@olwiba/ui 0.0.30 → 0.0.33
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 +20 -1
- package/dist/index.js +51 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/app/AuthSection.tsx +23 -12
- package/src/index.ts +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -134,6 +134,7 @@ 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;
|
|
@@ -714,6 +715,24 @@ interface RootErrorFallbackProps {
|
|
|
714
715
|
}
|
|
715
716
|
declare function RootErrorFallback({ error, resetErrorBoundary }: RootErrorFallbackProps): react_jsx_runtime.JSX.Element;
|
|
716
717
|
|
|
718
|
+
interface PostCardProps {
|
|
719
|
+
title: string;
|
|
720
|
+
description?: string;
|
|
721
|
+
date: string;
|
|
722
|
+
slug: string;
|
|
723
|
+
image?: string;
|
|
724
|
+
tags?: string[];
|
|
725
|
+
renderLink?: AppShellRenderLink;
|
|
726
|
+
}
|
|
727
|
+
declare function PostCard({ title, description, date, slug, image, tags, renderLink }: PostCardProps): react_jsx_runtime.JSX.Element;
|
|
728
|
+
|
|
729
|
+
interface PostListProps {
|
|
730
|
+
posts: PostCardProps[];
|
|
731
|
+
renderLink?: AppShellRenderLink;
|
|
732
|
+
emptyMessage?: string;
|
|
733
|
+
}
|
|
734
|
+
declare function PostList({ posts, renderLink, emptyMessage }: PostListProps): react_jsx_runtime.JSX.Element;
|
|
735
|
+
|
|
717
736
|
declare function useMounted(): boolean;
|
|
718
737
|
|
|
719
738
|
interface UseControlledOpenReturn {
|
|
@@ -770,4 +789,4 @@ interface UsePaginationReturn {
|
|
|
770
789
|
}
|
|
771
790
|
declare function usePagination(total: number, pageSize: number): UsePaginationReturn;
|
|
772
791
|
|
|
773
|
-
export { type AppNavItem, AppShell, type AppShellAction, type AppShellBrand, type AppShellProps, type AppShellRenderLink, type AppShellUser, type AuthFormProps, AuthSection, type AuthSectionProps, Badge, type BadgeProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, ContactSection, ContextMenu, type ContextMenuDef, type ContextMenuProps, CountUp, type CountUpProps, CtaSection, type CtaSectionProps, DevBanner, type DevBannerProps, Dock, type DockItem, type DockProps, EmptyState, type EmptyStateProps, ErrorPage, type ErrorPageProps, FadeIn, type FadeInProps, FaqSection, type FaqSectionProps, FeatureCard, type FeatureCardProps, FeaturesSection, type FeaturesSectionProps, Footer, type FooterProps, FullPageSpinner, GlassCard, type GlassCardProps, HeroSection, type HeroSectionProps, type Hotkey, ImageCard, type ImageCardProps, Input, type InputProps, LogoStrip, type LogoStripProps, Navbar, type NavbarProps, NewsletterSection, OlwibaUIProvider, type OlwibaUIProviderProps, Overlay, type OverlayProps, type OverlayVariant, PageHeader, type PageHeaderBackButton, type PageHeaderBreadcrumb, type PageHeaderProps, PageTransition, type PageTransitionProps, PricingCard, type PricingCardProps, type PricingFeature, type PricingPlan, PricingSection, type PricingSectionProps, RegisterHotkeys, RootErrorFallback, SectionTitle, type SectionTitleProps, Spotlight, type SpotlightGroup, type SpotlightItem, type SpotlightProps, StaggerChildren, type StaggerChildrenProps, StatCard, type StatCardProps, StatsSection, type StatsSectionProps, Suspensed, Switch, type SwitchProps, TeamSection, TestimonialCard, type TestimonialCardProps, TestimonialsSection, type TestimonialsSectionProps, Textarea, type TextareaProps, ThemeColorUpdater, ThemeSwitchMinimal, type UIMode, Underlay, type UnderlayProps, type UnderlayVariant, type UpgradeComparisonRow, UpgradePrompt, type UpgradePromptProps, type UseConfirmReturn, type UseControlledOpenReturn, type UsePaginationReturn, VersionBanner, cn, useConfirm, useControlledOpen, useCopyToClipboard, useDebounce, useIntersectionObserver, useLocalStorage, useMediaQuery, useMounted, useOlwibaUI, usePagination, useScrolledPast, useUIMode };
|
|
792
|
+
export { type AppNavItem, AppShell, type AppShellAction, type AppShellBrand, type AppShellProps, type AppShellRenderLink, type AppShellUser, type AuthFormProps, AuthSection, type AuthSectionProps, Badge, type BadgeProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, ContactSection, ContextMenu, type ContextMenuDef, type ContextMenuProps, CountUp, type CountUpProps, CtaSection, type CtaSectionProps, DevBanner, type DevBannerProps, Dock, type DockItem, type DockProps, EmptyState, type EmptyStateProps, ErrorPage, type ErrorPageProps, FadeIn, type FadeInProps, FaqSection, type FaqSectionProps, FeatureCard, type FeatureCardProps, FeaturesSection, type FeaturesSectionProps, Footer, type FooterProps, FullPageSpinner, GlassCard, type GlassCardProps, HeroSection, type HeroSectionProps, type Hotkey, ImageCard, type ImageCardProps, Input, type InputProps, LogoStrip, type LogoStripProps, Navbar, type NavbarProps, NewsletterSection, OlwibaUIProvider, type OlwibaUIProviderProps, Overlay, type OverlayProps, type OverlayVariant, PageHeader, type PageHeaderBackButton, type PageHeaderBreadcrumb, type PageHeaderProps, PageTransition, type PageTransitionProps, PostCard, type PostCardProps, PostList, type PostListProps, PricingCard, type PricingCardProps, type PricingFeature, type PricingPlan, PricingSection, type PricingSectionProps, RegisterHotkeys, RootErrorFallback, SectionTitle, type SectionTitleProps, Spotlight, type SpotlightGroup, type SpotlightItem, type SpotlightProps, StaggerChildren, type StaggerChildrenProps, StatCard, type StatCardProps, StatsSection, type StatsSectionProps, Suspensed, Switch, type SwitchProps, TeamSection, TestimonialCard, type TestimonialCardProps, TestimonialsSection, type TestimonialsSectionProps, Textarea, type TextareaProps, ThemeColorUpdater, ThemeSwitchMinimal, type UIMode, Underlay, type UnderlayProps, type UnderlayVariant, type UpgradeComparisonRow, UpgradePrompt, type UpgradePromptProps, type UseConfirmReturn, type UseControlledOpenReturn, type UsePaginationReturn, VersionBanner, cn, useConfirm, useControlledOpen, useCopyToClipboard, useDebounce, useIntersectionObserver, useLocalStorage, useMediaQuery, useMounted, useOlwibaUI, usePagination, useScrolledPast, useUIMode };
|
package/dist/index.js
CHANGED
|
@@ -254,8 +254,11 @@ function AppShell({
|
|
|
254
254
|
return inner;
|
|
255
255
|
}
|
|
256
256
|
var defaultRenderLink2 = ({ href, children, className }) => /* @__PURE__ */ jsx("a", { href, className, children });
|
|
257
|
-
function CenteredAuth({ children }) {
|
|
258
|
-
return /* @__PURE__ */
|
|
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
|
+
] });
|
|
259
262
|
}
|
|
260
263
|
function SplitAuth({ children, panel }) {
|
|
261
264
|
const defaultPanel = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
@@ -300,7 +303,7 @@ function DefaultForm({
|
|
|
300
303
|
renderLink = defaultRenderLink2
|
|
301
304
|
}) {
|
|
302
305
|
const isSignUp = mode === "signup";
|
|
303
|
-
return /* @__PURE__ */ jsxs(Card
|
|
306
|
+
return /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
304
307
|
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
305
308
|
brand && /* @__PURE__ */ jsx("div", { className: "mb-2", children: brand }),
|
|
306
309
|
/* @__PURE__ */ jsx(CardTitle, { children: isSignUp ? "Create an account" : "Sign in" }),
|
|
@@ -310,11 +313,11 @@ function DefaultForm({
|
|
|
310
313
|
/* @__PURE__ */ jsxs("form", { onSubmit, className: "space-y-4", children: [
|
|
311
314
|
isSignUp && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
312
315
|
/* @__PURE__ */ jsx(Label, { htmlFor: "auth-name", children: "Name" }),
|
|
313
|
-
/* @__PURE__ */ jsx(Input
|
|
316
|
+
/* @__PURE__ */ jsx(Input, { id: "auth-name", name: "name", type: "text", placeholder: "Your name", autoComplete: "name" })
|
|
314
317
|
] }),
|
|
315
318
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
316
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: "auth-email", children: "Email" }),
|
|
317
|
-
/* @__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" })
|
|
318
321
|
] }),
|
|
319
322
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
320
323
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -326,7 +329,7 @@ function DefaultForm({
|
|
|
326
329
|
})
|
|
327
330
|
] }),
|
|
328
331
|
/* @__PURE__ */ jsx(
|
|
329
|
-
Input
|
|
332
|
+
Input,
|
|
330
333
|
{
|
|
331
334
|
id: "auth-password",
|
|
332
335
|
name: "password",
|
|
@@ -338,8 +341,8 @@ function DefaultForm({
|
|
|
338
341
|
] }),
|
|
339
342
|
error && /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-destructive", children: error }),
|
|
340
343
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
341
|
-
/* @__PURE__ */ jsx(Button
|
|
342
|
-
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" })
|
|
343
346
|
] })
|
|
344
347
|
] }),
|
|
345
348
|
/* @__PURE__ */ jsx("p", { className: "text-center text-xs text-muted-foreground", children: isSignUp ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -361,11 +364,13 @@ function AuthSection({
|
|
|
361
364
|
className,
|
|
362
365
|
...formProps
|
|
363
366
|
}) {
|
|
364
|
-
const form = children ?? /* @__PURE__ */ jsx(DefaultForm, { ...formProps });
|
|
365
367
|
if (layout === "split") {
|
|
366
|
-
|
|
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 }) });
|
|
367
370
|
}
|
|
368
|
-
|
|
371
|
+
const { brand, ...restFormProps } = formProps;
|
|
372
|
+
const form = children ?? /* @__PURE__ */ jsx(DefaultForm, { ...restFormProps });
|
|
373
|
+
return /* @__PURE__ */ jsx(CenteredAuth, { brand, className, children: form });
|
|
369
374
|
}
|
|
370
375
|
function EmptyState({ icon: Icon, title, description, action, className, ...props }) {
|
|
371
376
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1998,6 +2003,39 @@ function RootErrorFallback({ error, resetErrorBoundary }) {
|
|
|
1998
2003
|
resetErrorBoundary && /* @__PURE__ */ jsx(Button$1, { onClick: resetErrorBoundary, variant: "outline", children: "Try again" })
|
|
1999
2004
|
] });
|
|
2000
2005
|
}
|
|
2006
|
+
function formatDate(dateStr) {
|
|
2007
|
+
return new Date(dateStr).toLocaleDateString("en-US", {
|
|
2008
|
+
year: "numeric",
|
|
2009
|
+
month: "long",
|
|
2010
|
+
day: "numeric"
|
|
2011
|
+
});
|
|
2012
|
+
}
|
|
2013
|
+
function PostCard({ title, description, date, slug, image, tags, renderLink }) {
|
|
2014
|
+
const href = `/blog/${slug}`;
|
|
2015
|
+
const LinkWrapper = ({ children, className }) => renderLink ? renderLink({ href, children, className }) : /* @__PURE__ */ jsx("a", { href, className, children });
|
|
2016
|
+
return /* @__PURE__ */ jsxs("article", { className: "group flex flex-col gap-3", children: [
|
|
2017
|
+
image && /* @__PURE__ */ jsx(LinkWrapper, { className: "block overflow-hidden rounded-xl", children: /* @__PURE__ */ jsx(
|
|
2018
|
+
"img",
|
|
2019
|
+
{
|
|
2020
|
+
src: image,
|
|
2021
|
+
alt: title,
|
|
2022
|
+
className: "aspect-video w-full object-cover transition-transform duration-300 group-hover:scale-105"
|
|
2023
|
+
}
|
|
2024
|
+
) }),
|
|
2025
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
2026
|
+
tags && tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: tags.map((tag) => /* @__PURE__ */ jsx(Badge$1, { variant: "secondary", className: "text-xs", children: tag }, tag)) }),
|
|
2027
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold leading-snug tracking-tight", children: /* @__PURE__ */ jsx(LinkWrapper, { className: "hover:text-primary transition-colors", children: title }) }),
|
|
2028
|
+
description && /* @__PURE__ */ jsx("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: description }),
|
|
2029
|
+
/* @__PURE__ */ jsx("time", { dateTime: date, className: "text-xs text-muted-foreground", children: formatDate(date) })
|
|
2030
|
+
] })
|
|
2031
|
+
] });
|
|
2032
|
+
}
|
|
2033
|
+
function PostList({ posts, renderLink, emptyMessage = "No posts published yet." }) {
|
|
2034
|
+
if (posts.length === 0) {
|
|
2035
|
+
return /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground italic", children: emptyMessage });
|
|
2036
|
+
}
|
|
2037
|
+
return /* @__PURE__ */ jsx("div", { className: "grid gap-8 sm:grid-cols-2", children: posts.map((post) => /* @__PURE__ */ jsx(PostCard, { ...post, renderLink }, post.slug)) });
|
|
2038
|
+
}
|
|
2001
2039
|
function useMounted() {
|
|
2002
2040
|
const [mounted, setMounted] = useState(false);
|
|
2003
2041
|
useEffect(() => {
|
|
@@ -2132,6 +2170,6 @@ function usePagination(total, pageSize) {
|
|
|
2132
2170
|
return { page, pageSize, totalPages, offset, hasPrev: page > 1, hasNext: page < totalPages, goTo, next, prev };
|
|
2133
2171
|
}
|
|
2134
2172
|
|
|
2135
|
-
export { AppShell, AuthSection, Badge, Button, Card, Checkbox, ConfirmDialog, ContactSection, ContextMenu, CountUp, CtaSection, DevBanner, Dock, EmptyState, ErrorPage, FadeIn, FaqSection, FeatureCard, FeaturesSection, Footer, FullPageSpinner, GlassCard, HeroSection, ImageCard, Input, LogoStrip, Navbar, NewsletterSection, OlwibaUIProvider, Overlay, PageHeader, PageTransition, PricingCard, PricingSection, RegisterHotkeys, RootErrorFallback, SectionTitle, Spotlight, StaggerChildren, StatCard, StatsSection, Suspensed, Switch, TeamSection, TestimonialCard, TestimonialsSection, Textarea, ThemeColorUpdater, ThemeSwitchMinimal, Underlay, UpgradePrompt, VersionBanner, cn, useConfirm, useControlledOpen, useCopyToClipboard, useDebounce, useIntersectionObserver, useLocalStorage, useMediaQuery, useMounted, useOlwibaUI, usePagination, useScrolledPast, useUIMode };
|
|
2173
|
+
export { AppShell, AuthSection, Badge, Button, Card, Checkbox, ConfirmDialog, ContactSection, ContextMenu, CountUp, CtaSection, DevBanner, Dock, EmptyState, ErrorPage, FadeIn, FaqSection, FeatureCard, FeaturesSection, Footer, FullPageSpinner, GlassCard, HeroSection, ImageCard, Input, LogoStrip, Navbar, NewsletterSection, OlwibaUIProvider, Overlay, PageHeader, PageTransition, PostCard, PostList, PricingCard, PricingSection, RegisterHotkeys, RootErrorFallback, SectionTitle, Spotlight, StaggerChildren, StatCard, StatsSection, Suspensed, Switch, TeamSection, TestimonialCard, TestimonialsSection, Textarea, ThemeColorUpdater, ThemeSwitchMinimal, Underlay, UpgradePrompt, VersionBanner, cn, useConfirm, useControlledOpen, useCopyToClipboard, useDebounce, useIntersectionObserver, useLocalStorage, useMediaQuery, useMounted, useOlwibaUI, usePagination, useScrolledPast, useUIMode };
|
|
2136
2174
|
//# sourceMappingURL=index.js.map
|
|
2137
2175
|
//# sourceMappingURL=index.js.map
|