@pactor-app/ui 1.31.0 → 1.33.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.
@@ -1269,7 +1269,7 @@ function Field({ className, ...props }) {
1269
1269
  FieldPrimitive.Root,
1270
1270
  {
1271
1271
  "data-slot": "field",
1272
- className: cn("flex flex-col gap-1.5", className),
1272
+ className: cn("flex flex-col gap-2", className),
1273
1273
  ...props
1274
1274
  }
1275
1275
  );
@@ -141,7 +141,19 @@ import {
141
141
  Typography,
142
142
  navigationMenuTriggerStyle,
143
143
  toast
144
- } from "./chunk-JWZHJEUS.js";
144
+ } from "./chunk-WYISCB4V.js";
145
+ import {
146
+ Dialog,
147
+ DialogContent,
148
+ DialogDescription,
149
+ DialogHeader,
150
+ DialogTitle,
151
+ DialogTrigger,
152
+ Drawer,
153
+ DrawerContent,
154
+ DrawerHeader,
155
+ DrawerTitle
156
+ } from "./chunk-HAOAXDTW.js";
145
157
  import {
146
158
  Accordion,
147
159
  AccordionContent,
@@ -165,18 +177,6 @@ import {
165
177
  TooltipContent,
166
178
  TooltipTrigger
167
179
  } from "./chunk-RB7RCKAX.js";
168
- import {
169
- Dialog,
170
- DialogContent,
171
- DialogDescription,
172
- DialogHeader,
173
- DialogTitle,
174
- DialogTrigger,
175
- Drawer,
176
- DrawerContent,
177
- DrawerHeader,
178
- DrawerTitle
179
- } from "./chunk-HAOAXDTW.js";
180
180
  import {
181
181
  Button,
182
182
  cn
@@ -595,11 +595,11 @@ function useFormContext() {
595
595
  function formItemClass(layout) {
596
596
  switch (layout) {
597
597
  case "horizontal":
598
- return "mb-4 flex min-h-9 items-center gap-2";
598
+ return "mb-2 flex min-h-9 items-center gap-2";
599
599
  case "inline":
600
600
  return "flex min-h-9 items-center gap-2";
601
601
  default:
602
- return "mb-4 flex min-h-9 flex-col justify-center gap-1.5";
602
+ return "mb-2 flex min-h-9 flex-col justify-center gap-1.5";
603
603
  }
604
604
  }
605
605
 
@@ -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) {
@@ -2697,7 +2699,7 @@ function Field2({
2697
2699
  "div",
2698
2700
  {
2699
2701
  "data-slot": "field-control",
2700
- className: cn(label || labelHint ? "mt-2" : void 0, controlClassName),
2702
+ className: cn(controlClassName),
2701
2703
  style: controlStyle,
2702
2704
  children
2703
2705
  }
@@ -1478,11 +1478,11 @@ function useFormContext() {
1478
1478
  function formItemClass(layout) {
1479
1479
  switch (layout) {
1480
1480
  case "horizontal":
1481
- return "mb-4 flex min-h-9 items-center gap-2";
1481
+ return "mb-2 flex min-h-9 items-center gap-2";
1482
1482
  case "inline":
1483
1483
  return "flex min-h-9 items-center gap-2";
1484
1484
  default:
1485
- return "mb-4 flex min-h-9 flex-col justify-center gap-1.5";
1485
+ return "mb-2 flex min-h-9 flex-col justify-center gap-1.5";
1486
1486
  }
1487
1487
  }
1488
1488
 
@@ -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) {
@@ -4558,7 +4560,7 @@ function Field({ className, ...props }) {
4558
4560
  import_field.Field.Root,
4559
4561
  {
4560
4562
  "data-slot": "field",
4561
- className: cn("flex flex-col gap-1.5", className),
4563
+ className: cn("flex flex-col gap-2", className),
4562
4564
  ...props
4563
4565
  }
4564
4566
  );
@@ -4642,7 +4644,7 @@ function Field2({
4642
4644
  "div",
4643
4645
  {
4644
4646
  "data-slot": "field-control",
4645
- className: cn(label || labelHint ? "mt-2" : void 0, controlClassName),
4647
+ className: cn(controlClassName),
4646
4648
  style: controlStyle,
4647
4649
  children
4648
4650
  }
@@ -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-F4YSZZHL.js";
157
+ } from "../chunk-X54WOK3C.js";
158
158
  import {
159
159
  ICONS,
160
160
  Icon,
@@ -164,9 +164,9 @@ import {
164
164
  normalizeIconName,
165
165
  useSidebarDrawer
166
166
  } from "../chunk-44DAGWXZ.js";
167
- import "../chunk-JWZHJEUS.js";
168
- import "../chunk-RB7RCKAX.js";
167
+ import "../chunk-WYISCB4V.js";
169
168
  import "../chunk-HAOAXDTW.js";
169
+ import "../chunk-RB7RCKAX.js";
170
170
  import "../chunk-WKJUCGV4.js";
171
171
  export {
172
172
  Accordion,
package/dist/index.cjs CHANGED
@@ -1494,11 +1494,11 @@ function useFormContext() {
1494
1494
  function formItemClass(layout) {
1495
1495
  switch (layout) {
1496
1496
  case "horizontal":
1497
- return "mb-4 flex min-h-9 items-center gap-2";
1497
+ return "mb-2 flex min-h-9 items-center gap-2";
1498
1498
  case "inline":
1499
1499
  return "flex min-h-9 items-center gap-2";
1500
1500
  default:
1501
- return "mb-4 flex min-h-9 flex-col justify-center gap-1.5";
1501
+ return "mb-2 flex min-h-9 flex-col justify-center gap-1.5";
1502
1502
  }
1503
1503
  }
1504
1504
 
@@ -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) {
@@ -4597,7 +4599,7 @@ function Field({ className, ...props }) {
4597
4599
  import_field.Field.Root,
4598
4600
  {
4599
4601
  "data-slot": "field",
4600
- className: cn("flex flex-col gap-1.5", className),
4602
+ className: cn("flex flex-col gap-2", className),
4601
4603
  ...props
4602
4604
  }
4603
4605
  );
@@ -4681,7 +4683,7 @@ function Field2({
4681
4683
  "div",
4682
4684
  {
4683
4685
  "data-slot": "field-control",
4684
- className: cn(label || labelHint ? "mt-2" : void 0, controlClassName),
4686
+ className: cn(controlClassName),
4685
4687
  style: controlStyle,
4686
4688
  children
4687
4689
  }
package/dist/index.js CHANGED
@@ -154,7 +154,15 @@ import {
154
154
  inferKind,
155
155
  registerBuiltinComponents,
156
156
  useFormContext
157
- } from "./chunk-F4YSZZHL.js";
157
+ } from "./chunk-X54WOK3C.js";
158
+ import {
159
+ InteractionProvider,
160
+ OVERLAY_CANCEL_PAYLOAD,
161
+ OverlayHost,
162
+ OverlayManager,
163
+ createUiBridge,
164
+ registerInteractionActions
165
+ } from "./chunk-U5EFJR5Z.js";
158
166
  import {
159
167
  AdminLayout,
160
168
  BlankLayout,
@@ -176,17 +184,9 @@ import {
176
184
  normalizeIconName,
177
185
  useSidebarDrawer
178
186
  } from "./chunk-44DAGWXZ.js";
179
- import {
180
- InteractionProvider,
181
- OVERLAY_CANCEL_PAYLOAD,
182
- OverlayHost,
183
- OverlayManager,
184
- createUiBridge,
185
- registerInteractionActions
186
- } from "./chunk-U5EFJR5Z.js";
187
- import "./chunk-JWZHJEUS.js";
188
- import "./chunk-RB7RCKAX.js";
187
+ import "./chunk-WYISCB4V.js";
189
188
  import "./chunk-HAOAXDTW.js";
189
+ import "./chunk-RB7RCKAX.js";
190
190
  import "./chunk-WKJUCGV4.js";
191
191
  export {
192
192
  Accordion,
package/dist/ui/index.cjs CHANGED
@@ -2934,7 +2934,7 @@ function Field({ className, ...props }) {
2934
2934
  import_field.Field.Root,
2935
2935
  {
2936
2936
  "data-slot": "field",
2937
- className: cn("flex flex-col gap-1.5", className),
2937
+ className: cn("flex flex-col gap-2", className),
2938
2938
  ...props
2939
2939
  }
2940
2940
  );
package/dist/ui/index.js CHANGED
@@ -161,7 +161,29 @@ import {
161
161
  toggleVariants,
162
162
  typographyVariants,
163
163
  useCarousel
164
- } from "../chunk-JWZHJEUS.js";
164
+ } from "../chunk-WYISCB4V.js";
165
+ import {
166
+ Dialog,
167
+ DialogClose,
168
+ DialogContent,
169
+ DialogDescription,
170
+ DialogFooter,
171
+ DialogHeader,
172
+ DialogOverlay,
173
+ DialogPortal,
174
+ DialogTitle,
175
+ DialogTrigger,
176
+ Drawer,
177
+ DrawerClose,
178
+ DrawerContent,
179
+ DrawerDescription,
180
+ DrawerFooter,
181
+ DrawerHeader,
182
+ DrawerOverlay,
183
+ DrawerPortal,
184
+ DrawerTitle,
185
+ DrawerTrigger
186
+ } from "../chunk-HAOAXDTW.js";
165
187
  import {
166
188
  Accordion,
167
189
  AccordionContent,
@@ -219,28 +241,6 @@ import {
219
241
  TooltipTrigger,
220
242
  useSidebar
221
243
  } from "../chunk-RB7RCKAX.js";
222
- import {
223
- Dialog,
224
- DialogClose,
225
- DialogContent,
226
- DialogDescription,
227
- DialogFooter,
228
- DialogHeader,
229
- DialogOverlay,
230
- DialogPortal,
231
- DialogTitle,
232
- DialogTrigger,
233
- Drawer,
234
- DrawerClose,
235
- DrawerContent,
236
- DrawerDescription,
237
- DrawerFooter,
238
- DrawerHeader,
239
- DrawerOverlay,
240
- DrawerPortal,
241
- DrawerTitle,
242
- DrawerTrigger
243
- } from "../chunk-HAOAXDTW.js";
244
244
  import {
245
245
  Button,
246
246
  buttonVariants,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pactor-app/ui",
3
- "version": "1.31.0",
3
+ "version": "1.33.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.33.0",
96
+ "@pactor-app/markdown": "1.33.0",
97
+ "@pactor-app/permission": "1.33.0",
98
+ "@pactor-app/router": "1.33.0",
99
+ "@pactor-app/runtime": "1.33.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.31.0",
111
- "@pactor-app/router": "1.31.0",
112
- "@pactor-app/markdown": "1.31.0",
113
- "@pactor-app/permission": "1.31.0",
114
- "@pactor-app/runtime": "1.31.0"
114
+ "vaul": "^1.1.2"
115
115
  },
116
116
  "peerDependencies": {
117
117
  "react": ">=18",