@abpjs/theme-shared 2.4.0 → 2.7.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.
package/dist/index.mjs CHANGED
@@ -202,10 +202,25 @@ import { createContext } from "react";
202
202
  var ThemeSharedAppendContentContext = createContext(void 0);
203
203
  var THEME_SHARED_APPEND_CONTENT = "THEME_SHARED_APPEND_CONTENT";
204
204
 
205
+ // src/tokens/http-error.token.ts
206
+ import { createContext as createContext2, useContext } from "react";
207
+ var HTTP_ERROR_CONFIG = "HTTP_ERROR_CONFIG";
208
+ var HttpErrorConfigContext = createContext2(void 0);
209
+ function httpErrorConfigFactory() {
210
+ return {
211
+ skipHandledErrorCodes: [],
212
+ errorScreen: void 0
213
+ };
214
+ }
215
+ function useHttpErrorConfig() {
216
+ const context = useContext(HttpErrorConfigContext);
217
+ return context ?? httpErrorConfigFactory();
218
+ }
219
+
205
220
  // src/contexts/toaster.context.tsx
206
221
  import {
207
- createContext as createContext2,
208
- useContext,
222
+ createContext as createContext3,
223
+ useContext as useContext2,
209
224
  useCallback,
210
225
  useState,
211
226
  useRef,
@@ -213,7 +228,7 @@ import {
213
228
  useEffect
214
229
  } from "react";
215
230
  import { jsx } from "react/jsx-runtime";
216
- var ToasterContext = createContext2(null);
231
+ var ToasterContext = createContext3(null);
217
232
  var toastCounter = 0;
218
233
  function generateId() {
219
234
  toastCounter += 1;
@@ -306,21 +321,21 @@ function ToasterProvider({ children }) {
306
321
  return /* @__PURE__ */ jsx(ToasterContext.Provider, { value, children });
307
322
  }
308
323
  function useToaster() {
309
- const context = useContext(ToasterContext);
324
+ const context = useContext2(ToasterContext);
310
325
  if (!context) {
311
326
  throw new Error("useToaster must be used within a ToasterProvider");
312
327
  }
313
328
  return context.service;
314
329
  }
315
330
  function useToasts() {
316
- const context = useContext(ToasterContext);
331
+ const context = useContext2(ToasterContext);
317
332
  if (!context) {
318
333
  throw new Error("useToasts must be used within a ToasterProvider");
319
334
  }
320
335
  return context.toasts;
321
336
  }
322
337
  function useToasterContext() {
323
- const context = useContext(ToasterContext);
338
+ const context = useContext2(ToasterContext);
324
339
  if (!context) {
325
340
  throw new Error("useToasterContext must be used within a ToasterProvider");
326
341
  }
@@ -329,8 +344,8 @@ function useToasterContext() {
329
344
 
330
345
  // src/contexts/confirmation.context.tsx
331
346
  import {
332
- createContext as createContext3,
333
- useContext as useContext2,
347
+ createContext as createContext4,
348
+ useContext as useContext3,
334
349
  useCallback as useCallback2,
335
350
  useState as useState2,
336
351
  useRef as useRef2,
@@ -338,7 +353,7 @@ import {
338
353
  useEffect as useEffect2
339
354
  } from "react";
340
355
  import { jsx as jsx2 } from "react/jsx-runtime";
341
- var ConfirmationContext = createContext3(null);
356
+ var ConfirmationContext = createContext4(null);
342
357
  function generateId2() {
343
358
  return `confirmation-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
344
359
  }
@@ -445,29 +460,103 @@ function ConfirmationProvider({ children }) {
445
460
  return /* @__PURE__ */ jsx2(ConfirmationContext.Provider, { value, children });
446
461
  }
447
462
  function useConfirmation() {
448
- const context = useContext2(ConfirmationContext);
463
+ const context = useContext3(ConfirmationContext);
449
464
  if (!context) {
450
465
  throw new Error("useConfirmation must be used within a ConfirmationProvider");
451
466
  }
452
467
  return context.service;
453
468
  }
454
469
  function useConfirmationState() {
455
- const context = useContext2(ConfirmationContext);
470
+ const context = useContext3(ConfirmationContext);
456
471
  if (!context) {
457
472
  throw new Error("useConfirmationState must be used within a ConfirmationProvider");
458
473
  }
459
474
  return { confirmation: context.confirmation, respond: context.respond };
460
475
  }
461
476
  function useConfirmationContext() {
462
- const context = useContext2(ConfirmationContext);
477
+ const context = useContext3(ConfirmationContext);
463
478
  if (!context) {
464
479
  throw new Error("useConfirmationContext must be used within a ConfirmationProvider");
465
480
  }
466
481
  return context;
467
482
  }
468
483
 
484
+ // src/contexts/modal.context.tsx
485
+ import {
486
+ createContext as createContext5,
487
+ useContext as useContext4,
488
+ useCallback as useCallback3,
489
+ useState as useState3,
490
+ useRef as useRef3,
491
+ useMemo as useMemo3
492
+ } from "react";
493
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
494
+ var ModalContext = createContext5(null);
495
+ function ModalProvider({ children }) {
496
+ const [modalState, setModalState] = useState3(null);
497
+ const [, setUpdateCounter] = useState3(0);
498
+ const containerRef = useRef3(null);
499
+ const renderTemplate = useCallback3((render, context) => {
500
+ setModalState({ render, context });
501
+ }, []);
502
+ const clearModal = useCallback3(() => {
503
+ setModalState(null);
504
+ }, []);
505
+ const getContainer = useCallback3(() => {
506
+ return containerRef;
507
+ }, []);
508
+ const detectChanges = useCallback3(() => {
509
+ setUpdateCounter((prev) => prev + 1);
510
+ }, []);
511
+ const service = useMemo3(
512
+ () => ({
513
+ renderTemplate,
514
+ clearModal,
515
+ getContainer,
516
+ detectChanges
517
+ }),
518
+ [renderTemplate, clearModal, getContainer, detectChanges]
519
+ );
520
+ const value = useMemo3(
521
+ () => ({ service, modalState }),
522
+ [service, modalState]
523
+ );
524
+ return /* @__PURE__ */ jsxs(ModalContext.Provider, { value, children: [
525
+ children,
526
+ /* @__PURE__ */ jsx3("div", { ref: containerRef, id: "modal-container" })
527
+ ] });
528
+ }
529
+ function useModal() {
530
+ const context = useContext4(ModalContext);
531
+ if (!context) {
532
+ throw new Error("useModal must be used within a ModalProvider");
533
+ }
534
+ return context.service;
535
+ }
536
+ function useModalState() {
537
+ const context = useContext4(ModalContext);
538
+ if (!context) {
539
+ throw new Error("useModalState must be used within a ModalProvider");
540
+ }
541
+ return context.modalState;
542
+ }
543
+ function useModalContext() {
544
+ const context = useContext4(ModalContext);
545
+ if (!context) {
546
+ throw new Error("useModalContext must be used within a ModalProvider");
547
+ }
548
+ return context;
549
+ }
550
+ function ModalContainer() {
551
+ const modalState = useModalState();
552
+ if (!modalState) {
553
+ return null;
554
+ }
555
+ return modalState.render(modalState.context);
556
+ }
557
+
469
558
  // src/handlers/error.handler.ts
470
- import { useCallback as useCallback3, useState as useState3 } from "react";
559
+ import { useCallback as useCallback4, useState as useState4 } from "react";
471
560
  var DEFAULT_ERROR_MESSAGES = {
472
561
  400: "AbpUi::DefaultErrorMessage400",
473
562
  401: "AbpUi::DefaultErrorMessage401",
@@ -479,22 +568,22 @@ var DEFAULT_ERROR_MESSAGES = {
479
568
  function useErrorHandler(options = {}) {
480
569
  const { navigate, loginPath = "/account/login" } = options;
481
570
  const confirmation = useConfirmation();
482
- const [errorComponentProps, setErrorComponentProps] = useState3(null);
483
- const navigateToLogin = useCallback3(() => {
571
+ const [errorComponentProps, setErrorComponentProps] = useState4(null);
572
+ const navigateToLogin = useCallback4(() => {
484
573
  if (navigate) {
485
574
  navigate(loginPath);
486
575
  }
487
576
  }, [navigate, loginPath]);
488
- const showError = useCallback3(
577
+ const showError = useCallback4(
489
578
  async (message, title) => {
490
579
  return confirmation.error(message, title || "AbpUi::Error");
491
580
  },
492
581
  [confirmation]
493
582
  );
494
- const clearErrorComponent = useCallback3(() => {
583
+ const clearErrorComponent = useCallback4(() => {
495
584
  setErrorComponentProps(null);
496
585
  }, []);
497
- const createErrorComponent = useCallback3(
586
+ const createErrorComponent = useCallback4(
498
587
  (instance) => {
499
588
  const props = {
500
589
  title: instance.title || "Error",
@@ -507,7 +596,7 @@ function useErrorHandler(options = {}) {
507
596
  },
508
597
  [clearErrorComponent]
509
598
  );
510
- const handleError = useCallback3(
599
+ const handleError = useCallback4(
511
600
  async (error) => {
512
601
  if (error.status === 401) {
513
602
  navigateToLogin();
@@ -549,7 +638,7 @@ function isHttpErrorResponse(error) {
549
638
  }
550
639
 
551
640
  // src/components/toast/Toast.tsx
552
- import { useEffect as useEffect3, useRef as useRef3, useMemo as useMemo3 } from "react";
641
+ import { useEffect as useEffect3, useRef as useRef4, useMemo as useMemo4 } from "react";
553
642
  import {
554
643
  Toaster as ChakraToaster,
555
644
  Portal,
@@ -568,7 +657,7 @@ import {
568
657
  XCircle,
569
658
  Circle
570
659
  } from "lucide-react";
571
- import { jsx as jsx3, jsxs } from "react/jsx-runtime";
660
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
572
661
  function resolveLocalizationParam(param) {
573
662
  if (param === void 0) return void 0;
574
663
  if (typeof param === "string") return param;
@@ -578,16 +667,16 @@ function SeverityIcon({ severity }) {
578
667
  const iconProps = { size: 20 };
579
668
  switch (severity) {
580
669
  case "success":
581
- return /* @__PURE__ */ jsx3(CheckCircle, { ...iconProps, color: "var(--chakra-colors-green-500)" });
670
+ return /* @__PURE__ */ jsx4(CheckCircle, { ...iconProps, color: "var(--chakra-colors-green-500)" });
582
671
  case "info":
583
- return /* @__PURE__ */ jsx3(Info, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
672
+ return /* @__PURE__ */ jsx4(Info, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
584
673
  case "warning":
585
- return /* @__PURE__ */ jsx3(AlertTriangle, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
674
+ return /* @__PURE__ */ jsx4(AlertTriangle, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
586
675
  case "error":
587
- return /* @__PURE__ */ jsx3(XCircle, { ...iconProps, color: "var(--chakra-colors-red-500)" });
676
+ return /* @__PURE__ */ jsx4(XCircle, { ...iconProps, color: "var(--chakra-colors-red-500)" });
588
677
  case "neutral":
589
678
  default:
590
- return /* @__PURE__ */ jsx3(Circle, { ...iconProps, color: "var(--chakra-colors-gray-500)" });
679
+ return /* @__PURE__ */ jsx4(Circle, { ...iconProps, color: "var(--chakra-colors-gray-500)" });
591
680
  }
592
681
  }
593
682
  function getSeverityColorPalette(severity) {
@@ -682,10 +771,10 @@ function getToaster(placement) {
682
771
  function ToastContainer({ position = "bottom-right", containerKey }) {
683
772
  const { toasts, service } = useToasterContext();
684
773
  const { t } = useLocalization();
685
- const displayedToastsRef = useRef3(/* @__PURE__ */ new Set());
686
- const placement = useMemo3(() => getPlacement(position), [position]);
687
- const toaster = useMemo3(() => getToaster(placement), [placement]);
688
- const filteredToasts = useMemo3(() => {
774
+ const displayedToastsRef = useRef4(/* @__PURE__ */ new Set());
775
+ const placement = useMemo4(() => getPlacement(position), [position]);
776
+ const toaster = useMemo4(() => getToaster(placement), [placement]);
777
+ const filteredToasts = useMemo4(() => {
689
778
  if (!containerKey) return toasts;
690
779
  return toasts.filter((toast) => toast.options?.containerKey === containerKey);
691
780
  }, [toasts, containerKey]);
@@ -722,10 +811,10 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
722
811
  });
723
812
  });
724
813
  }, [filteredToasts, t, service, toaster]);
725
- return /* @__PURE__ */ jsx3(Portal, { children: /* @__PURE__ */ jsx3(ChakraToaster, { toaster, insetInline: { mdDown: "4" }, children: (toast) => {
814
+ return /* @__PURE__ */ jsx4(Portal, { children: /* @__PURE__ */ jsx4(ChakraToaster, { toaster, insetInline: { mdDown: "4" }, children: (toast) => {
726
815
  const severity = toast.meta?.severity || "info";
727
816
  const closable = toast.meta?.closable !== false;
728
- return /* @__PURE__ */ jsx3(
817
+ return /* @__PURE__ */ jsx4(
729
818
  Toast.Root,
730
819
  {
731
820
  bg: getSeverityBg(severity),
@@ -734,13 +823,13 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
734
823
  borderRadius: "lg",
735
824
  boxShadow: "lg",
736
825
  width: { md: "sm" },
737
- children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", gap: 3, p: 4, children: [
738
- /* @__PURE__ */ jsx3(Box, { flexShrink: 0, pt: "2px", children: /* @__PURE__ */ jsx3(SeverityIcon, { severity }) }),
739
- /* @__PURE__ */ jsxs(Stack, { gap: 1, flex: 1, children: [
740
- toast.title && /* @__PURE__ */ jsx3(Toast.Title, { fontWeight: "bold", fontSize: "sm", color: "fg", children: toast.title }),
741
- toast.description && /* @__PURE__ */ jsx3(Toast.Description, { fontSize: "sm", color: "gray.700", children: toast.description })
826
+ children: /* @__PURE__ */ jsxs2(Flex, { align: "flex-start", gap: 3, p: 4, children: [
827
+ /* @__PURE__ */ jsx4(Box, { flexShrink: 0, pt: "2px", children: /* @__PURE__ */ jsx4(SeverityIcon, { severity }) }),
828
+ /* @__PURE__ */ jsxs2(Stack, { gap: 1, flex: 1, children: [
829
+ toast.title && /* @__PURE__ */ jsx4(Toast.Title, { fontWeight: "bold", fontSize: "sm", color: "fg", children: toast.title }),
830
+ toast.description && /* @__PURE__ */ jsx4(Toast.Description, { fontSize: "sm", color: "gray.700", children: toast.description })
742
831
  ] }),
743
- closable && /* @__PURE__ */ jsx3(Toast.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx3(CloseButton, { size: "sm" }) })
832
+ closable && /* @__PURE__ */ jsx4(Toast.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx4(CloseButton, { size: "sm" }) })
744
833
  ] })
745
834
  }
746
835
  );
@@ -748,7 +837,7 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
748
837
  }
749
838
 
750
839
  // src/components/confirmation/Confirmation.tsx
751
- import { useRef as useRef4 } from "react";
840
+ import { useRef as useRef5 } from "react";
752
841
  import {
753
842
  Dialog,
754
843
  Portal as Portal2,
@@ -764,7 +853,7 @@ import {
764
853
  XCircle as XCircle2,
765
854
  Circle as Circle2
766
855
  } from "lucide-react";
767
- import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
856
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
768
857
  function resolveLocalizationParam2(param) {
769
858
  if (param === void 0) return void 0;
770
859
  if (typeof param === "string") return param;
@@ -779,16 +868,16 @@ function SeverityIcon2({ severity }) {
779
868
  const iconProps = { size: 24 };
780
869
  switch (severity) {
781
870
  case "success":
782
- return /* @__PURE__ */ jsx4(CheckCircle2, { ...iconProps, color: "var(--chakra-colors-green-500)" });
871
+ return /* @__PURE__ */ jsx5(CheckCircle2, { ...iconProps, color: "var(--chakra-colors-green-500)" });
783
872
  case "info":
784
- return /* @__PURE__ */ jsx4(Info2, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
873
+ return /* @__PURE__ */ jsx5(Info2, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
785
874
  case "warning":
786
- return /* @__PURE__ */ jsx4(AlertTriangle2, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
875
+ return /* @__PURE__ */ jsx5(AlertTriangle2, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
787
876
  case "error":
788
- return /* @__PURE__ */ jsx4(XCircle2, { ...iconProps, color: "var(--chakra-colors-red-500)" });
877
+ return /* @__PURE__ */ jsx5(XCircle2, { ...iconProps, color: "var(--chakra-colors-red-500)" });
789
878
  case "neutral":
790
879
  default:
791
- return /* @__PURE__ */ jsx4(Circle2, { ...iconProps, color: "var(--chakra-colors-gray-500)" });
880
+ return /* @__PURE__ */ jsx5(Circle2, { ...iconProps, color: "var(--chakra-colors-gray-500)" });
792
881
  }
793
882
  }
794
883
  function getSeverityColorPalette2(severity) {
@@ -809,7 +898,7 @@ function getSeverityColorPalette2(severity) {
809
898
  function ConfirmationDialog({ className }) {
810
899
  const { confirmation, respond } = useConfirmationState();
811
900
  const { t } = useLocalization2();
812
- const cancelRef = useRef4(null);
901
+ const cancelRef = useRef5(null);
813
902
  if (!confirmation) {
814
903
  return null;
815
904
  }
@@ -839,7 +928,7 @@ function ConfirmationDialog({ className }) {
839
928
  handleDismiss();
840
929
  }
841
930
  };
842
- return /* @__PURE__ */ jsx4(
931
+ return /* @__PURE__ */ jsx5(
843
932
  Dialog.Root,
844
933
  {
845
934
  open: true,
@@ -847,16 +936,16 @@ function ConfirmationDialog({ className }) {
847
936
  role: "alertdialog",
848
937
  placement: "center",
849
938
  initialFocusEl: () => cancelRef.current,
850
- children: /* @__PURE__ */ jsxs2(Portal2, { children: [
851
- /* @__PURE__ */ jsx4(Dialog.Backdrop, {}),
852
- /* @__PURE__ */ jsx4(Dialog.Positioner, { children: /* @__PURE__ */ jsxs2(Dialog.Content, { className, maxWidth: "md", children: [
853
- /* @__PURE__ */ jsx4(Dialog.Header, { children: /* @__PURE__ */ jsxs2(Flex2, { align: "center", gap: 3, children: [
854
- /* @__PURE__ */ jsx4(SeverityIcon2, { severity }),
855
- localizedTitle && /* @__PURE__ */ jsx4(Dialog.Title, { children: /* @__PURE__ */ jsx4(Text, { fontWeight: "bold", fontSize: "lg", children: localizedTitle }) })
939
+ children: /* @__PURE__ */ jsxs3(Portal2, { children: [
940
+ /* @__PURE__ */ jsx5(Dialog.Backdrop, {}),
941
+ /* @__PURE__ */ jsx5(Dialog.Positioner, { children: /* @__PURE__ */ jsxs3(Dialog.Content, { className, maxWidth: "md", children: [
942
+ /* @__PURE__ */ jsx5(Dialog.Header, { children: /* @__PURE__ */ jsxs3(Flex2, { align: "center", gap: 3, children: [
943
+ /* @__PURE__ */ jsx5(SeverityIcon2, { severity }),
944
+ localizedTitle && /* @__PURE__ */ jsx5(Dialog.Title, { children: /* @__PURE__ */ jsx5(Text, { fontWeight: "bold", fontSize: "lg", children: localizedTitle }) })
856
945
  ] }) }),
857
- /* @__PURE__ */ jsx4(Dialog.Body, { children: /* @__PURE__ */ jsx4(Text, { color: "gray.600", children: localizedMessage }) }),
858
- /* @__PURE__ */ jsx4(Dialog.Footer, { children: /* @__PURE__ */ jsxs2(Flex2, { gap: 3, children: [
859
- !options?.hideCancelBtn && /* @__PURE__ */ jsx4(
946
+ /* @__PURE__ */ jsx5(Dialog.Body, { children: /* @__PURE__ */ jsx5(Text, { color: "gray.600", children: localizedMessage }) }),
947
+ /* @__PURE__ */ jsx5(Dialog.Footer, { children: /* @__PURE__ */ jsxs3(Flex2, { gap: 3, children: [
948
+ !options?.hideCancelBtn && /* @__PURE__ */ jsx5(
860
949
  Button,
861
950
  {
862
951
  ref: cancelRef,
@@ -865,7 +954,7 @@ function ConfirmationDialog({ className }) {
865
954
  children: cancelCopy
866
955
  }
867
956
  ),
868
- !options?.hideYesBtn && /* @__PURE__ */ jsx4(
957
+ !options?.hideYesBtn && /* @__PURE__ */ jsx5(
869
958
  Button,
870
959
  {
871
960
  colorPalette: getSeverityColorPalette2(severity),
@@ -881,17 +970,20 @@ function ConfirmationDialog({ className }) {
881
970
  }
882
971
 
883
972
  // src/components/errors/ErrorComponent.tsx
884
- import { Heading, Text as Text2, VStack, Button as Button2, Container } from "@chakra-ui/react";
885
- import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
973
+ import { Box as Box2, Heading, Text as Text2, VStack, Button as Button2, Container } from "@chakra-ui/react";
974
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
886
975
  function ErrorComponent({
887
976
  title = "Error",
888
977
  details = "An error has occurred.",
889
978
  onDestroy,
890
979
  showCloseButton = true,
891
- closeButtonText = "Go Back"
980
+ closeButtonText = "Go Back",
981
+ isHomeShow = false,
982
+ onHomeClick,
983
+ homeButtonText = "Go Home"
892
984
  }) {
893
- return /* @__PURE__ */ jsx5(Container, { maxW: "container.md", py: 20, children: /* @__PURE__ */ jsxs3(VStack, { gap: 6, textAlign: "center", children: [
894
- /* @__PURE__ */ jsx5(
985
+ return /* @__PURE__ */ jsx6(Container, { maxW: "container.md", py: 20, children: /* @__PURE__ */ jsxs4(VStack, { gap: 6, textAlign: "center", children: [
986
+ /* @__PURE__ */ jsx6(
895
987
  Heading,
896
988
  {
897
989
  size: "4xl",
@@ -900,23 +992,34 @@ function ErrorComponent({
900
992
  children: title
901
993
  }
902
994
  ),
903
- /* @__PURE__ */ jsx5(Text2, { fontSize: "lg", color: "gray.600", children: details }),
904
- showCloseButton && onDestroy && /* @__PURE__ */ jsx5(
905
- Button2,
906
- {
907
- colorPalette: "blue",
908
- size: "lg",
909
- onClick: onDestroy,
910
- children: closeButtonText
911
- }
912
- )
995
+ /* @__PURE__ */ jsx6(Text2, { fontSize: "lg", color: "gray.600", children: details }),
996
+ /* @__PURE__ */ jsxs4(Box2, { display: "flex", gap: 3, children: [
997
+ isHomeShow && onHomeClick && /* @__PURE__ */ jsx6(
998
+ Button2,
999
+ {
1000
+ colorPalette: "green",
1001
+ size: "lg",
1002
+ onClick: onHomeClick,
1003
+ children: homeButtonText
1004
+ }
1005
+ ),
1006
+ showCloseButton && onDestroy && /* @__PURE__ */ jsx6(
1007
+ Button2,
1008
+ {
1009
+ colorPalette: "blue",
1010
+ size: "lg",
1011
+ onClick: onDestroy,
1012
+ children: closeButtonText
1013
+ }
1014
+ )
1015
+ ] })
913
1016
  ] }) });
914
1017
  }
915
1018
 
916
1019
  // src/components/loader-bar/LoaderBar.tsx
917
- import { useEffect as useEffect4, useRef as useRef5, useState as useState4 } from "react";
1020
+ import { useEffect as useEffect4, useRef as useRef6, useState as useState5 } from "react";
918
1021
  import { useLoader } from "@abpjs/core";
919
- import { jsx as jsx6 } from "react/jsx-runtime";
1022
+ import { jsx as jsx7 } from "react/jsx-runtime";
920
1023
  function LoaderBar({
921
1024
  containerClass = "abp-loader-bar",
922
1025
  progressClass = "abp-progress",
@@ -925,9 +1028,9 @@ function LoaderBar({
925
1028
  stopDelay = 400
926
1029
  }) {
927
1030
  const { loading } = useLoader();
928
- const [isLoading, setIsLoading] = useState4(false);
929
- const [progressLevel, setProgressLevel] = useState4(0);
930
- const intervalRef = useRef5(null);
1031
+ const [isLoading, setIsLoading] = useState5(false);
1032
+ const [progressLevel, setProgressLevel] = useState5(0);
1033
+ const intervalRef = useRef6(null);
931
1034
  useEffect4(() => {
932
1035
  if (loading) {
933
1036
  startLoading();
@@ -975,7 +1078,7 @@ function LoaderBar({
975
1078
  if (!isLoading && progressLevel === 0) {
976
1079
  return null;
977
1080
  }
978
- return /* @__PURE__ */ jsx6(
1081
+ return /* @__PURE__ */ jsx7(
979
1082
  "div",
980
1083
  {
981
1084
  className: containerClass,
@@ -989,7 +1092,7 @@ function LoaderBar({
989
1092
  backgroundColor: "rgba(0, 0, 0, 0.1)",
990
1093
  overflow: "hidden"
991
1094
  },
992
- children: /* @__PURE__ */ jsx6(
1095
+ children: /* @__PURE__ */ jsx7(
993
1096
  "div",
994
1097
  {
995
1098
  className: progressClass,
@@ -1006,7 +1109,7 @@ function LoaderBar({
1006
1109
  }
1007
1110
 
1008
1111
  // src/components/modal/Modal.tsx
1009
- import React6 from "react";
1112
+ import React7 from "react";
1010
1113
  import {
1011
1114
  Dialog as Dialog2,
1012
1115
  Portal as Portal3,
@@ -1016,7 +1119,7 @@ import {
1016
1119
  Separator,
1017
1120
  CloseButton as CloseButton2
1018
1121
  } from "@chakra-ui/react";
1019
- import { Fragment, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
1122
+ import { Fragment, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
1020
1123
  function getSizeWidth(size) {
1021
1124
  switch (size) {
1022
1125
  case "sm":
@@ -1054,12 +1157,12 @@ function Modal({
1054
1157
  preventScroll = true,
1055
1158
  onInit
1056
1159
  }) {
1057
- const prevVisibleRef = React6.useRef(false);
1058
- const onInitRef = React6.useRef(onInit);
1059
- React6.useEffect(() => {
1160
+ const prevVisibleRef = React7.useRef(false);
1161
+ const onInitRef = React7.useRef(onInit);
1162
+ React7.useEffect(() => {
1060
1163
  onInitRef.current = onInit;
1061
1164
  }, [onInit]);
1062
- React6.useEffect(() => {
1165
+ React7.useEffect(() => {
1063
1166
  if (visible && !prevVisibleRef.current && onInitRef.current) {
1064
1167
  onInitRef.current();
1065
1168
  }
@@ -1071,7 +1174,7 @@ function Modal({
1071
1174
  }
1072
1175
  onVisibleChange?.(details.open);
1073
1176
  };
1074
- return /* @__PURE__ */ jsx7(
1177
+ return /* @__PURE__ */ jsx8(
1075
1178
  Dialog2.Root,
1076
1179
  {
1077
1180
  open: visible,
@@ -1083,9 +1186,9 @@ function Modal({
1083
1186
  motionPreset,
1084
1187
  trapFocus,
1085
1188
  preventScroll,
1086
- children: /* @__PURE__ */ jsxs4(Portal3, { children: [
1087
- /* @__PURE__ */ jsx7(Dialog2.Backdrop, {}),
1088
- /* @__PURE__ */ jsx7(Dialog2.Positioner, { children: /* @__PURE__ */ jsxs4(
1189
+ children: /* @__PURE__ */ jsxs5(Portal3, { children: [
1190
+ /* @__PURE__ */ jsx8(Dialog2.Backdrop, {}),
1191
+ /* @__PURE__ */ jsx8(Dialog2.Positioner, { children: /* @__PURE__ */ jsxs5(
1089
1192
  Dialog2.Content,
1090
1193
  {
1091
1194
  className: modalClass,
@@ -1095,17 +1198,17 @@ function Modal({
1095
1198
  height,
1096
1199
  minHeight,
1097
1200
  children: [
1098
- (header || showCloseButton) && /* @__PURE__ */ jsxs4(Fragment, { children: [
1099
- /* @__PURE__ */ jsx7(Dialog2.Header, { children: /* @__PURE__ */ jsxs4(Flex3, { justify: "space-between", align: "center", width: "100%", children: [
1100
- header && /* @__PURE__ */ jsx7(Dialog2.Title, { children: /* @__PURE__ */ jsx7(Text3, { fontWeight: "bold", fontSize: "lg", children: header }) }),
1101
- showCloseButton && /* @__PURE__ */ jsx7(Dialog2.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx7(CloseButton2, { size: "sm" }) })
1201
+ (header || showCloseButton) && /* @__PURE__ */ jsxs5(Fragment, { children: [
1202
+ /* @__PURE__ */ jsx8(Dialog2.Header, { children: /* @__PURE__ */ jsxs5(Flex3, { justify: "space-between", align: "center", width: "100%", children: [
1203
+ header && /* @__PURE__ */ jsx8(Dialog2.Title, { children: /* @__PURE__ */ jsx8(Text3, { fontWeight: "bold", fontSize: "lg", children: header }) }),
1204
+ showCloseButton && /* @__PURE__ */ jsx8(Dialog2.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx8(CloseButton2, { size: "sm" }) })
1102
1205
  ] }) }),
1103
- /* @__PURE__ */ jsx7(Separator, {})
1206
+ /* @__PURE__ */ jsx8(Separator, {})
1104
1207
  ] }),
1105
- children && /* @__PURE__ */ jsx7(Dialog2.Body, { py: 4, children }),
1106
- footer && /* @__PURE__ */ jsxs4(Fragment, { children: [
1107
- /* @__PURE__ */ jsx7(Separator, {}),
1108
- /* @__PURE__ */ jsx7(Dialog2.Footer, { children: /* @__PURE__ */ jsx7(Flex3, { gap: 3, justify: "flex-end", w: "100%", children: footer }) })
1208
+ children && /* @__PURE__ */ jsx8(Dialog2.Body, { py: 4, children }),
1209
+ footer && /* @__PURE__ */ jsxs5(Fragment, { children: [
1210
+ /* @__PURE__ */ jsx8(Separator, {}),
1211
+ /* @__PURE__ */ jsx8(Dialog2.Footer, { children: /* @__PURE__ */ jsx8(Flex3, { gap: 3, justify: "flex-end", w: "100%", children: footer }) })
1109
1212
  ] })
1110
1213
  ]
1111
1214
  }
@@ -1115,18 +1218,18 @@ function Modal({
1115
1218
  );
1116
1219
  }
1117
1220
  function AbpModalHeader({ children, className }) {
1118
- return /* @__PURE__ */ jsx7(Text3, { fontWeight: "bold", fontSize: "lg", className, children });
1221
+ return /* @__PURE__ */ jsx8(Text3, { fontWeight: "bold", fontSize: "lg", className, children });
1119
1222
  }
1120
1223
  function AbpModalBody({ children, className }) {
1121
- return /* @__PURE__ */ jsx7(Box3, { color: "gray.600", className, children });
1224
+ return /* @__PURE__ */ jsx8(Box3, { color: "gray.600", className, children });
1122
1225
  }
1123
1226
  function AbpModalFooter({ children, className }) {
1124
- return /* @__PURE__ */ jsx7(Flex3, { gap: 3, justify: "flex-end", className, children });
1227
+ return /* @__PURE__ */ jsx8(Flex3, { gap: 3, justify: "flex-end", className, children });
1125
1228
  }
1126
1229
 
1127
1230
  // src/components/ui/Alert.tsx
1128
1231
  import { Alert as ChakraAlert } from "@chakra-ui/react";
1129
- import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
1232
+ import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
1130
1233
  function Alert({
1131
1234
  status = "info",
1132
1235
  children,
@@ -1137,7 +1240,7 @@ function Alert({
1137
1240
  mb,
1138
1241
  borderRadius = "md"
1139
1242
  }) {
1140
- return /* @__PURE__ */ jsxs5(
1243
+ return /* @__PURE__ */ jsxs6(
1141
1244
  ChakraAlert.Root,
1142
1245
  {
1143
1246
  status,
@@ -1145,11 +1248,11 @@ function Alert({
1145
1248
  mb,
1146
1249
  borderRadius,
1147
1250
  children: [
1148
- showIcon && /* @__PURE__ */ jsx8(ChakraAlert.Indicator, {}),
1149
- title ? /* @__PURE__ */ jsxs5(Fragment2, { children: [
1150
- /* @__PURE__ */ jsx8(ChakraAlert.Title, { children: title }),
1151
- (description || children) && /* @__PURE__ */ jsx8(ChakraAlert.Description, { children: description || children })
1152
- ] }) : /* @__PURE__ */ jsx8(ChakraAlert.Title, { children })
1251
+ showIcon && /* @__PURE__ */ jsx9(ChakraAlert.Indicator, {}),
1252
+ title ? /* @__PURE__ */ jsxs6(Fragment2, { children: [
1253
+ /* @__PURE__ */ jsx9(ChakraAlert.Title, { children: title }),
1254
+ (description || children) && /* @__PURE__ */ jsx9(ChakraAlert.Description, { children: description || children })
1255
+ ] }) : /* @__PURE__ */ jsx9(ChakraAlert.Title, { children })
1153
1256
  ]
1154
1257
  }
1155
1258
  );
@@ -1158,7 +1261,7 @@ function Alert({
1158
1261
  // src/components/ui/Button.tsx
1159
1262
  import { forwardRef } from "react";
1160
1263
  import { Button as ChakraButton } from "@chakra-ui/react";
1161
- import { jsx as jsx9 } from "react/jsx-runtime";
1264
+ import { jsx as jsx10 } from "react/jsx-runtime";
1162
1265
  var Button3 = forwardRef(
1163
1266
  function Button4({
1164
1267
  children,
@@ -1175,7 +1278,7 @@ var Button3 = forwardRef(
1175
1278
  mr,
1176
1279
  ml
1177
1280
  }, ref) {
1178
- return /* @__PURE__ */ jsx9(
1281
+ return /* @__PURE__ */ jsx10(
1179
1282
  ChakraButton,
1180
1283
  {
1181
1284
  ref,
@@ -1200,7 +1303,7 @@ var Button3 = forwardRef(
1200
1303
  // src/components/ui/Checkbox.tsx
1201
1304
  import { forwardRef as forwardRef2 } from "react";
1202
1305
  import { Checkbox as ChakraCheckbox } from "@chakra-ui/react";
1203
- import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
1306
+ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
1204
1307
  var Checkbox = forwardRef2(
1205
1308
  function Checkbox2({
1206
1309
  children,
@@ -1218,7 +1321,7 @@ var Checkbox = forwardRef2(
1218
1321
  onChange,
1219
1322
  className
1220
1323
  }, ref) {
1221
- return /* @__PURE__ */ jsxs6(
1324
+ return /* @__PURE__ */ jsxs7(
1222
1325
  ChakraCheckbox.Root,
1223
1326
  {
1224
1327
  checked,
@@ -1231,7 +1334,7 @@ var Checkbox = forwardRef2(
1231
1334
  size,
1232
1335
  className,
1233
1336
  children: [
1234
- /* @__PURE__ */ jsx10(
1337
+ /* @__PURE__ */ jsx11(
1235
1338
  ChakraCheckbox.HiddenInput,
1236
1339
  {
1237
1340
  ref,
@@ -1241,8 +1344,8 @@ var Checkbox = forwardRef2(
1241
1344
  onChange
1242
1345
  }
1243
1346
  ),
1244
- /* @__PURE__ */ jsx10(ChakraCheckbox.Control, {}),
1245
- children && /* @__PURE__ */ jsx10(ChakraCheckbox.Label, { children })
1347
+ /* @__PURE__ */ jsx11(ChakraCheckbox.Control, {}),
1348
+ children && /* @__PURE__ */ jsx11(ChakraCheckbox.Label, { children })
1246
1349
  ]
1247
1350
  }
1248
1351
  );
@@ -1251,7 +1354,7 @@ var Checkbox = forwardRef2(
1251
1354
 
1252
1355
  // src/components/ui/FormField.tsx
1253
1356
  import { Field } from "@chakra-ui/react";
1254
- import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
1357
+ import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
1255
1358
  function FormField({
1256
1359
  label,
1257
1360
  invalid = false,
@@ -1263,14 +1366,14 @@ function FormField({
1263
1366
  htmlFor,
1264
1367
  className
1265
1368
  }) {
1266
- return /* @__PURE__ */ jsxs7(Field.Root, { invalid, disabled, className, children: [
1267
- label && /* @__PURE__ */ jsxs7(Field.Label, { htmlFor, children: [
1369
+ return /* @__PURE__ */ jsxs8(Field.Root, { invalid, disabled, className, children: [
1370
+ label && /* @__PURE__ */ jsxs8(Field.Label, { htmlFor, children: [
1268
1371
  label,
1269
- required && /* @__PURE__ */ jsx11(Field.RequiredIndicator, {})
1372
+ required && /* @__PURE__ */ jsx12(Field.RequiredIndicator, {})
1270
1373
  ] }),
1271
1374
  children,
1272
- helperText && !invalid && /* @__PURE__ */ jsx11(Field.HelperText, { children: helperText }),
1273
- invalid && errorText && /* @__PURE__ */ jsx11(Field.ErrorText, { children: errorText })
1375
+ helperText && !invalid && /* @__PURE__ */ jsx12(Field.HelperText, { children: helperText }),
1376
+ invalid && errorText && /* @__PURE__ */ jsx12(Field.ErrorText, { children: errorText })
1274
1377
  ] });
1275
1378
  }
1276
1379
 
@@ -1285,7 +1388,7 @@ import {
1285
1388
  import { useForm } from "react-hook-form";
1286
1389
  import { useLocalization as useLocalization3, useProfile } from "@abpjs/core";
1287
1390
  import { Check } from "lucide-react";
1288
- import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
1391
+ import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
1289
1392
  function ChangePassword({
1290
1393
  visible,
1291
1394
  onVisibleChange
@@ -1348,9 +1451,9 @@ function ChangePassword({
1348
1451
  hasSpecial: (value) => /[!@#$%^&*(),.?":{}|<>]/.test(value) || t("AbpIdentity::PasswordRequiresNonAlphanumeric") || "Password must contain a special character"
1349
1452
  }
1350
1453
  };
1351
- const modalFooter = /* @__PURE__ */ jsxs8(Fragment3, { children: [
1352
- /* @__PURE__ */ jsx12(Button5, { variant: "ghost", mr: 3, onClick: handleClose, disabled: isSubmitting, children: t("AbpIdentity::Cancel") || "Cancel" }),
1353
- /* @__PURE__ */ jsxs8(
1454
+ const modalFooter = /* @__PURE__ */ jsxs9(Fragment3, { children: [
1455
+ /* @__PURE__ */ jsx13(Button5, { variant: "ghost", mr: 3, onClick: handleClose, disabled: isSubmitting, children: t("AbpIdentity::Cancel") || "Cancel" }),
1456
+ /* @__PURE__ */ jsxs9(
1354
1457
  Button5,
1355
1458
  {
1356
1459
  colorPalette: "blue",
@@ -1358,13 +1461,13 @@ function ChangePassword({
1358
1461
  loading: isSubmitting,
1359
1462
  form: "change-password-form",
1360
1463
  children: [
1361
- /* @__PURE__ */ jsx12(Check, { size: 16 }),
1464
+ /* @__PURE__ */ jsx13(Check, { size: 16 }),
1362
1465
  t("AbpIdentity::Save") || "Save"
1363
1466
  ]
1364
1467
  }
1365
1468
  )
1366
1469
  ] });
1367
- return /* @__PURE__ */ jsx12(
1470
+ return /* @__PURE__ */ jsx13(
1368
1471
  Modal,
1369
1472
  {
1370
1473
  visible,
@@ -1373,13 +1476,13 @@ function ChangePassword({
1373
1476
  header: t("AbpIdentity::ChangePassword") || "Change Password",
1374
1477
  footer: modalFooter,
1375
1478
  centered: true,
1376
- children: /* @__PURE__ */ jsx12("form", { id: "change-password-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ jsxs8(VStack2, { gap: 4, children: [
1377
- /* @__PURE__ */ jsxs8(Field2.Root, { invalid: !!errors.password, children: [
1378
- /* @__PURE__ */ jsxs8(Field2.Label, { children: [
1479
+ children: /* @__PURE__ */ jsx13("form", { id: "change-password-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ jsxs9(VStack2, { gap: 4, children: [
1480
+ /* @__PURE__ */ jsxs9(Field2.Root, { invalid: !!errors.password, children: [
1481
+ /* @__PURE__ */ jsxs9(Field2.Label, { children: [
1379
1482
  t("AbpIdentity::DisplayName:CurrentPassword") || "Current Password",
1380
- /* @__PURE__ */ jsx12(Field2.RequiredIndicator, {})
1483
+ /* @__PURE__ */ jsx13(Field2.RequiredIndicator, {})
1381
1484
  ] }),
1382
- /* @__PURE__ */ jsx12(
1485
+ /* @__PURE__ */ jsx13(
1383
1486
  Input,
1384
1487
  {
1385
1488
  type: "password",
@@ -1388,28 +1491,28 @@ function ChangePassword({
1388
1491
  })
1389
1492
  }
1390
1493
  ),
1391
- /* @__PURE__ */ jsx12(Field2.ErrorText, { children: errors.password?.message })
1494
+ /* @__PURE__ */ jsx13(Field2.ErrorText, { children: errors.password?.message })
1392
1495
  ] }),
1393
- /* @__PURE__ */ jsxs8(Field2.Root, { invalid: !!errors.newPassword, children: [
1394
- /* @__PURE__ */ jsxs8(Field2.Label, { children: [
1496
+ /* @__PURE__ */ jsxs9(Field2.Root, { invalid: !!errors.newPassword, children: [
1497
+ /* @__PURE__ */ jsxs9(Field2.Label, { children: [
1395
1498
  t("AbpIdentity::DisplayName:NewPassword") || "New Password",
1396
- /* @__PURE__ */ jsx12(Field2.RequiredIndicator, {})
1499
+ /* @__PURE__ */ jsx13(Field2.RequiredIndicator, {})
1397
1500
  ] }),
1398
- /* @__PURE__ */ jsx12(
1501
+ /* @__PURE__ */ jsx13(
1399
1502
  Input,
1400
1503
  {
1401
1504
  type: "password",
1402
1505
  ...register("newPassword", passwordValidation)
1403
1506
  }
1404
1507
  ),
1405
- /* @__PURE__ */ jsx12(Field2.ErrorText, { children: errors.newPassword?.message })
1508
+ /* @__PURE__ */ jsx13(Field2.ErrorText, { children: errors.newPassword?.message })
1406
1509
  ] }),
1407
- /* @__PURE__ */ jsxs8(Field2.Root, { invalid: !!errors.repeatNewPassword, children: [
1408
- /* @__PURE__ */ jsxs8(Field2.Label, { children: [
1510
+ /* @__PURE__ */ jsxs9(Field2.Root, { invalid: !!errors.repeatNewPassword, children: [
1511
+ /* @__PURE__ */ jsxs9(Field2.Label, { children: [
1409
1512
  t("AbpIdentity::DisplayName:NewPasswordConfirm") || "Confirm New Password",
1410
- /* @__PURE__ */ jsx12(Field2.RequiredIndicator, {})
1513
+ /* @__PURE__ */ jsx13(Field2.RequiredIndicator, {})
1411
1514
  ] }),
1412
- /* @__PURE__ */ jsx12(
1515
+ /* @__PURE__ */ jsx13(
1413
1516
  Input,
1414
1517
  {
1415
1518
  type: "password",
@@ -1419,7 +1522,7 @@ function ChangePassword({
1419
1522
  })
1420
1523
  }
1421
1524
  ),
1422
- /* @__PURE__ */ jsx12(Field2.ErrorText, { children: errors.repeatNewPassword?.message })
1525
+ /* @__PURE__ */ jsx13(Field2.ErrorText, { children: errors.repeatNewPassword?.message })
1423
1526
  ] })
1424
1527
  ] }) })
1425
1528
  }
@@ -1438,7 +1541,7 @@ import {
1438
1541
  import { useForm as useForm2 } from "react-hook-form";
1439
1542
  import { useLocalization as useLocalization4, useProfile as useProfile2 } from "@abpjs/core";
1440
1543
  import { Check as Check2 } from "lucide-react";
1441
- import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
1544
+ import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
1442
1545
  function Profile({
1443
1546
  visible,
1444
1547
  onVisibleChange
@@ -1498,9 +1601,9 @@ function Profile({
1498
1601
  onVisibleChange(false);
1499
1602
  }
1500
1603
  };
1501
- const modalFooter = /* @__PURE__ */ jsxs9(Fragment4, { children: [
1502
- /* @__PURE__ */ jsx13(Button6, { variant: "ghost", mr: 3, onClick: handleClose, disabled: modalBusy, children: t("AbpIdentity::Cancel") || "Cancel" }),
1503
- /* @__PURE__ */ jsxs9(
1604
+ const modalFooter = /* @__PURE__ */ jsxs10(Fragment4, { children: [
1605
+ /* @__PURE__ */ jsx14(Button6, { variant: "ghost", mr: 3, onClick: handleClose, disabled: modalBusy, children: t("AbpIdentity::Cancel") || "Cancel" }),
1606
+ /* @__PURE__ */ jsxs10(
1504
1607
  Button6,
1505
1608
  {
1506
1609
  colorPalette: "blue",
@@ -1508,13 +1611,13 @@ function Profile({
1508
1611
  loading: modalBusy,
1509
1612
  form: "profile-form",
1510
1613
  children: [
1511
- /* @__PURE__ */ jsx13(Check2, { size: 16 }),
1614
+ /* @__PURE__ */ jsx14(Check2, { size: 16 }),
1512
1615
  t("AbpIdentity::Save") || "Save"
1513
1616
  ]
1514
1617
  }
1515
1618
  )
1516
1619
  ] });
1517
- return /* @__PURE__ */ jsx13(
1620
+ return /* @__PURE__ */ jsx14(
1518
1621
  Modal,
1519
1622
  {
1520
1623
  visible,
@@ -1524,13 +1627,13 @@ function Profile({
1524
1627
  footer: modalFooter,
1525
1628
  size: "lg",
1526
1629
  centered: true,
1527
- children: /* @__PURE__ */ jsx13("form", { id: "profile-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ jsxs9(VStack3, { gap: 4, children: [
1528
- /* @__PURE__ */ jsxs9(Field3.Root, { invalid: !!errors.userName, children: [
1529
- /* @__PURE__ */ jsxs9(Field3.Label, { children: [
1630
+ children: /* @__PURE__ */ jsx14("form", { id: "profile-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ jsxs10(VStack3, { gap: 4, children: [
1631
+ /* @__PURE__ */ jsxs10(Field3.Root, { invalid: !!errors.userName, children: [
1632
+ /* @__PURE__ */ jsxs10(Field3.Label, { children: [
1530
1633
  t("AbpIdentity::DisplayName:UserName") || "Username",
1531
- /* @__PURE__ */ jsx13(Field3.RequiredIndicator, {})
1634
+ /* @__PURE__ */ jsx14(Field3.RequiredIndicator, {})
1532
1635
  ] }),
1533
- /* @__PURE__ */ jsx13(
1636
+ /* @__PURE__ */ jsx14(
1534
1637
  Input2,
1535
1638
  {
1536
1639
  type: "text",
@@ -1543,12 +1646,12 @@ function Profile({
1543
1646
  })
1544
1647
  }
1545
1648
  ),
1546
- /* @__PURE__ */ jsx13(Field3.ErrorText, { children: errors.userName?.message })
1649
+ /* @__PURE__ */ jsx14(Field3.ErrorText, { children: errors.userName?.message })
1547
1650
  ] }),
1548
- /* @__PURE__ */ jsxs9(HStack, { gap: 4, w: "full", children: [
1549
- /* @__PURE__ */ jsxs9(Field3.Root, { invalid: !!errors.name, flex: 1, children: [
1550
- /* @__PURE__ */ jsx13(Field3.Label, { children: t("AbpIdentity::DisplayName:Name") || "Name" }),
1551
- /* @__PURE__ */ jsx13(
1651
+ /* @__PURE__ */ jsxs10(HStack, { gap: 4, w: "full", children: [
1652
+ /* @__PURE__ */ jsxs10(Field3.Root, { invalid: !!errors.name, flex: 1, children: [
1653
+ /* @__PURE__ */ jsx14(Field3.Label, { children: t("AbpIdentity::DisplayName:Name") || "Name" }),
1654
+ /* @__PURE__ */ jsx14(
1552
1655
  Input2,
1553
1656
  {
1554
1657
  type: "text",
@@ -1560,11 +1663,11 @@ function Profile({
1560
1663
  })
1561
1664
  }
1562
1665
  ),
1563
- /* @__PURE__ */ jsx13(Field3.ErrorText, { children: errors.name?.message })
1666
+ /* @__PURE__ */ jsx14(Field3.ErrorText, { children: errors.name?.message })
1564
1667
  ] }),
1565
- /* @__PURE__ */ jsxs9(Field3.Root, { invalid: !!errors.surname, flex: 1, children: [
1566
- /* @__PURE__ */ jsx13(Field3.Label, { children: t("AbpIdentity::DisplayName:Surname") || "Surname" }),
1567
- /* @__PURE__ */ jsx13(
1668
+ /* @__PURE__ */ jsxs10(Field3.Root, { invalid: !!errors.surname, flex: 1, children: [
1669
+ /* @__PURE__ */ jsx14(Field3.Label, { children: t("AbpIdentity::DisplayName:Surname") || "Surname" }),
1670
+ /* @__PURE__ */ jsx14(
1568
1671
  Input2,
1569
1672
  {
1570
1673
  type: "text",
@@ -1576,15 +1679,15 @@ function Profile({
1576
1679
  })
1577
1680
  }
1578
1681
  ),
1579
- /* @__PURE__ */ jsx13(Field3.ErrorText, { children: errors.surname?.message })
1682
+ /* @__PURE__ */ jsx14(Field3.ErrorText, { children: errors.surname?.message })
1580
1683
  ] })
1581
1684
  ] }),
1582
- /* @__PURE__ */ jsxs9(Field3.Root, { invalid: !!errors.email, children: [
1583
- /* @__PURE__ */ jsxs9(Field3.Label, { children: [
1685
+ /* @__PURE__ */ jsxs10(Field3.Root, { invalid: !!errors.email, children: [
1686
+ /* @__PURE__ */ jsxs10(Field3.Label, { children: [
1584
1687
  t("AbpIdentity::DisplayName:EmailAddress") || "Email Address",
1585
- /* @__PURE__ */ jsx13(Field3.RequiredIndicator, {})
1688
+ /* @__PURE__ */ jsx14(Field3.RequiredIndicator, {})
1586
1689
  ] }),
1587
- /* @__PURE__ */ jsx13(
1690
+ /* @__PURE__ */ jsx14(
1588
1691
  Input2,
1589
1692
  {
1590
1693
  type: "email",
@@ -1601,11 +1704,11 @@ function Profile({
1601
1704
  })
1602
1705
  }
1603
1706
  ),
1604
- /* @__PURE__ */ jsx13(Field3.ErrorText, { children: errors.email?.message })
1707
+ /* @__PURE__ */ jsx14(Field3.ErrorText, { children: errors.email?.message })
1605
1708
  ] }),
1606
- /* @__PURE__ */ jsxs9(Field3.Root, { invalid: !!errors.phoneNumber, children: [
1607
- /* @__PURE__ */ jsx13(Field3.Label, { children: t("AbpIdentity::DisplayName:PhoneNumber") || "Phone Number" }),
1608
- /* @__PURE__ */ jsx13(
1709
+ /* @__PURE__ */ jsxs10(Field3.Root, { invalid: !!errors.phoneNumber, children: [
1710
+ /* @__PURE__ */ jsx14(Field3.Label, { children: t("AbpIdentity::DisplayName:PhoneNumber") || "Phone Number" }),
1711
+ /* @__PURE__ */ jsx14(
1609
1712
  Input2,
1610
1713
  {
1611
1714
  type: "tel",
@@ -1617,7 +1720,7 @@ function Profile({
1617
1720
  })
1618
1721
  }
1619
1722
  ),
1620
- /* @__PURE__ */ jsx13(Field3.ErrorText, { children: errors.phoneNumber?.message })
1723
+ /* @__PURE__ */ jsx14(Field3.ErrorText, { children: errors.phoneNumber?.message })
1621
1724
  ] })
1622
1725
  ] }) })
1623
1726
  }
@@ -1862,11 +1965,11 @@ var abpSystem = createAbpSystem();
1862
1965
  // src/components/ui/color-mode.tsx
1863
1966
  import { ClientOnly, IconButton, Skeleton, Span } from "@chakra-ui/react";
1864
1967
  import { ThemeProvider, useTheme } from "next-themes";
1865
- import * as React11 from "react";
1968
+ import * as React12 from "react";
1866
1969
  import { Moon, Sun } from "lucide-react";
1867
- import { jsx as jsx14 } from "react/jsx-runtime";
1970
+ import { jsx as jsx15 } from "react/jsx-runtime";
1868
1971
  function ColorModeProvider(props) {
1869
- return /* @__PURE__ */ jsx14(ThemeProvider, { attribute: "class", disableTransitionOnChange: true, ...props });
1972
+ return /* @__PURE__ */ jsx15(ThemeProvider, { attribute: "class", disableTransitionOnChange: true, ...props });
1870
1973
  }
1871
1974
  function useColorMode() {
1872
1975
  const { resolvedTheme, setTheme, forcedTheme } = useTheme();
@@ -1882,11 +1985,11 @@ function useColorMode() {
1882
1985
  }
1883
1986
  function ColorModeIcon() {
1884
1987
  const { colorMode } = useColorMode();
1885
- return colorMode === "dark" ? /* @__PURE__ */ jsx14(Moon, {}) : /* @__PURE__ */ jsx14(Sun, {});
1988
+ return colorMode === "dark" ? /* @__PURE__ */ jsx15(Moon, {}) : /* @__PURE__ */ jsx15(Sun, {});
1886
1989
  }
1887
- var ColorModeButton = React11.forwardRef(function ColorModeButton2(props, ref) {
1990
+ var ColorModeButton = React12.forwardRef(function ColorModeButton2(props, ref) {
1888
1991
  const { toggleColorMode } = useColorMode();
1889
- return /* @__PURE__ */ jsx14(ClientOnly, { fallback: /* @__PURE__ */ jsx14(Skeleton, { boxSize: "9" }), children: /* @__PURE__ */ jsx14(
1992
+ return /* @__PURE__ */ jsx15(ClientOnly, { fallback: /* @__PURE__ */ jsx15(Skeleton, { boxSize: "9" }), children: /* @__PURE__ */ jsx15(
1890
1993
  IconButton,
1891
1994
  {
1892
1995
  onClick: toggleColorMode,
@@ -1901,13 +2004,13 @@ var ColorModeButton = React11.forwardRef(function ColorModeButton2(props, ref) {
1901
2004
  height: "5"
1902
2005
  }
1903
2006
  },
1904
- children: /* @__PURE__ */ jsx14(ColorModeIcon, {})
2007
+ children: /* @__PURE__ */ jsx15(ColorModeIcon, {})
1905
2008
  }
1906
2009
  ) });
1907
2010
  });
1908
- var LightMode = React11.forwardRef(
2011
+ var LightMode = React12.forwardRef(
1909
2012
  function LightMode2(props, ref) {
1910
- return /* @__PURE__ */ jsx14(
2013
+ return /* @__PURE__ */ jsx15(
1911
2014
  Span,
1912
2015
  {
1913
2016
  color: "fg",
@@ -1921,9 +2024,9 @@ var LightMode = React11.forwardRef(
1921
2024
  );
1922
2025
  }
1923
2026
  );
1924
- var DarkMode = React11.forwardRef(
2027
+ var DarkMode = React12.forwardRef(
1925
2028
  function DarkMode2(props, ref) {
1926
- return /* @__PURE__ */ jsx14(
2029
+ return /* @__PURE__ */ jsx15(
1927
2030
  Span,
1928
2031
  {
1929
2032
  color: "fg",
@@ -1940,7 +2043,7 @@ var DarkMode = React11.forwardRef(
1940
2043
 
1941
2044
  // src/providers/ThemeSharedProvider.tsx
1942
2045
  import { useDirection } from "@abpjs/core";
1943
- import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
2046
+ import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
1944
2047
  function ThemeSharedProvider({
1945
2048
  children,
1946
2049
  renderToasts = true,
@@ -1954,13 +2057,13 @@ function ThemeSharedProvider({
1954
2057
  const system = themeOverrides ? createAbpSystem(themeOverrides) : abpSystem;
1955
2058
  const { endSide } = useDirection();
1956
2059
  toastPosition = `bottom-${endSide}`;
1957
- const content = /* @__PURE__ */ jsx15(ToasterProvider, { children: /* @__PURE__ */ jsxs10(ConfirmationProvider, { children: [
2060
+ const content = /* @__PURE__ */ jsx16(ToasterProvider, { children: /* @__PURE__ */ jsxs11(ConfirmationProvider, { children: [
1958
2061
  children,
1959
- renderToasts && /* @__PURE__ */ jsx15(ToastContainer, { position: toastPosition }),
1960
- renderConfirmation && /* @__PURE__ */ jsx15(ConfirmationDialog, {})
2062
+ renderToasts && /* @__PURE__ */ jsx16(ToastContainer, { position: toastPosition }),
2063
+ renderConfirmation && /* @__PURE__ */ jsx16(ConfirmationDialog, {})
1961
2064
  ] }) });
1962
2065
  const colorModeProps = enableColorMode ? { defaultTheme: defaultColorMode } : { forcedTheme: "light" };
1963
- return /* @__PURE__ */ jsx15(ChakraProvider, { value: system, children: /* @__PURE__ */ jsx15(LocaleProvider, { locale, children: /* @__PURE__ */ jsx15(ColorModeProvider, { ...colorModeProps, children: content }) }) });
2066
+ return /* @__PURE__ */ jsx16(ChakraProvider, { value: system, children: /* @__PURE__ */ jsx16(LocaleProvider, { locale, children: /* @__PURE__ */ jsx16(ColorModeProvider, { ...colorModeProps, children: content }) }) });
1964
2067
  }
1965
2068
 
1966
2069
  // src/utils/styles.ts
@@ -2033,6 +2136,120 @@ function injectThemeSharedStyles() {
2033
2136
  }
2034
2137
  };
2035
2138
  }
2139
+
2140
+ // src/utils/validation-utils.ts
2141
+ var PASSWORD_SETTING_KEYS = {
2142
+ requiredLength: "Abp.Identity.Password.RequiredLength",
2143
+ maxLength: "Abp.Identity.Password.MaxLength",
2144
+ requireDigit: "Abp.Identity.Password.RequireDigit",
2145
+ requireLowercase: "Abp.Identity.Password.RequireLowercase",
2146
+ requireUppercase: "Abp.Identity.Password.RequireUppercase",
2147
+ requireNonAlphanumeric: "Abp.Identity.Password.RequireNonAlphanumeric",
2148
+ requiredUniqueChars: "Abp.Identity.Password.RequiredUniqueChars"
2149
+ };
2150
+ function parseBooleanSetting(value) {
2151
+ if (value === void 0) return void 0;
2152
+ return value.toLowerCase() === "true";
2153
+ }
2154
+ function parseIntegerSetting(value) {
2155
+ if (value === void 0) return void 0;
2156
+ const num = parseInt(value, 10);
2157
+ return isNaN(num) ? void 0 : num;
2158
+ }
2159
+ function getPasswordSettings(store) {
2160
+ return {
2161
+ requiredLength: parseIntegerSetting(store.getSetting(PASSWORD_SETTING_KEYS.requiredLength)),
2162
+ maxLength: parseIntegerSetting(store.getSetting(PASSWORD_SETTING_KEYS.maxLength)),
2163
+ requireDigit: parseBooleanSetting(store.getSetting(PASSWORD_SETTING_KEYS.requireDigit)),
2164
+ requireLowercase: parseBooleanSetting(store.getSetting(PASSWORD_SETTING_KEYS.requireLowercase)),
2165
+ requireUppercase: parseBooleanSetting(store.getSetting(PASSWORD_SETTING_KEYS.requireUppercase)),
2166
+ requireNonAlphanumeric: parseBooleanSetting(store.getSetting(PASSWORD_SETTING_KEYS.requireNonAlphanumeric)),
2167
+ requiredUniqueChars: parseIntegerSetting(store.getSetting(PASSWORD_SETTING_KEYS.requiredUniqueChars))
2168
+ };
2169
+ }
2170
+ function getPasswordValidators(store) {
2171
+ const settings = getPasswordSettings(store);
2172
+ const validators = [];
2173
+ if (settings.requiredLength && settings.requiredLength > 0) {
2174
+ validators.push((value) => {
2175
+ if (!value || value.length < settings.requiredLength) {
2176
+ return `Password must be at least ${settings.requiredLength} characters`;
2177
+ }
2178
+ return true;
2179
+ });
2180
+ }
2181
+ if (settings.maxLength && settings.maxLength > 0) {
2182
+ validators.push((value) => {
2183
+ if (value && value.length > settings.maxLength) {
2184
+ return `Password must be at most ${settings.maxLength} characters`;
2185
+ }
2186
+ return true;
2187
+ });
2188
+ }
2189
+ if (settings.requireDigit) {
2190
+ validators.push((value) => {
2191
+ if (!value || !/\d/.test(value)) {
2192
+ return "Password must contain at least one digit";
2193
+ }
2194
+ return true;
2195
+ });
2196
+ }
2197
+ if (settings.requireLowercase) {
2198
+ validators.push((value) => {
2199
+ if (!value || !/[a-z]/.test(value)) {
2200
+ return "Password must contain at least one lowercase letter";
2201
+ }
2202
+ return true;
2203
+ });
2204
+ }
2205
+ if (settings.requireUppercase) {
2206
+ validators.push((value) => {
2207
+ if (!value || !/[A-Z]/.test(value)) {
2208
+ return "Password must contain at least one uppercase letter";
2209
+ }
2210
+ return true;
2211
+ });
2212
+ }
2213
+ if (settings.requireNonAlphanumeric) {
2214
+ validators.push((value) => {
2215
+ if (!value || !/[^a-zA-Z0-9]/.test(value)) {
2216
+ return "Password must contain at least one special character";
2217
+ }
2218
+ return true;
2219
+ });
2220
+ }
2221
+ if (settings.requiredUniqueChars && settings.requiredUniqueChars > 0) {
2222
+ validators.push((value) => {
2223
+ if (!value) return true;
2224
+ const uniqueChars = new Set(value).size;
2225
+ if (uniqueChars < settings.requiredUniqueChars) {
2226
+ return `Password must contain at least ${settings.requiredUniqueChars} unique characters`;
2227
+ }
2228
+ return true;
2229
+ });
2230
+ }
2231
+ return validators;
2232
+ }
2233
+ function getPasswordValidationRules(store) {
2234
+ const validators = getPasswordValidators(store);
2235
+ const settings = getPasswordSettings(store);
2236
+ const validate = {};
2237
+ validators.forEach((validator, index) => {
2238
+ validate[`passwordRule${index}`] = validator;
2239
+ });
2240
+ return {
2241
+ required: "Password is required",
2242
+ minLength: settings.requiredLength ? {
2243
+ value: settings.requiredLength,
2244
+ message: `Password must be at least ${settings.requiredLength} characters`
2245
+ } : void 0,
2246
+ maxLength: settings.maxLength ? {
2247
+ value: settings.maxLength,
2248
+ message: `Password must be at most ${settings.maxLength} characters`
2249
+ } : void 0,
2250
+ validate
2251
+ };
2252
+ }
2036
2253
  export {
2037
2254
  AbpModalBody,
2038
2255
  AbpModalFooter,
@@ -2048,11 +2265,16 @@ export {
2048
2265
  DEFAULT_STYLES,
2049
2266
  ErrorComponent,
2050
2267
  FormField,
2268
+ HTTP_ERROR_CONFIG,
2269
+ HttpErrorConfigContext,
2051
2270
  LoaderBar,
2052
2271
  Modal,
2053
2272
  AbpModalBody as ModalBody,
2273
+ ModalContainer,
2054
2274
  AbpModalFooter as ModalFooter,
2055
2275
  AbpModalHeader as ModalHeader,
2276
+ ModalProvider,
2277
+ PASSWORD_SETTING_KEYS,
2056
2278
  Profile,
2057
2279
  THEME_SHARED_APPEND_CONTENT,
2058
2280
  THEME_SHARED_STYLES,
@@ -2066,14 +2288,22 @@ export {
2066
2288
  createErrorInterceptor,
2067
2289
  defaultAbpConfig,
2068
2290
  defineConfig,
2291
+ getPasswordSettings,
2292
+ getPasswordValidationRules,
2293
+ getPasswordValidators,
2069
2294
  getSeverityBg,
2070
2295
  getSeverityBorderColor,
2071
2296
  getSeverityColorPalette as getSeverityColorScheme,
2297
+ httpErrorConfigFactory,
2072
2298
  injectThemeSharedStyles,
2073
2299
  useConfirmation,
2074
2300
  useConfirmationContext,
2075
2301
  useConfirmationState,
2076
2302
  useErrorHandler,
2303
+ useHttpErrorConfig,
2304
+ useModal,
2305
+ useModalContext,
2306
+ useModalState,
2077
2307
  useToaster,
2078
2308
  useToasterContext,
2079
2309
  useToasts