@olwiba/ui 0.0.29 → 0.0.32
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/dist/index.d.ts +3 -0
- package/dist/index.js +41 -30
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/app/AuthSection.tsx +38 -23
package/dist/index.d.ts
CHANGED
|
@@ -134,11 +134,14 @@ interface AuthFormProps {
|
|
|
134
134
|
/** (signup) Link back to the sign-in page */
|
|
135
135
|
signInHref?: string;
|
|
136
136
|
forgotPasswordHref?: string;
|
|
137
|
+
/** Brand node — in centered layout renders above the card; in split layout renders inside the card */
|
|
137
138
|
brand?: React.ReactNode;
|
|
138
139
|
/** Error message displayed below the form fields */
|
|
139
140
|
error?: string;
|
|
140
141
|
/** Disables the submit button and shows a loading label */
|
|
141
142
|
loading?: boolean;
|
|
143
|
+
/** Render prop for links — use to inject framework-native link components (e.g. TanStack Router Link) */
|
|
144
|
+
renderLink?: AppShellRenderLink;
|
|
142
145
|
}
|
|
143
146
|
interface AuthSectionProps extends AuthFormProps {
|
|
144
147
|
/** Visual layout of the auth screen. @default 'centered' */
|
package/dist/index.js
CHANGED
|
@@ -253,8 +253,12 @@ function AppShell({
|
|
|
253
253
|
}
|
|
254
254
|
return inner;
|
|
255
255
|
}
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
var defaultRenderLink2 = ({ href, children, className }) => /* @__PURE__ */ jsx("a", { href, className, children });
|
|
257
|
+
function CenteredAuth({ children, brand, className }) {
|
|
258
|
+
return /* @__PURE__ */ jsxs("section", { className: cn$1("flex min-h-screen flex-col justify-center bg-background py-12 px-4 sm:px-6 lg:px-8", className), children: [
|
|
259
|
+
brand && /* @__PURE__ */ jsx("div", { className: "mx-auto w-full max-w-md text-center mb-8", children: brand }),
|
|
260
|
+
/* @__PURE__ */ jsx("div", { className: "mx-auto w-full max-w-md", children })
|
|
261
|
+
] });
|
|
258
262
|
}
|
|
259
263
|
function SplitAuth({ children, panel }) {
|
|
260
264
|
const defaultPanel = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
@@ -295,10 +299,11 @@ function DefaultForm({
|
|
|
295
299
|
forgotPasswordHref = "#",
|
|
296
300
|
brand,
|
|
297
301
|
error,
|
|
298
|
-
loading
|
|
302
|
+
loading,
|
|
303
|
+
renderLink = defaultRenderLink2
|
|
299
304
|
}) {
|
|
300
305
|
const isSignUp = mode === "signup";
|
|
301
|
-
return /* @__PURE__ */ jsxs(Card
|
|
306
|
+
return /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
302
307
|
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
303
308
|
brand && /* @__PURE__ */ jsx("div", { className: "mb-2", children: brand }),
|
|
304
309
|
/* @__PURE__ */ jsx(CardTitle, { children: isSignUp ? "Create an account" : "Sign in" }),
|
|
@@ -308,19 +313,23 @@ function DefaultForm({
|
|
|
308
313
|
/* @__PURE__ */ jsxs("form", { onSubmit, className: "space-y-4", children: [
|
|
309
314
|
isSignUp && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
310
315
|
/* @__PURE__ */ jsx(Label, { htmlFor: "auth-name", children: "Name" }),
|
|
311
|
-
/* @__PURE__ */ jsx(Input
|
|
316
|
+
/* @__PURE__ */ jsx(Input, { id: "auth-name", name: "name", type: "text", placeholder: "Your name", autoComplete: "name" })
|
|
312
317
|
] }),
|
|
313
318
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
314
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: "auth-email", children: "Email" }),
|
|
315
|
-
/* @__PURE__ */ jsx(Input
|
|
319
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "auth-email", children: "Email address" }),
|
|
320
|
+
/* @__PURE__ */ jsx(Input, { id: "auth-email", name: "email", type: "email", placeholder: "name@company.com", autoComplete: "email" })
|
|
316
321
|
] }),
|
|
317
322
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
318
323
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
319
324
|
/* @__PURE__ */ jsx(Label, { htmlFor: "auth-password", children: "Password" }),
|
|
320
|
-
!isSignUp && forgotPasswordHref &&
|
|
325
|
+
!isSignUp && forgotPasswordHref && renderLink({
|
|
326
|
+
href: forgotPasswordHref,
|
|
327
|
+
className: "text-xs text-muted-foreground underline underline-offset-4 hover:text-foreground",
|
|
328
|
+
children: "Forgot password?"
|
|
329
|
+
})
|
|
321
330
|
] }),
|
|
322
331
|
/* @__PURE__ */ jsx(
|
|
323
|
-
Input
|
|
332
|
+
Input,
|
|
324
333
|
{
|
|
325
334
|
id: "auth-password",
|
|
326
335
|
name: "password",
|
|
@@ -332,18 +341,18 @@ function DefaultForm({
|
|
|
332
341
|
] }),
|
|
333
342
|
error && /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-destructive", children: error }),
|
|
334
343
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
335
|
-
/* @__PURE__ */ jsx(Button
|
|
336
|
-
onSso && /* @__PURE__ */ jsx(Button
|
|
344
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", className: "w-full", disabled: loading, children: loading ? "Please wait\u2026" : isSignUp ? "Create account" : "Sign in" }),
|
|
345
|
+
onSso && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", className: "w-full", onClick: onSso, disabled: loading, children: "Use SSO" })
|
|
337
346
|
] })
|
|
338
347
|
] }),
|
|
339
348
|
/* @__PURE__ */ jsx("p", { className: "text-center text-xs text-muted-foreground", children: isSignUp ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
340
349
|
"Already have an account?",
|
|
341
350
|
" ",
|
|
342
|
-
|
|
351
|
+
renderLink({ href: signInHref, className: "text-foreground underline underline-offset-4", children: "Sign in" })
|
|
343
352
|
] }) : signUpHref && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
344
353
|
"New here?",
|
|
345
354
|
" ",
|
|
346
|
-
|
|
355
|
+
renderLink({ href: signUpHref, className: "text-foreground underline underline-offset-4", children: "Create an account" })
|
|
347
356
|
] }) })
|
|
348
357
|
] })
|
|
349
358
|
] });
|
|
@@ -355,11 +364,13 @@ function AuthSection({
|
|
|
355
364
|
className,
|
|
356
365
|
...formProps
|
|
357
366
|
}) {
|
|
358
|
-
const form = children ?? /* @__PURE__ */ jsx(DefaultForm, { ...formProps });
|
|
359
367
|
if (layout === "split") {
|
|
360
|
-
|
|
368
|
+
const form2 = children ?? /* @__PURE__ */ jsx(DefaultForm, { ...formProps });
|
|
369
|
+
return /* @__PURE__ */ jsx("div", { className: cn$1("h-full", className), children: /* @__PURE__ */ jsx(SplitAuth, { panel, children: form2 }) });
|
|
361
370
|
}
|
|
362
|
-
|
|
371
|
+
const { brand, ...restFormProps } = formProps;
|
|
372
|
+
const form = children ?? /* @__PURE__ */ jsx(DefaultForm, { ...restFormProps });
|
|
373
|
+
return /* @__PURE__ */ jsx(CenteredAuth, { brand, className, children: form });
|
|
363
374
|
}
|
|
364
375
|
function EmptyState({ icon: Icon, title, description, action, className, ...props }) {
|
|
365
376
|
return /* @__PURE__ */ jsxs(
|
|
@@ -378,14 +389,14 @@ function EmptyState({ icon: Icon, title, description, action, className, ...prop
|
|
|
378
389
|
}
|
|
379
390
|
);
|
|
380
391
|
}
|
|
381
|
-
var
|
|
392
|
+
var defaultRenderLink3 = ({ href, children, className }) => /* @__PURE__ */ jsx("a", { href, className, children });
|
|
382
393
|
function ErrorPage({
|
|
383
394
|
statusCode = "404",
|
|
384
395
|
title = "Page not found",
|
|
385
396
|
description = "The page you're looking for doesn't exist or has been moved. Check the URL or head back home.",
|
|
386
397
|
action = { label: "Take me home", href: "/" },
|
|
387
398
|
backAction = { label: "Go back" },
|
|
388
|
-
renderLink =
|
|
399
|
+
renderLink = defaultRenderLink3
|
|
389
400
|
}) {
|
|
390
401
|
return /* @__PURE__ */ jsx("section", { className: "overflow-hidden rounded-2xl border bg-card", children: /* @__PURE__ */ jsxs("div", { className: "relative flex min-h-[560px] flex-col items-center justify-center px-6 py-16 text-center", children: [
|
|
391
402
|
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-[radial-gradient(circle_at_center,hsl(var(--muted)/0.8),transparent_70%)]" }),
|
|
@@ -596,7 +607,7 @@ function SectionTitle({ title, description, badge, className }) {
|
|
|
596
607
|
description && /* @__PURE__ */ jsx("p", { className: "mx-auto mt-4 max-w-2xl text-pretty text-muted-foreground", children: description })
|
|
597
608
|
] }) });
|
|
598
609
|
}
|
|
599
|
-
var
|
|
610
|
+
var defaultRenderLink4 = ({ href, children, className }) => /* @__PURE__ */ jsx("a", { href, className, children });
|
|
600
611
|
function HeroSection({
|
|
601
612
|
heading,
|
|
602
613
|
badge,
|
|
@@ -606,7 +617,7 @@ function HeroSection({
|
|
|
606
617
|
heroImage,
|
|
607
618
|
avatarUrls,
|
|
608
619
|
socialProofText,
|
|
609
|
-
renderLink =
|
|
620
|
+
renderLink = defaultRenderLink4
|
|
610
621
|
}) {
|
|
611
622
|
return /* @__PURE__ */ jsx("section", { className: "overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "px-6 py-14 sm:px-10 sm:py-20", children: [
|
|
612
623
|
/* @__PURE__ */ jsxs("div", { className: "mx-auto grid max-w-6xl items-center gap-10 lg:grid-cols-2 lg:gap-16", children: [
|
|
@@ -736,14 +747,14 @@ function FeaturesSection({
|
|
|
736
747
|
)) })
|
|
737
748
|
] }) }) });
|
|
738
749
|
}
|
|
739
|
-
var
|
|
750
|
+
var defaultRenderLink5 = ({ href, children, className }) => /* @__PURE__ */ jsx("a", { href, className, children });
|
|
740
751
|
function CtaSection({
|
|
741
752
|
heading,
|
|
742
753
|
description,
|
|
743
754
|
primaryCta,
|
|
744
755
|
secondaryCta,
|
|
745
756
|
footnote,
|
|
746
|
-
renderLink =
|
|
757
|
+
renderLink = defaultRenderLink5
|
|
747
758
|
}) {
|
|
748
759
|
return /* @__PURE__ */ jsx("section", { className: "overflow-hidden rounded-2xl border bg-card", children: /* @__PURE__ */ jsxs("div", { className: "relative px-6 py-16 sm:px-10 sm:py-24", children: [
|
|
749
760
|
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-[radial-gradient(ellipse_at_center,hsl(var(--primary)/0.15),transparent_70%)]" }),
|
|
@@ -821,7 +832,7 @@ function PricingCard({
|
|
|
821
832
|
}
|
|
822
833
|
);
|
|
823
834
|
}
|
|
824
|
-
var
|
|
835
|
+
var defaultRenderLink6 = ({ href, children, className }) => /* @__PURE__ */ jsx("a", { href, className, children });
|
|
825
836
|
function PricingSection({
|
|
826
837
|
title = "Simple, transparent pricing",
|
|
827
838
|
description = "Start for free. Scale as you grow. No hidden fees.",
|
|
@@ -829,7 +840,7 @@ function PricingSection({
|
|
|
829
840
|
plans,
|
|
830
841
|
saveBadge = "Save 34%",
|
|
831
842
|
isAuthenticated,
|
|
832
|
-
renderLink =
|
|
843
|
+
renderLink = defaultRenderLink6,
|
|
833
844
|
footnote
|
|
834
845
|
}) {
|
|
835
846
|
const [annual, setAnnual] = React25.useState(false);
|
|
@@ -1264,13 +1275,13 @@ function ThemeSwitchMinimal() {
|
|
|
1264
1275
|
};
|
|
1265
1276
|
return /* @__PURE__ */ jsx(Button$1, { variant: "ghost", size: "icon", onClick: toggle, className: "size-8", "aria-label": "Toggle theme", children: theme === "dark" ? /* @__PURE__ */ jsx(Sun, { className: "size-4" }) : /* @__PURE__ */ jsx(Moon, { className: "size-4" }) });
|
|
1266
1277
|
}
|
|
1267
|
-
var
|
|
1278
|
+
var defaultRenderLink7 = ({ href, children, className }) => /* @__PURE__ */ jsx("a", { href, className, children });
|
|
1268
1279
|
function Navbar({
|
|
1269
1280
|
brand,
|
|
1270
1281
|
navLinks,
|
|
1271
1282
|
cta,
|
|
1272
1283
|
showThemeToggle = false,
|
|
1273
|
-
renderLink =
|
|
1284
|
+
renderLink = defaultRenderLink7
|
|
1274
1285
|
}) {
|
|
1275
1286
|
const [open, setOpen] = React25.useState(false);
|
|
1276
1287
|
const brandHref = brand.href ?? "/";
|
|
@@ -1340,13 +1351,13 @@ function Navbar({
|
|
|
1340
1351
|
] })
|
|
1341
1352
|
] }) });
|
|
1342
1353
|
}
|
|
1343
|
-
var
|
|
1354
|
+
var defaultRenderLink8 = ({ href, children, className }) => /* @__PURE__ */ jsx("a", { href, className, children });
|
|
1344
1355
|
function Footer({
|
|
1345
1356
|
brand,
|
|
1346
1357
|
navLinks,
|
|
1347
1358
|
socialLinks,
|
|
1348
1359
|
legal,
|
|
1349
|
-
renderLink =
|
|
1360
|
+
renderLink = defaultRenderLink8
|
|
1350
1361
|
}) {
|
|
1351
1362
|
const brandHref = brand.href ?? "/";
|
|
1352
1363
|
const copyrightText = legal ?? `\xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} ${brand.name}. All rights reserved.`;
|
|
@@ -1864,13 +1875,13 @@ function FullPageSpinner({ message }) {
|
|
|
1864
1875
|
message && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: message })
|
|
1865
1876
|
] });
|
|
1866
1877
|
}
|
|
1867
|
-
var
|
|
1878
|
+
var defaultRenderLink9 = ({ href, children, className }) => /* @__PURE__ */ jsx("a", { href, className, children });
|
|
1868
1879
|
function PageHeader({
|
|
1869
1880
|
title,
|
|
1870
1881
|
description,
|
|
1871
1882
|
breadcrumbs,
|
|
1872
1883
|
backButton,
|
|
1873
|
-
renderLink =
|
|
1884
|
+
renderLink = defaultRenderLink9,
|
|
1874
1885
|
className,
|
|
1875
1886
|
children
|
|
1876
1887
|
}) {
|