@cosmicdrift/kumiko-bundled-features 0.130.2 → 0.131.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-bundled-features",
3
- "version": "0.130.2",
3
+ "version": "0.131.0",
4
4
  "description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -107,11 +107,11 @@
107
107
  "./step-dispatcher": "./src/step-dispatcher/index.ts"
108
108
  },
109
109
  "dependencies": {
110
- "@cosmicdrift/kumiko-dispatcher-live": "0.130.2",
111
- "@cosmicdrift/kumiko-framework": "0.130.2",
112
- "@cosmicdrift/kumiko-headless": "0.130.2",
113
- "@cosmicdrift/kumiko-renderer": "0.130.2",
114
- "@cosmicdrift/kumiko-renderer-web": "0.130.2",
110
+ "@cosmicdrift/kumiko-dispatcher-live": "0.131.0",
111
+ "@cosmicdrift/kumiko-framework": "0.131.0",
112
+ "@cosmicdrift/kumiko-headless": "0.131.0",
113
+ "@cosmicdrift/kumiko-renderer": "0.131.0",
114
+ "@cosmicdrift/kumiko-renderer-web": "0.131.0",
115
115
  "@mollie/api-client": "^4.5.0",
116
116
  "@node-rs/argon2": "^2.0.2",
117
117
  "@types/nodemailer": "^8.0.0",
@@ -9,14 +9,13 @@
9
9
  // (full-screen, zentriert, max-w-sm). Web-only;
10
10
  // eine Native-Variante landet bei Bedarf
11
11
  // daneben (z.B. SafeArea + ScrollView).
12
- // authButtonClass — Tailwind-Class für anchor-styled-as-button
13
- // (z.B. "Zum Login"-Link nach Reset-Success).
14
- // Nur dort, wo ein <a>-Tag rendert.
15
- // authMutedLinkClass — Subtle-Link-Style.
16
12
  // parseUrlToken — URL-Param-Helper (window.location.search).
13
+ //
14
+ // Link-Styles laufen über das Link-Primitive (variant="button"/"muted") —
15
+ // die früheren authButtonClass/authMutedLinkClass sind dorthin gewandert.
17
16
 
18
17
  import { usePrimitives } from "@cosmicdrift/kumiko-renderer";
19
- import { BareFormProvider, cn } from "@cosmicdrift/kumiko-renderer-web";
18
+ import { BareFormProvider } from "@cosmicdrift/kumiko-renderer-web";
20
19
  import { createContext, type ReactNode, useContext, useEffect, useState } from "react";
21
20
 
22
21
  // Wrappt die zentrierte Auth-Card in ihre Umgebung. Default = Fullscreen-
@@ -80,20 +79,6 @@ export function AuthCard({ title, subtitle, children }: AuthCardProps): ReactNod
80
79
  return shell(card);
81
80
  }
82
81
 
83
- // Primary-button-Style für anchor-Tags die wie ein Button aussehen
84
- // (z.B. "Zum Login"-Link nach Reset-Success — kein <Button> weil <a>).
85
- export const authButtonClass = cn(
86
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors",
87
- "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
88
- "disabled:pointer-events-none disabled:opacity-50",
89
- "bg-primary text-primary-foreground shadow hover:bg-primary/90 h-9 px-4 py-2",
90
- );
91
-
92
- // Subtle-Link-Style (für "Zurück zum Login"-Anchors). Fixed margin/
93
- // alignment-classes lassen wir den Caller setzen — nur Farbe + hover.
94
- export const authMutedLinkClass =
95
- "text-sm text-muted-foreground hover:text-foreground underline-offset-4 hover:underline";
96
-
97
82
  // Liest `?<paramName>=<value>` aus der aktuellen URL — typisches
98
83
  // Pattern für Token-bearing Pages (reset, verify). Returnt "" wenn der
99
84
  // Browser nicht da ist (SSR-safety) oder der Parameter fehlt.
@@ -12,7 +12,7 @@
12
12
  import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
13
13
  import { type FormEvent, type ReactNode, useState } from "react";
14
14
  import { requestPasswordReset } from "./auth-client";
15
- import { AuthCard, authMutedLinkClass } from "./auth-form-primitives";
15
+ import { AuthCard } from "./auth-form-primitives";
16
16
 
17
17
  export type ForgotPasswordScreenProps = {
18
18
  readonly title?: string;
@@ -28,7 +28,7 @@ export function ForgotPasswordScreen({
28
28
  loginHref = "/login",
29
29
  }: ForgotPasswordScreenProps): ReactNode {
30
30
  const t = useTranslation();
31
- const { Form, Field, Input, Button, Banner } = usePrimitives();
31
+ const { Form, Field, Input, Button, Banner, Link } = usePrimitives();
32
32
  const [email, setEmail] = useState("");
33
33
  const [submitting, setSubmitting] = useState(false);
34
34
  const [done, setDone] = useState(false);
@@ -77,9 +77,9 @@ export function ForgotPasswordScreen({
77
77
  <p className="font-medium text-foreground">{t("auth.forgotPassword.successTitle")}</p>
78
78
  <p className="mt-1">{t("auth.forgotPassword.successBody")}</p>
79
79
  </Banner>
80
- <a href={loginHref} className={authMutedLinkClass}>
80
+ <Link href={loginHref} variant="muted">
81
81
  {t("auth.forgotPassword.backToLogin")}
82
- </a>
82
+ </Link>
83
83
  </div>
84
84
  ) : (
85
85
  <div className="p-6 pt-0 flex flex-col gap-4">
@@ -101,9 +101,9 @@ export function ForgotPasswordScreen({
101
101
  {submitting ? t("auth.forgotPassword.submitting") : t("auth.forgotPassword.submit")}
102
102
  </Button>
103
103
  </Form>
104
- <a href={loginHref} className={`${authMutedLinkClass} self-center`}>
104
+ <Link href={loginHref} variant="muted" className="self-center">
105
105
  {t("auth.forgotPassword.backToLogin")}
106
- </a>
106
+ </Link>
107
107
  </div>
108
108
  )}
109
109
  </AuthCard>
@@ -19,7 +19,7 @@
19
19
  import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
20
20
  import { type FormEvent, type ReactNode, useContext, useState } from "react";
21
21
  import { csrfHeader } from "./auth-client";
22
- import { AuthCard, authMutedLinkClass, useUrlToken } from "./auth-form-primitives";
22
+ import { AuthCard, useUrlToken } from "./auth-form-primitives";
23
23
  import { SessionContext, UNAUTHENTICATED } from "./session";
24
24
 
25
25
  export type InviteAcceptScreenProps = {
@@ -41,7 +41,7 @@ export function InviteAcceptScreen({
41
41
  loginHref = "/login",
42
42
  }: InviteAcceptScreenProps): ReactNode {
43
43
  const t = useTranslation();
44
- const { Form, Field, Input, Button, Banner } = usePrimitives();
44
+ const { Form, Field, Input, Button, Banner, Link } = usePrimitives();
45
45
  // NOT useSession(): InviteAcceptScreen is a public route (anon invite-links
46
46
  // are the documented use case) — useSession() throws without a
47
47
  // <SessionProvider> ancestor. Read the context directly and fall back to
@@ -142,9 +142,9 @@ export function InviteAcceptScreen({
142
142
  <AuthCard title={effectiveTitle}>
143
143
  <div className="p-6 pt-0 flex flex-col gap-4">
144
144
  <p className="text-sm text-muted-foreground">{t("auth.inviteAccept.missingToken")}</p>
145
- <a href={loginHref} className={authMutedLinkClass}>
145
+ <Link href={loginHref} variant="muted">
146
146
  {t("auth.inviteAccept.goToLogin")}
147
- </a>
147
+ </Link>
148
148
  </div>
149
149
  </AuthCard>
150
150
  );
@@ -12,7 +12,7 @@
12
12
  import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
13
13
  import { type FormEvent, type ReactNode, useState } from "react";
14
14
  import { type LoginFailure, requestEmailVerification } from "./auth-client";
15
- import { AuthCard, authMutedLinkClass } from "./auth-form-primitives";
15
+ import { AuthCard } from "./auth-form-primitives";
16
16
  import { useSession } from "./session";
17
17
 
18
18
  // Resend-Status für den "Bestätigungs-Mail erneut senden"-Flow, der bei
@@ -92,7 +92,7 @@ export function LoginScreen({
92
92
  legalLinks,
93
93
  }: LoginScreenProps): ReactNode {
94
94
  const t = useTranslation();
95
- const { Form, Field, Input, Button, Banner } = usePrimitives();
95
+ const { Form, Field, Input, Button, Banner, Link } = usePrimitives();
96
96
  const session = useSession();
97
97
  const [email, setEmail] = useState("");
98
98
  const [password, setPassword] = useState("");
@@ -186,17 +186,17 @@ export function LoginScreen({
186
186
  {error.reason === "email_not_verified" &&
187
187
  email.trim().length > 0 &&
188
188
  email === failedLoginEmail && (
189
- // kumiko-lint-ignore primitives-discipline Inline-Link im Banner (UX-Choice); Button-Primitive hat keinen link-Variant
190
- <button
191
- type="button"
192
- onClick={() => void onResend()}
193
- disabled={resendStatus.kind === "sending"}
194
- className={`${authMutedLinkClass} self-start text-left disabled:opacity-50`}
195
- >
196
- {resendStatus.kind === "sending"
197
- ? t("auth.login.submitting")
198
- : t("auth.login.resendVerification")}
199
- </button>
189
+ <span className="self-start">
190
+ <Button
191
+ variant="link"
192
+ onClick={() => void onResend()}
193
+ disabled={resendStatus.kind === "sending"}
194
+ >
195
+ {resendStatus.kind === "sending"
196
+ ? t("auth.login.submitting")
197
+ : t("auth.login.resendVerification")}
198
+ </Button>
199
+ </span>
200
200
  )}
201
201
  {resendStatus.kind === "rateLimited" && (
202
202
  <span className="text-xs">{t("auth.login.resendRateLimited")}</span>
@@ -212,14 +212,14 @@ export function LoginScreen({
212
212
  </Button>
213
213
  </Form>
214
214
  {forgotPasswordHref !== undefined && (
215
- <a href={forgotPasswordHref} className={`${authMutedLinkClass} self-center`}>
215
+ <Link href={forgotPasswordHref} variant="muted" className="self-center">
216
216
  {t("auth.login.forgotPassword")}
217
- </a>
217
+ </Link>
218
218
  )}
219
219
  {signupHref !== undefined && (
220
- <a href={signupHref} className={`${authMutedLinkClass} self-center`}>
220
+ <Link href={signupHref} variant="muted" className="self-center">
221
221
  {t("auth.signup.title")}
222
- </a>
222
+ </Link>
223
223
  )}
224
224
  {legalLinks !== undefined && legalLinks.length > 0 && (
225
225
  <nav
@@ -227,9 +227,9 @@ export function LoginScreen({
227
227
  className="flex items-center justify-center gap-3 pt-2 border-t border-border/50"
228
228
  >
229
229
  {legalLinks.map((link) => (
230
- <a key={link.href} href={link.href} className={`${authMutedLinkClass} text-xs`}>
230
+ <Link key={link.href} href={link.href} variant="muted" className="text-xs">
231
231
  {link.label}
232
- </a>
232
+ </Link>
233
233
  ))}
234
234
  </nav>
235
235
  )}
@@ -13,7 +13,7 @@
13
13
  import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
14
14
  import { type FormEvent, type ReactNode, useState } from "react";
15
15
  import { resetPassword } from "./auth-client";
16
- import { AuthCard, authButtonClass, authMutedLinkClass, useUrlToken } from "./auth-form-primitives";
16
+ import { AuthCard, useUrlToken } from "./auth-form-primitives";
17
17
 
18
18
  export type ResetPasswordScreenProps = {
19
19
  readonly title?: string;
@@ -31,7 +31,7 @@ export function ResetPasswordScreen({
31
31
  loginHref = "/login",
32
32
  }: ResetPasswordScreenProps): ReactNode {
33
33
  const t = useTranslation();
34
- const { Form, Field, Input, Button, Banner } = usePrimitives();
34
+ const { Form, Field, Input, Button, Banner, Link } = usePrimitives();
35
35
  const token = useUrlToken(tokenProp);
36
36
  const [newPassword, setNewPassword] = useState("");
37
37
  const [confirmPassword, setConfirmPassword] = useState("");
@@ -83,9 +83,9 @@ export function ResetPasswordScreen({
83
83
  <AuthCard title={effectiveTitle}>
84
84
  <div className="p-6 pt-0 flex flex-col gap-4">
85
85
  <p className="text-sm text-muted-foreground">{t("auth.resetPassword.missingToken")}</p>
86
- <a href={loginHref} className={authMutedLinkClass}>
86
+ <Link href={loginHref} variant="muted">
87
87
  {t("auth.resetPassword.goToLogin")}
88
- </a>
88
+ </Link>
89
89
  </div>
90
90
  </AuthCard>
91
91
  );
@@ -99,9 +99,9 @@ export function ResetPasswordScreen({
99
99
  <p className="font-medium text-foreground">{t("auth.resetPassword.successTitle")}</p>
100
100
  <p className="mt-1">{t("auth.resetPassword.successBody")}</p>
101
101
  </Banner>
102
- <a href={loginHref} className={authButtonClass}>
102
+ <Link href={loginHref} variant="button">
103
103
  {t("auth.resetPassword.goToLogin")}
104
- </a>
104
+ </Link>
105
105
  </div>
106
106
  ) : (
107
107
  <div className="p-6 pt-0 flex flex-col gap-4">
@@ -18,7 +18,7 @@
18
18
  import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
19
19
  import { type FormEvent, type ReactNode, useState } from "react";
20
20
  import { confirmSignup } from "./auth-client";
21
- import { AuthCard, authMutedLinkClass, useUrlToken } from "./auth-form-primitives";
21
+ import { AuthCard, useUrlToken } from "./auth-form-primitives";
22
22
 
23
23
  export type SignupCompleteScreenProps = {
24
24
  readonly title?: string;
@@ -43,7 +43,7 @@ export function SignupCompleteScreen({
43
43
  loginHref = "/login",
44
44
  }: SignupCompleteScreenProps): ReactNode {
45
45
  const t = useTranslation();
46
- const { Form, Field, Input, Button, Banner } = usePrimitives();
46
+ const { Form, Field, Input, Button, Banner, Link } = usePrimitives();
47
47
  const token = useUrlToken(tokenProp);
48
48
  const [password, setPassword] = useState("");
49
49
  const [confirmPassword, setConfirmPassword] = useState("");
@@ -98,9 +98,9 @@ export function SignupCompleteScreen({
98
98
  <AuthCard title={effectiveTitle}>
99
99
  <div className="p-6 pt-0 flex flex-col gap-4">
100
100
  <p className="text-sm text-muted-foreground">{t("auth.signupComplete.missingToken")}</p>
101
- <a href={loginHref} className={authMutedLinkClass}>
101
+ <Link href={loginHref} variant="muted">
102
102
  {t("auth.signup.haveAccount")}
103
- </a>
103
+ </Link>
104
104
  </div>
105
105
  </AuthCard>
106
106
  );
@@ -15,7 +15,7 @@
15
15
  import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
16
16
  import { type FormEvent, type ReactNode, useState } from "react";
17
17
  import { requestSignup } from "./auth-client";
18
- import { AuthCard, authMutedLinkClass } from "./auth-form-primitives";
18
+ import { AuthCard } from "./auth-form-primitives";
19
19
 
20
20
  export type SignupScreenProps = {
21
21
  readonly title?: string;
@@ -31,7 +31,7 @@ export function SignupScreen({
31
31
  loginHref = "/login",
32
32
  }: SignupScreenProps): ReactNode {
33
33
  const t = useTranslation();
34
- const { Form, Field, Input, Button, Banner } = usePrimitives();
34
+ const { Form, Field, Input, Button, Banner, Link } = usePrimitives();
35
35
  const [email, setEmail] = useState("");
36
36
  const [submitting, setSubmitting] = useState(false);
37
37
  const [done, setDone] = useState(false);
@@ -95,9 +95,9 @@ export function SignupScreen({
95
95
  <Button variant="secondary" onClick={onResend} disabled={submitting}>
96
96
  {t("auth.signup.resend")}
97
97
  </Button>
98
- <a href={loginHref} className={authMutedLinkClass}>
98
+ <Link href={loginHref} variant="muted">
99
99
  {t("auth.signup.haveAccount")}
100
- </a>
100
+ </Link>
101
101
  </div>
102
102
  ) : (
103
103
  <div className="p-6 pt-0 flex flex-col gap-4">
@@ -120,9 +120,9 @@ export function SignupScreen({
120
120
  {submitting ? t("auth.signup.submitting") : t("auth.signup.submit")}
121
121
  </Button>
122
122
  </Form>
123
- <a href={loginHref} className={`${authMutedLinkClass} self-center`}>
123
+ <Link href={loginHref} variant="muted" className="self-center">
124
124
  {t("auth.signup.haveAccount")}
125
- </a>
125
+ </Link>
126
126
  </div>
127
127
  )}
128
128
  </AuthCard>
@@ -10,10 +10,10 @@
10
10
  // nicht den ersten valid-call beim Mount und den zweiten als invalid-
11
11
  // Banner sehen.
12
12
 
13
- import { useTranslation } from "@cosmicdrift/kumiko-renderer";
13
+ import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
14
14
  import { type ReactNode, useEffect, useRef, useState } from "react";
15
15
  import { verifyEmail } from "./auth-client";
16
- import { AuthCard, authButtonClass, authMutedLinkClass, useUrlToken } from "./auth-form-primitives";
16
+ import { AuthCard, useUrlToken } from "./auth-form-primitives";
17
17
 
18
18
  export type VerifyEmailScreenProps = {
19
19
  readonly title?: string;
@@ -31,6 +31,7 @@ export function VerifyEmailScreen({
31
31
  loginHref = "/login",
32
32
  }: VerifyEmailScreenProps): ReactNode {
33
33
  const t = useTranslation();
34
+ const { Link } = usePrimitives();
34
35
  const token = useUrlToken(tokenProp);
35
36
  const [status, setStatus] = useState<Status>(token === "" ? "missing-token" : "verifying");
36
37
  const startedRef = useRef(false);
@@ -50,9 +51,9 @@ export function VerifyEmailScreen({
50
51
  <AuthCard title={title ?? t("auth.verifyEmail.errorTitle")}>
51
52
  <div className="p-6 pt-0 flex flex-col gap-4">
52
53
  <p className="text-sm text-muted-foreground">{t("auth.verifyEmail.missingToken")}</p>
53
- <a href={loginHref} className={authMutedLinkClass}>
54
+ <Link href={loginHref} variant="muted">
54
55
  {t("auth.verifyEmail.goToLogin")}
55
- </a>
56
+ </Link>
56
57
  </div>
57
58
  </AuthCard>
58
59
  );
@@ -75,9 +76,9 @@ export function VerifyEmailScreen({
75
76
  <AuthCard title={title ?? t("auth.verifyEmail.successTitle")}>
76
77
  <div className="p-6 pt-0 flex flex-col gap-4">
77
78
  <p className="text-sm text-muted-foreground">{t("auth.verifyEmail.successBody")}</p>
78
- <a href={loginHref} className={authButtonClass}>
79
+ <Link href={loginHref} variant="button">
79
80
  {t("auth.verifyEmail.goToLogin")}
80
- </a>
81
+ </Link>
81
82
  </div>
82
83
  </AuthCard>
83
84
  );
@@ -88,9 +89,9 @@ export function VerifyEmailScreen({
88
89
  <AuthCard title={title ?? t("auth.verifyEmail.errorTitle")}>
89
90
  <div className="p-6 pt-0 flex flex-col gap-4">
90
91
  <p className="text-sm text-muted-foreground">{t("auth.verifyEmail.errorBody")}</p>
91
- <a href={loginHref} className={authMutedLinkClass}>
92
+ <Link href={loginHref} variant="muted">
92
93
  {t("auth.verifyEmail.goToLogin")}
93
- </a>
94
+ </Link>
94
95
  </div>
95
96
  </AuthCard>
96
97
  );