@olwiba/ui 0.2.14 → 0.2.15
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.js +16 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/app/AppShell.tsx +8 -4
- package/src/marketing/Navbar.tsx +12 -14
package/package.json
CHANGED
package/src/app/AppShell.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import type { LucideIcon } from 'lucide-react';
|
|
4
|
-
import type
|
|
4
|
+
import { useCallback, type ReactNode } from 'react';
|
|
5
5
|
import {
|
|
6
6
|
BellIcon,
|
|
7
7
|
CreditCardIcon,
|
|
@@ -249,12 +249,16 @@ function ShellSidebar({
|
|
|
249
249
|
sidebarPosition: 'viewport' | 'contained';
|
|
250
250
|
}) {
|
|
251
251
|
const fallbackLogo = typeof brand.name === 'string' ? brand.name.slice(0, 1).toUpperCase() : null;
|
|
252
|
+
const { isMobile, setOpenMobile } = useSidebar();
|
|
253
|
+
const closeMobileMenu = useCallback(() => {
|
|
254
|
+
if (isMobile) setOpenMobile(false);
|
|
255
|
+
}, [isMobile, setOpenMobile]);
|
|
252
256
|
|
|
253
257
|
return (
|
|
254
258
|
<Sidebar side={side} collapsible={collapsible} sidebarPosition={sidebarPosition}>
|
|
255
259
|
<SidebarHeader className="py-3">
|
|
256
260
|
<SidebarMenu>
|
|
257
|
-
<SidebarMenuItem>
|
|
261
|
+
<SidebarMenuItem onClickCapture={closeMobileMenu}>
|
|
258
262
|
<SidebarMenuButton
|
|
259
263
|
asChild
|
|
260
264
|
size="lg"
|
|
@@ -295,7 +299,7 @@ function ShellSidebar({
|
|
|
295
299
|
<SidebarGroupContent className="flex flex-col gap-2">
|
|
296
300
|
{action && (
|
|
297
301
|
<SidebarMenu>
|
|
298
|
-
<SidebarMenuItem>
|
|
302
|
+
<SidebarMenuItem onClickCapture={closeMobileMenu}>
|
|
299
303
|
{action.href ? (
|
|
300
304
|
<SidebarMenuButton
|
|
301
305
|
asChild
|
|
@@ -328,7 +332,7 @@ function ShellSidebar({
|
|
|
328
332
|
|
|
329
333
|
<SidebarMenu>
|
|
330
334
|
{navItems.map((item) => (
|
|
331
|
-
<SidebarMenuItem key={item.label}>
|
|
335
|
+
<SidebarMenuItem key={item.label} onClickCapture={closeMobileMenu}>
|
|
332
336
|
<SidebarMenuButton asChild tooltip={item.label} isActive={item.isActive}>
|
|
333
337
|
{renderLink({
|
|
334
338
|
href: item.href,
|
package/src/marketing/Navbar.tsx
CHANGED
|
@@ -82,14 +82,19 @@ export function Navbar({
|
|
|
82
82
|
</div>
|
|
83
83
|
)}
|
|
84
84
|
|
|
85
|
-
{/* Mobile drawer —
|
|
85
|
+
{/* Mobile controls + drawer trigger — keep quick toggles visible, with menu last. */}
|
|
86
86
|
<Sheet open={open} onOpenChange={setOpen}>
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
<div className="col-start-3 flex items-center justify-end gap-1 md:hidden">
|
|
88
|
+
{controls?.map((control, i) => (
|
|
89
|
+
<React.Fragment key={i}>{control}</React.Fragment>
|
|
90
|
+
))}
|
|
91
|
+
<SheetTrigger asChild>
|
|
92
|
+
<Button variant="ghost" size="icon">
|
|
93
|
+
<Menu className="size-5" />
|
|
94
|
+
<span className="sr-only">Open menu</span>
|
|
95
|
+
</Button>
|
|
96
|
+
</SheetTrigger>
|
|
97
|
+
</div>
|
|
93
98
|
<SheetContent side="left" className="w-72">
|
|
94
99
|
{/* Brand row alone at the top — leaves the top-right corner to the built-in close */}
|
|
95
100
|
<div className="flex items-center pb-4">
|
|
@@ -105,13 +110,6 @@ export function Navbar({
|
|
|
105
110
|
})}
|
|
106
111
|
</span>
|
|
107
112
|
</div>
|
|
108
|
-
{controls?.length ? (
|
|
109
|
-
<div className="mb-4 flex w-full items-center justify-between gap-1">
|
|
110
|
-
{controls.map((control, i) => (
|
|
111
|
-
<React.Fragment key={i}>{control}</React.Fragment>
|
|
112
|
-
))}
|
|
113
|
-
</div>
|
|
114
|
-
) : null}
|
|
115
113
|
<Separator />
|
|
116
114
|
<nav className="mt-4 flex flex-col gap-1">
|
|
117
115
|
{navLinks.map((link) => (
|