@thetechfossil/auth2 1.2.8 → 1.2.9

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,11 +1,16 @@
1
+ "use client";
1
2
  import axios from 'axios';
2
3
  import { UpfilesClient, ImageManager } from '@thetechfossil/upfiles';
3
4
  import React3, { createContext, forwardRef, useState, useCallback, useEffect, useContext, useMemo, useRef } from 'react';
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
 
8
- // src/core/http-client.ts
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
+ });
9
14
  var HttpClient = class {
10
15
  constructor(baseUrl, defaultHeaders = {}) {
11
16
  this.csrfToken = null;
@@ -1018,6 +1023,14 @@ function useThemeColors() {
1018
1023
  const { theme } = useAuthTheme();
1019
1024
  return theme === "dark" ? darkTheme : lightTheme;
1020
1025
  }
1026
+ var PhoneInputWithCountry = null;
1027
+ try {
1028
+ const module = __require("react-phone-number-input");
1029
+ PhoneInputWithCountry = module.default || module;
1030
+ __require("react-phone-number-input/style.css");
1031
+ } catch (error) {
1032
+ console.warn("react-phone-number-input not available, using fallback");
1033
+ }
1021
1034
  var CustomPhoneInput = React3.forwardRef((props, ref) => /* @__PURE__ */ jsx(
1022
1035
  "input",
1023
1036
  {
@@ -1210,6 +1223,30 @@ var PhoneInput = ({
1210
1223
  const handleChange = useMemo(() => (val) => {
1211
1224
  onChange(val || "");
1212
1225
  }, [onChange]);
1226
+ if (!PhoneInputWithCountry) {
1227
+ return /* @__PURE__ */ jsx(
1228
+ "input",
1229
+ {
1230
+ id,
1231
+ type: "tel",
1232
+ value,
1233
+ onChange: (e) => onChange(e.target.value),
1234
+ disabled,
1235
+ required,
1236
+ placeholder,
1237
+ style: {
1238
+ width: "100%",
1239
+ padding: "12px 16px",
1240
+ border: `1px solid ${colors.borderSecondary}`,
1241
+ borderRadius: "8px",
1242
+ fontSize: "16px",
1243
+ backgroundColor: colors.bgSecondary,
1244
+ color: colors.textPrimary,
1245
+ ...style
1246
+ }
1247
+ }
1248
+ );
1249
+ }
1213
1250
  return /* @__PURE__ */ jsxs(
1214
1251
  "div",
1215
1252
  {