@tangle-network/sandbox-ui 0.24.0 → 0.24.1

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/pages.d.ts CHANGED
@@ -37,9 +37,15 @@ interface AuthPageProps {
37
37
  /**
38
38
  * Email/password handler. Return an error message to show, or null on success
39
39
  * (the caller handles navigation). If omitted, the email form is hidden —
40
- * SSO/social only.
40
+ * SSO/social only. In signup mode the third arg is the entered display name
41
+ * (empty string when name collection is disabled).
41
42
  */
42
- onEmailSubmit?: (email: string, password: string) => Promise<string | null>;
43
+ onEmailSubmit?: (email: string, password: string, name: string) => Promise<string | null>;
44
+ /**
45
+ * Collect a display name in the email form. Defaults to true in signup mode,
46
+ * false in signin. Set false to suppress it even on signup.
47
+ */
48
+ collectName?: boolean;
43
49
  /** Footer link target for the opposite mode (signup from signin, vice versa). */
44
50
  altHref?: string;
45
51
  /** Primary (Tangle) button background. Default Tangle ink `#0f172a`. */
@@ -55,7 +61,7 @@ interface AuthPageProps {
55
61
  /** Optional node rendered above the footer (legal copy, SSO notice, etc.). */
56
62
  children?: ReactNode;
57
63
  }
58
- declare function AuthPage({ product, tagline, mode, tangleAuthUrl, providers, socialHref, onEmailSubmit, altHref, accent, accentHover, logoSize, className, style, children, }: AuthPageProps): react_jsx_runtime.JSX.Element;
64
+ declare function AuthPage({ product, tagline, mode, tangleAuthUrl, providers, socialHref, onEmailSubmit, collectName, altHref, accent, accentHover, logoSize, className, style, children, }: AuthPageProps): react_jsx_runtime.JSX.Element;
59
65
 
60
66
  type ProductVariant$1 = "sandbox";
61
67
  interface BillingPageData {
package/dist/pages.js CHANGED
@@ -50,6 +50,7 @@ function AuthPage({
50
50
  providers = ["github", "google"],
51
51
  socialHref = (p) => `/api/auth/sign-in/social?provider=${p}&callbackURL=/app`,
52
52
  onEmailSubmit,
53
+ collectName,
53
54
  altHref,
54
55
  accent = "#0f172a",
55
56
  accentHover = "#1e293b",
@@ -58,11 +59,13 @@ function AuthPage({
58
59
  style,
59
60
  children
60
61
  }) {
62
+ const [name, setName] = useState("");
61
63
  const [email, setEmail] = useState("");
62
64
  const [password, setPassword] = useState("");
63
65
  const [error, setError] = useState("");
64
66
  const [loading, setLoading] = useState(false);
65
67
  const isSignup = mode === "signup";
68
+ const showName = collectName ?? isSignup;
66
69
  const tangleLabel = isSignup ? "Sign up with Tangle" : "Continue with Tangle";
67
70
  const emailLabel = isSignup ? "Create account with email" : "Sign in with email";
68
71
  const handleSubmit = async (e) => {
@@ -71,7 +74,7 @@ function AuthPage({
71
74
  setLoading(true);
72
75
  setError("");
73
76
  try {
74
- const err = await onEmailSubmit(email, password);
77
+ const err = await onEmailSubmit(email, password, name);
75
78
  if (err) setError(err);
76
79
  } catch {
77
80
  setError("Connection error \u2014 please try again");
@@ -181,6 +184,7 @@ function AuthPage({
181
184
  /* @__PURE__ */ jsx("div", { style: { flex: 1, height: 1, background: C.border } })
182
185
  ] }),
183
186
  /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
187
+ showName && /* @__PURE__ */ jsx("input", { type: "text", required: true, "aria-label": "Name", placeholder: "Name", autoComplete: "name", value: name, onChange: (e) => setName(e.target.value), style: inputStyle }),
184
188
  /* @__PURE__ */ jsx("input", { type: "email", required: true, "aria-label": "Email", placeholder: "Email", value: email, onChange: (e) => setEmail(e.target.value), style: inputStyle }),
185
189
  /* @__PURE__ */ jsx("input", { type: "password", required: true, "aria-label": "Password", placeholder: "Password", value: password, onChange: (e) => setPassword(e.target.value), style: inputStyle }),
186
190
  error && /* @__PURE__ */ jsx("p", { role: "alert", style: { fontSize: 14, color: "#b91c1c" }, children: error }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox-ui",
3
- "version": "0.24.0",
3
+ "version": "0.24.1",
4
4
  "description": "Unified UI component library for Tangle Sandbox — primitives, chat, dashboard, terminal, editor, and workspace components",
5
5
  "repository": {
6
6
  "type": "git",