@olwiba/ui 0.0.29 → 0.0.30

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": "@olwiba/ui",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -3,6 +3,11 @@
3
3
  import * as React from 'react';
4
4
  import { GalleryVerticalEnd, Building2, ShieldCheck, Sparkles } from 'lucide-react';
5
5
  import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label, cn } from '@olwiba/cn';
6
+ import type { AppShellRenderLink } from './AppShell';
7
+
8
+ const defaultRenderLink: AppShellRenderLink = ({ href, children, className }) => (
9
+ <a href={href} className={className}>{children}</a>
10
+ );
6
11
 
7
12
  // ─── Centered layout ──────────────────────────────────────────────────────────
8
13
 
@@ -66,6 +71,8 @@ export interface AuthFormProps {
66
71
  error?: string;
67
72
  /** Disables the submit button and shows a loading label */
68
73
  loading?: boolean;
74
+ /** Render prop for links — use to inject framework-native link components (e.g. TanStack Router Link) */
75
+ renderLink?: AppShellRenderLink;
69
76
  }
70
77
 
71
78
  function DefaultForm({
@@ -78,6 +85,7 @@ function DefaultForm({
78
85
  brand,
79
86
  error,
80
87
  loading,
88
+ renderLink = defaultRenderLink,
81
89
  }: AuthFormProps) {
82
90
  const isSignUp = mode === 'signup';
83
91
 
@@ -107,11 +115,11 @@ function DefaultForm({
107
115
  <div className="space-y-2">
108
116
  <div className="flex items-center justify-between">
109
117
  <Label htmlFor="auth-password">Password</Label>
110
- {!isSignUp && forgotPasswordHref && (
111
- <a className="text-xs text-muted-foreground underline underline-offset-4 hover:text-foreground" href={forgotPasswordHref}>
112
- Forgot password?
113
- </a>
114
- )}
118
+ {!isSignUp && forgotPasswordHref && renderLink({
119
+ href: forgotPasswordHref,
120
+ className: 'text-xs text-muted-foreground underline underline-offset-4 hover:text-foreground',
121
+ children: 'Forgot password?',
122
+ })}
115
123
  </div>
116
124
  <Input
117
125
  id="auth-password"
@@ -139,17 +147,13 @@ function DefaultForm({
139
147
  {isSignUp ? (
140
148
  <>
141
149
  Already have an account?{' '}
142
- <a className="text-foreground underline underline-offset-4" href={signInHref}>
143
- Sign in
144
- </a>
150
+ {renderLink({ href: signInHref, className: 'text-foreground underline underline-offset-4', children: 'Sign in' })}
145
151
  </>
146
152
  ) : (
147
153
  signUpHref && (
148
154
  <>
149
155
  New here?{' '}
150
- <a className="text-foreground underline underline-offset-4" href={signUpHref}>
151
- Create an account
152
- </a>
156
+ {renderLink({ href: signUpHref, className: 'text-foreground underline underline-offset-4', children: 'Create an account' })}
153
157
  </>
154
158
  )
155
159
  )}