@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/atoms.cjs +21 -5
- package/dist/atoms.cjs.map +1 -1
- package/dist/atoms.js +21 -5
- package/dist/atoms.js.map +1 -1
- package/dist/components.cjs +26 -10
- package/dist/components.cjs.map +1 -1
- package/dist/components.js +26 -10
- package/dist/components.js.map +1 -1
- package/dist/forms.cjs +21 -5
- package/dist/forms.cjs.map +1 -1
- package/dist/forms.js +21 -5
- package/dist/forms.js.map +1 -1
- package/dist/hooks.cjs +2 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.js +2 -0
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +58 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +56 -49
- package/dist/index.js.map +1 -1
- package/dist/lib.cjs +1 -0
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.js +1 -0
- package/dist/lib.js.map +1 -1
- package/dist/navigation.cjs +53 -0
- package/dist/navigation.cjs.map +1 -0
- package/dist/navigation.d.cts +64 -0
- package/dist/navigation.d.ts +64 -0
- package/dist/navigation.js +48 -0
- package/dist/navigation.js.map +1 -0
- package/package.json +6 -7
- package/dist/router.cjs +0 -44
- package/dist/router.cjs.map +0 -1
- package/dist/router.d.cts +0 -79
- package/dist/router.d.ts +0 -79
- package/dist/router.js +0 -42
- package/dist/router.js.map +0 -1
package/dist/forms.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { AlertTriangle, EyeOff, Eye, Loader2, CircleCheck, Check } from 'lucide-react';
|
|
3
3
|
import { createContext, useState, useEffect, useMemo, useCallback, useContext, useRef } from 'react';
|
|
4
|
-
import { useSearchParams } from 'react-router-dom';
|
|
5
4
|
import '@insforge/sdk';
|
|
6
5
|
|
|
6
|
+
// src/components/atoms/AuthBranding.tsx
|
|
7
7
|
function AuthBranding() {
|
|
8
8
|
return /* @__PURE__ */ jsxs("div", { className: "if-authBranding if-internal-ab4k9w", children: [
|
|
9
9
|
/* @__PURE__ */ jsx("p", { className: "if-authBranding-text", children: "Secured by" }),
|
|
@@ -101,6 +101,20 @@ function AuthFormField({ label, id, ...props }) {
|
|
|
101
101
|
/* @__PURE__ */ jsx("input", { id, className: "if-formField-input if-internal-i2v8k4", ...props })
|
|
102
102
|
] });
|
|
103
103
|
}
|
|
104
|
+
var NavigationContext = createContext(null);
|
|
105
|
+
function useNavigationAdapter() {
|
|
106
|
+
const adapter = useContext(NavigationContext);
|
|
107
|
+
if (!adapter) {
|
|
108
|
+
throw new Error("useNavigationAdapter must be used within NavigationProvider");
|
|
109
|
+
}
|
|
110
|
+
return adapter;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// src/navigation/useSearchParams.ts
|
|
114
|
+
function useSearchParams() {
|
|
115
|
+
const adapter = useNavigationAdapter();
|
|
116
|
+
return adapter.useSearchParams();
|
|
117
|
+
}
|
|
104
118
|
function AuthPasswordStrengthIndicator({
|
|
105
119
|
password,
|
|
106
120
|
config
|
|
@@ -194,7 +208,8 @@ function AuthPasswordField({
|
|
|
194
208
|
onFocus,
|
|
195
209
|
...props
|
|
196
210
|
}) {
|
|
197
|
-
const
|
|
211
|
+
const searchParams = useSearchParams();
|
|
212
|
+
const { Link } = useNavigationAdapter();
|
|
198
213
|
const [showPassword, setShowPassword] = useState(false);
|
|
199
214
|
const [showStrength, setShowStrength] = useState(false);
|
|
200
215
|
const resolvedForgotPasswordHref = useMemo(
|
|
@@ -210,7 +225,7 @@ function AuthPasswordField({
|
|
|
210
225
|
return /* @__PURE__ */ jsxs("div", { className: "if-passwordField if-internal-p5w9m7", children: [
|
|
211
226
|
(label || forgotPasswordLink) && /* @__PURE__ */ jsxs("div", { className: "if-passwordField-labelRow", children: [
|
|
212
227
|
/* @__PURE__ */ jsx("label", { htmlFor: id, className: "if-passwordField-label", children: label }),
|
|
213
|
-
forgotPasswordLink && resolvedForgotPasswordHref && /* @__PURE__ */ jsx(
|
|
228
|
+
forgotPasswordLink && resolvedForgotPasswordHref && /* @__PURE__ */ jsx(Link, { href: resolvedForgotPasswordHref, className: "if-passwordField-forgotLink", children: forgotPasswordLink.text || "Forget Password?" })
|
|
214
229
|
] }),
|
|
215
230
|
/* @__PURE__ */ jsxs("div", { className: "if-passwordField-inputWrapper", children: [
|
|
216
231
|
/* @__PURE__ */ jsx(
|
|
@@ -262,12 +277,13 @@ function AuthSubmitButton({
|
|
|
262
277
|
);
|
|
263
278
|
}
|
|
264
279
|
function AuthLink({ text, linkText, href }) {
|
|
265
|
-
const
|
|
280
|
+
const searchParams = useSearchParams();
|
|
281
|
+
const { Link } = useNavigationAdapter();
|
|
266
282
|
const finalHref = resolveAuthUrl(href, searchParams);
|
|
267
283
|
return /* @__PURE__ */ jsxs("p", { className: "if-authLink if-internal-al5w9p", children: [
|
|
268
284
|
text && /* @__PURE__ */ jsx("span", { className: "if-authLink-text", children: text }),
|
|
269
285
|
text && " ",
|
|
270
|
-
/* @__PURE__ */ jsx(
|
|
286
|
+
/* @__PURE__ */ jsx(Link, { href: finalHref, className: "if-authLink-link", children: linkText })
|
|
271
287
|
] });
|
|
272
288
|
}
|
|
273
289
|
function AuthDivider({ text = "or" }) {
|