@mrgnw/anahtar 0.0.26 → 0.0.27

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.
@@ -2,7 +2,7 @@
2
2
  import { guessDeviceName } from '../device.js';
3
3
  import { resolveMessages, detectLocaleClient, type AuthMessages } from '../i18n/index.js';
4
4
  import PasskeyPrompt from './PasskeyPrompt.svelte';
5
- import { onMount } from 'svelte';
5
+ import { onMount, type Snippet } from 'svelte';
6
6
  import { slide } from 'svelte/transition';
7
7
 
8
8
  interface PasskeyInfo {
@@ -23,6 +23,8 @@ interface Props {
23
23
  onPasskeysChange?: () => void | Promise<void>;
24
24
  getPasskeys?: () => Promise<PasskeyInfo[]>;
25
25
  onStepChange?: (step: 'email' | 'otp' | 'authenticated') => void;
26
+ /** Extra inline icons rendered before the sign-out button when authenticated. */
27
+ actions?: Snippet;
26
28
  }
27
29
 
28
30
  let {
@@ -36,6 +38,7 @@ let {
36
38
  onPasskeysChange,
37
39
  getPasskeys,
38
40
  onStepChange,
41
+ actions,
39
42
  }: Props = $props();
40
43
 
41
44
  let expanded = $state(false);
@@ -360,6 +363,10 @@ async function removePasskey(id: string) {
360
363
  </button>
361
364
  <span class="anahtar-pill-sep">&middot;</span>
362
365
  {/if}
366
+ {#if actions}
367
+ {@render actions()}
368
+ <span class="anahtar-pill-sep">&middot;</span>
369
+ {/if}
363
370
  <button class="anahtar-pill-icon anahtar-pill-signout" onclick={handleSignOut} title="Sign out" disabled={loading}>
364
371
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
365
372
  <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" x2="9" y1="12" y2="12"/>
@@ -1,4 +1,5 @@
1
1
  import { type AuthMessages } from '../i18n/index.js';
2
+ import { type Snippet } from 'svelte';
2
3
  interface PasskeyInfo {
3
4
  id: string;
4
5
  credentialId?: string;
@@ -18,6 +19,8 @@ interface Props {
18
19
  onPasskeysChange?: () => void | Promise<void>;
19
20
  getPasskeys?: () => Promise<PasskeyInfo[]>;
20
21
  onStepChange?: (step: 'email' | 'otp' | 'authenticated') => void;
22
+ /** Extra inline icons rendered before the sign-out button when authenticated. */
23
+ actions?: Snippet;
21
24
  }
22
25
  declare const AuthPill: import("svelte").Component<Props, {}, "">;
23
26
  type AuthPill = ReturnType<typeof AuthPill>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrgnw/anahtar",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "description": "Opinionated, reusable auth for SvelteKit. Email+OTP + passkeys.",
5
5
  "license": "MIT",
6
6
  "type": "module",