@insforge/react 0.6.8 → 0.6.10

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.js CHANGED
@@ -16,6 +16,9 @@ import { createContext, useContext, useState, useMemo, useEffect, useRef, useCal
16
16
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
17
17
  import { createClient } from '@insforge/sdk';
18
18
  import { InsforgeContext } from '@insforge/shared/react';
19
+ import createCache from '@emotion/cache';
20
+ import { keyframes as keyframes$1, CacheProvider } from '@emotion/react';
21
+ import styled from '@emotion/styled';
19
22
  import { AlertTriangle, Check, EyeOff, Eye, Loader2, CircleCheck, LogOut } from 'lucide-react';
20
23
  import { z } from 'zod';
21
24
 
@@ -104,8 +107,7 @@ var InsforgeManager = class _InsforgeManager {
104
107
  this.config = { ...this.config, ...config };
105
108
  }
106
109
  // Public initialization method
107
- // Following Clerk's pattern: Even if we have initialState (isLoaded=true from cookies),
108
- // we still need to load full user data from SDK/API
110
+ // Even if we have initialState (isLoaded=true from cookies), we still need to load full user data from SDK/API
109
111
  async initialize() {
110
112
  if (this.isInitializing) {
111
113
  return;
@@ -440,7 +442,13 @@ var InsforgeManager = class _InsforgeManager {
440
442
  return;
441
443
  }
442
444
  if (initialState.userId) {
443
- this.user = initialState.user ?? null;
445
+ const normalizeValue = (val) => val && val !== "null" ? val : "";
446
+ this.user = {
447
+ id: initialState.userId,
448
+ email: normalizeValue(initialState.user?.email),
449
+ name: normalizeValue(initialState.user?.name),
450
+ avatarUrl: normalizeValue(initialState.user?.avatarUrl)
451
+ };
444
452
  } else {
445
453
  this.user = null;
446
454
  }
@@ -481,6 +489,17 @@ var InsforgeManager = class _InsforgeManager {
481
489
  this.listeners.clear();
482
490
  }
483
491
  };
492
+ function StyleProvider({ children, nonce }) {
493
+ const cache = useMemo(() => {
494
+ const emotionCache = createCache({
495
+ key: "if-styles",
496
+ prepend: true,
497
+ nonce
498
+ });
499
+ return emotionCache;
500
+ }, [nonce]);
501
+ return /* @__PURE__ */ jsx(CacheProvider, { value: cache, children });
502
+ }
484
503
  function InsforgeProviderCore({
485
504
  children,
486
505
  baseUrl,
@@ -551,7 +570,7 @@ function InsforgeProviderCore({
551
570
  return /* @__PURE__ */ jsx(InsforgeContext.Provider, { value: contextValue, children });
552
571
  }
553
572
  function InsforgeProvider(props) {
554
- return /* @__PURE__ */ jsx(NavigationProvider, { adapter: BrowserNavigationAdapter, children: /* @__PURE__ */ jsx(InsforgeProviderCore, { ...props }) });
573
+ return /* @__PURE__ */ jsx(StyleProvider, { children: /* @__PURE__ */ jsx(NavigationProvider, { adapter: BrowserNavigationAdapter, children: /* @__PURE__ */ jsx(InsforgeProviderCore, { ...props }) }) });
555
574
  }
556
575
  function useInsforge() {
557
576
  const context = useContext(InsforgeContext);
@@ -600,9 +619,538 @@ function usePublicAuthConfig() {
600
619
  }, [getPublicAuthConfig]);
601
620
  return { authConfig, isLoaded };
602
621
  }
622
+
623
+ // src/styles/theme.ts
624
+ var theme = {
625
+ colors: {
626
+ primary: "#000000",
627
+ primaryHover: "#1f1f1f",
628
+ text: "#000000",
629
+ textSecondary: "#828282",
630
+ textMuted: "#a3a3a3",
631
+ textGray: "#525252",
632
+ border: "#d4d4d4",
633
+ borderGray: "#e4e4e7",
634
+ borderHover: "#9ca3af",
635
+ borderFocus: "#000000",
636
+ bgWhite: "#ffffff",
637
+ bgLight: "#fafafa",
638
+ bgGray: "#f5f5f5",
639
+ bgHover: "#f9fafb",
640
+ error: "#dc2626",
641
+ errorBg: "#fee2e2",
642
+ success: "#16a34a",
643
+ successBg: "#d1fae5",
644
+ successDark: "#059669",
645
+ black: "#000000",
646
+ zinc900: "#09090b"
647
+ },
648
+ spacing: {
649
+ 1: "0.25rem",
650
+ // 4px
651
+ 2: "0.5rem",
652
+ // 8px
653
+ 3: "0.75rem",
654
+ // 12px
655
+ 4: "1rem",
656
+ // 16px
657
+ 6: "1.5rem",
658
+ // 24px
659
+ 8: "2rem",
660
+ // 32px
661
+ 10: "2.5rem"
662
+ // 40px
663
+ },
664
+ radius: {
665
+ xs: "0.125rem",
666
+ // 2px
667
+ sm: "0.25rem",
668
+ // 4px
669
+ md: "0.375rem",
670
+ // 6px
671
+ lg: "0.5rem",
672
+ // 8px
673
+ xl: "0.75rem",
674
+ // 12px
675
+ full: "9999px"
676
+ },
677
+ fontSize: {
678
+ xs: "0.75rem",
679
+ // 12px
680
+ sm: "0.875rem",
681
+ // 14px
682
+ base: "1rem",
683
+ // 16px
684
+ lg: "1.125rem",
685
+ // 18px
686
+ xl: "1.25rem",
687
+ // 20px
688
+ "2xl": "1.5rem"
689
+ // 24px
690
+ },
691
+ lineHeight: {
692
+ tight: "1rem",
693
+ // 16px
694
+ normal: "1.25rem",
695
+ // 20px
696
+ relaxed: "1.5rem",
697
+ // 24px
698
+ loose: "2rem"
699
+ // 32px
700
+ },
701
+ fontFamily: {
702
+ base: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif",
703
+ manrope: "'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif"
704
+ },
705
+ fontWeight: {
706
+ normal: 400,
707
+ medium: 500,
708
+ semibold: 600
709
+ },
710
+ shadow: {
711
+ sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
712
+ md: "0 1px 2px 0 rgba(0, 0, 0, 0.1)",
713
+ lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"
714
+ },
715
+ transition: {
716
+ fast: "150ms cubic-bezier(0.4, 0, 0.2, 1)",
717
+ base: "200ms cubic-bezier(0.4, 0, 0.2, 1)"
718
+ },
719
+ sizes: {
720
+ input: {
721
+ height: "2.5rem"
722
+ // 40px
723
+ },
724
+ button: {
725
+ height: "2.5rem",
726
+ // 40px for submit
727
+ heightOAuth: "2.25rem"
728
+ // 36px for OAuth
729
+ },
730
+ avatar: "2rem",
731
+ // 32px
732
+ icon: "1.25rem",
733
+ // 20px
734
+ iconSm: "1.125rem",
735
+ // 18px
736
+ iconLg: "1.5rem",
737
+ // 24px
738
+ verifyCode: "3rem",
739
+ // 48px
740
+ verifyIcon: "4rem",
741
+ // 64px
742
+ verifyIconInner: "2rem"
743
+ // 32px
744
+ }
745
+ };
746
+ var keyframes = {
747
+ spin: `
748
+ from {
749
+ transform: rotate(0deg);
750
+ }
751
+ to {
752
+ transform: rotate(360deg);
753
+ }
754
+ `
755
+ };
756
+
757
+ // src/components/atoms/styled.ts
758
+ var spinAnimation = keyframes$1`${keyframes.spin}`;
759
+ var AuthContainerWrapper = styled.div`
760
+ width: 100%;
761
+ max-width: 400px;
762
+ border-radius: ${theme.radius.xl};
763
+ overflow: hidden;
764
+ box-shadow: ${theme.shadow.lg};
765
+ `;
766
+ var AuthCard = styled.div`
767
+ background-color: ${theme.colors.bgWhite};
768
+ padding: ${theme.spacing[6]};
769
+ display: flex;
770
+ flex-direction: column;
771
+ justify-content: center;
772
+ align-items: stretch;
773
+ gap: ${theme.spacing[6]};
774
+ `;
775
+ var AuthHeaderWrapper = styled.div`
776
+ display: flex;
777
+ flex-direction: column;
778
+ justify-content: flex-start;
779
+ align-items: flex-start;
780
+ gap: ${theme.spacing[2]};
781
+ `;
782
+ var AuthHeaderTitle = styled.h1`
783
+ font-size: ${theme.fontSize["2xl"]};
784
+ font-weight: ${theme.fontWeight.semibold};
785
+ color: ${theme.colors.text};
786
+ line-height: ${theme.lineHeight.loose};
787
+ margin: 0;
788
+ font-family: ${theme.fontFamily.base};
789
+ `;
790
+ var AuthHeaderSubtitle = styled.p`
791
+ font-size: ${theme.fontSize.sm};
792
+ font-weight: ${theme.fontWeight.normal};
793
+ color: ${theme.colors.textSecondary};
794
+ line-height: ${theme.lineHeight.relaxed};
795
+ margin: 0;
796
+ font-family: ${theme.fontFamily.base};
797
+ `;
798
+ var FormFieldWrapper = styled.div`
799
+ display: flex;
800
+ flex-direction: column;
801
+ justify-content: center;
802
+ align-items: stretch;
803
+ gap: ${theme.spacing[1]};
804
+ `;
805
+ var FormFieldLabel = styled.label`
806
+ font-size: ${theme.fontSize.sm};
807
+ font-weight: ${theme.fontWeight.normal};
808
+ color: ${theme.colors.text};
809
+ line-height: ${theme.lineHeight.relaxed};
810
+ font-family: ${theme.fontFamily.base};
811
+ `;
812
+ var FormFieldInput = styled.input`
813
+ width: 100%;
814
+ display: flex;
815
+ align-items: center;
816
+ gap: ${theme.spacing[2]};
817
+ align-self: stretch;
818
+ padding: ${theme.spacing[2]} ${theme.spacing[3]};
819
+ border-radius: ${theme.radius.sm};
820
+ border: 1px solid ${theme.colors.border};
821
+ background-color: ${theme.colors.bgWhite};
822
+ font-size: ${theme.fontSize.sm};
823
+ font-weight: ${theme.fontWeight.normal};
824
+ line-height: ${theme.lineHeight.normal};
825
+ color: ${theme.colors.text};
826
+ font-family: ${theme.fontFamily.base};
827
+ transition: border-color ${theme.transition.base};
828
+
829
+ &::placeholder {
830
+ color: ${theme.colors.textMuted};
831
+ font-size: ${theme.fontSize.sm};
832
+ font-weight: ${theme.fontWeight.normal};
833
+ }
834
+
835
+ &:focus {
836
+ outline: none;
837
+ border-color: ${theme.colors.borderFocus};
838
+ }
839
+ `;
840
+ var PasswordFieldWrapper = styled.div`
841
+ display: flex;
842
+ flex-direction: column;
843
+ justify-content: center;
844
+ align-items: stretch;
845
+ gap: ${theme.spacing[1]};
846
+ `;
847
+ var PasswordFieldLabelRow = styled.div`
848
+ display: flex;
849
+ justify-content: space-between;
850
+ align-items: center;
851
+ `;
852
+ var PasswordFieldLabel = styled.label`
853
+ font-size: ${theme.fontSize.sm};
854
+ font-weight: ${theme.fontWeight.normal};
855
+ color: ${theme.colors.text};
856
+ line-height: ${theme.lineHeight.relaxed};
857
+ font-family: ${theme.fontFamily.base};
858
+ `;
859
+ var PasswordFieldForgotLink = styled.a`
860
+ font-size: ${theme.fontSize.sm};
861
+ font-weight: ${theme.fontWeight.normal};
862
+ color: ${theme.colors.textSecondary};
863
+ text-decoration: none;
864
+ transition: color ${theme.transition.fast};
865
+ font-family: ${theme.fontFamily.base};
866
+ cursor: pointer;
867
+ `;
868
+ var PasswordFieldInputWrapper = styled.div`
869
+ position: relative;
870
+ width: 100%;
871
+ `;
872
+ var PasswordFieldInput = styled.input`
873
+ width: 100%;
874
+ display: flex;
875
+ align-items: center;
876
+ align-self: stretch;
877
+ padding: ${theme.spacing[2]} ${theme.spacing[3]};
878
+ padding-right: 2.5rem;
879
+ border-radius: ${theme.radius.sm};
880
+ border: 1px solid ${theme.colors.border};
881
+ background-color: ${theme.colors.bgWhite};
882
+ font-size: ${theme.fontSize.sm};
883
+ font-weight: ${theme.fontWeight.normal};
884
+ line-height: ${theme.lineHeight.normal};
885
+ color: ${theme.colors.text};
886
+ font-family: ${theme.fontFamily.base};
887
+ transition: border-color ${theme.transition.base};
888
+
889
+ &::placeholder {
890
+ color: ${theme.colors.textMuted};
891
+ }
892
+
893
+ &:focus {
894
+ outline: none;
895
+ border-color: ${theme.colors.borderFocus};
896
+ }
897
+ `;
898
+ var PasswordFieldToggleButton = styled.button`
899
+ position: absolute;
900
+ right: ${theme.spacing[1]};
901
+ top: 50%;
902
+ transform: translateY(-50%);
903
+ background: none;
904
+ border: none;
905
+ cursor: pointer;
906
+ padding: ${theme.spacing[1]};
907
+ display: flex;
908
+ align-items: center;
909
+ justify-content: center;
910
+ color: ${theme.colors.textSecondary};
911
+ transition: color ${theme.transition.fast};
912
+ `;
913
+ var SubmitButton = styled.button`
914
+ border-radius: ${theme.radius.sm};
915
+ background-color: ${theme.colors.primary};
916
+ height: ${theme.sizes.button.height};
917
+ width: 100%;
918
+ display: flex;
919
+ margin-top: ${theme.spacing[4]};
920
+ padding: ${theme.spacing[2]} ${theme.spacing[4]};
921
+ justify-content: center;
922
+ align-items: center;
923
+ gap: 0.625rem;
924
+ align-self: stretch;
925
+ color: ${theme.colors.bgWhite};
926
+ font-weight: ${theme.fontWeight.semibold};
927
+ font-family: ${theme.fontFamily.manrope};
928
+ font-size: ${theme.fontSize.base};
929
+ line-height: normal;
930
+ border: none;
931
+ cursor: pointer;
932
+ transition: background-color ${theme.transition.base};
933
+
934
+ &:hover:not(:disabled) {
935
+ background-color: ${theme.colors.primaryHover};
936
+ }
937
+
938
+ &:disabled {
939
+ opacity: 0.5;
940
+ cursor: not-allowed;
941
+ }
942
+ `;
943
+ var SubmitButtonIcon = styled.div`
944
+ width: ${theme.sizes.icon};
945
+ height: ${theme.sizes.icon};
946
+ display: flex;
947
+ align-items: center;
948
+ justify-content: center;
949
+
950
+ svg {
951
+ width: 100%;
952
+ height: 100%;
953
+ }
954
+ `;
955
+ var SubmitButtonSpinner = styled.div`
956
+ width: ${theme.sizes.icon};
957
+ height: ${theme.sizes.icon};
958
+ display: flex;
959
+ align-items: center;
960
+ justify-content: center;
961
+ animation: ${spinAnimation} 1s linear infinite;
962
+
963
+ svg {
964
+ width: 100%;
965
+ height: 100%;
966
+ }
967
+ `;
968
+ var OAuthButton = styled.button`
969
+ display: flex;
970
+ width: 100%;
971
+ height: ${theme.sizes.button.heightOAuth};
972
+ padding: ${(props) => props.$variant === "short" || props.$variant === "iconOnly" ? theme.spacing[2] : `${theme.spacing[2]} ${theme.spacing[3]}`};
973
+ flex-direction: row;
974
+ justify-content: center;
975
+ align-items: center;
976
+ gap: ${(props) => props.$variant === "iconOnly" ? "0" : props.$variant === "short" ? theme.spacing[2] : theme.spacing[3]};
977
+ border-radius: ${theme.radius.md};
978
+ border: 1px solid ${theme.colors.borderGray};
979
+ background-color: ${theme.colors.bgWhite};
980
+ box-shadow: ${theme.shadow.md};
981
+ color: ${theme.colors.zinc900};
982
+ text-align: center;
983
+ font-size: ${theme.fontSize.sm};
984
+ font-weight: ${theme.fontWeight.medium};
985
+ line-height: ${theme.lineHeight.normal};
986
+ cursor: pointer;
987
+ transition: all ${theme.transition.base};
988
+ font-family: ${theme.fontFamily.base};
989
+
990
+ &:hover:not(:disabled) {
991
+ background-color: ${theme.colors.bgHover};
992
+ border-color: ${theme.colors.borderHover};
993
+ }
994
+
995
+ &:disabled {
996
+ opacity: 0.6;
997
+ cursor: not-allowed;
998
+ }
999
+ `;
1000
+ var OAuthButtonIcon = styled.div`
1001
+ display: flex;
1002
+ align-items: center;
1003
+ justify-content: center;
1004
+ flex-shrink: 0;
1005
+ width: ${theme.sizes.iconSm};
1006
+ height: ${theme.sizes.iconSm};
1007
+
1008
+ svg {
1009
+ width: 100%;
1010
+ height: 100%;
1011
+ }
1012
+ `;
1013
+ var OAuthProvidersContainer = styled.div`
1014
+ display: flex;
1015
+ flex-direction: column;
1016
+ gap: ${theme.spacing[3]};
1017
+ width: 100%;
1018
+ `;
1019
+ var AuthLinkWrapper = styled.div`
1020
+ display: flex;
1021
+ justify-content: center;
1022
+ align-items: center;
1023
+ gap: ${theme.spacing[1]};
1024
+ font-size: ${theme.fontSize.sm};
1025
+ color: ${theme.colors.textSecondary};
1026
+ font-family: ${theme.fontFamily.base};
1027
+ `;
1028
+ var AuthLinkText = styled.span`
1029
+ font-weight: ${theme.fontWeight.normal};
1030
+ `;
1031
+ var AuthLinkLink = styled.a`
1032
+ font-weight: ${theme.fontWeight.semibold};
1033
+ color: ${theme.colors.text};
1034
+ text-decoration: none;
1035
+ transition: opacity ${theme.transition.fast};
1036
+ cursor: pointer;
1037
+ `;
1038
+ var AuthDividerWrapper = styled.div`
1039
+ display: flex;
1040
+ align-items: center;
1041
+ text-align: center;
1042
+ width: 100%;
1043
+ gap: ${theme.spacing[3]};
1044
+ `;
1045
+ var AuthDividerLine = styled.div`
1046
+ flex: 1;
1047
+ border-top: 1px solid ${theme.colors.border};
1048
+ `;
1049
+ var AuthDividerText = styled.span`
1050
+ font-size: ${theme.fontSize.sm};
1051
+ color: ${theme.colors.textSecondary};
1052
+ font-weight: ${theme.fontWeight.normal};
1053
+ font-family: ${theme.fontFamily.manrope};
1054
+ `;
1055
+ var ErrorBannerWrapper = styled.div`
1056
+ padding: ${theme.spacing[3]};
1057
+ background-color: ${theme.colors.errorBg};
1058
+ border-radius: ${theme.radius.md};
1059
+ border: 1px solid ${theme.colors.error};
1060
+ `;
1061
+ var ErrorBannerContent = styled.div`
1062
+ display: flex;
1063
+ align-items: center;
1064
+ gap: ${theme.spacing[2]};
1065
+ `;
1066
+ var ErrorBannerIcon = styled.div`
1067
+ width: ${theme.sizes.iconLg};
1068
+ height: ${theme.sizes.iconLg};
1069
+ flex-shrink: 0;
1070
+ color: ${theme.colors.error};
1071
+ display: flex;
1072
+ align-items: center;
1073
+ justify-content: center;
1074
+
1075
+ svg {
1076
+ width: 100%;
1077
+ height: 100%;
1078
+ }
1079
+ `;
1080
+ var ErrorBannerText = styled.p`
1081
+ font-size: ${theme.fontSize.sm};
1082
+ color: ${theme.colors.error};
1083
+ font-weight: ${theme.fontWeight.normal};
1084
+ font-family: ${theme.fontFamily.base};
1085
+ margin: 0;
1086
+ `;
1087
+ var AuthBrandingWrapper = styled.div`
1088
+ background-color: ${theme.colors.bgLight};
1089
+ padding: ${theme.spacing[4]} ${theme.spacing[2]};
1090
+ display: flex;
1091
+ flex-direction: row;
1092
+ justify-content: center;
1093
+ align-items: center;
1094
+ gap: ${theme.spacing[1]};
1095
+ `;
1096
+ var AuthBrandingText = styled.p`
1097
+ font-size: ${theme.fontSize.xs};
1098
+ font-weight: ${theme.fontWeight.medium};
1099
+ color: ${theme.colors.text};
1100
+ font-family: ${theme.fontFamily.manrope};
1101
+ margin: 0;
1102
+ `;
1103
+ var VerificationCodeInputContainer = styled.div`
1104
+ display: flex;
1105
+ gap: ${theme.spacing[3]};
1106
+ justify-content: center;
1107
+ `;
1108
+ var VerificationCodeInput = styled.input`
1109
+ width: ${theme.sizes.verifyCode};
1110
+ height: ${theme.sizes.verifyCode};
1111
+ text-align: center;
1112
+ font-size: ${theme.fontSize.base};
1113
+ font-weight: ${theme.fontWeight.semibold};
1114
+ border: 1px solid ${theme.colors.border};
1115
+ border-radius: ${theme.radius.sm};
1116
+ transition: border-color ${theme.transition.base};
1117
+ font-family: ${theme.fontFamily.manrope};
1118
+
1119
+ &:focus {
1120
+ outline: none;
1121
+ border-color: ${theme.colors.borderFocus};
1122
+ }
1123
+ `;
1124
+ var PasswordStrengthWrapper = styled.div`
1125
+ margin-top: ${theme.spacing[2]};
1126
+ `;
1127
+ styled.div`
1128
+ height: 100%;
1129
+ transition:
1130
+ width ${theme.transition.base},
1131
+ background-color ${theme.transition.base};
1132
+ `;
1133
+ styled.span`
1134
+ font-size: ${theme.fontSize.xs};
1135
+ color: ${theme.colors.textSecondary};
1136
+ font-family: ${theme.fontFamily.base};
1137
+ `;
1138
+ var PasswordStrengthRequirements = styled.div`
1139
+ display: flex;
1140
+ flex-direction: column;
1141
+ gap: ${theme.spacing[2]};
1142
+ font-size: ${theme.fontSize.sm};
1143
+ color: ${theme.colors.textGray};
1144
+ font-family: ${theme.fontFamily.base};
1145
+ `;
1146
+ var PasswordStrengthRequirement = styled.div`
1147
+ display: flex;
1148
+ align-items: center;
1149
+ gap: ${theme.spacing[2]};
1150
+ `;
603
1151
  function AuthBranding() {
604
- return /* @__PURE__ */ jsxs("div", { className: "if-authBranding if-internal-ab4k9w", children: [
605
- /* @__PURE__ */ jsx("p", { className: "if-authBranding-text", children: "Secured by" }),
1152
+ return /* @__PURE__ */ jsxs(AuthBrandingWrapper, { children: [
1153
+ /* @__PURE__ */ jsx(AuthBrandingText, { children: "Secured by" }),
606
1154
  /* @__PURE__ */ jsx("a", { href: "https://insforge.dev", target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsxs(
607
1155
  "svg",
608
1156
  {
@@ -671,30 +1219,30 @@ function AuthBranding() {
671
1219
  ] });
672
1220
  }
673
1221
  function AuthContainer({ children }) {
674
- return /* @__PURE__ */ jsxs("div", { className: "if-authContainer if-internal-a8f3d2", children: [
675
- /* @__PURE__ */ jsx("div", { className: "if-authCard if-internal-b2k9x1", children }),
1222
+ return /* @__PURE__ */ jsxs(AuthContainerWrapper, { children: [
1223
+ /* @__PURE__ */ jsx(AuthCard, { children }),
676
1224
  /* @__PURE__ */ jsx(AuthBranding, {})
677
1225
  ] });
678
1226
  }
679
1227
  function AuthHeader({ title, subtitle }) {
680
- return /* @__PURE__ */ jsxs("div", { className: "if-authHeader if-internal-h3m7w5", children: [
681
- /* @__PURE__ */ jsx("h1", { className: "if-authHeader-title if-internal-t4p1k9", children: title }),
682
- subtitle && /* @__PURE__ */ jsx("p", { className: "if-authHeader-subtitle if-internal-s7q2m3", children: subtitle })
1228
+ return /* @__PURE__ */ jsxs(AuthHeaderWrapper, { children: [
1229
+ /* @__PURE__ */ jsx(AuthHeaderTitle, { children: title }),
1230
+ subtitle && /* @__PURE__ */ jsx(AuthHeaderSubtitle, { children: subtitle })
683
1231
  ] });
684
1232
  }
685
1233
  function AuthErrorBanner({ error }) {
686
1234
  if (!error) {
687
1235
  return null;
688
1236
  }
689
- return /* @__PURE__ */ jsx("div", { className: "if-errorBanner if-internal-eb2m7k", children: /* @__PURE__ */ jsxs("div", { className: "if-errorBanner-content", children: [
690
- /* @__PURE__ */ jsx(AlertTriangle, { className: "if-errorBanner-icon" }),
691
- /* @__PURE__ */ jsx("span", { className: "if-errorBanner-text", children: error })
1237
+ return /* @__PURE__ */ jsx(ErrorBannerWrapper, { children: /* @__PURE__ */ jsxs(ErrorBannerContent, { children: [
1238
+ /* @__PURE__ */ jsx(ErrorBannerIcon, { children: /* @__PURE__ */ jsx(AlertTriangle, {}) }),
1239
+ /* @__PURE__ */ jsx(ErrorBannerText, { children: error })
692
1240
  ] }) });
693
1241
  }
694
1242
  function AuthFormField({ label, id, ...props }) {
695
- return /* @__PURE__ */ jsxs("div", { className: "if-formField if-internal-f9n6p2", children: [
696
- /* @__PURE__ */ jsx("label", { htmlFor: id, className: "if-formField-label if-internal-l3k8m1", children: label }),
697
- /* @__PURE__ */ jsx("input", { id, className: "if-formField-input if-internal-i2v8k4", ...props })
1243
+ return /* @__PURE__ */ jsxs(FormFieldWrapper, { children: [
1244
+ /* @__PURE__ */ jsx(FormFieldLabel, { htmlFor: id, children: label }),
1245
+ /* @__PURE__ */ jsx(FormFieldInput, { id, ...props })
698
1246
  ] });
699
1247
  }
700
1248
  function AuthPasswordStrengthIndicator({
@@ -702,7 +1250,7 @@ function AuthPasswordStrengthIndicator({
702
1250
  config
703
1251
  }) {
704
1252
  const requirements = createRequirements(config);
705
- return /* @__PURE__ */ jsx("div", { className: "if-passwordStrength if-internal-ps6w3k", children: /* @__PURE__ */ jsx("div", { className: "if-passwordStrength-requirements", children: requirements.map((req) => /* @__PURE__ */ jsxs("div", { className: "if-passwordStrength-requirement", children: [
1253
+ return /* @__PURE__ */ jsx(PasswordStrengthWrapper, { children: /* @__PURE__ */ jsx(PasswordStrengthRequirements, { children: requirements.map((req) => /* @__PURE__ */ jsxs(PasswordStrengthRequirement, { children: [
706
1254
  /* @__PURE__ */ jsx(
707
1255
  "div",
708
1256
  {
@@ -804,29 +1352,27 @@ function AuthPasswordField({
804
1352
  }
805
1353
  onFocus?.(e);
806
1354
  };
807
- return /* @__PURE__ */ jsxs("div", { className: "if-passwordField if-internal-p5w9m7", children: [
808
- (label || forgotPasswordLink) && /* @__PURE__ */ jsxs("div", { className: "if-passwordField-labelRow", children: [
809
- /* @__PURE__ */ jsx("label", { htmlFor: id, className: "if-passwordField-label", children: label }),
810
- forgotPasswordLink && resolvedForgotPasswordHref && /* @__PURE__ */ jsx(Link, { href: resolvedForgotPasswordHref, className: "if-passwordField-forgotLink", children: forgotPasswordLink.text || "Forget Password?" })
1355
+ return /* @__PURE__ */ jsxs(PasswordFieldWrapper, { children: [
1356
+ (label || forgotPasswordLink) && /* @__PURE__ */ jsxs(PasswordFieldLabelRow, { children: [
1357
+ /* @__PURE__ */ jsx(PasswordFieldLabel, { htmlFor: id, children: label }),
1358
+ forgotPasswordLink && resolvedForgotPasswordHref && /* @__PURE__ */ jsx(Link, { href: resolvedForgotPasswordHref, className: "", children: /* @__PURE__ */ jsx(PasswordFieldForgotLink, { as: "span", children: forgotPasswordLink.text || "Forget Password?" }) })
811
1359
  ] }),
812
- /* @__PURE__ */ jsxs("div", { className: "if-passwordField-inputWrapper", children: [
1360
+ /* @__PURE__ */ jsxs(PasswordFieldInputWrapper, { children: [
813
1361
  /* @__PURE__ */ jsx(
814
- "input",
1362
+ PasswordFieldInput,
815
1363
  {
816
1364
  id,
817
1365
  type: showPassword ? "text" : "password",
818
- className: "if-passwordField-input",
819
1366
  value,
820
1367
  onFocus: handleFocus,
821
1368
  ...props
822
1369
  }
823
1370
  ),
824
1371
  /* @__PURE__ */ jsx(
825
- "button",
1372
+ PasswordFieldToggleButton,
826
1373
  {
827
1374
  type: "button",
828
1375
  onClick: () => setShowPassword(!showPassword),
829
- className: "if-passwordField-toggleButton",
830
1376
  "aria-label": showPassword ? "Hide password" : "Show password",
831
1377
  children: showPassword ? /* @__PURE__ */ jsx(EyeOff, { size: 20 }) : /* @__PURE__ */ jsx(Eye, { size: 20 })
832
1378
  }
@@ -843,36 +1389,27 @@ function AuthSubmitButton({
843
1389
  type = "submit",
844
1390
  onClick
845
1391
  }) {
846
- return /* @__PURE__ */ jsxs(
847
- "button",
848
- {
849
- type,
850
- className: "if-submitButton if-internal-b8p3m4",
851
- disabled: disabled || isLoading || confirmed,
852
- onClick,
853
- children: [
854
- isLoading && /* @__PURE__ */ jsx(Loader2, { className: "if-submitButton-icon if-submitButton-spinner", size: 20 }),
855
- confirmed && /* @__PURE__ */ jsx(CircleCheck, { className: "if-submitButton-icon", size: 20 }),
856
- children
857
- ]
858
- }
859
- );
1392
+ return /* @__PURE__ */ jsxs(SubmitButton, { type, disabled: disabled || isLoading || confirmed, onClick, children: [
1393
+ isLoading && /* @__PURE__ */ jsx(SubmitButtonSpinner, { children: /* @__PURE__ */ jsx(Loader2, { size: 20 }) }),
1394
+ confirmed && /* @__PURE__ */ jsx(SubmitButtonIcon, { children: /* @__PURE__ */ jsx(CircleCheck, { size: 20 }) }),
1395
+ children
1396
+ ] });
860
1397
  }
861
1398
  function AuthLink({ text, linkText, href }) {
862
1399
  const searchParams = useSearchParams();
863
1400
  const { Link } = useNavigationAdapter();
864
1401
  const finalHref = resolveAuthUrl(href, searchParams);
865
- return /* @__PURE__ */ jsxs("p", { className: "if-authLink if-internal-al5w9p", children: [
866
- text && /* @__PURE__ */ jsx("span", { className: "if-authLink-text", children: text }),
1402
+ return /* @__PURE__ */ jsxs(AuthLinkWrapper, { children: [
1403
+ text && /* @__PURE__ */ jsx(AuthLinkText, { children: text }),
867
1404
  text && " ",
868
- /* @__PURE__ */ jsx(Link, { href: finalHref, className: "if-authLink-link", children: linkText })
1405
+ /* @__PURE__ */ jsx(Link, { href: finalHref, className: "", children: /* @__PURE__ */ jsx(AuthLinkLink, { as: "span", children: linkText }) })
869
1406
  ] });
870
1407
  }
871
1408
  function AuthDivider({ text = "or" }) {
872
- return /* @__PURE__ */ jsxs("div", { className: "if-authDivider if-internal-ad7k3m", children: [
873
- /* @__PURE__ */ jsx("div", { className: "if-authDivider-line" }),
874
- /* @__PURE__ */ jsx("span", { className: "if-authDivider-text", children: text }),
875
- /* @__PURE__ */ jsx("div", { className: "if-authDivider-line" })
1409
+ return /* @__PURE__ */ jsxs(AuthDividerWrapper, { children: [
1410
+ /* @__PURE__ */ jsx(AuthDividerLine, {}),
1411
+ /* @__PURE__ */ jsx(AuthDividerText, { children: text }),
1412
+ /* @__PURE__ */ jsx(AuthDividerLine, {})
876
1413
  ] });
877
1414
  }
878
1415
  var OAUTH_PROVIDER_CONFIG = {
@@ -1036,23 +1573,17 @@ function AuthOAuthButton({
1036
1573
  }
1037
1574
  return "";
1038
1575
  };
1039
- const className = [
1040
- "if-oauthButton",
1041
- "if-internal-o4k7w2",
1042
- displayMode === "full" && "if-oauthButton-full",
1043
- displayMode === "short" && "if-oauthButton-short",
1044
- displayMode === "icon" && "if-oauthButton-icon-only"
1045
- ].filter(Boolean).join(" ");
1576
+ const variant = displayMode === "icon" ? "iconOnly" : displayMode;
1046
1577
  return /* @__PURE__ */ jsxs(
1047
- "button",
1578
+ OAuthButton,
1048
1579
  {
1049
1580
  type: "button",
1050
1581
  onClick: () => onClick(provider),
1051
- className,
1582
+ $variant: variant,
1052
1583
  disabled: disabled || loading,
1053
1584
  style,
1054
1585
  children: [
1055
- loading ? /* @__PURE__ */ jsx(Loader2, { className: "if-oauthButton-icon if-submitButton-spinner", size: 18 }) : /* @__PURE__ */ jsx("span", { className: "if-oauthButton-icon", children: config.svg }),
1586
+ loading ? /* @__PURE__ */ jsx(SubmitButtonSpinner, { children: /* @__PURE__ */ jsx(Loader2, { size: 18 }) }) : /* @__PURE__ */ jsx(OAuthButtonIcon, { children: config.svg }),
1056
1587
  !loading && getButtonText() && /* @__PURE__ */ jsx("span", { children: getButtonText() })
1057
1588
  ]
1058
1589
  }
@@ -1111,14 +1642,12 @@ function AuthOAuthProviders({
1111
1642
  }
1112
1643
  };
1113
1644
  return /* @__PURE__ */ jsx(
1114
- "div",
1645
+ OAuthProvidersContainer,
1115
1646
  {
1116
- className: "if-oauthProviders if-internal-op3m8k",
1117
1647
  style: {
1118
1648
  display: "grid",
1119
1649
  gridTemplateColumns: "repeat(6, 1fr)",
1120
- gap: "0.75rem",
1121
- width: "100%"
1650
+ gap: "0.75rem"
1122
1651
  },
1123
1652
  children: providers.map((provider, index) => /* @__PURE__ */ jsx(
1124
1653
  AuthOAuthButton,
@@ -1185,8 +1714,8 @@ function AuthVerificationCodeInput({
1185
1714
  }
1186
1715
  }
1187
1716
  };
1188
- return /* @__PURE__ */ jsx("div", { className: "if-verificationCode-inputContainer", children: Array.from({ length }).map((_, index) => /* @__PURE__ */ jsx(
1189
- "input",
1717
+ return /* @__PURE__ */ jsx(VerificationCodeInputContainer, { children: Array.from({ length }).map((_, index) => /* @__PURE__ */ jsx(
1718
+ VerificationCodeInput,
1190
1719
  {
1191
1720
  ref: (el) => {
1192
1721
  inputRefs.current[index] = el;
@@ -1199,12 +1728,160 @@ function AuthVerificationCodeInput({
1199
1728
  onKeyDown: (e) => handleKeyDown(index, e),
1200
1729
  onPaste: handlePaste,
1201
1730
  disabled,
1202
- className: "if-verificationCode-input",
1203
1731
  autoComplete: "one-time-code"
1204
1732
  },
1205
1733
  index
1206
1734
  )) });
1207
1735
  }
1736
+ styled.form`
1737
+ display: flex;
1738
+ flex-direction: column;
1739
+ align-items: stretch;
1740
+ justify-content: center;
1741
+ gap: ${theme.spacing[6]};
1742
+ `;
1743
+ var VerificationStepWrapper = styled.div`
1744
+ display: flex;
1745
+ flex-direction: column;
1746
+ gap: ${theme.spacing[6]};
1747
+ align-items: stretch;
1748
+ `;
1749
+ var VerificationStepDescriptionContainer = styled.div`
1750
+ width: 100%;
1751
+ background-color: ${theme.colors.bgGray};
1752
+ border-radius: ${theme.radius.lg};
1753
+ padding: ${theme.spacing[3]} ${theme.spacing[3]} ${theme.spacing[6]} ${theme.spacing[3]};
1754
+ display: flex;
1755
+ flex-direction: column;
1756
+ gap: ${theme.spacing[3]};
1757
+ `;
1758
+ var VerificationStepDescriptionTitle = styled.h3`
1759
+ color: ${theme.colors.black};
1760
+ font-family: ${theme.fontFamily.base};
1761
+ font-size: ${theme.fontSize.base};
1762
+ font-style: normal;
1763
+ font-weight: ${theme.fontWeight.semibold};
1764
+ line-height: 24px;
1765
+ margin: 0;
1766
+ `;
1767
+ var VerificationStepDescription = styled.p`
1768
+ font-size: ${theme.fontSize.sm};
1769
+ color: ${theme.colors.textGray};
1770
+ text-align: left;
1771
+ font-family: ${theme.fontFamily.base};
1772
+ margin: 0;
1773
+ `;
1774
+ var VerificationEmail = styled.span`
1775
+ font-weight: ${theme.fontWeight.medium};
1776
+ color: ${theme.colors.text};
1777
+ `;
1778
+ var VerificationStepCodeContainer = styled.div`
1779
+ width: 100%;
1780
+ display: flex;
1781
+ flex-direction: column;
1782
+ gap: ${theme.spacing[10]};
1783
+ `;
1784
+ var VerificationStepCodeInputWrapper = styled.div`
1785
+ display: flex;
1786
+ flex-direction: column;
1787
+ gap: ${theme.spacing[6]};
1788
+ `;
1789
+ styled.p`
1790
+ font-size: ${theme.fontSize.sm};
1791
+ color: ${theme.colors.textSecondary};
1792
+ text-align: center;
1793
+ font-family: ${theme.fontFamily.base};
1794
+ margin: 0;
1795
+ `;
1796
+ var VerificationStepResendContainer = styled.div`
1797
+ width: 100%;
1798
+ font-size: ${theme.fontSize.sm};
1799
+ text-align: center;
1800
+ color: ${theme.colors.textSecondary};
1801
+ font-family: ${theme.fontFamily.base};
1802
+ `;
1803
+ var VerificationStepResendButton = styled.button`
1804
+ color: ${theme.colors.text};
1805
+ font-weight: ${theme.fontWeight.medium};
1806
+ transition: all ${theme.transition.base};
1807
+ background: none;
1808
+ border: none;
1809
+ padding: 0;
1810
+ font-family: ${theme.fontFamily.base};
1811
+ font-size: ${theme.fontSize.sm};
1812
+
1813
+ &:not(:disabled) {
1814
+ cursor: pointer;
1815
+ }
1816
+
1817
+ &:disabled {
1818
+ cursor: not-allowed;
1819
+ opacity: 0.5;
1820
+ }
1821
+ `;
1822
+ var VerifyStatusContainer = styled.div`
1823
+ width: 100%;
1824
+ display: flex;
1825
+ flex-direction: column;
1826
+ align-items: ${(props) => props.$stretch ? "stretch" : "center"};
1827
+ justify-content: center;
1828
+ gap: ${theme.spacing[6]};
1829
+ `;
1830
+ var VerifyStatusSpinner = styled.div`
1831
+ border-radius: ${theme.radius.full};
1832
+ height: ${theme.sizes.verifyCode};
1833
+ width: ${theme.sizes.verifyCode};
1834
+ border-bottom: 2px solid ${theme.colors.primary};
1835
+ `;
1836
+ var VerifyStatusSuccessContent = styled.div`
1837
+ display: flex;
1838
+ flex-direction: column;
1839
+ align-items: center;
1840
+ gap: ${theme.spacing[4]};
1841
+ `;
1842
+ var VerifyStatusSuccessIcon = styled.div`
1843
+ width: ${theme.sizes.verifyIcon};
1844
+ height: ${theme.sizes.verifyIcon};
1845
+ border-radius: ${theme.radius.full};
1846
+ background-color: ${theme.colors.successBg};
1847
+ display: flex;
1848
+ align-items: center;
1849
+ justify-content: center;
1850
+ `;
1851
+ var VerifyStatusSuccessIconSvg = styled.div`
1852
+ width: ${theme.sizes.verifyIconInner};
1853
+ height: ${theme.sizes.verifyIconInner};
1854
+ color: ${theme.colors.successDark};
1855
+ display: flex;
1856
+ align-items: center;
1857
+ justify-content: center;
1858
+
1859
+ svg {
1860
+ width: 100%;
1861
+ height: 100%;
1862
+ }
1863
+ `;
1864
+ var VerifyStatusTextCenter = styled.p`
1865
+ text-align: center;
1866
+ font-family: ${theme.fontFamily.base};
1867
+ font-size: ${theme.fontSize.sm};
1868
+ color: ${theme.colors.text};
1869
+ margin: 0;
1870
+ `;
1871
+ styled.div`
1872
+ display: none;
1873
+ `;
1874
+ styled.span`
1875
+ position: absolute;
1876
+ width: 1px;
1877
+ height: 1px;
1878
+ padding: 0;
1879
+ margin: -1px;
1880
+ overflow: hidden;
1881
+ clip: rect(0, 0, 0, 0);
1882
+ white-space: nowrap;
1883
+ border-width: 0;
1884
+ `;
1208
1885
  function AuthEmailVerificationStep({
1209
1886
  email,
1210
1887
  method,
@@ -1258,19 +1935,19 @@ function AuthEmailVerificationStep({
1258
1935
  setVerificationCode("");
1259
1936
  }
1260
1937
  };
1261
- return /* @__PURE__ */ jsxs("div", { className: "if-verificationStep", children: [
1262
- isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-descriptionContainer", children: [
1263
- /* @__PURE__ */ jsx("p", { className: "if-verificationStep-descriptionTitle", children: "Verify Your Email" }),
1264
- /* @__PURE__ */ jsx("p", { className: "if-verificationStep-description", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
1938
+ return /* @__PURE__ */ jsxs(VerificationStepWrapper, { children: [
1939
+ isLinkMethod && /* @__PURE__ */ jsxs(VerificationStepDescriptionContainer, { children: [
1940
+ /* @__PURE__ */ jsx(VerificationStepDescriptionTitle, { children: "Verify Your Email" }),
1941
+ /* @__PURE__ */ jsx(VerificationStepDescription, { children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
1265
1942
  part,
1266
- index < array.length - 1 && /* @__PURE__ */ jsx("span", { className: "if-verificationLink-email", children: email })
1943
+ index < array.length - 1 && /* @__PURE__ */ jsx(VerificationEmail, { children: email })
1267
1944
  ] }, index)) })
1268
1945
  ] }),
1269
- !isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-codeContainer", children: [
1270
- /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-codeInputWrapper", children: [
1271
- /* @__PURE__ */ jsx("p", { className: "if-verificationStep-codeDescription", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
1946
+ !isLinkMethod && /* @__PURE__ */ jsxs(VerificationStepCodeContainer, { children: [
1947
+ /* @__PURE__ */ jsxs(VerificationStepCodeInputWrapper, { children: [
1948
+ /* @__PURE__ */ jsx(VerificationStepDescription, { children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
1272
1949
  part,
1273
- index < array.length - 1 && /* @__PURE__ */ jsx("span", { className: "if-verificationCode-email", children: email })
1950
+ index < array.length - 1 && /* @__PURE__ */ jsx(VerificationEmail, { children: email })
1274
1951
  ] }, index)) }),
1275
1952
  /* @__PURE__ */ jsx(
1276
1953
  AuthVerificationCodeInput,
@@ -1294,17 +1971,16 @@ function AuthEmailVerificationStep({
1294
1971
  }
1295
1972
  )
1296
1973
  ] }),
1297
- /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-resendContainer", children: [
1974
+ /* @__PURE__ */ jsxs(VerificationStepResendContainer, { children: [
1298
1975
  "Didn't receive the email?",
1299
1976
  " ",
1300
1977
  /* @__PURE__ */ jsx(
1301
- "button",
1978
+ VerificationStepResendButton,
1302
1979
  {
1303
1980
  onClick: () => {
1304
1981
  void handleResend();
1305
1982
  },
1306
1983
  disabled: resendDisabled || isSending,
1307
- className: "if-verificationStep-resendButton",
1308
1984
  children: isSending ? "Sending..." : resendDisabled ? `Retry in (${resendCountdown}s)` : "Click to resend"
1309
1985
  }
1310
1986
  )
@@ -1363,16 +2039,16 @@ function AuthResetPasswordVerificationStep({
1363
2039
  setVerificationCode("");
1364
2040
  }
1365
2041
  };
1366
- return /* @__PURE__ */ jsxs("div", { className: "if-verificationStep", children: [
1367
- isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-descriptionContainer", children: [
1368
- /* @__PURE__ */ jsx("p", { className: "if-verificationStep-descriptionTitle", children: "Check Your Email" }),
1369
- /* @__PURE__ */ jsx("p", { className: "if-verificationStep-description", children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
2042
+ return /* @__PURE__ */ jsxs(VerificationStepWrapper, { children: [
2043
+ isLinkMethod && /* @__PURE__ */ jsxs(VerificationStepDescriptionContainer, { children: [
2044
+ /* @__PURE__ */ jsx(VerificationStepDescriptionTitle, { children: "Check Your Email" }),
2045
+ /* @__PURE__ */ jsx(VerificationStepDescription, { children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxs("span", { children: [
1370
2046
  part,
1371
- index < array.length - 1 && /* @__PURE__ */ jsx("span", { className: "if-verificationLink-email", children: email })
2047
+ index < array.length - 1 && /* @__PURE__ */ jsx(VerificationEmail, { children: email })
1372
2048
  ] }, index)) })
1373
2049
  ] }),
1374
- !isLinkMethod && /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-codeContainer", children: [
1375
- /* @__PURE__ */ jsx("div", { className: "if-verificationStep-codeInputWrapper", children: /* @__PURE__ */ jsx(
2050
+ !isLinkMethod && /* @__PURE__ */ jsxs(VerificationStepCodeContainer, { children: [
2051
+ /* @__PURE__ */ jsx(VerificationStepCodeInputWrapper, { children: /* @__PURE__ */ jsx(
1376
2052
  AuthVerificationCodeInput,
1377
2053
  {
1378
2054
  value: verificationCode,
@@ -1393,17 +2069,16 @@ function AuthResetPasswordVerificationStep({
1393
2069
  }
1394
2070
  )
1395
2071
  ] }),
1396
- /* @__PURE__ */ jsxs("div", { className: "if-verificationStep-resendContainer", children: [
2072
+ /* @__PURE__ */ jsxs(VerificationStepResendContainer, { children: [
1397
2073
  "Didn't receive the email?",
1398
2074
  " ",
1399
2075
  /* @__PURE__ */ jsx(
1400
- "button",
2076
+ VerificationStepResendButton,
1401
2077
  {
1402
2078
  onClick: () => {
1403
2079
  void handleResend();
1404
2080
  },
1405
2081
  disabled: resendDisabled || isSending,
1406
- className: "if-verificationStep-resendButton",
1407
2082
  children: isSending ? "Sending..." : resendDisabled ? `Retry in (${resendCountdown}s)` : "Click to resend"
1408
2083
  }
1409
2084
  )
@@ -1449,39 +2124,47 @@ function SignInForm({
1449
2124
  onVerifyCode,
1450
2125
  emailSent: false
1451
2126
  }
1452
- ) : /* @__PURE__ */ jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
1453
- /* @__PURE__ */ jsx(
1454
- AuthFormField,
1455
- {
1456
- id: "email",
1457
- type: "email",
1458
- label: emailLabel,
1459
- placeholder: emailPlaceholder,
1460
- value: email,
1461
- onChange: (e) => onEmailChange(e.target.value),
1462
- required: true,
1463
- autoComplete: "email"
1464
- }
1465
- ),
1466
- /* @__PURE__ */ jsx(
1467
- AuthPasswordField,
1468
- {
1469
- id: "password",
1470
- label: passwordLabel,
1471
- placeholder: passwordPlaceholder,
1472
- value: password,
1473
- onChange: (e) => onPasswordChange(e.target.value),
1474
- required: true,
1475
- autoComplete: "current-password",
1476
- authConfig,
1477
- forgotPasswordLink: forgotPasswordUrl ? {
1478
- href: forgotPasswordUrl,
1479
- text: forgotPasswordText
1480
- } : void 0
1481
- }
1482
- ),
1483
- /* @__PURE__ */ jsx(AuthSubmitButton, { isLoading: loading, disabled: loading || oauthLoading !== null, children: loading ? loadingButtonText : submitButtonText })
1484
- ] }),
2127
+ ) : /* @__PURE__ */ jsxs(
2128
+ "form",
2129
+ {
2130
+ onSubmit,
2131
+ noValidate: true,
2132
+ style: { display: "flex", flexDirection: "column", gap: theme.spacing[6] },
2133
+ children: [
2134
+ /* @__PURE__ */ jsx(
2135
+ AuthFormField,
2136
+ {
2137
+ id: "email",
2138
+ type: "email",
2139
+ label: emailLabel,
2140
+ placeholder: emailPlaceholder,
2141
+ value: email,
2142
+ onChange: (e) => onEmailChange(e.target.value),
2143
+ required: true,
2144
+ autoComplete: "email"
2145
+ }
2146
+ ),
2147
+ /* @__PURE__ */ jsx(
2148
+ AuthPasswordField,
2149
+ {
2150
+ id: "password",
2151
+ label: passwordLabel,
2152
+ placeholder: passwordPlaceholder,
2153
+ value: password,
2154
+ onChange: (e) => onPasswordChange(e.target.value),
2155
+ required: true,
2156
+ autoComplete: "current-password",
2157
+ authConfig,
2158
+ forgotPasswordLink: forgotPasswordUrl ? {
2159
+ href: forgotPasswordUrl,
2160
+ text: forgotPasswordText
2161
+ } : void 0
2162
+ }
2163
+ ),
2164
+ /* @__PURE__ */ jsx(AuthSubmitButton, { isLoading: loading, disabled: loading || oauthLoading !== null, children: loading ? loadingButtonText : submitButtonText })
2165
+ ]
2166
+ }
2167
+ ),
1485
2168
  !showVerificationStep && /* @__PURE__ */ jsxs(Fragment, { children: [
1486
2169
  /* @__PURE__ */ jsx(AuthLink, { text: signUpText, linkText: signUpLinkText, href: signUpUrl }),
1487
2170
  authConfig.oAuthProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1633,36 +2316,44 @@ function SignUpForm({
1633
2316
  onVerifyCode,
1634
2317
  emailSent: true
1635
2318
  }
1636
- ) : /* @__PURE__ */ jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
1637
- /* @__PURE__ */ jsx(
1638
- AuthFormField,
1639
- {
1640
- id: "email",
1641
- type: "email",
1642
- label: emailLabel,
1643
- placeholder: emailPlaceholder,
1644
- value: email,
1645
- onChange: (e) => onEmailChange(e.target.value),
1646
- required: true,
1647
- autoComplete: "email"
1648
- }
1649
- ),
1650
- /* @__PURE__ */ jsx(
1651
- AuthPasswordField,
1652
- {
1653
- id: "password",
1654
- label: passwordLabel,
1655
- placeholder: passwordPlaceholder,
1656
- value: password,
1657
- onChange: (e) => onPasswordChange(e.target.value),
1658
- required: true,
1659
- autoComplete: "new-password",
1660
- showStrengthIndicator: true,
1661
- authConfig
1662
- }
1663
- ),
1664
- /* @__PURE__ */ jsx(AuthSubmitButton, { isLoading: loading, disabled: loading || oauthLoading !== null, children: loading ? loadingButtonText : submitButtonText })
1665
- ] }),
2319
+ ) : /* @__PURE__ */ jsxs(
2320
+ "form",
2321
+ {
2322
+ onSubmit,
2323
+ noValidate: true,
2324
+ style: { display: "flex", flexDirection: "column", gap: theme.spacing[6] },
2325
+ children: [
2326
+ /* @__PURE__ */ jsx(
2327
+ AuthFormField,
2328
+ {
2329
+ id: "email",
2330
+ type: "email",
2331
+ label: emailLabel,
2332
+ placeholder: emailPlaceholder,
2333
+ value: email,
2334
+ onChange: (e) => onEmailChange(e.target.value),
2335
+ required: true,
2336
+ autoComplete: "email"
2337
+ }
2338
+ ),
2339
+ /* @__PURE__ */ jsx(
2340
+ AuthPasswordField,
2341
+ {
2342
+ id: "password",
2343
+ label: passwordLabel,
2344
+ placeholder: passwordPlaceholder,
2345
+ value: password,
2346
+ onChange: (e) => onPasswordChange(e.target.value),
2347
+ required: true,
2348
+ autoComplete: "new-password",
2349
+ showStrengthIndicator: true,
2350
+ authConfig
2351
+ }
2352
+ ),
2353
+ /* @__PURE__ */ jsx(AuthSubmitButton, { isLoading: loading, disabled: loading || oauthLoading !== null, children: loading ? loadingButtonText : submitButtonText })
2354
+ ]
2355
+ }
2356
+ ),
1666
2357
  !showVerificationStep && /* @__PURE__ */ jsxs(Fragment, { children: [
1667
2358
  /* @__PURE__ */ jsx(AuthLink, { text: signInText, linkText: signInLinkText, href: signInUrl }),
1668
2359
  authConfig.oAuthProviders.length > 0 && onOAuthClick && /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1905,22 +2596,30 @@ function ForgotPasswordForm({
1905
2596
  onResendEmail: onResendEmail || (async () => {
1906
2597
  })
1907
2598
  }
1908
- ) : /* @__PURE__ */ jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
1909
- /* @__PURE__ */ jsx(
1910
- AuthFormField,
1911
- {
1912
- id: "email",
1913
- type: "email",
1914
- label: emailLabel,
1915
- placeholder: emailPlaceholder,
1916
- value: email,
1917
- onChange: (e) => onEmailChange(e.target.value),
1918
- required: true,
1919
- autoComplete: "email"
1920
- }
1921
- ),
1922
- /* @__PURE__ */ jsx(AuthSubmitButton, { isLoading: loading, disabled: loading, children: loading ? loadingButtonText : submitButtonText })
1923
- ] }),
2599
+ ) : /* @__PURE__ */ jsxs(
2600
+ "form",
2601
+ {
2602
+ onSubmit,
2603
+ noValidate: true,
2604
+ style: { display: "flex", flexDirection: "column", gap: theme.spacing[6] },
2605
+ children: [
2606
+ /* @__PURE__ */ jsx(
2607
+ AuthFormField,
2608
+ {
2609
+ id: "email",
2610
+ type: "email",
2611
+ label: emailLabel,
2612
+ placeholder: emailPlaceholder,
2613
+ value: email,
2614
+ onChange: (e) => onEmailChange(e.target.value),
2615
+ required: true,
2616
+ autoComplete: "email"
2617
+ }
2618
+ ),
2619
+ /* @__PURE__ */ jsx(AuthSubmitButton, { isLoading: loading, disabled: loading, children: loading ? loadingButtonText : submitButtonText })
2620
+ ]
2621
+ }
2622
+ ),
1924
2623
  !showVerificationStep && /* @__PURE__ */ jsx(AuthLink, { text: backToSignInText, linkText: "Back to Sign In", href: backToSignInUrl })
1925
2624
  ] });
1926
2625
  }
@@ -1949,77 +2648,64 @@ function ResetPasswordForm({
1949
2648
  successMessage = "Your password has been successfully reset. You can wait for redirect to sign in with your new password.";
1950
2649
  }
1951
2650
  if (success) {
1952
- return /* @__PURE__ */ jsx(AuthContainer, { children: /* @__PURE__ */ jsxs(
1953
- "div",
2651
+ return /* @__PURE__ */ jsx(AuthContainer, { children: /* @__PURE__ */ jsx(VerifyStatusContainer, { $stretch: true, children: /* @__PURE__ */ jsxs(VerifyStatusSuccessContent, { children: [
2652
+ /* @__PURE__ */ jsx(VerifyStatusSuccessIcon, { children: /* @__PURE__ */ jsx(VerifyStatusSuccessIconSvg, { children: /* @__PURE__ */ jsx(
2653
+ "svg",
2654
+ {
2655
+ fill: "none",
2656
+ strokeLinecap: "round",
2657
+ strokeLinejoin: "round",
2658
+ strokeWidth: "2",
2659
+ viewBox: "0 0 24 24",
2660
+ stroke: "currentColor",
2661
+ children: /* @__PURE__ */ jsx("path", { d: "M5 13l4 4L19 7" })
2662
+ }
2663
+ ) }) }),
2664
+ /* @__PURE__ */ jsx(VerifyStatusTextCenter, { style: { fontSize: "1.5rem", fontWeight: 600 }, children: successTitle }),
2665
+ /* @__PURE__ */ jsx(VerifyStatusTextCenter, { style: { color: theme.colors.textSecondary }, children: successMessage })
2666
+ ] }) }) });
2667
+ }
2668
+ return /* @__PURE__ */ jsxs(AuthContainer, { children: [
2669
+ /* @__PURE__ */ jsx(AuthHeader, { title, subtitle }),
2670
+ /* @__PURE__ */ jsx(AuthErrorBanner, { error: error || "" }),
2671
+ /* @__PURE__ */ jsxs(
2672
+ "form",
1954
2673
  {
1955
- style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "1rem" },
2674
+ onSubmit,
2675
+ noValidate: true,
2676
+ style: { display: "flex", flexDirection: "column", gap: theme.spacing[6] },
1956
2677
  children: [
1957
2678
  /* @__PURE__ */ jsx(
1958
- "div",
2679
+ AuthPasswordField,
1959
2680
  {
1960
- style: {
1961
- width: "4rem",
1962
- height: "4rem",
1963
- borderRadius: "50%",
1964
- backgroundColor: "#D1FAE5",
1965
- display: "flex",
1966
- alignItems: "center",
1967
- justifyContent: "center"
1968
- },
1969
- children: /* @__PURE__ */ jsx(
1970
- "svg",
1971
- {
1972
- style: { width: "2rem", height: "2rem", color: "#059669" },
1973
- fill: "none",
1974
- strokeLinecap: "round",
1975
- strokeLinejoin: "round",
1976
- strokeWidth: "2",
1977
- viewBox: "0 0 24 24",
1978
- stroke: "currentColor",
1979
- children: /* @__PURE__ */ jsx("path", { d: "M5 13l4 4L19 7" })
1980
- }
1981
- )
2681
+ id: "newPassword",
2682
+ label: newPasswordLabel,
2683
+ placeholder: newPasswordPlaceholder,
2684
+ value: newPassword,
2685
+ onChange: (e) => onNewPasswordChange(e.target.value),
2686
+ required: true,
2687
+ autoComplete: "new-password",
2688
+ showStrengthIndicator: true,
2689
+ authConfig
1982
2690
  }
1983
2691
  ),
1984
- /* @__PURE__ */ jsx("h2", { className: "if-authHeader-title", style: { textAlign: "center" }, children: successTitle }),
1985
- /* @__PURE__ */ jsx("p", { className: "if-authHeader-subtitle", style: { textAlign: "center" }, children: successMessage })
2692
+ /* @__PURE__ */ jsx(
2693
+ AuthPasswordField,
2694
+ {
2695
+ id: "confirmPassword",
2696
+ label: confirmPasswordLabel,
2697
+ placeholder: confirmPasswordPlaceholder,
2698
+ value: confirmPassword,
2699
+ onChange: (e) => onConfirmPasswordChange(e.target.value),
2700
+ required: true,
2701
+ autoComplete: "new-password",
2702
+ authConfig
2703
+ }
2704
+ ),
2705
+ /* @__PURE__ */ jsx(AuthSubmitButton, { isLoading: loading, disabled: loading, children: loading ? loadingButtonText : submitButtonText })
1986
2706
  ]
1987
2707
  }
1988
- ) });
1989
- }
1990
- return /* @__PURE__ */ jsxs(AuthContainer, { children: [
1991
- /* @__PURE__ */ jsx(AuthHeader, { title, subtitle }),
1992
- /* @__PURE__ */ jsx(AuthErrorBanner, { error: error || "" }),
1993
- /* @__PURE__ */ jsxs("form", { onSubmit, noValidate: true, className: "if-form if-internal-fm9k2p", children: [
1994
- /* @__PURE__ */ jsx(
1995
- AuthPasswordField,
1996
- {
1997
- id: "newPassword",
1998
- label: newPasswordLabel,
1999
- placeholder: newPasswordPlaceholder,
2000
- value: newPassword,
2001
- onChange: (e) => onNewPasswordChange(e.target.value),
2002
- required: true,
2003
- autoComplete: "new-password",
2004
- showStrengthIndicator: true,
2005
- authConfig
2006
- }
2007
- ),
2008
- /* @__PURE__ */ jsx(
2009
- AuthPasswordField,
2010
- {
2011
- id: "confirmPassword",
2012
- label: confirmPasswordLabel,
2013
- placeholder: confirmPasswordPlaceholder,
2014
- value: confirmPassword,
2015
- onChange: (e) => onConfirmPasswordChange(e.target.value),
2016
- required: true,
2017
- autoComplete: "new-password",
2018
- authConfig
2019
- }
2020
- ),
2021
- /* @__PURE__ */ jsx(AuthSubmitButton, { isLoading: loading, disabled: loading, children: loading ? loadingButtonText : submitButtonText })
2022
- ] })
2708
+ )
2023
2709
  ] });
2024
2710
  }
2025
2711
  function ForgotPassword({ onError, ...uiProps }) {
@@ -2364,25 +3050,24 @@ function VerifyEmailStatus({
2364
3050
  errorTitle = "Verification Failed"
2365
3051
  }) {
2366
3052
  if (status === "verifying") {
2367
- return /* @__PURE__ */ jsx(AuthContainer, { children: /* @__PURE__ */ jsxs("div", { className: "if-verifyStatus-container", children: [
2368
- /* @__PURE__ */ jsx("h2", { className: "if-authHeader-title", children: verifyingTitle }),
2369
- /* @__PURE__ */ jsx("div", { className: "if-submitButton-spinner if-verifyStatus-spinner" })
3053
+ return /* @__PURE__ */ jsx(AuthContainer, { children: /* @__PURE__ */ jsxs(VerifyStatusContainer, { children: [
3054
+ /* @__PURE__ */ jsx(AuthHeader, { title: verifyingTitle }),
3055
+ /* @__PURE__ */ jsx(VerifyStatusSpinner, {})
2370
3056
  ] }) });
2371
3057
  }
2372
3058
  if (status === "error") {
2373
- return /* @__PURE__ */ jsx(AuthContainer, { children: /* @__PURE__ */ jsx("div", { className: "if-verifyStatus-container-stretch", children: /* @__PURE__ */ jsxs("div", { className: "if-authHeader if-internal-h3m7w5", children: [
2374
- /* @__PURE__ */ jsx("h1", { className: "if-authHeader-title if-internal-t4p1k9", children: errorTitle }),
2375
- /* @__PURE__ */ jsxs("p", { className: "if-authHeader-subtitle if-internal-s7q2m3", children: [
2376
- error || "The verification link is invalid or has expired.",
2377
- " Please try again or contact support if the problem persists. You can close this page and return to your app."
2378
- ] })
2379
- ] }) }) });
3059
+ return /* @__PURE__ */ jsx(AuthContainer, { children: /* @__PURE__ */ jsx(VerifyStatusContainer, { $stretch: true, children: /* @__PURE__ */ jsx(
3060
+ AuthHeader,
3061
+ {
3062
+ title: errorTitle,
3063
+ subtitle: `${error || "The verification link is invalid or has expired."} Please try again or contact support if the problem persists. You can close this page and return to your app.`
3064
+ }
3065
+ ) }) });
2380
3066
  }
2381
- return /* @__PURE__ */ jsx(AuthContainer, { children: /* @__PURE__ */ jsx("div", { className: "if-verifyStatus-container-stretch", children: /* @__PURE__ */ jsxs("div", { className: "if-verifyStatus-successContent", children: [
2382
- /* @__PURE__ */ jsx("div", { className: "if-verifyStatus-successIcon", children: /* @__PURE__ */ jsx(
3067
+ return /* @__PURE__ */ jsx(AuthContainer, { children: /* @__PURE__ */ jsx(VerifyStatusContainer, { $stretch: true, children: /* @__PURE__ */ jsxs(VerifyStatusSuccessContent, { children: [
3068
+ /* @__PURE__ */ jsx(VerifyStatusSuccessIcon, { children: /* @__PURE__ */ jsx(VerifyStatusSuccessIconSvg, { children: /* @__PURE__ */ jsx(
2383
3069
  "svg",
2384
3070
  {
2385
- className: "if-verifyStatus-successIconSvg",
2386
3071
  fill: "none",
2387
3072
  strokeLinecap: "round",
2388
3073
  strokeLinejoin: "round",
@@ -2391,9 +3076,9 @@ function VerifyEmailStatus({
2391
3076
  stroke: "currentColor",
2392
3077
  children: /* @__PURE__ */ jsx("path", { d: "M5 13l4 4L19 7" })
2393
3078
  }
2394
- ) }),
2395
- /* @__PURE__ */ jsx("h2", { className: "if-authHeader-title if-verifyStatus-textCenter", children: successTitle }),
2396
- /* @__PURE__ */ jsx("p", { className: "if-authHeader-subtitle if-verifyStatus-textCenter", children: successMessage })
3079
+ ) }) }),
3080
+ /* @__PURE__ */ jsx(VerifyStatusTextCenter, { style: { fontSize: "1.5rem", fontWeight: 600 }, children: successTitle }),
3081
+ /* @__PURE__ */ jsx(VerifyStatusTextCenter, { style: { color: theme.colors.textSecondary }, children: successMessage })
2397
3082
  ] }) }) });
2398
3083
  }
2399
3084
  function VerifyEmail({ token, onSuccess, onError, ...uiProps }) {
@@ -2443,6 +3128,120 @@ function VerifyEmail({ token, onSuccess, onError, ...uiProps }) {
2443
3128
  }, [token, verifyEmail, onSuccess, onError]);
2444
3129
  return /* @__PURE__ */ jsx(VerifyEmailStatus, { status, error, ...uiProps });
2445
3130
  }
3131
+ var UserButtonContainer = styled.div`
3132
+ position: relative;
3133
+ display: inline-block;
3134
+ `;
3135
+ var UserButtonButton = styled.button`
3136
+ display: flex;
3137
+ align-items: center;
3138
+ justify-content: center;
3139
+ gap: ${theme.spacing[2]};
3140
+ padding: ${theme.spacing[2]};
3141
+ border-radius: ${(props) => props.$detailed ? theme.radius.sm : theme.radius.full};
3142
+ background-color: ${(props) => props.$detailed ? theme.colors.bgWhite : "transparent"};
3143
+ border: ${(props) => props.$detailed ? `1px solid ${theme.colors.border}` : "none"};
3144
+ cursor: pointer;
3145
+ transition: all ${theme.transition.base};
3146
+
3147
+ &:hover {
3148
+ ${(props) => props.$detailed ? `
3149
+ background-color: ${theme.colors.bgLight};
3150
+ opacity: 1;
3151
+ ` : `
3152
+ opacity: 0.8;
3153
+ `}
3154
+ }
3155
+ `;
3156
+ var UserButtonAvatar = styled.div`
3157
+ width: 2rem;
3158
+ height: 2rem;
3159
+ border-radius: ${theme.radius.full};
3160
+ background-color: ${theme.colors.primary};
3161
+ color: ${theme.colors.bgWhite};
3162
+ display: flex;
3163
+ align-items: center;
3164
+ justify-content: center;
3165
+ font-weight: 600;
3166
+ font-size: ${theme.fontSize.sm};
3167
+ font-family: ${theme.fontFamily.base};
3168
+ overflow: hidden;
3169
+ `;
3170
+ var UserButtonAvatarImage = styled.img`
3171
+ border-radius: ${theme.radius.full};
3172
+ object-fit: cover;
3173
+ width: 100%;
3174
+ height: 100%;
3175
+ `;
3176
+ var UserButtonAvatarInitials = styled.span`
3177
+ color: ${theme.colors.bgWhite};
3178
+ font-weight: 600;
3179
+ font-size: ${theme.fontSize.sm};
3180
+ `;
3181
+ var UserButtonInfo = styled.div`
3182
+ display: flex;
3183
+ flex-direction: column;
3184
+ align-items: flex-start;
3185
+ gap: 0.125rem;
3186
+ `;
3187
+ var UserButtonName = styled.div`
3188
+ font-size: ${theme.fontSize.sm};
3189
+ font-weight: 600;
3190
+ color: ${theme.colors.text};
3191
+ line-height: 1.25rem;
3192
+ text-align: left;
3193
+ font-family: ${theme.fontFamily.base};
3194
+ `;
3195
+ var UserButtonEmail = styled.div`
3196
+ font-size: ${theme.fontSize.xs};
3197
+ color: ${theme.colors.textSecondary};
3198
+ line-height: 1rem;
3199
+ text-align: left;
3200
+ font-family: ${theme.fontFamily.base};
3201
+ `;
3202
+ var UserButtonMenu = styled.div`
3203
+ position: absolute;
3204
+ margin-top: ${theme.spacing[2]};
3205
+ background-color: ${theme.colors.bgWhite};
3206
+ border: 1px solid ${theme.colors.border};
3207
+ border-radius: ${theme.radius.md};
3208
+ box-shadow: ${theme.shadow.lg};
3209
+ padding: ${theme.spacing[2]};
3210
+ min-width: 200px;
3211
+ z-index: 50;
3212
+ `;
3213
+ var UserButtonMenuItem = styled.button`
3214
+ display: flex;
3215
+ align-items: center;
3216
+ gap: ${theme.spacing[2]};
3217
+ padding: ${theme.spacing[2]};
3218
+ border-radius: ${theme.radius.sm};
3219
+ cursor: pointer;
3220
+ transition: background-color ${theme.transition.fast};
3221
+ font-size: ${theme.fontSize.sm};
3222
+ color: ${(props) => props.$signout ? theme.colors.error : theme.colors.text};
3223
+ font-family: ${theme.fontFamily.base};
3224
+ background: none;
3225
+ border: none;
3226
+ width: 100%;
3227
+ text-align: left;
3228
+
3229
+ &:hover {
3230
+ background-color: ${theme.colors.bgLight};
3231
+ }
3232
+ `;
3233
+ var UserButtonMenuItemIcon = styled.div`
3234
+ width: 1.25rem;
3235
+ height: 1.25rem;
3236
+ display: flex;
3237
+ align-items: center;
3238
+ justify-content: center;
3239
+
3240
+ svg {
3241
+ width: 100%;
3242
+ height: 100%;
3243
+ }
3244
+ `;
2446
3245
  function UserButton({ afterSignOutUrl = "/", mode = "detailed" }) {
2447
3246
  const { user, signOut } = useInsforge();
2448
3247
  const [isOpen, setIsOpen] = useState(false);
@@ -2494,43 +3293,34 @@ function UserButton({ afterSignOutUrl = "/", mode = "detailed" }) {
2494
3293
  return null;
2495
3294
  }
2496
3295
  const initials = user.name ? user.name.charAt(0).toUpperCase() : user.email.split("@")[0].slice(0, 2).toUpperCase();
2497
- const buttonClassName = mode === "detailed" ? "if-userButton if-userButton-detailed" : "if-userButton";
2498
- return /* @__PURE__ */ jsxs("div", { className: "if-userButton-container if-internal-ub3k8p", ref: dropdownRef, children: [
3296
+ return /* @__PURE__ */ jsxs(UserButtonContainer, { ref: dropdownRef, children: [
2499
3297
  /* @__PURE__ */ jsxs(
2500
- "button",
3298
+ UserButtonButton,
2501
3299
  {
2502
- className: buttonClassName,
3300
+ $detailed: mode === "detailed",
2503
3301
  onClick: () => setIsOpen(!isOpen),
2504
3302
  "aria-expanded": isOpen,
2505
3303
  "aria-haspopup": "true",
2506
3304
  children: [
2507
- /* @__PURE__ */ jsx("div", { className: "if-userButton-avatar", children: user.avatarUrl && !imageError ? /* @__PURE__ */ jsx(
2508
- "img",
3305
+ /* @__PURE__ */ jsx(UserButtonAvatar, { children: user.avatarUrl && !imageError ? /* @__PURE__ */ jsx(
3306
+ UserButtonAvatarImage,
2509
3307
  {
2510
3308
  src: user.avatarUrl,
2511
3309
  alt: user.email,
2512
- onError: () => setImageError(true),
2513
- className: "if-userButton-avatarImage"
3310
+ onError: () => setImageError(true)
2514
3311
  }
2515
- ) : /* @__PURE__ */ jsx("span", { className: "if-userButton-avatarInitials", children: initials }) }),
2516
- mode === "detailed" && /* @__PURE__ */ jsxs("div", { className: "if-userButton-info", children: [
2517
- user.name && /* @__PURE__ */ jsx("div", { className: "if-userButton-name", children: user.name }),
2518
- /* @__PURE__ */ jsx("div", { className: "if-userButton-email", children: user.email })
3312
+ ) : /* @__PURE__ */ jsx(UserButtonAvatarInitials, { children: initials }) }),
3313
+ mode === "detailed" && /* @__PURE__ */ jsxs(UserButtonInfo, { children: [
3314
+ user.name && /* @__PURE__ */ jsx(UserButtonName, { children: user.name }),
3315
+ /* @__PURE__ */ jsx(UserButtonEmail, { children: user.email })
2519
3316
  ] })
2520
3317
  ]
2521
3318
  }
2522
3319
  ),
2523
- isOpen && /* @__PURE__ */ jsx("div", { className: "if-userButton-menu", children: /* @__PURE__ */ jsxs(
2524
- "button",
2525
- {
2526
- onClick: () => void handleSignOut(),
2527
- className: "if-userButton-menuItem if-userButton-menuItem-signout",
2528
- children: [
2529
- /* @__PURE__ */ jsx(LogOut, { className: "if-userButton-menuItem-icon" }),
2530
- "Sign out"
2531
- ]
2532
- }
2533
- ) })
3320
+ isOpen && /* @__PURE__ */ jsx(UserButtonMenu, { children: /* @__PURE__ */ jsxs(UserButtonMenuItem, { $signout: true, onClick: () => void handleSignOut(), children: [
3321
+ /* @__PURE__ */ jsx(UserButtonMenuItemIcon, { children: /* @__PURE__ */ jsx(LogOut, {}) }),
3322
+ "Sign out"
3323
+ ] }) })
2534
3324
  ] });
2535
3325
  }
2536
3326
  function Protect({
@@ -2639,6 +3429,6 @@ function useUser() {
2639
3429
  return { user, isLoaded, updateUser, setUser };
2640
3430
  }
2641
3431
 
2642
- export { AuthBranding, AuthContainer, AuthDivider, AuthEmailVerificationStep, AuthErrorBanner, AuthFormField, AuthHeader, AuthLink, AuthOAuthButton, AuthOAuthProviders, AuthPasswordField, AuthPasswordStrengthIndicator, AuthResetPasswordVerificationStep, AuthSubmitButton, AuthVerificationCodeInput, BrowserNavigationAdapter, ForgotPassword, ForgotPasswordForm, InsforgeProvider, InsforgeProviderCore, NavigationProvider, OAUTH_PROVIDER_CONFIG, Protect, ResetPassword, ResetPasswordForm, SignIn, SignInButton, SignInForm, SignUp, SignUpButton, SignUpForm, SignedIn, SignedOut, UserButton, VerifyEmail, VerifyEmailStatus, checkPasswordStrength, createPasswordSchema, emailSchema, getAllProviderConfigs, getProviderConfig, passwordSchema, resolveAuthPath, resolveAuthUrl, useAuth, useInsforge, useNavigationAdapter, usePublicAuthConfig, useSearchParams, useUser, validateEmail, validatePassword };
3432
+ export { AuthBranding, AuthContainer, AuthDivider, AuthEmailVerificationStep, AuthErrorBanner, AuthFormField, AuthHeader, AuthLink, AuthOAuthButton, AuthOAuthProviders, AuthPasswordField, AuthPasswordStrengthIndicator, AuthResetPasswordVerificationStep, AuthSubmitButton, AuthVerificationCodeInput, BrowserNavigationAdapter, ForgotPassword, ForgotPasswordForm, InsforgeProvider, InsforgeProviderCore, NavigationProvider, OAUTH_PROVIDER_CONFIG, Protect, ResetPassword, ResetPasswordForm, SignIn, SignInButton, SignInForm, SignUp, SignUpButton, SignUpForm, SignedIn, SignedOut, StyleProvider, UserButton, VerifyEmail, VerifyEmailStatus, checkPasswordStrength, createPasswordSchema, emailSchema, getAllProviderConfigs, getProviderConfig, passwordSchema, resolveAuthPath, resolveAuthUrl, theme, useAuth, useInsforge, useNavigationAdapter, usePublicAuthConfig, useSearchParams, useUser, validateEmail, validatePassword };
2643
3433
  //# sourceMappingURL=index.js.map
2644
3434
  //# sourceMappingURL=index.js.map