yaxa-svelte 1.5.0 → 1.5.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.
@@ -0,0 +1,3 @@
1
+ export { default as AuthCard } from '../components/saas/AuthCard.svelte';
2
+ export { useAuth } from '../composables/useAuth.svelte';
3
+ export type { UseAuthOptions, SocialProvider } from '../composables/useAuth.svelte';
@@ -0,0 +1,3 @@
1
+ // Yaxa SaaS Auth Suite (Better-Auth integration for Svelte 5 & SvelteKit)
2
+ export { default as AuthCard } from '../components/saas/AuthCard.svelte';
3
+ export { useAuth } from '../composables/useAuth.svelte';
@@ -3,24 +3,16 @@
3
3
  import Badge from '../elements/Badge.svelte';
4
4
  import Icon from '../elements/Icon.svelte';
5
5
  import DropdownMenu, { type MenuItem } from '../navigation/DropdownMenu.svelte';
6
- import { useAuth } from '../../composables/useAuth.svelte';
7
-
8
- interface UserInfo {
9
- name?: string | null;
10
- email?: string | null;
11
- image?: string | null;
12
- role?: string | null;
13
- tier?: string | null;
14
- }
6
+ import { getAuthUserContext, type AuthUserContext } from '../../site/context';
15
7
 
16
8
  interface Props {
17
- user?: UserInfo | null;
9
+ user?: AuthUserContext | null;
18
10
  tier?: string;
19
11
  dashboardUrl?: string;
20
12
  settingsUrl?: string;
21
13
  billingUrl?: string;
22
14
  class?: string;
23
- onsignout?: () => void;
15
+ onsignout?: () => void | Promise<void>;
24
16
  }
25
17
 
26
18
  let {
@@ -33,16 +25,17 @@
33
25
  onsignout
34
26
  }: Props = $props();
35
27
 
36
- const auth = useAuth();
28
+ const contextUser = $derived(getAuthUserContext());
37
29
 
38
30
  const currentUser = $derived(
39
- propUser ||
40
- auth.user || {
41
- name: 'Solo Developer',
42
- email: 'dev@yaxa.dev',
43
- image: null,
44
- tier
45
- }
31
+ propUser !== undefined
32
+ ? propUser
33
+ : contextUser || {
34
+ name: 'Solo Developer',
35
+ email: 'dev@yaxa.dev',
36
+ image: null,
37
+ tier
38
+ }
46
39
  );
47
40
 
48
41
  const initials = $derived.by(() => {
@@ -91,9 +84,11 @@
91
84
  icon: 'log-out',
92
85
  destructive: true,
93
86
  onSelect: async () => {
94
- await auth.signOut();
95
- if (onsignout) onsignout();
96
- if (typeof window !== 'undefined') window.location.href = '/login';
87
+ if (onsignout) {
88
+ await onsignout();
89
+ } else if (typeof window !== 'undefined') {
90
+ window.location.href = '/login';
91
+ }
97
92
  }
98
93
  }
99
94
  ]);
@@ -1,18 +1,12 @@
1
- interface UserInfo {
2
- name?: string | null;
3
- email?: string | null;
4
- image?: string | null;
5
- role?: string | null;
6
- tier?: string | null;
7
- }
1
+ import { type AuthUserContext } from '../../site/context';
8
2
  interface Props {
9
- user?: UserInfo | null;
3
+ user?: AuthUserContext | null;
10
4
  tier?: string;
11
5
  dashboardUrl?: string;
12
6
  settingsUrl?: string;
13
7
  billingUrl?: string;
14
8
  class?: string;
15
- onsignout?: () => void;
9
+ onsignout?: () => void | Promise<void>;
16
10
  }
17
11
  declare const UserMenu: import("svelte").Component<Props, {}, "">;
18
12
  type UserMenu = ReturnType<typeof UserMenu>;
package/dist/index.d.ts CHANGED
@@ -123,13 +123,10 @@ export { yaxa } from './vite/index';
123
123
  export type { YaxaPluginOptions } from './vite/index';
124
124
  export { default as Gate } from './components/saas/Gate.svelte';
125
125
  export type { GateProps } from './components/saas/Gate.svelte';
126
- export { default as AuthCard } from './components/saas/AuthCard.svelte';
127
126
  export { default as UserMenu } from './components/saas/UserMenu.svelte';
128
127
  export { default as PricingCard } from './components/saas/PricingCard.svelte';
129
128
  export { default as PricingTable } from './components/saas/PricingTable.svelte';
130
129
  export { default as SubscriptionCard } from './components/saas/SubscriptionCard.svelte';
131
- export { useAuth } from './composables/useAuth.svelte';
132
- export type { UseAuthOptions, SocialProvider } from './composables/useAuth.svelte';
133
130
  export { useGate } from './composables/useGate.svelte';
134
131
  export type { UseGateOptions } from './composables/useGate.svelte';
135
132
  export { useUpload } from './composables/useUpload.svelte';
package/dist/index.js CHANGED
@@ -89,14 +89,12 @@ export { createManifestHandler } from './site/manifest';
89
89
  export { generateWebSiteSchema, generateOrganizationSchema, generateSoftwareApplicationSchema, generateSoftwareSourceCodeSchema, generatePersonSchema, generateArticleSchema, generateBreadcrumbSchema } from './site/schema';
90
90
  export { definePageSeo } from './site/seo-helpers';
91
91
  export { yaxa } from './vite/index';
92
- // SaaS Suite: UI Components & Composables
92
+ // SaaS Suite: UI Components & Composables (Pure UI & Context Runes)
93
93
  export { default as Gate } from './components/saas/Gate.svelte';
94
- export { default as AuthCard } from './components/saas/AuthCard.svelte';
95
94
  export { default as UserMenu } from './components/saas/UserMenu.svelte';
96
95
  export { default as PricingCard } from './components/saas/PricingCard.svelte';
97
96
  export { default as PricingTable } from './components/saas/PricingTable.svelte';
98
97
  export { default as SubscriptionCard } from './components/saas/SubscriptionCard.svelte';
99
- export { useAuth } from './composables/useAuth.svelte';
100
98
  export { useGate } from './composables/useGate.svelte';
101
99
  export { useUpload } from './composables/useUpload.svelte';
102
100
  // Utilities
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaxa-svelte",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "The Intuitive Svelte UI Library — Nuxt UI v4 equivalent for SvelteKit 2.7+ & Svelte 5 with automated SEO, dynamic OpenGraph cards, sitemaps, robots.txt, and Tailwind CSS v4.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://yaxa.vercel.app",
@@ -54,8 +54,9 @@
54
54
  "default": "./dist/server/index.js"
55
55
  },
56
56
  "./auth": {
57
- "types": "./dist/server/auth/index.d.ts",
58
- "default": "./dist/server/auth/index.js"
57
+ "types": "./dist/auth/index.d.ts",
58
+ "svelte": "./dist/auth/index.js",
59
+ "default": "./dist/auth/index.js"
59
60
  },
60
61
  "./db": {
61
62
  "types": "./dist/server/db/index.d.ts",
@@ -114,17 +115,15 @@
114
115
  "typescript": "^6.0.3",
115
116
  "typescript-eslint": "^8.60.1",
116
117
  "unplugin-icons": "^23.0.1",
117
- "vite": "^8.0.16"
118
+ "vite": "^8.0.16",
119
+ "zod": "^4.5.4"
118
120
  },
119
121
  "dependencies": {
120
122
  "bits-ui": "^2.19.0",
121
- "formsnap": "^2.0.1",
122
123
  "mode-watcher": "^1.1.0",
123
124
  "runed": "^0.37.1",
124
125
  "svelte-sonner": "^1.2.1",
125
- "sveltekit-superforms": "^2.30.2",
126
- "tailwind-variants": "^3.3.1",
127
- "zod": "^4.5.4"
126
+ "tailwind-variants": "^3.3.1"
128
127
  },
129
128
  "peerDependencies": {
130
129
  "@aws-sdk/client-s3": ">=3.0.0",
@@ -137,7 +136,8 @@
137
136
  "better-auth": ">=1.7.0",
138
137
  "drizzle-orm": ">=0.45.0",
139
138
  "resend": ">=6.27.0",
140
- "svelte": "^5.0.0"
139
+ "svelte": "^5.0.0",
140
+ "zod": ">=3.0.0 || >=4.0.0"
141
141
  },
142
142
  "peerDependenciesMeta": {
143
143
  "@aws-sdk/client-s3": {
@@ -166,6 +166,9 @@
166
166
  },
167
167
  "resend": {
168
168
  "optional": true
169
+ },
170
+ "zod": {
171
+ "optional": true
169
172
  }
170
173
  },
171
174
  "scripts": {