@pactor-app/ui 1.25.0 → 1.26.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.
@@ -2645,6 +2645,7 @@ import { jsx as jsx39, jsxs as jsxs30 } from "react/jsx-runtime";
2645
2645
  function Field2({
2646
2646
  label,
2647
2647
  required,
2648
+ labelHint,
2648
2649
  description,
2649
2650
  error,
2650
2651
  children,
@@ -2652,6 +2653,8 @@ function Field2({
2652
2653
  style,
2653
2654
  labelClassName,
2654
2655
  labelStyle,
2656
+ labelHintClassName,
2657
+ labelHintStyle,
2655
2658
  controlClassName,
2656
2659
  controlStyle,
2657
2660
  descriptionClassName,
@@ -2660,18 +2663,32 @@ function Field2({
2660
2663
  errorStyle
2661
2664
  }) {
2662
2665
  return /* @__PURE__ */ jsxs30(Field, { className, style, children: [
2663
- label ? /* @__PURE__ */ jsxs30(FieldLabel, { className: labelClassName, style: labelStyle, children: [
2664
- required ? /* @__PURE__ */ jsxs30("span", { "aria-hidden": true, className: "text-destructive", children: [
2665
- "*",
2666
- " "
2667
- ] }) : null,
2668
- label
2666
+ label || labelHint ? /* @__PURE__ */ jsxs30("div", { className: "flex w-full items-center justify-between gap-2", children: [
2667
+ label ? /* @__PURE__ */ jsxs30(FieldLabel, { className: labelClassName, style: labelStyle, children: [
2668
+ required ? /* @__PURE__ */ jsxs30("span", { "aria-hidden": true, className: "text-destructive", children: [
2669
+ "*",
2670
+ " "
2671
+ ] }) : null,
2672
+ label
2673
+ ] }) : /* @__PURE__ */ jsx39("span", {}),
2674
+ labelHint ? /* @__PURE__ */ jsx39(
2675
+ "span",
2676
+ {
2677
+ "data-slot": "field-label-hint",
2678
+ className: cn(
2679
+ "shrink-0 text-xs leading-none text-muted-foreground",
2680
+ labelHintClassName
2681
+ ),
2682
+ style: labelHintStyle,
2683
+ children: labelHint
2684
+ }
2685
+ ) : null
2669
2686
  ] }) : null,
2670
2687
  /* @__PURE__ */ jsx39(
2671
2688
  "div",
2672
2689
  {
2673
2690
  "data-slot": "field-control",
2674
- className: cn(label ? "mt-2" : void 0, controlClassName),
2691
+ className: cn(label || labelHint ? "mt-2" : void 0, controlClassName),
2675
2692
  style: controlStyle,
2676
2693
  children
2677
2694
  }
@@ -4592,6 +4592,7 @@ var import_jsx_runtime67 = require("react/jsx-runtime");
4592
4592
  function Field2({
4593
4593
  label,
4594
4594
  required,
4595
+ labelHint,
4595
4596
  description,
4596
4597
  error,
4597
4598
  children,
@@ -4599,6 +4600,8 @@ function Field2({
4599
4600
  style,
4600
4601
  labelClassName,
4601
4602
  labelStyle,
4603
+ labelHintClassName,
4604
+ labelHintStyle,
4602
4605
  controlClassName,
4603
4606
  controlStyle,
4604
4607
  descriptionClassName,
@@ -4607,18 +4610,32 @@ function Field2({
4607
4610
  errorStyle
4608
4611
  }) {
4609
4612
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Field, { className, style, children: [
4610
- label ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(FieldLabel, { className: labelClassName, style: labelStyle, children: [
4611
- required ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { "aria-hidden": true, className: "text-destructive", children: [
4612
- "*",
4613
- " "
4614
- ] }) : null,
4615
- label
4613
+ label || labelHint ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex w-full items-center justify-between gap-2", children: [
4614
+ label ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(FieldLabel, { className: labelClassName, style: labelStyle, children: [
4615
+ required ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { "aria-hidden": true, className: "text-destructive", children: [
4616
+ "*",
4617
+ " "
4618
+ ] }) : null,
4619
+ label
4620
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", {}),
4621
+ labelHint ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
4622
+ "span",
4623
+ {
4624
+ "data-slot": "field-label-hint",
4625
+ className: cn(
4626
+ "shrink-0 text-xs leading-none text-muted-foreground",
4627
+ labelHintClassName
4628
+ ),
4629
+ style: labelHintStyle,
4630
+ children: labelHint
4631
+ }
4632
+ ) : null
4616
4633
  ] }) : null,
4617
4634
  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
4618
4635
  "div",
4619
4636
  {
4620
4637
  "data-slot": "field-control",
4621
- className: cn(label ? "mt-2" : void 0, controlClassName),
4638
+ className: cn(label || labelHint ? "mt-2" : void 0, controlClassName),
4622
4639
  style: controlStyle,
4623
4640
  children
4624
4641
  }
@@ -989,6 +989,8 @@ interface FieldProps {
989
989
  label?: string;
990
990
  /** 必填标记(label 前渲染红色 `*`;仅视觉标记,校验仍由 Form rules 承担) */
991
991
  required?: boolean;
992
+ /** label 行右侧的提示文字(如「创建后不可修改」),右对齐小字弱化展示 */
993
+ labelHint?: string;
992
994
  /** 辅助说明文案 */
993
995
  description?: string;
994
996
  /** 错误文案(声明式展示,如校验失败信息) */
@@ -1002,6 +1004,9 @@ interface FieldProps {
1002
1004
  /** label 节点 class / style(必填星号随 label 节点) */
1003
1005
  labelClassName?: string;
1004
1006
  labelStyle?: CSSProperties;
1007
+ /** label 行右侧提示节点 class / style */
1008
+ labelHintClassName?: string;
1009
+ labelHintStyle?: CSSProperties;
1005
1010
  /** 控件容器(label 下方)class / style;缺省有 label 时容器自带 mt-2 */
1006
1011
  controlClassName?: string;
1007
1012
  controlStyle?: CSSProperties;
@@ -1014,12 +1019,13 @@ interface FieldProps {
1014
1019
  }
1015
1020
  /**
1016
1021
  * Field 适配器(shadcn kit):通用表单项容器(Base UI Field 封装,
1017
- * 上下结构:label 在上、控件容器在下);label / description / error 为
1018
- * 框架级 props,error 声明式强制展示;`required` 在 label 前渲染必填星号
1019
- * (对齐 antd Form.Item required 语义);label 与控件容器之间默认 mt-2,
1020
- * 四个节点(label / 控件容器 / description / error)均可独立加样式。
1022
+ * 上下结构:label 在上、控件容器在下);label / labelHint / description /
1023
+ * error 为框架级 props,error 声明式强制展示;`required` 在 label 前渲染
1024
+ * 必填星号(对齐 antd Form.Item required 语义);`labelHint` 与 label 同行
1025
+ * 右对齐(弱化为小字);label 与控件容器之间默认 mt-2,五个节点
1026
+ * (label / labelHint / 控件容器 / description / error)均可独立加样式。
1021
1027
  */
1022
- declare function Field({ label, required, description, error, children, className, style, labelClassName, labelStyle, controlClassName, controlStyle, descriptionClassName, descriptionStyle, errorClassName, errorStyle, }: FieldProps): React.JSX.Element;
1028
+ declare function Field({ label, required, labelHint, description, error, children, className, style, labelClassName, labelStyle, labelHintClassName, labelHintStyle, controlClassName, controlStyle, descriptionClassName, descriptionStyle, errorClassName, errorStyle, }: FieldProps): React.JSX.Element;
1023
1029
 
1024
1030
  /** 文件类别(缺省按 fileType / name 扩展名推断) */
1025
1031
  type FilePreviewKind = 'image' | 'text' | 'video' | 'audio' | 'other';
@@ -989,6 +989,8 @@ interface FieldProps {
989
989
  label?: string;
990
990
  /** 必填标记(label 前渲染红色 `*`;仅视觉标记,校验仍由 Form rules 承担) */
991
991
  required?: boolean;
992
+ /** label 行右侧的提示文字(如「创建后不可修改」),右对齐小字弱化展示 */
993
+ labelHint?: string;
992
994
  /** 辅助说明文案 */
993
995
  description?: string;
994
996
  /** 错误文案(声明式展示,如校验失败信息) */
@@ -1002,6 +1004,9 @@ interface FieldProps {
1002
1004
  /** label 节点 class / style(必填星号随 label 节点) */
1003
1005
  labelClassName?: string;
1004
1006
  labelStyle?: CSSProperties;
1007
+ /** label 行右侧提示节点 class / style */
1008
+ labelHintClassName?: string;
1009
+ labelHintStyle?: CSSProperties;
1005
1010
  /** 控件容器(label 下方)class / style;缺省有 label 时容器自带 mt-2 */
1006
1011
  controlClassName?: string;
1007
1012
  controlStyle?: CSSProperties;
@@ -1014,12 +1019,13 @@ interface FieldProps {
1014
1019
  }
1015
1020
  /**
1016
1021
  * Field 适配器(shadcn kit):通用表单项容器(Base UI Field 封装,
1017
- * 上下结构:label 在上、控件容器在下);label / description / error 为
1018
- * 框架级 props,error 声明式强制展示;`required` 在 label 前渲染必填星号
1019
- * (对齐 antd Form.Item required 语义);label 与控件容器之间默认 mt-2,
1020
- * 四个节点(label / 控件容器 / description / error)均可独立加样式。
1022
+ * 上下结构:label 在上、控件容器在下);label / labelHint / description /
1023
+ * error 为框架级 props,error 声明式强制展示;`required` 在 label 前渲染
1024
+ * 必填星号(对齐 antd Form.Item required 语义);`labelHint` 与 label 同行
1025
+ * 右对齐(弱化为小字);label 与控件容器之间默认 mt-2,五个节点
1026
+ * (label / labelHint / 控件容器 / description / error)均可独立加样式。
1021
1027
  */
1022
- declare function Field({ label, required, description, error, children, className, style, labelClassName, labelStyle, controlClassName, controlStyle, descriptionClassName, descriptionStyle, errorClassName, errorStyle, }: FieldProps): React.JSX.Element;
1028
+ declare function Field({ label, required, labelHint, description, error, children, className, style, labelClassName, labelStyle, labelHintClassName, labelHintStyle, controlClassName, controlStyle, descriptionClassName, descriptionStyle, errorClassName, errorStyle, }: FieldProps): React.JSX.Element;
1023
1029
 
1024
1030
  /** 文件类别(缺省按 fileType / name 扩展名推断) */
1025
1031
  type FilePreviewKind = 'image' | 'text' | 'video' | 'audio' | 'other';
@@ -154,7 +154,7 @@ import {
154
154
  inferKind,
155
155
  registerBuiltinComponents,
156
156
  useFormContext
157
- } from "../chunk-7VQS23L5.js";
157
+ } from "../chunk-HSQJWJDS.js";
158
158
  import {
159
159
  ICONS,
160
160
  Icon,
package/dist/index.cjs CHANGED
@@ -4631,6 +4631,7 @@ var import_jsx_runtime67 = require("react/jsx-runtime");
4631
4631
  function Field2({
4632
4632
  label,
4633
4633
  required,
4634
+ labelHint,
4634
4635
  description,
4635
4636
  error,
4636
4637
  children,
@@ -4638,6 +4639,8 @@ function Field2({
4638
4639
  style,
4639
4640
  labelClassName,
4640
4641
  labelStyle,
4642
+ labelHintClassName,
4643
+ labelHintStyle,
4641
4644
  controlClassName,
4642
4645
  controlStyle,
4643
4646
  descriptionClassName,
@@ -4646,18 +4649,32 @@ function Field2({
4646
4649
  errorStyle
4647
4650
  }) {
4648
4651
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Field, { className, style, children: [
4649
- label ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(FieldLabel, { className: labelClassName, style: labelStyle, children: [
4650
- required ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { "aria-hidden": true, className: "text-destructive", children: [
4651
- "*",
4652
- " "
4653
- ] }) : null,
4654
- label
4652
+ label || labelHint ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex w-full items-center justify-between gap-2", children: [
4653
+ label ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(FieldLabel, { className: labelClassName, style: labelStyle, children: [
4654
+ required ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { "aria-hidden": true, className: "text-destructive", children: [
4655
+ "*",
4656
+ " "
4657
+ ] }) : null,
4658
+ label
4659
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", {}),
4660
+ labelHint ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
4661
+ "span",
4662
+ {
4663
+ "data-slot": "field-label-hint",
4664
+ className: cn(
4665
+ "shrink-0 text-xs leading-none text-muted-foreground",
4666
+ labelHintClassName
4667
+ ),
4668
+ style: labelHintStyle,
4669
+ children: labelHint
4670
+ }
4671
+ ) : null
4655
4672
  ] }) : null,
4656
4673
  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
4657
4674
  "div",
4658
4675
  {
4659
4676
  "data-slot": "field-control",
4660
- className: cn(label ? "mt-2" : void 0, controlClassName),
4677
+ className: cn(label || labelHint ? "mt-2" : void 0, controlClassName),
4661
4678
  style: controlStyle,
4662
4679
  children
4663
4680
  }
package/dist/index.js CHANGED
@@ -154,7 +154,7 @@ import {
154
154
  inferKind,
155
155
  registerBuiltinComponents,
156
156
  useFormContext
157
- } from "./chunk-7VQS23L5.js";
157
+ } from "./chunk-HSQJWJDS.js";
158
158
  import {
159
159
  InteractionProvider,
160
160
  OVERLAY_CANCEL_PAYLOAD,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pactor-app/ui",
3
- "version": "1.25.0",
3
+ "version": "1.26.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",
@@ -107,11 +107,11 @@
107
107
  "react-resizable-panels": "^4.12.3",
108
108
  "tailwind-merge": "^3.6.0",
109
109
  "vaul": "^1.1.2",
110
- "@pactor-app/core": "1.25.0",
111
- "@pactor-app/router": "1.25.0",
112
- "@pactor-app/markdown": "1.25.0",
113
- "@pactor-app/permission": "1.25.0",
114
- "@pactor-app/runtime": "1.25.0"
110
+ "@pactor-app/core": "1.26.0",
111
+ "@pactor-app/runtime": "1.26.0",
112
+ "@pactor-app/permission": "1.26.0",
113
+ "@pactor-app/router": "1.26.0",
114
+ "@pactor-app/markdown": "1.26.0"
115
115
  },
116
116
  "peerDependencies": {
117
117
  "react": ">=18",