@pactor-app/ui 1.1.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.
@@ -79,6 +79,62 @@ interface LandingLayoutProps {
79
79
  footer?: ReactNode;
80
80
  children?: ReactNode;
81
81
  }
82
+ /** ChatLayout 菜单项(显式 menu 数据驱动;registry 推导时由 router MenuItem 映射) */
83
+ interface ChatLayoutMenuItem {
84
+ key: string;
85
+ label: string;
86
+ /** 图标名(Icon 白名单,kebab/Pascal 均可) */
87
+ icon?: string;
88
+ /** label 后的角标 */
89
+ badge?: string | number;
90
+ /** label 右侧的状态圆点 */
91
+ dot?: boolean;
92
+ /** 分组标题(相邻同组只渲染一次) */
93
+ group?: string;
94
+ /** 置灰不可选 */
95
+ disabled?: boolean;
96
+ /** 路由路径(registry 推导时来自 MenuItem.path;bridge 导航与 active 推导用) */
97
+ path?: string;
98
+ }
99
+ /** ChatLayout 品牌区(与 Sidebar 品牌区同构:{ title, logo? } 对象或任意 ReactNode) */
100
+ type ChatLayoutBrand = {
101
+ title: string;
102
+ logo?: string;
103
+ } | ReactNode;
104
+ /**
105
+ * ChatLayout props(设计决策 D7):聊天场景外壳布局——
106
+ * 品牌区 + 菜单侧栏 + 主内容区。
107
+ *
108
+ * 菜单来源优先级:`sidebar` 槽 > `menu` 显式数据 > `registry` 推导 > 空侧栏。
109
+ * 导航行为:`onMenuSelect` 提供时调用之;否则有 `bridge` 且项有 `path` 时
110
+ * `bridge.push(path)`。高亮推导:`activeMenuKey` > `route` > `bridge` 订阅。
111
+ */
112
+ interface ChatLayoutProps {
113
+ /** 品牌区({ title, logo } 对象或任意 ReactNode) */
114
+ brand?: ChatLayoutBrand;
115
+ /** 显式菜单数据;提供时优先于 registry 推导 */
116
+ menu?: ChatLayoutMenuItem[];
117
+ /** 菜单注册表(app-shell 注入);无 menu 时据此推导菜单 */
118
+ registry?: MenuRegistry;
119
+ /** 导航桥(app-shell 注入);默认导航与 active 推导用 */
120
+ bridge?: NavigationBridge;
121
+ /** 路由上下文(测试友好,优先于 bridge 订阅) */
122
+ route?: RouteContext;
123
+ /** 权限检查器(registry 推导时过滤菜单) */
124
+ permissionChecker?: PermissionChecker;
125
+ /** 受控高亮项 key(优先于 route/bridge 推导) */
126
+ activeMenuKey?: string;
127
+ /** 菜单项点击回调(disabled 项不触发);提供时替代默认导航 */
128
+ onMenuSelect?: (key: string, item: ChatLayoutMenuItem) => void;
129
+ /** 桌面端可折叠为 icon rail(透传 Sidebar;缺省 false) */
130
+ collapsible?: boolean;
131
+ /** 自由侧栏槽(提供时替代内建菜单) */
132
+ sidebar?: ReactNode;
133
+ /** 侧栏底部固定槽(渲染在滚动区之后,不随内容滚动) */
134
+ sidebarFooter?: ReactNode;
135
+ /** 主内容区 */
136
+ children?: ReactNode;
137
+ }
82
138
 
83
139
  /**
84
140
  * 菜单链(设计决策 D2):沿可见树查找 menuId 的父链,
@@ -98,7 +154,7 @@ declare function findMenuChain(registry: MenuRegistry, menuId: string): MenuItem
98
154
  declare function collectDefaultOpenKeys(registry: MenuRegistry, activeMenuId?: string): string[];
99
155
 
100
156
  /**
101
- * ShadcnAdminLayout:与 pactor-layout 的 AdminLayout(antd 版)契约一致——
157
+ * AdminLayout:内置默认 UI 实现的管理后台布局——
102
158
  * 复用 `AdminLayoutProps`;Header(brand + headerExtra)/ Sidebar / 内容出口;
103
159
  * config 开关(header/sidebar 缺省开,tabs/breadcrumb/footer 缺省关)一致;
104
160
  * mode(top-side/top-bottom/side-full/two-column)、fixedHeader/fixedSider、
@@ -112,47 +168,69 @@ declare function collectDefaultOpenKeys(registry: MenuRegistry, activeMenuId?: s
112
168
  * 样式:Tailwind 工具类读取 shadcn 语义令牌(bg-background / border-border /
113
169
  * text-muted-foreground …),结构钩子用 data-slot 属性。
114
170
  */
115
- declare function ShadcnAdminLayout({ config, brand, registry, bridge, route: routeProp, permissionChecker, headerExtra, children, }: AdminLayoutProps): React.JSX.Element;
171
+ declare function AdminLayout({ config, brand, registry, bridge, route: routeProp, permissionChecker, headerExtra, children, }: AdminLayoutProps): React.JSX.Element;
172
+
173
+ /**
174
+ * BlankLayout:内置默认 UI 实现的无壳布局——
175
+ * 直接渲染 children(带最小页面容器样式)。
176
+ */
177
+ declare function BlankLayout({ children }: BlankLayoutProps): React.JSX.Element;
116
178
 
117
179
  /**
118
- * ShadcnBlankLayout:与 pactor-layout 的 BlankLayout(antd 版)契约一致——
119
- * 无壳布局,直接渲染 children(带最小页面容器样式)。
180
+ * ChatLayout(设计决策 D7):聊天场景外壳布局——
181
+ * 品牌区 + 菜单侧栏 + 主内容区,基于 ui `Sidebar` + `Menu` 组件组合。
182
+ *
183
+ * 菜单来源优先级(高 → 低):
184
+ * 1. `sidebar` 槽:自由侧栏内容,整体替代内建菜单;
185
+ * 2. `menu` 显式数据:调用方直接提供菜单项(含 icon/badge/dot/group/disabled);
186
+ * 3. `registry` 推导:app-shell 注入的 MenuRegistry 可见树
187
+ * (group 类型项 → 分组标签,page/link → 菜单项,permissionChecker 过滤);
188
+ * 4. 空侧栏:以上均无时不渲染侧栏,主区通栏。
189
+ *
190
+ * 导航行为:`onMenuSelect` 提供时调用之(disabled 项不触发);
191
+ * 否则有 `bridge` 且项有 `path` 时 `bridge.push(path)`。
192
+ *
193
+ * 高亮推导优先级:`activeMenuKey` > `route`(测试友好)>
194
+ * `bridge` 订阅 location 按 `path === pathname` 命中。
195
+ *
196
+ * 与 chat 包的 `ChatLayout`(header + ChatView 极简布局)不同,
197
+ * 本组件是带侧栏菜单的完整外壳,两者不冲突(不同包导出)。
120
198
  */
121
- declare function ShadcnBlankLayout({ children }: BlankLayoutProps): React.JSX.Element;
199
+ declare function ChatLayout({ brand, menu, registry, bridge, route: routeProp, permissionChecker, activeMenuKey, onMenuSelect, collapsible, sidebar, sidebarFooter, children, }: ChatLayoutProps): React.JSX.Element;
122
200
 
123
201
  /**
124
- * ShadcnLoginLayout:与 pactor-layout 的 LoginLayout(antd 版)契约一致——
125
- * 登录页外壳,只负责品牌区与表单出口的布局,不含任何认证逻辑。
202
+ * LoginLayout:内置默认 UI 实现的登录页外壳——
203
+ * 只负责品牌区与表单出口的布局,不含任何认证逻辑。
126
204
  * variant center:居中卡片(vendored shadcn Card);split:左品牌右表单
127
205
  * (缺省 center)。
128
206
  */
129
- declare function ShadcnLoginLayout({ variant, brand, children, }: LoginLayoutProps): React.JSX.Element;
207
+ declare function LoginLayout({ variant, brand, children, }: LoginLayoutProps): React.JSX.Element;
130
208
 
131
209
  /**
132
- * ShadcnLandingLayout:与 pactor-layout 的 LandingLayout(antd 版)契约一致——
133
- * 落地页外壳,可选 navbar / footer 插槽,children 为主内容区。
210
+ * LandingLayout:内置默认 UI 实现的落地页外壳——
211
+ * 可选 navbar / footer 插槽,children 为主内容区。
134
212
  */
135
- declare function ShadcnLandingLayout({ navbar, footer, children, }: LandingLayoutProps): React.JSX.Element;
213
+ declare function LandingLayout({ navbar, footer, children, }: LandingLayoutProps): React.JSX.Element;
136
214
 
137
215
  /** 布局组件类型(各布局 props 不同,注册表按通用组件存储) */
138
216
  type LayoutComponent = ComponentType<any>;
139
217
  /** LayoutRegistry:布局类型名 → 布局组件(复用 core Registry) */
140
218
  type LayoutRegistry = Registry<LayoutComponent>;
141
219
  /**
142
- * registerShadcnLayouts:向 LayoutRegistry 注册 shadcn 实现的四种布局
143
- * (类型名:admin / blank / login / landing)。
220
+ * registerBuiltinLayouts:向 LayoutRegistry 注册内置实现的五种布局
221
+ * (类型名:admin / blank / login / landing / chat)。
144
222
  */
145
- declare function registerShadcnLayouts(registry: LayoutRegistry): void;
223
+ declare function registerBuiltinLayouts(registry: LayoutRegistry): void;
146
224
  /**
147
- * createShadcnLayoutRegistry(设计决策 D5):预注册 shadcn 版
148
- * admin / blank / login / landing 四种布局组件。
225
+ * createLayoutRegistry(设计决策 D5):预注册内置版
226
+ * admin / blank / login / landing / chat 五种布局组件。
149
227
  * 业务可继续 register 自定义布局类型。
150
228
  */
151
- declare function createShadcnLayoutRegistry(): LayoutRegistry;
229
+ declare function createLayoutRegistry(): LayoutRegistry;
152
230
  /**
153
231
  * resolveLayout(设计决策 D5):按类型名解析布局组件;
154
- * 未命中返回 ShadcnBlankLayout 并 console.warn(不抛错,不崩页面)。
232
+ * 未命中返回 BlankLayout 并 console.warn(不抛错,不崩页面)。
155
233
  */
156
234
  declare function resolveLayout(registry: LayoutRegistry, type: string): LayoutComponent;
157
235
 
158
- export { type AdminBrand, type AdminLayoutBreakpoint, type AdminLayoutConfig, type AdminLayoutMode, type AdminLayoutProps, type BlankLayoutProps, type LandingLayoutProps, type LayoutComponent, type LayoutRegistry, type LoginBrand, type LoginLayoutProps, ShadcnAdminLayout, ShadcnBlankLayout, ShadcnLandingLayout, ShadcnLoginLayout, collectDefaultOpenKeys, createShadcnLayoutRegistry, findMenuChain, registerShadcnLayouts, resolveLayout };
236
+ export { type AdminBrand, AdminLayout, type AdminLayoutBreakpoint, type AdminLayoutConfig, type AdminLayoutMode, type AdminLayoutProps, BlankLayout, type BlankLayoutProps, ChatLayout, type ChatLayoutBrand, type ChatLayoutMenuItem, type ChatLayoutProps, LandingLayout, type LandingLayoutProps, type LayoutComponent, type LayoutRegistry, type LoginBrand, LoginLayout, type LoginLayoutProps, collectDefaultOpenKeys, createLayoutRegistry, findMenuChain, registerBuiltinLayouts, resolveLayout };
@@ -79,6 +79,62 @@ interface LandingLayoutProps {
79
79
  footer?: ReactNode;
80
80
  children?: ReactNode;
81
81
  }
82
+ /** ChatLayout 菜单项(显式 menu 数据驱动;registry 推导时由 router MenuItem 映射) */
83
+ interface ChatLayoutMenuItem {
84
+ key: string;
85
+ label: string;
86
+ /** 图标名(Icon 白名单,kebab/Pascal 均可) */
87
+ icon?: string;
88
+ /** label 后的角标 */
89
+ badge?: string | number;
90
+ /** label 右侧的状态圆点 */
91
+ dot?: boolean;
92
+ /** 分组标题(相邻同组只渲染一次) */
93
+ group?: string;
94
+ /** 置灰不可选 */
95
+ disabled?: boolean;
96
+ /** 路由路径(registry 推导时来自 MenuItem.path;bridge 导航与 active 推导用) */
97
+ path?: string;
98
+ }
99
+ /** ChatLayout 品牌区(与 Sidebar 品牌区同构:{ title, logo? } 对象或任意 ReactNode) */
100
+ type ChatLayoutBrand = {
101
+ title: string;
102
+ logo?: string;
103
+ } | ReactNode;
104
+ /**
105
+ * ChatLayout props(设计决策 D7):聊天场景外壳布局——
106
+ * 品牌区 + 菜单侧栏 + 主内容区。
107
+ *
108
+ * 菜单来源优先级:`sidebar` 槽 > `menu` 显式数据 > `registry` 推导 > 空侧栏。
109
+ * 导航行为:`onMenuSelect` 提供时调用之;否则有 `bridge` 且项有 `path` 时
110
+ * `bridge.push(path)`。高亮推导:`activeMenuKey` > `route` > `bridge` 订阅。
111
+ */
112
+ interface ChatLayoutProps {
113
+ /** 品牌区({ title, logo } 对象或任意 ReactNode) */
114
+ brand?: ChatLayoutBrand;
115
+ /** 显式菜单数据;提供时优先于 registry 推导 */
116
+ menu?: ChatLayoutMenuItem[];
117
+ /** 菜单注册表(app-shell 注入);无 menu 时据此推导菜单 */
118
+ registry?: MenuRegistry;
119
+ /** 导航桥(app-shell 注入);默认导航与 active 推导用 */
120
+ bridge?: NavigationBridge;
121
+ /** 路由上下文(测试友好,优先于 bridge 订阅) */
122
+ route?: RouteContext;
123
+ /** 权限检查器(registry 推导时过滤菜单) */
124
+ permissionChecker?: PermissionChecker;
125
+ /** 受控高亮项 key(优先于 route/bridge 推导) */
126
+ activeMenuKey?: string;
127
+ /** 菜单项点击回调(disabled 项不触发);提供时替代默认导航 */
128
+ onMenuSelect?: (key: string, item: ChatLayoutMenuItem) => void;
129
+ /** 桌面端可折叠为 icon rail(透传 Sidebar;缺省 false) */
130
+ collapsible?: boolean;
131
+ /** 自由侧栏槽(提供时替代内建菜单) */
132
+ sidebar?: ReactNode;
133
+ /** 侧栏底部固定槽(渲染在滚动区之后,不随内容滚动) */
134
+ sidebarFooter?: ReactNode;
135
+ /** 主内容区 */
136
+ children?: ReactNode;
137
+ }
82
138
 
83
139
  /**
84
140
  * 菜单链(设计决策 D2):沿可见树查找 menuId 的父链,
@@ -98,7 +154,7 @@ declare function findMenuChain(registry: MenuRegistry, menuId: string): MenuItem
98
154
  declare function collectDefaultOpenKeys(registry: MenuRegistry, activeMenuId?: string): string[];
99
155
 
100
156
  /**
101
- * ShadcnAdminLayout:与 pactor-layout 的 AdminLayout(antd 版)契约一致——
157
+ * AdminLayout:内置默认 UI 实现的管理后台布局——
102
158
  * 复用 `AdminLayoutProps`;Header(brand + headerExtra)/ Sidebar / 内容出口;
103
159
  * config 开关(header/sidebar 缺省开,tabs/breadcrumb/footer 缺省关)一致;
104
160
  * mode(top-side/top-bottom/side-full/two-column)、fixedHeader/fixedSider、
@@ -112,47 +168,69 @@ declare function collectDefaultOpenKeys(registry: MenuRegistry, activeMenuId?: s
112
168
  * 样式:Tailwind 工具类读取 shadcn 语义令牌(bg-background / border-border /
113
169
  * text-muted-foreground …),结构钩子用 data-slot 属性。
114
170
  */
115
- declare function ShadcnAdminLayout({ config, brand, registry, bridge, route: routeProp, permissionChecker, headerExtra, children, }: AdminLayoutProps): React.JSX.Element;
171
+ declare function AdminLayout({ config, brand, registry, bridge, route: routeProp, permissionChecker, headerExtra, children, }: AdminLayoutProps): React.JSX.Element;
172
+
173
+ /**
174
+ * BlankLayout:内置默认 UI 实现的无壳布局——
175
+ * 直接渲染 children(带最小页面容器样式)。
176
+ */
177
+ declare function BlankLayout({ children }: BlankLayoutProps): React.JSX.Element;
116
178
 
117
179
  /**
118
- * ShadcnBlankLayout:与 pactor-layout 的 BlankLayout(antd 版)契约一致——
119
- * 无壳布局,直接渲染 children(带最小页面容器样式)。
180
+ * ChatLayout(设计决策 D7):聊天场景外壳布局——
181
+ * 品牌区 + 菜单侧栏 + 主内容区,基于 ui `Sidebar` + `Menu` 组件组合。
182
+ *
183
+ * 菜单来源优先级(高 → 低):
184
+ * 1. `sidebar` 槽:自由侧栏内容,整体替代内建菜单;
185
+ * 2. `menu` 显式数据:调用方直接提供菜单项(含 icon/badge/dot/group/disabled);
186
+ * 3. `registry` 推导:app-shell 注入的 MenuRegistry 可见树
187
+ * (group 类型项 → 分组标签,page/link → 菜单项,permissionChecker 过滤);
188
+ * 4. 空侧栏:以上均无时不渲染侧栏,主区通栏。
189
+ *
190
+ * 导航行为:`onMenuSelect` 提供时调用之(disabled 项不触发);
191
+ * 否则有 `bridge` 且项有 `path` 时 `bridge.push(path)`。
192
+ *
193
+ * 高亮推导优先级:`activeMenuKey` > `route`(测试友好)>
194
+ * `bridge` 订阅 location 按 `path === pathname` 命中。
195
+ *
196
+ * 与 chat 包的 `ChatLayout`(header + ChatView 极简布局)不同,
197
+ * 本组件是带侧栏菜单的完整外壳,两者不冲突(不同包导出)。
120
198
  */
121
- declare function ShadcnBlankLayout({ children }: BlankLayoutProps): React.JSX.Element;
199
+ declare function ChatLayout({ brand, menu, registry, bridge, route: routeProp, permissionChecker, activeMenuKey, onMenuSelect, collapsible, sidebar, sidebarFooter, children, }: ChatLayoutProps): React.JSX.Element;
122
200
 
123
201
  /**
124
- * ShadcnLoginLayout:与 pactor-layout 的 LoginLayout(antd 版)契约一致——
125
- * 登录页外壳,只负责品牌区与表单出口的布局,不含任何认证逻辑。
202
+ * LoginLayout:内置默认 UI 实现的登录页外壳——
203
+ * 只负责品牌区与表单出口的布局,不含任何认证逻辑。
126
204
  * variant center:居中卡片(vendored shadcn Card);split:左品牌右表单
127
205
  * (缺省 center)。
128
206
  */
129
- declare function ShadcnLoginLayout({ variant, brand, children, }: LoginLayoutProps): React.JSX.Element;
207
+ declare function LoginLayout({ variant, brand, children, }: LoginLayoutProps): React.JSX.Element;
130
208
 
131
209
  /**
132
- * ShadcnLandingLayout:与 pactor-layout 的 LandingLayout(antd 版)契约一致——
133
- * 落地页外壳,可选 navbar / footer 插槽,children 为主内容区。
210
+ * LandingLayout:内置默认 UI 实现的落地页外壳——
211
+ * 可选 navbar / footer 插槽,children 为主内容区。
134
212
  */
135
- declare function ShadcnLandingLayout({ navbar, footer, children, }: LandingLayoutProps): React.JSX.Element;
213
+ declare function LandingLayout({ navbar, footer, children, }: LandingLayoutProps): React.JSX.Element;
136
214
 
137
215
  /** 布局组件类型(各布局 props 不同,注册表按通用组件存储) */
138
216
  type LayoutComponent = ComponentType<any>;
139
217
  /** LayoutRegistry:布局类型名 → 布局组件(复用 core Registry) */
140
218
  type LayoutRegistry = Registry<LayoutComponent>;
141
219
  /**
142
- * registerShadcnLayouts:向 LayoutRegistry 注册 shadcn 实现的四种布局
143
- * (类型名:admin / blank / login / landing)。
220
+ * registerBuiltinLayouts:向 LayoutRegistry 注册内置实现的五种布局
221
+ * (类型名:admin / blank / login / landing / chat)。
144
222
  */
145
- declare function registerShadcnLayouts(registry: LayoutRegistry): void;
223
+ declare function registerBuiltinLayouts(registry: LayoutRegistry): void;
146
224
  /**
147
- * createShadcnLayoutRegistry(设计决策 D5):预注册 shadcn 版
148
- * admin / blank / login / landing 四种布局组件。
225
+ * createLayoutRegistry(设计决策 D5):预注册内置版
226
+ * admin / blank / login / landing / chat 五种布局组件。
149
227
  * 业务可继续 register 自定义布局类型。
150
228
  */
151
- declare function createShadcnLayoutRegistry(): LayoutRegistry;
229
+ declare function createLayoutRegistry(): LayoutRegistry;
152
230
  /**
153
231
  * resolveLayout(设计决策 D5):按类型名解析布局组件;
154
- * 未命中返回 ShadcnBlankLayout 并 console.warn(不抛错,不崩页面)。
232
+ * 未命中返回 BlankLayout 并 console.warn(不抛错,不崩页面)。
155
233
  */
156
234
  declare function resolveLayout(registry: LayoutRegistry, type: string): LayoutComponent;
157
235
 
158
- export { type AdminBrand, type AdminLayoutBreakpoint, type AdminLayoutConfig, type AdminLayoutMode, type AdminLayoutProps, type BlankLayoutProps, type LandingLayoutProps, type LayoutComponent, type LayoutRegistry, type LoginBrand, type LoginLayoutProps, ShadcnAdminLayout, ShadcnBlankLayout, ShadcnLandingLayout, ShadcnLoginLayout, collectDefaultOpenKeys, createShadcnLayoutRegistry, findMenuChain, registerShadcnLayouts, resolveLayout };
236
+ export { type AdminBrand, AdminLayout, type AdminLayoutBreakpoint, type AdminLayoutConfig, type AdminLayoutMode, type AdminLayoutProps, BlankLayout, type BlankLayoutProps, ChatLayout, type ChatLayoutBrand, type ChatLayoutMenuItem, type ChatLayoutProps, LandingLayout, type LandingLayoutProps, type LayoutComponent, type LayoutRegistry, type LoginBrand, LoginLayout, type LoginLayoutProps, collectDefaultOpenKeys, createLayoutRegistry, findMenuChain, registerBuiltinLayouts, resolveLayout };
@@ -1,25 +1,27 @@
1
1
  import {
2
- ShadcnAdminLayout,
3
- ShadcnBlankLayout,
4
- ShadcnLandingLayout,
5
- ShadcnLoginLayout,
2
+ AdminLayout,
3
+ BlankLayout,
4
+ ChatLayout,
5
+ LandingLayout,
6
+ LoginLayout,
6
7
  collectDefaultOpenKeys,
7
- createShadcnLayoutRegistry,
8
+ createLayoutRegistry,
8
9
  findMenuChain,
9
- registerShadcnLayouts,
10
+ registerBuiltinLayouts,
10
11
  resolveLayout
11
- } from "../chunk-GV5R6TUT.js";
12
- import "../chunk-6JNCDPGS.js";
13
- import "../chunk-GL7IO22L.js";
12
+ } from "../chunk-22TEN3ER.js";
13
+ import "../chunk-HJPHJKVA.js";
14
+ import "../chunk-2LYMCWEJ.js";
14
15
  import "../chunk-RQHJBTEU.js";
15
16
  export {
16
- ShadcnAdminLayout,
17
- ShadcnBlankLayout,
18
- ShadcnLandingLayout,
19
- ShadcnLoginLayout,
17
+ AdminLayout,
18
+ BlankLayout,
19
+ ChatLayout,
20
+ LandingLayout,
21
+ LoginLayout,
20
22
  collectDefaultOpenKeys,
21
- createShadcnLayoutRegistry,
23
+ createLayoutRegistry,
22
24
  findMenuChain,
23
- registerShadcnLayouts,
25
+ registerBuiltinLayouts,
24
26
  resolveLayout
25
27
  };
package/dist/ui/index.js CHANGED
@@ -164,10 +164,6 @@ import {
164
164
  Toggle,
165
165
  ToggleGroup,
166
166
  ToggleGroupItem,
167
- Tooltip,
168
- TooltipContent,
169
- TooltipProvider,
170
- TooltipTrigger,
171
167
  Typography,
172
168
  badgeVariants,
173
169
  chartColor,
@@ -177,7 +173,7 @@ import {
177
173
  toggleVariants,
178
174
  typographyVariants,
179
175
  useCarousel
180
- } from "../chunk-BVHAP22U.js";
176
+ } from "../chunk-Q5NUGUJG.js";
181
177
  import {
182
178
  Button,
183
179
  Dialog,
@@ -216,8 +212,12 @@ import {
216
212
  CardTitle,
217
213
  Popover,
218
214
  PopoverContent,
219
- PopoverTrigger
220
- } from "../chunk-GL7IO22L.js";
215
+ PopoverTrigger,
216
+ Tooltip,
217
+ TooltipContent,
218
+ TooltipProvider,
219
+ TooltipTrigger
220
+ } from "../chunk-2LYMCWEJ.js";
221
221
  import "../chunk-RQHJBTEU.js";
222
222
  export {
223
223
  Accordion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pactor-app/ui",
3
- "version": "1.1.0",
3
+ "version": "1.2.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",
@@ -104,10 +104,10 @@
104
104
  "recharts": "^3.10.1",
105
105
  "tailwind-merge": "^3.6.0",
106
106
  "vaul": "^1.1.2",
107
- "@pactor-app/permission": "1.1.0",
108
- "@pactor-app/runtime": "1.1.0",
109
- "@pactor-app/core": "1.1.0",
110
- "@pactor-app/router": "1.1.0"
107
+ "@pactor-app/core": "1.2.0",
108
+ "@pactor-app/router": "1.2.0",
109
+ "@pactor-app/permission": "1.2.0",
110
+ "@pactor-app/runtime": "1.2.0"
111
111
  },
112
112
  "peerDependencies": {
113
113
  "react": ">=18",
@@ -1,257 +0,0 @@
1
- import {
2
- cn
3
- } from "./chunk-RQHJBTEU.js";
4
-
5
- // src/components/components/Icon/index.tsx
6
- import {
7
- ArrowDown,
8
- ArrowLeft,
9
- ArrowRight,
10
- ArrowUp,
11
- Bell,
12
- Bookmark,
13
- Brain,
14
- Briefcase,
15
- Building2,
16
- Calendar,
17
- Camera,
18
- ChartColumn,
19
- Check,
20
- ChevronDown,
21
- ChevronLeft,
22
- ChevronRight,
23
- ChevronsUpDown,
24
- ChevronUp,
25
- CircleAlert,
26
- CircleCheck,
27
- CircleQuestionMark,
28
- CircleX,
29
- Clock,
30
- Cloud,
31
- Code,
32
- Copy,
33
- CreditCard,
34
- Database,
35
- Download,
36
- Ellipsis,
37
- EllipsisVertical,
38
- ExternalLink,
39
- Eye,
40
- File,
41
- FileText,
42
- Flag,
43
- Folder,
44
- Funnel,
45
- Globe,
46
- Heart,
47
- History,
48
- House,
49
- Image,
50
- Info,
51
- Key,
52
- Languages,
53
- LayoutGrid,
54
- Link,
55
- List,
56
- ListFilter,
57
- LoaderCircle,
58
- Lock,
59
- LockOpen,
60
- LogIn,
61
- LogOut,
62
- Mail,
63
- MapPin,
64
- Menu,
65
- MessageCircle,
66
- MessageSquare,
67
- Minus,
68
- Moon,
69
- Package,
70
- PanelLeft,
71
- PanelRightOpen,
72
- Paperclip,
73
- Pencil,
74
- Phone,
75
- Plus,
76
- Quote,
77
- RefreshCcw,
78
- RotateCcw,
79
- Save,
80
- Search,
81
- Send,
82
- Settings,
83
- Share2,
84
- Shield,
85
- ShoppingCart,
86
- Square,
87
- SquarePen,
88
- Star,
89
- Sun,
90
- Table,
91
- Tag,
92
- Terminal,
93
- ThumbsDown,
94
- ThumbsUp,
95
- Trash2,
96
- TriangleAlert,
97
- Upload,
98
- User,
99
- Users,
100
- X,
101
- Zap
102
- } from "lucide-react";
103
- import { jsx } from "react/jsx-runtime";
104
- var ICONS = {
105
- "arrow-left": ArrowLeft,
106
- "arrow-right": ArrowRight,
107
- "arrow-up": ArrowUp,
108
- "arrow-down": ArrowDown,
109
- "chevron-left": ChevronLeft,
110
- "chevron-right": ChevronRight,
111
- "chevron-up": ChevronUp,
112
- "chevron-down": ChevronDown,
113
- check: Check,
114
- x: X,
115
- plus: Plus,
116
- minus: Minus,
117
- search: Search,
118
- settings: Settings,
119
- user: User,
120
- users: Users,
121
- home: House,
122
- menu: Menu,
123
- bell: Bell,
124
- calendar: Calendar,
125
- clock: Clock,
126
- download: Download,
127
- upload: Upload,
128
- pencil: Pencil,
129
- edit: SquarePen,
130
- trash: Trash2,
131
- eye: Eye,
132
- info: Info,
133
- warning: TriangleAlert,
134
- error: CircleAlert,
135
- "check-circle": CircleCheck,
136
- "x-circle": CircleX,
137
- "help-circle": CircleQuestionMark,
138
- loading: LoaderCircle,
139
- spinner: LoaderCircle,
140
- star: Star,
141
- heart: Heart,
142
- bookmark: Bookmark,
143
- share: Share2,
144
- copy: Copy,
145
- "external-link": ExternalLink,
146
- link: Link,
147
- mail: Mail,
148
- phone: Phone,
149
- lock: Lock,
150
- unlock: LockOpen,
151
- "log-in": LogIn,
152
- "log-out": LogOut,
153
- sun: Sun,
154
- moon: Moon,
155
- globe: Globe,
156
- filter: Funnel,
157
- "list-filter": ListFilter,
158
- "more-horizontal": Ellipsis,
159
- "more-vertical": EllipsisVertical,
160
- refresh: RefreshCcw,
161
- save: Save,
162
- file: File,
163
- folder: Folder,
164
- image: Image,
165
- camera: Camera,
166
- chart: ChartColumn,
167
- table: Table,
168
- list: List,
169
- grid: LayoutGrid,
170
- tag: Tag,
171
- "shopping-cart": ShoppingCart,
172
- "credit-card": CreditCard,
173
- package: Package,
174
- "map-pin": MapPin,
175
- building: Building2,
176
- briefcase: Briefcase,
177
- send: Send,
178
- message: MessageCircle,
179
- "message-square": MessageSquare,
180
- paperclip: Paperclip,
181
- "thumbs-up": ThumbsUp,
182
- "thumbs-down": ThumbsDown,
183
- zap: Zap,
184
- flag: Flag,
185
- key: Key,
186
- shield: Shield,
187
- terminal: Terminal,
188
- code: Code,
189
- database: Database,
190
- cloud: Cloud,
191
- languages: Languages,
192
- // @pactor-app/chat 收敛(spec: chat-icon-convergence):chat 既有图标与
193
- // 契约图标名(menu.icon / messageActions[].icon 的既有取值)直通
194
- "chevrons-up-down": ChevronsUpDown,
195
- "file-text": FileText,
196
- "panel-left": PanelLeft,
197
- "panel-right-open": PanelRightOpen,
198
- square: Square,
199
- history: History,
200
- "rotate-ccw": RotateCcw,
201
- quote: Quote,
202
- chat: MessageSquare,
203
- brain: Brain
204
- };
205
- function normalizeIconName(name) {
206
- return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[_\s]+/g, "-").toLowerCase();
207
- }
208
- var sizePx = {
209
- sm: 16,
210
- default: 20,
211
- lg: 24
212
- };
213
- function Icon({
214
- name,
215
- size = "default",
216
- color,
217
- strokeWidth,
218
- className,
219
- style
220
- }) {
221
- const key = name ? normalizeIconName(name) : "";
222
- const Lucide = ICONS[key];
223
- const px = typeof size === "number" ? size : sizePx[size];
224
- if (!Lucide) {
225
- return /* @__PURE__ */ jsx(
226
- CircleQuestionMark,
227
- {
228
- "data-slot": "icon",
229
- "data-unknown": name,
230
- size: px,
231
- color,
232
- strokeWidth,
233
- className: cn("shrink-0 text-muted-foreground", className),
234
- style,
235
- "aria-hidden": "true"
236
- }
237
- );
238
- }
239
- return /* @__PURE__ */ jsx(
240
- Lucide,
241
- {
242
- "data-slot": "icon",
243
- size: px,
244
- color,
245
- strokeWidth,
246
- className: cn("shrink-0", className),
247
- style,
248
- "aria-hidden": "true"
249
- }
250
- );
251
- }
252
-
253
- export {
254
- ICONS,
255
- normalizeIconName,
256
- Icon
257
- };