@thetechfossil/auth2 1.2.8 → 1.2.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.
@@ -1,10 +1,16 @@
1
+ "use client";
1
2
  import React2, { createContext, forwardRef, useContext, useState, useMemo, useEffect, useRef, useCallback } from 'react';
2
3
  import axios from 'axios';
3
4
  import { ImageManager, UpfilesClient } from '@thetechfossil/upfiles';
4
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
- import PhoneInputWithCountry from 'react-phone-number-input';
6
- import 'react-phone-number-input/style.css';
7
6
 
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined")
11
+ return require.apply(this, arguments);
12
+ throw new Error('Dynamic require of "' + x + '" is not supported');
13
+ });
8
14
  var HttpClient = class {
9
15
  constructor(baseUrl, defaultHeaders = {}) {
10
16
  this.csrfToken = null;
@@ -686,6 +692,14 @@ function useThemeColors() {
686
692
  const { theme } = useAuthTheme();
687
693
  return theme === "dark" ? darkTheme : lightTheme;
688
694
  }
695
+ var PhoneInputWithCountry = null;
696
+ try {
697
+ const module = __require("react-phone-number-input");
698
+ PhoneInputWithCountry = module.default || module;
699
+ __require("react-phone-number-input/style.css");
700
+ } catch (error) {
701
+ console.warn("react-phone-number-input not available, using fallback");
702
+ }
689
703
  var CustomPhoneInput = React2.forwardRef((props, ref) => /* @__PURE__ */ jsx(
690
704
  "input",
691
705
  {
@@ -878,6 +892,30 @@ var PhoneInput = ({
878
892
  const handleChange = useMemo(() => (val) => {
879
893
  onChange(val || "");
880
894
  }, [onChange]);
895
+ if (!PhoneInputWithCountry) {
896
+ return /* @__PURE__ */ jsx(
897
+ "input",
898
+ {
899
+ id,
900
+ type: "tel",
901
+ value,
902
+ onChange: (e) => onChange(e.target.value),
903
+ disabled,
904
+ required,
905
+ placeholder,
906
+ style: {
907
+ width: "100%",
908
+ padding: "12px 16px",
909
+ border: `1px solid ${colors.borderSecondary}`,
910
+ borderRadius: "8px",
911
+ fontSize: "16px",
912
+ backgroundColor: colors.bgSecondary,
913
+ color: colors.textPrimary,
914
+ ...style
915
+ }
916
+ }
917
+ );
918
+ }
881
919
  return /* @__PURE__ */ jsxs(
882
920
  "div",
883
921
  {
@@ -4218,8 +4256,9 @@ var UserProfile = ({
4218
4256
  setIsLoading(false);
4219
4257
  }
4220
4258
  };
4221
- const handleAvatarUploadComplete = (avatarUrl) => {
4259
+ const handleAvatarUploadComplete = async (avatarUrl) => {
4222
4260
  setSuccess("Avatar updated successfully!");
4261
+ window.location.reload();
4223
4262
  };
4224
4263
  const handleAvatarUploadError = (error2) => {
4225
4264
  setError(error2.message || "Failed to upload avatar");