@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.
package/dist/index.mjs CHANGED
@@ -1,12 +1,18 @@
1
+ "use client";
1
2
  import axios from 'axios';
2
3
  import { UpfilesClient, ImageManager } from '@thetechfossil/upfiles';
3
4
  export { ConnectProjectDialog, ImageManager, ProjectFilesWidget, UpfilesClient, Uploader } from '@thetechfossil/upfiles';
4
5
  import React3, { createContext, forwardRef, useContext, useState, useCallback, useEffect, useRef, useMemo } from 'react';
5
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
- import PhoneInputWithCountry from 'react-phone-number-input';
7
- import 'react-phone-number-input/style.css';
8
7
 
9
8
  var __defProp = Object.defineProperty;
9
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
+ }) : x)(function(x) {
12
+ if (typeof require !== "undefined")
13
+ return require.apply(this, arguments);
14
+ throw new Error('Dynamic require of "' + x + '" is not supported');
15
+ });
10
16
  var __export = (target, all) => {
11
17
  for (var name in all)
12
18
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -1023,6 +1029,14 @@ function useThemeColors() {
1023
1029
  const { theme } = useAuthTheme();
1024
1030
  return theme === "dark" ? darkTheme : lightTheme;
1025
1031
  }
1032
+ var PhoneInputWithCountry = null;
1033
+ try {
1034
+ const module = __require("react-phone-number-input");
1035
+ PhoneInputWithCountry = module.default || module;
1036
+ __require("react-phone-number-input/style.css");
1037
+ } catch (error) {
1038
+ console.warn("react-phone-number-input not available, using fallback");
1039
+ }
1026
1040
  var CustomPhoneInput = React3.forwardRef((props, ref) => /* @__PURE__ */ jsx(
1027
1041
  "input",
1028
1042
  {
@@ -1215,6 +1229,30 @@ var PhoneInput = ({
1215
1229
  const handleChange = useMemo(() => (val) => {
1216
1230
  onChange(val || "");
1217
1231
  }, [onChange]);
1232
+ if (!PhoneInputWithCountry) {
1233
+ return /* @__PURE__ */ jsx(
1234
+ "input",
1235
+ {
1236
+ id,
1237
+ type: "tel",
1238
+ value,
1239
+ onChange: (e) => onChange(e.target.value),
1240
+ disabled,
1241
+ required,
1242
+ placeholder,
1243
+ style: {
1244
+ width: "100%",
1245
+ padding: "12px 16px",
1246
+ border: `1px solid ${colors.borderSecondary}`,
1247
+ borderRadius: "8px",
1248
+ fontSize: "16px",
1249
+ backgroundColor: colors.bgSecondary,
1250
+ color: colors.textPrimary,
1251
+ ...style
1252
+ }
1253
+ }
1254
+ );
1255
+ }
1218
1256
  return /* @__PURE__ */ jsxs(
1219
1257
  "div",
1220
1258
  {
@@ -4547,8 +4585,9 @@ var UserProfile = ({
4547
4585
  setIsLoading(false);
4548
4586
  }
4549
4587
  };
4550
- const handleAvatarUploadComplete = (avatarUrl) => {
4588
+ const handleAvatarUploadComplete = async (avatarUrl) => {
4551
4589
  setSuccess("Avatar updated successfully!");
4590
+ window.location.reload();
4552
4591
  };
4553
4592
  const handleAvatarUploadError = (error2) => {
4554
4593
  setError(error2.message || "Failed to upload avatar");