@olwiba/ui 0.0.32 → 0.0.34
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 +22 -2
- package/dist/index.js +46 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/app/AppShell.tsx +10 -2
- package/src/components/ThemeSwitchMinimal.tsx +6 -1
- package/src/index.ts +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -103,6 +103,8 @@ interface AppShellProps {
|
|
|
103
103
|
user?: AppShellUser;
|
|
104
104
|
/** Text shown in the top header bar */
|
|
105
105
|
pageTitle?: string;
|
|
106
|
+
/** Slot rendered at the start of the top header bar, after the sidebar trigger. */
|
|
107
|
+
headerStart?: ReactNode;
|
|
106
108
|
/** Override link rendering for SPA navigation. Defaults to a native <a>. */
|
|
107
109
|
renderLink?: AppShellRenderLink;
|
|
108
110
|
children?: ReactNode;
|
|
@@ -122,7 +124,7 @@ interface AppShellProps {
|
|
|
122
124
|
/** Which side the sidebar sits on. @default "left" */
|
|
123
125
|
side?: 'left' | 'right';
|
|
124
126
|
}
|
|
125
|
-
declare function AppShell({ brand, navItems, action, user, pageTitle, renderLink, collapsible, sidebarPosition, side, children, }?: AppShellProps): react_jsx_runtime.JSX.Element;
|
|
127
|
+
declare function AppShell({ brand, navItems, action, user, pageTitle, headerStart, renderLink, collapsible, sidebarPosition, side, children, }?: AppShellProps): react_jsx_runtime.JSX.Element;
|
|
126
128
|
|
|
127
129
|
interface AuthFormProps {
|
|
128
130
|
/** Controls form title, fields, and footer text. @default 'signin' */
|
|
@@ -715,6 +717,24 @@ interface RootErrorFallbackProps {
|
|
|
715
717
|
}
|
|
716
718
|
declare function RootErrorFallback({ error, resetErrorBoundary }: RootErrorFallbackProps): react_jsx_runtime.JSX.Element;
|
|
717
719
|
|
|
720
|
+
interface PostCardProps {
|
|
721
|
+
title: string;
|
|
722
|
+
description?: string;
|
|
723
|
+
date: string;
|
|
724
|
+
slug: string;
|
|
725
|
+
image?: string;
|
|
726
|
+
tags?: string[];
|
|
727
|
+
renderLink?: AppShellRenderLink;
|
|
728
|
+
}
|
|
729
|
+
declare function PostCard({ title, description, date, slug, image, tags, renderLink }: PostCardProps): react_jsx_runtime.JSX.Element;
|
|
730
|
+
|
|
731
|
+
interface PostListProps {
|
|
732
|
+
posts: PostCardProps[];
|
|
733
|
+
renderLink?: AppShellRenderLink;
|
|
734
|
+
emptyMessage?: string;
|
|
735
|
+
}
|
|
736
|
+
declare function PostList({ posts, renderLink, emptyMessage }: PostListProps): react_jsx_runtime.JSX.Element;
|
|
737
|
+
|
|
718
738
|
declare function useMounted(): boolean;
|
|
719
739
|
|
|
720
740
|
interface UseControlledOpenReturn {
|
|
@@ -771,4 +791,4 @@ interface UsePaginationReturn {
|
|
|
771
791
|
}
|
|
772
792
|
declare function usePagination(total: number, pageSize: number): UsePaginationReturn;
|
|
773
793
|
|
|
774
|
-
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 };
|
|
794
|
+
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
|
@@ -193,9 +193,10 @@ function ShellSidebar({
|
|
|
193
193
|
/* @__PURE__ */ jsx(SidebarFooter, { children: /* @__PURE__ */ jsx(NavUser, { user }) })
|
|
194
194
|
] });
|
|
195
195
|
}
|
|
196
|
-
function ShellHeader({ pageTitle }) {
|
|
196
|
+
function ShellHeader({ pageTitle, headerStart }) {
|
|
197
197
|
return /* @__PURE__ */ jsx("header", { className: "flex h-12 shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6", children: [
|
|
198
198
|
/* @__PURE__ */ jsx(SidebarTrigger, { className: "-ml-1" }),
|
|
199
|
+
headerStart && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: headerStart }),
|
|
199
200
|
/* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "mx-2 data-[orientation=vertical]:h-4" }),
|
|
200
201
|
/* @__PURE__ */ jsx("h1", { className: "text-base font-medium", children: pageTitle })
|
|
201
202
|
] }) });
|
|
@@ -215,6 +216,7 @@ function AppShell({
|
|
|
215
216
|
action,
|
|
216
217
|
user = defaultUser,
|
|
217
218
|
pageTitle = "Dashboard",
|
|
219
|
+
headerStart,
|
|
218
220
|
renderLink = defaultRenderLink,
|
|
219
221
|
collapsible = "icon",
|
|
220
222
|
sidebarPosition = "viewport",
|
|
@@ -242,7 +244,7 @@ function AppShell({
|
|
|
242
244
|
}
|
|
243
245
|
),
|
|
244
246
|
/* @__PURE__ */ jsxs(SidebarInset, { className: isContained ? void 0 : "overflow-y-auto", children: [
|
|
245
|
-
/* @__PURE__ */ jsx(ShellHeader, { pageTitle }),
|
|
247
|
+
/* @__PURE__ */ jsx(ShellHeader, { pageTitle, headerStart }),
|
|
246
248
|
children
|
|
247
249
|
] })
|
|
248
250
|
]
|
|
@@ -1273,7 +1275,14 @@ function ThemeSwitchMinimal() {
|
|
|
1273
1275
|
localStorage.setItem("theme", next);
|
|
1274
1276
|
document.documentElement.classList.toggle("dark", next === "dark");
|
|
1275
1277
|
};
|
|
1276
|
-
return /* @__PURE__ */ jsx(Button$1, { variant: "ghost", size: "icon", onClick: toggle, className: "size-8", "aria-label": "Toggle theme", children:
|
|
1278
|
+
return /* @__PURE__ */ jsx(Button$1, { variant: "ghost", size: "icon", onClick: toggle, className: "size-8", "aria-label": "Toggle theme", children: /* @__PURE__ */ jsx(
|
|
1279
|
+
"span",
|
|
1280
|
+
{
|
|
1281
|
+
className: "inline-flex size-4 items-center justify-center animate-in fade-in zoom-in-75 spin-in-90 duration-200 motion-reduce:animate-none",
|
|
1282
|
+
children: theme === "dark" ? /* @__PURE__ */ jsx(Sun, { className: "size-4" }) : /* @__PURE__ */ jsx(Moon, { className: "size-4" })
|
|
1283
|
+
},
|
|
1284
|
+
theme
|
|
1285
|
+
) });
|
|
1277
1286
|
}
|
|
1278
1287
|
var defaultRenderLink7 = ({ href, children, className }) => /* @__PURE__ */ jsx("a", { href, className, children });
|
|
1279
1288
|
function Navbar({
|
|
@@ -2003,6 +2012,39 @@ function RootErrorFallback({ error, resetErrorBoundary }) {
|
|
|
2003
2012
|
resetErrorBoundary && /* @__PURE__ */ jsx(Button$1, { onClick: resetErrorBoundary, variant: "outline", children: "Try again" })
|
|
2004
2013
|
] });
|
|
2005
2014
|
}
|
|
2015
|
+
function formatDate(dateStr) {
|
|
2016
|
+
return new Date(dateStr).toLocaleDateString("en-US", {
|
|
2017
|
+
year: "numeric",
|
|
2018
|
+
month: "long",
|
|
2019
|
+
day: "numeric"
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
2022
|
+
function PostCard({ title, description, date, slug, image, tags, renderLink }) {
|
|
2023
|
+
const href = `/blog/${slug}`;
|
|
2024
|
+
const LinkWrapper = ({ children, className }) => renderLink ? renderLink({ href, children, className }) : /* @__PURE__ */ jsx("a", { href, className, children });
|
|
2025
|
+
return /* @__PURE__ */ jsxs("article", { className: "group flex flex-col gap-3", children: [
|
|
2026
|
+
image && /* @__PURE__ */ jsx(LinkWrapper, { className: "block overflow-hidden rounded-xl", children: /* @__PURE__ */ jsx(
|
|
2027
|
+
"img",
|
|
2028
|
+
{
|
|
2029
|
+
src: image,
|
|
2030
|
+
alt: title,
|
|
2031
|
+
className: "aspect-video w-full object-cover transition-transform duration-300 group-hover:scale-105"
|
|
2032
|
+
}
|
|
2033
|
+
) }),
|
|
2034
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
2035
|
+
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)) }),
|
|
2036
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold leading-snug tracking-tight", children: /* @__PURE__ */ jsx(LinkWrapper, { className: "hover:text-primary transition-colors", children: title }) }),
|
|
2037
|
+
description && /* @__PURE__ */ jsx("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: description }),
|
|
2038
|
+
/* @__PURE__ */ jsx("time", { dateTime: date, className: "text-xs text-muted-foreground", children: formatDate(date) })
|
|
2039
|
+
] })
|
|
2040
|
+
] });
|
|
2041
|
+
}
|
|
2042
|
+
function PostList({ posts, renderLink, emptyMessage = "No posts published yet." }) {
|
|
2043
|
+
if (posts.length === 0) {
|
|
2044
|
+
return /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground italic", children: emptyMessage });
|
|
2045
|
+
}
|
|
2046
|
+
return /* @__PURE__ */ jsx("div", { className: "grid gap-8 sm:grid-cols-2", children: posts.map((post) => /* @__PURE__ */ jsx(PostCard, { ...post, renderLink }, post.slug)) });
|
|
2047
|
+
}
|
|
2006
2048
|
function useMounted() {
|
|
2007
2049
|
const [mounted, setMounted] = useState(false);
|
|
2008
2050
|
useEffect(() => {
|
|
@@ -2137,6 +2179,6 @@ function usePagination(total, pageSize) {
|
|
|
2137
2179
|
return { page, pageSize, totalPages, offset, hasPrev: page > 1, hasNext: page < totalPages, goTo, next, prev };
|
|
2138
2180
|
}
|
|
2139
2181
|
|
|
2140
|
-
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 };
|
|
2182
|
+
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 };
|
|
2141
2183
|
//# sourceMappingURL=index.js.map
|
|
2142
2184
|
//# sourceMappingURL=index.js.map
|