@pactor-app/ui 1.0.0 → 1.2.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.
@@ -1,6 +1,6 @@
1
1
  import { ComponentRegistry } from '@pactor-app/runtime';
2
2
  import * as React from 'react';
3
- import { CSSProperties, ReactNode } from 'react';
3
+ import { CSSProperties, ReactNode, ReactElement } from 'react';
4
4
  import { DslNode, DslChildren } from '@pactor-app/core';
5
5
  import { LucideIcon } from 'lucide-react';
6
6
  import { t as toggleVariants, b as typographyVariants } from '../typography-DsGdDBc2.cjs';
@@ -420,6 +420,51 @@ interface ChartProps {
420
420
  */
421
421
  declare function Chart({ chartType, data, xKey, yKeys, colors, className, style, }: ChartProps): React.JSX.Element;
422
422
 
423
+ interface ChatInputProps {
424
+ /** 受控值(提供即受控:变更只经 onChange 传出,显示值取自 props) */
425
+ value?: string;
426
+ placeholder?: string;
427
+ disabled?: boolean;
428
+ /** 最小行数(高度随内容自适应,rows 为下限;缺省 3) */
429
+ rows?: number;
430
+ /**
431
+ * 隐藏内建发送钮(工具栏右端完全自定义的场景);
432
+ * hideSend 且左右槽均未提供时工具栏行整体零渲染
433
+ */
434
+ hideSend?: boolean;
435
+ /** 工具栏左端槽(DslNode 子树,经 Renderer children 机制渲染) */
436
+ toolbarStart?: DslNode;
437
+ /** 工具栏右端槽(发送钮之前) */
438
+ toolbarEnd?: DslNode;
439
+ /** 顶部区槽(提供时渲染在 textarea 上方,与 footer 对称;附件卡片、上下文 chips 等输入上下文展示) */
440
+ header?: DslNode;
441
+ /** 底部区槽(提供时渲染,与工具栏以分隔线相隔) */
442
+ footer?: DslNode;
443
+ /** 输入事件,传出 string 值 */
444
+ onChange?: (value: string) => void;
445
+ /** 发送事件(点击发送钮或 Enter),传出当前文本 */
446
+ onSubmit?: (value: string) => void;
447
+ /** 通用:根节点 class(与内置样式合并) */
448
+ className?: string;
449
+ /** 通用:根节点内联样式 */
450
+ style?: CSSProperties;
451
+ }
452
+ /**
453
+ * ChatInput 适配器(shadcn kit):AI 对话输入框的通用结构构件
454
+ * (spec: shadcn-extended-components / ChatInput)——外层圆角容器
455
+ * (focus-within 高亮)内依次承载自适应高度 textarea(输入区最小
456
+ * 高度 60px)、工具栏行与可选底部区;工具栏与底部区内容完全由
457
+ * DSL 槽位自定义;工具栏行在左右槽均未提供且 hideSend 时整体零渲染。
458
+ *
459
+ * 发送语义:点击发送钮或 Enter(Shift+Enter 换行;IME 合成中 Enter
460
+ * 不发送;trim 后空白禁发且发送钮禁用);非受控发送后自动清空,
461
+ * 受控模式由调用方在 onSubmit 闭环里清空。
462
+ *
463
+ * 定位为通用结构构件:transport / 附件 / 提及等对话领域能力请使用
464
+ * @pactor-app/chat 的 Composer。
465
+ */
466
+ declare function ChatInput({ value, placeholder, disabled, rows, hideSend, toolbarStart, toolbarEnd, header, footer, onChange, onSubmit, className, style, }: ChatInputProps): React.JSX.Element;
467
+
423
468
  interface ContentProps {
424
469
  /** 通用:根节点 class(与内置样式合并) */
425
470
  className?: string;
@@ -968,6 +1013,14 @@ interface MenuItem {
968
1013
  label: string;
969
1014
  /** 图标名(Icon 白名单,kebab/Pascal 均可),渲染于文字前 */
970
1015
  icon?: string;
1016
+ /** label 后的角标(inline 模式右对齐展示) */
1017
+ badge?: string | number;
1018
+ /** label 右侧的 danger 系状态圆点(与 badge 可共存) */
1019
+ dot?: boolean;
1020
+ /** 分组标题(inline 模式顶层;相邻同组项只渲染一次) */
1021
+ group?: string;
1022
+ /** 置灰不可选,点击不触发 onSelect */
1023
+ disabled?: boolean;
971
1024
  children?: MenuItem[];
972
1025
  }
973
1026
  interface MenuProps {
@@ -981,13 +1034,14 @@ interface MenuProps {
981
1034
  onSelect?: (key: string) => void;
982
1035
  /** 通用:根节点 class(与内置样式合并) */
983
1036
  className?: string;
984
- /** 通用:根节点内联样式 */
1037
+ /** 通用:根节点内联样式(同 className 挂载规则) */
985
1038
  style?: CSSProperties;
986
1039
  }
987
1040
  /**
988
1041
  * Menu 导航菜单(shadcn kit):哑渲染组件——items 经表达式注入,
989
1042
  * 不直接读取外壳层 MenuRegistry;选中态受控(selectedKey + onSelect
990
- * 闭环,典型接 navigate 动作)。
1043
+ * 闭环,典型接 navigate 动作)。在 Sidebar 内且侧栏折叠(icon rail)
1044
+ * 时自动降级为仅图标(label / badge / dot / 分组隐藏,hover 经 RailTooltip 展示)。
991
1045
  */
992
1046
  declare function Menu({ items, mode, selectedKey, onSelect, className, style, }: MenuProps): React.JSX.Element;
993
1047
 
@@ -1259,7 +1313,7 @@ interface SheetProps {
1259
1313
  */
1260
1314
  declare function Sheet({ title, open, side, onClose, children, className, style, }: SheetProps): React.JSX.Element;
1261
1315
 
1262
- /** 品牌区:标题 + 可选 logo(图片地址) */
1316
+ /** 品牌区:标题 + 可选 logo(图片地址);也可直接传 ReactNode 自定义 */
1263
1317
  interface SidebarBrand {
1264
1318
  title: string;
1265
1319
  logo?: string;
@@ -1273,27 +1327,46 @@ interface SidebarNavItem {
1273
1327
  children?: SidebarNavItem[];
1274
1328
  }
1275
1329
  interface SidebarProps {
1276
- /** 品牌区(标题 + 可选 logo */
1277
- brand?: SidebarBrand;
1278
- /** 导航项(可含嵌套 children,可含表达式) */
1330
+ /** 品牌区({ title, logo } 对象或任意 ReactNode);移动端渲染在顶栏,桌面端渲染在侧栏顶部品牌行 */
1331
+ brand?: SidebarBrand | ReactNode;
1332
+ /** 导航项(可含嵌套 children,可含表达式);content 槽提供时不渲染 */
1279
1333
  items?: SidebarNavItem[];
1280
- /** 是否渲染折叠触发器(折叠态内部维护,经 onCollapse 传出) */
1334
+ /** 侧栏自由内容槽(提供时替代 items 导航;DSL 子树经 Renderer 渲染) */
1335
+ content?: ReactNode;
1336
+ /** 侧栏底部固定区(渲染在滚动区之后,不随内容滚动;未提供不渲染容器) */
1337
+ sidebarFooter?: ReactNode;
1338
+ /** 是否渲染折叠触发器:折叠后桌面侧栏收窄为 icon rail(64px,导航仅图标) */
1281
1339
  collapsible?: boolean;
1282
1340
  /** 折叠状态变化事件,传出 boolean */
1283
1341
  onCollapse?: (collapsed: boolean) => void;
1342
+ /** 路由 / 会话切换标识:值变化时移动端抽屉在渲染期关闭 */
1343
+ locationKey?: string;
1344
+ /** 移动端(<768px)侧栏变为覆盖抽屉(缺省 true);false 时各端均为 flex 行布局 */
1345
+ drawer?: boolean;
1284
1346
  /** 通用:根节点 class(与内置样式合并) */
1285
1347
  className?: string;
1286
- /** 通用:根节点内联样式 */
1348
+ /** 通用:根节点内联样式(同 className 挂载规则) */
1287
1349
  style?: CSSProperties;
1288
1350
  /** 主内容区 */
1289
1351
  children?: ReactNode;
1290
1352
  }
1353
+ declare function useSidebarDrawer(): {
1354
+ close: () => void;
1355
+ collapsed: boolean;
1356
+ } | null;
1291
1357
  /**
1292
- * Sidebar 页面级组合(shadcn kit):品牌区 + 嵌套导航(href 渲染为锚点、
1293
- * 子菜单缩进展示)的侧栏与 children 主内容区组成的整页布局;样式取
1294
- * sidebar 系列语义令牌;collapsible 时提供折叠触发器。
1358
+ * Sidebar 页面级组合(shadcn kit):品牌区 + 侧栏(items 嵌套导航或
1359
+ * content 自由内容槽)+ children 主内容区组成的页面外壳;样式取
1360
+ * sidebar 系列语义令牌。
1361
+ *
1362
+ * - 桌面(≥768px):侧栏与主区 flex 同行;collapsible 时折叠触发器把
1363
+ * 侧栏收窄为 icon rail(64px,导航仅图标、hover 经 RailTooltip 展示);
1364
+ * - 移动端(<768px,drawer 缺省开启):侧栏退出文档流变为左侧覆盖
1365
+ * 抽屉——顶栏菜单按钮开启,遮罩点击 / Escape / locationKey 变化
1366
+ * 关闭,关闭时容器 inert;移动端不渲染折叠触发器;
1367
+ * - 侧栏内容可经 useSidebarDrawer() 取 close / collapsed 自行适配。
1295
1368
  */
1296
- declare function Sidebar({ brand, items, collapsible, onCollapse, className, style, children, }: SidebarProps): React.JSX.Element;
1369
+ declare function Sidebar({ brand, items, content, sidebarFooter, collapsible, onCollapse, locationKey, drawer, className, style, children, }: SidebarProps): React.JSX.Element;
1297
1370
 
1298
1371
  interface SiderProps {
1299
1372
  /** 展开宽度(px),默认 200 */
@@ -1638,11 +1711,11 @@ interface TypographyProps {
1638
1711
  declare function Typography({ variant, text, className, style, }: TypographyProps): React.JSX.Element;
1639
1712
 
1640
1713
  /**
1641
- * shadcn kit 组件表:DSL 类型名 → 组件适配器。
1642
- * 类型名集合与 pactor-components 的 builtinComponents 完全一致;
1714
+ * 内置组件表:DSL 类型名 → 组件适配器。
1715
+ * 类型名集合即 spec: builtin-components 的内置组件清单;
1643
1716
  * 容器组件(Tabs / Table)经 `useRenderer().renderChildren` 渲染 DSL 子树。
1644
1717
  */
1645
- declare const shadcnComponents: {
1718
+ declare const builtinComponents: {
1646
1719
  readonly Page: typeof Page;
1647
1720
  readonly Grid: typeof Grid;
1648
1721
  readonly Flex: typeof Flex;
@@ -1682,6 +1755,7 @@ declare const shadcnComponents: {
1682
1755
  readonly Slider: typeof Slider;
1683
1756
  readonly Label: typeof Label;
1684
1757
  readonly Field: typeof Field;
1758
+ readonly ChatInput: typeof ChatInput;
1685
1759
  readonly Breadcrumb: typeof Breadcrumb;
1686
1760
  readonly Pagination: typeof Pagination;
1687
1761
  readonly Menubar: typeof Menubar;
@@ -1716,10 +1790,20 @@ declare const shadcnComponents: {
1716
1790
  readonly Chart: typeof Chart;
1717
1791
  readonly Icon: typeof Icon;
1718
1792
  };
1719
- /** 把全部 V1 内置组件(shadcn 实现)按 DSL 类型名注册到给定 ComponentRegistry */
1720
- declare function registerShadcnComponents(registry: ComponentRegistry): void;
1721
- /** 创建并返回注册了全部 V1 内置组件(shadcn 实现)的新 ComponentRegistry */
1722
- declare function createShadcnComponentRegistry(): ComponentRegistry;
1793
+ /** 把全部 V1 内置组件按 DSL 类型名注册到给定 ComponentRegistry */
1794
+ declare function registerBuiltinComponents(registry: ComponentRegistry): void;
1795
+ /** 创建并返回注册了全部 V1 内置组件的新 ComponentRegistry */
1796
+ declare function createComponentRegistry(): ComponentRegistry;
1797
+
1798
+ /**
1799
+ * icon rail 提示(Sidebar 折叠态:Sidebar items 与 Menu 共用):
1800
+ * 触发元素本身经 render 合并为 TooltipTrigger(aria/ref/事件不丢失),
1801
+ * 提示浮层显示在图标右侧;仅折叠态使用,展开态无原生 title 干扰。
1802
+ */
1803
+ declare function RailTooltip({ label, children, }: {
1804
+ label: string;
1805
+ children: ReactElement;
1806
+ }): ReactNode;
1723
1807
 
1724
1808
  /**
1725
1809
  * Form 容器上下文(shadcn kit):Form 组件维护受控 values / 校验错误
@@ -1751,4 +1835,4 @@ interface FormContextValue {
1751
1835
  /** 在字段组件内探测 Form 上下文;不在 Form 内时返回 null */
1752
1836
  declare function useFormContext(): FormContextValue | null;
1753
1837
 
1754
- export { Accordion, type AccordionItemData, type AccordionProps, Alert, AlertDialog, type AlertDialogProps, type AlertProps, type AlertVariant, AspectRatio, type AspectRatioProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, Breadcrumb, type BreadcrumbItemData, type BreadcrumbProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, Carousel, type CarouselImage, type CarouselItemData, type CarouselProps, Chart, type ChartProps, type ChartType, Checkbox, type CheckboxProps, Collapsible, type CollapsibleProps, Combobox, type ComboboxOption, type ComboboxProps, Command, type CommandGroupData, type CommandItemData, type CommandProps, Content, type ContentProps, ContextMenu, type ContextMenuItemData, type ContextMenuProps, DataTable, type DataTableColumn, type DataTablePagination, type DataTableProps, type DataTableSort, type DataTableSortOrder, Dialog, type DialogProps, Drawer, type DrawerPlacement, type DrawerProps, DropdownMenu, type DropdownMenuItemData, type DropdownMenuProps, Empty, type EmptyProps, Field, type FieldProps, type FieldRule, Flex, type FlexProps, Footer, type FooterProps, Form, type FormContextValue, type FormProps, Grid, type GridProps, Header, type HeaderBrandPosition, type HeaderDropdown, type HeaderDropdownItem, type HeaderLocale, type HeaderMenuItem, type HeaderProps, type HeaderUser, type HeaderUserItem, HoverCard, type HoverCardProps, ICONS, Icon, type IconProps, type IconSize, Input, InputGroup, type InputGroupProps, InputOTP, type InputOTPProps, type InputProps, Item, type ItemProps, Kbd, type KbdProps, Label, type LabelProps, Layout, type LayoutProps, Link, type LinkProps, Menu, type MenuItem, type MenuProps, Menubar, type MenubarLeafItem, type MenubarMenuData, type MenubarProps, NavigationMenu, type NavigationMenuChildItem, type NavigationMenuItemData, type NavigationMenuProps, Page, type PageProps, Pagination, type PaginationProps, Popover, type PopoverProps, Progress, type ProgressProps, RadioGroup, type RadioGroupOption, type RadioGroupProps, Resizable, type ResizablePanelData, type ResizableProps, ScrollArea, type ScrollAreaProps, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, type SheetSide, Sidebar, type SidebarBrand, type SidebarNavItem, type SidebarProps, Sider, type SiderProps, Skeleton, type SkeletonProps, type SkeletonShape, Slider, type SliderProps, Sonner, type SonnerProps, Spinner, type SpinnerProps, type SpinnerSize, Statistic, type StatisticProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TablePagination, type TablePaginationInfo, type TableProps, Tabs, type TabsProps, Text, type TextProps, type TextType, Textarea, type TextareaProps, Toggle, ToggleGroup, type ToggleGroupOption, type ToggleGroupProps, type ToggleProps, Tooltip, type TooltipProps, Typography, type TypographyProps, type TypographyVariant, createShadcnComponentRegistry, normalizeIconName, registerShadcnComponents, shadcnComponents, useFormContext };
1838
+ export { Accordion, type AccordionItemData, type AccordionProps, Alert, AlertDialog, type AlertDialogProps, type AlertProps, type AlertVariant, AspectRatio, type AspectRatioProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, Breadcrumb, type BreadcrumbItemData, type BreadcrumbProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, Carousel, type CarouselImage, type CarouselItemData, type CarouselProps, Chart, type ChartProps, type ChartType, Checkbox, type CheckboxProps, Collapsible, type CollapsibleProps, Combobox, type ComboboxOption, type ComboboxProps, Command, type CommandGroupData, type CommandItemData, type CommandProps, Content, type ContentProps, ContextMenu, type ContextMenuItemData, type ContextMenuProps, DataTable, type DataTableColumn, type DataTablePagination, type DataTableProps, type DataTableSort, type DataTableSortOrder, Dialog, type DialogProps, Drawer, type DrawerPlacement, type DrawerProps, DropdownMenu, type DropdownMenuItemData, type DropdownMenuProps, Empty, type EmptyProps, Field, type FieldProps, type FieldRule, Flex, type FlexProps, Footer, type FooterProps, Form, type FormContextValue, type FormProps, Grid, type GridProps, Header, type HeaderBrandPosition, type HeaderDropdown, type HeaderDropdownItem, type HeaderLocale, type HeaderMenuItem, type HeaderProps, type HeaderUser, type HeaderUserItem, HoverCard, type HoverCardProps, ICONS, Icon, type IconProps, type IconSize, Input, InputGroup, type InputGroupProps, InputOTP, type InputOTPProps, type InputProps, Item, type ItemProps, Kbd, type KbdProps, Label, type LabelProps, Layout, type LayoutProps, Link, type LinkProps, Menu, type MenuItem, type MenuProps, Menubar, type MenubarLeafItem, type MenubarMenuData, type MenubarProps, NavigationMenu, type NavigationMenuChildItem, type NavigationMenuItemData, type NavigationMenuProps, Page, type PageProps, Pagination, type PaginationProps, Popover, type PopoverProps, Progress, type ProgressProps, RadioGroup, type RadioGroupOption, type RadioGroupProps, RailTooltip, Resizable, type ResizablePanelData, type ResizableProps, ScrollArea, type ScrollAreaProps, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, type SheetSide, Sidebar, type SidebarBrand, type SidebarNavItem, type SidebarProps, Sider, type SiderProps, Skeleton, type SkeletonProps, type SkeletonShape, Slider, type SliderProps, Sonner, type SonnerProps, Spinner, type SpinnerProps, type SpinnerSize, Statistic, type StatisticProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TablePagination, type TablePaginationInfo, type TableProps, Tabs, type TabsProps, Text, type TextProps, type TextType, Textarea, type TextareaProps, Toggle, ToggleGroup, type ToggleGroupOption, type ToggleGroupProps, type ToggleProps, Tooltip, type TooltipProps, Typography, type TypographyProps, type TypographyVariant, builtinComponents, createComponentRegistry, normalizeIconName, registerBuiltinComponents, useFormContext, useSidebarDrawer };
@@ -1,6 +1,6 @@
1
1
  import { ComponentRegistry } from '@pactor-app/runtime';
2
2
  import * as React from 'react';
3
- import { CSSProperties, ReactNode } from 'react';
3
+ import { CSSProperties, ReactNode, ReactElement } from 'react';
4
4
  import { DslNode, DslChildren } from '@pactor-app/core';
5
5
  import { LucideIcon } from 'lucide-react';
6
6
  import { t as toggleVariants, b as typographyVariants } from '../typography-DsGdDBc2.js';
@@ -420,6 +420,51 @@ interface ChartProps {
420
420
  */
421
421
  declare function Chart({ chartType, data, xKey, yKeys, colors, className, style, }: ChartProps): React.JSX.Element;
422
422
 
423
+ interface ChatInputProps {
424
+ /** 受控值(提供即受控:变更只经 onChange 传出,显示值取自 props) */
425
+ value?: string;
426
+ placeholder?: string;
427
+ disabled?: boolean;
428
+ /** 最小行数(高度随内容自适应,rows 为下限;缺省 3) */
429
+ rows?: number;
430
+ /**
431
+ * 隐藏内建发送钮(工具栏右端完全自定义的场景);
432
+ * hideSend 且左右槽均未提供时工具栏行整体零渲染
433
+ */
434
+ hideSend?: boolean;
435
+ /** 工具栏左端槽(DslNode 子树,经 Renderer children 机制渲染) */
436
+ toolbarStart?: DslNode;
437
+ /** 工具栏右端槽(发送钮之前) */
438
+ toolbarEnd?: DslNode;
439
+ /** 顶部区槽(提供时渲染在 textarea 上方,与 footer 对称;附件卡片、上下文 chips 等输入上下文展示) */
440
+ header?: DslNode;
441
+ /** 底部区槽(提供时渲染,与工具栏以分隔线相隔) */
442
+ footer?: DslNode;
443
+ /** 输入事件,传出 string 值 */
444
+ onChange?: (value: string) => void;
445
+ /** 发送事件(点击发送钮或 Enter),传出当前文本 */
446
+ onSubmit?: (value: string) => void;
447
+ /** 通用:根节点 class(与内置样式合并) */
448
+ className?: string;
449
+ /** 通用:根节点内联样式 */
450
+ style?: CSSProperties;
451
+ }
452
+ /**
453
+ * ChatInput 适配器(shadcn kit):AI 对话输入框的通用结构构件
454
+ * (spec: shadcn-extended-components / ChatInput)——外层圆角容器
455
+ * (focus-within 高亮)内依次承载自适应高度 textarea(输入区最小
456
+ * 高度 60px)、工具栏行与可选底部区;工具栏与底部区内容完全由
457
+ * DSL 槽位自定义;工具栏行在左右槽均未提供且 hideSend 时整体零渲染。
458
+ *
459
+ * 发送语义:点击发送钮或 Enter(Shift+Enter 换行;IME 合成中 Enter
460
+ * 不发送;trim 后空白禁发且发送钮禁用);非受控发送后自动清空,
461
+ * 受控模式由调用方在 onSubmit 闭环里清空。
462
+ *
463
+ * 定位为通用结构构件:transport / 附件 / 提及等对话领域能力请使用
464
+ * @pactor-app/chat 的 Composer。
465
+ */
466
+ declare function ChatInput({ value, placeholder, disabled, rows, hideSend, toolbarStart, toolbarEnd, header, footer, onChange, onSubmit, className, style, }: ChatInputProps): React.JSX.Element;
467
+
423
468
  interface ContentProps {
424
469
  /** 通用:根节点 class(与内置样式合并) */
425
470
  className?: string;
@@ -968,6 +1013,14 @@ interface MenuItem {
968
1013
  label: string;
969
1014
  /** 图标名(Icon 白名单,kebab/Pascal 均可),渲染于文字前 */
970
1015
  icon?: string;
1016
+ /** label 后的角标(inline 模式右对齐展示) */
1017
+ badge?: string | number;
1018
+ /** label 右侧的 danger 系状态圆点(与 badge 可共存) */
1019
+ dot?: boolean;
1020
+ /** 分组标题(inline 模式顶层;相邻同组项只渲染一次) */
1021
+ group?: string;
1022
+ /** 置灰不可选,点击不触发 onSelect */
1023
+ disabled?: boolean;
971
1024
  children?: MenuItem[];
972
1025
  }
973
1026
  interface MenuProps {
@@ -981,13 +1034,14 @@ interface MenuProps {
981
1034
  onSelect?: (key: string) => void;
982
1035
  /** 通用:根节点 class(与内置样式合并) */
983
1036
  className?: string;
984
- /** 通用:根节点内联样式 */
1037
+ /** 通用:根节点内联样式(同 className 挂载规则) */
985
1038
  style?: CSSProperties;
986
1039
  }
987
1040
  /**
988
1041
  * Menu 导航菜单(shadcn kit):哑渲染组件——items 经表达式注入,
989
1042
  * 不直接读取外壳层 MenuRegistry;选中态受控(selectedKey + onSelect
990
- * 闭环,典型接 navigate 动作)。
1043
+ * 闭环,典型接 navigate 动作)。在 Sidebar 内且侧栏折叠(icon rail)
1044
+ * 时自动降级为仅图标(label / badge / dot / 分组隐藏,hover 经 RailTooltip 展示)。
991
1045
  */
992
1046
  declare function Menu({ items, mode, selectedKey, onSelect, className, style, }: MenuProps): React.JSX.Element;
993
1047
 
@@ -1259,7 +1313,7 @@ interface SheetProps {
1259
1313
  */
1260
1314
  declare function Sheet({ title, open, side, onClose, children, className, style, }: SheetProps): React.JSX.Element;
1261
1315
 
1262
- /** 品牌区:标题 + 可选 logo(图片地址) */
1316
+ /** 品牌区:标题 + 可选 logo(图片地址);也可直接传 ReactNode 自定义 */
1263
1317
  interface SidebarBrand {
1264
1318
  title: string;
1265
1319
  logo?: string;
@@ -1273,27 +1327,46 @@ interface SidebarNavItem {
1273
1327
  children?: SidebarNavItem[];
1274
1328
  }
1275
1329
  interface SidebarProps {
1276
- /** 品牌区(标题 + 可选 logo */
1277
- brand?: SidebarBrand;
1278
- /** 导航项(可含嵌套 children,可含表达式) */
1330
+ /** 品牌区({ title, logo } 对象或任意 ReactNode);移动端渲染在顶栏,桌面端渲染在侧栏顶部品牌行 */
1331
+ brand?: SidebarBrand | ReactNode;
1332
+ /** 导航项(可含嵌套 children,可含表达式);content 槽提供时不渲染 */
1279
1333
  items?: SidebarNavItem[];
1280
- /** 是否渲染折叠触发器(折叠态内部维护,经 onCollapse 传出) */
1334
+ /** 侧栏自由内容槽(提供时替代 items 导航;DSL 子树经 Renderer 渲染) */
1335
+ content?: ReactNode;
1336
+ /** 侧栏底部固定区(渲染在滚动区之后,不随内容滚动;未提供不渲染容器) */
1337
+ sidebarFooter?: ReactNode;
1338
+ /** 是否渲染折叠触发器:折叠后桌面侧栏收窄为 icon rail(64px,导航仅图标) */
1281
1339
  collapsible?: boolean;
1282
1340
  /** 折叠状态变化事件,传出 boolean */
1283
1341
  onCollapse?: (collapsed: boolean) => void;
1342
+ /** 路由 / 会话切换标识:值变化时移动端抽屉在渲染期关闭 */
1343
+ locationKey?: string;
1344
+ /** 移动端(<768px)侧栏变为覆盖抽屉(缺省 true);false 时各端均为 flex 行布局 */
1345
+ drawer?: boolean;
1284
1346
  /** 通用:根节点 class(与内置样式合并) */
1285
1347
  className?: string;
1286
- /** 通用:根节点内联样式 */
1348
+ /** 通用:根节点内联样式(同 className 挂载规则) */
1287
1349
  style?: CSSProperties;
1288
1350
  /** 主内容区 */
1289
1351
  children?: ReactNode;
1290
1352
  }
1353
+ declare function useSidebarDrawer(): {
1354
+ close: () => void;
1355
+ collapsed: boolean;
1356
+ } | null;
1291
1357
  /**
1292
- * Sidebar 页面级组合(shadcn kit):品牌区 + 嵌套导航(href 渲染为锚点、
1293
- * 子菜单缩进展示)的侧栏与 children 主内容区组成的整页布局;样式取
1294
- * sidebar 系列语义令牌;collapsible 时提供折叠触发器。
1358
+ * Sidebar 页面级组合(shadcn kit):品牌区 + 侧栏(items 嵌套导航或
1359
+ * content 自由内容槽)+ children 主内容区组成的页面外壳;样式取
1360
+ * sidebar 系列语义令牌。
1361
+ *
1362
+ * - 桌面(≥768px):侧栏与主区 flex 同行;collapsible 时折叠触发器把
1363
+ * 侧栏收窄为 icon rail(64px,导航仅图标、hover 经 RailTooltip 展示);
1364
+ * - 移动端(<768px,drawer 缺省开启):侧栏退出文档流变为左侧覆盖
1365
+ * 抽屉——顶栏菜单按钮开启,遮罩点击 / Escape / locationKey 变化
1366
+ * 关闭,关闭时容器 inert;移动端不渲染折叠触发器;
1367
+ * - 侧栏内容可经 useSidebarDrawer() 取 close / collapsed 自行适配。
1295
1368
  */
1296
- declare function Sidebar({ brand, items, collapsible, onCollapse, className, style, children, }: SidebarProps): React.JSX.Element;
1369
+ declare function Sidebar({ brand, items, content, sidebarFooter, collapsible, onCollapse, locationKey, drawer, className, style, children, }: SidebarProps): React.JSX.Element;
1297
1370
 
1298
1371
  interface SiderProps {
1299
1372
  /** 展开宽度(px),默认 200 */
@@ -1638,11 +1711,11 @@ interface TypographyProps {
1638
1711
  declare function Typography({ variant, text, className, style, }: TypographyProps): React.JSX.Element;
1639
1712
 
1640
1713
  /**
1641
- * shadcn kit 组件表:DSL 类型名 → 组件适配器。
1642
- * 类型名集合与 pactor-components 的 builtinComponents 完全一致;
1714
+ * 内置组件表:DSL 类型名 → 组件适配器。
1715
+ * 类型名集合即 spec: builtin-components 的内置组件清单;
1643
1716
  * 容器组件(Tabs / Table)经 `useRenderer().renderChildren` 渲染 DSL 子树。
1644
1717
  */
1645
- declare const shadcnComponents: {
1718
+ declare const builtinComponents: {
1646
1719
  readonly Page: typeof Page;
1647
1720
  readonly Grid: typeof Grid;
1648
1721
  readonly Flex: typeof Flex;
@@ -1682,6 +1755,7 @@ declare const shadcnComponents: {
1682
1755
  readonly Slider: typeof Slider;
1683
1756
  readonly Label: typeof Label;
1684
1757
  readonly Field: typeof Field;
1758
+ readonly ChatInput: typeof ChatInput;
1685
1759
  readonly Breadcrumb: typeof Breadcrumb;
1686
1760
  readonly Pagination: typeof Pagination;
1687
1761
  readonly Menubar: typeof Menubar;
@@ -1716,10 +1790,20 @@ declare const shadcnComponents: {
1716
1790
  readonly Chart: typeof Chart;
1717
1791
  readonly Icon: typeof Icon;
1718
1792
  };
1719
- /** 把全部 V1 内置组件(shadcn 实现)按 DSL 类型名注册到给定 ComponentRegistry */
1720
- declare function registerShadcnComponents(registry: ComponentRegistry): void;
1721
- /** 创建并返回注册了全部 V1 内置组件(shadcn 实现)的新 ComponentRegistry */
1722
- declare function createShadcnComponentRegistry(): ComponentRegistry;
1793
+ /** 把全部 V1 内置组件按 DSL 类型名注册到给定 ComponentRegistry */
1794
+ declare function registerBuiltinComponents(registry: ComponentRegistry): void;
1795
+ /** 创建并返回注册了全部 V1 内置组件的新 ComponentRegistry */
1796
+ declare function createComponentRegistry(): ComponentRegistry;
1797
+
1798
+ /**
1799
+ * icon rail 提示(Sidebar 折叠态:Sidebar items 与 Menu 共用):
1800
+ * 触发元素本身经 render 合并为 TooltipTrigger(aria/ref/事件不丢失),
1801
+ * 提示浮层显示在图标右侧;仅折叠态使用,展开态无原生 title 干扰。
1802
+ */
1803
+ declare function RailTooltip({ label, children, }: {
1804
+ label: string;
1805
+ children: ReactElement;
1806
+ }): ReactNode;
1723
1807
 
1724
1808
  /**
1725
1809
  * Form 容器上下文(shadcn kit):Form 组件维护受控 values / 校验错误
@@ -1751,4 +1835,4 @@ interface FormContextValue {
1751
1835
  /** 在字段组件内探测 Form 上下文;不在 Form 内时返回 null */
1752
1836
  declare function useFormContext(): FormContextValue | null;
1753
1837
 
1754
- export { Accordion, type AccordionItemData, type AccordionProps, Alert, AlertDialog, type AlertDialogProps, type AlertProps, type AlertVariant, AspectRatio, type AspectRatioProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, Breadcrumb, type BreadcrumbItemData, type BreadcrumbProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, Carousel, type CarouselImage, type CarouselItemData, type CarouselProps, Chart, type ChartProps, type ChartType, Checkbox, type CheckboxProps, Collapsible, type CollapsibleProps, Combobox, type ComboboxOption, type ComboboxProps, Command, type CommandGroupData, type CommandItemData, type CommandProps, Content, type ContentProps, ContextMenu, type ContextMenuItemData, type ContextMenuProps, DataTable, type DataTableColumn, type DataTablePagination, type DataTableProps, type DataTableSort, type DataTableSortOrder, Dialog, type DialogProps, Drawer, type DrawerPlacement, type DrawerProps, DropdownMenu, type DropdownMenuItemData, type DropdownMenuProps, Empty, type EmptyProps, Field, type FieldProps, type FieldRule, Flex, type FlexProps, Footer, type FooterProps, Form, type FormContextValue, type FormProps, Grid, type GridProps, Header, type HeaderBrandPosition, type HeaderDropdown, type HeaderDropdownItem, type HeaderLocale, type HeaderMenuItem, type HeaderProps, type HeaderUser, type HeaderUserItem, HoverCard, type HoverCardProps, ICONS, Icon, type IconProps, type IconSize, Input, InputGroup, type InputGroupProps, InputOTP, type InputOTPProps, type InputProps, Item, type ItemProps, Kbd, type KbdProps, Label, type LabelProps, Layout, type LayoutProps, Link, type LinkProps, Menu, type MenuItem, type MenuProps, Menubar, type MenubarLeafItem, type MenubarMenuData, type MenubarProps, NavigationMenu, type NavigationMenuChildItem, type NavigationMenuItemData, type NavigationMenuProps, Page, type PageProps, Pagination, type PaginationProps, Popover, type PopoverProps, Progress, type ProgressProps, RadioGroup, type RadioGroupOption, type RadioGroupProps, Resizable, type ResizablePanelData, type ResizableProps, ScrollArea, type ScrollAreaProps, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, type SheetSide, Sidebar, type SidebarBrand, type SidebarNavItem, type SidebarProps, Sider, type SiderProps, Skeleton, type SkeletonProps, type SkeletonShape, Slider, type SliderProps, Sonner, type SonnerProps, Spinner, type SpinnerProps, type SpinnerSize, Statistic, type StatisticProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TablePagination, type TablePaginationInfo, type TableProps, Tabs, type TabsProps, Text, type TextProps, type TextType, Textarea, type TextareaProps, Toggle, ToggleGroup, type ToggleGroupOption, type ToggleGroupProps, type ToggleProps, Tooltip, type TooltipProps, Typography, type TypographyProps, type TypographyVariant, createShadcnComponentRegistry, normalizeIconName, registerShadcnComponents, shadcnComponents, useFormContext };
1838
+ export { Accordion, type AccordionItemData, type AccordionProps, Alert, AlertDialog, type AlertDialogProps, type AlertProps, type AlertVariant, AspectRatio, type AspectRatioProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, Breadcrumb, type BreadcrumbItemData, type BreadcrumbProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, Carousel, type CarouselImage, type CarouselItemData, type CarouselProps, Chart, type ChartProps, type ChartType, Checkbox, type CheckboxProps, Collapsible, type CollapsibleProps, Combobox, type ComboboxOption, type ComboboxProps, Command, type CommandGroupData, type CommandItemData, type CommandProps, Content, type ContentProps, ContextMenu, type ContextMenuItemData, type ContextMenuProps, DataTable, type DataTableColumn, type DataTablePagination, type DataTableProps, type DataTableSort, type DataTableSortOrder, Dialog, type DialogProps, Drawer, type DrawerPlacement, type DrawerProps, DropdownMenu, type DropdownMenuItemData, type DropdownMenuProps, Empty, type EmptyProps, Field, type FieldProps, type FieldRule, Flex, type FlexProps, Footer, type FooterProps, Form, type FormContextValue, type FormProps, Grid, type GridProps, Header, type HeaderBrandPosition, type HeaderDropdown, type HeaderDropdownItem, type HeaderLocale, type HeaderMenuItem, type HeaderProps, type HeaderUser, type HeaderUserItem, HoverCard, type HoverCardProps, ICONS, Icon, type IconProps, type IconSize, Input, InputGroup, type InputGroupProps, InputOTP, type InputOTPProps, type InputProps, Item, type ItemProps, Kbd, type KbdProps, Label, type LabelProps, Layout, type LayoutProps, Link, type LinkProps, Menu, type MenuItem, type MenuProps, Menubar, type MenubarLeafItem, type MenubarMenuData, type MenubarProps, NavigationMenu, type NavigationMenuChildItem, type NavigationMenuItemData, type NavigationMenuProps, Page, type PageProps, Pagination, type PaginationProps, Popover, type PopoverProps, Progress, type ProgressProps, RadioGroup, type RadioGroupOption, type RadioGroupProps, RailTooltip, Resizable, type ResizablePanelData, type ResizableProps, ScrollArea, type ScrollAreaProps, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, type SheetSide, Sidebar, type SidebarBrand, type SidebarNavItem, type SidebarProps, Sider, type SiderProps, Skeleton, type SkeletonProps, type SkeletonShape, Slider, type SliderProps, Sonner, type SonnerProps, Spinner, type SpinnerProps, type SpinnerSize, Statistic, type StatisticProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TablePagination, type TablePaginationInfo, type TableProps, Tabs, type TabsProps, Text, type TextProps, type TextType, Textarea, type TextareaProps, Toggle, ToggleGroup, type ToggleGroupOption, type ToggleGroupProps, type ToggleProps, Tooltip, type TooltipProps, Typography, type TypographyProps, type TypographyVariant, builtinComponents, createComponentRegistry, normalizeIconName, registerBuiltinComponents, useFormContext, useSidebarDrawer };
@@ -38,7 +38,6 @@ import {
38
38
  Label,
39
39
  Layout,
40
40
  Link,
41
- Menu,
42
41
  Menubar,
43
42
  NavigationMenu,
44
43
  Page,
@@ -51,7 +50,6 @@ import {
51
50
  Select,
52
51
  Separator,
53
52
  Sheet,
54
- Sidebar,
55
53
  Sider,
56
54
  Skeleton,
57
55
  Slider,
@@ -67,19 +65,23 @@ import {
67
65
  ToggleGroup,
68
66
  Tooltip,
69
67
  Typography,
70
- createShadcnComponentRegistry,
71
- registerShadcnComponents,
72
- shadcnComponents,
68
+ builtinComponents,
69
+ createComponentRegistry,
70
+ registerBuiltinComponents,
73
71
  useFormContext
74
- } from "../chunk-FVZMNP5P.js";
72
+ } from "../chunk-LMEJ242M.js";
75
73
  import {
76
74
  ICONS,
77
75
  Icon,
78
- normalizeIconName
79
- } from "../chunk-UR3I4WXQ.js";
80
- import "../chunk-TUXCPXPA.js";
76
+ Menu,
77
+ RailTooltip,
78
+ Sidebar,
79
+ normalizeIconName,
80
+ useSidebarDrawer
81
+ } from "../chunk-HJPHJKVA.js";
82
+ import "../chunk-Q5NUGUJG.js";
81
83
  import "../chunk-F3H23KYG.js";
82
- import "../chunk-GL7IO22L.js";
84
+ import "../chunk-2LYMCWEJ.js";
83
85
  import "../chunk-RQHJBTEU.js";
84
86
  export {
85
87
  Accordion,
@@ -131,6 +133,7 @@ export {
131
133
  Popover,
132
134
  Progress,
133
135
  RadioGroup,
136
+ RailTooltip,
134
137
  Resizable,
135
138
  ScrollArea,
136
139
  Select,
@@ -152,9 +155,10 @@ export {
152
155
  ToggleGroup,
153
156
  Tooltip,
154
157
  Typography,
155
- createShadcnComponentRegistry,
158
+ builtinComponents,
159
+ createComponentRegistry,
156
160
  normalizeIconName,
157
- registerShadcnComponents,
158
- shadcnComponents,
159
- useFormContext
161
+ registerBuiltinComponents,
162
+ useFormContext,
163
+ useSidebarDrawer
160
164
  };