@pactor-app/ui 1.9.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.
@@ -153,7 +153,7 @@ import {
153
153
  DrawerContent,
154
154
  DrawerHeader,
155
155
  DrawerTitle
156
- } from "./chunk-F42SGQNW.js";
156
+ } from "./chunk-XUHJ5YSG.js";
157
157
  import {
158
158
  Accordion,
159
159
  AccordionContent,
@@ -2513,6 +2513,7 @@ function RadioGroup2({
2513
2513
  label,
2514
2514
  rules,
2515
2515
  options = [],
2516
+ direction = "vertical",
2516
2517
  value,
2517
2518
  disabled,
2518
2519
  onChange,
@@ -2544,10 +2545,14 @@ function RadioGroup2({
2544
2545
  onValueChange: handleChange,
2545
2546
  disabled,
2546
2547
  name: inForm ? name : void 0,
2547
- className: cn(!inForm && className),
2548
+ className: cn(
2549
+ direction === "horizontal" && "flex flex-wrap items-center gap-x-6 gap-y-2",
2550
+ !inForm && className
2551
+ ),
2548
2552
  style: inForm ? void 0 : style,
2549
2553
  children: options.map((option, index) => {
2550
2554
  const optionId = `${controlId}-${index}`;
2555
+ const optionDisabled = disabled || option.disabled;
2551
2556
  return /* @__PURE__ */ jsxs35("span", { className: "inline-flex items-center gap-2", children: [
2552
2557
  /* @__PURE__ */ jsx50(
2553
2558
  RadioGroupItem,
@@ -2557,7 +2562,17 @@ function RadioGroup2({
2557
2562
  disabled: option.disabled
2558
2563
  }
2559
2564
  ),
2560
- /* @__PURE__ */ jsx50("label", { htmlFor: optionId, className: "text-sm leading-none font-medium", children: option.label })
2565
+ /* @__PURE__ */ jsx50(
2566
+ "label",
2567
+ {
2568
+ htmlFor: optionId,
2569
+ className: cn(
2570
+ "text-sm leading-none font-medium",
2571
+ optionDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
2572
+ ),
2573
+ children: option.label
2574
+ }
2575
+ )
2561
2576
  ] }, String(option.value));
2562
2577
  })
2563
2578
  }
@@ -11,7 +11,7 @@ import {
11
11
  DrawerContent,
12
12
  DrawerHeader,
13
13
  DrawerTitle
14
- } from "./chunk-F42SGQNW.js";
14
+ } from "./chunk-XUHJ5YSG.js";
15
15
  import {
16
16
  Button,
17
17
  cn
@@ -35,7 +35,7 @@ function DialogOverlay({
35
35
  {
36
36
  "data-slot": "dialog-overlay",
37
37
  className: cn(
38
- "fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
38
+ "fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 data-closed:fill-mode-forwards",
39
39
  className
40
40
  ),
41
41
  ...props
@@ -55,7 +55,7 @@ function DialogContent({
55
55
  {
56
56
  "data-slot": "dialog-content",
57
57
  className: cn(
58
- "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 shadow-lg shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 sm:max-w-lg",
58
+ "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 shadow-lg shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-closed:fill-mode-forwards sm:max-w-lg",
59
59
  className
60
60
  ),
61
61
  ...props,
@@ -2901,7 +2901,7 @@ function DialogOverlay({
2901
2901
  {
2902
2902
  "data-slot": "dialog-overlay",
2903
2903
  className: cn(
2904
- "fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
2904
+ "fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 data-closed:fill-mode-forwards",
2905
2905
  className
2906
2906
  ),
2907
2907
  ...props
@@ -2921,7 +2921,7 @@ function DialogContent({
2921
2921
  {
2922
2922
  "data-slot": "dialog-content",
2923
2923
  className: cn(
2924
- "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 shadow-lg shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 sm:max-w-lg",
2924
+ "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 shadow-lg shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-closed:fill-mode-forwards sm:max-w-lg",
2925
2925
  className
2926
2926
  ),
2927
2927
  ...props,
@@ -5951,6 +5951,7 @@ function RadioGroup2({
5951
5951
  label,
5952
5952
  rules,
5953
5953
  options = [],
5954
+ direction = "vertical",
5954
5955
  value,
5955
5956
  disabled,
5956
5957
  onChange,
@@ -5982,10 +5983,14 @@ function RadioGroup2({
5982
5983
  onValueChange: handleChange,
5983
5984
  disabled,
5984
5985
  name: inForm ? name : void 0,
5985
- className: cn(!inForm && className),
5986
+ className: cn(
5987
+ direction === "horizontal" && "flex flex-wrap items-center gap-x-6 gap-y-2",
5988
+ !inForm && className
5989
+ ),
5986
5990
  style: inForm ? void 0 : style,
5987
5991
  children: options.map((option, index) => {
5988
5992
  const optionId = `${controlId}-${index}`;
5993
+ const optionDisabled = disabled || option.disabled;
5989
5994
  return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
5990
5995
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
5991
5996
  RadioGroupItem,
@@ -5995,7 +6000,17 @@ function RadioGroup2({
5995
6000
  disabled: option.disabled
5996
6001
  }
5997
6002
  ),
5998
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("label", { htmlFor: optionId, className: "text-sm leading-none font-medium", children: option.label })
6003
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
6004
+ "label",
6005
+ {
6006
+ htmlFor: optionId,
6007
+ className: cn(
6008
+ "text-sm leading-none font-medium",
6009
+ optionDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
6010
+ ),
6011
+ children: option.label
6012
+ }
6013
+ )
5999
6014
  ] }, String(option.value));
6000
6015
  })
6001
6016
  }
@@ -1280,6 +1280,8 @@ interface RadioGroupProps {
1280
1280
  rules?: FieldRule[];
1281
1281
  /** 选项列表 */
1282
1282
  options?: RadioGroupOption[];
1283
+ /** 选项排列方向,默认 vertical */
1284
+ direction?: 'horizontal' | 'vertical';
1283
1285
  /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
1284
1286
  value?: string | number | boolean;
1285
1287
  disabled?: boolean;
@@ -1293,9 +1295,10 @@ interface RadioGroupProps {
1293
1295
  /**
1294
1296
  * RadioGroup 适配器(shadcn kit):基于 vendored RadioGroup(Base UI);
1295
1297
  * Base UI RadioGroup 的 value 原生支持 string/number/boolean,
1296
- * onChange 传出选中项原始 value。
1298
+ * onChange 传出选中项原始 value。`direction` 控制选项横/纵排列;
1299
+ * label 经 htmlFor 关联 Base UI 隐藏原生 input,点击 label 即选中对应项。
1297
1300
  */
1298
- 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;
1299
1302
 
1300
1303
  /** 可拖拽面板;`children` 为 DSL 子树,经 renderChildren 渲染 */
1301
1304
  interface ResizablePanelData {
@@ -1280,6 +1280,8 @@ interface RadioGroupProps {
1280
1280
  rules?: FieldRule[];
1281
1281
  /** 选项列表 */
1282
1282
  options?: RadioGroupOption[];
1283
+ /** 选项排列方向,默认 vertical */
1284
+ direction?: 'horizontal' | 'vertical';
1283
1285
  /** 受控值(独立渲染时生效);Form 内作为字段初始值(优先于 Form initialValues) */
1284
1286
  value?: string | number | boolean;
1285
1287
  disabled?: boolean;
@@ -1293,9 +1295,10 @@ interface RadioGroupProps {
1293
1295
  /**
1294
1296
  * RadioGroup 适配器(shadcn kit):基于 vendored RadioGroup(Base UI);
1295
1297
  * Base UI RadioGroup 的 value 原生支持 string/number/boolean,
1296
- * onChange 传出选中项原始 value。
1298
+ * onChange 传出选中项原始 value。`direction` 控制选项横/纵排列;
1299
+ * label 经 htmlFor 关联 Base UI 隐藏原生 input,点击 label 即选中对应项。
1297
1300
  */
1298
- 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;
1299
1302
 
1300
1303
  /** 可拖拽面板;`children` 为 DSL 子树,经 renderChildren 渲染 */
1301
1304
  interface ResizablePanelData {
@@ -71,7 +71,7 @@ import {
71
71
  createComponentRegistry,
72
72
  registerBuiltinComponents,
73
73
  useFormContext
74
- } from "../chunk-KUFQSYTS.js";
74
+ } from "../chunk-M4PHRT2N.js";
75
75
  import {
76
76
  ICONS,
77
77
  Icon,
@@ -82,7 +82,7 @@ import {
82
82
  useSidebarDrawer
83
83
  } from "../chunk-PECP7DJB.js";
84
84
  import "../chunk-VT5XP4U4.js";
85
- import "../chunk-F42SGQNW.js";
85
+ import "../chunk-XUHJ5YSG.js";
86
86
  import "../chunk-VM4FESQB.js";
87
87
  import "../chunk-WKJUCGV4.js";
88
88
  export {
package/dist/index.cjs CHANGED
@@ -2922,7 +2922,7 @@ function DialogOverlay({
2922
2922
  {
2923
2923
  "data-slot": "dialog-overlay",
2924
2924
  className: cn(
2925
- "fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
2925
+ "fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 data-closed:fill-mode-forwards",
2926
2926
  className
2927
2927
  ),
2928
2928
  ...props
@@ -2942,7 +2942,7 @@ function DialogContent({
2942
2942
  {
2943
2943
  "data-slot": "dialog-content",
2944
2944
  className: cn(
2945
- "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 shadow-lg shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 sm:max-w-lg",
2945
+ "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 shadow-lg shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-closed:fill-mode-forwards sm:max-w-lg",
2946
2946
  className
2947
2947
  ),
2948
2948
  ...props,
@@ -5990,6 +5990,7 @@ function RadioGroup2({
5990
5990
  label,
5991
5991
  rules,
5992
5992
  options = [],
5993
+ direction = "vertical",
5993
5994
  value,
5994
5995
  disabled,
5995
5996
  onChange,
@@ -6021,10 +6022,14 @@ function RadioGroup2({
6021
6022
  onValueChange: handleChange,
6022
6023
  disabled,
6023
6024
  name: inForm ? name : void 0,
6024
- className: cn(!inForm && className),
6025
+ className: cn(
6026
+ direction === "horizontal" && "flex flex-wrap items-center gap-x-6 gap-y-2",
6027
+ !inForm && className
6028
+ ),
6025
6029
  style: inForm ? void 0 : style,
6026
6030
  children: options.map((option, index) => {
6027
6031
  const optionId = `${controlId}-${index}`;
6032
+ const optionDisabled = disabled || option.disabled;
6028
6033
  return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
6029
6034
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
6030
6035
  RadioGroupItem,
@@ -6034,7 +6039,17 @@ function RadioGroup2({
6034
6039
  disabled: option.disabled
6035
6040
  }
6036
6041
  ),
6037
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("label", { htmlFor: optionId, className: "text-sm leading-none font-medium", children: option.label })
6042
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
6043
+ "label",
6044
+ {
6045
+ htmlFor: optionId,
6046
+ className: cn(
6047
+ "text-sm leading-none font-medium",
6048
+ optionDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
6049
+ ),
6050
+ children: option.label
6051
+ }
6052
+ )
6038
6053
  ] }, String(option.value));
6039
6054
  })
6040
6055
  }
package/dist/index.js CHANGED
@@ -71,7 +71,7 @@ import {
71
71
  createComponentRegistry,
72
72
  registerBuiltinComponents,
73
73
  useFormContext
74
- } from "./chunk-KUFQSYTS.js";
74
+ } from "./chunk-M4PHRT2N.js";
75
75
  import {
76
76
  InteractionProvider,
77
77
  OVERLAY_CANCEL_PAYLOAD,
@@ -79,7 +79,7 @@ import {
79
79
  OverlayManager,
80
80
  createUiBridge,
81
81
  registerInteractionActions
82
- } from "./chunk-S3SMCICK.js";
82
+ } from "./chunk-VRAVO5LE.js";
83
83
  import {
84
84
  AdminLayout,
85
85
  BlankLayout,
@@ -102,7 +102,7 @@ import {
102
102
  useSidebarDrawer
103
103
  } from "./chunk-PECP7DJB.js";
104
104
  import "./chunk-VT5XP4U4.js";
105
- import "./chunk-F42SGQNW.js";
105
+ import "./chunk-XUHJ5YSG.js";
106
106
  import "./chunk-VM4FESQB.js";
107
107
  import "./chunk-WKJUCGV4.js";
108
108
  export {
@@ -310,7 +310,7 @@ function DialogOverlay({
310
310
  {
311
311
  "data-slot": "dialog-overlay",
312
312
  className: cn(
313
- "fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
313
+ "fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 data-closed:fill-mode-forwards",
314
314
  className
315
315
  ),
316
316
  ...props
@@ -330,7 +330,7 @@ function DialogContent({
330
330
  {
331
331
  "data-slot": "dialog-content",
332
332
  className: cn(
333
- "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 shadow-lg shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 sm:max-w-lg",
333
+ "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 shadow-lg shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-closed:fill-mode-forwards sm:max-w-lg",
334
334
  className
335
335
  ),
336
336
  ...props,
@@ -5,8 +5,8 @@ import {
5
5
  OverlayManager,
6
6
  createUiBridge,
7
7
  registerInteractionActions
8
- } from "../chunk-S3SMCICK.js";
9
- import "../chunk-F42SGQNW.js";
8
+ } from "../chunk-VRAVO5LE.js";
9
+ import "../chunk-XUHJ5YSG.js";
10
10
  import "../chunk-WKJUCGV4.js";
11
11
  export {
12
12
  InteractionProvider,
package/dist/ui/index.cjs CHANGED
@@ -2775,7 +2775,7 @@ function DialogOverlay({
2775
2775
  {
2776
2776
  "data-slot": "dialog-overlay",
2777
2777
  className: cn(
2778
- "fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
2778
+ "fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 data-closed:fill-mode-forwards",
2779
2779
  className
2780
2780
  ),
2781
2781
  ...props
@@ -2795,7 +2795,7 @@ function DialogContent({
2795
2795
  {
2796
2796
  "data-slot": "dialog-content",
2797
2797
  className: cn(
2798
- "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 shadow-lg shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 sm:max-w-lg",
2798
+ "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 shadow-lg shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-closed:fill-mode-forwards sm:max-w-lg",
2799
2799
  className
2800
2800
  ),
2801
2801
  ...props,
package/dist/ui/index.js CHANGED
@@ -182,7 +182,7 @@ import {
182
182
  DrawerPortal,
183
183
  DrawerTitle,
184
184
  DrawerTrigger
185
- } from "../chunk-F42SGQNW.js";
185
+ } from "../chunk-XUHJ5YSG.js";
186
186
  import {
187
187
  Accordion,
188
188
  AccordionContent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pactor-app/ui",
3
- "version": "1.9.0",
3
+ "version": "1.10.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.9.0",
109
- "@pactor-app/permission": "1.9.0",
110
- "@pactor-app/router": "1.9.0",
111
- "@pactor-app/runtime": "1.9.0"
108
+ "@pactor-app/core": "1.10.0",
109
+ "@pactor-app/permission": "1.10.0",
110
+ "@pactor-app/router": "1.10.0",
111
+ "@pactor-app/runtime": "1.10.0"
112
112
  },
113
113
  "peerDependencies": {
114
114
  "react": ">=18",
package/styles.css CHANGED
@@ -967,9 +967,15 @@
967
967
  margin-block-start: calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));
968
968
  margin-block-end: calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)));
969
969
  }
970
+ .gap-x-6 {
971
+ column-gap: calc(var(--spacing) * 6);
972
+ }
970
973
  .gap-y-0\.5 {
971
974
  row-gap: calc(var(--spacing) * 0.5);
972
975
  }
976
+ .gap-y-2 {
977
+ row-gap: calc(var(--spacing) * 2);
978
+ }
973
979
  .self-end {
974
980
  align-self: flex-end;
975
981
  }
@@ -2755,6 +2761,10 @@
2755
2761
  --tw-exit-opacity: calc(0/100);
2756
2762
  --tw-exit-opacity: 0;
2757
2763
  }
2764
+ .data-closed\:fill-mode-forwards:where([data-closed]:not([data-closed='false'])) {
2765
+ animation-fill-mode: forwards;
2766
+ --tw-animation-fill-mode: forwards;
2767
+ }
2758
2768
  .data-closed\:zoom-out-95:where([data-closed]:not([data-closed='false'])) {
2759
2769
  --tw-exit-scale: calc(95*1%);
2760
2770
  --tw-exit-scale: .95;