@pactor-app/ui 0.1.0 → 1.1.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,7 +1,36 @@
1
1
  import { ComponentRegistry } from '@pactor-app/runtime';
2
2
  import * as React from 'react';
3
- import { ReactNode } from 'react';
4
- import { DslNode } from '@pactor-app/core';
3
+ import { CSSProperties, ReactNode, ReactElement } from 'react';
4
+ import { DslNode, DslChildren } from '@pactor-app/core';
5
+ import { LucideIcon } from 'lucide-react';
6
+ import { t as toggleVariants, b as typographyVariants } from '../typography-DsGdDBc2.js';
7
+ import { VariantProps } from 'class-variance-authority';
8
+ import 'class-variance-authority/types';
9
+ import '@base-ui/react/toggle';
10
+
11
+ /** 手风琴面板;`children` 为 DSL 子树,经 Renderer children 机制渲染 */
12
+ interface AccordionItemData {
13
+ key: string;
14
+ title: string;
15
+ children?: DslNode[];
16
+ }
17
+ interface AccordionProps {
18
+ /** 面板列表(可含表达式解析后的数组) */
19
+ items?: AccordionItemData[];
20
+ /** 允许收起全部面板(契约兼容字段;Base UI single 模式天然允许收起) */
21
+ collapsible?: boolean;
22
+ /** 允许多个面板同时展开 */
23
+ multiple?: boolean;
24
+ /** 通用:根节点 class(与内置样式合并) */
25
+ className?: string;
26
+ /** 通用:根节点内联样式 */
27
+ style?: CSSProperties;
28
+ }
29
+ /**
30
+ * Accordion 适配器(shadcn kit):items 声明面板,pane 内容经
31
+ * renderChildren 渲染 DSL 子树;multiple 切换单开/多开模式。
32
+ */
33
+ declare function Accordion({ items, multiple, className, style, }: AccordionProps): React.JSX.Element;
5
34
 
6
35
  /** DSL Alert 变体 */
7
36
  type AlertVariant = 'success' | 'info' | 'warning' | 'error';
@@ -12,9 +41,105 @@ interface AlertProps {
12
41
  description?: string;
13
42
  /** 变体,默认 info */
14
43
  variant?: AlertVariant;
44
+ /** 通用:根节点 class(与内置样式合并) */
45
+ className?: string;
46
+ /** 通用:根节点内联样式 */
47
+ style?: CSSProperties;
15
48
  }
16
49
  /** Alert 适配器(shadcn kit):message → AlertTitle,description → AlertDescription */
17
- declare function Alert({ message, description, variant }: AlertProps): React.JSX.Element;
50
+ declare function Alert({ message, description, variant, className, style }: AlertProps): React.JSX.Element;
51
+
52
+ interface AlertDialogProps {
53
+ /** 标题 */
54
+ title?: string;
55
+ /** 说明内容 */
56
+ description?: string;
57
+ /** 确认按钮文案(缺省取 i18n `pactor.alertDialog.confirm`,与 InteractionProvider confirm 一致) */
58
+ confirmText?: string;
59
+ /** 取消按钮文案(缺省取 i18n `pactor.alertDialog.cancel`) */
60
+ cancelText?: string;
61
+ /** 受控开关(可绑表达式);缺省时由 trigger 自管理 */
62
+ open?: boolean;
63
+ /** 确认事件:点击确认按钮触发,且弹层关闭 */
64
+ onConfirm?: () => void;
65
+ /** 取消事件:点击取消按钮触发,且弹层关闭 */
66
+ onCancel?: () => void;
67
+ /** 触发元素(DSL 子树,非受控用法下点击打开) */
68
+ trigger?: DslNode;
69
+ /** 通用:根节点 class(挂在弹层内容根节点,与内置样式合并) */
70
+ className?: string;
71
+ /** 通用:内联样式(同 className 挂载规则) */
72
+ style?: CSSProperties;
73
+ }
74
+ /**
75
+ * AlertDialog 适配器(shadcn kit):确认/取消按钮语义化封装——
76
+ * 点击确认先执行 onConfirm 再关闭(Action 为 Base UI Close,
77
+ * 关闭由原语完成);取消同理执行 onCancel。与 vendored dialog
78
+ * 共享 Backdrop/Popup,视觉与 OverlayHost modal 一致(design D4)。
79
+ */
80
+ declare function AlertDialog({ title, description, confirmText, cancelText, open, onConfirm, onCancel, trigger, className, style, }: AlertDialogProps): React.JSX.Element;
81
+
82
+ interface AspectRatioProps {
83
+ /** 宽高比(如 16/9,数字或 `'16/9'` 字符串),默认 1 */
84
+ ratio?: number | string;
85
+ /** 内容(DSL 子树,经 Renderer children 机制渲染,按比例约束) */
86
+ children?: ReactNode;
87
+ /** 通用:根节点 class(与内置样式合并) */
88
+ className?: string;
89
+ /** 通用:根节点内联样式 */
90
+ style?: CSSProperties;
91
+ }
92
+ /** AspectRatio 适配器(shadcn kit):ratio → CSS aspect-ratio 容器 */
93
+ declare function AspectRatio({ ratio, children, className, style }: AspectRatioProps): React.JSX.Element;
94
+
95
+ interface AvatarProps {
96
+ /** 图片地址 */
97
+ src?: string;
98
+ /** 图片替代文本 */
99
+ alt?: string;
100
+ /** 加载失败或缺省时的占位文本(如首字母) */
101
+ fallback?: string;
102
+ /** 通用:根节点 class(与内置样式合并) */
103
+ className?: string;
104
+ /** 通用:根节点内联样式 */
105
+ style?: CSSProperties;
106
+ }
107
+ /** Avatar 适配器(shadcn kit):src / alt / fallback → vendored Avatar */
108
+ declare function Avatar({ src, alt, fallback, className, style }: AvatarProps): React.JSX.Element;
109
+
110
+ /** DSL Badge 变体 */
111
+ type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline';
112
+ interface BadgeProps {
113
+ /** 徽标文本 */
114
+ text?: string;
115
+ /** 变体,默认 default */
116
+ variant?: BadgeVariant;
117
+ /** 通用:根节点 class(与内置样式合并) */
118
+ className?: string;
119
+ /** 通用:根节点内联样式 */
120
+ style?: CSSProperties;
121
+ }
122
+ /** Badge 适配器(shadcn kit):text / variant → vendored Badge */
123
+ declare function Badge({ text, variant, className, style }: BadgeProps): React.JSX.Element;
124
+
125
+ /** 面包屑项;href 缺省时渲染为纯文本 */
126
+ interface BreadcrumbItemData {
127
+ label: string;
128
+ href?: string;
129
+ }
130
+ interface BreadcrumbProps {
131
+ /** 路径项(可含表达式解析后的数组);末项始终为当前页纯文本 */
132
+ items?: BreadcrumbItemData[];
133
+ /** 通用:根节点 class(与内置样式合并) */
134
+ className?: string;
135
+ /** 通用:根节点内联样式 */
136
+ style?: CSSProperties;
137
+ }
138
+ /**
139
+ * Breadcrumb 适配器(shadcn kit):items 声明路径,带 href 的非末项
140
+ * 渲染为可点击链接,末项渲染为当前页纯文本(aria-current="page")。
141
+ */
142
+ declare function Breadcrumb({ items, className, style }: BreadcrumbProps): React.JSX.Element;
18
143
 
19
144
  /** DSL Button 变体(框架级协议) */
20
145
  type ButtonVariant = 'default' | 'primary' | 'dashed' | 'link' | 'text';
@@ -34,6 +159,10 @@ interface ButtonProps {
34
159
  submit?: boolean;
35
160
  /** 点击事件(Renderer 绑定 events.onClick) */
36
161
  onClick?: () => void;
162
+ /** 通用:根节点 class(与内置样式合并) */
163
+ className?: string;
164
+ /** 通用:根节点内联样式 */
165
+ style?: CSSProperties;
37
166
  children?: ReactNode;
38
167
  }
39
168
  /**
@@ -42,17 +171,504 @@ interface ButtonProps {
42
171
  * Form 的提交按钮(type=submit);danger 映射 destructive(link/text
43
172
  * 变体保持原样、文字标红);loading 显示旋转图标并禁用。
44
173
  */
45
- declare function Button({ text, variant, danger, size, loading, disabled, submit, onClick, children, }: ButtonProps): React.JSX.Element;
174
+ declare function Button({ text, variant, danger, size, loading, disabled, submit, onClick, className, style, children, }: ButtonProps): React.JSX.Element;
175
+
176
+ interface ButtonGroupProps {
177
+ /** 通用:根节点 class(与内置样式合并) */
178
+ className?: string;
179
+ /** 通用:根节点内联样式 */
180
+ style?: CSSProperties;
181
+ /** 若干 Button(渲染好的 ReactNode) */
182
+ children?: ReactNode;
183
+ }
184
+ /** ButtonGroup 适配器(shadcn kit):children 为若干 Button,渲染为相连按钮组 */
185
+ declare function ButtonGroup({ className, style, children }: ButtonGroupProps): React.JSX.Element;
186
+
187
+ /** DSL 校验规则(框架级协议,当前支持 required + message) */
188
+ interface FieldRule {
189
+ required?: boolean;
190
+ message?: string;
191
+ }
192
+ interface InputProps {
193
+ /** 字段名;在 Form 内声明 name 即自动成为表单项 */
194
+ name?: string;
195
+ /** 表单项标签 */
196
+ label?: string;
197
+ /** 校验规则 */
198
+ rules?: FieldRule[];
199
+ /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
200
+ value?: string;
201
+ /** 输入类型:password 时掩码输入(缺省 text) */
202
+ type?: 'text' | 'password';
203
+ placeholder?: string;
204
+ disabled?: boolean;
205
+ /** 输入事件,传出 string 值(非原生 event,设计决策 D2) */
206
+ onChange?: (value: string) => void;
207
+ /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件本身) */
208
+ className?: string;
209
+ /** 通用:根节点内联样式(同 className 的挂载规则) */
210
+ style?: CSSProperties;
211
+ }
212
+ /**
213
+ * Input 适配器(shadcn kit,语义对齐 antd 版):
214
+ * 在 Form 内且声明 `name` 时自动成为表单项(label / rules 生效,
215
+ * 值由 Form 上下文托管);否则渲染独立受控控件,onChange 传出 string。
216
+ * 表单项为去原语化结构(design D3):`<div data-slot="form-item">` +
217
+ * `<label htmlFor>` 与控件 `useId` 关联。
218
+ */
219
+ declare function Input({ name, label, rules, value, type, placeholder, disabled, onChange, className, style, }: InputProps): React.JSX.Element;
220
+
221
+ interface CalendarProps {
222
+ /** 字段名;在 Form 内声明 name 即自动成为表单项 */
223
+ name?: string;
224
+ /** 表单项标签 */
225
+ label?: string;
226
+ /** 校验规则 */
227
+ rules?: FieldRule[];
228
+ /** 选择模式(当前仅支持 single) */
229
+ mode?: 'single';
230
+ /** 受控值(ISO 日期字符串 yyyy-MM-dd);Form 内作为字段初始值 */
231
+ value?: string;
232
+ disabled?: boolean;
233
+ /** 选中日期事件,传出 ISO 日期字符串(yyyy-MM-dd),清除传 undefined */
234
+ onChange?: (value: string | undefined) => void;
235
+ /** 通用:根节点 class(Form 内为 form-item 容器) */
236
+ className?: string;
237
+ /** 通用:根节点内联样式(同 className 的挂载规则) */
238
+ style?: CSSProperties;
239
+ }
240
+ /**
241
+ * Calendar 适配器(shadcn kit):基于 vendored Calendar(react-day-picker);
242
+ * DSL 值为 ISO 日期字符串(yyyy-MM-dd),onChange 同样传出 ISO 字符串
243
+ * (DSL 语义值,非 Date 对象);Form 内声明 `name` 自动成为表单项。
244
+ */
245
+ declare function Calendar({ name, label, rules, mode, value, disabled, onChange, className, style, }: CalendarProps): React.JSX.Element;
46
246
 
47
247
  interface CardProps {
48
248
  /** 卡片标题,可选 */
49
249
  title?: string;
50
250
  /** 是否有边框,默认 true(false 去边框与阴影) */
51
251
  bordered?: boolean;
252
+ /** 通用:根节点 class(与内置样式合并) */
253
+ className?: string;
254
+ /** 通用:根节点内联样式(布局逃逸口,如 `{ flex: 1 }`) */
255
+ style?: CSSProperties;
52
256
  children?: ReactNode;
53
257
  }
54
258
  /** Card 适配器(shadcn kit):可选标题 + 边框开关(bordered=false 去边框与阴影) */
55
- declare function Card({ title, bordered, children }: CardProps): React.JSX.Element;
259
+ declare function Card({ title, bordered, className, style, children }: CardProps): React.JSX.Element;
260
+
261
+ /** 轮播图片项 */
262
+ interface CarouselImage {
263
+ src: string;
264
+ alt?: string;
265
+ }
266
+ /** Carousel items 元素:图片对象或 DSL 子树 */
267
+ type CarouselItemData = CarouselImage | DslNode;
268
+ interface CarouselProps {
269
+ /** 轮播项:图片 `{ src, alt }` 数组或 DSL 子树数组(经 renderChildren 渲染) */
270
+ items?: CarouselItemData[];
271
+ /** 循环滚动 */
272
+ loop?: boolean;
273
+ /** 自动播放:true 用默认间隔(3000ms),数字为间隔毫秒数 */
274
+ autoplay?: boolean | number;
275
+ /** 通用:根节点 class(与内置样式合并) */
276
+ className?: string;
277
+ /** 通用:根节点内联样式 */
278
+ style?: CSSProperties;
279
+ }
280
+ /**
281
+ * Carousel 适配器(shadcn kit):基于 vendored Carousel(embla-carousel-react);
282
+ * items 支持图片对象或 DSL 子树;`loop` 映射 embla loop;
283
+ * `autoplay` 以定时器驱动 scrollNext(loop 时回绕),不引入额外插件依赖。
284
+ */
285
+ declare function Carousel({ items, loop, autoplay, className, style, }: CarouselProps): React.JSX.Element;
286
+
287
+ interface CheckboxProps {
288
+ /** 字段名;在 Form 内声明 name 即自动成为表单项 */
289
+ name?: string;
290
+ /** 勾选框旁的标签文本 */
291
+ label?: string;
292
+ /** 校验规则 */
293
+ rules?: FieldRule[];
294
+ /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
295
+ value?: boolean;
296
+ disabled?: boolean;
297
+ /** 勾选变化事件,传出 boolean */
298
+ onChange?: (checked: boolean) => void;
299
+ /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件包裹) */
300
+ className?: string;
301
+ /** 通用:根节点内联样式(同 className 的挂载规则) */
302
+ style?: CSSProperties;
303
+ }
304
+ /**
305
+ * Checkbox 适配器(shadcn kit):基于 vendored Checkbox(Base UI);
306
+ * label 渲染在勾选框旁并与之关联;onChange 传出 boolean。
307
+ */
308
+ declare function Checkbox({ name, label, rules, value, disabled, onChange, className, style, }: CheckboxProps): React.JSX.Element;
309
+
310
+ interface CollapsibleProps {
311
+ /** 触发区标题 */
312
+ title?: string;
313
+ /** 受控开关(可绑 `${state.x}` 表达式);缺省内部自管理 */
314
+ open?: boolean;
315
+ /** 折叠内容(DSL 子树,经 Renderer children 机制渲染) */
316
+ children?: ReactNode;
317
+ /** 通用:根节点 class(与内置样式合并) */
318
+ className?: string;
319
+ /** 通用:根节点内联样式 */
320
+ style?: CSSProperties;
321
+ }
322
+ /**
323
+ * Collapsible 适配器(shadcn kit):title 触发区 + children 折叠内容;
324
+ * open 受控(缺省内部自管理)。
325
+ */
326
+ declare function Collapsible({ title, open, children, className, style, }: CollapsibleProps): React.JSX.Element;
327
+
328
+ /** Combobox 选项(支持表达式解析后的数组) */
329
+ interface ComboboxOption {
330
+ label: string;
331
+ value: string | number;
332
+ disabled?: boolean;
333
+ }
334
+ interface ComboboxProps {
335
+ /** 字段名;在 Form 内声明 name 即自动成为表单项 */
336
+ name?: string;
337
+ /** 表单项标签 */
338
+ label?: string;
339
+ /** 校验规则 */
340
+ rules?: FieldRule[];
341
+ /** 选项列表 */
342
+ options?: ComboboxOption[];
343
+ /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
344
+ value?: string | number;
345
+ placeholder?: string;
346
+ /** 是否可搜索过滤(缺省 true) */
347
+ searchable?: boolean;
348
+ disabled?: boolean;
349
+ /** 选中变化事件,传出选中项的原始 value */
350
+ onChange?: (value: string | number | undefined) => void;
351
+ /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为触发器) */
352
+ className?: string;
353
+ /** 通用:根节点内联样式(同 className 的挂载规则) */
354
+ style?: CSSProperties;
355
+ }
356
+ /**
357
+ * Combobox 适配器(shadcn kit):vendored Combobox(Popover + Command 组合);
358
+ * 支持搜索过滤;onChange 传出选中项原始 value(DSL 语义值);
359
+ * Form 内声明 `name` 自动成为表单项。
360
+ */
361
+ declare function Combobox({ name, label, rules, options, value, placeholder, searchable, disabled, onChange, className, style, }: ComboboxProps): React.JSX.Element;
362
+
363
+ /** Command 命令项 */
364
+ interface CommandItemData {
365
+ label: string;
366
+ value: string;
367
+ /** 图标名(Icon 白名单,kebab/Pascal 均可),渲染于文字前 */
368
+ icon?: string;
369
+ disabled?: boolean;
370
+ }
371
+ /** Command 分组 */
372
+ interface CommandGroupData {
373
+ heading?: string;
374
+ items: CommandItemData[];
375
+ }
376
+ interface CommandProps {
377
+ /** 分组列表 */
378
+ groups?: CommandGroupData[];
379
+ /** 搜索框占位文本 */
380
+ placeholder?: string;
381
+ /** 空结果文案(缺省取 i18n `pactor.command.empty`) */
382
+ emptyText?: string;
383
+ /** 选中事件,传出选中项 value */
384
+ onSelect?: (value: string) => void;
385
+ /** 通用:根节点 class(与内置样式合并) */
386
+ className?: string;
387
+ /** 通用:根节点内联样式 */
388
+ style?: CSSProperties;
389
+ }
390
+ /**
391
+ * Command 适配器(shadcn kit):基于 vendored Command(cmdk);
392
+ * 支持搜索过滤(按 value 与 label 匹配);onSelect 传出选中项 value
393
+ * (DSL 语义值)。
394
+ */
395
+ declare function Command({ groups, placeholder, emptyText, onSelect, className, style, }: CommandProps): React.JSX.Element;
396
+
397
+ /** 图表类型 */
398
+ type ChartType = 'line' | 'bar' | 'area' | 'pie';
399
+ interface ChartProps {
400
+ /** 图表类型:line / bar / area / pie */
401
+ chartType: ChartType;
402
+ /** 数据数组(通常为 `${data.xxx}` 表达式解析结果) */
403
+ data?: Record<string, unknown>[];
404
+ /** 类目/名称字段(pie 时为切片 name 字段) */
405
+ xKey?: string;
406
+ /** 数值字段(多系列传多个;pie 取第一个作为 value 字段) */
407
+ yKeys?: string[];
408
+ /** 系列颜色(按序循环),缺省使用 chart-1..5 语义令牌 */
409
+ colors?: string[];
410
+ /** 通用:根节点 class(与内置样式合并) */
411
+ className?: string;
412
+ /** 通用:根节点内联样式 */
413
+ style?: CSSProperties;
414
+ }
415
+ /**
416
+ * Chart 适配器(shadcn kit,recharts 薄封装):以受限框架级 props
417
+ * (chartType / data / xKey / yKeys / colors)渲染 line/bar/area/pie
418
+ * 图表,不透传 recharts 自由组合 API;缺省配色取 chart-1..5 令牌;
419
+ * 多系列(yKeys > 1)或 pie 时渲染 Legend。
420
+ */
421
+ declare function Chart({ chartType, data, xKey, yKeys, colors, className, style, }: ChartProps): React.JSX.Element;
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
+
468
+ interface ContentProps {
469
+ /** 通用:根节点 class(与内置样式合并) */
470
+ className?: string;
471
+ /** 通用:根节点内联样式 */
472
+ style?: CSSProperties;
473
+ children?: ReactNode;
474
+ }
475
+ /**
476
+ * Content 主内容区(shadcn kit,语义对齐 antd Layout.Content):
477
+ * 纯语义容器,`flex: 1` 占据 Layout 中的剩余空间。
478
+ */
479
+ declare function Content({ className, style, children }: ContentProps): React.JSX.Element;
480
+
481
+ /** 菜单项;danger 项以 destructive 语义呈现 */
482
+ interface ContextMenuItemData {
483
+ label: string;
484
+ value: string;
485
+ disabled?: boolean;
486
+ danger?: boolean;
487
+ /** 图标名(Icon 白名单,kebab/Pascal 均可),渲染于文字前 */
488
+ icon?: string;
489
+ }
490
+ interface ContextMenuProps {
491
+ /** 菜单项(可含表达式解析后的数组) */
492
+ items?: ContextMenuItemData[];
493
+ /** 选中事件,传出选中项 value */
494
+ onSelect?: (value: string) => void;
495
+ /** 右键作用区域(DSL 子树,经 Renderer children 机制渲染) */
496
+ children?: ReactNode;
497
+ /** 通用:根节点 class(挂在弹出内容根节点,与内置样式合并) */
498
+ className?: string;
499
+ /** 通用:内联样式(同 className 挂载规则) */
500
+ style?: CSSProperties;
501
+ }
502
+ /**
503
+ * ContextMenu 适配器(shadcn kit):children 为右键作用区域;
504
+ * 菜单项点击触发 onSelect 并传出该项 value。
505
+ */
506
+ declare function ContextMenu({ items, onSelect, children, className, style, }: ContextMenuProps): React.JSX.Element;
507
+
508
+ /**
509
+ * 列定义;`children`(别名 `renderChildren`)为单元格自定义渲染 DSL 子树,
510
+ * 经 Renderer 子作用域渲染,作用域注入 `row`(当前行记录)与 `rowIndex`
511
+ * (当前页内序号),语义与 Table 的 `cell` 一致。
512
+ */
513
+ interface DataTableColumn {
514
+ key: string;
515
+ title?: string;
516
+ /** 可排序:点击表头切换升/降序(客户端排序 + onSort 回调) */
517
+ sortable?: boolean;
518
+ /** 可筛选:表头提供筛选输入(客户端包含匹配) */
519
+ filterable?: boolean;
520
+ children?: DslNode[];
521
+ /** 契约兼容别名:同 children */
522
+ renderChildren?: DslNode[];
523
+ }
524
+ /** 排序方向 */
525
+ type DataTableSortOrder = 'asc' | 'desc';
526
+ /** 排序状态(onSort 事件参数同形) */
527
+ interface DataTableSort {
528
+ key: string;
529
+ order: DataTableSortOrder;
530
+ }
531
+ /** DSL 分页配置:false 关闭,`{ pageSize }` 简化映射 */
532
+ type DataTablePagination = false | {
533
+ pageSize?: number;
534
+ };
535
+ interface DataTableProps {
536
+ columns?: DataTableColumn[];
537
+ /** 数据行(通常为 `${data.xxx}` 表达式解析结果) */
538
+ rows?: Record<string, unknown>[];
539
+ /** 行 key 字段,默认 'id' */
540
+ rowKey?: string;
541
+ pagination?: DataTablePagination;
542
+ /** 受控初始排序(后续点击表头内部维护) */
543
+ sort?: DataTableSort;
544
+ /** 排序变化事件,传出 `{ key, order }` */
545
+ onSort?: (sort: DataTableSort) => void;
546
+ /** 分页变化事件,传出页码 number */
547
+ onPageChange?: (page: number) => void;
548
+ /** 通用:根节点 class(与内置样式合并) */
549
+ className?: string;
550
+ /** 通用:根节点内联样式 */
551
+ style?: CSSProperties;
552
+ }
553
+ /**
554
+ * DataTable 适配器(shadcn kit):在既有 Table 语义之上的一体化数据表——
555
+ * sortable 列表头点击切换升/降序(客户端排序 + onSort 传 `{ key, order }`)、
556
+ * filterable 列提供表头筛选输入(客户端包含匹配)、分页复用 Table 分页行为
557
+ * (onPageChange 传页码);cell 自定义渲染沿用 row/rowIndex 作用域语义。
558
+ */
559
+ declare function DataTable({ columns, rows, rowKey, pagination, sort, onSort, onPageChange, className, style, }: DataTableProps): React.JSX.Element;
560
+
561
+ interface DialogProps {
562
+ /** 对话框标题 */
563
+ title?: string;
564
+ /** 辅助说明 */
565
+ description?: string;
566
+ /** 受控开关(可绑 `${state.x}` 表达式);缺省时由 trigger 自管理 */
567
+ open?: boolean;
568
+ /** 关闭事件(X / 遮罩 / Escape 任一途径关闭时触发) */
569
+ onClose?: () => void;
570
+ /** 触发元素(DSL 子树,非受控用法下点击打开) */
571
+ trigger?: DslNode;
572
+ /** 内容(DSL 子树,经 Renderer children 机制渲染) */
573
+ children?: ReactNode;
574
+ /** 通用:根节点 class(挂在弹层内容根节点,与内置样式合并) */
575
+ className?: string;
576
+ /** 通用:内联样式(同 className 挂载规则) */
577
+ style?: CSSProperties;
578
+ }
579
+ /**
580
+ * Dialog 适配器(shadcn kit):受控 `open`(表达式绑定)+ `onClose`;
581
+ * 非受控时可用 `trigger` DSL 子树作触发元素。与交互层 OverlayHost
582
+ * 的 modal 共用同一套 vendored dialog 原语(design D4)。
583
+ */
584
+ declare function Dialog({ title, description, open, onClose, trigger, children, className, style, }: DialogProps): React.JSX.Element;
585
+
586
+ type DrawerPlacement = 'left' | 'right' | 'top' | 'bottom';
587
+ interface DrawerProps {
588
+ /** 抽屉标题 */
589
+ title?: string;
590
+ /** 受控开关(可绑 `${state.x}` 表达式) */
591
+ open?: boolean;
592
+ /** 滑出方向,缺省 right */
593
+ placement?: DrawerPlacement;
594
+ /** 关闭事件(遮罩 / Escape / 拖拽关闭时触发) */
595
+ onClose?: () => void;
596
+ /** 内容(DSL 子树,经 Renderer children 机制渲染) */
597
+ children?: ReactNode;
598
+ /** 通用:根节点 class(挂在抽屉内容根节点,与内置样式合并) */
599
+ className?: string;
600
+ /** 通用:内联样式(同 className 挂载规则) */
601
+ style?: CSSProperties;
602
+ }
603
+ /**
604
+ * Drawer 适配器(shadcn kit,vaul 原语):受控 `open` + `placement`
605
+ * 四方向;与交互层 OverlayHost 的 drawer 共用同一套 vendored
606
+ * drawer 原语(design D4)。
607
+ */
608
+ declare function Drawer({ title, open, placement, onClose, children, className, style, }: DrawerProps): React.JSX.Element;
609
+
610
+ /** 菜单项;danger 项以 destructive 语义呈现 */
611
+ interface DropdownMenuItemData {
612
+ label: string;
613
+ value: string;
614
+ disabled?: boolean;
615
+ danger?: boolean;
616
+ /** 图标名(Icon 白名单,kebab/Pascal 均可),渲染于文字前 */
617
+ icon?: string;
618
+ }
619
+ interface DropdownMenuProps {
620
+ /** 菜单项(可含表达式解析后的数组) */
621
+ items?: DropdownMenuItemData[];
622
+ /** 选中事件,传出选中项 value */
623
+ onSelect?: (value: string) => void;
624
+ /** 触发元素(DSL 子树,经 Renderer children 机制渲染) */
625
+ children?: ReactNode;
626
+ /** 通用:根节点 class(挂在弹出内容根节点,与内置样式合并) */
627
+ className?: string;
628
+ /** 通用:内联样式(同 className 挂载规则) */
629
+ style?: CSSProperties;
630
+ }
631
+ /**
632
+ * DropdownMenu 适配器(shadcn kit):children 为触发元素(以 span
633
+ * 包装接入 Base UI Trigger,避免按钮嵌套按钮);菜单项点击触发
634
+ * onSelect 并传出该项 value。
635
+ */
636
+ declare function DropdownMenu({ items, onSelect, children, className, style, }: DropdownMenuProps): React.JSX.Element;
637
+
638
+ interface EmptyProps {
639
+ /** 空状态标题 */
640
+ title?: string;
641
+ /** 辅助说明文案 */
642
+ description?: string;
643
+ /** 操作区(DSL 子树,经 Renderer children 机制渲染) */
644
+ children?: ReactNode;
645
+ /** 通用:根节点 class(与内置样式合并) */
646
+ className?: string;
647
+ /** 通用:根节点内联样式 */
648
+ style?: CSSProperties;
649
+ }
650
+ /** Empty 适配器(shadcn kit):title / description + 可选 children 操作区 */
651
+ declare function Empty({ title, description, children, className, style }: EmptyProps): React.JSX.Element;
652
+
653
+ interface FieldProps {
654
+ /** 表单项标签 */
655
+ label?: string;
656
+ /** 辅助说明文案 */
657
+ description?: string;
658
+ /** 错误文案(声明式展示,如校验失败信息) */
659
+ error?: string;
660
+ /** 控件 DSL 子树(经 Renderer children 机制渲染) */
661
+ children?: ReactNode;
662
+ /** 通用:根节点 class(与内置样式合并) */
663
+ className?: string;
664
+ /** 通用:根节点内联样式 */
665
+ style?: CSSProperties;
666
+ }
667
+ /**
668
+ * Field 适配器(shadcn kit):通用表单项容器(Base UI Field 封装);
669
+ * label / description / error 为框架级 props,error 声明式强制展示。
670
+ */
671
+ declare function Field({ label, description, error, children, className, style }: FieldProps): React.JSX.Element;
56
672
 
57
673
  interface FlexProps {
58
674
  /** 主轴方向,默认 horizontal */
@@ -63,10 +679,27 @@ interface FlexProps {
63
679
  justify?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
64
680
  /** 交叉轴对齐 */
65
681
  align?: 'start' | 'center' | 'end' | 'baseline' | 'stretch';
682
+ /** 通用:根节点 class(与内置样式合并) */
683
+ className?: string;
684
+ /** 通用:根节点内联样式(布局逃逸口,如 `{ flex: 1 }`;与数字 gap 合并) */
685
+ style?: CSSProperties;
66
686
  children?: ReactNode;
67
687
  }
68
688
  /** Flex 布局(shadcn kit):方向 / 对齐映射 Tailwind 工具类,数字 gap 内联 */
69
- declare function Flex({ direction, gap, justify, align, children, }: FlexProps): React.JSX.Element;
689
+ declare function Flex({ direction, gap, justify, align, className, style, children, }: FlexProps): React.JSX.Element;
690
+
691
+ interface FooterProps {
692
+ /** 通用:根节点 class(与内置样式合并) */
693
+ className?: string;
694
+ /** 通用:根节点内联样式 */
695
+ style?: CSSProperties;
696
+ children?: ReactNode;
697
+ }
698
+ /**
699
+ * Footer 底部区域(shadcn kit,语义对齐 antd Layout.Footer):
700
+ * 纯语义容器,默认居中、弱化的辅助文本样式。
701
+ */
702
+ declare function Footer({ className, style, children }: FooterProps): React.JSX.Element;
70
703
 
71
704
  interface FormProps {
72
705
  /** 表单名(缺省 'default'):`form.setValues` 联动动作按名寻址 */
@@ -75,6 +708,10 @@ interface FormProps {
75
708
  layout?: 'horizontal' | 'vertical' | 'inline';
76
709
  /** 表单初始值(创建时生效;字段级 value 优先于 initialValues[name]) */
77
710
  initialValues?: Record<string, unknown>;
711
+ /** 通用:根节点 class(与内置样式合并) */
712
+ className?: string;
713
+ /** 通用:根节点内联样式 */
714
+ style?: CSSProperties;
78
715
  children?: ReactNode;
79
716
  /** 提交事件(校验通过后触发),参数为表单 values */
80
717
  onSubmit?: (values: Record<string, unknown>) => void;
@@ -91,63 +728,522 @@ interface FormProps {
91
728
  * 2. 校验通过把 values 写入 runtime state 的 `form` 路径(`${form.<field>}` 可用)
92
729
  * 3. 以 values 调用 onSubmit(Renderer 把它放入 `event` 作用域)
93
730
  */
94
- declare function Form({ name, layout, initialValues, children, onSubmit, onValuesChange, }: FormProps): React.JSX.Element;
731
+ declare function Form({ name, layout, initialValues, className, style, children, onSubmit, onValuesChange, }: FormProps): React.JSX.Element;
95
732
 
96
733
  interface GridProps {
97
734
  /** 列数,默认 1;每列等宽(columns 取整下限 1) */
98
735
  columns?: number;
99
736
  /** 栏间距 */
100
737
  gap?: number;
738
+ /** 通用:根节点 class(与内置样式合并) */
739
+ className?: string;
740
+ /** 通用:根节点内联样式(布局逃逸口;与 columns / gap 生成的样式合并,同键后者优先) */
741
+ style?: CSSProperties;
101
742
  children?: ReactNode;
102
743
  }
103
744
  /**
104
745
  * Grid 均分栏布局(shadcn kit):CSS grid。
105
746
  * 列数为运行时动态值,无法用 Tailwind 静态类表达,经 inline style 设置。
106
747
  */
107
- declare function Grid({ columns, gap, children }: GridProps): React.JSX.Element;
748
+ declare function Grid({ columns, gap, className, style, children }: GridProps): React.JSX.Element;
108
749
 
109
- /** DSL 校验规则(框架级协议,当前支持 required + message) */
110
- interface FieldRule {
111
- required?: boolean;
112
- message?: string;
750
+ /** 品牌区位置(缺省 'left') */
751
+ type HeaderBrandPosition = 'left' | 'right';
752
+ /** 通用下拉项 */
753
+ interface HeaderDropdownItem {
754
+ label: string;
755
+ value: string;
756
+ disabled?: boolean;
757
+ /** 图标名(Icon 白名单,kebab/Pascal 均可),渲染于文字前 */
758
+ icon?: string;
113
759
  }
114
- interface InputProps {
760
+ /** 通用下拉区配置 */
761
+ interface HeaderDropdown {
762
+ label: string;
763
+ items: HeaderDropdownItem[];
764
+ /** 渲染位置(缺省 'left') */
765
+ position?: 'left' | 'right';
766
+ }
767
+ /** 菜单项;`children` 为弹出式子菜单 */
768
+ interface HeaderMenuItem {
769
+ key: string;
770
+ label: string;
771
+ /** 图标名(Icon 白名单,kebab/Pascal 均可),渲染于文字前 */
772
+ icon?: string;
773
+ children?: HeaderMenuItem[];
774
+ }
775
+ /** 用户区菜单项 */
776
+ interface HeaderUserItem {
777
+ label: string;
778
+ value: string;
779
+ /** 图标名(Icon 白名单,kebab/Pascal 均可),渲染于文字前 */
780
+ icon?: string;
781
+ }
782
+ /** 用户区配置;`items` 缺省或为空时退化为纯展示(无下拉) */
783
+ interface HeaderUser {
784
+ name: string;
785
+ avatar?: string;
786
+ items?: HeaderUserItem[];
787
+ }
788
+ /** 语言选项 */
789
+ interface HeaderLocale {
790
+ label: string;
791
+ value: string;
792
+ }
793
+ interface HeaderProps {
794
+ /** 品牌区 logo 图片地址(可含表达式) */
795
+ logo?: string;
796
+ /** 品牌区标题文本 */
797
+ title?: string;
798
+ /** 品牌区位置(缺省 'left') */
799
+ brandPosition?: HeaderBrandPosition;
800
+ /** 通用下拉区 */
801
+ dropdown?: HeaderDropdown;
802
+ /** 横向菜单(可含表达式),语义复用 horizontal Menu(含子菜单) */
803
+ menu?: HeaderMenuItem[];
804
+ /** 用户区 */
805
+ user?: HeaderUser;
806
+ /** 国际化切换选项 */
807
+ locales?: HeaderLocale[];
808
+ /** 菜单选中事件,传出选中项 key */
809
+ onMenuSelect?: (key: string) => void;
810
+ /** 通用下拉选中事件,传出选中项 value */
811
+ onDropdownSelect?: (value: string) => void;
812
+ /** 用户区菜单选中事件,传出选中项 value */
813
+ onUserSelect?: (value: string) => void;
814
+ /** 语言切换事件,传出选中的 locale 值 */
815
+ onLocaleChange?: (locale: string) => void;
816
+ /** 通用:根节点 class(与内置样式合并) */
817
+ className?: string;
818
+ /** 通用:根节点内联样式 */
819
+ style?: CSSProperties;
820
+ children?: ReactNode;
821
+ }
822
+ /**
823
+ * Header 顶部区域(shadcn kit,语义对齐 antd Layout.Header):
824
+ * 横向 flex、垂直居中、默认下边框。除 children 外可携带五个可选结构
825
+ * 区域(品牌区 / 通用下拉 / 横向菜单 / 用户区 / 国际化切换);全部区域
826
+ * props 缺省时退化为纯容器。
827
+ *
828
+ * 排布固定:左区(品牌?→下拉?→菜单?)— flex-1 中区(children)—
829
+ * 右区(下拉?→品牌?→locales→user)。区域内部直接组合 src/ui 原语
830
+ * (dropdown-menu / avatar),事件值透传给 Header 自身的事件 props。
831
+ */
832
+ declare function Header({ logo, title, brandPosition, dropdown, menu, user, locales, onMenuSelect, onDropdownSelect, onUserSelect, onLocaleChange, className, style, children, }: HeaderProps): React.JSX.Element;
833
+
834
+ interface HoverCardProps {
835
+ /** 悬浮卡片内容:DSL 子树(对象,原样保留至渲染层求值)或纯文本 */
836
+ content?: DslNode | string;
837
+ /** 触发元素(DSL 子树,经 Renderer children 机制渲染) */
838
+ children?: ReactNode;
839
+ /** 通用:根节点 class(挂在卡片浮层根节点,与内置样式合并) */
840
+ className?: string;
841
+ /** 通用:内联样式(同 className 挂载规则) */
842
+ style?: CSSProperties;
843
+ }
844
+ /**
845
+ * HoverCard 适配器(shadcn kit):children 为触发元素(span 包装接入
846
+ * Base UI Trigger),悬浮显示 content 富内容卡片(支持 DSL 子树)。
847
+ */
848
+ declare function HoverCard({ content, children, className, style }: HoverCardProps): React.JSX.Element;
849
+
850
+ /**
851
+ * 常用图标白名单(lucide-react 静态导入,可 tree-shake):
852
+ * key 为 kebab-case 名(DSL 侧同时接受 PascalCase,见 normalizeIconName)。
853
+ * 未列出的图标按需在此补充一行导入 + 一行映射。
854
+ */
855
+ declare const ICONS: Record<string, LucideIcon>;
856
+ /** DSL Icon 尺寸(数字直接作 px) */
857
+ type IconSize = 'sm' | 'default' | 'lg' | number;
858
+ interface IconProps {
859
+ /** 图标名:kebab-case(如 'arrow-right')或 PascalCase(如 'ArrowRight'),见 ICONS 白名单 */
860
+ name?: string;
861
+ /** 尺寸:'sm' 16 / 'default' 20 / 'lg' 24,或数字 px(缺省 default) */
862
+ size?: IconSize;
863
+ /** 颜色(CSS 颜色值,缺省 currentColor 跟随文本色) */
864
+ color?: string;
865
+ /** 描边宽度(lucide 缺省 2) */
866
+ strokeWidth?: number;
867
+ /** 通用:根节点 class(与内置样式合并) */
868
+ className?: string;
869
+ /** 通用:根节点内联样式 */
870
+ style?: CSSProperties;
871
+ }
872
+ /** kebab-case / camelCase / PascalCase 统一归一为 kebab-case 白名单键 */
873
+ declare function normalizeIconName(name: string): string;
874
+ /**
875
+ * Icon 适配器(shadcn kit):按 name 从 lucide 白名单渲染图标。
876
+ * 未知名渲染占位图标(help-circle)并标 `data-unknown`,不抛错
877
+ * (与 chat messageActions 图标白名单同约定)。
878
+ */
879
+ declare function Icon({ name, size, color, strokeWidth, className, style, }: IconProps): React.JSX.Element;
880
+
881
+ interface InputGroupProps {
882
+ /** 通用:根节点 class(与内置样式合并) */
883
+ className?: string;
884
+ /** 通用:根节点内联样式 */
885
+ style?: CSSProperties;
886
+ /** Input 与前后缀元素(Text/Button,渲染好的 ReactNode) */
887
+ children?: ReactNode;
888
+ }
889
+ /**
890
+ * InputGroup 适配器(shadcn kit):children 为 Input 与前后缀元素
891
+ * (Text/Button),渲染为组合输入框;内部 Input 的边框/焦点环由
892
+ * 容器样式消化。
893
+ */
894
+ declare function InputGroup({ className, style, children }: InputGroupProps): React.JSX.Element;
895
+
896
+ interface InputOTPProps {
115
897
  /** 字段名;在 Form 内声明 name 即自动成为表单项 */
116
898
  name?: string;
117
899
  /** 表单项标签 */
118
900
  label?: string;
119
901
  /** 校验规则 */
120
902
  rules?: FieldRule[];
121
- /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
903
+ /** OTP 位数(缺省 6) */
904
+ length?: number;
905
+ /** 受控值(独立渲染时生效);Form 内作为字段初始值 */
122
906
  value?: string;
123
- /** 输入类型:password 时掩码输入(缺省 text) */
124
- type?: 'text' | 'password';
125
- placeholder?: string;
126
907
  disabled?: boolean;
127
- /** 输入事件,传出 string 值(非原生 event,设计决策 D2) */
908
+ /** 输入事件,传出当前字符串 */
128
909
  onChange?: (value: string) => void;
910
+ /** 输入满 length 位时触发,传出完整 OTP 字符串 */
911
+ onComplete?: (value: string) => void;
912
+ /** 通用:根节点 class(Form 内为 form-item 容器) */
913
+ className?: string;
914
+ /** 通用:根节点内联样式(同 className 的挂载规则) */
915
+ style?: CSSProperties;
129
916
  }
130
917
  /**
131
- * Input 适配器(shadcn kit,语义对齐 antd 版):
132
- * Form 内且声明 `name` 时自动成为表单项(label / rules 生效,
133
- * 值由 Form 上下文托管);否则渲染独立受控控件,onChange 传出 string。
134
- * 表单项为去原语化结构(design D3):`<div data-slot="form-item">` +
135
- * `<label htmlFor>` 与控件 `useId` 关联。
918
+ * InputOTP 适配器(shadcn kit):基于 vendored InputOTP(input-otp);
919
+ * onChange 传出当前字符串、onComplete 传出完整 OTP(DSL 语义值);
920
+ * Form 内声明 `name` 自动成为表单项。独立渲染时内部维护输入态
921
+ * (value prop 作为初始值/受控镜像)。
922
+ */
923
+ declare function InputOTP({ name, label, rules, length, value, disabled, onChange, onComplete, className, style, }: InputOTPProps): React.JSX.Element;
924
+
925
+ interface ItemProps {
926
+ /** 标题 */
927
+ title?: string;
928
+ /** 描述文本 */
929
+ description?: string;
930
+ /** 媒体区(DSL 子树,经 renderChildren 渲染) */
931
+ media?: DslNode | DslNode[];
932
+ /** 操作区(DSL 子树,经 renderChildren 渲染) */
933
+ actions?: DslNode[];
934
+ /** 通用:根节点 class(与内置样式合并) */
935
+ className?: string;
936
+ /** 通用:根节点内联样式 */
937
+ style?: CSSProperties;
938
+ }
939
+ /**
940
+ * Item 适配器(shadcn kit):media / title+description / actions 三段式
941
+ * 列表项;media 与 actions 为 DSL 子树,经 renderChildren 渲染。
942
+ */
943
+ declare function Item({ title, description, media, actions, className, style, }: ItemProps): React.JSX.Element;
944
+
945
+ interface KbdProps {
946
+ /** 按键文本(如 ⌘K) */
947
+ text?: string;
948
+ /** 通用:根节点 class(与内置样式合并) */
949
+ className?: string;
950
+ /** 通用:根节点内联样式 */
951
+ style?: CSSProperties;
952
+ }
953
+ /** Kbd 适配器(shadcn kit):text → vendored Kbd */
954
+ declare function Kbd({ text, className, style }: KbdProps): React.JSX.Element;
955
+
956
+ interface LabelProps {
957
+ /** 标签文本 */
958
+ text?: string;
959
+ /** 关联控件 id(label htmlFor) */
960
+ htmlFor?: string;
961
+ /** 通用:根节点 class(与内置样式合并) */
962
+ className?: string;
963
+ /** 通用:根节点内联样式 */
964
+ style?: CSSProperties;
965
+ }
966
+ /** Label 适配器(shadcn kit):独立使用的表单标签 */
967
+ declare function Label({ text, htmlFor, className, style }: LabelProps): React.JSX.Element;
968
+
969
+ interface LayoutProps {
970
+ /**
971
+ * 主轴方向;缺省按直接子节点推导:含 Sider 时为 horizontal,
972
+ * 否则 vertical(对齐 antd Layout 语义);显式提供时覆盖推导
973
+ */
974
+ direction?: 'horizontal' | 'vertical';
975
+ /** 通用:根节点 class(与内置样式合并) */
976
+ className?: string;
977
+ /** 通用:根节点内联样式 */
978
+ style?: CSSProperties;
979
+ /** 内部:withScope 注册时由 Renderer 传入的原始 DSL 子树(可为动态引用) */
980
+ dslChildren?: DslChildren;
981
+ }
982
+ /**
983
+ * Layout 布局容器(shadcn kit,语义对齐 antd Layout):flex 容器。
984
+ * 方向推导基于直接子节点的 DSL 类型;`component` 引用解析到子树根类型
985
+ * (页面级命名组件里放 Sider 同样计入推导)。动态引用(DslSourceRef)
986
+ * 形态无法静态推导方向,按 vertical 处理(可用 direction 显式指定)。
987
+ */
988
+ declare function Layout({ direction, className, style, dslChildren }: LayoutProps): React.JSX.Element;
989
+
990
+ interface LinkProps {
991
+ /** 链接地址(可含表达式) */
992
+ href?: string;
993
+ /** 链接文本;也可用 children */
994
+ text?: string;
995
+ /** 打开方式(`_blank` 新窗口等) */
996
+ target?: '_blank' | '_self' | '_parent' | '_top';
997
+ /** 通用:根节点 class(与内置样式合并) */
998
+ className?: string;
999
+ /** 通用:根节点内联样式 */
1000
+ style?: CSSProperties;
1001
+ children?: ReactNode;
1002
+ }
1003
+ /**
1004
+ * Link 链接(shadcn kit):渲染原生 `<a href>`——自然跳转,
1005
+ * 目标可以是宿主任意路由(嵌入模式的主要跳转方式,见
1006
+ * spec: embedded-page-view 的「自然跳转」)。
136
1007
  */
137
- declare function Input({ name, label, rules, value, type, placeholder, disabled, onChange, }: InputProps): React.JSX.Element;
1008
+ declare function Link({ href, text, target, className, style, children }: LinkProps): React.JSX.Element;
1009
+
1010
+ /** 菜单项;`children` 为子菜单(inline 模式下缩进展示) */
1011
+ interface MenuItem {
1012
+ key: string;
1013
+ label: string;
1014
+ /** 图标名(Icon 白名单,kebab/Pascal 均可),渲染于文字前 */
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;
1024
+ children?: MenuItem[];
1025
+ }
1026
+ interface MenuProps {
1027
+ /** 菜单项(可含表达式,如 `${data.menus}`) */
1028
+ items?: MenuItem[];
1029
+ /** 展示模式:inline(Sider 内纵向,缺省)| horizontal(Header 内横向) */
1030
+ mode?: 'inline' | 'horizontal';
1031
+ /** 受控选中项 key(可绑 `${state.x}`) */
1032
+ selectedKey?: string;
1033
+ /** 选中变化事件,传出选中项 key */
1034
+ onSelect?: (key: string) => void;
1035
+ /** 通用:根节点 class(与内置样式合并) */
1036
+ className?: string;
1037
+ /** 通用:根节点内联样式(同 className 挂载规则) */
1038
+ style?: CSSProperties;
1039
+ }
1040
+ /**
1041
+ * Menu 导航菜单(shadcn kit):哑渲染组件——items 经表达式注入,
1042
+ * 不直接读取外壳层 MenuRegistry;选中态受控(selectedKey + onSelect
1043
+ * 闭环,典型接 navigate 动作)。在 Sidebar 内且侧栏折叠(icon rail)
1044
+ * 时自动降级为仅图标(label / badge / dot / 分组隐藏,hover 经 RailTooltip 展示)。
1045
+ */
1046
+ declare function Menu({ items, mode, selectedKey, onSelect, className, style, }: MenuProps): React.JSX.Element;
1047
+
1048
+ /** 菜单项(叶子);value 为 onSelect 传出值 */
1049
+ interface MenubarLeafItem {
1050
+ label: string;
1051
+ value: string;
1052
+ disabled?: boolean;
1053
+ /** 图标名(Icon 白名单,kebab/Pascal 均可),渲染于文字前 */
1054
+ icon?: string;
1055
+ }
1056
+ /** 一级菜单(嵌套叶子项) */
1057
+ interface MenubarMenuData {
1058
+ label: string;
1059
+ items: MenubarLeafItem[];
1060
+ }
1061
+ interface MenubarProps {
1062
+ /** 菜单组(可含表达式解析后的数组) */
1063
+ menus?: MenubarMenuData[];
1064
+ /** 选中事件,传出选中项 value */
1065
+ onSelect?: (value: string) => void;
1066
+ /** 通用:根节点 class(与内置样式合并) */
1067
+ className?: string;
1068
+ /** 通用:根节点内联样式 */
1069
+ style?: CSSProperties;
1070
+ }
1071
+ /**
1072
+ * Menubar 适配器(shadcn kit):menus 声明嵌套菜单,叶子项点击
1073
+ * 触发 onSelect 并传出该项 value(DSL 语义值,非 DOM 事件)。
1074
+ */
1075
+ declare function Menubar({ menus, onSelect, className, style }: MenubarProps): React.JSX.Element;
1076
+
1077
+ /** 子链接项 */
1078
+ interface NavigationMenuChildItem {
1079
+ label: string;
1080
+ href: string;
1081
+ description?: string;
1082
+ /** 图标名(Icon 白名单,kebab/Pascal 均可),渲染于文字前 */
1083
+ icon?: string;
1084
+ }
1085
+ /** 导航项:href 直链,或 children 下拉面板 */
1086
+ interface NavigationMenuItemData {
1087
+ label: string;
1088
+ href?: string;
1089
+ /** 图标名(Icon 白名单,kebab/Pascal 均可),渲染于文字前 */
1090
+ icon?: string;
1091
+ children?: NavigationMenuChildItem[];
1092
+ }
1093
+ interface NavigationMenuProps {
1094
+ /** 导航项(可含表达式解析后的数组) */
1095
+ items?: NavigationMenuItemData[];
1096
+ /** 通用:根节点 class(与内置样式合并) */
1097
+ className?: string;
1098
+ /** 通用:根节点内联样式 */
1099
+ style?: CSSProperties;
1100
+ }
1101
+ /**
1102
+ * NavigationMenu 适配器(shadcn kit):items 声明一级导航;
1103
+ * 含 children 的项渲染为触发器 + 下拉面板(链接含 description),
1104
+ * 仅含 href 的项渲染为直链。
1105
+ */
1106
+ declare function NavigationMenu({ items, className, style }: NavigationMenuProps): React.JSX.Element;
138
1107
 
139
1108
  interface PageProps {
140
1109
  /** 页面标题,可选 */
141
1110
  title?: string;
1111
+ /** 通用:根节点 class(与内置样式合并) */
1112
+ className?: string;
1113
+ /** 通用:根节点内联样式(布局逃逸口) */
1114
+ style?: CSSProperties;
142
1115
  children?: ReactNode;
143
1116
  }
144
1117
  /** Page 容器(shadcn kit):可选标题 + 内容区(纵向节奏 space-y-5) */
145
- declare function Page({ title, children }: PageProps): React.JSX.Element;
1118
+ declare function Page({ title, className, style, children }: PageProps): React.JSX.Element;
1119
+
1120
+ interface PaginationProps {
1121
+ /** 总条数(可绑表达式解析后的数字) */
1122
+ total?: number;
1123
+ /** 每页条数,缺省 10 */
1124
+ pageSize?: number;
1125
+ /** 受控当前页(可绑 `${state.x}`);缺省内部自管理 */
1126
+ page?: number;
1127
+ /** 翻页事件,传出目标页码(number) */
1128
+ onChange?: (page: number) => void;
1129
+ /** 通用:根节点 class(与内置样式合并) */
1130
+ className?: string;
1131
+ /** 通用:根节点内联样式 */
1132
+ style?: CSSProperties;
1133
+ }
1134
+ /**
1135
+ * Pagination 适配器(shadcn kit):total/pageSize 推页数;page 受控
1136
+ * (缺省内部自管理);onChange 传出目标页码 number。上一页/下一页
1137
+ * 与页码点击均走同一 onChange。
1138
+ */
1139
+ declare function Pagination({ total, pageSize, page, onChange, className, style, }: PaginationProps): React.JSX.Element;
1140
+
1141
+ interface PopoverProps {
1142
+ /** 浮层内容:DSL 子树(对象,原样保留至渲染层求值)或纯文本 */
1143
+ content?: DslNode | string;
1144
+ /** 触发元素(DSL 子树,经 Renderer children 机制渲染) */
1145
+ children?: ReactNode;
1146
+ /** 通用:根节点 class(挂在浮层内容根节点,与内置样式合并) */
1147
+ className?: string;
1148
+ /** 通用:内联样式(同 className 挂载规则) */
1149
+ style?: CSSProperties;
1150
+ }
1151
+ /**
1152
+ * Popover 适配器(shadcn kit):children 为触发元素(span 包装接入
1153
+ * Base UI Trigger);content 支持 DSL 子树或纯文本。
1154
+ */
1155
+ declare function Popover({ content, children, className, style }: PopoverProps): React.JSX.Element;
1156
+
1157
+ interface ProgressProps {
1158
+ /** 百分比(0-100,可为表达式解析后的数字);undefined / null 为不确定态 */
1159
+ value?: number | null;
1160
+ /** 通用:根节点 class(与内置样式合并) */
1161
+ className?: string;
1162
+ /** 通用:根节点内联样式 */
1163
+ style?: CSSProperties;
1164
+ }
1165
+ /** Progress 适配器(shadcn kit):value(0-100)→ vendored Progress(Base UI) */
1166
+ declare function Progress({ value, className, style }: ProgressProps): React.JSX.Element;
1167
+
1168
+ /** RadioGroup 选项 */
1169
+ interface RadioGroupOption {
1170
+ label: string;
1171
+ value: string | number | boolean;
1172
+ /** 单个选项禁用 */
1173
+ disabled?: boolean;
1174
+ }
1175
+ interface RadioGroupProps {
1176
+ /** 字段名;在 Form 内声明 name 即自动成为表单项 */
1177
+ name?: string;
1178
+ /** 表单项标签 */
1179
+ label?: string;
1180
+ /** 校验规则 */
1181
+ rules?: FieldRule[];
1182
+ /** 选项列表 */
1183
+ options?: RadioGroupOption[];
1184
+ /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
1185
+ value?: string | number | boolean;
1186
+ disabled?: boolean;
1187
+ /** 选中变化事件,传出选中项的 value */
1188
+ onChange?: (value: string | number | boolean) => void;
1189
+ /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件包裹) */
1190
+ className?: string;
1191
+ /** 通用:根节点内联样式(同 className 的挂载规则) */
1192
+ style?: CSSProperties;
1193
+ }
1194
+ /**
1195
+ * RadioGroup 适配器(shadcn kit):基于 vendored RadioGroup(Base UI);
1196
+ * Base UI RadioGroup 的 value 原生支持 string/number/boolean,
1197
+ * onChange 传出选中项原始 value。
1198
+ */
1199
+ declare function RadioGroup({ name, label, rules, options, value, disabled, onChange, className, style, }: RadioGroupProps): React.JSX.Element;
1200
+
1201
+ /** 可拖拽面板;`children` 为 DSL 子树,经 renderChildren 渲染 */
1202
+ interface ResizablePanelData {
1203
+ children?: DslNode[];
1204
+ /** 默认尺寸(百分比,0-100) */
1205
+ defaultSize?: number;
1206
+ }
1207
+ interface ResizableProps {
1208
+ /** 面板列表(相邻面板间渲染拖拽手柄) */
1209
+ panels?: ResizablePanelData[];
1210
+ /** 排列方向(缺省 horizontal) */
1211
+ direction?: 'horizontal' | 'vertical';
1212
+ /** 通用:根节点 class(与内置样式合并) */
1213
+ className?: string;
1214
+ /** 通用:根节点内联样式 */
1215
+ style?: CSSProperties;
1216
+ }
1217
+ /**
1218
+ * Resizable 适配器(shadcn kit):基于 vendored Resizable
1219
+ * (react-resizable-panels);panels 声明面板,相邻面板间为可拖拽手柄;
1220
+ * DSL 的 defaultSize 统一按百分比解释。
1221
+ */
1222
+ declare function Resizable({ panels, direction, className, style, }: ResizableProps): React.JSX.Element;
1223
+
1224
+ interface ScrollAreaProps {
1225
+ /** 最大高度(px 或 CSS 长度),超出后出现自定义滚动条 */
1226
+ maxHeight?: number | string;
1227
+ /** 最大宽度(px 或 CSS 长度) */
1228
+ maxWidth?: number | string;
1229
+ /** 通用:根节点 class(与内置样式合并) */
1230
+ className?: string;
1231
+ /** 通用:根节点内联样式 */
1232
+ style?: CSSProperties;
1233
+ children?: ReactNode;
1234
+ }
1235
+ /**
1236
+ * ScrollArea 适配器(shadcn kit):基于 vendored ScrollArea(Base UI);
1237
+ * maxHeight/maxWidth 尺寸约束 + children 内容,自定义滚动条。
1238
+ */
1239
+ declare function ScrollArea({ maxHeight, maxWidth, className, style, children, }: ScrollAreaProps): React.JSX.Element;
146
1240
 
147
1241
  /** Select 选项(支持表达式解析后的数组) */
148
1242
  interface SelectOption {
149
1243
  label: string;
150
1244
  value: string | number | boolean;
1245
+ /** 单个选项禁用 */
1246
+ disabled?: boolean;
151
1247
  }
152
1248
  interface SelectProps {
153
1249
  /** 字段名;在 Form 内声明 name 即自动成为表单项 */
@@ -165,6 +1261,10 @@ interface SelectProps {
165
1261
  allowClear?: boolean;
166
1262
  /** 选中变化事件,传出选中的 value */
167
1263
  onChange?: (value: unknown) => void;
1264
+ /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件包裹) */
1265
+ className?: string;
1266
+ /** 通用:根节点内联样式(同 className 的挂载规则) */
1267
+ style?: CSSProperties;
168
1268
  }
169
1269
  /**
170
1270
  * Select 适配器(shadcn kit,语义对齐 antd 版):
@@ -176,7 +1276,200 @@ interface SelectProps {
176
1276
  * popup 时(如表单初始值回填),Trigger 同样显示 label(对齐原 Radix 坑
177
1277
  * 的对应场景,见 design D2/风险表)。
178
1278
  */
179
- declare function Select({ name, label, rules, options, value, placeholder, disabled, allowClear, onChange, }: SelectProps): React.JSX.Element;
1279
+ declare function Select({ name, label, rules, options, value, placeholder, disabled, allowClear, onChange, className, style, }: SelectProps): React.JSX.Element;
1280
+
1281
+ interface SeparatorProps {
1282
+ /** 方向,默认 horizontal */
1283
+ orientation?: 'horizontal' | 'vertical';
1284
+ /** 通用:根节点 class(与内置样式合并) */
1285
+ className?: string;
1286
+ /** 通用:根节点内联样式 */
1287
+ style?: CSSProperties;
1288
+ }
1289
+ /** Separator 适配器(shadcn kit):orientation → vendored Separator */
1290
+ declare function Separator({ orientation, className, style }: SeparatorProps): React.JSX.Element;
1291
+
1292
+ type SheetSide = 'left' | 'right' | 'top' | 'bottom';
1293
+ interface SheetProps {
1294
+ /** 面板标题 */
1295
+ title?: string;
1296
+ /** 受控开关(可绑 `${state.x}` 表达式) */
1297
+ open?: boolean;
1298
+ /** 滑出方向,缺省 right */
1299
+ side?: SheetSide;
1300
+ /** 关闭事件(X / 遮罩 / Escape 任一途径关闭时触发) */
1301
+ onClose?: () => void;
1302
+ /** 内容(DSL 子树,经 Renderer children 机制渲染) */
1303
+ children?: ReactNode;
1304
+ /** 通用:根节点 class(挂在面板内容根节点,与内置样式合并) */
1305
+ className?: string;
1306
+ /** 通用:内联样式(同 className 挂载规则) */
1307
+ style?: CSSProperties;
1308
+ }
1309
+ /**
1310
+ * Sheet 适配器(shadcn kit):受控 `open` + `side` 四边滑入;
1311
+ * 基于 vendored sheet 原语(dialog 同源),与 OverlayHost 视觉
1312
+ * 一致(design D4)。
1313
+ */
1314
+ declare function Sheet({ title, open, side, onClose, children, className, style, }: SheetProps): React.JSX.Element;
1315
+
1316
+ /** 品牌区:标题 + 可选 logo(图片地址);也可直接传 ReactNode 自定义 */
1317
+ interface SidebarBrand {
1318
+ title: string;
1319
+ logo?: string;
1320
+ }
1321
+ /** 导航项;`children` 为子菜单(缩进展示) */
1322
+ interface SidebarNavItem {
1323
+ label: string;
1324
+ href?: string;
1325
+ /** 图标名(Icon 白名单,kebab/Pascal 均可),渲染于文字前 */
1326
+ icon?: string;
1327
+ children?: SidebarNavItem[];
1328
+ }
1329
+ interface SidebarProps {
1330
+ /** 品牌区({ title, logo } 对象或任意 ReactNode);移动端渲染在顶栏,桌面端渲染在侧栏顶部品牌行 */
1331
+ brand?: SidebarBrand | ReactNode;
1332
+ /** 导航项(可含嵌套 children,可含表达式);content 槽提供时不渲染 */
1333
+ items?: SidebarNavItem[];
1334
+ /** 侧栏自由内容槽(提供时替代 items 导航;DSL 子树经 Renderer 渲染) */
1335
+ content?: ReactNode;
1336
+ /** 侧栏底部固定区(渲染在滚动区之后,不随内容滚动;未提供不渲染容器) */
1337
+ sidebarFooter?: ReactNode;
1338
+ /** 是否渲染折叠触发器:折叠后桌面侧栏收窄为 icon rail(64px,导航仅图标) */
1339
+ collapsible?: boolean;
1340
+ /** 折叠状态变化事件,传出 boolean */
1341
+ onCollapse?: (collapsed: boolean) => void;
1342
+ /** 路由 / 会话切换标识:值变化时移动端抽屉在渲染期关闭 */
1343
+ locationKey?: string;
1344
+ /** 移动端(<768px)侧栏变为覆盖抽屉(缺省 true);false 时各端均为 flex 行布局 */
1345
+ drawer?: boolean;
1346
+ /** 通用:根节点 class(与内置样式合并) */
1347
+ className?: string;
1348
+ /** 通用:根节点内联样式(同 className 挂载规则) */
1349
+ style?: CSSProperties;
1350
+ /** 主内容区 */
1351
+ children?: ReactNode;
1352
+ }
1353
+ declare function useSidebarDrawer(): {
1354
+ close: () => void;
1355
+ collapsed: boolean;
1356
+ } | null;
1357
+ /**
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 自行适配。
1368
+ */
1369
+ declare function Sidebar({ brand, items, content, sidebarFooter, collapsible, onCollapse, locationKey, drawer, className, style, children, }: SidebarProps): React.JSX.Element;
1370
+
1371
+ interface SiderProps {
1372
+ /** 展开宽度(px),默认 200 */
1373
+ width?: number;
1374
+ /** 是否渲染底部折叠触发器 */
1375
+ collapsible?: boolean;
1376
+ /** 受控折叠态(可绑 `${state.x}`,配合 onCollapse 回写) */
1377
+ collapsed?: boolean;
1378
+ /** 折叠后的宽度(px),默认 64 */
1379
+ collapsedWidth?: number;
1380
+ /** 折叠状态变化事件,传出 boolean */
1381
+ onCollapse?: (collapsed: boolean) => void;
1382
+ /** 通用:根节点 class(与内置样式合并) */
1383
+ className?: string;
1384
+ /** 通用:根节点内联样式 */
1385
+ style?: CSSProperties;
1386
+ children?: ReactNode;
1387
+ }
1388
+ /**
1389
+ * Sider 侧边区域(shadcn kit,语义对齐 antd Layout.Sider):
1390
+ * 纯容器(内容完全由 children DSL 声明)+ 可选折叠触发器;
1391
+ * 折叠为受控 prop(props 绑 state + onCollapse 回写的闭环)。
1392
+ */
1393
+ declare function Sider({ width, collapsible, collapsed, collapsedWidth, onCollapse, className, style, children, }: SiderProps): React.JSX.Element;
1394
+
1395
+ /** DSL Skeleton 形状 */
1396
+ type SkeletonShape = 'line' | 'circle' | 'rect';
1397
+ interface SkeletonProps {
1398
+ /** 形状:line(文本行)/ circle(圆形)/ rect(矩形),默认 line */
1399
+ shape?: SkeletonShape;
1400
+ /** 宽度(px 或 CSS 长度) */
1401
+ width?: number | string;
1402
+ /** 高度(px 或 CSS 长度) */
1403
+ height?: number | string;
1404
+ /** 通用:根节点 class(与内置样式合并) */
1405
+ className?: string;
1406
+ /** 通用:根节点内联样式 */
1407
+ style?: CSSProperties;
1408
+ }
1409
+ /** Skeleton 适配器(shadcn kit):shape + width / height → vendored Skeleton */
1410
+ declare function Skeleton({ shape, width, height, className, style }: SkeletonProps): React.JSX.Element;
1411
+
1412
+ interface SliderProps {
1413
+ /** 字段名;在 Form 内声明 name 即自动成为表单项 */
1414
+ name?: string;
1415
+ /** 表单项标签 */
1416
+ label?: string;
1417
+ /** 校验规则 */
1418
+ rules?: FieldRule[];
1419
+ /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
1420
+ value?: number;
1421
+ /** 最小值,默认 0 */
1422
+ min?: number;
1423
+ /** 最大值,默认 100 */
1424
+ max?: number;
1425
+ /** 步长,默认 1 */
1426
+ step?: number;
1427
+ disabled?: boolean;
1428
+ /** 拖动变化事件,传出 number */
1429
+ onChange?: (value: number) => void;
1430
+ /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件本身) */
1431
+ className?: string;
1432
+ /** 通用:根节点内联样式(同 className 的挂载规则) */
1433
+ style?: CSSProperties;
1434
+ }
1435
+ /**
1436
+ * Slider 适配器(shadcn kit):基于 vendored Slider(Base UI,单值形态);
1437
+ * onChange 传出 number(DSL 语义值,非 DOM 事件)。
1438
+ */
1439
+ declare function Slider({ name, label, rules, value, min, max, step, disabled, onChange, className, style, }: SliderProps): React.JSX.Element;
1440
+
1441
+ interface SonnerProps {
1442
+ /** 通用:挂载点容器 class */
1443
+ className?: string;
1444
+ /** 通用:挂载点容器内联样式 */
1445
+ style?: CSSProperties;
1446
+ }
1447
+ /**
1448
+ * Sonner 适配器(shadcn kit,Base UI Toast 薄封装):
1449
+ * DSL 组件形态仅作全局 toast 挂载点(渲染 Toaster);同时在 mount 时
1450
+ * 向运行时动作注册表注册 `toast` 动作——DSL events 可写
1451
+ * `{ action: 'toast', params: { message, description?, variant? } }`
1452
+ * (variant: success/error/info)。
1453
+ *
1454
+ * 接线方式说明:runtime 动作注册表(Registry)天然支持外部扩展
1455
+ * (同 registerInteractionActions 的先例),无需修改 runtime;
1456
+ * 动作经本挂载组件注册,复用 vendored toast 原语的模块级
1457
+ * ToastManager(命令式 API 与 Toaster 共用同一实例)。
1458
+ */
1459
+ declare function Sonner({ className, style }: SonnerProps): React.JSX.Element;
1460
+
1461
+ /** DSL Spinner 尺寸 */
1462
+ type SpinnerSize = 'sm' | 'default' | 'lg';
1463
+ interface SpinnerProps {
1464
+ /** 尺寸,默认 default */
1465
+ size?: SpinnerSize;
1466
+ /** 通用:根节点 class(与内置样式合并) */
1467
+ className?: string;
1468
+ /** 通用:根节点内联样式 */
1469
+ style?: CSSProperties;
1470
+ }
1471
+ /** Spinner 适配器(shadcn kit):size → vendored Spinner(纯 CSS 旋转) */
1472
+ declare function Spinner({ size, className, style }: SpinnerProps): React.JSX.Element;
180
1473
 
181
1474
  interface StatisticProps {
182
1475
  /** 指标标题 */
@@ -187,9 +1480,36 @@ interface StatisticProps {
187
1480
  precision?: number;
188
1481
  /** 后缀(如单位) */
189
1482
  suffix?: string;
1483
+ /** 通用:根节点 class(与内置样式合并) */
1484
+ className?: string;
1485
+ /** 通用:根节点内联样式 */
1486
+ style?: CSSProperties;
190
1487
  }
191
1488
  /** Statistic 适配器(shadcn kit):标题 + 数值(precision 精度 / suffix 后缀) */
192
- declare function Statistic({ title, value, precision, suffix }: StatisticProps): React.JSX.Element;
1489
+ declare function Statistic({ title, value, precision, suffix, className, style }: StatisticProps): React.JSX.Element;
1490
+
1491
+ interface SwitchProps {
1492
+ /** 字段名;在 Form 内声明 name 即自动成为表单项 */
1493
+ name?: string;
1494
+ /** 开关旁的标签文本 */
1495
+ label?: string;
1496
+ /** 校验规则 */
1497
+ rules?: FieldRule[];
1498
+ /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
1499
+ value?: boolean;
1500
+ disabled?: boolean;
1501
+ /** 开关变化事件,传出 boolean */
1502
+ onChange?: (checked: boolean) => void;
1503
+ /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件包裹) */
1504
+ className?: string;
1505
+ /** 通用:根节点内联样式(同 className 的挂载规则) */
1506
+ style?: CSSProperties;
1507
+ }
1508
+ /**
1509
+ * Switch 适配器(shadcn kit):基于 vendored Switch(Base UI);
1510
+ * onChange 传出 boolean(DSL 语义值,非 DOM 事件)。
1511
+ */
1512
+ declare function Switch({ name, label, rules, value, disabled, onChange, className, style, }: SwitchProps): React.JSX.Element;
193
1513
 
194
1514
  /**
195
1515
  * 列定义;`cell` 为行模板 DSL 子树,每个单元格经 Renderer 子作用域
@@ -221,6 +1541,10 @@ interface TableProps {
221
1541
  pagination?: TablePagination;
222
1542
  /** 分页 / 排序变化事件,传出 pagination 信息 */
223
1543
  onChange?: (pagination: TablePaginationInfo) => void;
1544
+ /** 通用:根节点 class(与内置样式合并) */
1545
+ className?: string;
1546
+ /** 通用:根节点内联样式 */
1547
+ style?: CSSProperties;
224
1548
  }
225
1549
  /**
226
1550
  * Table 适配器(shadcn kit,语义对齐 antd 版):vendored shadcn Table 原语
@@ -228,7 +1552,7 @@ interface TableProps {
228
1552
  * (pageSize)/ 空态;`cell` 行模板经 renderChildren 注入
229
1553
  * `{ row, rowIndex }`(rowIndex 为当前页内序号)。
230
1554
  */
231
- declare function Table({ columns, dataSource, rowKey, loading, pagination, onChange, }: TableProps): React.JSX.Element;
1555
+ declare function Table({ columns, dataSource, rowKey, loading, pagination, onChange, className, style, }: TableProps): React.JSX.Element;
232
1556
 
233
1557
  /** Tabs 页签定义;`children` 为 DSL 子树,经 Renderer children 机制渲染 */
234
1558
  interface TabItem {
@@ -242,13 +1566,149 @@ interface TabsProps {
242
1566
  activeKey?: string;
243
1567
  /** 页签切换事件,传出新激活的 key */
244
1568
  onChange?: (key: string) => void;
1569
+ /** 通用:根节点 class(与内置样式合并) */
1570
+ className?: string;
1571
+ /** 通用:根节点内联样式 */
1572
+ style?: CSSProperties;
245
1573
  }
246
1574
  /**
247
1575
  * Tabs 容器(shadcn kit,语义对齐 antd 版):
248
1576
  * 基于 vendored shadcn Tabs(@base-ui/react),每个 pane 的内容经
249
1577
  * renderChildren 渲染;未传 activeKey 时缺省激活第一个页签。
250
1578
  */
251
- declare function Tabs({ items, activeKey, onChange }: TabsProps): React.JSX.Element;
1579
+ declare function Tabs({ items, activeKey, onChange, className, style }: TabsProps): React.JSX.Element;
1580
+
1581
+ /** DSL Text 语义类型 */
1582
+ type TextType = 'default' | 'secondary' | 'success' | 'warning' | 'danger';
1583
+ interface TextProps {
1584
+ /** 文本内容(可含表达式);也可用 children 渲染 */
1585
+ text?: string;
1586
+ /** 语义类型(颜色) */
1587
+ type?: TextType;
1588
+ /** 加粗 */
1589
+ strong?: boolean;
1590
+ /** 删除线 */
1591
+ delete?: boolean;
1592
+ /** 下划线 */
1593
+ underline?: boolean;
1594
+ /** 斜体 */
1595
+ italic?: boolean;
1596
+ /** 通用:根节点 class(与内置样式合并) */
1597
+ className?: string;
1598
+ /** 通用:根节点内联样式 */
1599
+ style?: CSSProperties;
1600
+ children?: ReactNode;
1601
+ }
1602
+ /** Text 适配器(shadcn kit):普通文本渲染,语义类型 + 修饰(粗体/删除线/下划线/斜体) */
1603
+ declare function Text({ text, type, strong, delete: del, underline, italic, className, style, children, }: TextProps): React.JSX.Element;
1604
+
1605
+ interface TextareaProps {
1606
+ /** 字段名;在 Form 内声明 name 即自动成为表单项 */
1607
+ name?: string;
1608
+ /** 表单项标签 */
1609
+ label?: string;
1610
+ /** 校验规则 */
1611
+ rules?: FieldRule[];
1612
+ /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
1613
+ value?: string;
1614
+ placeholder?: string;
1615
+ /** 行数(缺省由内容自适应) */
1616
+ rows?: number;
1617
+ disabled?: boolean;
1618
+ /** 输入事件,传出 string 值 */
1619
+ onChange?: (value: string) => void;
1620
+ /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件本身) */
1621
+ className?: string;
1622
+ /** 通用:根节点内联样式(同 className 的挂载规则) */
1623
+ style?: CSSProperties;
1624
+ }
1625
+ /**
1626
+ * Textarea 适配器(shadcn kit):Form 内声明 `name` 自动成为表单项;
1627
+ * onChange 传出 string(非原生 event)。
1628
+ */
1629
+ declare function Textarea({ name, label, rules, value, placeholder, rows, disabled, onChange, className, style, }: TextareaProps): React.JSX.Element;
1630
+
1631
+ interface ToggleProps {
1632
+ /** 按钮文本 */
1633
+ text?: string;
1634
+ /** 受控按下态 */
1635
+ pressed?: boolean;
1636
+ /** 样式变体 */
1637
+ variant?: VariantProps<typeof toggleVariants>['variant'];
1638
+ /** 尺寸 */
1639
+ size?: VariantProps<typeof toggleVariants>['size'];
1640
+ disabled?: boolean;
1641
+ /** 按下态变化事件,传出 boolean */
1642
+ onChange?: (pressed: boolean) => void;
1643
+ /** 通用:根节点 class(与内置样式合并) */
1644
+ className?: string;
1645
+ /** 通用:根节点内联样式 */
1646
+ style?: CSSProperties;
1647
+ }
1648
+ /**
1649
+ * Toggle 适配器(shadcn kit):基于 vendored Toggle(Base UI);
1650
+ * pressed 受控(未传时为非受控);onChange 传出 boolean(DSL 语义值)。
1651
+ */
1652
+ declare function Toggle({ text, pressed, variant, size, disabled, onChange, className, style, }: ToggleProps): React.JSX.Element;
1653
+
1654
+ /** ToggleGroup 选项 */
1655
+ interface ToggleGroupOption {
1656
+ label: string;
1657
+ value: string;
1658
+ disabled?: boolean;
1659
+ }
1660
+ interface ToggleGroupProps {
1661
+ /** 选项列表 */
1662
+ options?: ToggleGroupOption[];
1663
+ /** 受控选中值:单选传 value,多选传数组 */
1664
+ value?: string | string[];
1665
+ /** 多选模式(缺省单选) */
1666
+ multiple?: boolean;
1667
+ disabled?: boolean;
1668
+ /** 选中变化事件:单选传出选中 value(取消选中传 undefined),多选传出值数组 */
1669
+ onChange?: (value: string | string[] | undefined) => void;
1670
+ /** 通用:根节点 class(与内置样式合并) */
1671
+ className?: string;
1672
+ /** 通用:根节点内联样式 */
1673
+ style?: CSSProperties;
1674
+ }
1675
+ /**
1676
+ * ToggleGroup 适配器(shadcn kit):基于 vendored ToggleGroup(Base UI);
1677
+ * Base UI 统一以数组表达选中态,适配层按 multiple 收敛为
1678
+ * 单值/数组(DSL 语义值)。
1679
+ */
1680
+ declare function ToggleGroup({ options, value, multiple, disabled, onChange, className, style, }: ToggleGroupProps): React.JSX.Element;
1681
+
1682
+ interface TooltipProps {
1683
+ /** 提示文案 */
1684
+ content?: string;
1685
+ /** 触发元素(DSL 子树,经 Renderer children 机制渲染) */
1686
+ children?: ReactNode;
1687
+ /** 通用:根节点 class(挂在提示浮层根节点,与内置样式合并) */
1688
+ className?: string;
1689
+ /** 通用:内联样式(同 className 挂载规则) */
1690
+ style?: CSSProperties;
1691
+ }
1692
+ /**
1693
+ * Tooltip 适配器(shadcn kit):children 为触发元素(span 包装接入
1694
+ * Base UI Trigger),悬浮显示 content 提示浮层。
1695
+ */
1696
+ declare function Tooltip({ content, children, className, style }: TooltipProps): React.JSX.Element;
1697
+
1698
+ /** Typography 排版变体 */
1699
+ type TypographyVariant = NonNullable<VariantProps<typeof typographyVariants>['variant']>;
1700
+ interface TypographyProps {
1701
+ /** 排版变体(缺省 p) */
1702
+ variant?: TypographyVariant;
1703
+ /** 文本内容(可含表达式) */
1704
+ text?: string;
1705
+ /** 通用:根节点 class(与内置样式合并) */
1706
+ className?: string;
1707
+ /** 通用:根节点内联样式 */
1708
+ style?: CSSProperties;
1709
+ }
1710
+ /** Typography 适配器(shadcn kit):按 variant 渲染排版样式文本 */
1711
+ declare function Typography({ variant, text, className, style, }: TypographyProps): React.JSX.Element;
252
1712
 
253
1713
  /**
254
1714
  * shadcn kit 组件表:DSL 类型名 → 组件适配器。
@@ -268,12 +1728,83 @@ declare const shadcnComponents: {
268
1728
  readonly Form: typeof Form;
269
1729
  readonly Input: typeof Input;
270
1730
  readonly Select: typeof Select;
1731
+ readonly Layout: {
1732
+ readonly component: typeof Layout;
1733
+ readonly withScope: true;
1734
+ };
1735
+ readonly Header: typeof Header;
1736
+ readonly Sider: typeof Sider;
1737
+ readonly Content: typeof Content;
1738
+ readonly Footer: typeof Footer;
1739
+ readonly Menu: typeof Menu;
1740
+ readonly Link: typeof Link;
1741
+ readonly Text: typeof Text;
1742
+ readonly Badge: typeof Badge;
1743
+ readonly Avatar: typeof Avatar;
1744
+ readonly Skeleton: typeof Skeleton;
1745
+ readonly Separator: typeof Separator;
1746
+ readonly Kbd: typeof Kbd;
1747
+ readonly Spinner: typeof Spinner;
1748
+ readonly Empty: typeof Empty;
1749
+ readonly AspectRatio: typeof AspectRatio;
1750
+ readonly Progress: typeof Progress;
1751
+ readonly Textarea: typeof Textarea;
1752
+ readonly Checkbox: typeof Checkbox;
1753
+ readonly RadioGroup: typeof RadioGroup;
1754
+ readonly Switch: typeof Switch;
1755
+ readonly Slider: typeof Slider;
1756
+ readonly Label: typeof Label;
1757
+ readonly Field: typeof Field;
1758
+ readonly ChatInput: typeof ChatInput;
1759
+ readonly Breadcrumb: typeof Breadcrumb;
1760
+ readonly Pagination: typeof Pagination;
1761
+ readonly Menubar: typeof Menubar;
1762
+ readonly NavigationMenu: typeof NavigationMenu;
1763
+ readonly DropdownMenu: typeof DropdownMenu;
1764
+ readonly ContextMenu: typeof ContextMenu;
1765
+ readonly Dialog: typeof Dialog;
1766
+ readonly AlertDialog: typeof AlertDialog;
1767
+ readonly Drawer: typeof Drawer;
1768
+ readonly Sheet: typeof Sheet;
1769
+ readonly Popover: typeof Popover;
1770
+ readonly Sonner: typeof Sonner;
1771
+ readonly Accordion: typeof Accordion;
1772
+ readonly Collapsible: typeof Collapsible;
1773
+ readonly Tooltip: typeof Tooltip;
1774
+ readonly HoverCard: typeof HoverCard;
1775
+ readonly Calendar: typeof Calendar;
1776
+ readonly InputOTP: typeof InputOTP;
1777
+ readonly Combobox: typeof Combobox;
1778
+ readonly Carousel: typeof Carousel;
1779
+ readonly Command: typeof Command;
1780
+ readonly Resizable: typeof Resizable;
1781
+ readonly ScrollArea: typeof ScrollArea;
1782
+ readonly Toggle: typeof Toggle;
1783
+ readonly ToggleGroup: typeof ToggleGroup;
1784
+ readonly ButtonGroup: typeof ButtonGroup;
1785
+ readonly InputGroup: typeof InputGroup;
1786
+ readonly Item: typeof Item;
1787
+ readonly Typography: typeof Typography;
1788
+ readonly Sidebar: typeof Sidebar;
1789
+ readonly DataTable: typeof DataTable;
1790
+ readonly Chart: typeof Chart;
1791
+ readonly Icon: typeof Icon;
271
1792
  };
272
1793
  /** 把全部 V1 内置组件(shadcn 实现)按 DSL 类型名注册到给定 ComponentRegistry */
273
1794
  declare function registerShadcnComponents(registry: ComponentRegistry): void;
274
1795
  /** 创建并返回注册了全部 V1 内置组件(shadcn 实现)的新 ComponentRegistry */
275
1796
  declare function createShadcnComponentRegistry(): ComponentRegistry;
276
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;
1807
+
277
1808
  /**
278
1809
  * Form 容器上下文(shadcn kit):Form 组件维护受控 values / 校验错误
279
1810
  * 并经 React Context 下发;Input / Select 据此判断自身是否在表单内。
@@ -304,4 +1835,4 @@ interface FormContextValue {
304
1835
  /** 在字段组件内探测 Form 上下文;不在 Form 内时返回 null */
305
1836
  declare function useFormContext(): FormContextValue | null;
306
1837
 
307
- export { Alert, type AlertProps, type AlertVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, type FieldRule, Flex, type FlexProps, Form, type FormContextValue, type FormProps, Grid, type GridProps, Input, type InputProps, Page, type PageProps, Select, type SelectOption, type SelectProps, Statistic, type StatisticProps, type TabItem, Table, type TableColumn, type TablePagination, type TablePaginationInfo, type TableProps, Tabs, type TabsProps, createShadcnComponentRegistry, 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, createShadcnComponentRegistry, normalizeIconName, registerShadcnComponents, shadcnComponents, useFormContext, useSidebarDrawer };