@pactor-app/ui 1.32.0 → 1.34.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.
@@ -2571,6 +2571,7 @@ function Drawer2({
2571
2571
  title,
2572
2572
  open,
2573
2573
  placement = "right",
2574
+ draggable,
2574
2575
  onClose,
2575
2576
  children,
2576
2577
  className,
@@ -2581,6 +2582,7 @@ function Drawer2({
2581
2582
  {
2582
2583
  direction: placement,
2583
2584
  modal: false,
2585
+ handleOnly: draggable !== true,
2584
2586
  open: open ?? false,
2585
2587
  onOpenChange: (next) => {
2586
2588
  if (!next) {
@@ -4309,6 +4309,7 @@ function Drawer2({
4309
4309
  title,
4310
4310
  open,
4311
4311
  placement = "right",
4312
+ draggable,
4312
4313
  onClose,
4313
4314
  children,
4314
4315
  className,
@@ -4319,6 +4320,7 @@ function Drawer2({
4319
4320
  {
4320
4321
  direction: placement,
4321
4322
  modal: false,
4323
+ handleOnly: draggable !== true,
4322
4324
  open: open ?? false,
4323
4325
  onOpenChange: (next) => {
4324
4326
  if (!next) {
@@ -925,6 +925,9 @@ interface DrawerProps {
925
925
  open?: boolean;
926
926
  /** 滑出方向,缺省 right */
927
927
  placement?: DrawerPlacement;
928
+ /** 是否允许按住面板拖拽关闭;缺省 false(仅底部抽屉的把手可拖拽),
929
+ * 遮罩点击 / Escape 关闭不受影响 */
930
+ draggable?: boolean;
928
931
  /** 关闭事件(遮罩 / Escape / 拖拽关闭时触发) */
929
932
  onClose?: () => void;
930
933
  /** 内容(DSL 子树,经 Renderer children 机制渲染) */
@@ -939,7 +942,7 @@ interface DrawerProps {
939
942
  * 四方向;与交互层 OverlayHost 的 drawer 共用同一套 vendored
940
943
  * drawer 原语(design D4)。
941
944
  */
942
- declare function Drawer({ title, open, placement, onClose, children, className, style, }: DrawerProps): React.JSX.Element;
945
+ declare function Drawer({ title, open, placement, draggable, onClose, children, className, style, }: DrawerProps): React.JSX.Element;
943
946
 
944
947
  /** 菜单项;danger 项以 destructive 语义呈现 */
945
948
  interface DropdownMenuItemData {
@@ -1007,7 +1010,7 @@ interface FieldProps {
1007
1010
  /** label 行右侧提示节点 class / style */
1008
1011
  labelHintClassName?: string;
1009
1012
  labelHintStyle?: CSSProperties;
1010
- /** 控件容器(label 下方)class / style;缺省有 label 时容器自带 mt-2 */
1013
+ /** 控件容器(label 下方)class / style(label 与控件间距由 Field 容器 gap 承担) */
1011
1014
  controlClassName?: string;
1012
1015
  controlStyle?: CSSProperties;
1013
1016
  /** 辅助说明节点 class / style */
@@ -1022,8 +1025,9 @@ interface FieldProps {
1022
1025
  * 上下结构:label 在上、控件容器在下);label / labelHint / description /
1023
1026
  * error 为框架级 props,error 声明式强制展示;`required` 在 label 前渲染
1024
1027
  * 必填星号(对齐 antd Form.Item required 语义);`labelHint` 与 label 同行
1025
- * 右对齐(弱化为小字);label 与控件容器之间默认 mt-2,五个节点
1026
- * (label / labelHint / 控件容器 / description / error)均可独立加样式。
1028
+ * 右对齐(弱化为小字);label 与控件容器间距由 Field 容器 flex-col gap-2
1029
+ * 承担,五个节点(label / labelHint / 控件容器 / description / error)
1030
+ * 均可独立加样式。
1027
1031
  */
1028
1032
  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;
1029
1033
 
@@ -925,6 +925,9 @@ interface DrawerProps {
925
925
  open?: boolean;
926
926
  /** 滑出方向,缺省 right */
927
927
  placement?: DrawerPlacement;
928
+ /** 是否允许按住面板拖拽关闭;缺省 false(仅底部抽屉的把手可拖拽),
929
+ * 遮罩点击 / Escape 关闭不受影响 */
930
+ draggable?: boolean;
928
931
  /** 关闭事件(遮罩 / Escape / 拖拽关闭时触发) */
929
932
  onClose?: () => void;
930
933
  /** 内容(DSL 子树,经 Renderer children 机制渲染) */
@@ -939,7 +942,7 @@ interface DrawerProps {
939
942
  * 四方向;与交互层 OverlayHost 的 drawer 共用同一套 vendored
940
943
  * drawer 原语(design D4)。
941
944
  */
942
- declare function Drawer({ title, open, placement, onClose, children, className, style, }: DrawerProps): React.JSX.Element;
945
+ declare function Drawer({ title, open, placement, draggable, onClose, children, className, style, }: DrawerProps): React.JSX.Element;
943
946
 
944
947
  /** 菜单项;danger 项以 destructive 语义呈现 */
945
948
  interface DropdownMenuItemData {
@@ -1007,7 +1010,7 @@ interface FieldProps {
1007
1010
  /** label 行右侧提示节点 class / style */
1008
1011
  labelHintClassName?: string;
1009
1012
  labelHintStyle?: CSSProperties;
1010
- /** 控件容器(label 下方)class / style;缺省有 label 时容器自带 mt-2 */
1013
+ /** 控件容器(label 下方)class / style(label 与控件间距由 Field 容器 gap 承担) */
1011
1014
  controlClassName?: string;
1012
1015
  controlStyle?: CSSProperties;
1013
1016
  /** 辅助说明节点 class / style */
@@ -1022,8 +1025,9 @@ interface FieldProps {
1022
1025
  * 上下结构:label 在上、控件容器在下);label / labelHint / description /
1023
1026
  * error 为框架级 props,error 声明式强制展示;`required` 在 label 前渲染
1024
1027
  * 必填星号(对齐 antd Form.Item required 语义);`labelHint` 与 label 同行
1025
- * 右对齐(弱化为小字);label 与控件容器之间默认 mt-2,五个节点
1026
- * (label / labelHint / 控件容器 / description / error)均可独立加样式。
1028
+ * 右对齐(弱化为小字);label 与控件容器间距由 Field 容器 flex-col gap-2
1029
+ * 承担,五个节点(label / labelHint / 控件容器 / description / error)
1030
+ * 均可独立加样式。
1027
1031
  */
1028
1032
  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;
1029
1033
 
@@ -154,7 +154,7 @@ import {
154
154
  inferKind,
155
155
  registerBuiltinComponents,
156
156
  useFormContext
157
- } from "../chunk-R5KHWCWB.js";
157
+ } from "../chunk-X54WOK3C.js";
158
158
  import {
159
159
  ICONS,
160
160
  Icon,
package/dist/index.cjs CHANGED
@@ -4348,6 +4348,7 @@ function Drawer2({
4348
4348
  title,
4349
4349
  open,
4350
4350
  placement = "right",
4351
+ draggable,
4351
4352
  onClose,
4352
4353
  children,
4353
4354
  className,
@@ -4358,6 +4359,7 @@ function Drawer2({
4358
4359
  {
4359
4360
  direction: placement,
4360
4361
  modal: false,
4362
+ handleOnly: draggable !== true,
4361
4363
  open: open ?? false,
4362
4364
  onOpenChange: (next) => {
4363
4365
  if (!next) {
package/dist/index.js CHANGED
@@ -154,7 +154,7 @@ import {
154
154
  inferKind,
155
155
  registerBuiltinComponents,
156
156
  useFormContext
157
- } from "./chunk-R5KHWCWB.js";
157
+ } from "./chunk-X54WOK3C.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.32.0",
3
+ "version": "1.34.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",
@@ -92,6 +92,11 @@
92
92
  },
93
93
  "dependencies": {
94
94
  "@base-ui/react": "^1.7.0",
95
+ "@pactor-app/core": "1.34.0",
96
+ "@pactor-app/markdown": "1.34.0",
97
+ "@pactor-app/permission": "1.34.0",
98
+ "@pactor-app/router": "1.34.0",
99
+ "@pactor-app/runtime": "1.34.0",
95
100
  "class-variance-authority": "^0.7.1",
96
101
  "clsx": "^2.1.1",
97
102
  "cmdk": "^1.1.1",
@@ -106,12 +111,7 @@
106
111
  "react-day-picker": "^10.0.1",
107
112
  "react-resizable-panels": "^4.12.3",
108
113
  "tailwind-merge": "^3.6.0",
109
- "vaul": "^1.1.2",
110
- "@pactor-app/core": "1.32.0",
111
- "@pactor-app/markdown": "1.32.0",
112
- "@pactor-app/permission": "1.32.0",
113
- "@pactor-app/router": "1.32.0",
114
- "@pactor-app/runtime": "1.32.0"
114
+ "vaul": "^1.1.2"
115
115
  },
116
116
  "peerDependencies": {
117
117
  "react": ">=18",