@cronus-ui/ui 0.6.1 → 0.6.2

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,26 @@
1
+ /**
2
+ * DEMO auth adapter. Gold-path apps replace `lib/auth-adapter.ts` with a
3
+ * Better-Auth implementation that keeps the same named exports
4
+ * (`signInEmail`, `signUpEmail`, `requestPasswordReset`).
5
+ *
6
+ * PURE TS (zero React / hooks / DOM). Gallery and store demos fake success
7
+ * after client-side validation — no network.
8
+ */
9
+ /** Email + password used by sign-in (and as the base of sign-up). */
10
+ export interface AuthCredentials {
11
+ email: string;
12
+ password: string;
13
+ }
14
+ /** Sign-up payload — same credentials, optional display name. */
15
+ export interface SignUpInput extends AuthCredentials {
16
+ name?: string;
17
+ }
18
+ /** Demo sign-in: validate, wait briefly, resolve. No network. */
19
+ export declare function signInEmail(input: AuthCredentials): Promise<void>;
20
+ /** Demo sign-up: validate, wait briefly, resolve. No network. */
21
+ export declare function signUpEmail(input: SignUpInput): Promise<void>;
22
+ /** Demo password-reset request: validate email, wait briefly, resolve. No network. */
23
+ export declare function requestPasswordReset(input: {
24
+ email: string;
25
+ }): Promise<void>;
26
+ //# sourceMappingURL=auth-adapter.d.ts.map
@@ -0,0 +1,46 @@
1
+ /**
2
+ * DEMO auth adapter. Gold-path apps replace `lib/auth-adapter.ts` with a
3
+ * Better-Auth implementation that keeps the same named exports
4
+ * (`signInEmail`, `signUpEmail`, `requestPasswordReset`).
5
+ *
6
+ * PURE TS (zero React / hooks / DOM). Gallery and store demos fake success
7
+ * after client-side validation — no network.
8
+ */
9
+ const DEMO_LATENCY_MS = 200;
10
+ function wait(ms) {
11
+ return new Promise((resolve) => {
12
+ setTimeout(resolve, ms);
13
+ });
14
+ }
15
+ function requireEmail(email) {
16
+ const trimmed = email.trim();
17
+ if (!trimmed) {
18
+ throw new Error("Email is required.");
19
+ }
20
+ if (!trimmed.includes("@")) {
21
+ throw new Error("Enter a valid email address.");
22
+ }
23
+ }
24
+ function requirePassword(password) {
25
+ if (password.length < 8) {
26
+ throw new Error("Password must be at least 8 characters.");
27
+ }
28
+ }
29
+ /** Demo sign-in: validate, wait briefly, resolve. No network. */
30
+ export async function signInEmail(input) {
31
+ requireEmail(input.email);
32
+ requirePassword(input.password);
33
+ await wait(DEMO_LATENCY_MS);
34
+ }
35
+ /** Demo sign-up: validate, wait briefly, resolve. No network. */
36
+ export async function signUpEmail(input) {
37
+ requireEmail(input.email);
38
+ requirePassword(input.password);
39
+ await wait(DEMO_LATENCY_MS);
40
+ }
41
+ /** Demo password-reset request: validate email, wait briefly, resolve. No network. */
42
+ export async function requestPasswordReset(input) {
43
+ requireEmail(input.email);
44
+ await wait(DEMO_LATENCY_MS);
45
+ }
46
+ //# sourceMappingURL=auth-adapter.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronus-ui/ui",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Cronus UI — themeable, accessible React components (Radix + CVA + Tailwind v4).",
5
5
  "type": "module",
6
6
  "exports": {
@@ -20,6 +20,10 @@
20
20
  "types": "./dist/lib/demo-saas.d.ts",
21
21
  "import": "./dist/lib/demo-saas.js"
22
22
  },
23
+ "./auth-adapter": {
24
+ "types": "./dist/lib/auth-adapter.d.ts",
25
+ "import": "./dist/lib/auth-adapter.js"
26
+ },
23
27
  "./testing": {
24
28
  "types": "./dist/testing/index.d.ts",
25
29
  "import": "./dist/testing/index.js"
@@ -755,7 +759,7 @@
755
759
  "vaul": "^1.1.2"
756
760
  },
757
761
  "peerDependencies": {
758
- "@cronus-ui/theme": "0.6.1",
762
+ "@cronus-ui/theme": "0.6.2",
759
763
  "@dnd-kit/core": "^6.3.1",
760
764
  "@dnd-kit/sortable": "^10.0.0",
761
765
  "@dnd-kit/utilities": "^3.2.2",
@@ -899,7 +903,7 @@
899
903
  }
900
904
  },
901
905
  "devDependencies": {
902
- "@cronus-ui/theme": "0.6.1",
906
+ "@cronus-ui/theme": "0.6.2",
903
907
  "@dnd-kit/core": "^6.3.1",
904
908
  "@dnd-kit/sortable": "^10.0.0",
905
909
  "@dnd-kit/utilities": "^3.2.2",