@pactor-app/ui 1.9.0 → 1.11.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.
@@ -145,6 +145,7 @@ interface BreadcrumbProps {
145
145
  /**
146
146
  * Breadcrumb 适配器(shadcn kit):items 声明路径,带 href 的非末项
147
147
  * 渲染为可点击链接,末项渲染为当前页纯文本(aria-current="page")。
148
+ * 链接站内路径的普通左键点击走渲染上下文路由(同 Link 组件规则)。
148
149
  */
149
150
  declare function Breadcrumb({ items, className, style }: BreadcrumbProps): React.JSX.Element;
150
151
 
@@ -155,6 +156,8 @@ type ButtonSize = 'small' | 'middle' | 'large';
155
156
  interface ButtonProps {
156
157
  /** 按钮文本;也可用 children 渲染内容 */
157
158
  text?: string;
159
+ /** 图标名(Icon 白名单,kebab-case / PascalCase 均可),渲染在文本前 */
160
+ icon?: string;
158
161
  /** 变体,默认 default */
159
162
  variant?: ButtonVariant;
160
163
  /** 危险态 */
@@ -176,9 +179,10 @@ interface ButtonProps {
176
179
  * Button 适配器(shadcn kit):vendored shadcn Button(cva 变体)。
177
180
  * props 契约与 pactor-components(antd 版)一致;`submit: true` 时作为
178
181
  * Form 的提交按钮(type=submit);danger 映射 destructive(link/text
179
- * 变体保持原样、文字标红);loading 显示旋转图标并禁用。
182
+ * 变体保持原样、文字标红);loading 显示旋转图标并禁用(优先于 icon);
183
+ * `icon` 渲染文本前图标(对齐 Alert 的 icon 通道)。
180
184
  */
181
- declare function Button({ text, variant, danger, size, loading, disabled, submit, onClick, className, style, children, }: ButtonProps): React.JSX.Element;
185
+ declare function Button({ text, icon, variant, danger, size, loading, disabled, submit, onClick, className, style, children, }: ButtonProps): React.JSX.Element;
182
186
 
183
187
  interface ButtonGroupProps {
184
188
  /** 通用:根节点 class(与内置样式合并) */
@@ -216,6 +220,9 @@ interface InputProps {
216
220
  onChange?: (value: string) => void;
217
221
  /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件本身) */
218
222
  className?: string;
223
+ /** 控件本体 class(无论是否在 Form 内都挂控件节点;独立渲染时与
224
+ * className 同点合并——Form 内需要精确设置控件样式(如宽度)时使用) */
225
+ controlClassName?: string;
219
226
  /** 通用:根节点内联样式(同 className 的挂载规则) */
220
227
  style?: CSSProperties;
221
228
  }
@@ -226,7 +233,7 @@ interface InputProps {
226
233
  * 表单项为去原语化结构(design D3):`<div data-slot="form-item">` +
227
234
  * `<label htmlFor>` 与控件 `useId` 关联。
228
235
  */
229
- declare function Input({ name, label, rules, value, type, placeholder, disabled, allowClear, onChange, className, style, }: InputProps): React.JSX.Element;
236
+ declare function Input({ name, label, rules, value, type, placeholder, disabled, allowClear, onChange, className, controlClassName, style, }: InputProps): React.JSX.Element;
230
237
 
231
238
  interface CalendarProps {
232
239
  /** 字段名;在 Form 内声明 name 即自动成为表单项 */
@@ -738,6 +745,8 @@ declare function Empty({ title, description, children, className, style }: Empty
738
745
  interface FieldProps {
739
746
  /** 表单项标签 */
740
747
  label?: string;
748
+ /** 必填标记(label 前渲染红色 `*`;仅视觉标记,校验仍由 Form rules 承担) */
749
+ required?: boolean;
741
750
  /** 辅助说明文案 */
742
751
  description?: string;
743
752
  /** 错误文案(声明式展示,如校验失败信息) */
@@ -751,9 +760,10 @@ interface FieldProps {
751
760
  }
752
761
  /**
753
762
  * Field 适配器(shadcn kit):通用表单项容器(Base UI Field 封装);
754
- * label / description / error 为框架级 props,error 声明式强制展示。
763
+ * label / description / error 为框架级 props,error 声明式强制展示;
764
+ * `required` 在 label 前渲染必填星号(对齐 antd Form.Item required 语义)。
755
765
  */
756
- declare function Field({ label, description, error, children, className, style }: FieldProps): React.JSX.Element;
766
+ declare function Field({ label, required, description, error, children, className, style }: FieldProps): React.JSX.Element;
757
767
 
758
768
  interface FlexProps {
759
769
  /** 主轴方向,默认 horizontal */
@@ -1090,9 +1100,10 @@ interface LinkProps {
1090
1100
  children?: ReactNode;
1091
1101
  }
1092
1102
  /**
1093
- * Link 链接(shadcn kit):渲染原生 `<a href>`——自然跳转,
1094
- * 目标可以是宿主任意路由(嵌入模式的主要跳转方式,见
1095
- * spec: embedded-page-view 的「自然跳转」)。
1103
+ * Link 链接(shadcn kit):渲染原生 `<a href>` 保留原生语义;
1104
+ * 站内路径(`/` 开头)的普通左键点击拦截后走渲染上下文路由
1105
+ * (`route.navigate`,嵌入模式可注入宿主路由),外链 / 锚点 /
1106
+ * 修饰键点击 / 显式 target 保持浏览器自然跳转。
1096
1107
  */
1097
1108
  declare function Link({ href, text, target, className, style, children }: LinkProps): React.JSX.Element;
1098
1109
 
@@ -1280,6 +1291,8 @@ interface RadioGroupProps {
1280
1291
  rules?: FieldRule[];
1281
1292
  /** 选项列表 */
1282
1293
  options?: RadioGroupOption[];
1294
+ /** 选项排列方向,默认 vertical */
1295
+ direction?: 'horizontal' | 'vertical';
1283
1296
  /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
1284
1297
  value?: string | number | boolean;
1285
1298
  disabled?: boolean;
@@ -1293,9 +1306,10 @@ interface RadioGroupProps {
1293
1306
  /**
1294
1307
  * RadioGroup 适配器(shadcn kit):基于 vendored RadioGroup(Base UI);
1295
1308
  * Base UI RadioGroup 的 value 原生支持 string/number/boolean,
1296
- * onChange 传出选中项原始 value。
1309
+ * onChange 传出选中项原始 value。`direction` 控制选项横/纵排列;
1310
+ * label 经 htmlFor 关联 Base UI 隐藏原生 input,点击 label 即选中对应项。
1297
1311
  */
1298
- declare function RadioGroup({ name, label, rules, options, value, disabled, onChange, className, style, }: RadioGroupProps): React.JSX.Element;
1312
+ declare function RadioGroup({ name, label, rules, options, direction, value, disabled, onChange, className, style, }: RadioGroupProps): React.JSX.Element;
1299
1313
 
1300
1314
  /** 可拖拽面板;`children` 为 DSL 子树,经 renderChildren 渲染 */
1301
1315
  interface ResizablePanelData {
@@ -1369,6 +1383,9 @@ interface SelectProps {
1369
1383
  onChange?: (value: unknown) => void;
1370
1384
  /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件包裹) */
1371
1385
  className?: string;
1386
+ /** 控件本体 class(无论是否在 Form 内都挂控件包裹节点;独立渲染时与
1387
+ * className 同点合并——Form 内需要精确设置控件样式(如宽度)时使用) */
1388
+ controlClassName?: string;
1372
1389
  /** 通用:根节点内联样式(同 className 的挂载规则) */
1373
1390
  style?: CSSProperties;
1374
1391
  }
@@ -1382,7 +1399,7 @@ interface SelectProps {
1382
1399
  * popup 时(如表单初始值回填),Trigger 同样显示 label(对齐原 Radix 坑
1383
1400
  * 的对应场景,见 design D2/风险表)。
1384
1401
  */
1385
- declare function Select({ name, label, rules, options, value, placeholder, disabled, allowClear, onChange, className, style, }: SelectProps): React.JSX.Element;
1402
+ declare function Select({ name, label, rules, options, value, placeholder, disabled, allowClear, onChange, className, controlClassName, style, }: SelectProps): React.JSX.Element;
1386
1403
 
1387
1404
  interface SeparatorProps {
1388
1405
  /** 方向,默认 horizontal */
@@ -145,6 +145,7 @@ interface BreadcrumbProps {
145
145
  /**
146
146
  * Breadcrumb 适配器(shadcn kit):items 声明路径,带 href 的非末项
147
147
  * 渲染为可点击链接,末项渲染为当前页纯文本(aria-current="page")。
148
+ * 链接站内路径的普通左键点击走渲染上下文路由(同 Link 组件规则)。
148
149
  */
149
150
  declare function Breadcrumb({ items, className, style }: BreadcrumbProps): React.JSX.Element;
150
151
 
@@ -155,6 +156,8 @@ type ButtonSize = 'small' | 'middle' | 'large';
155
156
  interface ButtonProps {
156
157
  /** 按钮文本;也可用 children 渲染内容 */
157
158
  text?: string;
159
+ /** 图标名(Icon 白名单,kebab-case / PascalCase 均可),渲染在文本前 */
160
+ icon?: string;
158
161
  /** 变体,默认 default */
159
162
  variant?: ButtonVariant;
160
163
  /** 危险态 */
@@ -176,9 +179,10 @@ interface ButtonProps {
176
179
  * Button 适配器(shadcn kit):vendored shadcn Button(cva 变体)。
177
180
  * props 契约与 pactor-components(antd 版)一致;`submit: true` 时作为
178
181
  * Form 的提交按钮(type=submit);danger 映射 destructive(link/text
179
- * 变体保持原样、文字标红);loading 显示旋转图标并禁用。
182
+ * 变体保持原样、文字标红);loading 显示旋转图标并禁用(优先于 icon);
183
+ * `icon` 渲染文本前图标(对齐 Alert 的 icon 通道)。
180
184
  */
181
- declare function Button({ text, variant, danger, size, loading, disabled, submit, onClick, className, style, children, }: ButtonProps): React.JSX.Element;
185
+ declare function Button({ text, icon, variant, danger, size, loading, disabled, submit, onClick, className, style, children, }: ButtonProps): React.JSX.Element;
182
186
 
183
187
  interface ButtonGroupProps {
184
188
  /** 通用:根节点 class(与内置样式合并) */
@@ -216,6 +220,9 @@ interface InputProps {
216
220
  onChange?: (value: string) => void;
217
221
  /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件本身) */
218
222
  className?: string;
223
+ /** 控件本体 class(无论是否在 Form 内都挂控件节点;独立渲染时与
224
+ * className 同点合并——Form 内需要精确设置控件样式(如宽度)时使用) */
225
+ controlClassName?: string;
219
226
  /** 通用:根节点内联样式(同 className 的挂载规则) */
220
227
  style?: CSSProperties;
221
228
  }
@@ -226,7 +233,7 @@ interface InputProps {
226
233
  * 表单项为去原语化结构(design D3):`<div data-slot="form-item">` +
227
234
  * `<label htmlFor>` 与控件 `useId` 关联。
228
235
  */
229
- declare function Input({ name, label, rules, value, type, placeholder, disabled, allowClear, onChange, className, style, }: InputProps): React.JSX.Element;
236
+ declare function Input({ name, label, rules, value, type, placeholder, disabled, allowClear, onChange, className, controlClassName, style, }: InputProps): React.JSX.Element;
230
237
 
231
238
  interface CalendarProps {
232
239
  /** 字段名;在 Form 内声明 name 即自动成为表单项 */
@@ -738,6 +745,8 @@ declare function Empty({ title, description, children, className, style }: Empty
738
745
  interface FieldProps {
739
746
  /** 表单项标签 */
740
747
  label?: string;
748
+ /** 必填标记(label 前渲染红色 `*`;仅视觉标记,校验仍由 Form rules 承担) */
749
+ required?: boolean;
741
750
  /** 辅助说明文案 */
742
751
  description?: string;
743
752
  /** 错误文案(声明式展示,如校验失败信息) */
@@ -751,9 +760,10 @@ interface FieldProps {
751
760
  }
752
761
  /**
753
762
  * Field 适配器(shadcn kit):通用表单项容器(Base UI Field 封装);
754
- * label / description / error 为框架级 props,error 声明式强制展示。
763
+ * label / description / error 为框架级 props,error 声明式强制展示;
764
+ * `required` 在 label 前渲染必填星号(对齐 antd Form.Item required 语义)。
755
765
  */
756
- declare function Field({ label, description, error, children, className, style }: FieldProps): React.JSX.Element;
766
+ declare function Field({ label, required, description, error, children, className, style }: FieldProps): React.JSX.Element;
757
767
 
758
768
  interface FlexProps {
759
769
  /** 主轴方向,默认 horizontal */
@@ -1090,9 +1100,10 @@ interface LinkProps {
1090
1100
  children?: ReactNode;
1091
1101
  }
1092
1102
  /**
1093
- * Link 链接(shadcn kit):渲染原生 `<a href>`——自然跳转,
1094
- * 目标可以是宿主任意路由(嵌入模式的主要跳转方式,见
1095
- * spec: embedded-page-view 的「自然跳转」)。
1103
+ * Link 链接(shadcn kit):渲染原生 `<a href>` 保留原生语义;
1104
+ * 站内路径(`/` 开头)的普通左键点击拦截后走渲染上下文路由
1105
+ * (`route.navigate`,嵌入模式可注入宿主路由),外链 / 锚点 /
1106
+ * 修饰键点击 / 显式 target 保持浏览器自然跳转。
1096
1107
  */
1097
1108
  declare function Link({ href, text, target, className, style, children }: LinkProps): React.JSX.Element;
1098
1109
 
@@ -1280,6 +1291,8 @@ interface RadioGroupProps {
1280
1291
  rules?: FieldRule[];
1281
1292
  /** 选项列表 */
1282
1293
  options?: RadioGroupOption[];
1294
+ /** 选项排列方向,默认 vertical */
1295
+ direction?: 'horizontal' | 'vertical';
1283
1296
  /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
1284
1297
  value?: string | number | boolean;
1285
1298
  disabled?: boolean;
@@ -1293,9 +1306,10 @@ interface RadioGroupProps {
1293
1306
  /**
1294
1307
  * RadioGroup 适配器(shadcn kit):基于 vendored RadioGroup(Base UI);
1295
1308
  * Base UI RadioGroup 的 value 原生支持 string/number/boolean,
1296
- * onChange 传出选中项原始 value。
1309
+ * onChange 传出选中项原始 value。`direction` 控制选项横/纵排列;
1310
+ * label 经 htmlFor 关联 Base UI 隐藏原生 input,点击 label 即选中对应项。
1297
1311
  */
1298
- declare function RadioGroup({ name, label, rules, options, value, disabled, onChange, className, style, }: RadioGroupProps): React.JSX.Element;
1312
+ declare function RadioGroup({ name, label, rules, options, direction, value, disabled, onChange, className, style, }: RadioGroupProps): React.JSX.Element;
1299
1313
 
1300
1314
  /** 可拖拽面板;`children` 为 DSL 子树,经 renderChildren 渲染 */
1301
1315
  interface ResizablePanelData {
@@ -1369,6 +1383,9 @@ interface SelectProps {
1369
1383
  onChange?: (value: unknown) => void;
1370
1384
  /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件包裹) */
1371
1385
  className?: string;
1386
+ /** 控件本体 class(无论是否在 Form 内都挂控件包裹节点;独立渲染时与
1387
+ * className 同点合并——Form 内需要精确设置控件样式(如宽度)时使用) */
1388
+ controlClassName?: string;
1372
1389
  /** 通用:根节点内联样式(同 className 的挂载规则) */
1373
1390
  style?: CSSProperties;
1374
1391
  }
@@ -1382,7 +1399,7 @@ interface SelectProps {
1382
1399
  * popup 时(如表单初始值回填),Trigger 同样显示 label(对齐原 Radix 坑
1383
1400
  * 的对应场景,见 design D2/风险表)。
1384
1401
  */
1385
- declare function Select({ name, label, rules, options, value, placeholder, disabled, allowClear, onChange, className, style, }: SelectProps): React.JSX.Element;
1402
+ declare function Select({ name, label, rules, options, value, placeholder, disabled, allowClear, onChange, className, controlClassName, style, }: SelectProps): React.JSX.Element;
1386
1403
 
1387
1404
  interface SeparatorProps {
1388
1405
  /** 方向,默认 horizontal */
@@ -71,7 +71,7 @@ import {
71
71
  createComponentRegistry,
72
72
  registerBuiltinComponents,
73
73
  useFormContext
74
- } from "../chunk-KUFQSYTS.js";
74
+ } from "../chunk-HW6M3BEF.js";
75
75
  import {
76
76
  ICONS,
77
77
  Icon,
@@ -81,8 +81,8 @@ import {
81
81
  normalizeIconName,
82
82
  useSidebarDrawer
83
83
  } from "../chunk-PECP7DJB.js";
84
- import "../chunk-VT5XP4U4.js";
85
- import "../chunk-F42SGQNW.js";
84
+ import "../chunk-NVORKHWX.js";
85
+ import "../chunk-XUHJ5YSG.js";
86
86
  import "../chunk-VM4FESQB.js";
87
87
  import "../chunk-WKJUCGV4.js";
88
88
  export {