@pactor-app/ui 1.13.0 → 1.14.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.
@@ -1645,18 +1645,49 @@ function Empty2({ title, description, children, className, style }) {
1645
1645
 
1646
1646
  // src/components/components/Field/index.tsx
1647
1647
  import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
1648
- function Field2({ label, required, description, error, children, className, style }) {
1648
+ function Field2({
1649
+ label,
1650
+ required,
1651
+ description,
1652
+ error,
1653
+ children,
1654
+ className,
1655
+ style,
1656
+ labelClassName,
1657
+ labelStyle,
1658
+ controlClassName,
1659
+ controlStyle,
1660
+ descriptionClassName,
1661
+ descriptionStyle,
1662
+ errorClassName,
1663
+ errorStyle
1664
+ }) {
1649
1665
  return /* @__PURE__ */ jsxs23(Field, { className, style, children: [
1650
- label ? /* @__PURE__ */ jsxs23(FieldLabel, { children: [
1666
+ label ? /* @__PURE__ */ jsxs23(FieldLabel, { className: labelClassName, style: labelStyle, children: [
1651
1667
  required ? /* @__PURE__ */ jsxs23("span", { "aria-hidden": true, className: "text-destructive", children: [
1652
1668
  "*",
1653
1669
  " "
1654
1670
  ] }) : null,
1655
1671
  label
1656
1672
  ] }) : null,
1657
- children,
1658
- description ? /* @__PURE__ */ jsx28(FieldDescription, { children: description }) : null,
1659
- error ? /* @__PURE__ */ jsx28(FieldError, { match: true, children: error }) : null
1673
+ /* @__PURE__ */ jsx28(
1674
+ "div",
1675
+ {
1676
+ "data-slot": "field-control",
1677
+ className: cn(label ? "mt-2" : void 0, controlClassName),
1678
+ style: controlStyle,
1679
+ children
1680
+ }
1681
+ ),
1682
+ description ? /* @__PURE__ */ jsx28(
1683
+ FieldDescription,
1684
+ {
1685
+ className: descriptionClassName,
1686
+ style: descriptionStyle,
1687
+ children: description
1688
+ }
1689
+ ) : null,
1690
+ error ? /* @__PURE__ */ jsx28(FieldError, { match: true, className: errorClassName, style: errorStyle, children: error }) : null
1660
1691
  ] });
1661
1692
  }
1662
1693
 
@@ -3528,18 +3528,49 @@ function FieldError({ className, ...props }) {
3528
3528
 
3529
3529
  // src/components/components/Field/index.tsx
3530
3530
  var import_jsx_runtime57 = require("react/jsx-runtime");
3531
- function Field2({ label, required, description, error, children, className, style }) {
3531
+ function Field2({
3532
+ label,
3533
+ required,
3534
+ description,
3535
+ error,
3536
+ children,
3537
+ className,
3538
+ style,
3539
+ labelClassName,
3540
+ labelStyle,
3541
+ controlClassName,
3542
+ controlStyle,
3543
+ descriptionClassName,
3544
+ descriptionStyle,
3545
+ errorClassName,
3546
+ errorStyle
3547
+ }) {
3532
3548
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Field, { className, style, children: [
3533
- label ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(FieldLabel, { children: [
3549
+ label ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(FieldLabel, { className: labelClassName, style: labelStyle, children: [
3534
3550
  required ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { "aria-hidden": true, className: "text-destructive", children: [
3535
3551
  "*",
3536
3552
  " "
3537
3553
  ] }) : null,
3538
3554
  label
3539
3555
  ] }) : null,
3540
- children,
3541
- description ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FieldDescription, { children: description }) : null,
3542
- error ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FieldError, { match: true, children: error }) : null
3556
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
3557
+ "div",
3558
+ {
3559
+ "data-slot": "field-control",
3560
+ className: cn(label ? "mt-2" : void 0, controlClassName),
3561
+ style: controlStyle,
3562
+ children
3563
+ }
3564
+ ),
3565
+ description ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
3566
+ FieldDescription,
3567
+ {
3568
+ className: descriptionClassName,
3569
+ style: descriptionStyle,
3570
+ children: description
3571
+ }
3572
+ ) : null,
3573
+ error ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FieldError, { match: true, className: errorClassName, style: errorStyle, children: error }) : null
3543
3574
  ] });
3544
3575
  }
3545
3576
 
@@ -760,13 +760,27 @@ interface FieldProps {
760
760
  className?: string;
761
761
  /** 通用:根节点内联样式 */
762
762
  style?: CSSProperties;
763
+ /** label 节点 class / style(必填星号随 label 节点) */
764
+ labelClassName?: string;
765
+ labelStyle?: CSSProperties;
766
+ /** 控件容器(label 下方)class / style;缺省有 label 时容器自带 mt-2 */
767
+ controlClassName?: string;
768
+ controlStyle?: CSSProperties;
769
+ /** 辅助说明节点 class / style */
770
+ descriptionClassName?: string;
771
+ descriptionStyle?: CSSProperties;
772
+ /** 错误节点 class / style */
773
+ errorClassName?: string;
774
+ errorStyle?: CSSProperties;
763
775
  }
764
776
  /**
765
- * Field 适配器(shadcn kit):通用表单项容器(Base UI Field 封装);
766
- * label / description / error 为框架级 props,error 声明式强制展示;
767
- * `required` 在 label 前渲染必填星号(对齐 antd Form.Item required 语义)。
777
+ * Field 适配器(shadcn kit):通用表单项容器(Base UI Field 封装,
778
+ * 上下结构:label 在上、控件容器在下);label / description / error 为
779
+ * 框架级 props,error 声明式强制展示;`required` 在 label 前渲染必填星号
780
+ * (对齐 antd Form.Item required 语义);label 与控件容器之间默认 mt-2,
781
+ * 四个节点(label / 控件容器 / description / error)均可独立加样式。
768
782
  */
769
- declare function Field({ label, required, description, error, children, className, style }: FieldProps): React.JSX.Element;
783
+ declare function Field({ label, required, description, error, children, className, style, labelClassName, labelStyle, controlClassName, controlStyle, descriptionClassName, descriptionStyle, errorClassName, errorStyle, }: FieldProps): React.JSX.Element;
770
784
 
771
785
  interface FlexProps {
772
786
  /** 主轴方向,默认 horizontal */
@@ -760,13 +760,27 @@ interface FieldProps {
760
760
  className?: string;
761
761
  /** 通用:根节点内联样式 */
762
762
  style?: CSSProperties;
763
+ /** label 节点 class / style(必填星号随 label 节点) */
764
+ labelClassName?: string;
765
+ labelStyle?: CSSProperties;
766
+ /** 控件容器(label 下方)class / style;缺省有 label 时容器自带 mt-2 */
767
+ controlClassName?: string;
768
+ controlStyle?: CSSProperties;
769
+ /** 辅助说明节点 class / style */
770
+ descriptionClassName?: string;
771
+ descriptionStyle?: CSSProperties;
772
+ /** 错误节点 class / style */
773
+ errorClassName?: string;
774
+ errorStyle?: CSSProperties;
763
775
  }
764
776
  /**
765
- * Field 适配器(shadcn kit):通用表单项容器(Base UI Field 封装);
766
- * label / description / error 为框架级 props,error 声明式强制展示;
767
- * `required` 在 label 前渲染必填星号(对齐 antd Form.Item required 语义)。
777
+ * Field 适配器(shadcn kit):通用表单项容器(Base UI Field 封装,
778
+ * 上下结构:label 在上、控件容器在下);label / description / error 为
779
+ * 框架级 props,error 声明式强制展示;`required` 在 label 前渲染必填星号
780
+ * (对齐 antd Form.Item required 语义);label 与控件容器之间默认 mt-2,
781
+ * 四个节点(label / 控件容器 / description / error)均可独立加样式。
768
782
  */
769
- declare function Field({ label, required, description, error, children, className, style }: FieldProps): React.JSX.Element;
783
+ declare function Field({ label, required, description, error, children, className, style, labelClassName, labelStyle, controlClassName, controlStyle, descriptionClassName, descriptionStyle, errorClassName, errorStyle, }: FieldProps): React.JSX.Element;
770
784
 
771
785
  interface FlexProps {
772
786
  /** 主轴方向,默认 horizontal */
@@ -71,7 +71,7 @@ import {
71
71
  createComponentRegistry,
72
72
  registerBuiltinComponents,
73
73
  useFormContext
74
- } from "../chunk-CFUWF54N.js";
74
+ } from "../chunk-L77EOXU3.js";
75
75
  import {
76
76
  ICONS,
77
77
  Icon,
package/dist/index.cjs CHANGED
@@ -3567,18 +3567,49 @@ function FieldError({ className, ...props }) {
3567
3567
 
3568
3568
  // src/components/components/Field/index.tsx
3569
3569
  var import_jsx_runtime57 = require("react/jsx-runtime");
3570
- function Field2({ label, required, description, error, children, className, style }) {
3570
+ function Field2({
3571
+ label,
3572
+ required,
3573
+ description,
3574
+ error,
3575
+ children,
3576
+ className,
3577
+ style,
3578
+ labelClassName,
3579
+ labelStyle,
3580
+ controlClassName,
3581
+ controlStyle,
3582
+ descriptionClassName,
3583
+ descriptionStyle,
3584
+ errorClassName,
3585
+ errorStyle
3586
+ }) {
3571
3587
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Field, { className, style, children: [
3572
- label ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(FieldLabel, { children: [
3588
+ label ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(FieldLabel, { className: labelClassName, style: labelStyle, children: [
3573
3589
  required ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { "aria-hidden": true, className: "text-destructive", children: [
3574
3590
  "*",
3575
3591
  " "
3576
3592
  ] }) : null,
3577
3593
  label
3578
3594
  ] }) : null,
3579
- children,
3580
- description ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FieldDescription, { children: description }) : null,
3581
- error ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FieldError, { match: true, children: error }) : null
3595
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
3596
+ "div",
3597
+ {
3598
+ "data-slot": "field-control",
3599
+ className: cn(label ? "mt-2" : void 0, controlClassName),
3600
+ style: controlStyle,
3601
+ children
3602
+ }
3603
+ ),
3604
+ description ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
3605
+ FieldDescription,
3606
+ {
3607
+ className: descriptionClassName,
3608
+ style: descriptionStyle,
3609
+ children: description
3610
+ }
3611
+ ) : null,
3612
+ error ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FieldError, { match: true, className: errorClassName, style: errorStyle, children: error }) : null
3582
3613
  ] });
3583
3614
  }
3584
3615
 
package/dist/index.js CHANGED
@@ -71,7 +71,7 @@ import {
71
71
  createComponentRegistry,
72
72
  registerBuiltinComponents,
73
73
  useFormContext
74
- } from "./chunk-CFUWF54N.js";
74
+ } from "./chunk-L77EOXU3.js";
75
75
  import {
76
76
  InteractionProvider,
77
77
  OVERLAY_CANCEL_PAYLOAD,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pactor-app/ui",
3
- "version": "1.13.0",
3
+ "version": "1.14.0",
4
4
  "description": "Pactor UI kit (shadcn): the single built-in UI kit — vendored shadcn/ui components (Base UI primitives + cva + tailwind-merge + lucide-react), props contracts, interaction core (OverlayManager / UiBridge) and layouts, with build-time Tailwind v4 prebuilt styles.css (zero consumer-side Tailwind config)",
5
5
  "keywords": [
6
6
  "pactor",
@@ -105,10 +105,10 @@
105
105
  "recharts": "^3.10.1",
106
106
  "tailwind-merge": "^3.6.0",
107
107
  "vaul": "^1.1.2",
108
- "@pactor-app/core": "1.13.0",
109
- "@pactor-app/router": "1.13.0",
110
- "@pactor-app/runtime": "1.13.0",
111
- "@pactor-app/permission": "1.13.0"
108
+ "@pactor-app/core": "1.14.0",
109
+ "@pactor-app/runtime": "1.14.0",
110
+ "@pactor-app/router": "1.14.0",
111
+ "@pactor-app/permission": "1.14.0"
112
112
  },
113
113
  "peerDependencies": {
114
114
  "react": ">=18",