@insforge/react 0.4.11 → 0.5.0

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/forms.cjs CHANGED
@@ -3,9 +3,9 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var lucideReact = require('lucide-react');
5
5
  var react = require('react');
6
- var reactRouterDom = require('react-router-dom');
7
6
  require('@insforge/sdk');
8
7
 
8
+ // src/components/atoms/AuthBranding.tsx
9
9
  function AuthBranding() {
10
10
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "if-authBranding if-internal-ab4k9w", children: [
11
11
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "if-authBranding-text", children: "Secured by" }),
@@ -103,6 +103,20 @@ function AuthFormField({ label, id, ...props }) {
103
103
  /* @__PURE__ */ jsxRuntime.jsx("input", { id, className: "if-formField-input if-internal-i2v8k4", ...props })
104
104
  ] });
105
105
  }
106
+ var NavigationContext = react.createContext(null);
107
+ function useNavigationAdapter() {
108
+ const adapter = react.useContext(NavigationContext);
109
+ if (!adapter) {
110
+ throw new Error("useNavigationAdapter must be used within NavigationProvider");
111
+ }
112
+ return adapter;
113
+ }
114
+
115
+ // src/navigation/useSearchParams.ts
116
+ function useSearchParams() {
117
+ const adapter = useNavigationAdapter();
118
+ return adapter.useSearchParams();
119
+ }
106
120
  function AuthPasswordStrengthIndicator({
107
121
  password,
108
122
  config
@@ -196,7 +210,8 @@ function AuthPasswordField({
196
210
  onFocus,
197
211
  ...props
198
212
  }) {
199
- const [searchParams] = reactRouterDom.useSearchParams();
213
+ const searchParams = useSearchParams();
214
+ const { Link } = useNavigationAdapter();
200
215
  const [showPassword, setShowPassword] = react.useState(false);
201
216
  const [showStrength, setShowStrength] = react.useState(false);
202
217
  const resolvedForgotPasswordHref = react.useMemo(
@@ -212,7 +227,7 @@ function AuthPasswordField({
212
227
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "if-passwordField if-internal-p5w9m7", children: [
213
228
  (label || forgotPasswordLink) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "if-passwordField-labelRow", children: [
214
229
  /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: "if-passwordField-label", children: label }),
215
- forgotPasswordLink && resolvedForgotPasswordHref && /* @__PURE__ */ jsxRuntime.jsx("a", { href: resolvedForgotPasswordHref, className: "if-passwordField-forgotLink", children: forgotPasswordLink.text || "Forget Password?" })
230
+ forgotPasswordLink && resolvedForgotPasswordHref && /* @__PURE__ */ jsxRuntime.jsx(Link, { href: resolvedForgotPasswordHref, className: "if-passwordField-forgotLink", children: forgotPasswordLink.text || "Forget Password?" })
216
231
  ] }),
217
232
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "if-passwordField-inputWrapper", children: [
218
233
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -264,12 +279,13 @@ function AuthSubmitButton({
264
279
  );
265
280
  }
266
281
  function AuthLink({ text, linkText, href }) {
267
- const [searchParams] = reactRouterDom.useSearchParams();
282
+ const searchParams = useSearchParams();
283
+ const { Link } = useNavigationAdapter();
268
284
  const finalHref = resolveAuthUrl(href, searchParams);
269
285
  return /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "if-authLink if-internal-al5w9p", children: [
270
286
  text && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "if-authLink-text", children: text }),
271
287
  text && " ",
272
- /* @__PURE__ */ jsxRuntime.jsx("a", { href: finalHref, className: "if-authLink-link", children: linkText })
288
+ /* @__PURE__ */ jsxRuntime.jsx(Link, { href: finalHref, className: "if-authLink-link", children: linkText })
273
289
  ] });
274
290
  }
275
291
  function AuthDivider({ text = "or" }) {