@abpjs/theme-shared 2.2.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
@@ -197,10 +197,30 @@ var DEFAULT_STYLES = `
197
197
  }
198
198
  `;
199
199
 
200
+ // src/constants/append-content.ts
201
+ import { createContext } from "react";
202
+ var ThemeSharedAppendContentContext = createContext(void 0);
203
+ var THEME_SHARED_APPEND_CONTENT = "THEME_SHARED_APPEND_CONTENT";
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
+
200
220
  // src/contexts/toaster.context.tsx
201
221
  import {
202
- createContext,
203
- useContext,
222
+ createContext as createContext3,
223
+ useContext as useContext2,
204
224
  useCallback,
205
225
  useState,
206
226
  useRef,
@@ -208,7 +228,7 @@ import {
208
228
  useEffect
209
229
  } from "react";
210
230
  import { jsx } from "react/jsx-runtime";
211
- var ToasterContext = createContext(null);
231
+ var ToasterContext = createContext3(null);
212
232
  var toastCounter = 0;
213
233
  function generateId() {
214
234
  toastCounter += 1;
@@ -301,21 +321,21 @@ function ToasterProvider({ children }) {
301
321
  return /* @__PURE__ */ jsx(ToasterContext.Provider, { value, children });
302
322
  }
303
323
  function useToaster() {
304
- const context = useContext(ToasterContext);
324
+ const context = useContext2(ToasterContext);
305
325
  if (!context) {
306
326
  throw new Error("useToaster must be used within a ToasterProvider");
307
327
  }
308
328
  return context.service;
309
329
  }
310
330
  function useToasts() {
311
- const context = useContext(ToasterContext);
331
+ const context = useContext2(ToasterContext);
312
332
  if (!context) {
313
333
  throw new Error("useToasts must be used within a ToasterProvider");
314
334
  }
315
335
  return context.toasts;
316
336
  }
317
337
  function useToasterContext() {
318
- const context = useContext(ToasterContext);
338
+ const context = useContext2(ToasterContext);
319
339
  if (!context) {
320
340
  throw new Error("useToasterContext must be used within a ToasterProvider");
321
341
  }
@@ -324,8 +344,8 @@ function useToasterContext() {
324
344
 
325
345
  // src/contexts/confirmation.context.tsx
326
346
  import {
327
- createContext as createContext2,
328
- useContext as useContext2,
347
+ createContext as createContext4,
348
+ useContext as useContext3,
329
349
  useCallback as useCallback2,
330
350
  useState as useState2,
331
351
  useRef as useRef2,
@@ -333,7 +353,7 @@ import {
333
353
  useEffect as useEffect2
334
354
  } from "react";
335
355
  import { jsx as jsx2 } from "react/jsx-runtime";
336
- var ConfirmationContext = createContext2(null);
356
+ var ConfirmationContext = createContext4(null);
337
357
  function generateId2() {
338
358
  return `confirmation-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
339
359
  }
@@ -440,29 +460,103 @@ function ConfirmationProvider({ children }) {
440
460
  return /* @__PURE__ */ jsx2(ConfirmationContext.Provider, { value, children });
441
461
  }
442
462
  function useConfirmation() {
443
- const context = useContext2(ConfirmationContext);
463
+ const context = useContext3(ConfirmationContext);
444
464
  if (!context) {
445
465
  throw new Error("useConfirmation must be used within a ConfirmationProvider");
446
466
  }
447
467
  return context.service;
448
468
  }
449
469
  function useConfirmationState() {
450
- const context = useContext2(ConfirmationContext);
470
+ const context = useContext3(ConfirmationContext);
451
471
  if (!context) {
452
472
  throw new Error("useConfirmationState must be used within a ConfirmationProvider");
453
473
  }
454
474
  return { confirmation: context.confirmation, respond: context.respond };
455
475
  }
456
476
  function useConfirmationContext() {
457
- const context = useContext2(ConfirmationContext);
477
+ const context = useContext3(ConfirmationContext);
458
478
  if (!context) {
459
479
  throw new Error("useConfirmationContext must be used within a ConfirmationProvider");
460
480
  }
461
481
  return context;
462
482
  }
463
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
+
464
558
  // src/handlers/error.handler.ts
465
- import { useCallback as useCallback3, useState as useState3 } from "react";
559
+ import { useCallback as useCallback4, useState as useState4 } from "react";
466
560
  var DEFAULT_ERROR_MESSAGES = {
467
561
  400: "AbpUi::DefaultErrorMessage400",
468
562
  401: "AbpUi::DefaultErrorMessage401",
@@ -474,22 +568,22 @@ var DEFAULT_ERROR_MESSAGES = {
474
568
  function useErrorHandler(options = {}) {
475
569
  const { navigate, loginPath = "/account/login" } = options;
476
570
  const confirmation = useConfirmation();
477
- const [errorComponentProps, setErrorComponentProps] = useState3(null);
478
- const navigateToLogin = useCallback3(() => {
571
+ const [errorComponentProps, setErrorComponentProps] = useState4(null);
572
+ const navigateToLogin = useCallback4(() => {
479
573
  if (navigate) {
480
574
  navigate(loginPath);
481
575
  }
482
576
  }, [navigate, loginPath]);
483
- const showError = useCallback3(
577
+ const showError = useCallback4(
484
578
  async (message, title) => {
485
579
  return confirmation.error(message, title || "AbpUi::Error");
486
580
  },
487
581
  [confirmation]
488
582
  );
489
- const clearErrorComponent = useCallback3(() => {
583
+ const clearErrorComponent = useCallback4(() => {
490
584
  setErrorComponentProps(null);
491
585
  }, []);
492
- const createErrorComponent = useCallback3(
586
+ const createErrorComponent = useCallback4(
493
587
  (instance) => {
494
588
  const props = {
495
589
  title: instance.title || "Error",
@@ -502,7 +596,7 @@ function useErrorHandler(options = {}) {
502
596
  },
503
597
  [clearErrorComponent]
504
598
  );
505
- const handleError = useCallback3(
599
+ const handleError = useCallback4(
506
600
  async (error) => {
507
601
  if (error.status === 401) {
508
602
  navigateToLogin();
@@ -544,7 +638,7 @@ function isHttpErrorResponse(error) {
544
638
  }
545
639
 
546
640
  // src/components/toast/Toast.tsx
547
- 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";
548
642
  import {
549
643
  Toaster as ChakraToaster,
550
644
  Portal,
@@ -563,7 +657,7 @@ import {
563
657
  XCircle,
564
658
  Circle
565
659
  } from "lucide-react";
566
- import { jsx as jsx3, jsxs } from "react/jsx-runtime";
660
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
567
661
  function resolveLocalizationParam(param) {
568
662
  if (param === void 0) return void 0;
569
663
  if (typeof param === "string") return param;
@@ -573,16 +667,16 @@ function SeverityIcon({ severity }) {
573
667
  const iconProps = { size: 20 };
574
668
  switch (severity) {
575
669
  case "success":
576
- return /* @__PURE__ */ jsx3(CheckCircle, { ...iconProps, color: "var(--chakra-colors-green-500)" });
670
+ return /* @__PURE__ */ jsx4(CheckCircle, { ...iconProps, color: "var(--chakra-colors-green-500)" });
577
671
  case "info":
578
- return /* @__PURE__ */ jsx3(Info, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
672
+ return /* @__PURE__ */ jsx4(Info, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
579
673
  case "warning":
580
- return /* @__PURE__ */ jsx3(AlertTriangle, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
674
+ return /* @__PURE__ */ jsx4(AlertTriangle, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
581
675
  case "error":
582
- return /* @__PURE__ */ jsx3(XCircle, { ...iconProps, color: "var(--chakra-colors-red-500)" });
676
+ return /* @__PURE__ */ jsx4(XCircle, { ...iconProps, color: "var(--chakra-colors-red-500)" });
583
677
  case "neutral":
584
678
  default:
585
- return /* @__PURE__ */ jsx3(Circle, { ...iconProps, color: "var(--chakra-colors-gray-500)" });
679
+ return /* @__PURE__ */ jsx4(Circle, { ...iconProps, color: "var(--chakra-colors-gray-500)" });
586
680
  }
587
681
  }
588
682
  function getSeverityColorPalette(severity) {
@@ -677,10 +771,10 @@ function getToaster(placement) {
677
771
  function ToastContainer({ position = "bottom-right", containerKey }) {
678
772
  const { toasts, service } = useToasterContext();
679
773
  const { t } = useLocalization();
680
- const displayedToastsRef = useRef3(/* @__PURE__ */ new Set());
681
- const placement = useMemo3(() => getPlacement(position), [position]);
682
- const toaster = useMemo3(() => getToaster(placement), [placement]);
683
- 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(() => {
684
778
  if (!containerKey) return toasts;
685
779
  return toasts.filter((toast) => toast.options?.containerKey === containerKey);
686
780
  }, [toasts, containerKey]);
@@ -717,10 +811,10 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
717
811
  });
718
812
  });
719
813
  }, [filteredToasts, t, service, toaster]);
720
- 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) => {
721
815
  const severity = toast.meta?.severity || "info";
722
816
  const closable = toast.meta?.closable !== false;
723
- return /* @__PURE__ */ jsx3(
817
+ return /* @__PURE__ */ jsx4(
724
818
  Toast.Root,
725
819
  {
726
820
  bg: getSeverityBg(severity),
@@ -729,13 +823,13 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
729
823
  borderRadius: "lg",
730
824
  boxShadow: "lg",
731
825
  width: { md: "sm" },
732
- children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", gap: 3, p: 4, children: [
733
- /* @__PURE__ */ jsx3(Box, { flexShrink: 0, pt: "2px", children: /* @__PURE__ */ jsx3(SeverityIcon, { severity }) }),
734
- /* @__PURE__ */ jsxs(Stack, { gap: 1, flex: 1, children: [
735
- toast.title && /* @__PURE__ */ jsx3(Toast.Title, { fontWeight: "bold", fontSize: "sm", color: "fg", children: toast.title }),
736
- 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 })
737
831
  ] }),
738
- 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" }) })
739
833
  ] })
740
834
  }
741
835
  );
@@ -743,7 +837,7 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
743
837
  }
744
838
 
745
839
  // src/components/confirmation/Confirmation.tsx
746
- import { useRef as useRef4 } from "react";
840
+ import { useRef as useRef5 } from "react";
747
841
  import {
748
842
  Dialog,
749
843
  Portal as Portal2,
@@ -759,7 +853,7 @@ import {
759
853
  XCircle as XCircle2,
760
854
  Circle as Circle2
761
855
  } from "lucide-react";
762
- import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
856
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
763
857
  function resolveLocalizationParam2(param) {
764
858
  if (param === void 0) return void 0;
765
859
  if (typeof param === "string") return param;
@@ -774,16 +868,16 @@ function SeverityIcon2({ severity }) {
774
868
  const iconProps = { size: 24 };
775
869
  switch (severity) {
776
870
  case "success":
777
- return /* @__PURE__ */ jsx4(CheckCircle2, { ...iconProps, color: "var(--chakra-colors-green-500)" });
871
+ return /* @__PURE__ */ jsx5(CheckCircle2, { ...iconProps, color: "var(--chakra-colors-green-500)" });
778
872
  case "info":
779
- return /* @__PURE__ */ jsx4(Info2, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
873
+ return /* @__PURE__ */ jsx5(Info2, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
780
874
  case "warning":
781
- return /* @__PURE__ */ jsx4(AlertTriangle2, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
875
+ return /* @__PURE__ */ jsx5(AlertTriangle2, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
782
876
  case "error":
783
- return /* @__PURE__ */ jsx4(XCircle2, { ...iconProps, color: "var(--chakra-colors-red-500)" });
877
+ return /* @__PURE__ */ jsx5(XCircle2, { ...iconProps, color: "var(--chakra-colors-red-500)" });
784
878
  case "neutral":
785
879
  default:
786
- return /* @__PURE__ */ jsx4(Circle2, { ...iconProps, color: "var(--chakra-colors-gray-500)" });
880
+ return /* @__PURE__ */ jsx5(Circle2, { ...iconProps, color: "var(--chakra-colors-gray-500)" });
787
881
  }
788
882
  }
789
883
  function getSeverityColorPalette2(severity) {
@@ -804,7 +898,7 @@ function getSeverityColorPalette2(severity) {
804
898
  function ConfirmationDialog({ className }) {
805
899
  const { confirmation, respond } = useConfirmationState();
806
900
  const { t } = useLocalization2();
807
- const cancelRef = useRef4(null);
901
+ const cancelRef = useRef5(null);
808
902
  if (!confirmation) {
809
903
  return null;
810
904
  }
@@ -834,7 +928,7 @@ function ConfirmationDialog({ className }) {
834
928
  handleDismiss();
835
929
  }
836
930
  };
837
- return /* @__PURE__ */ jsx4(
931
+ return /* @__PURE__ */ jsx5(
838
932
  Dialog.Root,
839
933
  {
840
934
  open: true,
@@ -842,16 +936,16 @@ function ConfirmationDialog({ className }) {
842
936
  role: "alertdialog",
843
937
  placement: "center",
844
938
  initialFocusEl: () => cancelRef.current,
845
- children: /* @__PURE__ */ jsxs2(Portal2, { children: [
846
- /* @__PURE__ */ jsx4(Dialog.Backdrop, {}),
847
- /* @__PURE__ */ jsx4(Dialog.Positioner, { children: /* @__PURE__ */ jsxs2(Dialog.Content, { className, maxWidth: "md", children: [
848
- /* @__PURE__ */ jsx4(Dialog.Header, { children: /* @__PURE__ */ jsxs2(Flex2, { align: "center", gap: 3, children: [
849
- /* @__PURE__ */ jsx4(SeverityIcon2, { severity }),
850
- 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 }) })
851
945
  ] }) }),
852
- /* @__PURE__ */ jsx4(Dialog.Body, { children: /* @__PURE__ */ jsx4(Text, { color: "gray.600", children: localizedMessage }) }),
853
- /* @__PURE__ */ jsx4(Dialog.Footer, { children: /* @__PURE__ */ jsxs2(Flex2, { gap: 3, children: [
854
- !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(
855
949
  Button,
856
950
  {
857
951
  ref: cancelRef,
@@ -860,7 +954,7 @@ function ConfirmationDialog({ className }) {
860
954
  children: cancelCopy
861
955
  }
862
956
  ),
863
- !options?.hideYesBtn && /* @__PURE__ */ jsx4(
957
+ !options?.hideYesBtn && /* @__PURE__ */ jsx5(
864
958
  Button,
865
959
  {
866
960
  colorPalette: getSeverityColorPalette2(severity),
@@ -876,17 +970,20 @@ function ConfirmationDialog({ className }) {
876
970
  }
877
971
 
878
972
  // src/components/errors/ErrorComponent.tsx
879
- import { Heading, Text as Text2, VStack, Button as Button2, Container } from "@chakra-ui/react";
880
- 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";
881
975
  function ErrorComponent({
882
976
  title = "Error",
883
977
  details = "An error has occurred.",
884
978
  onDestroy,
885
979
  showCloseButton = true,
886
- closeButtonText = "Go Back"
980
+ closeButtonText = "Go Back",
981
+ isHomeShow = false,
982
+ onHomeClick,
983
+ homeButtonText = "Go Home"
887
984
  }) {
888
- return /* @__PURE__ */ jsx5(Container, { maxW: "container.md", py: 20, children: /* @__PURE__ */ jsxs3(VStack, { gap: 6, textAlign: "center", children: [
889
- /* @__PURE__ */ jsx5(
985
+ return /* @__PURE__ */ jsx6(Container, { maxW: "container.md", py: 20, children: /* @__PURE__ */ jsxs4(VStack, { gap: 6, textAlign: "center", children: [
986
+ /* @__PURE__ */ jsx6(
890
987
  Heading,
891
988
  {
892
989
  size: "4xl",
@@ -895,23 +992,34 @@ function ErrorComponent({
895
992
  children: title
896
993
  }
897
994
  ),
898
- /* @__PURE__ */ jsx5(Text2, { fontSize: "lg", color: "gray.600", children: details }),
899
- showCloseButton && onDestroy && /* @__PURE__ */ jsx5(
900
- Button2,
901
- {
902
- colorPalette: "blue",
903
- size: "lg",
904
- onClick: onDestroy,
905
- children: closeButtonText
906
- }
907
- )
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
+ ] })
908
1016
  ] }) });
909
1017
  }
910
1018
 
911
1019
  // src/components/loader-bar/LoaderBar.tsx
912
- 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";
913
1021
  import { useLoader } from "@abpjs/core";
914
- import { jsx as jsx6 } from "react/jsx-runtime";
1022
+ import { jsx as jsx7 } from "react/jsx-runtime";
915
1023
  function LoaderBar({
916
1024
  containerClass = "abp-loader-bar",
917
1025
  progressClass = "abp-progress",
@@ -920,9 +1028,9 @@ function LoaderBar({
920
1028
  stopDelay = 400
921
1029
  }) {
922
1030
  const { loading } = useLoader();
923
- const [isLoading, setIsLoading] = useState4(false);
924
- const [progressLevel, setProgressLevel] = useState4(0);
925
- const intervalRef = useRef5(null);
1031
+ const [isLoading, setIsLoading] = useState5(false);
1032
+ const [progressLevel, setProgressLevel] = useState5(0);
1033
+ const intervalRef = useRef6(null);
926
1034
  useEffect4(() => {
927
1035
  if (loading) {
928
1036
  startLoading();
@@ -970,7 +1078,7 @@ function LoaderBar({
970
1078
  if (!isLoading && progressLevel === 0) {
971
1079
  return null;
972
1080
  }
973
- return /* @__PURE__ */ jsx6(
1081
+ return /* @__PURE__ */ jsx7(
974
1082
  "div",
975
1083
  {
976
1084
  className: containerClass,
@@ -984,7 +1092,7 @@ function LoaderBar({
984
1092
  backgroundColor: "rgba(0, 0, 0, 0.1)",
985
1093
  overflow: "hidden"
986
1094
  },
987
- children: /* @__PURE__ */ jsx6(
1095
+ children: /* @__PURE__ */ jsx7(
988
1096
  "div",
989
1097
  {
990
1098
  className: progressClass,
@@ -1001,7 +1109,7 @@ function LoaderBar({
1001
1109
  }
1002
1110
 
1003
1111
  // src/components/modal/Modal.tsx
1004
- import React6 from "react";
1112
+ import React7 from "react";
1005
1113
  import {
1006
1114
  Dialog as Dialog2,
1007
1115
  Portal as Portal3,
@@ -1011,7 +1119,7 @@ import {
1011
1119
  Separator,
1012
1120
  CloseButton as CloseButton2
1013
1121
  } from "@chakra-ui/react";
1014
- 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";
1015
1123
  function getSizeWidth(size) {
1016
1124
  switch (size) {
1017
1125
  case "sm":
@@ -1049,12 +1157,12 @@ function Modal({
1049
1157
  preventScroll = true,
1050
1158
  onInit
1051
1159
  }) {
1052
- const prevVisibleRef = React6.useRef(false);
1053
- const onInitRef = React6.useRef(onInit);
1054
- React6.useEffect(() => {
1160
+ const prevVisibleRef = React7.useRef(false);
1161
+ const onInitRef = React7.useRef(onInit);
1162
+ React7.useEffect(() => {
1055
1163
  onInitRef.current = onInit;
1056
1164
  }, [onInit]);
1057
- React6.useEffect(() => {
1165
+ React7.useEffect(() => {
1058
1166
  if (visible && !prevVisibleRef.current && onInitRef.current) {
1059
1167
  onInitRef.current();
1060
1168
  }
@@ -1066,7 +1174,7 @@ function Modal({
1066
1174
  }
1067
1175
  onVisibleChange?.(details.open);
1068
1176
  };
1069
- return /* @__PURE__ */ jsx7(
1177
+ return /* @__PURE__ */ jsx8(
1070
1178
  Dialog2.Root,
1071
1179
  {
1072
1180
  open: visible,
@@ -1078,9 +1186,9 @@ function Modal({
1078
1186
  motionPreset,
1079
1187
  trapFocus,
1080
1188
  preventScroll,
1081
- children: /* @__PURE__ */ jsxs4(Portal3, { children: [
1082
- /* @__PURE__ */ jsx7(Dialog2.Backdrop, {}),
1083
- /* @__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(
1084
1192
  Dialog2.Content,
1085
1193
  {
1086
1194
  className: modalClass,
@@ -1090,17 +1198,17 @@ function Modal({
1090
1198
  height,
1091
1199
  minHeight,
1092
1200
  children: [
1093
- (header || showCloseButton) && /* @__PURE__ */ jsxs4(Fragment, { children: [
1094
- /* @__PURE__ */ jsx7(Dialog2.Header, { children: /* @__PURE__ */ jsxs4(Flex3, { justify: "space-between", align: "center", width: "100%", children: [
1095
- header && /* @__PURE__ */ jsx7(Dialog2.Title, { children: /* @__PURE__ */ jsx7(Text3, { fontWeight: "bold", fontSize: "lg", children: header }) }),
1096
- 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" }) })
1097
1205
  ] }) }),
1098
- /* @__PURE__ */ jsx7(Separator, {})
1206
+ /* @__PURE__ */ jsx8(Separator, {})
1099
1207
  ] }),
1100
- children && /* @__PURE__ */ jsx7(Dialog2.Body, { py: 4, children }),
1101
- footer && /* @__PURE__ */ jsxs4(Fragment, { children: [
1102
- /* @__PURE__ */ jsx7(Separator, {}),
1103
- /* @__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 }) })
1104
1212
  ] })
1105
1213
  ]
1106
1214
  }
@@ -1110,18 +1218,18 @@ function Modal({
1110
1218
  );
1111
1219
  }
1112
1220
  function AbpModalHeader({ children, className }) {
1113
- return /* @__PURE__ */ jsx7(Text3, { fontWeight: "bold", fontSize: "lg", className, children });
1221
+ return /* @__PURE__ */ jsx8(Text3, { fontWeight: "bold", fontSize: "lg", className, children });
1114
1222
  }
1115
1223
  function AbpModalBody({ children, className }) {
1116
- return /* @__PURE__ */ jsx7(Box3, { color: "gray.600", className, children });
1224
+ return /* @__PURE__ */ jsx8(Box3, { color: "gray.600", className, children });
1117
1225
  }
1118
1226
  function AbpModalFooter({ children, className }) {
1119
- return /* @__PURE__ */ jsx7(Flex3, { gap: 3, justify: "flex-end", className, children });
1227
+ return /* @__PURE__ */ jsx8(Flex3, { gap: 3, justify: "flex-end", className, children });
1120
1228
  }
1121
1229
 
1122
1230
  // src/components/ui/Alert.tsx
1123
1231
  import { Alert as ChakraAlert } from "@chakra-ui/react";
1124
- 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";
1125
1233
  function Alert({
1126
1234
  status = "info",
1127
1235
  children,
@@ -1132,7 +1240,7 @@ function Alert({
1132
1240
  mb,
1133
1241
  borderRadius = "md"
1134
1242
  }) {
1135
- return /* @__PURE__ */ jsxs5(
1243
+ return /* @__PURE__ */ jsxs6(
1136
1244
  ChakraAlert.Root,
1137
1245
  {
1138
1246
  status,
@@ -1140,11 +1248,11 @@ function Alert({
1140
1248
  mb,
1141
1249
  borderRadius,
1142
1250
  children: [
1143
- showIcon && /* @__PURE__ */ jsx8(ChakraAlert.Indicator, {}),
1144
- title ? /* @__PURE__ */ jsxs5(Fragment2, { children: [
1145
- /* @__PURE__ */ jsx8(ChakraAlert.Title, { children: title }),
1146
- (description || children) && /* @__PURE__ */ jsx8(ChakraAlert.Description, { children: description || children })
1147
- ] }) : /* @__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 })
1148
1256
  ]
1149
1257
  }
1150
1258
  );
@@ -1153,7 +1261,7 @@ function Alert({
1153
1261
  // src/components/ui/Button.tsx
1154
1262
  import { forwardRef } from "react";
1155
1263
  import { Button as ChakraButton } from "@chakra-ui/react";
1156
- import { jsx as jsx9 } from "react/jsx-runtime";
1264
+ import { jsx as jsx10 } from "react/jsx-runtime";
1157
1265
  var Button3 = forwardRef(
1158
1266
  function Button4({
1159
1267
  children,
@@ -1170,7 +1278,7 @@ var Button3 = forwardRef(
1170
1278
  mr,
1171
1279
  ml
1172
1280
  }, ref) {
1173
- return /* @__PURE__ */ jsx9(
1281
+ return /* @__PURE__ */ jsx10(
1174
1282
  ChakraButton,
1175
1283
  {
1176
1284
  ref,
@@ -1195,7 +1303,7 @@ var Button3 = forwardRef(
1195
1303
  // src/components/ui/Checkbox.tsx
1196
1304
  import { forwardRef as forwardRef2 } from "react";
1197
1305
  import { Checkbox as ChakraCheckbox } from "@chakra-ui/react";
1198
- import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
1306
+ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
1199
1307
  var Checkbox = forwardRef2(
1200
1308
  function Checkbox2({
1201
1309
  children,
@@ -1213,7 +1321,7 @@ var Checkbox = forwardRef2(
1213
1321
  onChange,
1214
1322
  className
1215
1323
  }, ref) {
1216
- return /* @__PURE__ */ jsxs6(
1324
+ return /* @__PURE__ */ jsxs7(
1217
1325
  ChakraCheckbox.Root,
1218
1326
  {
1219
1327
  checked,
@@ -1226,7 +1334,7 @@ var Checkbox = forwardRef2(
1226
1334
  size,
1227
1335
  className,
1228
1336
  children: [
1229
- /* @__PURE__ */ jsx10(
1337
+ /* @__PURE__ */ jsx11(
1230
1338
  ChakraCheckbox.HiddenInput,
1231
1339
  {
1232
1340
  ref,
@@ -1236,8 +1344,8 @@ var Checkbox = forwardRef2(
1236
1344
  onChange
1237
1345
  }
1238
1346
  ),
1239
- /* @__PURE__ */ jsx10(ChakraCheckbox.Control, {}),
1240
- children && /* @__PURE__ */ jsx10(ChakraCheckbox.Label, { children })
1347
+ /* @__PURE__ */ jsx11(ChakraCheckbox.Control, {}),
1348
+ children && /* @__PURE__ */ jsx11(ChakraCheckbox.Label, { children })
1241
1349
  ]
1242
1350
  }
1243
1351
  );
@@ -1246,7 +1354,7 @@ var Checkbox = forwardRef2(
1246
1354
 
1247
1355
  // src/components/ui/FormField.tsx
1248
1356
  import { Field } from "@chakra-ui/react";
1249
- import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
1357
+ import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
1250
1358
  function FormField({
1251
1359
  label,
1252
1360
  invalid = false,
@@ -1258,14 +1366,14 @@ function FormField({
1258
1366
  htmlFor,
1259
1367
  className
1260
1368
  }) {
1261
- return /* @__PURE__ */ jsxs7(Field.Root, { invalid, disabled, className, children: [
1262
- 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: [
1263
1371
  label,
1264
- required && /* @__PURE__ */ jsx11(Field.RequiredIndicator, {})
1372
+ required && /* @__PURE__ */ jsx12(Field.RequiredIndicator, {})
1265
1373
  ] }),
1266
1374
  children,
1267
- helperText && !invalid && /* @__PURE__ */ jsx11(Field.HelperText, { children: helperText }),
1268
- 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 })
1269
1377
  ] });
1270
1378
  }
1271
1379
 
@@ -1280,7 +1388,7 @@ import {
1280
1388
  import { useForm } from "react-hook-form";
1281
1389
  import { useLocalization as useLocalization3, useProfile } from "@abpjs/core";
1282
1390
  import { Check } from "lucide-react";
1283
- 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";
1284
1392
  function ChangePassword({
1285
1393
  visible,
1286
1394
  onVisibleChange
@@ -1343,9 +1451,9 @@ function ChangePassword({
1343
1451
  hasSpecial: (value) => /[!@#$%^&*(),.?":{}|<>]/.test(value) || t("AbpIdentity::PasswordRequiresNonAlphanumeric") || "Password must contain a special character"
1344
1452
  }
1345
1453
  };
1346
- const modalFooter = /* @__PURE__ */ jsxs8(Fragment3, { children: [
1347
- /* @__PURE__ */ jsx12(Button5, { variant: "ghost", mr: 3, onClick: handleClose, disabled: isSubmitting, children: t("AbpIdentity::Cancel") || "Cancel" }),
1348
- /* @__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(
1349
1457
  Button5,
1350
1458
  {
1351
1459
  colorPalette: "blue",
@@ -1353,13 +1461,13 @@ function ChangePassword({
1353
1461
  loading: isSubmitting,
1354
1462
  form: "change-password-form",
1355
1463
  children: [
1356
- /* @__PURE__ */ jsx12(Check, { size: 16 }),
1464
+ /* @__PURE__ */ jsx13(Check, { size: 16 }),
1357
1465
  t("AbpIdentity::Save") || "Save"
1358
1466
  ]
1359
1467
  }
1360
1468
  )
1361
1469
  ] });
1362
- return /* @__PURE__ */ jsx12(
1470
+ return /* @__PURE__ */ jsx13(
1363
1471
  Modal,
1364
1472
  {
1365
1473
  visible,
@@ -1368,13 +1476,13 @@ function ChangePassword({
1368
1476
  header: t("AbpIdentity::ChangePassword") || "Change Password",
1369
1477
  footer: modalFooter,
1370
1478
  centered: true,
1371
- children: /* @__PURE__ */ jsx12("form", { id: "change-password-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ jsxs8(VStack2, { gap: 4, children: [
1372
- /* @__PURE__ */ jsxs8(Field2.Root, { invalid: !!errors.password, children: [
1373
- /* @__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: [
1374
1482
  t("AbpIdentity::DisplayName:CurrentPassword") || "Current Password",
1375
- /* @__PURE__ */ jsx12(Field2.RequiredIndicator, {})
1483
+ /* @__PURE__ */ jsx13(Field2.RequiredIndicator, {})
1376
1484
  ] }),
1377
- /* @__PURE__ */ jsx12(
1485
+ /* @__PURE__ */ jsx13(
1378
1486
  Input,
1379
1487
  {
1380
1488
  type: "password",
@@ -1383,28 +1491,28 @@ function ChangePassword({
1383
1491
  })
1384
1492
  }
1385
1493
  ),
1386
- /* @__PURE__ */ jsx12(Field2.ErrorText, { children: errors.password?.message })
1494
+ /* @__PURE__ */ jsx13(Field2.ErrorText, { children: errors.password?.message })
1387
1495
  ] }),
1388
- /* @__PURE__ */ jsxs8(Field2.Root, { invalid: !!errors.newPassword, children: [
1389
- /* @__PURE__ */ jsxs8(Field2.Label, { children: [
1496
+ /* @__PURE__ */ jsxs9(Field2.Root, { invalid: !!errors.newPassword, children: [
1497
+ /* @__PURE__ */ jsxs9(Field2.Label, { children: [
1390
1498
  t("AbpIdentity::DisplayName:NewPassword") || "New Password",
1391
- /* @__PURE__ */ jsx12(Field2.RequiredIndicator, {})
1499
+ /* @__PURE__ */ jsx13(Field2.RequiredIndicator, {})
1392
1500
  ] }),
1393
- /* @__PURE__ */ jsx12(
1501
+ /* @__PURE__ */ jsx13(
1394
1502
  Input,
1395
1503
  {
1396
1504
  type: "password",
1397
1505
  ...register("newPassword", passwordValidation)
1398
1506
  }
1399
1507
  ),
1400
- /* @__PURE__ */ jsx12(Field2.ErrorText, { children: errors.newPassword?.message })
1508
+ /* @__PURE__ */ jsx13(Field2.ErrorText, { children: errors.newPassword?.message })
1401
1509
  ] }),
1402
- /* @__PURE__ */ jsxs8(Field2.Root, { invalid: !!errors.repeatNewPassword, children: [
1403
- /* @__PURE__ */ jsxs8(Field2.Label, { children: [
1510
+ /* @__PURE__ */ jsxs9(Field2.Root, { invalid: !!errors.repeatNewPassword, children: [
1511
+ /* @__PURE__ */ jsxs9(Field2.Label, { children: [
1404
1512
  t("AbpIdentity::DisplayName:NewPasswordConfirm") || "Confirm New Password",
1405
- /* @__PURE__ */ jsx12(Field2.RequiredIndicator, {})
1513
+ /* @__PURE__ */ jsx13(Field2.RequiredIndicator, {})
1406
1514
  ] }),
1407
- /* @__PURE__ */ jsx12(
1515
+ /* @__PURE__ */ jsx13(
1408
1516
  Input,
1409
1517
  {
1410
1518
  type: "password",
@@ -1414,7 +1522,7 @@ function ChangePassword({
1414
1522
  })
1415
1523
  }
1416
1524
  ),
1417
- /* @__PURE__ */ jsx12(Field2.ErrorText, { children: errors.repeatNewPassword?.message })
1525
+ /* @__PURE__ */ jsx13(Field2.ErrorText, { children: errors.repeatNewPassword?.message })
1418
1526
  ] })
1419
1527
  ] }) })
1420
1528
  }
@@ -1433,7 +1541,7 @@ import {
1433
1541
  import { useForm as useForm2 } from "react-hook-form";
1434
1542
  import { useLocalization as useLocalization4, useProfile as useProfile2 } from "@abpjs/core";
1435
1543
  import { Check as Check2 } from "lucide-react";
1436
- 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";
1437
1545
  function Profile({
1438
1546
  visible,
1439
1547
  onVisibleChange
@@ -1493,9 +1601,9 @@ function Profile({
1493
1601
  onVisibleChange(false);
1494
1602
  }
1495
1603
  };
1496
- const modalFooter = /* @__PURE__ */ jsxs9(Fragment4, { children: [
1497
- /* @__PURE__ */ jsx13(Button6, { variant: "ghost", mr: 3, onClick: handleClose, disabled: modalBusy, children: t("AbpIdentity::Cancel") || "Cancel" }),
1498
- /* @__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(
1499
1607
  Button6,
1500
1608
  {
1501
1609
  colorPalette: "blue",
@@ -1503,13 +1611,13 @@ function Profile({
1503
1611
  loading: modalBusy,
1504
1612
  form: "profile-form",
1505
1613
  children: [
1506
- /* @__PURE__ */ jsx13(Check2, { size: 16 }),
1614
+ /* @__PURE__ */ jsx14(Check2, { size: 16 }),
1507
1615
  t("AbpIdentity::Save") || "Save"
1508
1616
  ]
1509
1617
  }
1510
1618
  )
1511
1619
  ] });
1512
- return /* @__PURE__ */ jsx13(
1620
+ return /* @__PURE__ */ jsx14(
1513
1621
  Modal,
1514
1622
  {
1515
1623
  visible,
@@ -1519,13 +1627,13 @@ function Profile({
1519
1627
  footer: modalFooter,
1520
1628
  size: "lg",
1521
1629
  centered: true,
1522
- children: /* @__PURE__ */ jsx13("form", { id: "profile-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ jsxs9(VStack3, { gap: 4, children: [
1523
- /* @__PURE__ */ jsxs9(Field3.Root, { invalid: !!errors.userName, children: [
1524
- /* @__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: [
1525
1633
  t("AbpIdentity::DisplayName:UserName") || "Username",
1526
- /* @__PURE__ */ jsx13(Field3.RequiredIndicator, {})
1634
+ /* @__PURE__ */ jsx14(Field3.RequiredIndicator, {})
1527
1635
  ] }),
1528
- /* @__PURE__ */ jsx13(
1636
+ /* @__PURE__ */ jsx14(
1529
1637
  Input2,
1530
1638
  {
1531
1639
  type: "text",
@@ -1538,12 +1646,12 @@ function Profile({
1538
1646
  })
1539
1647
  }
1540
1648
  ),
1541
- /* @__PURE__ */ jsx13(Field3.ErrorText, { children: errors.userName?.message })
1649
+ /* @__PURE__ */ jsx14(Field3.ErrorText, { children: errors.userName?.message })
1542
1650
  ] }),
1543
- /* @__PURE__ */ jsxs9(HStack, { gap: 4, w: "full", children: [
1544
- /* @__PURE__ */ jsxs9(Field3.Root, { invalid: !!errors.name, flex: 1, children: [
1545
- /* @__PURE__ */ jsx13(Field3.Label, { children: t("AbpIdentity::DisplayName:Name") || "Name" }),
1546
- /* @__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(
1547
1655
  Input2,
1548
1656
  {
1549
1657
  type: "text",
@@ -1555,11 +1663,11 @@ function Profile({
1555
1663
  })
1556
1664
  }
1557
1665
  ),
1558
- /* @__PURE__ */ jsx13(Field3.ErrorText, { children: errors.name?.message })
1666
+ /* @__PURE__ */ jsx14(Field3.ErrorText, { children: errors.name?.message })
1559
1667
  ] }),
1560
- /* @__PURE__ */ jsxs9(Field3.Root, { invalid: !!errors.surname, flex: 1, children: [
1561
- /* @__PURE__ */ jsx13(Field3.Label, { children: t("AbpIdentity::DisplayName:Surname") || "Surname" }),
1562
- /* @__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(
1563
1671
  Input2,
1564
1672
  {
1565
1673
  type: "text",
@@ -1571,15 +1679,15 @@ function Profile({
1571
1679
  })
1572
1680
  }
1573
1681
  ),
1574
- /* @__PURE__ */ jsx13(Field3.ErrorText, { children: errors.surname?.message })
1682
+ /* @__PURE__ */ jsx14(Field3.ErrorText, { children: errors.surname?.message })
1575
1683
  ] })
1576
1684
  ] }),
1577
- /* @__PURE__ */ jsxs9(Field3.Root, { invalid: !!errors.email, children: [
1578
- /* @__PURE__ */ jsxs9(Field3.Label, { children: [
1685
+ /* @__PURE__ */ jsxs10(Field3.Root, { invalid: !!errors.email, children: [
1686
+ /* @__PURE__ */ jsxs10(Field3.Label, { children: [
1579
1687
  t("AbpIdentity::DisplayName:EmailAddress") || "Email Address",
1580
- /* @__PURE__ */ jsx13(Field3.RequiredIndicator, {})
1688
+ /* @__PURE__ */ jsx14(Field3.RequiredIndicator, {})
1581
1689
  ] }),
1582
- /* @__PURE__ */ jsx13(
1690
+ /* @__PURE__ */ jsx14(
1583
1691
  Input2,
1584
1692
  {
1585
1693
  type: "email",
@@ -1596,11 +1704,11 @@ function Profile({
1596
1704
  })
1597
1705
  }
1598
1706
  ),
1599
- /* @__PURE__ */ jsx13(Field3.ErrorText, { children: errors.email?.message })
1707
+ /* @__PURE__ */ jsx14(Field3.ErrorText, { children: errors.email?.message })
1600
1708
  ] }),
1601
- /* @__PURE__ */ jsxs9(Field3.Root, { invalid: !!errors.phoneNumber, children: [
1602
- /* @__PURE__ */ jsx13(Field3.Label, { children: t("AbpIdentity::DisplayName:PhoneNumber") || "Phone Number" }),
1603
- /* @__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(
1604
1712
  Input2,
1605
1713
  {
1606
1714
  type: "tel",
@@ -1612,7 +1720,7 @@ function Profile({
1612
1720
  })
1613
1721
  }
1614
1722
  ),
1615
- /* @__PURE__ */ jsx13(Field3.ErrorText, { children: errors.phoneNumber?.message })
1723
+ /* @__PURE__ */ jsx14(Field3.ErrorText, { children: errors.phoneNumber?.message })
1616
1724
  ] })
1617
1725
  ] }) })
1618
1726
  }
@@ -1857,11 +1965,11 @@ var abpSystem = createAbpSystem();
1857
1965
  // src/components/ui/color-mode.tsx
1858
1966
  import { ClientOnly, IconButton, Skeleton, Span } from "@chakra-ui/react";
1859
1967
  import { ThemeProvider, useTheme } from "next-themes";
1860
- import * as React11 from "react";
1968
+ import * as React12 from "react";
1861
1969
  import { Moon, Sun } from "lucide-react";
1862
- import { jsx as jsx14 } from "react/jsx-runtime";
1970
+ import { jsx as jsx15 } from "react/jsx-runtime";
1863
1971
  function ColorModeProvider(props) {
1864
- return /* @__PURE__ */ jsx14(ThemeProvider, { attribute: "class", disableTransitionOnChange: true, ...props });
1972
+ return /* @__PURE__ */ jsx15(ThemeProvider, { attribute: "class", disableTransitionOnChange: true, ...props });
1865
1973
  }
1866
1974
  function useColorMode() {
1867
1975
  const { resolvedTheme, setTheme, forcedTheme } = useTheme();
@@ -1877,11 +1985,11 @@ function useColorMode() {
1877
1985
  }
1878
1986
  function ColorModeIcon() {
1879
1987
  const { colorMode } = useColorMode();
1880
- return colorMode === "dark" ? /* @__PURE__ */ jsx14(Moon, {}) : /* @__PURE__ */ jsx14(Sun, {});
1988
+ return colorMode === "dark" ? /* @__PURE__ */ jsx15(Moon, {}) : /* @__PURE__ */ jsx15(Sun, {});
1881
1989
  }
1882
- var ColorModeButton = React11.forwardRef(function ColorModeButton2(props, ref) {
1990
+ var ColorModeButton = React12.forwardRef(function ColorModeButton2(props, ref) {
1883
1991
  const { toggleColorMode } = useColorMode();
1884
- 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(
1885
1993
  IconButton,
1886
1994
  {
1887
1995
  onClick: toggleColorMode,
@@ -1896,13 +2004,13 @@ var ColorModeButton = React11.forwardRef(function ColorModeButton2(props, ref) {
1896
2004
  height: "5"
1897
2005
  }
1898
2006
  },
1899
- children: /* @__PURE__ */ jsx14(ColorModeIcon, {})
2007
+ children: /* @__PURE__ */ jsx15(ColorModeIcon, {})
1900
2008
  }
1901
2009
  ) });
1902
2010
  });
1903
- var LightMode = React11.forwardRef(
2011
+ var LightMode = React12.forwardRef(
1904
2012
  function LightMode2(props, ref) {
1905
- return /* @__PURE__ */ jsx14(
2013
+ return /* @__PURE__ */ jsx15(
1906
2014
  Span,
1907
2015
  {
1908
2016
  color: "fg",
@@ -1916,9 +2024,9 @@ var LightMode = React11.forwardRef(
1916
2024
  );
1917
2025
  }
1918
2026
  );
1919
- var DarkMode = React11.forwardRef(
2027
+ var DarkMode = React12.forwardRef(
1920
2028
  function DarkMode2(props, ref) {
1921
- return /* @__PURE__ */ jsx14(
2029
+ return /* @__PURE__ */ jsx15(
1922
2030
  Span,
1923
2031
  {
1924
2032
  color: "fg",
@@ -1935,7 +2043,7 @@ var DarkMode = React11.forwardRef(
1935
2043
 
1936
2044
  // src/providers/ThemeSharedProvider.tsx
1937
2045
  import { useDirection } from "@abpjs/core";
1938
- import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
2046
+ import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
1939
2047
  function ThemeSharedProvider({
1940
2048
  children,
1941
2049
  renderToasts = true,
@@ -1949,13 +2057,13 @@ function ThemeSharedProvider({
1949
2057
  const system = themeOverrides ? createAbpSystem(themeOverrides) : abpSystem;
1950
2058
  const { endSide } = useDirection();
1951
2059
  toastPosition = `bottom-${endSide}`;
1952
- const content = /* @__PURE__ */ jsx15(ToasterProvider, { children: /* @__PURE__ */ jsxs10(ConfirmationProvider, { children: [
2060
+ const content = /* @__PURE__ */ jsx16(ToasterProvider, { children: /* @__PURE__ */ jsxs11(ConfirmationProvider, { children: [
1953
2061
  children,
1954
- renderToasts && /* @__PURE__ */ jsx15(ToastContainer, { position: toastPosition }),
1955
- renderConfirmation && /* @__PURE__ */ jsx15(ConfirmationDialog, {})
2062
+ renderToasts && /* @__PURE__ */ jsx16(ToastContainer, { position: toastPosition }),
2063
+ renderConfirmation && /* @__PURE__ */ jsx16(ConfirmationDialog, {})
1956
2064
  ] }) });
1957
2065
  const colorModeProps = enableColorMode ? { defaultTheme: defaultColorMode } : { forcedTheme: "light" };
1958
- 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 }) }) });
1959
2067
  }
1960
2068
 
1961
2069
  // src/utils/styles.ts
@@ -2028,6 +2136,120 @@ function injectThemeSharedStyles() {
2028
2136
  }
2029
2137
  };
2030
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
+ }
2031
2253
  export {
2032
2254
  AbpModalBody,
2033
2255
  AbpModalFooter,
@@ -2043,13 +2265,20 @@ export {
2043
2265
  DEFAULT_STYLES,
2044
2266
  ErrorComponent,
2045
2267
  FormField,
2268
+ HTTP_ERROR_CONFIG,
2269
+ HttpErrorConfigContext,
2046
2270
  LoaderBar,
2047
2271
  Modal,
2048
2272
  AbpModalBody as ModalBody,
2273
+ ModalContainer,
2049
2274
  AbpModalFooter as ModalFooter,
2050
2275
  AbpModalHeader as ModalHeader,
2276
+ ModalProvider,
2277
+ PASSWORD_SETTING_KEYS,
2051
2278
  Profile,
2279
+ THEME_SHARED_APPEND_CONTENT,
2052
2280
  THEME_SHARED_STYLES,
2281
+ ThemeSharedAppendContentContext,
2053
2282
  ThemeSharedProvider,
2054
2283
  ToastContainer,
2055
2284
  Toaster,
@@ -2059,14 +2288,22 @@ export {
2059
2288
  createErrorInterceptor,
2060
2289
  defaultAbpConfig,
2061
2290
  defineConfig,
2291
+ getPasswordSettings,
2292
+ getPasswordValidationRules,
2293
+ getPasswordValidators,
2062
2294
  getSeverityBg,
2063
2295
  getSeverityBorderColor,
2064
2296
  getSeverityColorPalette as getSeverityColorScheme,
2297
+ httpErrorConfigFactory,
2065
2298
  injectThemeSharedStyles,
2066
2299
  useConfirmation,
2067
2300
  useConfirmationContext,
2068
2301
  useConfirmationState,
2069
2302
  useErrorHandler,
2303
+ useHttpErrorConfig,
2304
+ useModal,
2305
+ useModalContext,
2306
+ useModalState,
2070
2307
  useToaster,
2071
2308
  useToasterContext,
2072
2309
  useToasts