@pactor-app/ui 1.10.0 → 1.12.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,10 @@ type ButtonSize = 'small' | 'middle' | 'large';
155
156
  interface ButtonProps {
156
157
  /** 按钮文本;也可用 children 渲染内容 */
157
158
  text?: string;
159
+ /** 图标名(Icon 白名单,kebab-case / PascalCase 均可),渲染在文本前 */
160
+ icon?: string;
161
+ /** 提示文案:hover / focus 按钮时展示 Tooltip */
162
+ tooltip?: string;
158
163
  /** 变体,默认 default */
159
164
  variant?: ButtonVariant;
160
165
  /** 危险态 */
@@ -176,9 +181,11 @@ interface ButtonProps {
176
181
  * Button 适配器(shadcn kit):vendored shadcn Button(cva 变体)。
177
182
  * props 契约与 pactor-components(antd 版)一致;`submit: true` 时作为
178
183
  * Form 的提交按钮(type=submit);danger 映射 destructive(link/text
179
- * 变体保持原样、文字标红);loading 显示旋转图标并禁用。
184
+ * 变体保持原样、文字标红);loading 显示旋转图标并禁用(优先于 icon);
185
+ * `icon` 渲染文本前图标(对齐 Alert 的 icon 通道);`tooltip` 经 vendored
186
+ * Tooltip 包装(Trigger render 合并到按钮本体)。
180
187
  */
181
- declare function Button({ text, variant, danger, size, loading, disabled, submit, onClick, className, style, children, }: ButtonProps): React.JSX.Element;
188
+ declare function Button({ text, icon, tooltip, variant, danger, size, loading, disabled, submit, onClick, className, style, children, }: ButtonProps): React.JSX.Element;
182
189
 
183
190
  interface ButtonGroupProps {
184
191
  /** 通用:根节点 class(与内置样式合并) */
@@ -216,6 +223,9 @@ interface InputProps {
216
223
  onChange?: (value: string) => void;
217
224
  /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件本身) */
218
225
  className?: string;
226
+ /** 控件本体 class(无论是否在 Form 内都挂控件节点;独立渲染时与
227
+ * className 同点合并——Form 内需要精确设置控件样式(如宽度)时使用) */
228
+ controlClassName?: string;
219
229
  /** 通用:根节点内联样式(同 className 的挂载规则) */
220
230
  style?: CSSProperties;
221
231
  }
@@ -226,7 +236,7 @@ interface InputProps {
226
236
  * 表单项为去原语化结构(design D3):`<div data-slot="form-item">` +
227
237
  * `<label htmlFor>` 与控件 `useId` 关联。
228
238
  */
229
- declare function Input({ name, label, rules, value, type, placeholder, disabled, allowClear, onChange, className, style, }: InputProps): React.JSX.Element;
239
+ declare function Input({ name, label, rules, value, type, placeholder, disabled, allowClear, onChange, className, controlClassName, style, }: InputProps): React.JSX.Element;
230
240
 
231
241
  interface CalendarProps {
232
242
  /** 字段名;在 Form 内声明 name 即自动成为表单项 */
@@ -738,6 +748,8 @@ declare function Empty({ title, description, children, className, style }: Empty
738
748
  interface FieldProps {
739
749
  /** 表单项标签 */
740
750
  label?: string;
751
+ /** 必填标记(label 前渲染红色 `*`;仅视觉标记,校验仍由 Form rules 承担) */
752
+ required?: boolean;
741
753
  /** 辅助说明文案 */
742
754
  description?: string;
743
755
  /** 错误文案(声明式展示,如校验失败信息) */
@@ -751,9 +763,10 @@ interface FieldProps {
751
763
  }
752
764
  /**
753
765
  * Field 适配器(shadcn kit):通用表单项容器(Base UI Field 封装);
754
- * label / description / error 为框架级 props,error 声明式强制展示。
766
+ * label / description / error 为框架级 props,error 声明式强制展示;
767
+ * `required` 在 label 前渲染必填星号(对齐 antd Form.Item required 语义)。
755
768
  */
756
- declare function Field({ label, description, error, children, className, style }: FieldProps): React.JSX.Element;
769
+ declare function Field({ label, required, description, error, children, className, style }: FieldProps): React.JSX.Element;
757
770
 
758
771
  interface FlexProps {
759
772
  /** 主轴方向,默认 horizontal */
@@ -1090,9 +1103,10 @@ interface LinkProps {
1090
1103
  children?: ReactNode;
1091
1104
  }
1092
1105
  /**
1093
- * Link 链接(shadcn kit):渲染原生 `<a href>`——自然跳转,
1094
- * 目标可以是宿主任意路由(嵌入模式的主要跳转方式,见
1095
- * spec: embedded-page-view 的「自然跳转」)。
1106
+ * Link 链接(shadcn kit):渲染原生 `<a href>` 保留原生语义;
1107
+ * 站内路径(`/` 开头)的普通左键点击拦截后走渲染上下文路由
1108
+ * (`route.navigate`,嵌入模式可注入宿主路由),外链 / 锚点 /
1109
+ * 修饰键点击 / 显式 target 保持浏览器自然跳转。
1096
1110
  */
1097
1111
  declare function Link({ href, text, target, className, style, children }: LinkProps): React.JSX.Element;
1098
1112
 
@@ -1372,6 +1386,9 @@ interface SelectProps {
1372
1386
  onChange?: (value: unknown) => void;
1373
1387
  /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件包裹) */
1374
1388
  className?: string;
1389
+ /** 控件本体 class(无论是否在 Form 内都挂控件包裹节点;独立渲染时与
1390
+ * className 同点合并——Form 内需要精确设置控件样式(如宽度)时使用) */
1391
+ controlClassName?: string;
1375
1392
  /** 通用:根节点内联样式(同 className 的挂载规则) */
1376
1393
  style?: CSSProperties;
1377
1394
  }
@@ -1385,7 +1402,7 @@ interface SelectProps {
1385
1402
  * popup 时(如表单初始值回填),Trigger 同样显示 label(对齐原 Radix 坑
1386
1403
  * 的对应场景,见 design D2/风险表)。
1387
1404
  */
1388
- declare function Select({ name, label, rules, options, value, placeholder, disabled, allowClear, onChange, className, style, }: SelectProps): React.JSX.Element;
1405
+ declare function Select({ name, label, rules, options, value, placeholder, disabled, allowClear, onChange, className, controlClassName, style, }: SelectProps): React.JSX.Element;
1389
1406
 
1390
1407
  interface SeparatorProps {
1391
1408
  /** 方向,默认 horizontal */
@@ -1698,11 +1715,15 @@ declare function Tabs({ items, activeKey, variant, onChange, className, style }:
1698
1715
 
1699
1716
  /** DSL Text 语义类型 */
1700
1717
  type TextType = 'default' | 'secondary' | 'success' | 'warning' | 'danger';
1718
+ /** DSL Text 字号(middle 缺省继承上下文字号) */
1719
+ type TextSize = 'small' | 'middle' | 'large';
1701
1720
  interface TextProps {
1702
1721
  /** 文本内容(可含表达式);也可用 children 渲染 */
1703
1722
  text?: string;
1704
1723
  /** 语义类型(颜色) */
1705
1724
  type?: TextType;
1725
+ /** 字号:small 12 / middle 继承(缺省)/ large 18 */
1726
+ size?: TextSize;
1706
1727
  /** 加粗 */
1707
1728
  strong?: boolean;
1708
1729
  /** 删除线 */
@@ -1717,8 +1738,8 @@ interface TextProps {
1717
1738
  style?: CSSProperties;
1718
1739
  children?: ReactNode;
1719
1740
  }
1720
- /** Text 适配器(shadcn kit):普通文本渲染,语义类型 + 修饰(粗体/删除线/下划线/斜体) */
1721
- declare function Text({ text, type, strong, delete: del, underline, italic, className, style, children, }: TextProps): React.JSX.Element;
1741
+ /** Text 适配器(shadcn kit):普通文本渲染,语义类型 + 字号 + 修饰(粗体/删除线/下划线/斜体) */
1742
+ declare function Text({ text, type, size, strong, delete: del, underline, italic, className, style, children, }: TextProps): React.JSX.Element;
1722
1743
 
1723
1744
  interface TextareaProps {
1724
1745
  /** 字段名;在 Form 内声明 name 即自动成为表单项 */
@@ -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,10 @@ type ButtonSize = 'small' | 'middle' | 'large';
155
156
  interface ButtonProps {
156
157
  /** 按钮文本;也可用 children 渲染内容 */
157
158
  text?: string;
159
+ /** 图标名(Icon 白名单,kebab-case / PascalCase 均可),渲染在文本前 */
160
+ icon?: string;
161
+ /** 提示文案:hover / focus 按钮时展示 Tooltip */
162
+ tooltip?: string;
158
163
  /** 变体,默认 default */
159
164
  variant?: ButtonVariant;
160
165
  /** 危险态 */
@@ -176,9 +181,11 @@ interface ButtonProps {
176
181
  * Button 适配器(shadcn kit):vendored shadcn Button(cva 变体)。
177
182
  * props 契约与 pactor-components(antd 版)一致;`submit: true` 时作为
178
183
  * Form 的提交按钮(type=submit);danger 映射 destructive(link/text
179
- * 变体保持原样、文字标红);loading 显示旋转图标并禁用。
184
+ * 变体保持原样、文字标红);loading 显示旋转图标并禁用(优先于 icon);
185
+ * `icon` 渲染文本前图标(对齐 Alert 的 icon 通道);`tooltip` 经 vendored
186
+ * Tooltip 包装(Trigger render 合并到按钮本体)。
180
187
  */
181
- declare function Button({ text, variant, danger, size, loading, disabled, submit, onClick, className, style, children, }: ButtonProps): React.JSX.Element;
188
+ declare function Button({ text, icon, tooltip, variant, danger, size, loading, disabled, submit, onClick, className, style, children, }: ButtonProps): React.JSX.Element;
182
189
 
183
190
  interface ButtonGroupProps {
184
191
  /** 通用:根节点 class(与内置样式合并) */
@@ -216,6 +223,9 @@ interface InputProps {
216
223
  onChange?: (value: string) => void;
217
224
  /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件本身) */
218
225
  className?: string;
226
+ /** 控件本体 class(无论是否在 Form 内都挂控件节点;独立渲染时与
227
+ * className 同点合并——Form 内需要精确设置控件样式(如宽度)时使用) */
228
+ controlClassName?: string;
219
229
  /** 通用:根节点内联样式(同 className 的挂载规则) */
220
230
  style?: CSSProperties;
221
231
  }
@@ -226,7 +236,7 @@ interface InputProps {
226
236
  * 表单项为去原语化结构(design D3):`<div data-slot="form-item">` +
227
237
  * `<label htmlFor>` 与控件 `useId` 关联。
228
238
  */
229
- declare function Input({ name, label, rules, value, type, placeholder, disabled, allowClear, onChange, className, style, }: InputProps): React.JSX.Element;
239
+ declare function Input({ name, label, rules, value, type, placeholder, disabled, allowClear, onChange, className, controlClassName, style, }: InputProps): React.JSX.Element;
230
240
 
231
241
  interface CalendarProps {
232
242
  /** 字段名;在 Form 内声明 name 即自动成为表单项 */
@@ -738,6 +748,8 @@ declare function Empty({ title, description, children, className, style }: Empty
738
748
  interface FieldProps {
739
749
  /** 表单项标签 */
740
750
  label?: string;
751
+ /** 必填标记(label 前渲染红色 `*`;仅视觉标记,校验仍由 Form rules 承担) */
752
+ required?: boolean;
741
753
  /** 辅助说明文案 */
742
754
  description?: string;
743
755
  /** 错误文案(声明式展示,如校验失败信息) */
@@ -751,9 +763,10 @@ interface FieldProps {
751
763
  }
752
764
  /**
753
765
  * Field 适配器(shadcn kit):通用表单项容器(Base UI Field 封装);
754
- * label / description / error 为框架级 props,error 声明式强制展示。
766
+ * label / description / error 为框架级 props,error 声明式强制展示;
767
+ * `required` 在 label 前渲染必填星号(对齐 antd Form.Item required 语义)。
755
768
  */
756
- declare function Field({ label, description, error, children, className, style }: FieldProps): React.JSX.Element;
769
+ declare function Field({ label, required, description, error, children, className, style }: FieldProps): React.JSX.Element;
757
770
 
758
771
  interface FlexProps {
759
772
  /** 主轴方向,默认 horizontal */
@@ -1090,9 +1103,10 @@ interface LinkProps {
1090
1103
  children?: ReactNode;
1091
1104
  }
1092
1105
  /**
1093
- * Link 链接(shadcn kit):渲染原生 `<a href>`——自然跳转,
1094
- * 目标可以是宿主任意路由(嵌入模式的主要跳转方式,见
1095
- * spec: embedded-page-view 的「自然跳转」)。
1106
+ * Link 链接(shadcn kit):渲染原生 `<a href>` 保留原生语义;
1107
+ * 站内路径(`/` 开头)的普通左键点击拦截后走渲染上下文路由
1108
+ * (`route.navigate`,嵌入模式可注入宿主路由),外链 / 锚点 /
1109
+ * 修饰键点击 / 显式 target 保持浏览器自然跳转。
1096
1110
  */
1097
1111
  declare function Link({ href, text, target, className, style, children }: LinkProps): React.JSX.Element;
1098
1112
 
@@ -1372,6 +1386,9 @@ interface SelectProps {
1372
1386
  onChange?: (value: unknown) => void;
1373
1387
  /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件包裹) */
1374
1388
  className?: string;
1389
+ /** 控件本体 class(无论是否在 Form 内都挂控件包裹节点;独立渲染时与
1390
+ * className 同点合并——Form 内需要精确设置控件样式(如宽度)时使用) */
1391
+ controlClassName?: string;
1375
1392
  /** 通用:根节点内联样式(同 className 的挂载规则) */
1376
1393
  style?: CSSProperties;
1377
1394
  }
@@ -1385,7 +1402,7 @@ interface SelectProps {
1385
1402
  * popup 时(如表单初始值回填),Trigger 同样显示 label(对齐原 Radix 坑
1386
1403
  * 的对应场景,见 design D2/风险表)。
1387
1404
  */
1388
- declare function Select({ name, label, rules, options, value, placeholder, disabled, allowClear, onChange, className, style, }: SelectProps): React.JSX.Element;
1405
+ declare function Select({ name, label, rules, options, value, placeholder, disabled, allowClear, onChange, className, controlClassName, style, }: SelectProps): React.JSX.Element;
1389
1406
 
1390
1407
  interface SeparatorProps {
1391
1408
  /** 方向,默认 horizontal */
@@ -1698,11 +1715,15 @@ declare function Tabs({ items, activeKey, variant, onChange, className, style }:
1698
1715
 
1699
1716
  /** DSL Text 语义类型 */
1700
1717
  type TextType = 'default' | 'secondary' | 'success' | 'warning' | 'danger';
1718
+ /** DSL Text 字号(middle 缺省继承上下文字号) */
1719
+ type TextSize = 'small' | 'middle' | 'large';
1701
1720
  interface TextProps {
1702
1721
  /** 文本内容(可含表达式);也可用 children 渲染 */
1703
1722
  text?: string;
1704
1723
  /** 语义类型(颜色) */
1705
1724
  type?: TextType;
1725
+ /** 字号:small 12 / middle 继承(缺省)/ large 18 */
1726
+ size?: TextSize;
1706
1727
  /** 加粗 */
1707
1728
  strong?: boolean;
1708
1729
  /** 删除线 */
@@ -1717,8 +1738,8 @@ interface TextProps {
1717
1738
  style?: CSSProperties;
1718
1739
  children?: ReactNode;
1719
1740
  }
1720
- /** Text 适配器(shadcn kit):普通文本渲染,语义类型 + 修饰(粗体/删除线/下划线/斜体) */
1721
- declare function Text({ text, type, strong, delete: del, underline, italic, className, style, children, }: TextProps): React.JSX.Element;
1741
+ /** Text 适配器(shadcn kit):普通文本渲染,语义类型 + 字号 + 修饰(粗体/删除线/下划线/斜体) */
1742
+ declare function Text({ text, type, size, strong, delete: del, underline, italic, className, style, children, }: TextProps): React.JSX.Element;
1722
1743
 
1723
1744
  interface TextareaProps {
1724
1745
  /** 字段名;在 Form 内声明 name 即自动成为表单项 */
@@ -71,7 +71,7 @@ import {
71
71
  createComponentRegistry,
72
72
  registerBuiltinComponents,
73
73
  useFormContext
74
- } from "../chunk-M4PHRT2N.js";
74
+ } from "../chunk-3KCE7ROX.js";
75
75
  import {
76
76
  ICONS,
77
77
  Icon,
@@ -80,10 +80,10 @@ import {
80
80
  Sidebar,
81
81
  normalizeIconName,
82
82
  useSidebarDrawer
83
- } from "../chunk-PECP7DJB.js";
84
- import "../chunk-VT5XP4U4.js";
83
+ } from "../chunk-2B5YV2HR.js";
84
+ import "../chunk-XEK5NQJA.js";
85
85
  import "../chunk-XUHJ5YSG.js";
86
- import "../chunk-VM4FESQB.js";
86
+ import "../chunk-AUSWAD26.js";
87
87
  import "../chunk-WKJUCGV4.js";
88
88
  export {
89
89
  Accordion,