@pactor-app/ui 1.8.0 → 1.10.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.
@@ -41,13 +41,20 @@ interface AlertProps {
41
41
  description?: string;
42
42
  /** 变体,默认 info */
43
43
  variant?: AlertVariant;
44
+ /** 是否显示图标;true 时按 variant 显示对应默认图标 */
45
+ showIcon?: boolean;
46
+ /** 自定义图标名(Icon 白名单,kebab-case / PascalCase 均可);提供时隐含 showIcon */
47
+ icon?: string;
44
48
  /** 通用:根节点 class(与内置样式合并) */
45
49
  className?: string;
46
50
  /** 通用:根节点内联样式 */
47
51
  style?: CSSProperties;
48
52
  }
49
- /** Alert 适配器(shadcn kit):message → AlertTitle,description → AlertDescription */
50
- declare function Alert({ message, description, variant, className, style }: AlertProps): React.JSX.Element;
53
+ /**
54
+ * Alert 适配器(shadcn kit):message → AlertTitle,description → AlertDescription;
55
+ * `showIcon` / `icon` 渲染前缀图标(vendored Alert 的 has-[>svg] 栅格自动让出图标列)
56
+ */
57
+ declare function Alert({ message, description, variant, showIcon, icon, className, style, }: AlertProps): React.JSX.Element;
51
58
 
52
59
  interface AlertDialogProps {
53
60
  /** 标题 */
@@ -202,6 +209,9 @@ interface InputProps {
202
209
  type?: 'text' | 'password';
203
210
  placeholder?: string;
204
211
  disabled?: boolean;
212
+ /** 值为非空时显示清除按钮,点击清空当前值;开启后独立渲染的
213
+ * className/style 挂控件包裹节点(含清除按钮),未开启时保持挂控件本身 */
214
+ allowClear?: boolean;
205
215
  /** 输入事件,传出 string 值(非原生 event,设计决策 D2) */
206
216
  onChange?: (value: string) => void;
207
217
  /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件本身) */
@@ -216,7 +226,7 @@ interface InputProps {
216
226
  * 表单项为去原语化结构(design D3):`<div data-slot="form-item">` +
217
227
  * `<label htmlFor>` 与控件 `useId` 关联。
218
228
  */
219
- declare function Input({ name, label, rules, value, type, placeholder, disabled, onChange, className, style, }: InputProps): React.JSX.Element;
229
+ declare function Input({ name, label, rules, value, type, placeholder, disabled, allowClear, onChange, className, style, }: InputProps): React.JSX.Element;
220
230
 
221
231
  interface CalendarProps {
222
232
  /** 字段名;在 Form 内声明 name 即自动成为表单项 */
@@ -1270,6 +1280,8 @@ interface RadioGroupProps {
1270
1280
  rules?: FieldRule[];
1271
1281
  /** 选项列表 */
1272
1282
  options?: RadioGroupOption[];
1283
+ /** 选项排列方向,默认 vertical */
1284
+ direction?: 'horizontal' | 'vertical';
1273
1285
  /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
1274
1286
  value?: string | number | boolean;
1275
1287
  disabled?: boolean;
@@ -1283,9 +1295,10 @@ interface RadioGroupProps {
1283
1295
  /**
1284
1296
  * RadioGroup 适配器(shadcn kit):基于 vendored RadioGroup(Base UI);
1285
1297
  * Base UI RadioGroup 的 value 原生支持 string/number/boolean,
1286
- * onChange 传出选中项原始 value。
1298
+ * onChange 传出选中项原始 value。`direction` 控制选项横/纵排列;
1299
+ * label 经 htmlFor 关联 Base UI 隐藏原生 input,点击 label 即选中对应项。
1287
1300
  */
1288
- declare function RadioGroup({ name, label, rules, options, value, disabled, onChange, className, style, }: RadioGroupProps): React.JSX.Element;
1301
+ declare function RadioGroup({ name, label, rules, options, direction, value, disabled, onChange, className, style, }: RadioGroupProps): React.JSX.Element;
1289
1302
 
1290
1303
  /** 可拖拽面板;`children` 为 DSL 子树,经 renderChildren 渲染 */
1291
1304
  interface ResizablePanelData {
@@ -1667,6 +1680,8 @@ interface TabsProps {
1667
1680
  items?: TabItem[];
1668
1681
  /** 当前激活页签 key(可绑表达式) */
1669
1682
  activeKey?: string;
1683
+ /** 页签栏样式:default 胶囊(缺省)/ line 下划线 */
1684
+ variant?: 'default' | 'line';
1670
1685
  /** 页签切换事件,传出新激活的 key */
1671
1686
  onChange?: (key: string) => void;
1672
1687
  /** 通用:根节点 class(与内置样式合并) */
@@ -1679,7 +1694,7 @@ interface TabsProps {
1679
1694
  * 基于 vendored shadcn Tabs(@base-ui/react),每个 pane 的内容经
1680
1695
  * renderChildren 渲染;未传 activeKey 时缺省激活第一个页签。
1681
1696
  */
1682
- declare function Tabs({ items, activeKey, onChange, className, style }: TabsProps): React.JSX.Element;
1697
+ declare function Tabs({ items, activeKey, variant, onChange, className, style }: TabsProps): React.JSX.Element;
1683
1698
 
1684
1699
  /** DSL Text 语义类型 */
1685
1700
  type TextType = 'default' | 'secondary' | 'success' | 'warning' | 'danger';
@@ -41,13 +41,20 @@ interface AlertProps {
41
41
  description?: string;
42
42
  /** 变体,默认 info */
43
43
  variant?: AlertVariant;
44
+ /** 是否显示图标;true 时按 variant 显示对应默认图标 */
45
+ showIcon?: boolean;
46
+ /** 自定义图标名(Icon 白名单,kebab-case / PascalCase 均可);提供时隐含 showIcon */
47
+ icon?: string;
44
48
  /** 通用:根节点 class(与内置样式合并) */
45
49
  className?: string;
46
50
  /** 通用:根节点内联样式 */
47
51
  style?: CSSProperties;
48
52
  }
49
- /** Alert 适配器(shadcn kit):message → AlertTitle,description → AlertDescription */
50
- declare function Alert({ message, description, variant, className, style }: AlertProps): React.JSX.Element;
53
+ /**
54
+ * Alert 适配器(shadcn kit):message → AlertTitle,description → AlertDescription;
55
+ * `showIcon` / `icon` 渲染前缀图标(vendored Alert 的 has-[>svg] 栅格自动让出图标列)
56
+ */
57
+ declare function Alert({ message, description, variant, showIcon, icon, className, style, }: AlertProps): React.JSX.Element;
51
58
 
52
59
  interface AlertDialogProps {
53
60
  /** 标题 */
@@ -202,6 +209,9 @@ interface InputProps {
202
209
  type?: 'text' | 'password';
203
210
  placeholder?: string;
204
211
  disabled?: boolean;
212
+ /** 值为非空时显示清除按钮,点击清空当前值;开启后独立渲染的
213
+ * className/style 挂控件包裹节点(含清除按钮),未开启时保持挂控件本身 */
214
+ allowClear?: boolean;
205
215
  /** 输入事件,传出 string 值(非原生 event,设计决策 D2) */
206
216
  onChange?: (value: string) => void;
207
217
  /** 通用:根节点 class(Form 内为 form-item 容器,独立渲染时为控件本身) */
@@ -216,7 +226,7 @@ interface InputProps {
216
226
  * 表单项为去原语化结构(design D3):`<div data-slot="form-item">` +
217
227
  * `<label htmlFor>` 与控件 `useId` 关联。
218
228
  */
219
- declare function Input({ name, label, rules, value, type, placeholder, disabled, onChange, className, style, }: InputProps): React.JSX.Element;
229
+ declare function Input({ name, label, rules, value, type, placeholder, disabled, allowClear, onChange, className, style, }: InputProps): React.JSX.Element;
220
230
 
221
231
  interface CalendarProps {
222
232
  /** 字段名;在 Form 内声明 name 即自动成为表单项 */
@@ -1270,6 +1280,8 @@ interface RadioGroupProps {
1270
1280
  rules?: FieldRule[];
1271
1281
  /** 选项列表 */
1272
1282
  options?: RadioGroupOption[];
1283
+ /** 选项排列方向,默认 vertical */
1284
+ direction?: 'horizontal' | 'vertical';
1273
1285
  /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
1274
1286
  value?: string | number | boolean;
1275
1287
  disabled?: boolean;
@@ -1283,9 +1295,10 @@ interface RadioGroupProps {
1283
1295
  /**
1284
1296
  * RadioGroup 适配器(shadcn kit):基于 vendored RadioGroup(Base UI);
1285
1297
  * Base UI RadioGroup 的 value 原生支持 string/number/boolean,
1286
- * onChange 传出选中项原始 value。
1298
+ * onChange 传出选中项原始 value。`direction` 控制选项横/纵排列;
1299
+ * label 经 htmlFor 关联 Base UI 隐藏原生 input,点击 label 即选中对应项。
1287
1300
  */
1288
- declare function RadioGroup({ name, label, rules, options, value, disabled, onChange, className, style, }: RadioGroupProps): React.JSX.Element;
1301
+ declare function RadioGroup({ name, label, rules, options, direction, value, disabled, onChange, className, style, }: RadioGroupProps): React.JSX.Element;
1289
1302
 
1290
1303
  /** 可拖拽面板;`children` 为 DSL 子树,经 renderChildren 渲染 */
1291
1304
  interface ResizablePanelData {
@@ -1667,6 +1680,8 @@ interface TabsProps {
1667
1680
  items?: TabItem[];
1668
1681
  /** 当前激活页签 key(可绑表达式) */
1669
1682
  activeKey?: string;
1683
+ /** 页签栏样式:default 胶囊(缺省)/ line 下划线 */
1684
+ variant?: 'default' | 'line';
1670
1685
  /** 页签切换事件,传出新激活的 key */
1671
1686
  onChange?: (key: string) => void;
1672
1687
  /** 通用:根节点 class(与内置样式合并) */
@@ -1679,7 +1694,7 @@ interface TabsProps {
1679
1694
  * 基于 vendored shadcn Tabs(@base-ui/react),每个 pane 的内容经
1680
1695
  * renderChildren 渲染;未传 activeKey 时缺省激活第一个页签。
1681
1696
  */
1682
- declare function Tabs({ items, activeKey, onChange, className, style }: TabsProps): React.JSX.Element;
1697
+ declare function Tabs({ items, activeKey, variant, onChange, className, style }: TabsProps): React.JSX.Element;
1683
1698
 
1684
1699
  /** DSL Text 语义类型 */
1685
1700
  type TextType = 'default' | 'secondary' | 'success' | 'warning' | 'danger';
@@ -71,7 +71,7 @@ import {
71
71
  createComponentRegistry,
72
72
  registerBuiltinComponents,
73
73
  useFormContext
74
- } from "../chunk-7YOIAVV6.js";
74
+ } from "../chunk-M4PHRT2N.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-XUIXZJDQ.js";
85
- import "../chunk-F42SGQNW.js";
84
+ import "../chunk-VT5XP4U4.js";
85
+ import "../chunk-XUHJ5YSG.js";
86
86
  import "../chunk-VM4FESQB.js";
87
87
  import "../chunk-WKJUCGV4.js";
88
88
  export {