@tradalab/lyra 3.9.0 → 3.12.0

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.
@@ -66,7 +66,7 @@ declare function AppShellBody({ className, children, ...rest }: ComponentProps<"
66
66
  * <AppShellMain>{children}</AppShellMain>
67
67
  * </AppShell>
68
68
  */
69
- declare function StackedSidebar({ className, ...rest }: ComponentProps<typeof Sidebar>): React.JSX.Element;
69
+ declare function StackedSidebar({ className, children, collapsible, ...rest }: ComponentProps<typeof Sidebar>): React.JSX.Element;
70
70
  /**
71
71
  * Narrow icon-rail column inside a {@link StackedSidebar}. Fixed to the icon
72
72
  * width, never collapses on its own (the parent `StackedSidebar` owns the
@@ -79,8 +79,16 @@ declare function SidebarDock({ className, ...rest }: ComponentProps<typeof Sideb
79
79
  /**
80
80
  * Wider content column inside a {@link StackedSidebar} (tree, list, …).
81
81
  * Fills remaining width; render conditionally to show/hide per app state.
82
+ *
83
+ * On icon-collapse the stack is one icon column wide and the panel is `hidden`, not squeezed
84
+ * to zero: clipped links keep their place in the tab order. `collapseToIcons` is for a panel
85
+ * that is a nav and has icon forms; the stylesheet then widens the collapsed stack to two
86
+ * columns, the dock and this panel's icons. Opt-in, because a tree or a connection list
87
+ * (redishub, loom, the hubs) has no icon form and would be crammed into 3rem.
82
88
  */
83
- declare function SidebarPanel({ className, ...rest }: ComponentProps<typeof Sidebar>): React.JSX.Element;
89
+ declare function SidebarPanel({ className, collapseToIcons, ...rest }: ComponentProps<typeof Sidebar> & {
90
+ collapseToIcons?: boolean;
91
+ }): React.JSX.Element;
84
92
 
85
93
  /**
86
94
  * Width is decided by what is inside the page, not one page at a time.
@@ -444,6 +452,34 @@ interface TabBarProps {
444
452
  */
445
453
  declare function TabBar({ tabs, activeId, onSelect, onClose, onTogglePin, onCloseOthers, onCloseAll, labels, }: TabBarProps): React.JSX.Element | null;
446
454
 
455
+ interface BottomNavItem {
456
+ id: string;
457
+ label: string;
458
+ /** The app's own icon element; the bar sizes it. */
459
+ icon: ReactNode;
460
+ /** Shows a dot on the icon. The text is what a screen reader says for the dot, so it is required to show one. */
461
+ badge?: string;
462
+ }
463
+ interface BottomNavProps {
464
+ items: BottomNavItem[];
465
+ activeId: string | null;
466
+ onSelect: (id: string) => void;
467
+ /** Names the landmark when a screen has more than one `nav`. */
468
+ label?: string;
469
+ className?: string;
470
+ }
471
+ /**
472
+ * A phone's top-level destinations along the bottom edge, where the thumb is. Not `TabBar`: that is an
473
+ * editor's row of documents that open, close and pin.
474
+ *
475
+ * It routes nothing - `onSelect` hands the id back - because auth/app switches tabs in state while
476
+ * lunarcalendar and pomodoro push routes, and all three drew this same bar by hand.
477
+ *
478
+ * No safe-area padding here. The app's root already pads every edge, and pomodoro's own copy padding
479
+ * the bottom again counted the inset twice.
480
+ */
481
+ declare function BottomNav({ items, activeId, onSelect, label, className }: BottomNavProps): React.JSX.Element;
482
+
447
483
  interface LeadingCrumb {
448
484
  /** Where the crumb links. Omit to render it as plain text. */
449
485
  href?: string;
@@ -591,4 +627,4 @@ interface AppGlyphProps {
591
627
  /** An app's mark: its image when `icon` is a URL that loads, else a name monogram. */
592
628
  declare function AppGlyph({ icon, name, className, ownOrigin }: AppGlyphProps): React.JSX.Element;
593
629
 
594
- export { AppGlyph, type AppGlyphProps, AppGrid, type AppGridGroup, type AppGridItem, type AppGridProps, AppShell, AppShellBody, AppShellHeader, AppShellMain, type AppShellProps, AppSwitcher, type AppSwitcherApp, type AppSwitcherProps, type AppSwitcherSection, AppTile, Breadcrumbs, type BreadcrumbsProps, type LeadingCrumb, type MatchMode, NavBrand, type NavBrandApp, type NavBrandGroup, type NavBrandProps, NavGroup, type NavGroupProps, type NavIcon, NavItem, type NavItemProps, NavSection, type NavSectionProps, NavUser, type NavUserProps, type NavUserThemeLabels, PageHeader, type PageHeaderProps, type PageMeasure, PageShell, type PageShellProps, SidebarDock, SidebarPanel, StackedSidebar, TabBar, type TabBarLabels, type TabBarProps, type TabItem, type UseActiveRoute, defaultAppGridLabels, defaultNavBrandAppsLabel, defaultNavUserThemeLabels, defaultTabBarLabels, isIconUrl, useActiveRoute };
630
+ export { AppGlyph, type AppGlyphProps, AppGrid, type AppGridGroup, type AppGridItem, type AppGridProps, AppShell, AppShellBody, AppShellHeader, AppShellMain, type AppShellProps, AppSwitcher, type AppSwitcherApp, type AppSwitcherProps, type AppSwitcherSection, AppTile, BottomNav, type BottomNavItem, type BottomNavProps, Breadcrumbs, type BreadcrumbsProps, type LeadingCrumb, type MatchMode, NavBrand, type NavBrandApp, type NavBrandGroup, type NavBrandProps, NavGroup, type NavGroupProps, type NavIcon, NavItem, type NavItemProps, NavSection, type NavSectionProps, NavUser, type NavUserProps, type NavUserThemeLabels, PageHeader, type PageHeaderProps, type PageMeasure, PageShell, type PageShellProps, SidebarDock, SidebarPanel, StackedSidebar, TabBar, type TabBarLabels, type TabBarProps, type TabItem, type UseActiveRoute, defaultAppGridLabels, defaultNavBrandAppsLabel, defaultNavUserThemeLabels, defaultTabBarLabels, isIconUrl, useActiveRoute };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { usePlate, useCompact } from '../chunk-AIULLZYM.js';
3
- import { SidebarInset, SidebarProvider, Sidebar, SidebarGroup, SidebarGroupLabel, SidebarGroupContent, SidebarMenu, SidebarMenuItem, SidebarMenuButton, useSidebar, defaultAccountMenuLabels, initialsOf, PlatePicker, Switch, ScrollArea, ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ScrollBar, Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbPage, BreadcrumbLink, BreadcrumbSeparator, Card, CardTitle, CardDescription } from '../chunk-CLNMWZPV.js';
3
+ import { SidebarInset, SidebarProvider, useSidebar, Sidebar, SidebarGroup, SidebarGroupLabel, SidebarGroupContent, SidebarMenu, SidebarMenuItem, SidebarMenuButton, defaultAccountMenuLabels, initialsOf, PlatePicker, Switch, ScrollArea, ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ScrollBar, Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbPage, BreadcrumbLink, BreadcrumbSeparator, Card, CardTitle, CardDescription } from '../chunk-CLNMWZPV.js';
4
4
  import '../chunk-D7DMRCDY.js';
5
5
  import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuSeparator, DropdownMenuLabel, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuItem } from '../chunk-VEWKPOMS.js';
6
6
  import { Avatar, AvatarImage, AvatarFallback, InputGroup, InputGroupAddon, InputGroupInput } from '../chunk-VXW3K5O5.js';
@@ -43,18 +43,23 @@ function AppShellBody({
43
43
  }
44
44
  function StackedSidebar({
45
45
  className,
46
+ children,
47
+ collapsible = "icon",
46
48
  ...rest
47
49
  }) {
50
+ const { isMobile } = useSidebar();
51
+ const inSheet = isMobile && collapsible !== "none";
48
52
  return /* @__PURE__ */ jsx(
49
53
  Sidebar,
50
54
  {
51
55
  variant: "sidebar",
52
- collapsible: "icon",
56
+ collapsible,
53
57
  ...rest,
54
58
  className: cn(
55
59
  "overflow-hidden *:data-[sidebar=sidebar]:flex-row",
56
60
  className
57
- )
61
+ ),
62
+ children: inSheet ? /* @__PURE__ */ jsx("div", { className: "flex size-full flex-row", children }) : children
58
63
  }
59
64
  );
60
65
  }
@@ -67,8 +72,9 @@ function SidebarDock({
67
72
  {
68
73
  ...rest,
69
74
  collapsible: "none",
75
+ "data-sidebar-dock": "",
70
76
  className: cn(
71
- "w-[calc(var(--sidebar-width-icon)+1px)]! overflow-hidden border-r",
77
+ "w-[calc(var(--sidebar-width-dock,3rem)+1px)]! shrink-0 overflow-hidden border-r",
72
78
  className
73
79
  )
74
80
  }
@@ -76,6 +82,7 @@ function SidebarDock({
76
82
  }
77
83
  function SidebarPanel({
78
84
  className,
85
+ collapseToIcons = false,
79
86
  ...rest
80
87
  }) {
81
88
  return /* @__PURE__ */ jsx(
@@ -83,7 +90,12 @@ function SidebarPanel({
83
90
  {
84
91
  ...rest,
85
92
  collapsible: "none",
86
- className: cn("flex-1 overflow-hidden", className)
93
+ "data-sidebar-panel-icons": collapseToIcons ? "" : void 0,
94
+ className: cn(
95
+ "min-w-0 flex-1 overflow-hidden",
96
+ !collapseToIcons && "group-data-[collapsible=icon]:hidden",
97
+ className
98
+ )
87
99
  }
88
100
  );
89
101
  }
@@ -670,6 +682,41 @@ function TabBar({
670
682
  }
671
683
  );
672
684
  }
685
+ function BottomNav({ items, activeId, onSelect, label, className }) {
686
+ return /* @__PURE__ */ jsx(
687
+ "nav",
688
+ {
689
+ "data-slot": "bottom-nav",
690
+ "aria-label": label,
691
+ className: cn("grid shrink-0 border-t border-border bg-background", className),
692
+ style: { gridTemplateColumns: `repeat(${items.length}, minmax(0, 1fr))` },
693
+ children: items.map((item) => {
694
+ const active = item.id === activeId;
695
+ return /* @__PURE__ */ jsxs(
696
+ "button",
697
+ {
698
+ type: "button",
699
+ "aria-current": active ? "page" : void 0,
700
+ onClick: () => onSelect(item.id),
701
+ className: cn(
702
+ "relative flex h-14 flex-col items-center justify-center gap-1 text-xs text-muted-foreground",
703
+ active && "text-primary"
704
+ ),
705
+ children: [
706
+ active && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute inset-x-6 top-0 h-0.5 bg-primary" }),
707
+ /* @__PURE__ */ jsxs("span", { className: "relative [&_svg]:size-5", children: [
708
+ item.icon,
709
+ item.badge && /* @__PURE__ */ jsx("span", { role: "img", "aria-label": item.badge, className: "absolute -top-0.5 -right-1 size-2.5 rounded-full bg-warning" })
710
+ ] }),
711
+ item.label
712
+ ]
713
+ },
714
+ item.id
715
+ );
716
+ })
717
+ }
718
+ );
719
+ }
673
720
  function Breadcrumbs({ separator, labels, resolve, leading, ...rest }) {
674
721
  const { pathname } = useActiveRoute();
675
722
  const segments = pathname.split("/").filter(Boolean);
@@ -761,6 +808,6 @@ function AppTile({ app }) {
761
808
  );
762
809
  }
763
810
 
764
- export { AppGlyph, AppGrid, AppShell, AppShellBody, AppShellHeader, AppShellMain, AppSwitcher, AppTile, Breadcrumbs, NavBrand, NavGroup, NavItem, NavSection, NavUser, PageHeader, PageShell, SidebarDock, SidebarPanel, StackedSidebar, TabBar, defaultAppGridLabels, defaultNavBrandAppsLabel, defaultNavUserThemeLabels, defaultTabBarLabels, isIconUrl, useActiveRoute };
811
+ export { AppGlyph, AppGrid, AppShell, AppShellBody, AppShellHeader, AppShellMain, AppSwitcher, AppTile, BottomNav, Breadcrumbs, NavBrand, NavGroup, NavItem, NavSection, NavUser, PageHeader, PageShell, SidebarDock, SidebarPanel, StackedSidebar, TabBar, defaultAppGridLabels, defaultNavBrandAppsLabel, defaultNavUserThemeLabels, defaultTabBarLabels, isIconUrl, useActiveRoute };
765
812
  //# sourceMappingURL=index.js.map
766
813
  //# sourceMappingURL=index.js.map