@ascendkit/nextjs 0.3.6 → 0.3.7

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.
@@ -274,15 +274,15 @@ export function AscendKitProvider({ publicKey = process.env.NEXT_PUBLIC_ASCENDKI
274
274
  if (message)
275
275
  setAuthNotification({ variant, message });
276
276
  }, localization: {
277
- SIGN_IN: environmentName ? `Log in to ${environmentName}` : "Log In",
277
+ SIGN_IN: environmentName ? `Log in to ${environmentName}` : "Log in",
278
278
  SIGN_IN_DESCRIPTION: credentialsEnabled
279
- ? "Enter your credentials to continue"
279
+ ? "Enter your email below to log in to your account"
280
280
  : magicLinkEnabled
281
- ? "Enter your email to receive a sign-in link"
281
+ ? "Enter your email to receive a secure sign-in link"
282
282
  : "Choose how you'd like to sign in",
283
- SIGN_UP: environmentName ? `Sign up for ${environmentName}` : "Sign Up",
284
- SIGN_UP_DESCRIPTION: "Enter your information to create an account",
285
- SIGN_IN_WITH: "",
283
+ SIGN_UP: environmentName ? `Sign up for ${environmentName}` : "Sign up",
284
+ SIGN_UP_DESCRIPTION: "Enter your information to create your account",
285
+ SIGN_IN_WITH: "Continue with",
286
286
  DISABLED_CREDENTIALS_DESCRIPTION: socialProviders.length === 1
287
287
  ? `Continue with ${socialProviders[0].charAt(0).toUpperCase() + socialProviders[0].slice(1)} to sign in`
288
288
  : "Choose how you'd like to continue",
@@ -1,7 +1,30 @@
1
1
  import { type AuthViewProps } from "@daveyplate/better-auth-ui";
2
+ type AscendKitAuthCardDensity = "comfortable" | "compact";
3
+ type AscendKitAuthCardAlignment = "left" | "center";
4
+ interface AscendKitAuthCardTheme {
5
+ card?: string;
6
+ foreground?: string;
7
+ mutedForeground?: string;
8
+ border?: string;
9
+ input?: string;
10
+ primary?: string;
11
+ primaryForeground?: string;
12
+ accent?: string;
13
+ accentForeground?: string;
14
+ radius?: string;
15
+ shadow?: string;
16
+ }
2
17
  interface AscendKitAuthCardProps extends Omit<AuthViewProps, "view"> {
3
18
  /** Which view to show. Defaults to "SIGN_IN". */
4
19
  view?: AuthViewProps["view"];
20
+ /** Visual density of the built-in AscendKit styling. */
21
+ density?: AscendKitAuthCardDensity;
22
+ /** Content alignment for the header and footer chrome. */
23
+ alignment?: AscendKitAuthCardAlignment;
24
+ /** Optional eyebrow text rendered above the auth title. */
25
+ eyebrow?: string | null;
26
+ /** Optional theme token overrides for the built-in card styling. */
27
+ theme?: AscendKitAuthCardTheme;
5
28
  }
6
29
  /**
7
30
  * Drop-in auth card powered by Better Auth UI.
@@ -1 +1 @@
1
- {"version":3,"file":"auth-card.d.ts","sourceRoot":"","sources":["../../src/components/auth-card.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAK1E,UAAU,sBAAuB,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;IAClE,iDAAiD;IACjD,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC9B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAoM9D"}
1
+ {"version":3,"file":"auth-card.d.ts","sourceRoot":"","sources":["../../src/components/auth-card.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAK1E,KAAK,wBAAwB,GAAG,aAAa,GAAG,SAAS,CAAC;AAC1D,KAAK,0BAA0B,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEpD,UAAU,sBAAsB;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,sBAAuB,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;IAClE,iDAAiD;IACjD,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7B,wDAAwD;IACxD,OAAO,CAAC,EAAE,wBAAwB,CAAC;IACnC,0DAA0D;IAC1D,SAAS,CAAC,EAAE,0BAA0B,CAAC;IACvC,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,oEAAoE;IACpE,KAAK,CAAC,EAAE,sBAAsB,CAAC;CAChC;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAonB9D"}
@@ -1,9 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useEffect } from "react";
3
+ import { useEffect, useRef } from "react";
4
4
  import { AuthView } from "@daveyplate/better-auth-ui";
5
5
  import { useAscendKitContext } from "../client/provider";
6
6
  import { BrandingBadge } from "./branding-badge";
7
+ function joinClasses(...values) {
8
+ return values.filter(Boolean).join(" ");
9
+ }
7
10
  /**
8
11
  * Drop-in auth card powered by Better Auth UI.
9
12
  *
@@ -17,10 +20,29 @@ import { BrandingBadge } from "./branding-badge";
17
20
  * ```
18
21
  */
19
22
  export function AscendKitAuthCard(props) {
23
+ const { density = "comfortable", alignment = "left", eyebrow = "Secure access", theme, ...authViewProps } = props;
20
24
  const { settingsLoaded, settingsError, refreshSettings, authNotification, clearAuthNotification } = useAscendKitContext();
25
+ const wrapperRef = useRef(null);
26
+ const hasEyebrow = typeof eyebrow === "string" && eyebrow.trim().length > 0;
21
27
  useEffect(() => {
22
28
  void refreshSettings();
23
29
  }, [refreshSettings]);
30
+ useEffect(() => {
31
+ const root = wrapperRef.current;
32
+ if (!root)
33
+ return;
34
+ const buttons = root.querySelectorAll(".ak-baui-provider-button");
35
+ for (const button of buttons) {
36
+ const walker = document.createTreeWalker(button, NodeFilter.SHOW_TEXT);
37
+ let textNode = null;
38
+ while ((textNode = walker.nextNode())) {
39
+ if (textNode.textContent?.trim()) {
40
+ textNode.textContent = textNode.textContent.replace(/^Continue with\s+/i, "").trim();
41
+ break;
42
+ }
43
+ }
44
+ }
45
+ }, [settingsLoaded, authViewProps.view, authViewProps.socialLayout]);
24
46
  // Auto-dismiss notification after 8 seconds
25
47
  useEffect(() => {
26
48
  if (!authNotification)
@@ -46,6 +68,50 @@ export function AscendKitAuthCard(props) {
46
68
  : authNotification?.variant === "info"
47
69
  ? "ak-auth-notification--info"
48
70
  : "ak-auth-notification--success";
71
+ const wrapperStyle = {
72
+ ["--ak-auth-eyebrow"]: hasEyebrow ? JSON.stringify(eyebrow) : undefined,
73
+ ["--ak-auth-card"]: theme?.card,
74
+ ["--ak-auth-foreground"]: theme?.foreground,
75
+ ["--ak-auth-muted-foreground"]: theme?.mutedForeground,
76
+ ["--ak-auth-border"]: theme?.border,
77
+ ["--ak-auth-input"]: theme?.input,
78
+ ["--ak-auth-primary"]: theme?.primary,
79
+ ["--ak-auth-primary-foreground"]: theme?.primaryForeground,
80
+ ["--ak-auth-accent"]: theme?.accent,
81
+ ["--ak-auth-accent-foreground"]: theme?.accentForeground,
82
+ ["--ak-auth-radius"]: theme?.radius,
83
+ ["--ak-auth-shadow"]: theme?.shadow,
84
+ };
85
+ const mergedClassNames = {
86
+ ...authViewProps.classNames,
87
+ base: joinClasses("ak-baui-card", authViewProps.classNames?.base),
88
+ header: joinClasses("ak-baui-header", authViewProps.classNames?.header),
89
+ title: joinClasses("ak-baui-title", authViewProps.classNames?.title),
90
+ description: joinClasses("ak-baui-description", authViewProps.classNames?.description),
91
+ content: joinClasses("ak-baui-content", authViewProps.classNames?.content),
92
+ continueWith: joinClasses("ak-baui-continue", authViewProps.classNames?.continueWith),
93
+ separator: joinClasses("ak-baui-separator", authViewProps.classNames?.separator),
94
+ footer: joinClasses("ak-baui-footer", authViewProps.classNames?.footer),
95
+ footerLink: joinClasses("ak-baui-footer-link", authViewProps.classNames?.footerLink),
96
+ form: {
97
+ ...authViewProps.classNames?.form,
98
+ base: joinClasses("ak-baui-form", authViewProps.classNames?.form?.base),
99
+ label: joinClasses("ak-baui-label", authViewProps.classNames?.form?.label),
100
+ input: joinClasses("ak-baui-input", authViewProps.classNames?.form?.input),
101
+ error: joinClasses("ak-baui-error", authViewProps.classNames?.form?.error),
102
+ button: joinClasses("ak-baui-button", authViewProps.classNames?.form?.button),
103
+ primaryButton: joinClasses("ak-baui-button-primary", authViewProps.classNames?.form?.primaryButton),
104
+ secondaryButton: joinClasses("ak-baui-button-secondary", authViewProps.classNames?.form?.secondaryButton),
105
+ outlineButton: joinClasses("ak-baui-button-outline", authViewProps.classNames?.form?.outlineButton),
106
+ providerButton: joinClasses("ak-baui-provider-button", authViewProps.classNames?.form?.providerButton),
107
+ forgotPasswordLink: joinClasses("ak-baui-forgot-link", authViewProps.classNames?.form?.forgotPasswordLink),
108
+ icon: joinClasses("ak-baui-icon", authViewProps.classNames?.form?.icon),
109
+ checkbox: joinClasses("ak-baui-checkbox", authViewProps.classNames?.form?.checkbox),
110
+ otpInput: joinClasses("ak-baui-otp-input", authViewProps.classNames?.form?.otpInput),
111
+ otpInputContainer: joinClasses("ak-baui-otp-input-container", authViewProps.classNames?.form?.otpInputContainer),
112
+ qrCode: joinClasses("ak-baui-qr", authViewProps.classNames?.form?.qrCode),
113
+ },
114
+ };
49
115
  return (_jsxs("div", { children: [authNotification && (_jsxs("div", { className: `ak-auth-notification ${notifClass}`, role: "alert", children: [_jsx("p", { className: "ak-auth-notification-msg", children: authNotification.message }), _jsx("button", { type: "button", className: "ak-auth-notification-close", onClick: clearAuthNotification, "aria-label": "Dismiss", children: "\u2715" }), _jsx("style", { children: `
50
116
  .ak-auth-notification {
51
117
  display: flex;
@@ -124,17 +190,334 @@ export function AscendKitAuthCard(props) {
124
190
  --ak-notif-info-border: rgba(59, 130, 246, 0.2);
125
191
  }
126
192
  }
127
- ` })] })), _jsxs("div", { className: "ak-auth-view-wrapper", children: [_jsx(AuthView, { ...props, socialLayout: props.socialLayout ?? "vertical", classNames: {
128
- content: "overflow-x-hidden",
129
- continueWith: "w-full min-w-0",
130
- separator: "min-w-0 flex-1",
131
- ...props.classNames,
132
- } }), _jsx("style", { children: `
193
+ ` })] })), _jsxs("div", { ref: wrapperRef, className: `ak-auth-view-wrapper ak-auth-density-${density} ak-auth-align-${alignment}${hasEyebrow ? " ak-auth-has-eyebrow" : ""}`, style: wrapperStyle, children: [_jsx(AuthView, { ...authViewProps, socialLayout: authViewProps.socialLayout ?? "vertical", classNames: mergedClassNames }), _jsx("style", { children: `
133
194
  /*
134
- * Fallback styles for Better Auth UI's Tailwind utility classes.
135
- * These ensure correct rendering when the host app's Tailwind config
136
- * does not scan node_modules/@daveyplate/better-auth-ui.
137
- * Each rule uses .ak-auth-view-wrapper to avoid leaking into the host app.
195
+ * Scoped fallback theme tokens and semantic classes for Better Auth UI.
196
+ * This keeps AscendKitAuthCard working even when the host app does not
197
+ * scan node_modules or define shadcn/ui theme variables.
198
+ */
199
+ .ak-auth-view-wrapper {
200
+ --background: #f7f8fc;
201
+ --foreground: var(--ak-auth-foreground, #f3f6ff);
202
+ --card: var(--ak-auth-card, linear-gradient(180deg, rgba(19, 25, 42, 0.94) 0%, rgba(12, 17, 30, 0.98) 100%));
203
+ --card-foreground: var(--ak-auth-foreground, #f3f6ff);
204
+ --popover: #ffffff;
205
+ --popover-foreground: #0f172a;
206
+ --primary: var(--ak-auth-primary, #f6f7fb);
207
+ --primary-foreground: var(--ak-auth-primary-foreground, #0f172a);
208
+ --secondary: rgba(255, 255, 255, 0.04);
209
+ --secondary-foreground: var(--ak-auth-foreground, #f3f6ff);
210
+ --muted: rgba(255, 255, 255, 0.04);
211
+ --muted-foreground: var(--ak-auth-muted-foreground, #94a3b8);
212
+ --accent: var(--ak-auth-accent, rgba(255, 255, 255, 0.06));
213
+ --accent-foreground: var(--ak-auth-accent-foreground, #f3f6ff);
214
+ --destructive: #dc2626;
215
+ --destructive-foreground: #ffffff;
216
+ --border: var(--ak-auth-border, rgba(148, 163, 184, 0.18));
217
+ --input: var(--ak-auth-input, rgba(148, 163, 184, 0.2));
218
+ --ring: #7dd3fc;
219
+ --ring-offset-background: #050816;
220
+ --ak-shell-radius: var(--ak-auth-radius, 26px);
221
+ --ak-shell-shadow: var(--ak-auth-shadow, 0 28px 80px rgba(2, 6, 23, 0.42));
222
+ --ak-inner-surface: rgba(7, 11, 23, 0.52);
223
+ --ak-inner-surface-strong: rgba(7, 11, 23, 0.74);
224
+ color: var(--foreground);
225
+ }
226
+ html.dark .ak-auth-view-wrapper,
227
+ :root.dark .ak-auth-view-wrapper {
228
+ --background: #020617;
229
+ --foreground: #f8fafc;
230
+ --card: var(--ak-auth-card, linear-gradient(180deg, rgba(19, 25, 42, 0.94) 0%, rgba(12, 17, 30, 0.98) 100%));
231
+ --card-foreground: var(--ak-auth-foreground, #f8fafc);
232
+ --popover: #0f172a;
233
+ --popover-foreground: #f8fafc;
234
+ --primary: var(--ak-auth-primary, #f8fafc);
235
+ --primary-foreground: var(--ak-auth-primary-foreground, #0f172a);
236
+ --secondary: rgba(255, 255, 255, 0.04);
237
+ --secondary-foreground: var(--ak-auth-foreground, #f8fafc);
238
+ --muted: rgba(255, 255, 255, 0.04);
239
+ --muted-foreground: var(--ak-auth-muted-foreground, #94a3b8);
240
+ --accent: var(--ak-auth-accent, rgba(255, 255, 255, 0.06));
241
+ --accent-foreground: var(--ak-auth-accent-foreground, #f8fafc);
242
+ --destructive: #ef4444;
243
+ --destructive-foreground: #ffffff;
244
+ --border: var(--ak-auth-border, rgba(255, 255, 255, 0.14));
245
+ --input: var(--ak-auth-input, rgba(255, 255, 255, 0.14));
246
+ --ring: #60a5fa;
247
+ --ring-offset-background: #020617;
248
+ }
249
+ .ak-auth-view-wrapper .ak-baui-card {
250
+ display: flex;
251
+ flex-direction: column;
252
+ width: 100%;
253
+ max-width: 31.5rem;
254
+ border: 1px solid var(--border);
255
+ border-radius: var(--ak-shell-radius);
256
+ background: var(--card);
257
+ color: var(--card-foreground);
258
+ box-shadow: var(--ak-shell-shadow);
259
+ backdrop-filter: blur(18px);
260
+ overflow: hidden;
261
+ position: relative;
262
+ }
263
+ .ak-auth-view-wrapper .ak-baui-card::before {
264
+ content: "";
265
+ position: absolute;
266
+ inset: 0;
267
+ pointer-events: none;
268
+ background:
269
+ radial-gradient(circle at top left, rgba(125, 211, 252, 0.12), transparent 32%),
270
+ radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.05), transparent 24%);
271
+ }
272
+ .ak-auth-view-wrapper .ak-baui-header {
273
+ display: flex;
274
+ flex-direction: column;
275
+ gap: 0.75rem;
276
+ padding: 2.25rem 2.25rem 0;
277
+ position: relative;
278
+ z-index: 1;
279
+ }
280
+ .ak-auth-view-wrapper .ak-baui-header::before {
281
+ content: var(--ak-auth-eyebrow);
282
+ display: inline-flex;
283
+ align-self: flex-start;
284
+ margin-bottom: 0.1rem;
285
+ padding: 0.33rem 0.7rem;
286
+ border: 1px solid rgba(125, 211, 252, 0.18);
287
+ border-radius: 999px;
288
+ background: rgba(125, 211, 252, 0.08);
289
+ color: rgba(191, 219, 254, 0.92);
290
+ font-size: 0.7rem;
291
+ line-height: 1;
292
+ font-weight: 700;
293
+ letter-spacing: 0.12em;
294
+ text-transform: uppercase;
295
+ }
296
+ .ak-auth-view-wrapper:not(.ak-auth-has-eyebrow) .ak-baui-header::before {
297
+ display: none;
298
+ }
299
+ .ak-auth-view-wrapper .ak-baui-title {
300
+ margin: 0;
301
+ font-size: clamp(2.25rem, 3.8vw, 2.75rem);
302
+ line-height: 1;
303
+ letter-spacing: -0.04em;
304
+ font-weight: 750;
305
+ color: var(--card-foreground);
306
+ }
307
+ .ak-auth-view-wrapper .ak-baui-description {
308
+ margin: 0;
309
+ max-width: 28rem;
310
+ font-size: 1rem;
311
+ line-height: 1.6;
312
+ color: var(--muted-foreground);
313
+ }
314
+ .ak-auth-view-wrapper .ak-baui-content {
315
+ display: grid;
316
+ gap: 1.2rem;
317
+ padding: 1.9rem 2.25rem 2.25rem;
318
+ overflow-x: hidden;
319
+ position: relative;
320
+ z-index: 1;
321
+ }
322
+ .ak-auth-view-wrapper .ak-baui-form {
323
+ display: grid;
324
+ width: 100%;
325
+ gap: 1.5rem;
326
+ padding: 1.4rem;
327
+ border: 1px solid rgba(148, 163, 184, 0.1);
328
+ border-radius: calc(var(--ak-shell-radius) - 8px);
329
+ background:
330
+ linear-gradient(180deg, rgba(6, 10, 21, 0.6) 0%, rgba(7, 12, 24, 0.76) 100%);
331
+ box-shadow:
332
+ inset 0 1px 0 rgba(255, 255, 255, 0.03),
333
+ 0 18px 32px rgba(2, 6, 23, 0.18);
334
+ }
335
+ .ak-auth-view-wrapper .ak-baui-form .flex.items-center.justify-between {
336
+ gap: 0.75rem;
337
+ }
338
+ .ak-auth-view-wrapper .ak-baui-label {
339
+ font-size: 0.95rem;
340
+ line-height: 1.35rem;
341
+ font-weight: 600;
342
+ color: var(--card-foreground);
343
+ }
344
+ .ak-auth-view-wrapper .ak-baui-input {
345
+ width: 100%;
346
+ min-width: 0;
347
+ min-height: 3.15rem;
348
+ padding: 0.8rem 0.95rem;
349
+ border: 1px solid var(--input);
350
+ border-radius: calc(var(--ak-shell-radius) - 12px);
351
+ background: rgba(9, 14, 26, 0.9);
352
+ color: var(--foreground);
353
+ box-sizing: border-box;
354
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
355
+ }
356
+ .ak-auth-view-wrapper .ak-baui-input::placeholder {
357
+ color: var(--muted-foreground);
358
+ }
359
+ .ak-auth-view-wrapper .ak-baui-input:focus-visible,
360
+ .ak-auth-view-wrapper .ak-baui-input:focus {
361
+ outline: none;
362
+ border-color: var(--ring);
363
+ box-shadow:
364
+ 0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent),
365
+ inset 0 1px 0 rgba(255, 255, 255, 0.02);
366
+ }
367
+ .ak-auth-view-wrapper .ak-baui-button {
368
+ display: inline-flex;
369
+ align-items: center;
370
+ justify-content: center;
371
+ gap: 0.5rem;
372
+ min-height: 3.15rem;
373
+ width: 100%;
374
+ border-radius: calc(var(--ak-shell-radius) - 12px);
375
+ border: 1px solid transparent;
376
+ padding: 0.85rem 1.1rem;
377
+ font-size: 1rem;
378
+ line-height: 1.35rem;
379
+ font-weight: 600;
380
+ cursor: pointer;
381
+ transition: transform 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
382
+ }
383
+ .ak-auth-view-wrapper .ak-baui-button:disabled {
384
+ opacity: 0.65;
385
+ cursor: not-allowed;
386
+ }
387
+ .ak-auth-view-wrapper .ak-baui-button-primary {
388
+ background:
389
+ linear-gradient(180deg, color-mix(in srgb, var(--primary) 94%, white) 0%, var(--primary) 100%);
390
+ color: var(--primary-foreground);
391
+ box-shadow:
392
+ 0 14px 34px rgba(248, 250, 252, 0.09),
393
+ inset 0 1px 0 rgba(255, 255, 255, 0.45);
394
+ }
395
+ .ak-auth-view-wrapper .ak-baui-button-primary:hover:not(:disabled) {
396
+ opacity: 0.95;
397
+ transform: translateY(-1px);
398
+ }
399
+ .ak-auth-view-wrapper .ak-baui-button-outline,
400
+ .ak-auth-view-wrapper .ak-baui-provider-button {
401
+ background: rgba(4, 8, 18, 0.86);
402
+ border-color: var(--border);
403
+ color: var(--foreground);
404
+ }
405
+ .ak-auth-view-wrapper .ak-baui-button-outline:hover:not(:disabled),
406
+ .ak-auth-view-wrapper .ak-baui-provider-button:hover:not(:disabled) {
407
+ background: color-mix(in srgb, var(--accent) 96%, rgba(6, 10, 20, 0.48));
408
+ transform: translateY(-1px);
409
+ }
410
+ .ak-auth-view-wrapper .ak-baui-provider-button {
411
+ justify-content: center;
412
+ letter-spacing: -0.01em;
413
+ font-weight: 600;
414
+ }
415
+ .ak-auth-view-wrapper .ak-baui-icon {
416
+ width: 1.1rem;
417
+ height: 1.1rem;
418
+ flex-shrink: 0;
419
+ }
420
+ .ak-auth-view-wrapper .ak-baui-error {
421
+ font-size: 0.875rem;
422
+ line-height: 1.25rem;
423
+ color: var(--destructive);
424
+ }
425
+ .ak-auth-view-wrapper .ak-baui-forgot-link,
426
+ .ak-auth-view-wrapper .ak-baui-footer-link {
427
+ color: var(--foreground);
428
+ font-weight: 600;
429
+ text-decoration: none;
430
+ }
431
+ .ak-auth-view-wrapper .ak-baui-forgot-link:hover,
432
+ .ak-auth-view-wrapper .ak-baui-footer-link:hover {
433
+ color: color-mix(in srgb, var(--foreground) 88%, white);
434
+ text-decoration: underline;
435
+ text-underline-offset: 0.16em;
436
+ }
437
+ .ak-auth-view-wrapper .ak-baui-continue {
438
+ display: flex;
439
+ align-items: center;
440
+ width: 100%;
441
+ min-width: 0;
442
+ gap: 1rem;
443
+ margin: 0.2rem 0 0.05rem;
444
+ }
445
+ .ak-auth-view-wrapper .ak-baui-continue span {
446
+ white-space: nowrap;
447
+ text-transform: uppercase;
448
+ letter-spacing: 0.18em;
449
+ font-size: 0.69rem;
450
+ line-height: 1rem;
451
+ color: var(--muted-foreground);
452
+ }
453
+ .ak-auth-view-wrapper .ak-baui-separator {
454
+ flex: 1 1 0%;
455
+ min-width: 0;
456
+ background: var(--border);
457
+ opacity: 0.62;
458
+ }
459
+ .ak-auth-view-wrapper .ak-baui-footer {
460
+ display: flex;
461
+ justify-content: center;
462
+ align-items: center;
463
+ gap: 0.4rem;
464
+ padding: 0.25rem 2.25rem 2.25rem;
465
+ color: var(--muted-foreground);
466
+ font-size: 0.92rem;
467
+ line-height: 1.45rem;
468
+ position: relative;
469
+ z-index: 1;
470
+ }
471
+ .ak-auth-view-wrapper .ak-baui-checkbox {
472
+ border-color: var(--input);
473
+ }
474
+ .ak-auth-view-wrapper .ak-baui-otp-input {
475
+ border-color: var(--input);
476
+ border-radius: 0.5rem;
477
+ }
478
+ .ak-auth-view-wrapper .ak-baui-otp-input-container,
479
+ .ak-auth-view-wrapper .ak-baui-qr {
480
+ width: 100%;
481
+ }
482
+ .ak-auth-view-wrapper.ak-auth-align-center .ak-baui-header,
483
+ .ak-auth-view-wrapper.ak-auth-align-center .ak-baui-footer {
484
+ align-items: center;
485
+ text-align: center;
486
+ }
487
+ .ak-auth-view-wrapper.ak-auth-align-center .ak-baui-description {
488
+ margin-left: auto;
489
+ margin-right: auto;
490
+ }
491
+ .ak-auth-view-wrapper.ak-auth-align-center .ak-baui-header::before {
492
+ align-self: center;
493
+ }
494
+ .ak-auth-view-wrapper.ak-auth-density-compact .ak-baui-header {
495
+ padding: 1.6rem 1.6rem 0;
496
+ }
497
+ .ak-auth-view-wrapper.ak-auth-density-compact .ak-baui-content {
498
+ padding: 1.3rem 1.6rem 1.6rem;
499
+ }
500
+ .ak-auth-view-wrapper.ak-auth-density-compact .ak-baui-footer {
501
+ padding: 0.15rem 1.6rem 1.6rem;
502
+ }
503
+ .ak-auth-view-wrapper.ak-auth-density-compact .ak-baui-title {
504
+ font-size: clamp(1.85rem, 3vw, 2.1rem);
505
+ }
506
+ .ak-auth-view-wrapper.ak-auth-density-compact .ak-baui-description {
507
+ font-size: 0.92rem;
508
+ line-height: 1.45;
509
+ }
510
+ .ak-auth-view-wrapper.ak-auth-density-compact .ak-baui-form {
511
+ padding: 1rem;
512
+ }
513
+ .ak-auth-view-wrapper.ak-auth-density-compact .ak-baui-button,
514
+ .ak-auth-view-wrapper.ak-auth-density-compact .ak-baui-input {
515
+ min-height: 2.8rem;
516
+ }
517
+
518
+ /*
519
+ * Minimal utility fallbacks for Better Auth UI internals that still
520
+ * rely on Tailwind-generated classes.
138
521
  */
139
522
  .ak-auth-view-wrapper .size-4 { width: 1rem; height: 1rem; }
140
523
  .ak-auth-view-wrapper .size-5 { width: 1.25rem; height: 1.25rem; }
@@ -156,13 +539,51 @@ export function AscendKitAuthCard(props) {
156
539
  .ak-auth-view-wrapper .text-lg { font-size: 1.125rem; line-height: 1.75rem; }
157
540
  .ak-auth-view-wrapper .font-semibold { font-weight: 600; }
158
541
  .ak-auth-view-wrapper .rounded-md { border-radius: 0.375rem; }
542
+ .ak-auth-view-wrapper .rounded-xl { border-radius: 0.75rem; }
159
543
  .ak-auth-view-wrapper .rounded-lg { border-radius: 0.5rem; }
160
544
  .ak-auth-view-wrapper .min-w-0 { min-width: 0; }
161
545
  .ak-auth-view-wrapper .overflow-x-hidden { overflow-x: hidden; }
162
546
  .ak-auth-view-wrapper .text-center { text-align: center; }
163
547
  .ak-auth-view-wrapper .p-2 { padding: 0.5rem; }
164
548
  .ak-auth-view-wrapper .p-4 { padding: 1rem; }
549
+ .ak-auth-view-wrapper .px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
165
550
  .ak-auth-view-wrapper .px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
551
+ .ak-auth-view-wrapper .py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
552
+ .ak-auth-view-wrapper .py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
166
553
  .ak-auth-view-wrapper .h-9 { height: 2.25rem; }
554
+ .ak-auth-view-wrapper .border { border: 1px solid var(--border); }
555
+ .ak-auth-view-wrapper .bg-card { background: var(--card); }
556
+ .ak-auth-view-wrapper .bg-background { background: var(--background); }
557
+ .ak-auth-view-wrapper .text-card-foreground { color: var(--card-foreground); }
558
+ .ak-auth-view-wrapper .text-foreground { color: var(--foreground); }
559
+ .ak-auth-view-wrapper .text-muted-foreground { color: var(--muted-foreground); }
560
+ .ak-auth-view-wrapper .border-input { border-color: var(--input); }
561
+ .ak-auth-view-wrapper .shadow-sm,
562
+ .ak-auth-view-wrapper .shadow-xs { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }
563
+
564
+ @media (max-width: 640px) {
565
+ .ak-auth-view-wrapper .ak-baui-card {
566
+ max-width: 100%;
567
+ }
568
+ .ak-auth-view-wrapper .ak-baui-header {
569
+ padding: 1.55rem 1.2rem 0;
570
+ }
571
+ .ak-auth-view-wrapper .ak-baui-content {
572
+ padding: 1.2rem 1.2rem 1.35rem;
573
+ }
574
+ .ak-auth-view-wrapper .ak-baui-footer {
575
+ padding: 0.2rem 1.2rem 1.35rem;
576
+ flex-wrap: wrap;
577
+ }
578
+ .ak-auth-view-wrapper .ak-baui-title {
579
+ font-size: 2rem;
580
+ }
581
+ .ak-auth-view-wrapper .ak-baui-description {
582
+ font-size: 0.95rem;
583
+ }
584
+ .ak-auth-view-wrapper .ak-baui-form {
585
+ padding: 1rem;
586
+ }
587
+ }
167
588
  ` })] }), _jsx(BrandingBadge, {})] }));
168
589
  }
@@ -1 +1 @@
1
- {"version":3,"file":"auth-modal.d.ts","sourceRoot":"","sources":["../../src/components/auth-modal.tsx"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,wBAAgB,SAAS,4CA2HxB"}
1
+ {"version":3,"file":"auth-modal.d.ts","sourceRoot":"","sources":["../../src/components/auth-modal.tsx"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,wBAAgB,SAAS,4CA2IxB"}
@@ -49,61 +49,77 @@ export function AuthModal() {
49
49
  left: 50%;
50
50
  transform: translate(-50%, -50%);
51
51
  margin: 0;
52
- border: none;
53
- border-radius: 12px;
52
+ border: 1px solid rgba(255, 255, 255, 0.08);
53
+ border-radius: 28px;
54
54
  padding: 0;
55
- max-width: 420px;
56
- width: 90vw;
55
+ max-width: 560px;
56
+ width: min(92vw, 560px);
57
57
  max-height: 90vh;
58
58
  overflow-y: auto;
59
- background: var(--ak-modal-bg, #fff);
60
- color: var(--ak-modal-color, #1a1a1a);
61
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
59
+ background:
60
+ linear-gradient(180deg, rgba(9, 12, 20, 0.98) 0%, rgba(4, 6, 13, 0.98) 100%);
61
+ color: var(--ak-modal-color, #f5f5f5);
62
+ box-shadow: 0 36px 120px rgba(0, 0, 0, 0.48);
62
63
  z-index: 9999;
63
64
  }
64
65
  .ak-auth-modal::backdrop {
65
- background: rgba(0, 0, 0, 0.5);
66
- backdrop-filter: blur(4px);
67
- -webkit-backdrop-filter: blur(4px);
66
+ background: rgba(2, 6, 23, 0.72);
67
+ backdrop-filter: blur(14px);
68
+ -webkit-backdrop-filter: blur(14px);
68
69
  }
69
70
  .ak-auth-modal-content {
70
71
  position: relative;
71
- padding: 32px 24px 24px;
72
+ padding: 28px 28px 22px;
72
73
  }
73
74
  .ak-auth-modal-close {
74
75
  position: absolute;
75
- top: 12px;
76
- right: 12px;
77
- background: none;
78
- border: none;
79
- font-size: 18px;
76
+ top: 14px;
77
+ right: 14px;
78
+ display: inline-flex;
79
+ align-items: center;
80
+ justify-content: center;
81
+ width: 40px;
82
+ height: 40px;
83
+ background: rgba(255, 255, 255, 0.03);
84
+ border: 1px solid rgba(255, 255, 255, 0.08);
85
+ font-size: 22px;
80
86
  cursor: pointer;
81
- color: var(--ak-modal-muted, #888);
87
+ color: var(--ak-modal-muted, rgba(255, 255, 255, 0.7));
82
88
  line-height: 1;
83
- padding: 4px 8px;
84
- border-radius: 4px;
89
+ padding: 0;
90
+ border-radius: 999px;
91
+ transition: background-color 0.15s, color 0.15s, transform 0.15s;
85
92
  }
86
93
  .ak-auth-modal-close:hover {
87
- color: var(--ak-modal-color, #1a1a1a);
88
- background: var(--ak-modal-hover-bg, rgba(0, 0, 0, 0.05));
94
+ color: var(--ak-modal-color, #fff);
95
+ background: var(--ak-modal-hover-bg, rgba(255, 255, 255, 0.08));
96
+ transform: translateY(-1px);
89
97
  }
90
98
 
91
99
  /* Dark mode: Tailwind class-based (html.dark) */
92
100
  :root.dark .ak-auth-modal,
93
101
  html.dark .ak-auth-modal {
94
- --ak-modal-bg: #0a0a0a;
95
102
  --ak-modal-color: #f5f5f5;
96
- --ak-modal-muted: #888;
97
- --ak-modal-hover-bg: rgba(255, 255, 255, 0.1);
103
+ --ak-modal-muted: rgba(255, 255, 255, 0.7);
104
+ --ak-modal-hover-bg: rgba(255, 255, 255, 0.12);
98
105
  }
99
106
 
100
107
  /* Dark mode: system preference fallback */
101
108
  @media (prefers-color-scheme: dark) {
102
109
  .ak-auth-modal:not(.ak-light) {
103
- --ak-modal-bg: #0a0a0a;
104
110
  --ak-modal-color: #f5f5f5;
105
- --ak-modal-muted: #888;
106
- --ak-modal-hover-bg: rgba(255, 255, 255, 0.1);
111
+ --ak-modal-muted: rgba(255, 255, 255, 0.7);
112
+ --ak-modal-hover-bg: rgba(255, 255, 255, 0.12);
113
+ }
114
+ }
115
+
116
+ @media (max-width: 640px) {
117
+ .ak-auth-modal {
118
+ width: min(94vw, 560px);
119
+ border-radius: 24px;
120
+ }
121
+ .ak-auth-modal-content {
122
+ padding: 18px 16px 14px;
107
123
  }
108
124
  }
109
125
  ` })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"branding-badge.d.ts","sourceRoot":"","sources":["../../src/components/branding-badge.tsx"],"names":[],"mappings":"AAIA,wBAAgB,aAAa,mDAgC5B"}
1
+ {"version":3,"file":"branding-badge.d.ts","sourceRoot":"","sources":["../../src/components/branding-badge.tsx"],"names":[],"mappings":"AAIA,wBAAgB,aAAa,mDAqC5B"}
@@ -7,10 +7,11 @@ export function BrandingBadge() {
7
7
  return null;
8
8
  return (_jsxs("div", { className: "ak-branding-badge", children: [_jsxs("a", { href: "https://ascendkit.dev?ref=auth", target: "_blank", rel: "noopener noreferrer", className: "ak-branding-link", children: ["Powered by ", _jsx("strong", { children: "AscendKit" })] }), _jsx("style", { children: `
9
9
  .ak-branding-badge {
10
- margin-top: 12px;
10
+ margin-top: 16px;
11
11
  text-align: center;
12
12
  font-size: 12px;
13
- color: var(--ak-muted-color, #888);
13
+ letter-spacing: 0.01em;
14
+ color: var(--ak-muted-color, rgba(148, 163, 184, 0.88));
14
15
  }
15
16
  .ak-branding-link {
16
17
  color: inherit;
@@ -19,5 +20,9 @@ export function BrandingBadge() {
19
20
  .ak-branding-link:hover {
20
21
  text-decoration: underline;
21
22
  }
23
+ .ak-branding-link strong {
24
+ font-weight: 700;
25
+ color: color-mix(in srgb, currentColor 82%, white);
26
+ }
22
27
  ` })] }));
23
28
  }
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "0.3.6";
1
+ export declare const SDK_VERSION = "0.3.7";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.3.6";
1
+ export const SDK_VERSION = "0.3.7";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ascendkit/nextjs",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "AscendKit SDK for Next.js and React",
5
5
  "author": "ascendkit.dev",
6
6
  "license": "MIT",