yaxa-svelte 2.8.0 → 2.8.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/README.md CHANGED
@@ -41,7 +41,7 @@ _Nuxt UI v4 & Nuxt UI Pro Equivalent for SvelteKit 2 & 3 & Svelte 5 with Built-i
41
41
  - 🚀 **100% DRY SEO Parity**: Automate dynamic Open Graph cards (`/api/og`), environment-aware `robots.txt`, XML sitemaps with human-readable `sitemap.xsl` stylesheets, PWA manifests, and Schema.org JSON-LD from a single `src/site.config.ts`.
42
42
  - 🔐 **Batteries-Included SaaS Suite**: Pre-integrated **Better-Auth**, multi-dialect **Drizzle ORM** (Neon PostgreSQL & Turso LibSQL/SQLite), **Polar.sh** payments & webhook sync, and **Resend** transactional emails.
43
43
  - 🧩 **50+ Production Components**: Elements, compound `<Skeleton recipe="...">` layouts, AI primitives, charts, advanced forms (`<RichTextEditor>`, `<PhoneInput>`, `<CreditCardInput>`), layout, overlays, sliding segmented `<Tabs>`, native `<Toast>` / `<Toaster>`, and drop-in SaaS widgets (`<AuthCard>`, `<UserMenu>`, `<PricingTable>`, `<SubscriptionCard>`).
44
- - 🛠️ **Composable Runes**: `useAuth`, `useShortcuts`, `useClipboard`, `useColorMode`, `useToast`, `useMediaQuery`, `useDebounce`, `useIdle`, `useGate`.
44
+ - 🛠️ **Composable Runes**: `useShortcuts`, `useClipboard`, `useColorMode`, `useToast`, `useMediaQuery`, `useDebounce`, `useIdle`, `useGate`, `useAuth` (`yaxa-svelte/auth`).
45
45
 
46
46
  ---
47
47
 
@@ -578,14 +578,14 @@ A zero-overhead, runes-native query and mutation cache built specifically for Sv
578
578
  | **Theming & Studio** | `<ThemeStudio>`, `theme`, `ACCENT_PALETTES`, `NEUTRAL_PALETTES`, `RADIUS_PRESETS`, Harmonic Radius Multiplier Scale, Chart Palette Series Tokens |
579
579
  | **AI Primitives** | `<AiChat>`, `<PromptBar>`, `<AiThought>`, `<AiToolCall>`, `useAiChat` |
580
580
  | **Charts (Pure SVG)** | `<LineChart>`, `<BarChart>`, `<DonutChart>` (0 external charting dependencies, auto-responsive, dark/light theme aware) |
581
- | **SaaS & Auth Suite** | `<SignInCard>`, `<SignUpCard>`, `<ResetPasswordCard>`, `<PasskeyUI>` (WebAuthn), `<TwoFactorModal>` (TOTP), `<AuthCard>` (Polymorphic), `<Gate>`, `<UserMenu>`, `<OrgSwitcher>`, `<PricingCard>`, `<PricingTable>`, `<SubscriptionCard>`, `useAuth`, `useGate`, `useUpload` |
581
+ | **SaaS & Auth Suite** | `<Gate>`, `<UserMenu>`, `<OrgSwitcher>`, `<PricingCard>`, `<PricingTable>`, `<SubscriptionCard>`, `useGate`, `useUpload` (Root); `<SignInCard>`, `<SignUpCard>`, `<ResetPasswordCard>`, `<AuthCard>`, `<PasskeyUI>`, `<TwoFactorModal>`, `useAuth` (`yaxa-svelte/auth`) |
582
582
  | **Admin Suite** | `<AdminDashboard>`, `<RecordDrawer>`, `<DevSandbox>`, `<ImpersonationBanner>`, `createYaxaAdminHook`, `createDrizzleAdmin` |
583
583
  | **Elements & Code** | `<CodeDiff>` (Interactive Diff & Changelog), `<CodeBlock>`, `<DataTable>` (Client & Server Modes), `Button`, `ButtonGroup`, `Badge`, `Avatar`, `AvatarGroup`, `Chip`, `Meter`, `MetricCard`, `Kbd`, `Icon`, `Spinner`, `Progress`, `Skeleton`, `Link`, `Logo`, `Tree`, `Timeline`, `Terminal`, `VirtualList`, `Carousel` |
584
584
  | **Forms (Auto-Wired)** | `<Form>`, `<FormField>`, `Input`, `InputOTP`, `Textarea`, `Checkbox`, `Switch`, `Select`, `Combobox`, `MultiSelect`, `NumberInput`, `PhoneInput`, `CreditCardInput`, `RadioGroup`, `Slider`, `ColorPicker`, `ToggleGroup`, `DatePicker`, `DateRangePicker`, `Dropzone`, `<RichTextEditor>` |
585
585
  | **Layout & Blocks** | `Container`, `Header`, `Footer`, `Section`, `Card`, `Divider`, `YaxaApp`, `DashboardShell` (with independent sidebar tokens), `ResizablePanels`, Page Blocks (`Hero`, `SaaS Metrics`, `FAQ`, `Testimonials`, `FeatureGrid`) |
586
586
  | **Overlays & Nav** | `Tabs`, `Breadcrumb`, `Pagination`, `CommandPalette` (`⌘K`), `DropdownMenu`, `ContextMenu`, `Modal`, `Drawer`, `Slideover`, `Popover`, `Tooltip` (with `arrow={false}` & `unstyled`), `Alert`, `Accordion`, `NotificationCenter`, `Stepper` |
587
587
  | **Motion & Actions** | `springTilt`, `smoothSlide`, `staggerFly`, `autosize`, `clickOutside`, `portal`, `sortableItem`, `infiniteScrollAction` |
588
- | **Composables** | `useAuth`, `useGate`, `useUpload`, `useClipboard`, `useShortcuts`, `useColorMode`, `useToast`, `useMediaQuery`, `useDebounce`, `useIdle`, `useInfiniteScroll`, `useSortable`, `useDataTable`, `useLocale` |
588
+ | **Composables** | `useGate`, `useUpload`, `useClipboard`, `useShortcuts`, `useColorMode`, `useToast`, `useMediaQuery`, `useDebounce`, `useIdle`, `useInfiniteScroll`, `useSortable`, `useDataTable`, `useLocale` (Root); `useAuth` (`yaxa-svelte/auth`) |
589
589
 
590
590
  ---
591
591
 
@@ -3,13 +3,21 @@ import AuthCard from './AuthCard.svelte';
3
3
  import SignInCard from './SignInCard.svelte';
4
4
  import SignUpCard from './SignUpCard.svelte';
5
5
  import ResetPasswordCard from './ResetPasswordCard.svelte';
6
+ import { AuthCard as SubpathAuthCard, SignInCard as SubpathSignInCard, SignUpCard as SubpathSignUpCard, ResetPasswordCard as SubpathResetPasswordCard, PasskeyUI, TwoFactorModal, useAuth } from '../../auth/index.js';
6
7
  import { renderComponent } from '../../testing/index.js';
7
8
  describe('Turnkey Auth Suite Components', () => {
8
- it('exports all auth card component definitions', () => {
9
+ it('exports all auth card component definitions from yaxa-svelte/auth', () => {
9
10
  expect(AuthCard).toBeDefined();
10
11
  expect(SignInCard).toBeDefined();
11
12
  expect(SignUpCard).toBeDefined();
12
13
  expect(ResetPasswordCard).toBeDefined();
14
+ expect(SubpathAuthCard).toBeDefined();
15
+ expect(SubpathSignInCard).toBeDefined();
16
+ expect(SubpathSignUpCard).toBeDefined();
17
+ expect(SubpathResetPasswordCard).toBeDefined();
18
+ expect(PasskeyUI).toBeDefined();
19
+ expect(TwoFactorModal).toBeDefined();
20
+ expect(typeof useAuth).toBe('function');
13
21
  });
14
22
  it('renders SignInCard with sign-in fields and action buttons', () => {
15
23
  const { cleanup, target } = renderComponent(SignInCard, {
package/dist/index.d.ts CHANGED
@@ -202,18 +202,6 @@ export type { OrgSwitcherProps, OrgItem } from './components/saas/OrgSwitcher.sv
202
202
  export { default as PricingCard } from './components/saas/PricingCard.svelte';
203
203
  export { default as PricingTable } from './components/saas/PricingTable.svelte';
204
204
  export { default as SubscriptionCard } from './components/saas/SubscriptionCard.svelte';
205
- export { default as AuthCard } from './components/saas/AuthCard.svelte';
206
- export type { AuthCardProps, AuthCardMode } from './components/saas/AuthCard.svelte';
207
- export { default as SignInCard } from './components/saas/SignInCard.svelte';
208
- export type { SignInCardProps } from './components/saas/SignInCard.svelte';
209
- export { default as SignUpCard } from './components/saas/SignUpCard.svelte';
210
- export type { SignUpCardProps } from './components/saas/SignUpCard.svelte';
211
- export { default as ResetPasswordCard } from './components/saas/ResetPasswordCard.svelte';
212
- export type { ResetPasswordCardProps } from './components/saas/ResetPasswordCard.svelte';
213
- export { default as PasskeyUI } from './components/saas/PasskeyUI.svelte';
214
- export { default as TwoFactorModal } from './components/saas/TwoFactorModal.svelte';
215
- export { useAuth } from './composables/useAuth.svelte';
216
- export type { SocialProvider } from './composables/useAuth.svelte';
217
205
  export { useGate } from './composables/useGate.svelte';
218
206
  export type { UseGateOptions } from './composables/useGate.svelte';
219
207
  export { useUpload } from './composables/useUpload.svelte';
package/dist/index.js CHANGED
@@ -134,13 +134,6 @@ export { default as OrgSwitcher, orgSwitcherVariants } from './components/saas/O
134
134
  export { default as PricingCard } from './components/saas/PricingCard.svelte';
135
135
  export { default as PricingTable } from './components/saas/PricingTable.svelte';
136
136
  export { default as SubscriptionCard } from './components/saas/SubscriptionCard.svelte';
137
- export { default as AuthCard } from './components/saas/AuthCard.svelte';
138
- export { default as SignInCard } from './components/saas/SignInCard.svelte';
139
- export { default as SignUpCard } from './components/saas/SignUpCard.svelte';
140
- export { default as ResetPasswordCard } from './components/saas/ResetPasswordCard.svelte';
141
- export { default as PasskeyUI } from './components/saas/PasskeyUI.svelte';
142
- export { default as TwoFactorModal } from './components/saas/TwoFactorModal.svelte';
143
- export { useAuth } from './composables/useAuth.svelte';
144
137
  export { useGate } from './composables/useGate.svelte';
145
138
  export { useUpload } from './composables/useUpload.svelte';
146
139
  // Pre-Built SaaS Blocks
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,96 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import * as rootExports from './index';
3
+ import fs from 'node:fs';
4
+ import path from 'node:path';
5
+ describe('Root Entry Point Purity (yaxa-svelte)', () => {
6
+ const FORBIDDEN_EXPORTS = [
7
+ // Better-Auth client cards & composables (strictly yaxa-svelte/auth)
8
+ 'useAuth',
9
+ 'AuthCard',
10
+ 'SignInCard',
11
+ 'SignUpCard',
12
+ 'ResetPasswordCard',
13
+ 'PasskeyUI',
14
+ 'TwoFactorModal',
15
+ 'createYaxaAuth',
16
+ // Database & ORM (strictly yaxa-svelte/db)
17
+ 'getDb',
18
+ 'schemaPg',
19
+ 'schemaSqlite',
20
+ // Server endpoints & pipeline (strictly yaxa-svelte/server)
21
+ 'yaxaEndpoint',
22
+ 'requireAuth',
23
+ 'requireRole',
24
+ 'createAiStreamHandler',
25
+ 'createApiDocsHandler',
26
+ 'yaxaSSE',
27
+ 'broadcast',
28
+ 'enqueueJob',
29
+ 'defineWorker',
30
+ 'createJobRunner',
31
+ // Admin (strictly yaxa-svelte/admin)
32
+ 'createYaxaAdminHook',
33
+ 'createDrizzleAdmin',
34
+ 'AdminDashboard',
35
+ // Polar billing (strictly yaxa-svelte/polar)
36
+ 'createPolarCheckout',
37
+ 'createPolarWebhookHandler',
38
+ // Resend emails (strictly yaxa-svelte/email)
39
+ 'sendMagicLinkEmail',
40
+ 'sendWelcomeEmail',
41
+ // Storage uploads (strictly yaxa-svelte/storage)
42
+ 'createPresignedUploadUrl'
43
+ ];
44
+ it('must NOT export any Better-Auth, database, or server backend primitives', () => {
45
+ for (const name of FORBIDDEN_EXPORTS) {
46
+ expect(rootExports[name], `Accidental re-export of '${name}' in root 'yaxa-svelte'! Must be in appropriate subpath ('yaxa-svelte/auth', 'yaxa-svelte/server', etc.)`).toBeUndefined();
47
+ }
48
+ });
49
+ it('src/lib/index.ts source must not reference restricted subpaths or heavy backend peer dependencies', () => {
50
+ const indexPath = path.resolve('src/lib/index.ts');
51
+ const source = fs.readFileSync(indexPath, 'utf-8');
52
+ const FORBIDDEN_SUBPATHS = [
53
+ './auth',
54
+ './server',
55
+ './db',
56
+ './polar',
57
+ './email',
58
+ './storage',
59
+ './admin',
60
+ 'better-auth',
61
+ 'drizzle-orm',
62
+ '@polar-sh/sdk',
63
+ 'resend',
64
+ '@aws-sdk'
65
+ ];
66
+ for (const forbidden of FORBIDDEN_SUBPATHS) {
67
+ expect(source.includes(forbidden), `src/lib/index.ts contains forbidden reference: '${forbidden}'`).toBe(false);
68
+ }
69
+ });
70
+ it('src/lib/index.ts must not re-export auth card components', () => {
71
+ const indexPath = path.resolve('src/lib/index.ts');
72
+ const source = fs.readFileSync(indexPath, 'utf-8');
73
+ const FORBIDDEN_AUTH_CARDS = [
74
+ 'AuthCard',
75
+ 'SignInCard',
76
+ 'SignUpCard',
77
+ 'ResetPasswordCard',
78
+ 'PasskeyUI',
79
+ 'TwoFactorModal',
80
+ 'useAuth'
81
+ ];
82
+ for (const card of FORBIDDEN_AUTH_CARDS) {
83
+ const regex = new RegExp(`\\b${card}\\b`);
84
+ expect(regex.test(source), `src/lib/index.ts contains forbidden auth component: '${card}'`).toBe(false);
85
+ }
86
+ });
87
+ it('root entry point successfully evaluates without throwing runtime errors', () => {
88
+ expect(rootExports).toBeDefined();
89
+ expect(typeof rootExports.Button).toBe('function');
90
+ expect(typeof rootExports.Modal).toBe('function');
91
+ expect(typeof rootExports.Gate).toBe('function');
92
+ expect(typeof rootExports.UserMenu).toBe('function');
93
+ expect(typeof rootExports.useGate).toBe('function');
94
+ expect(typeof rootExports.useYaxa).toBe('function');
95
+ });
96
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaxa-svelte",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "The Intuitive Svelte UI Library — Nuxt UI v4 equivalent for SvelteKit 2 & 3 & 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",