@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.
package/dist/index.js CHANGED
@@ -1,19 +1,24 @@
1
+ "use client";
1
2
  'use strict';
2
3
 
3
4
  var axios = require('axios');
4
5
  var upfiles = require('@thetechfossil/upfiles');
5
6
  var React3 = require('react');
6
7
  var jsxRuntime = require('react/jsx-runtime');
7
- var PhoneInputWithCountry = require('react-phone-number-input');
8
- require('react-phone-number-input/style.css');
9
8
 
10
9
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
10
 
12
11
  var axios__default = /*#__PURE__*/_interopDefault(axios);
13
12
  var React3__default = /*#__PURE__*/_interopDefault(React3);
14
- var PhoneInputWithCountry__default = /*#__PURE__*/_interopDefault(PhoneInputWithCountry);
15
13
 
16
14
  var __defProp = Object.defineProperty;
15
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
16
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
17
+ }) : x)(function(x) {
18
+ if (typeof require !== "undefined")
19
+ return require.apply(this, arguments);
20
+ throw new Error('Dynamic require of "' + x + '" is not supported');
21
+ });
17
22
  var __export = (target, all) => {
18
23
  for (var name in all)
19
24
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -1030,6 +1035,14 @@ function useThemeColors() {
1030
1035
  const { theme } = useAuthTheme();
1031
1036
  return theme === "dark" ? darkTheme : lightTheme;
1032
1037
  }
1038
+ var PhoneInputWithCountry = null;
1039
+ try {
1040
+ const module = __require("react-phone-number-input");
1041
+ PhoneInputWithCountry = module.default || module;
1042
+ __require("react-phone-number-input/style.css");
1043
+ } catch (error) {
1044
+ console.warn("react-phone-number-input not available, using fallback");
1045
+ }
1033
1046
  var CustomPhoneInput = React3__default.default.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1034
1047
  "input",
1035
1048
  {
@@ -1222,6 +1235,30 @@ var PhoneInput = ({
1222
1235
  const handleChange = React3.useMemo(() => (val) => {
1223
1236
  onChange(val || "");
1224
1237
  }, [onChange]);
1238
+ if (!PhoneInputWithCountry) {
1239
+ return /* @__PURE__ */ jsxRuntime.jsx(
1240
+ "input",
1241
+ {
1242
+ id,
1243
+ type: "tel",
1244
+ value,
1245
+ onChange: (e) => onChange(e.target.value),
1246
+ disabled,
1247
+ required,
1248
+ placeholder,
1249
+ style: {
1250
+ width: "100%",
1251
+ padding: "12px 16px",
1252
+ border: `1px solid ${colors.borderSecondary}`,
1253
+ borderRadius: "8px",
1254
+ fontSize: "16px",
1255
+ backgroundColor: colors.bgSecondary,
1256
+ color: colors.textPrimary,
1257
+ ...style
1258
+ }
1259
+ }
1260
+ );
1261
+ }
1225
1262
  return /* @__PURE__ */ jsxRuntime.jsxs(
1226
1263
  "div",
1227
1264
  {
@@ -1232,7 +1269,7 @@ var PhoneInput = ({
1232
1269
  children: [
1233
1270
  /* @__PURE__ */ jsxRuntime.jsx("style", { children: styleContent }),
1234
1271
  /* @__PURE__ */ jsxRuntime.jsx(
1235
- PhoneInputWithCountry__default.default,
1272
+ PhoneInputWithCountry,
1236
1273
  {
1237
1274
  id,
1238
1275
  international: true,