@pactor-app/ui 1.3.0 → 1.7.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.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { Accordion, AccordionItemData, AccordionProps, Alert, AlertDialog, AlertDialogProps, AlertProps, AlertVariant, AspectRatio, AspectRatioProps, Avatar, AvatarProps, Badge, BadgeProps, BadgeVariant, Breadcrumb, BreadcrumbItemData, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, ButtonSize, ButtonVariant, Calendar, CalendarProps, Card, CardProps, Carousel, CarouselImage, CarouselItemData, CarouselProps, Chart, ChartProps, ChartType, ChatInput, ChatInputProps, Checkbox, CheckboxProps, Collapsible, CollapsibleProps, Combobox, ComboboxOption, ComboboxProps, Command, CommandGroupData, CommandItemData, CommandProps, Content, ContentProps, ContextMenu, ContextMenuItemData, ContextMenuProps, DataTable, DataTableColumn, DataTablePagination, DataTableProps, DataTableSort, DataTableSortOrder, Dialog, DialogProps, Drawer, DrawerPlacement, DrawerProps, DropdownMenu, DropdownMenuItemData, DropdownMenuProps, Empty, EmptyProps, Field, FieldProps, FieldRule, Flex, FlexProps, Footer, FooterProps, Form, FormContextValue, FormProps, Grid, GridProps, Header, HeaderBrandPosition, HeaderDropdown, HeaderDropdownItem, HeaderLocale, HeaderMenuItem, HeaderProps, HeaderUser, HeaderUserItem, HoverCard, HoverCardProps, ICONS, Icon, IconProps, IconSize, Input, InputGroup, InputGroupProps, InputOTP, InputOTPProps, InputProps, Item, ItemProps, Kbd, KbdProps, Label, LabelProps, Layout, LayoutProps, Link, LinkProps, Menu, MenuItem, MenuProps, Menubar, MenubarLeafItem, MenubarMenuData, MenubarProps, NavigationMenu, NavigationMenuChildItem, NavigationMenuItemData, NavigationMenuProps, Page, PageProps, Pagination, PaginationProps, Popover, PopoverProps, Progress, ProgressProps, RadioGroup, RadioGroupOption, RadioGroupProps, RailTooltip, Resizable, ResizablePanelData, ResizableProps, ScrollArea, ScrollAreaProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, SheetSide, Sidebar, SidebarBrand, SidebarNavItem, SidebarProps, Sider, SiderProps, Skeleton, SkeletonProps, SkeletonShape, Slider, SliderProps, Sonner, SonnerProps, Spinner, SpinnerProps, SpinnerSize, Statistic, StatisticProps, Switch, SwitchProps, TabItem, Table, TableColumn, TablePagination, TablePaginationInfo, TableProps, Tabs, TabsProps, Text, TextProps, TextType, Textarea, TextareaProps, Toggle, ToggleGroup, ToggleGroupOption, ToggleGroupProps, ToggleProps, Tooltip, TooltipProps, Typography, TypographyProps, TypographyVariant, builtinComponents, createComponentRegistry, normalizeIconName, registerBuiltinComponents, useFormContext, useSidebarDrawer } from './components/index.cjs';
1
+ export { Accordion, AccordionItemData, AccordionProps, Alert, AlertDialog, AlertDialogProps, AlertProps, AlertVariant, AspectRatio, AspectRatioProps, Avatar, AvatarProps, Badge, BadgeProps, BadgeVariant, Breadcrumb, BreadcrumbItemData, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, ButtonSize, ButtonVariant, Calendar, CalendarProps, Card, CardProps, Carousel, CarouselImage, CarouselItemData, CarouselProps, Chart, ChartProps, ChartType, ChatInput, ChatInputProps, Checkbox, CheckboxProps, Collapsible, CollapsibleProps, Combobox, ComboboxOption, ComboboxProps, Command, CommandGroupData, CommandItemData, CommandProps, Content, ContentProps, ContextMenu, ContextMenuItemData, ContextMenuProps, DataTable, DataTableColumn, DataTablePagination, DataTableProps, DataTableSort, DataTableSortOrder, DatePicker, DatePickerPreset, DatePickerPresetKey, DatePickerProps, DatePickerRangeProps, DatePickerSingleProps, DateRangeValue, Dialog, DialogProps, Drawer, DrawerPlacement, DrawerProps, DropdownMenu, DropdownMenuItemData, DropdownMenuProps, Empty, EmptyProps, Field, FieldProps, FieldRule, Flex, FlexProps, Footer, FooterProps, Form, FormContextValue, FormProps, Grid, GridProps, Header, HeaderBrandPosition, HeaderDropdown, HeaderDropdownItem, HeaderLocale, HeaderMenuItem, HeaderProps, HeaderUser, HeaderUserItem, HoverCard, HoverCardProps, ICONS, Icon, IconProps, IconSize, Input, InputGroup, InputGroupProps, InputOTP, InputOTPProps, InputProps, Item, ItemProps, Kbd, KbdProps, Label, LabelProps, Layout, LayoutProps, Link, LinkProps, Menu, MenuItem, MenuProps, Menubar, MenubarLeafItem, MenubarMenuData, MenubarProps, NavigationMenu, NavigationMenuChildItem, NavigationMenuItemData, NavigationMenuProps, Page, PageProps, Pagination, PaginationProps, Popover, PopoverProps, Progress, ProgressProps, RadioGroup, RadioGroupOption, RadioGroupProps, RailTooltip, Resizable, ResizablePanelData, ResizableProps, ScrollArea, ScrollAreaProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, SheetSide, Sidebar, SidebarBrand, SidebarNavItem, SidebarProps, Sider, SiderProps, Skeleton, SkeletonProps, SkeletonShape, Slider, SliderProps, Sonner, SonnerProps, Spinner, SpinnerProps, SpinnerSize, Statistic, StatisticProps, Switch, SwitchProps, TabItem, Table, TableColumn, TablePagination, TablePaginationInfo, TableProps, Tabs, TabsProps, Text, TextProps, TextType, Textarea, TextareaProps, Toggle, ToggleGroup, ToggleGroupOption, ToggleGroupProps, ToggleProps, Tooltip, TooltipProps, Typography, TypographyProps, TypographyVariant, builtinComponents, createComponentRegistry, normalizeIconName, registerBuiltinComponents, useFormContext, useSidebarDrawer } from './components/index.cjs';
2
2
  export { AdminBrand, AdminLayout, AdminLayoutBreakpoint, AdminLayoutConfig, AdminLayoutMode, AdminLayoutProps, BlankLayout, BlankLayoutProps, ChatLayout, ChatLayoutBrand, ChatLayoutMenuItem, ChatLayoutProps, LandingLayout, LandingLayoutProps, LayoutComponent, LayoutRegistry, LoginBrand, LoginLayout, LoginLayoutProps, collectDefaultOpenKeys, createLayoutRegistry, findMenuChain, registerBuiltinLayouts, resolveLayout } from './layout/index.cjs';
3
3
  export { InteractionProvider, InteractionProviderProps, OVERLAY_CANCEL_PAYLOAD, OverlayConfig, OverlayEntry, OverlayHost, OverlayHostProps, OverlayListener, OverlayManager, ResolvePageFn, UiBridge, UiMessage, UiModal, createUiBridge, registerInteractionActions } from './interaction/index.cjs';
4
4
  import '@pactor-app/runtime';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { Accordion, AccordionItemData, AccordionProps, Alert, AlertDialog, AlertDialogProps, AlertProps, AlertVariant, AspectRatio, AspectRatioProps, Avatar, AvatarProps, Badge, BadgeProps, BadgeVariant, Breadcrumb, BreadcrumbItemData, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, ButtonSize, ButtonVariant, Calendar, CalendarProps, Card, CardProps, Carousel, CarouselImage, CarouselItemData, CarouselProps, Chart, ChartProps, ChartType, ChatInput, ChatInputProps, Checkbox, CheckboxProps, Collapsible, CollapsibleProps, Combobox, ComboboxOption, ComboboxProps, Command, CommandGroupData, CommandItemData, CommandProps, Content, ContentProps, ContextMenu, ContextMenuItemData, ContextMenuProps, DataTable, DataTableColumn, DataTablePagination, DataTableProps, DataTableSort, DataTableSortOrder, Dialog, DialogProps, Drawer, DrawerPlacement, DrawerProps, DropdownMenu, DropdownMenuItemData, DropdownMenuProps, Empty, EmptyProps, Field, FieldProps, FieldRule, Flex, FlexProps, Footer, FooterProps, Form, FormContextValue, FormProps, Grid, GridProps, Header, HeaderBrandPosition, HeaderDropdown, HeaderDropdownItem, HeaderLocale, HeaderMenuItem, HeaderProps, HeaderUser, HeaderUserItem, HoverCard, HoverCardProps, ICONS, Icon, IconProps, IconSize, Input, InputGroup, InputGroupProps, InputOTP, InputOTPProps, InputProps, Item, ItemProps, Kbd, KbdProps, Label, LabelProps, Layout, LayoutProps, Link, LinkProps, Menu, MenuItem, MenuProps, Menubar, MenubarLeafItem, MenubarMenuData, MenubarProps, NavigationMenu, NavigationMenuChildItem, NavigationMenuItemData, NavigationMenuProps, Page, PageProps, Pagination, PaginationProps, Popover, PopoverProps, Progress, ProgressProps, RadioGroup, RadioGroupOption, RadioGroupProps, RailTooltip, Resizable, ResizablePanelData, ResizableProps, ScrollArea, ScrollAreaProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, SheetSide, Sidebar, SidebarBrand, SidebarNavItem, SidebarProps, Sider, SiderProps, Skeleton, SkeletonProps, SkeletonShape, Slider, SliderProps, Sonner, SonnerProps, Spinner, SpinnerProps, SpinnerSize, Statistic, StatisticProps, Switch, SwitchProps, TabItem, Table, TableColumn, TablePagination, TablePaginationInfo, TableProps, Tabs, TabsProps, Text, TextProps, TextType, Textarea, TextareaProps, Toggle, ToggleGroup, ToggleGroupOption, ToggleGroupProps, ToggleProps, Tooltip, TooltipProps, Typography, TypographyProps, TypographyVariant, builtinComponents, createComponentRegistry, normalizeIconName, registerBuiltinComponents, useFormContext, useSidebarDrawer } from './components/index.js';
1
+ export { Accordion, AccordionItemData, AccordionProps, Alert, AlertDialog, AlertDialogProps, AlertProps, AlertVariant, AspectRatio, AspectRatioProps, Avatar, AvatarProps, Badge, BadgeProps, BadgeVariant, Breadcrumb, BreadcrumbItemData, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, ButtonSize, ButtonVariant, Calendar, CalendarProps, Card, CardProps, Carousel, CarouselImage, CarouselItemData, CarouselProps, Chart, ChartProps, ChartType, ChatInput, ChatInputProps, Checkbox, CheckboxProps, Collapsible, CollapsibleProps, Combobox, ComboboxOption, ComboboxProps, Command, CommandGroupData, CommandItemData, CommandProps, Content, ContentProps, ContextMenu, ContextMenuItemData, ContextMenuProps, DataTable, DataTableColumn, DataTablePagination, DataTableProps, DataTableSort, DataTableSortOrder, DatePicker, DatePickerPreset, DatePickerPresetKey, DatePickerProps, DatePickerRangeProps, DatePickerSingleProps, DateRangeValue, Dialog, DialogProps, Drawer, DrawerPlacement, DrawerProps, DropdownMenu, DropdownMenuItemData, DropdownMenuProps, Empty, EmptyProps, Field, FieldProps, FieldRule, Flex, FlexProps, Footer, FooterProps, Form, FormContextValue, FormProps, Grid, GridProps, Header, HeaderBrandPosition, HeaderDropdown, HeaderDropdownItem, HeaderLocale, HeaderMenuItem, HeaderProps, HeaderUser, HeaderUserItem, HoverCard, HoverCardProps, ICONS, Icon, IconProps, IconSize, Input, InputGroup, InputGroupProps, InputOTP, InputOTPProps, InputProps, Item, ItemProps, Kbd, KbdProps, Label, LabelProps, Layout, LayoutProps, Link, LinkProps, Menu, MenuItem, MenuProps, Menubar, MenubarLeafItem, MenubarMenuData, MenubarProps, NavigationMenu, NavigationMenuChildItem, NavigationMenuItemData, NavigationMenuProps, Page, PageProps, Pagination, PaginationProps, Popover, PopoverProps, Progress, ProgressProps, RadioGroup, RadioGroupOption, RadioGroupProps, RailTooltip, Resizable, ResizablePanelData, ResizableProps, ScrollArea, ScrollAreaProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, SheetSide, Sidebar, SidebarBrand, SidebarNavItem, SidebarProps, Sider, SiderProps, Skeleton, SkeletonProps, SkeletonShape, Slider, SliderProps, Sonner, SonnerProps, Spinner, SpinnerProps, SpinnerSize, Statistic, StatisticProps, Switch, SwitchProps, TabItem, Table, TableColumn, TablePagination, TablePaginationInfo, TableProps, Tabs, TabsProps, Text, TextProps, TextType, Textarea, TextareaProps, Toggle, ToggleGroup, ToggleGroupOption, ToggleGroupProps, ToggleProps, Tooltip, TooltipProps, Typography, TypographyProps, TypographyVariant, builtinComponents, createComponentRegistry, normalizeIconName, registerBuiltinComponents, useFormContext, useSidebarDrawer } from './components/index.js';
2
2
  export { AdminBrand, AdminLayout, AdminLayoutBreakpoint, AdminLayoutConfig, AdminLayoutMode, AdminLayoutProps, BlankLayout, BlankLayoutProps, ChatLayout, ChatLayoutBrand, ChatLayoutMenuItem, ChatLayoutProps, LandingLayout, LandingLayoutProps, LayoutComponent, LayoutRegistry, LoginBrand, LoginLayout, LoginLayoutProps, collectDefaultOpenKeys, createLayoutRegistry, findMenuChain, registerBuiltinLayouts, resolveLayout } from './layout/index.js';
3
3
  export { InteractionProvider, InteractionProviderProps, OVERLAY_CANCEL_PAYLOAD, OverlayConfig, OverlayEntry, OverlayHost, OverlayHostProps, OverlayListener, OverlayManager, ResolvePageFn, UiBridge, UiMessage, UiModal, createUiBridge, registerInteractionActions } from './interaction/index.js';
4
4
  import '@pactor-app/runtime';
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ import {
20
20
  Content,
21
21
  ContextMenu,
22
22
  DataTable,
23
+ DatePicker,
23
24
  Dialog,
24
25
  Drawer,
25
26
  DropdownMenu,
@@ -70,7 +71,7 @@ import {
70
71
  createComponentRegistry,
71
72
  registerBuiltinComponents,
72
73
  useFormContext
73
- } from "./chunk-P54Y23AP.js";
74
+ } from "./chunk-PMYLC26E.js";
74
75
  import {
75
76
  InteractionProvider,
76
77
  OVERLAY_CANCEL_PAYLOAD,
@@ -90,7 +91,7 @@ import {
90
91
  findMenuChain,
91
92
  registerBuiltinLayouts,
92
93
  resolveLayout
93
- } from "./chunk-TDVG7MZ5.js";
94
+ } from "./chunk-FJPRXEKQ.js";
94
95
  import {
95
96
  ICONS,
96
97
  Icon,
@@ -99,8 +100,8 @@ import {
99
100
  Sidebar,
100
101
  normalizeIconName,
101
102
  useSidebarDrawer
102
- } from "./chunk-EVGIS2ZE.js";
103
- import "./chunk-UKA7C3JP.js";
103
+ } from "./chunk-ZM3WJZZ7.js";
104
+ import "./chunk-E2TD6JD2.js";
104
105
  import "./chunk-F42SGQNW.js";
105
106
  import "./chunk-L4Z7MNYY.js";
106
107
  import "./chunk-WKJUCGV4.js";
@@ -129,6 +130,7 @@ export {
129
130
  Content,
130
131
  ContextMenu,
131
132
  DataTable,
133
+ DatePicker,
132
134
  Dialog,
133
135
  Drawer,
134
136
  DropdownMenu,
@@ -931,6 +931,9 @@ function BlankLayout({ children }) {
931
931
 
932
932
  // src/layout/chat/ChatLayout.tsx
933
933
  var import_permission2 = require("@pactor-app/permission");
934
+ var import_react6 = require("react");
935
+
936
+ // src/components/components/Menu/index.tsx
934
937
  var import_react5 = require("react");
935
938
 
936
939
  // src/ui/tooltip.tsx
@@ -1698,16 +1701,49 @@ function SidebarInner({
1698
1701
 
1699
1702
  // src/components/components/Menu/index.tsx
1700
1703
  var import_jsx_runtime11 = require("react/jsx-runtime");
1704
+ function collectAncestors(items, target, into, trail = []) {
1705
+ for (const item of items) {
1706
+ if (item.key === target) {
1707
+ for (const key of trail) into.add(key);
1708
+ return true;
1709
+ }
1710
+ if (item.children?.length && collectAncestors(item.children, target, into, [...trail, item.key])) {
1711
+ return true;
1712
+ }
1713
+ }
1714
+ return false;
1715
+ }
1701
1716
  function Menu2({
1702
1717
  items = [],
1703
1718
  mode = "inline",
1704
1719
  selectedKey,
1720
+ collapsible = false,
1721
+ defaultExpandedKeys,
1705
1722
  onSelect,
1706
1723
  className,
1707
1724
  style
1708
1725
  }) {
1709
1726
  const drawer = useSidebarDrawer();
1710
1727
  const collapsed = mode === "inline" && drawer?.collapsed === true;
1728
+ const collapsibleOn = collapsible && mode === "inline" && !collapsed;
1729
+ const [expandedKeys, setExpandedKeys] = (0, import_react5.useState)(() => {
1730
+ const initial = new Set(defaultExpandedKeys ?? []);
1731
+ if (selectedKey !== void 0) {
1732
+ collectAncestors(items, selectedKey, initial);
1733
+ }
1734
+ return initial;
1735
+ });
1736
+ const toggleExpanded = (key) => {
1737
+ setExpandedKeys((prev) => {
1738
+ const next = new Set(prev);
1739
+ if (next.has(key)) {
1740
+ next.delete(key);
1741
+ } else {
1742
+ next.add(key);
1743
+ }
1744
+ return next;
1745
+ });
1746
+ };
1711
1747
  let previousGroup;
1712
1748
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1713
1749
  "nav",
@@ -1743,7 +1779,10 @@ function Menu2({
1743
1779
  depth: 0,
1744
1780
  selectedKey,
1745
1781
  onSelect,
1746
- collapsed
1782
+ collapsed,
1783
+ collapsible: collapsibleOn,
1784
+ expandedKeys,
1785
+ onToggle: toggleExpanded
1747
1786
  }
1748
1787
  )
1749
1788
  ] }, item.key);
@@ -1757,15 +1796,34 @@ function MenuEntry({
1757
1796
  depth,
1758
1797
  selectedKey,
1759
1798
  onSelect,
1760
- collapsed = false
1799
+ collapsed = false,
1800
+ collapsible = false,
1801
+ expandedKeys,
1802
+ onToggle
1761
1803
  }) {
1762
1804
  const selected = item.key === selectedKey;
1805
+ const hasChildren = (item.children?.length ?? 0) > 0;
1806
+ const isDirectory = collapsible && hasChildren;
1807
+ const expanded = isDirectory && expandedKeys?.has(item.key) === true;
1808
+ const railDirectory = collapsed && hasChildren;
1809
+ const [flyoutOpen, setFlyoutOpen] = (0, import_react5.useState)(false);
1810
+ const flyoutTimer = (0, import_react5.useRef)(void 0);
1811
+ const flyoutOpenNow = () => {
1812
+ window.clearTimeout(flyoutTimer.current);
1813
+ setFlyoutOpen(true);
1814
+ };
1815
+ const flyoutCloseLater = () => {
1816
+ window.clearTimeout(flyoutTimer.current);
1817
+ flyoutTimer.current = window.setTimeout(() => setFlyoutOpen(false), 200);
1818
+ };
1819
+ (0, import_react5.useEffect)(() => () => window.clearTimeout(flyoutTimer.current), []);
1763
1820
  const button = /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1764
1821
  "button",
1765
1822
  {
1766
1823
  type: "button",
1767
1824
  "data-slot": "menu-item",
1768
1825
  "aria-current": selected ? "page" : void 0,
1826
+ "aria-expanded": isDirectory ? expanded : railDirectory ? flyoutOpen : void 0,
1769
1827
  disabled: item.disabled,
1770
1828
  className: cn(
1771
1829
  "flex w-full items-center gap-2 rounded-md text-sm transition-colors",
@@ -1775,8 +1833,14 @@ function MenuEntry({
1775
1833
  item.disabled && "cursor-not-allowed opacity-50 hover:bg-transparent hover:text-muted-foreground"
1776
1834
  ),
1777
1835
  style: mode === "inline" && depth > 0 && !collapsed ? { paddingLeft: 12 + depth * 16 } : void 0,
1836
+ onMouseEnter: railDirectory ? flyoutOpenNow : void 0,
1837
+ onMouseLeave: railDirectory ? flyoutCloseLater : void 0,
1778
1838
  onClick: () => {
1779
- if (!item.disabled) {
1839
+ if (item.disabled) return;
1840
+ if (railDirectory) return;
1841
+ if (isDirectory) {
1842
+ onToggle?.(item.key);
1843
+ } else {
1780
1844
  onSelect?.(item.key);
1781
1845
  }
1782
1846
  },
@@ -1791,13 +1855,58 @@ function MenuEntry({
1791
1855
  className: "shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-xs text-muted-foreground",
1792
1856
  children: item.badge
1793
1857
  }
1858
+ ) : null,
1859
+ isDirectory ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1860
+ "span",
1861
+ {
1862
+ "data-slot": "menu-item-chevron",
1863
+ className: cn(
1864
+ "shrink-0 transition-transform",
1865
+ expanded && "rotate-180"
1866
+ ),
1867
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: "chevron-down", size: "sm" })
1868
+ }
1794
1869
  ) : null
1795
1870
  ]
1796
1871
  }
1797
1872
  );
1798
1873
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { "data-slot": "menu-entry", "data-key": item.key, children: [
1799
- collapsed ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RailTooltip, { label: item.label, children: button }) : button,
1800
- item.children?.map((child) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1874
+ railDirectory ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Popover, { open: flyoutOpen, onOpenChange: setFlyoutOpen, children: [
1875
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PopoverTrigger, { render: button }),
1876
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1877
+ PopoverContent,
1878
+ {
1879
+ "data-slot": "menu-flyout",
1880
+ side: "right",
1881
+ align: "start",
1882
+ sideOffset: 8,
1883
+ className: "max-h-[70vh] w-48 overflow-auto p-1",
1884
+ initialFocus: false,
1885
+ onMouseEnter: flyoutOpenNow,
1886
+ onMouseLeave: flyoutCloseLater,
1887
+ onClick: (event) => {
1888
+ if (event.target.closest("[data-slot=menu-item]")) {
1889
+ setFlyoutOpen(false);
1890
+ }
1891
+ },
1892
+ children: [
1893
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "px-3 pt-2 pb-1 text-xs font-semibold text-muted-foreground", children: item.label }),
1894
+ item.children?.map((child) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1895
+ MenuEntry,
1896
+ {
1897
+ item: child,
1898
+ mode: "inline",
1899
+ depth: 0,
1900
+ selectedKey,
1901
+ onSelect
1902
+ },
1903
+ child.key
1904
+ ))
1905
+ ]
1906
+ }
1907
+ )
1908
+ ] }) : collapsed ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RailTooltip, { label: item.label, children: button }) : button,
1909
+ railDirectory || isDirectory && !expanded ? null : item.children?.map((child) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1801
1910
  MenuEntry,
1802
1911
  {
1803
1912
  item: child,
@@ -1805,7 +1914,10 @@ function MenuEntry({
1805
1914
  depth: depth + 1,
1806
1915
  selectedKey,
1807
1916
  onSelect,
1808
- collapsed
1917
+ collapsed,
1918
+ collapsible,
1919
+ expandedKeys,
1920
+ onToggle
1809
1921
  },
1810
1922
  child.key
1811
1923
  ))
@@ -1828,7 +1940,7 @@ function ChatLayout({
1828
1940
  sidebarFooter,
1829
1941
  children
1830
1942
  }) {
1831
- const registryMenus = (0, import_react5.useMemo)(() => {
1943
+ const registryMenus = (0, import_react6.useMemo)(() => {
1832
1944
  if (menu !== void 0 || registry === void 0) {
1833
1945
  return [];
1834
1946
  }
@@ -1837,10 +1949,10 @@ function ChatLayout({
1837
1949
  return visible.flatMap((item) => menuItemToMenuData(item));
1838
1950
  }, [menu, registry, permissionChecker]);
1839
1951
  const menuItems = menu ?? registryMenus;
1840
- const [bridgePath, setBridgePath] = (0, import_react5.useState)(
1952
+ const [bridgePath, setBridgePath] = (0, import_react6.useState)(
1841
1953
  () => bridge?.getLocation().pathname ?? "/"
1842
1954
  );
1843
- (0, import_react5.useEffect)(() => {
1955
+ (0, import_react6.useEffect)(() => {
1844
1956
  if (bridge === void 0) {
1845
1957
  return;
1846
1958
  }
@@ -1848,7 +1960,7 @@ function ChatLayout({
1848
1960
  setBridgePath(location.pathname);
1849
1961
  });
1850
1962
  }, [bridge]);
1851
- const activeKey = (0, import_react5.useMemo)(() => {
1963
+ const activeKey = (0, import_react6.useMemo)(() => {
1852
1964
  if (activeMenuKey !== void 0) {
1853
1965
  return activeMenuKey;
1854
1966
  }
@@ -9,8 +9,8 @@ import {
9
9
  findMenuChain,
10
10
  registerBuiltinLayouts,
11
11
  resolveLayout
12
- } from "../chunk-TDVG7MZ5.js";
13
- import "../chunk-EVGIS2ZE.js";
12
+ } from "../chunk-FJPRXEKQ.js";
13
+ import "../chunk-ZM3WJZZ7.js";
14
14
  import "../chunk-L4Z7MNYY.js";
15
15
  import "../chunk-WKJUCGV4.js";
16
16
  export {
package/dist/ui/index.cjs CHANGED
@@ -1201,11 +1201,11 @@ function Calendar({
1201
1201
  defaultClassNames.day_button
1202
1202
  ),
1203
1203
  selected: cn(
1204
- "[&>button]:bg-(--calendar-selected-background) [&>button]:text-(--calendar-selected-foreground) [&>button]:hover:bg-(--calendar-selected-background)",
1204
+ "[&>button]:bg-(--calendar-selected-background) [&>button]:text-(--calendar-selected-foreground) [&>button]:hover:bg-(--calendar-selected-background) [&>button]:hover:text-(--calendar-selected-foreground)",
1205
1205
  defaultClassNames.selected
1206
1206
  ),
1207
1207
  today: cn(
1208
- "[&>button]:bg-(--calendar-today-background) [&>button]:text-(--calendar-today-foreground)",
1208
+ "[&>button]:bg-(--calendar-today-background) [&>button]:text-(--calendar-today-foreground) [&>button]:hover:bg-(--calendar-today-background) [&>button]:hover:text-(--calendar-today-foreground) [&>button]:border [&>button]:border-(--calendar-today-border)",
1209
1209
  defaultClassNames.today
1210
1210
  ),
1211
1211
  outside: cn(
@@ -4682,7 +4682,7 @@ function ToggleGroup({
4682
4682
  "data-variant": variant,
4683
4683
  "data-size": size,
4684
4684
  className: cn(
4685
- "group/toggle-group flex w-fit items-center rounded-md [&>[data-slot=toggle]]:rounded-none [&>[data-slot=toggle]]:first:rounded-l-md [&>[data-slot=toggle]]:last:rounded-r-md",
4685
+ "group/toggle-group flex w-fit items-center gap-1 rounded-md",
4686
4686
  className
4687
4687
  ),
4688
4688
  ...props,
package/dist/ui/index.js CHANGED
@@ -160,7 +160,7 @@ import {
160
160
  toggleVariants,
161
161
  typographyVariants,
162
162
  useCarousel
163
- } from "../chunk-UKA7C3JP.js";
163
+ } from "../chunk-E2TD6JD2.js";
164
164
  import {
165
165
  Dialog,
166
166
  DialogClose,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pactor-app/ui",
3
- "version": "1.3.0",
3
+ "version": "1.7.0",
4
4
  "description": "Pactor UI kit (shadcn): the single built-in UI kit — vendored shadcn/ui components (Base UI primitives + cva + tailwind-merge + lucide-react), props contracts, interaction core (OverlayManager / UiBridge) and layouts, with build-time Tailwind v4 prebuilt styles.css (zero consumer-side Tailwind config)",
5
5
  "keywords": [
6
6
  "pactor",
@@ -105,10 +105,10 @@
105
105
  "recharts": "^3.10.1",
106
106
  "tailwind-merge": "^3.6.0",
107
107
  "vaul": "^1.1.2",
108
- "@pactor-app/core": "1.3.0",
109
- "@pactor-app/permission": "1.3.0",
110
- "@pactor-app/router": "1.3.0",
111
- "@pactor-app/runtime": "1.3.0"
108
+ "@pactor-app/core": "1.7.0",
109
+ "@pactor-app/permission": "1.7.0",
110
+ "@pactor-app/runtime": "1.7.0",
111
+ "@pactor-app/router": "1.7.0"
112
112
  },
113
113
  "peerDependencies": {
114
114
  "react": ">=18",
package/styles.css CHANGED
@@ -656,6 +656,9 @@
656
656
  .w-40 {
657
657
  width: calc(var(--spacing) * 40);
658
658
  }
659
+ .w-48 {
660
+ width: calc(var(--spacing) * 48);
661
+ }
659
662
  .w-52 {
660
663
  width: calc(var(--spacing) * 52);
661
664
  }
@@ -800,6 +803,9 @@
800
803
  .rotate-90 {
801
804
  rotate: 90deg;
802
805
  }
806
+ .rotate-180 {
807
+ rotate: 180deg;
808
+ }
803
809
  .transform {
804
810
  transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
805
811
  }
@@ -1081,6 +1087,9 @@
1081
1087
  --tw-border-style: none;
1082
1088
  border-style: none;
1083
1089
  }
1090
+ .border-\(--calendar-today-border\) {
1091
+ border-color: var(--calendar-today-border);
1092
+ }
1084
1093
  .border-\(color\:--pagination-active-border\) {
1085
1094
  border-color: var(--pagination-active-border);
1086
1095
  }
@@ -2035,6 +2044,12 @@
2035
2044
  .hover\:text-\(--calendar-day-hover-foreground\):hover {
2036
2045
  color: var(--calendar-day-hover-foreground);
2037
2046
  }
2047
+ .hover\:text-\(--calendar-selected-foreground\):hover {
2048
+ color: var(--calendar-selected-foreground);
2049
+ }
2050
+ .hover\:text-\(--calendar-today-foreground\):hover {
2051
+ color: var(--calendar-today-foreground);
2052
+ }
2038
2053
  .hover\:text-\(--menu-hover-foreground\):hover {
2039
2054
  color: var(--menu-hover-foreground);
2040
2055
  }
@@ -2957,19 +2972,21 @@
2957
2972
  .\[\&\>\[data-slot\=text\]\]\:text-muted-foreground > [data-slot=text] {
2958
2973
  color: var(--muted-foreground);
2959
2974
  }
2960
- .\[\&\>\[data-slot\=toggle\]\]\:rounded-none > [data-slot=toggle] {
2975
+ .\[\&\>button\]\:hidden > button {
2976
+ display: none;
2977
+ }
2978
+ .\[\&\>button\]\:rounded-none > button {
2961
2979
  border-radius: 0;
2962
2980
  }
2963
- .\[\&\>\[data-slot\=toggle\]\]\:first\:rounded-l-md > [data-slot=toggle]:first-child {
2964
- border-top-left-radius: calc(var(--radius) * 0.8);
2965
- border-bottom-left-radius: calc(var(--radius) * 0.8);
2981
+ .\[\&\>button\]\:border > button {
2982
+ border-style: var(--tw-border-style);
2983
+ border-width: 1px;
2966
2984
  }
2967
- .\[\&\>\[data-slot\=toggle\]\]\:last\:rounded-r-md > [data-slot=toggle]:last-child {
2968
- border-top-right-radius: calc(var(--radius) * 0.8);
2969
- border-bottom-right-radius: calc(var(--radius) * 0.8);
2985
+ .\[\&\>button\]\:border-\(--calendar-today-border\) > button {
2986
+ border-color: var(--calendar-today-border);
2970
2987
  }
2971
- .\[\&\>button\]\:hidden > button {
2972
- display: none;
2988
+ .\[\&\>button\]\:bg-\(--calendar-range-background\) > button {
2989
+ background-color: var(--calendar-range-background);
2973
2990
  }
2974
2991
  .\[\&\>button\]\:bg-\(--calendar-selected-background\) > button {
2975
2992
  background-color: var(--calendar-selected-background);
@@ -2977,6 +2994,9 @@
2977
2994
  .\[\&\>button\]\:bg-\(--calendar-today-background\) > button {
2978
2995
  background-color: var(--calendar-today-background);
2979
2996
  }
2997
+ .\[\&\>button\]\:text-\(--calendar-range-foreground\) > button {
2998
+ color: var(--calendar-range-foreground);
2999
+ }
2980
3000
  .\[\&\>button\]\:text-\(--calendar-selected-foreground\) > button {
2981
3001
  color: var(--calendar-selected-foreground);
2982
3002
  }
@@ -2987,6 +3007,15 @@
2987
3007
  .\[\&\>button\]\:hover\:bg-\(--calendar-selected-background\) > button:hover {
2988
3008
  background-color: var(--calendar-selected-background);
2989
3009
  }
3010
+ .\[\&\>button\]\:hover\:bg-\(--calendar-today-background\) > button:hover {
3011
+ background-color: var(--calendar-today-background);
3012
+ }
3013
+ .\[\&\>button\]\:hover\:text-\(--calendar-selected-foreground\) > button:hover {
3014
+ color: var(--calendar-selected-foreground);
3015
+ }
3016
+ .\[\&\>button\]\:hover\:text-\(--calendar-today-foreground\) > button:hover {
3017
+ color: var(--calendar-today-foreground);
3018
+ }
2990
3019
  }
2991
3020
  .\[\&\>li\]\:mt-2 > li {
2992
3021
  margin-top: calc(var(--spacing) * 2);
@@ -3205,6 +3234,9 @@
3205
3234
  --calendar-selected-foreground: var(--primary-foreground);
3206
3235
  --calendar-today-background: var(--accent);
3207
3236
  --calendar-today-foreground: var(--accent-foreground);
3237
+ --calendar-today-border: var(--primary);
3238
+ --calendar-range-background: var(--accent);
3239
+ --calendar-range-foreground: var(--accent-foreground);
3208
3240
  --flex-gap: 12px;
3209
3241
  --flex-gap-sm: calc(var(--flex-gap) * 0.67);
3210
3242
  --flex-gap-md: calc(var(--flex-gap) * 1.33);