@abpjs/theme-basic 0.7.6 → 0.9.0

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
- export * from './ChangePassword';
1
+ /**
2
+ * @deprecated Since v0.9.0, ChangePassword has moved to @abpjs/theme-shared.
3
+ * Import from '@abpjs/theme-shared' instead.
4
+ * This re-export is provided for backward compatibility.
5
+ */
6
+ export { ChangePassword, type ChangePasswordProps } from '@abpjs/theme-shared';
@@ -1 +1,6 @@
1
- export * from './Profile';
1
+ /**
2
+ * @deprecated Since v0.9.0, Profile has moved to @abpjs/theme-shared.
3
+ * Import from '@abpjs/theme-shared' instead.
4
+ * This re-export is provided for backward compatibility.
5
+ */
6
+ export { Profile, type ProfileProps } from '@abpjs/theme-shared';
package/dist/index.d.ts CHANGED
@@ -2,9 +2,12 @@
2
2
  * @abpjs/theme-basic
3
3
  *
4
4
  * ABP Framework Theme Basic components for React.
5
- * Translated from @abp/ng.theme.basic v0.7.6
5
+ * Translated from @abp/ng.theme.basic v0.9.0
6
6
  *
7
7
  * This package provides the basic theme layout components for ABP React applications.
8
+ *
9
+ * Note: In v0.9.0, ChangePassword and Profile components moved to @abpjs/theme-shared.
10
+ * They are re-exported from this package for backward compatibility but are deprecated.
8
11
  */
9
12
  export * from './models';
10
13
  export { LayoutProvider, useLayoutContext, useLayoutService, useNavigationElements, BrandingProvider, useBranding, useLogo, } from './contexts';
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  Block: () => Block,
24
24
  BrandingProvider: () => BrandingProvider,
25
- ChangePassword: () => ChangePassword,
25
+ ChangePassword: () => import_theme_shared.ChangePassword,
26
26
  DefaultLogo: () => DefaultLogo,
27
27
  LAYOUTS: () => LAYOUTS,
28
28
  LanguageSelector: () => LanguageSelector,
@@ -36,7 +36,7 @@ __export(index_exports, {
36
36
  LogoText: () => LogoText,
37
37
  NavLinks: () => NavLinks,
38
38
  Navbar: () => Navbar,
39
- Profile: () => Profile,
39
+ Profile: () => import_theme_shared2.Profile,
40
40
  SIDEBAR_Z_INDEX: () => SIDEBAR_Z_INDEX,
41
41
  SearchField: () => SearchField,
42
42
  SearchProvider: () => SearchProvider,
@@ -258,10 +258,10 @@ function LayoutBase({
258
258
  }
259
259
 
260
260
  // src/components/layout-application/LayoutApplication.tsx
261
- var import_react20 = require("react");
262
- var import_react21 = require("@chakra-ui/react");
261
+ var import_react16 = require("react");
262
+ var import_react17 = require("@chakra-ui/react");
263
263
  var import_react_router_dom6 = require("react-router-dom");
264
- var import_core8 = require("@abpjs/core");
264
+ var import_core6 = require("@abpjs/core");
265
265
 
266
266
  // src/components/blocks/sidebars/sidebar-with-collapsible/sidebar.tsx
267
267
  var import_react14 = require("@chakra-ui/react");
@@ -377,7 +377,7 @@ var SearchField = () => {
377
377
  import_react7.InputGroup,
378
378
  {
379
379
  flex: "1",
380
- startElement: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react7.Icon, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lu.LuSearch, {}) }),
380
+ startElement: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lu.LuSearch, {}),
381
381
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
382
382
  import_react7.Input,
383
383
  {
@@ -563,7 +563,7 @@ var CollapsibleNavLink = ({ route }) => {
563
563
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react10.HStack, { gap: "2", children: [
564
564
  route.badge !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react10.Badge, { size: "sm", colorPalette: route.badgeColorPalette || "gray", variant: "solid", children: route.badge }),
565
565
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react10.Collapsible.Context, { children: (context) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
566
- import_react10.Icon,
566
+ import_react10.chakra.span,
567
567
  {
568
568
  "aria-hidden": true,
569
569
  transition: "transform 0.2s",
@@ -767,342 +767,14 @@ var Block = () => {
767
767
  ] });
768
768
  };
769
769
 
770
- // src/components/change-password/ChangePassword.tsx
771
- var import_react16 = require("react");
772
- var import_react17 = require("@chakra-ui/react");
773
- var import_react_hook_form = require("react-hook-form");
774
- var import_core6 = require("@abpjs/core");
770
+ // src/components/change-password/index.ts
775
771
  var import_theme_shared = require("@abpjs/theme-shared");
776
- var import_lucide_react2 = require("lucide-react");
777
- var import_jsx_runtime14 = require("react/jsx-runtime");
778
- function ChangePassword({
779
- visible,
780
- onVisibleChange
781
- }) {
782
- const { t } = (0, import_core6.useLocalization)();
783
- const { changePassword } = (0, import_core6.useProfile)();
784
- const toaster = (0, import_theme_shared.useToaster)();
785
- const {
786
- register,
787
- handleSubmit,
788
- watch,
789
- reset,
790
- formState: { errors, isSubmitting }
791
- } = (0, import_react_hook_form.useForm)({
792
- defaultValues: {
793
- password: "",
794
- newPassword: "",
795
- repeatNewPassword: ""
796
- }
797
- });
798
- const newPassword = watch("newPassword");
799
- (0, import_react16.useEffect)(() => {
800
- if (visible) {
801
- reset();
802
- }
803
- }, [visible, reset]);
804
- const onSubmit = async (data) => {
805
- try {
806
- await changePassword({
807
- currentPassword: data.password,
808
- newPassword: data.newPassword
809
- });
810
- toaster.success(
811
- t("AbpIdentity::PasswordChangedMessage") || "Password changed successfully",
812
- t("AbpUi::Success") || "Success"
813
- );
814
- onVisibleChange(false);
815
- } catch (error) {
816
- toaster.error(
817
- error instanceof Error ? error.message : "An error occurred",
818
- t("AbpIdentity::PasswordChangeFailed") || "Failed to change password"
819
- );
820
- }
821
- };
822
- const handleClose = () => {
823
- onVisibleChange(false);
824
- };
825
- const passwordValidation = {
826
- required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required",
827
- minLength: {
828
- value: 6,
829
- message: t("AbpIdentity::PasswordTooShort") || "Password must be at least 6 characters"
830
- },
831
- validate: {
832
- hasLowercase: (value) => /[a-z]/.test(value) || t("AbpIdentity::PasswordRequiresLower") || "Password must contain a lowercase letter",
833
- hasUppercase: (value) => /[A-Z]/.test(value) || t("AbpIdentity::PasswordRequiresUpper") || "Password must contain an uppercase letter",
834
- hasNumber: (value) => /[0-9]/.test(value) || t("AbpIdentity::PasswordRequiresDigit") || "Password must contain a number",
835
- hasSpecial: (value) => /[!@#$%^&*(),.?":{}|<>]/.test(value) || t("AbpIdentity::PasswordRequiresNonAlphanumeric") || "Password must contain a special character"
836
- }
837
- };
838
- const modalFooter = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
839
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Button, { variant: "ghost", mr: 3, onClick: handleClose, children: t("AbpIdentity::Cancel") || "Cancel" }),
840
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
841
- import_react17.Button,
842
- {
843
- colorPalette: "blue",
844
- type: "submit",
845
- loading: isSubmitting,
846
- form: "change-password-form",
847
- children: [
848
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react2.Check, { size: 16 }),
849
- t("AbpIdentity::Save") || "Save"
850
- ]
851
- }
852
- )
853
- ] });
854
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
855
- import_theme_shared.Modal,
856
- {
857
- visible,
858
- onVisibleChange,
859
- header: t("AbpIdentity::ChangePassword") || "Change Password",
860
- footer: modalFooter,
861
- centered: true,
862
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("form", { id: "change-password-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.VStack, { gap: 4, children: [
863
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.Field.Root, { invalid: !!errors.password, children: [
864
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.Field.Label, { children: [
865
- t("AbpIdentity::DisplayName:CurrentPassword") || "Current Password",
866
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Field.RequiredIndicator, {})
867
- ] }),
868
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
869
- import_react17.Input,
870
- {
871
- type: "password",
872
- ...register("password", {
873
- required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required"
874
- })
875
- }
876
- ),
877
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Field.ErrorText, { children: errors.password?.message })
878
- ] }),
879
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.Field.Root, { invalid: !!errors.newPassword, children: [
880
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.Field.Label, { children: [
881
- t("AbpIdentity::DisplayName:NewPassword") || "New Password",
882
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Field.RequiredIndicator, {})
883
- ] }),
884
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
885
- import_react17.Input,
886
- {
887
- type: "password",
888
- ...register("newPassword", passwordValidation)
889
- }
890
- ),
891
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Field.ErrorText, { children: errors.newPassword?.message })
892
- ] }),
893
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.Field.Root, { invalid: !!errors.repeatNewPassword, children: [
894
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.Field.Label, { children: [
895
- t("AbpIdentity::DisplayName:NewPasswordConfirm") || "Confirm New Password",
896
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Field.RequiredIndicator, {})
897
- ] }),
898
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
899
- import_react17.Input,
900
- {
901
- type: "password",
902
- ...register("repeatNewPassword", {
903
- required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required",
904
- validate: (value) => value === newPassword || t("AbpIdentity::Identity.PasswordConfirmationFailed") || "Passwords do not match"
905
- })
906
- }
907
- ),
908
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Field.ErrorText, { children: errors.repeatNewPassword?.message })
909
- ] })
910
- ] }) })
911
- }
912
- );
913
- }
914
772
 
915
- // src/components/profile/Profile.tsx
916
- var import_react18 = require("react");
917
- var import_react19 = require("@chakra-ui/react");
918
- var import_react_hook_form2 = require("react-hook-form");
919
- var import_core7 = require("@abpjs/core");
773
+ // src/components/profile/index.ts
920
774
  var import_theme_shared2 = require("@abpjs/theme-shared");
921
- var import_lucide_react3 = require("lucide-react");
922
- var import_jsx_runtime15 = require("react/jsx-runtime");
923
- function Profile({
924
- visible,
925
- onVisibleChange
926
- }) {
927
- const { t } = (0, import_core7.useLocalization)();
928
- const { profile, fetchProfile, updateProfile, loading } = (0, import_core7.useProfile)();
929
- const toaster = (0, import_theme_shared2.useToaster)();
930
- const {
931
- register,
932
- handleSubmit,
933
- reset,
934
- formState: { errors, isSubmitting }
935
- } = (0, import_react_hook_form2.useForm)({
936
- defaultValues: {
937
- userName: "",
938
- email: "",
939
- name: "",
940
- surname: "",
941
- phoneNumber: ""
942
- }
943
- });
944
- (0, import_react18.useEffect)(() => {
945
- if (visible) {
946
- fetchProfile().then(() => {
947
- });
948
- }
949
- }, [visible, fetchProfile]);
950
- (0, import_react18.useEffect)(() => {
951
- if (profile) {
952
- reset({
953
- userName: profile.userName || "",
954
- email: profile.email || "",
955
- name: profile.name || "",
956
- surname: profile.surname || "",
957
- phoneNumber: profile.phoneNumber || ""
958
- });
959
- }
960
- }, [profile, reset]);
961
- const onSubmit = async (data) => {
962
- try {
963
- await updateProfile(data);
964
- toaster.success(
965
- t("AbpIdentity::ProfileUpdatedMessage") || "Profile updated successfully",
966
- t("AbpUi::Success") || "Success"
967
- );
968
- onVisibleChange(false);
969
- } catch (error) {
970
- toaster.error(
971
- error instanceof Error ? error.message : "An error occurred",
972
- t("AbpIdentity::ProfileUpdateFailed") || "Failed to update profile"
973
- );
974
- }
975
- };
976
- const handleClose = () => {
977
- onVisibleChange(false);
978
- };
979
- const modalFooter = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
980
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Button, { variant: "ghost", mr: 3, onClick: handleClose, children: t("AbpIdentity::Cancel") || "Cancel" }),
981
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
982
- import_react19.Button,
983
- {
984
- colorPalette: "blue",
985
- type: "submit",
986
- loading: isSubmitting || loading,
987
- form: "profile-form",
988
- children: [
989
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react3.Check, { size: 16 }),
990
- t("AbpIdentity::Save") || "Save"
991
- ]
992
- }
993
- )
994
- ] });
995
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
996
- import_theme_shared2.Modal,
997
- {
998
- visible,
999
- onVisibleChange,
1000
- header: t("AbpIdentity::PersonalInfo") || "Personal Info",
1001
- footer: modalFooter,
1002
- size: "lg",
1003
- centered: true,
1004
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("form", { id: "profile-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.VStack, { gap: 4, children: [
1005
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Root, { invalid: !!errors.userName, children: [
1006
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Label, { children: [
1007
- t("AbpIdentity::DisplayName:UserName") || "Username",
1008
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.RequiredIndicator, {})
1009
- ] }),
1010
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1011
- import_react19.Input,
1012
- {
1013
- type: "text",
1014
- ...register("userName", {
1015
- required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required",
1016
- maxLength: {
1017
- value: 256,
1018
- message: "Maximum 256 characters"
1019
- }
1020
- })
1021
- }
1022
- ),
1023
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.ErrorText, { children: errors.userName?.message })
1024
- ] }),
1025
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.HStack, { gap: 4, w: "full", children: [
1026
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Root, { invalid: !!errors.name, flex: 1, children: [
1027
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.Label, { children: t("AbpIdentity::DisplayName:Name") || "Name" }),
1028
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1029
- import_react19.Input,
1030
- {
1031
- type: "text",
1032
- ...register("name", {
1033
- maxLength: {
1034
- value: 64,
1035
- message: "Maximum 64 characters"
1036
- }
1037
- })
1038
- }
1039
- ),
1040
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.ErrorText, { children: errors.name?.message })
1041
- ] }),
1042
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Root, { invalid: !!errors.surname, flex: 1, children: [
1043
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.Label, { children: t("AbpIdentity::DisplayName:Surname") || "Surname" }),
1044
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1045
- import_react19.Input,
1046
- {
1047
- type: "text",
1048
- ...register("surname", {
1049
- maxLength: {
1050
- value: 64,
1051
- message: "Maximum 64 characters"
1052
- }
1053
- })
1054
- }
1055
- ),
1056
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.ErrorText, { children: errors.surname?.message })
1057
- ] })
1058
- ] }),
1059
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Root, { invalid: !!errors.email, children: [
1060
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Label, { children: [
1061
- t("AbpIdentity::DisplayName:EmailAddress") || "Email Address",
1062
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.RequiredIndicator, {})
1063
- ] }),
1064
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1065
- import_react19.Input,
1066
- {
1067
- type: "email",
1068
- ...register("email", {
1069
- required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required",
1070
- pattern: {
1071
- value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
1072
- message: t("AbpIdentity::InvalidEmail") || "Invalid email address"
1073
- },
1074
- maxLength: {
1075
- value: 256,
1076
- message: "Maximum 256 characters"
1077
- }
1078
- })
1079
- }
1080
- ),
1081
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.ErrorText, { children: errors.email?.message })
1082
- ] }),
1083
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Root, { invalid: !!errors.phoneNumber, children: [
1084
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.Label, { children: t("AbpIdentity::DisplayName:PhoneNumber") || "Phone Number" }),
1085
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1086
- import_react19.Input,
1087
- {
1088
- type: "tel",
1089
- ...register("phoneNumber", {
1090
- maxLength: {
1091
- value: 16,
1092
- message: "Maximum 16 characters"
1093
- }
1094
- })
1095
- }
1096
- ),
1097
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.ErrorText, { children: errors.phoneNumber?.message })
1098
- ] })
1099
- ] }) })
1100
- }
1101
- );
1102
- }
1103
775
 
1104
776
  // src/components/layout-application/LayoutApplication.tsx
1105
- var import_jsx_runtime16 = require("react/jsx-runtime");
777
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1106
778
  var SIDEBAR_Z_INDEX = 1100;
1107
779
  function LayoutApplication({
1108
780
  showLanguageSelector = true,
@@ -1118,18 +790,18 @@ function LayoutApplication({
1118
790
  children
1119
791
  }) {
1120
792
  const navigate = (0, import_react_router_dom6.useNavigate)();
1121
- const { logout } = (0, import_core8.useAuth)();
1122
- const { direction, isRtl } = (0, import_core8.useDirection)();
1123
- const [isChangePasswordOpen, setIsChangePasswordOpen] = (0, import_react20.useState)(false);
1124
- const [isProfileOpen, setIsProfileOpen] = (0, import_react20.useState)(false);
1125
- const handleLogout = (0, import_react20.useCallback)(() => {
793
+ const { logout } = (0, import_core6.useAuth)();
794
+ const { direction, isRtl } = (0, import_core6.useDirection)();
795
+ const [isChangePasswordOpen, setIsChangePasswordOpen] = (0, import_react16.useState)(false);
796
+ const [isProfileOpen, setIsProfileOpen] = (0, import_react16.useState)(false);
797
+ const handleLogout = (0, import_react16.useCallback)(() => {
1126
798
  logout();
1127
799
  navigate("/account/login");
1128
800
  }, [logout, navigate]);
1129
- const handleChangePassword = (0, import_react20.useCallback)(() => {
801
+ const handleChangePassword = (0, import_react16.useCallback)(() => {
1130
802
  setIsChangePasswordOpen(true);
1131
803
  }, []);
1132
- const handleProfile = (0, import_react20.useCallback)(() => {
804
+ const handleProfile = (0, import_react16.useCallback)(() => {
1133
805
  setIsProfileOpen(true);
1134
806
  }, []);
1135
807
  const sidebarProps = {
@@ -1148,10 +820,10 @@ function LayoutApplication({
1148
820
  onLogout: handleLogout
1149
821
  } : void 0
1150
822
  };
1151
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
1152
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react21.Flex, { minH: "100vh", dir: direction, children: [
1153
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1154
- import_react21.Box,
823
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
824
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.Flex, { minH: "100vh", dir: direction, children: [
825
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
826
+ import_react17.Box,
1155
827
  {
1156
828
  position: "fixed",
1157
829
  top: 0,
@@ -1160,11 +832,11 @@ function LayoutApplication({
1160
832
  insetInline: 0,
1161
833
  zIndex: SIDEBAR_Z_INDEX,
1162
834
  hideFrom: "md",
1163
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Navbar, { sidebarProps })
835
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Navbar, { sidebarProps })
1164
836
  }
1165
837
  ),
1166
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1167
- import_react21.Box,
838
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
839
+ import_react17.Box,
1168
840
  {
1169
841
  as: "aside",
1170
842
  position: "fixed",
@@ -1174,11 +846,11 @@ function LayoutApplication({
1174
846
  bottom: 0,
1175
847
  hideBelow: "md",
1176
848
  zIndex: SIDEBAR_Z_INDEX,
1177
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Sidebar, { h: "100vh", ...sidebarProps })
849
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Sidebar, { h: "100vh", ...sidebarProps })
1178
850
  }
1179
851
  ),
1180
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1181
- import_react21.Box,
852
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
853
+ import_react17.Box,
1182
854
  {
1183
855
  as: "main",
1184
856
  flex: "1",
@@ -1187,27 +859,27 @@ function LayoutApplication({
1187
859
  mt: { base: "60px", md: 0 },
1188
860
  p: { base: 4, md: 6 },
1189
861
  minH: "100vh",
1190
- children: children || /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_router_dom6.Outlet, {})
862
+ children: children || /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_router_dom6.Outlet, {})
1191
863
  }
1192
864
  )
1193
865
  ] }),
1194
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1195
- ChangePassword,
866
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
867
+ import_theme_shared.ChangePassword,
1196
868
  {
1197
869
  visible: isChangePasswordOpen,
1198
870
  onVisibleChange: setIsChangePasswordOpen
1199
871
  }
1200
872
  ),
1201
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Profile, { visible: isProfileOpen, onVisibleChange: setIsProfileOpen })
873
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_theme_shared2.Profile, { visible: isProfileOpen, onVisibleChange: setIsProfileOpen })
1202
874
  ] });
1203
875
  }
1204
- LayoutApplication.type = import_core8.eLayoutType.application;
876
+ LayoutApplication.type = import_core6.eLayoutType.application;
1205
877
 
1206
878
  // src/components/layout-account/LayoutAccount.tsx
1207
- var import_react22 = require("@chakra-ui/react");
879
+ var import_react18 = require("@chakra-ui/react");
1208
880
  var import_react_router_dom7 = require("react-router-dom");
1209
- var import_core9 = require("@abpjs/core");
1210
- var import_jsx_runtime17 = require("react/jsx-runtime");
881
+ var import_core7 = require("@abpjs/core");
882
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1211
883
  function LayoutAccount({
1212
884
  showLanguageSelector = true,
1213
885
  showSearch = false,
@@ -1220,7 +892,7 @@ function LayoutAccount({
1220
892
  footerContent,
1221
893
  children
1222
894
  }) {
1223
- const { direction, isRtl } = (0, import_core9.useDirection)();
895
+ const { direction, isRtl } = (0, import_core7.useDirection)();
1224
896
  const sidebarProps = {
1225
897
  showSearch,
1226
898
  showLanguageSelector,
@@ -1234,9 +906,9 @@ function LayoutAccount({
1234
906
  userProfileProps: void 0
1235
907
  // No user profile on account pages
1236
908
  };
1237
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react22.Flex, { minH: "100vh", dir: direction, children: [
1238
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1239
- import_react22.Box,
909
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react18.Flex, { minH: "100vh", dir: direction, children: [
910
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
911
+ import_react18.Box,
1240
912
  {
1241
913
  position: "fixed",
1242
914
  top: 0,
@@ -1245,11 +917,11 @@ function LayoutAccount({
1245
917
  insetInline: 0,
1246
918
  zIndex: SIDEBAR_Z_INDEX,
1247
919
  hideFrom: "md",
1248
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Navbar, { sidebarProps })
920
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Navbar, { sidebarProps })
1249
921
  }
1250
922
  ),
1251
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1252
- import_react22.Box,
923
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
924
+ import_react18.Box,
1253
925
  {
1254
926
  as: "aside",
1255
927
  position: "fixed",
@@ -1259,11 +931,11 @@ function LayoutAccount({
1259
931
  bottom: 0,
1260
932
  hideBelow: "md",
1261
933
  zIndex: SIDEBAR_Z_INDEX,
1262
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Sidebar, { h: "100vh", ...sidebarProps })
934
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Sidebar, { h: "100vh", ...sidebarProps })
1263
935
  }
1264
936
  ),
1265
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1266
- import_react22.Box,
937
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
938
+ import_react18.Box,
1267
939
  {
1268
940
  as: "main",
1269
941
  flex: "1",
@@ -1272,36 +944,36 @@ function LayoutAccount({
1272
944
  mt: { base: "60px", md: 0 },
1273
945
  p: { base: 4, md: 6 },
1274
946
  minH: "100vh",
1275
- children: children || /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_router_dom7.Outlet, {})
947
+ children: children || /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_router_dom7.Outlet, {})
1276
948
  }
1277
949
  )
1278
950
  ] });
1279
951
  }
1280
- LayoutAccount.type = import_core9.eLayoutType.account;
952
+ LayoutAccount.type = import_core7.eLayoutType.account;
1281
953
 
1282
954
  // src/components/layout-empty/LayoutEmpty.tsx
1283
- var import_react23 = require("@chakra-ui/react");
955
+ var import_react19 = require("@chakra-ui/react");
1284
956
  var import_react_router_dom8 = require("react-router-dom");
1285
- var import_core10 = require("@abpjs/core");
1286
- var import_jsx_runtime18 = require("react/jsx-runtime");
957
+ var import_core8 = require("@abpjs/core");
958
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1287
959
  function LayoutEmpty({ children }) {
1288
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react23.Box, { minH: "100vh", children: children || /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_router_dom8.Outlet, {}) });
960
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react19.Box, { minH: "100vh", children: children || /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_router_dom8.Outlet, {}) });
1289
961
  }
1290
- LayoutEmpty.type = import_core10.eLayoutType.empty;
962
+ LayoutEmpty.type = import_core8.eLayoutType.empty;
1291
963
 
1292
964
  // src/providers/ThemeBasicProvider.tsx
1293
- var import_react24 = require("react");
965
+ var import_react20 = require("react");
1294
966
  var import_theme_shared3 = require("@abpjs/theme-shared");
1295
- var import_core11 = require("@abpjs/core");
1296
- var import_jsx_runtime19 = require("react/jsx-runtime");
967
+ var import_core9 = require("@abpjs/core");
968
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1297
969
  function LocaleSync({ children }) {
1298
- const { language } = (0, import_core11.useSession)();
1299
- const { direction } = (0, import_core11.useDirection)();
1300
- (0, import_react24.useEffect)(() => {
970
+ const { language } = (0, import_core9.useSession)();
971
+ const { direction } = (0, import_core9.useDirection)();
972
+ (0, import_react20.useEffect)(() => {
1301
973
  document.documentElement.dir = direction;
1302
974
  document.documentElement.lang = language || "en";
1303
975
  }, [direction, language]);
1304
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, { children });
976
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx_runtime17.Fragment, { children });
1305
977
  }
1306
978
  function ThemeBasicInner({
1307
979
  children,
@@ -1316,9 +988,9 @@ function ThemeBasicInner({
1316
988
  appName,
1317
989
  logoLink
1318
990
  }) {
1319
- const { language } = (0, import_core11.useSession)();
991
+ const { language } = (0, import_core9.useSession)();
1320
992
  const locale = language || "en-US";
1321
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
993
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1322
994
  import_theme_shared3.ThemeSharedProvider,
1323
995
  {
1324
996
  renderToasts,
@@ -1328,14 +1000,14 @@ function ThemeBasicInner({
1328
1000
  enableColorMode,
1329
1001
  defaultColorMode,
1330
1002
  locale,
1331
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LocaleSync, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1003
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LocaleSync, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1332
1004
  BrandingProvider,
1333
1005
  {
1334
1006
  logo,
1335
1007
  logoIcon,
1336
1008
  appName,
1337
1009
  logoLink,
1338
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LayoutProvider, { children })
1010
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LayoutProvider, { children })
1339
1011
  }
1340
1012
  ) })
1341
1013
  }
@@ -1409,7 +1081,7 @@ function ThemeBasicProvider({
1409
1081
  logoLink
1410
1082
  }) {
1411
1083
  const mergedThemeOverrides = themeOverrides || defaultThemeBasicConfig;
1412
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1084
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1413
1085
  ThemeBasicInner,
1414
1086
  {
1415
1087
  renderToasts,
package/dist/index.mjs CHANGED
@@ -296,7 +296,7 @@ var LogoIcon = (props) => /* @__PURE__ */ jsxs2("svg", { height: "24", viewBox:
296
296
  ] });
297
297
 
298
298
  // src/components/blocks/sidebars/sidebar-with-collapsible/search-field.tsx
299
- import { Icon, Input, InputGroup } from "@chakra-ui/react";
299
+ import { Input, InputGroup } from "@chakra-ui/react";
300
300
  import { LuSearch } from "react-icons/lu";
301
301
  import { useLocalization } from "@abpjs/core";
302
302
 
@@ -336,7 +336,7 @@ var SearchField = () => {
336
336
  InputGroup,
337
337
  {
338
338
  flex: "1",
339
- startElement: /* @__PURE__ */ jsx6(Icon, { size: "sm", children: /* @__PURE__ */ jsx6(LuSearch, {}) }),
339
+ startElement: /* @__PURE__ */ jsx6(LuSearch, {}),
340
340
  children: /* @__PURE__ */ jsx6(
341
341
  Input,
342
342
  {
@@ -441,7 +441,7 @@ var UserProfile = ({ onChangePassword, onProfile, onLogout, loginUrl = "/account
441
441
  };
442
442
 
443
443
  // src/components/blocks/sidebars/sidebar-with-collapsible/nav-links.tsx
444
- import { Badge as Badge2, Button as Button3, Collapsible as Collapsible2, HStack as HStack3, Icon as Icon2, Stack } from "@chakra-ui/react";
444
+ import { Badge as Badge2, Button as Button3, Collapsible as Collapsible2, HStack as HStack3, Stack, chakra } from "@chakra-ui/react";
445
445
  import { LuChevronDown } from "react-icons/lu";
446
446
  import { useConfig as useConfig2, useDirection as useDirection2 } from "@abpjs/core";
447
447
  import { useMemo as useMemo4, useState as useState4 } from "react";
@@ -522,7 +522,7 @@ var CollapsibleNavLink = ({ route }) => {
522
522
  /* @__PURE__ */ jsxs5(HStack3, { gap: "2", children: [
523
523
  route.badge !== void 0 && /* @__PURE__ */ jsx9(Badge2, { size: "sm", colorPalette: route.badgeColorPalette || "gray", variant: "solid", children: route.badge }),
524
524
  /* @__PURE__ */ jsx9(Collapsible2.Context, { children: (context) => /* @__PURE__ */ jsx9(
525
- Icon2,
525
+ chakra.span,
526
526
  {
527
527
  "aria-hidden": true,
528
528
  transition: "transform 0.2s",
@@ -726,353 +726,14 @@ var Block = () => {
726
726
  ] });
727
727
  };
728
728
 
729
- // src/components/change-password/ChangePassword.tsx
730
- import { useEffect } from "react";
731
- import {
732
- Button as Button5,
733
- VStack,
734
- Input as Input2,
735
- Field
736
- } from "@chakra-ui/react";
737
- import { useForm } from "react-hook-form";
738
- import { useLocalization as useLocalization3, useProfile } from "@abpjs/core";
739
- import { Modal, useToaster } from "@abpjs/theme-shared";
740
- import { Check } from "lucide-react";
741
- import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
742
- function ChangePassword({
743
- visible,
744
- onVisibleChange
745
- }) {
746
- const { t } = useLocalization3();
747
- const { changePassword } = useProfile();
748
- const toaster = useToaster();
749
- const {
750
- register,
751
- handleSubmit,
752
- watch,
753
- reset,
754
- formState: { errors, isSubmitting }
755
- } = useForm({
756
- defaultValues: {
757
- password: "",
758
- newPassword: "",
759
- repeatNewPassword: ""
760
- }
761
- });
762
- const newPassword = watch("newPassword");
763
- useEffect(() => {
764
- if (visible) {
765
- reset();
766
- }
767
- }, [visible, reset]);
768
- const onSubmit = async (data) => {
769
- try {
770
- await changePassword({
771
- currentPassword: data.password,
772
- newPassword: data.newPassword
773
- });
774
- toaster.success(
775
- t("AbpIdentity::PasswordChangedMessage") || "Password changed successfully",
776
- t("AbpUi::Success") || "Success"
777
- );
778
- onVisibleChange(false);
779
- } catch (error) {
780
- toaster.error(
781
- error instanceof Error ? error.message : "An error occurred",
782
- t("AbpIdentity::PasswordChangeFailed") || "Failed to change password"
783
- );
784
- }
785
- };
786
- const handleClose = () => {
787
- onVisibleChange(false);
788
- };
789
- const passwordValidation = {
790
- required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required",
791
- minLength: {
792
- value: 6,
793
- message: t("AbpIdentity::PasswordTooShort") || "Password must be at least 6 characters"
794
- },
795
- validate: {
796
- hasLowercase: (value) => /[a-z]/.test(value) || t("AbpIdentity::PasswordRequiresLower") || "Password must contain a lowercase letter",
797
- hasUppercase: (value) => /[A-Z]/.test(value) || t("AbpIdentity::PasswordRequiresUpper") || "Password must contain an uppercase letter",
798
- hasNumber: (value) => /[0-9]/.test(value) || t("AbpIdentity::PasswordRequiresDigit") || "Password must contain a number",
799
- hasSpecial: (value) => /[!@#$%^&*(),.?":{}|<>]/.test(value) || t("AbpIdentity::PasswordRequiresNonAlphanumeric") || "Password must contain a special character"
800
- }
801
- };
802
- const modalFooter = /* @__PURE__ */ jsxs10(Fragment3, { children: [
803
- /* @__PURE__ */ jsx14(Button5, { variant: "ghost", mr: 3, onClick: handleClose, children: t("AbpIdentity::Cancel") || "Cancel" }),
804
- /* @__PURE__ */ jsxs10(
805
- Button5,
806
- {
807
- colorPalette: "blue",
808
- type: "submit",
809
- loading: isSubmitting,
810
- form: "change-password-form",
811
- children: [
812
- /* @__PURE__ */ jsx14(Check, { size: 16 }),
813
- t("AbpIdentity::Save") || "Save"
814
- ]
815
- }
816
- )
817
- ] });
818
- return /* @__PURE__ */ jsx14(
819
- Modal,
820
- {
821
- visible,
822
- onVisibleChange,
823
- header: t("AbpIdentity::ChangePassword") || "Change Password",
824
- footer: modalFooter,
825
- centered: true,
826
- children: /* @__PURE__ */ jsx14("form", { id: "change-password-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ jsxs10(VStack, { gap: 4, children: [
827
- /* @__PURE__ */ jsxs10(Field.Root, { invalid: !!errors.password, children: [
828
- /* @__PURE__ */ jsxs10(Field.Label, { children: [
829
- t("AbpIdentity::DisplayName:CurrentPassword") || "Current Password",
830
- /* @__PURE__ */ jsx14(Field.RequiredIndicator, {})
831
- ] }),
832
- /* @__PURE__ */ jsx14(
833
- Input2,
834
- {
835
- type: "password",
836
- ...register("password", {
837
- required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required"
838
- })
839
- }
840
- ),
841
- /* @__PURE__ */ jsx14(Field.ErrorText, { children: errors.password?.message })
842
- ] }),
843
- /* @__PURE__ */ jsxs10(Field.Root, { invalid: !!errors.newPassword, children: [
844
- /* @__PURE__ */ jsxs10(Field.Label, { children: [
845
- t("AbpIdentity::DisplayName:NewPassword") || "New Password",
846
- /* @__PURE__ */ jsx14(Field.RequiredIndicator, {})
847
- ] }),
848
- /* @__PURE__ */ jsx14(
849
- Input2,
850
- {
851
- type: "password",
852
- ...register("newPassword", passwordValidation)
853
- }
854
- ),
855
- /* @__PURE__ */ jsx14(Field.ErrorText, { children: errors.newPassword?.message })
856
- ] }),
857
- /* @__PURE__ */ jsxs10(Field.Root, { invalid: !!errors.repeatNewPassword, children: [
858
- /* @__PURE__ */ jsxs10(Field.Label, { children: [
859
- t("AbpIdentity::DisplayName:NewPasswordConfirm") || "Confirm New Password",
860
- /* @__PURE__ */ jsx14(Field.RequiredIndicator, {})
861
- ] }),
862
- /* @__PURE__ */ jsx14(
863
- Input2,
864
- {
865
- type: "password",
866
- ...register("repeatNewPassword", {
867
- required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required",
868
- validate: (value) => value === newPassword || t("AbpIdentity::Identity.PasswordConfirmationFailed") || "Passwords do not match"
869
- })
870
- }
871
- ),
872
- /* @__PURE__ */ jsx14(Field.ErrorText, { children: errors.repeatNewPassword?.message })
873
- ] })
874
- ] }) })
875
- }
876
- );
877
- }
729
+ // src/components/change-password/index.ts
730
+ import { ChangePassword } from "@abpjs/theme-shared";
878
731
 
879
- // src/components/profile/Profile.tsx
880
- import { useEffect as useEffect2 } from "react";
881
- import {
882
- Button as Button6,
883
- VStack as VStack2,
884
- HStack as HStack6,
885
- Input as Input3,
886
- Field as Field2
887
- } from "@chakra-ui/react";
888
- import { useForm as useForm2 } from "react-hook-form";
889
- import { useLocalization as useLocalization4, useProfile as useProfile2 } from "@abpjs/core";
890
- import { Modal as Modal2, useToaster as useToaster2 } from "@abpjs/theme-shared";
891
- import { Check as Check2 } from "lucide-react";
892
- import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
893
- function Profile({
894
- visible,
895
- onVisibleChange
896
- }) {
897
- const { t } = useLocalization4();
898
- const { profile, fetchProfile, updateProfile, loading } = useProfile2();
899
- const toaster = useToaster2();
900
- const {
901
- register,
902
- handleSubmit,
903
- reset,
904
- formState: { errors, isSubmitting }
905
- } = useForm2({
906
- defaultValues: {
907
- userName: "",
908
- email: "",
909
- name: "",
910
- surname: "",
911
- phoneNumber: ""
912
- }
913
- });
914
- useEffect2(() => {
915
- if (visible) {
916
- fetchProfile().then(() => {
917
- });
918
- }
919
- }, [visible, fetchProfile]);
920
- useEffect2(() => {
921
- if (profile) {
922
- reset({
923
- userName: profile.userName || "",
924
- email: profile.email || "",
925
- name: profile.name || "",
926
- surname: profile.surname || "",
927
- phoneNumber: profile.phoneNumber || ""
928
- });
929
- }
930
- }, [profile, reset]);
931
- const onSubmit = async (data) => {
932
- try {
933
- await updateProfile(data);
934
- toaster.success(
935
- t("AbpIdentity::ProfileUpdatedMessage") || "Profile updated successfully",
936
- t("AbpUi::Success") || "Success"
937
- );
938
- onVisibleChange(false);
939
- } catch (error) {
940
- toaster.error(
941
- error instanceof Error ? error.message : "An error occurred",
942
- t("AbpIdentity::ProfileUpdateFailed") || "Failed to update profile"
943
- );
944
- }
945
- };
946
- const handleClose = () => {
947
- onVisibleChange(false);
948
- };
949
- const modalFooter = /* @__PURE__ */ jsxs11(Fragment4, { children: [
950
- /* @__PURE__ */ jsx15(Button6, { variant: "ghost", mr: 3, onClick: handleClose, children: t("AbpIdentity::Cancel") || "Cancel" }),
951
- /* @__PURE__ */ jsxs11(
952
- Button6,
953
- {
954
- colorPalette: "blue",
955
- type: "submit",
956
- loading: isSubmitting || loading,
957
- form: "profile-form",
958
- children: [
959
- /* @__PURE__ */ jsx15(Check2, { size: 16 }),
960
- t("AbpIdentity::Save") || "Save"
961
- ]
962
- }
963
- )
964
- ] });
965
- return /* @__PURE__ */ jsx15(
966
- Modal2,
967
- {
968
- visible,
969
- onVisibleChange,
970
- header: t("AbpIdentity::PersonalInfo") || "Personal Info",
971
- footer: modalFooter,
972
- size: "lg",
973
- centered: true,
974
- children: /* @__PURE__ */ jsx15("form", { id: "profile-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ jsxs11(VStack2, { gap: 4, children: [
975
- /* @__PURE__ */ jsxs11(Field2.Root, { invalid: !!errors.userName, children: [
976
- /* @__PURE__ */ jsxs11(Field2.Label, { children: [
977
- t("AbpIdentity::DisplayName:UserName") || "Username",
978
- /* @__PURE__ */ jsx15(Field2.RequiredIndicator, {})
979
- ] }),
980
- /* @__PURE__ */ jsx15(
981
- Input3,
982
- {
983
- type: "text",
984
- ...register("userName", {
985
- required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required",
986
- maxLength: {
987
- value: 256,
988
- message: "Maximum 256 characters"
989
- }
990
- })
991
- }
992
- ),
993
- /* @__PURE__ */ jsx15(Field2.ErrorText, { children: errors.userName?.message })
994
- ] }),
995
- /* @__PURE__ */ jsxs11(HStack6, { gap: 4, w: "full", children: [
996
- /* @__PURE__ */ jsxs11(Field2.Root, { invalid: !!errors.name, flex: 1, children: [
997
- /* @__PURE__ */ jsx15(Field2.Label, { children: t("AbpIdentity::DisplayName:Name") || "Name" }),
998
- /* @__PURE__ */ jsx15(
999
- Input3,
1000
- {
1001
- type: "text",
1002
- ...register("name", {
1003
- maxLength: {
1004
- value: 64,
1005
- message: "Maximum 64 characters"
1006
- }
1007
- })
1008
- }
1009
- ),
1010
- /* @__PURE__ */ jsx15(Field2.ErrorText, { children: errors.name?.message })
1011
- ] }),
1012
- /* @__PURE__ */ jsxs11(Field2.Root, { invalid: !!errors.surname, flex: 1, children: [
1013
- /* @__PURE__ */ jsx15(Field2.Label, { children: t("AbpIdentity::DisplayName:Surname") || "Surname" }),
1014
- /* @__PURE__ */ jsx15(
1015
- Input3,
1016
- {
1017
- type: "text",
1018
- ...register("surname", {
1019
- maxLength: {
1020
- value: 64,
1021
- message: "Maximum 64 characters"
1022
- }
1023
- })
1024
- }
1025
- ),
1026
- /* @__PURE__ */ jsx15(Field2.ErrorText, { children: errors.surname?.message })
1027
- ] })
1028
- ] }),
1029
- /* @__PURE__ */ jsxs11(Field2.Root, { invalid: !!errors.email, children: [
1030
- /* @__PURE__ */ jsxs11(Field2.Label, { children: [
1031
- t("AbpIdentity::DisplayName:EmailAddress") || "Email Address",
1032
- /* @__PURE__ */ jsx15(Field2.RequiredIndicator, {})
1033
- ] }),
1034
- /* @__PURE__ */ jsx15(
1035
- Input3,
1036
- {
1037
- type: "email",
1038
- ...register("email", {
1039
- required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required",
1040
- pattern: {
1041
- value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
1042
- message: t("AbpIdentity::InvalidEmail") || "Invalid email address"
1043
- },
1044
- maxLength: {
1045
- value: 256,
1046
- message: "Maximum 256 characters"
1047
- }
1048
- })
1049
- }
1050
- ),
1051
- /* @__PURE__ */ jsx15(Field2.ErrorText, { children: errors.email?.message })
1052
- ] }),
1053
- /* @__PURE__ */ jsxs11(Field2.Root, { invalid: !!errors.phoneNumber, children: [
1054
- /* @__PURE__ */ jsx15(Field2.Label, { children: t("AbpIdentity::DisplayName:PhoneNumber") || "Phone Number" }),
1055
- /* @__PURE__ */ jsx15(
1056
- Input3,
1057
- {
1058
- type: "tel",
1059
- ...register("phoneNumber", {
1060
- maxLength: {
1061
- value: 16,
1062
- message: "Maximum 16 characters"
1063
- }
1064
- })
1065
- }
1066
- ),
1067
- /* @__PURE__ */ jsx15(Field2.ErrorText, { children: errors.phoneNumber?.message })
1068
- ] })
1069
- ] }) })
1070
- }
1071
- );
1072
- }
732
+ // src/components/profile/index.ts
733
+ import { Profile } from "@abpjs/theme-shared";
1073
734
 
1074
735
  // src/components/layout-application/LayoutApplication.tsx
1075
- import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
736
+ import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
1076
737
  var SIDEBAR_Z_INDEX = 1100;
1077
738
  function LayoutApplication({
1078
739
  showLanguageSelector = true,
@@ -1118,9 +779,9 @@ function LayoutApplication({
1118
779
  onLogout: handleLogout
1119
780
  } : void 0
1120
781
  };
1121
- return /* @__PURE__ */ jsxs12(Fragment5, { children: [
1122
- /* @__PURE__ */ jsxs12(Flex2, { minH: "100vh", dir: direction, children: [
1123
- /* @__PURE__ */ jsx16(
782
+ return /* @__PURE__ */ jsxs10(Fragment3, { children: [
783
+ /* @__PURE__ */ jsxs10(Flex2, { minH: "100vh", dir: direction, children: [
784
+ /* @__PURE__ */ jsx14(
1124
785
  Box5,
1125
786
  {
1126
787
  position: "fixed",
@@ -1130,10 +791,10 @@ function LayoutApplication({
1130
791
  insetInline: 0,
1131
792
  zIndex: SIDEBAR_Z_INDEX,
1132
793
  hideFrom: "md",
1133
- children: /* @__PURE__ */ jsx16(Navbar, { sidebarProps })
794
+ children: /* @__PURE__ */ jsx14(Navbar, { sidebarProps })
1134
795
  }
1135
796
  ),
1136
- /* @__PURE__ */ jsx16(
797
+ /* @__PURE__ */ jsx14(
1137
798
  Box5,
1138
799
  {
1139
800
  as: "aside",
@@ -1144,10 +805,10 @@ function LayoutApplication({
1144
805
  bottom: 0,
1145
806
  hideBelow: "md",
1146
807
  zIndex: SIDEBAR_Z_INDEX,
1147
- children: /* @__PURE__ */ jsx16(Sidebar, { h: "100vh", ...sidebarProps })
808
+ children: /* @__PURE__ */ jsx14(Sidebar, { h: "100vh", ...sidebarProps })
1148
809
  }
1149
810
  ),
1150
- /* @__PURE__ */ jsx16(
811
+ /* @__PURE__ */ jsx14(
1151
812
  Box5,
1152
813
  {
1153
814
  as: "main",
@@ -1157,18 +818,18 @@ function LayoutApplication({
1157
818
  mt: { base: "60px", md: 0 },
1158
819
  p: { base: 4, md: 6 },
1159
820
  minH: "100vh",
1160
- children: children || /* @__PURE__ */ jsx16(Outlet2, {})
821
+ children: children || /* @__PURE__ */ jsx14(Outlet2, {})
1161
822
  }
1162
823
  )
1163
824
  ] }),
1164
- /* @__PURE__ */ jsx16(
825
+ /* @__PURE__ */ jsx14(
1165
826
  ChangePassword,
1166
827
  {
1167
828
  visible: isChangePasswordOpen,
1168
829
  onVisibleChange: setIsChangePasswordOpen
1169
830
  }
1170
831
  ),
1171
- /* @__PURE__ */ jsx16(Profile, { visible: isProfileOpen, onVisibleChange: setIsProfileOpen })
832
+ /* @__PURE__ */ jsx14(Profile, { visible: isProfileOpen, onVisibleChange: setIsProfileOpen })
1172
833
  ] });
1173
834
  }
1174
835
  LayoutApplication.type = eLayoutType.application;
@@ -1177,7 +838,7 @@ LayoutApplication.type = eLayoutType.application;
1177
838
  import { Box as Box6, Flex as Flex3 } from "@chakra-ui/react";
1178
839
  import { Outlet as Outlet3 } from "react-router-dom";
1179
840
  import { eLayoutType as eLayoutType2, useDirection as useDirection5 } from "@abpjs/core";
1180
- import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
841
+ import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
1181
842
  function LayoutAccount({
1182
843
  showLanguageSelector = true,
1183
844
  showSearch = false,
@@ -1204,8 +865,8 @@ function LayoutAccount({
1204
865
  userProfileProps: void 0
1205
866
  // No user profile on account pages
1206
867
  };
1207
- return /* @__PURE__ */ jsxs13(Flex3, { minH: "100vh", dir: direction, children: [
1208
- /* @__PURE__ */ jsx17(
868
+ return /* @__PURE__ */ jsxs11(Flex3, { minH: "100vh", dir: direction, children: [
869
+ /* @__PURE__ */ jsx15(
1209
870
  Box6,
1210
871
  {
1211
872
  position: "fixed",
@@ -1215,10 +876,10 @@ function LayoutAccount({
1215
876
  insetInline: 0,
1216
877
  zIndex: SIDEBAR_Z_INDEX,
1217
878
  hideFrom: "md",
1218
- children: /* @__PURE__ */ jsx17(Navbar, { sidebarProps })
879
+ children: /* @__PURE__ */ jsx15(Navbar, { sidebarProps })
1219
880
  }
1220
881
  ),
1221
- /* @__PURE__ */ jsx17(
882
+ /* @__PURE__ */ jsx15(
1222
883
  Box6,
1223
884
  {
1224
885
  as: "aside",
@@ -1229,10 +890,10 @@ function LayoutAccount({
1229
890
  bottom: 0,
1230
891
  hideBelow: "md",
1231
892
  zIndex: SIDEBAR_Z_INDEX,
1232
- children: /* @__PURE__ */ jsx17(Sidebar, { h: "100vh", ...sidebarProps })
893
+ children: /* @__PURE__ */ jsx15(Sidebar, { h: "100vh", ...sidebarProps })
1233
894
  }
1234
895
  ),
1235
- /* @__PURE__ */ jsx17(
896
+ /* @__PURE__ */ jsx15(
1236
897
  Box6,
1237
898
  {
1238
899
  as: "main",
@@ -1242,7 +903,7 @@ function LayoutAccount({
1242
903
  mt: { base: "60px", md: 0 },
1243
904
  p: { base: 4, md: 6 },
1244
905
  minH: "100vh",
1245
- children: children || /* @__PURE__ */ jsx17(Outlet3, {})
906
+ children: children || /* @__PURE__ */ jsx15(Outlet3, {})
1246
907
  }
1247
908
  )
1248
909
  ] });
@@ -1253,25 +914,25 @@ LayoutAccount.type = eLayoutType2.account;
1253
914
  import { Box as Box7 } from "@chakra-ui/react";
1254
915
  import { Outlet as Outlet4 } from "react-router-dom";
1255
916
  import { eLayoutType as eLayoutType3 } from "@abpjs/core";
1256
- import { jsx as jsx18 } from "react/jsx-runtime";
917
+ import { jsx as jsx16 } from "react/jsx-runtime";
1257
918
  function LayoutEmpty({ children }) {
1258
- return /* @__PURE__ */ jsx18(Box7, { minH: "100vh", children: children || /* @__PURE__ */ jsx18(Outlet4, {}) });
919
+ return /* @__PURE__ */ jsx16(Box7, { minH: "100vh", children: children || /* @__PURE__ */ jsx16(Outlet4, {}) });
1259
920
  }
1260
921
  LayoutEmpty.type = eLayoutType3.empty;
1261
922
 
1262
923
  // src/providers/ThemeBasicProvider.tsx
1263
- import { useEffect as useEffect3 } from "react";
924
+ import { useEffect } from "react";
1264
925
  import { ThemeSharedProvider, defineConfig } from "@abpjs/theme-shared";
1265
926
  import { useSession as useSession2, useDirection as useDirection6 } from "@abpjs/core";
1266
- import { Fragment as Fragment6, jsx as jsx19 } from "react/jsx-runtime";
927
+ import { Fragment as Fragment4, jsx as jsx17 } from "react/jsx-runtime";
1267
928
  function LocaleSync({ children }) {
1268
929
  const { language } = useSession2();
1269
930
  const { direction } = useDirection6();
1270
- useEffect3(() => {
931
+ useEffect(() => {
1271
932
  document.documentElement.dir = direction;
1272
933
  document.documentElement.lang = language || "en";
1273
934
  }, [direction, language]);
1274
- return /* @__PURE__ */ jsx19(Fragment6, { children });
935
+ return /* @__PURE__ */ jsx17(Fragment4, { children });
1275
936
  }
1276
937
  function ThemeBasicInner({
1277
938
  children,
@@ -1288,7 +949,7 @@ function ThemeBasicInner({
1288
949
  }) {
1289
950
  const { language } = useSession2();
1290
951
  const locale = language || "en-US";
1291
- return /* @__PURE__ */ jsx19(
952
+ return /* @__PURE__ */ jsx17(
1292
953
  ThemeSharedProvider,
1293
954
  {
1294
955
  renderToasts,
@@ -1298,14 +959,14 @@ function ThemeBasicInner({
1298
959
  enableColorMode,
1299
960
  defaultColorMode,
1300
961
  locale,
1301
- children: /* @__PURE__ */ jsx19(LocaleSync, { children: /* @__PURE__ */ jsx19(
962
+ children: /* @__PURE__ */ jsx17(LocaleSync, { children: /* @__PURE__ */ jsx17(
1302
963
  BrandingProvider,
1303
964
  {
1304
965
  logo,
1305
966
  logoIcon,
1306
967
  appName,
1307
968
  logoLink,
1308
- children: /* @__PURE__ */ jsx19(LayoutProvider, { children })
969
+ children: /* @__PURE__ */ jsx17(LayoutProvider, { children })
1309
970
  }
1310
971
  ) })
1311
972
  }
@@ -1379,7 +1040,7 @@ function ThemeBasicProvider({
1379
1040
  logoLink
1380
1041
  }) {
1381
1042
  const mergedThemeOverrides = themeOverrides || defaultThemeBasicConfig;
1382
- return /* @__PURE__ */ jsx19(
1043
+ return /* @__PURE__ */ jsx17(
1383
1044
  ThemeBasicInner,
1384
1045
  {
1385
1046
  renderToasts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abpjs/theme-basic",
3
- "version": "0.7.6",
3
+ "version": "0.9.0",
4
4
  "description": "ABP Framework Theme Basic components for React - translated from @abp/ng.theme.basic",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -27,11 +27,11 @@
27
27
  "lucide-react": "^0.400.0",
28
28
  "react-hook-form": "^7.48.0",
29
29
  "react-icons": "^5.0.0",
30
- "@abpjs/core": "0.7.6",
31
- "@abpjs/theme-shared": "0.7.6"
30
+ "@abpjs/core": "0.9.0",
31
+ "@abpjs/theme-shared": "0.9.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@abp/ng.theme.basic": "0.7.6"
34
+ "@abp/ng.theme.basic": "0.9.0"
35
35
  },
36
36
  "author": "tekthar.com",
37
37
  "license": "LGPL-3.0",
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- export interface ChangePasswordProps {
3
- /** Whether the modal is visible */
4
- visible: boolean;
5
- /** Callback when visibility changes */
6
- onVisibleChange: (visible: boolean) => void;
7
- }
8
- /**
9
- * Change password modal component.
10
- * Translated from Angular ChangePasswordComponent.
11
- *
12
- * Provides a modal dialog for changing the user's password with:
13
- * - Current password input
14
- * - New password input with validation
15
- * - Confirm new password with match validation
16
- *
17
- * @example
18
- * ```tsx
19
- * <ChangePassword
20
- * visible={isOpen}
21
- * onVisibleChange={setIsOpen}
22
- * />
23
- * ```
24
- */
25
- export declare function ChangePassword({ visible, onVisibleChange, }: ChangePasswordProps): React.ReactElement;
26
- export default ChangePassword;
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- export interface ProfileProps {
3
- /** Whether the modal is visible */
4
- visible: boolean;
5
- /** Callback when visibility changes */
6
- onVisibleChange: (visible: boolean) => void;
7
- }
8
- /**
9
- * Profile modal component for editing user profile.
10
- * Translated from Angular ProfileComponent.
11
- *
12
- * Provides a modal dialog for editing user profile with:
13
- * - Username (required)
14
- * - Email (required)
15
- * - Name
16
- * - Surname
17
- * - Phone number
18
- *
19
- * @example
20
- * ```tsx
21
- * <Profile
22
- * visible={isOpen}
23
- * onVisibleChange={setIsOpen}
24
- * />
25
- * ```
26
- */
27
- export declare function Profile({ visible, onVisibleChange, }: ProfileProps): React.ReactElement;
28
- export default Profile;