@pactor-app/ui 1.9.0 → 1.11.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.
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-HW6M3BEF.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,
@@ -101,8 +101,8 @@ import {
101
101
  normalizeIconName,
102
102
  useSidebarDrawer
103
103
  } from "./chunk-PECP7DJB.js";
104
- import "./chunk-VT5XP4U4.js";
105
- import "./chunk-F42SGQNW.js";
104
+ import "./chunk-NVORKHWX.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
@@ -934,6 +934,7 @@ function Badge({
934
934
 
935
935
  // src/ui/breadcrumb.tsx
936
936
  var import_lucide_react2 = require("lucide-react");
937
+ var React3 = __toESM(require("react"), 1);
937
938
  var import_jsx_runtime9 = require("react/jsx-runtime");
938
939
  function Breadcrumb({ ...props }) {
939
940
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
@@ -961,12 +962,27 @@ function BreadcrumbItem({ className, ...props }) {
961
962
  }
962
963
  );
963
964
  }
964
- function BreadcrumbLink({ className, ...props }) {
965
+ function BreadcrumbLink({
966
+ className,
967
+ render,
968
+ ...props
969
+ }) {
970
+ const linkClassName = cn("transition-colors hover:text-foreground", className);
971
+ if (render) {
972
+ return React3.cloneElement(render, {
973
+ "data-slot": "breadcrumb-link",
974
+ ...props,
975
+ className: cn(
976
+ linkClassName,
977
+ render.props.className
978
+ )
979
+ });
980
+ }
965
981
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
966
982
  "a",
967
983
  {
968
984
  "data-slot": "breadcrumb-link",
969
- className: cn("transition-colors hover:text-foreground", className),
985
+ className: linkClassName,
970
986
  ...props
971
987
  }
972
988
  );
@@ -1036,7 +1052,7 @@ function ButtonGroup({ className, ...props }) {
1036
1052
  }
1037
1053
 
1038
1054
  // src/ui/bubble.tsx
1039
- var React3 = __toESM(require("react"), 1);
1055
+ var React4 = __toESM(require("react"), 1);
1040
1056
  var import_class_variance_authority5 = require("class-variance-authority");
1041
1057
  var import_jsx_runtime11 = require("react/jsx-runtime");
1042
1058
  function BubbleGroup({ className, ...props }) {
@@ -1095,8 +1111,8 @@ function BubbleContent({
1095
1111
  "w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",
1096
1112
  className
1097
1113
  );
1098
- if (asChild && React3.isValidElement(children)) {
1099
- return React3.cloneElement(children, {
1114
+ if (asChild && React4.isValidElement(children)) {
1115
+ return React4.cloneElement(children, {
1100
1116
  "data-slot": "bubble-content",
1101
1117
  className: cn(cls, children.props.className),
1102
1118
  ...props
@@ -1259,11 +1275,11 @@ function ChartContainer({
1259
1275
  // src/ui/carousel.tsx
1260
1276
  var import_embla_carousel_react = __toESM(require("embla-carousel-react"), 1);
1261
1277
  var import_lucide_react4 = require("lucide-react");
1262
- var React4 = __toESM(require("react"), 1);
1278
+ var React5 = __toESM(require("react"), 1);
1263
1279
  var import_jsx_runtime14 = require("react/jsx-runtime");
1264
- var CarouselContext = React4.createContext(null);
1280
+ var CarouselContext = React5.createContext(null);
1265
1281
  function useCarousel() {
1266
- const context = React4.useContext(CarouselContext);
1282
+ const context = React5.useContext(CarouselContext);
1267
1283
  if (!context) {
1268
1284
  throw new Error("useCarousel must be used within a <Carousel />");
1269
1285
  }
@@ -1282,16 +1298,16 @@ function Carousel({
1282
1298
  { ...opts, axis: orientation === "horizontal" ? "x" : "y" },
1283
1299
  plugins
1284
1300
  );
1285
- const [canScrollPrev, setCanScrollPrev] = React4.useState(false);
1286
- const [canScrollNext, setCanScrollNext] = React4.useState(false);
1287
- const onSelect = React4.useCallback((carouselApi) => {
1301
+ const [canScrollPrev, setCanScrollPrev] = React5.useState(false);
1302
+ const [canScrollNext, setCanScrollNext] = React5.useState(false);
1303
+ const onSelect = React5.useCallback((carouselApi) => {
1288
1304
  if (!carouselApi) return;
1289
1305
  setCanScrollPrev(carouselApi.canScrollPrev());
1290
1306
  setCanScrollNext(carouselApi.canScrollNext());
1291
1307
  }, []);
1292
- const scrollPrev = React4.useCallback(() => api?.scrollPrev(), [api]);
1293
- const scrollNext = React4.useCallback(() => api?.scrollNext(), [api]);
1294
- const handleKeyDown = React4.useCallback(
1308
+ const scrollPrev = React5.useCallback(() => api?.scrollPrev(), [api]);
1309
+ const scrollNext = React5.useCallback(() => api?.scrollNext(), [api]);
1310
+ const handleKeyDown = React5.useCallback(
1295
1311
  (event) => {
1296
1312
  if (event.key === "ArrowLeft") {
1297
1313
  event.preventDefault();
@@ -1303,10 +1319,10 @@ function Carousel({
1303
1319
  },
1304
1320
  [scrollPrev, scrollNext]
1305
1321
  );
1306
- React4.useEffect(() => {
1322
+ React5.useEffect(() => {
1307
1323
  if (api && setApi) setApi(api);
1308
1324
  }, [api, setApi]);
1309
- React4.useEffect(() => {
1325
+ React5.useEffect(() => {
1310
1326
  if (!api) return;
1311
1327
  onSelect(api);
1312
1328
  api.on("reInit", onSelect);
@@ -2775,7 +2791,7 @@ function DialogOverlay({
2775
2791
  {
2776
2792
  "data-slot": "dialog-overlay",
2777
2793
  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",
2794
+ "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
2795
  className
2780
2796
  ),
2781
2797
  ...props
@@ -2795,7 +2811,7 @@ function DialogContent({
2795
2811
  {
2796
2812
  "data-slot": "dialog-content",
2797
2813
  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",
2814
+ "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
2815
  className
2800
2816
  ),
2801
2817
  ...props,
@@ -3053,7 +3069,7 @@ function InputGroupInput({
3053
3069
  // src/ui/input-otp.tsx
3054
3070
  var import_input_otp = require("input-otp");
3055
3071
  var import_lucide_react15 = require("lucide-react");
3056
- var React5 = __toESM(require("react"), 1);
3072
+ var React6 = __toESM(require("react"), 1);
3057
3073
  var import_jsx_runtime36 = require("react/jsx-runtime");
3058
3074
  function InputOTP({
3059
3075
  className,
@@ -3088,7 +3104,7 @@ function InputOTPSlot({
3088
3104
  className,
3089
3105
  ...props
3090
3106
  }) {
3091
- const inputOTPContext = React5.useContext(import_input_otp.OTPInputContext);
3107
+ const inputOTPContext = React6.useContext(import_input_otp.OTPInputContext);
3092
3108
  const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
3093
3109
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
3094
3110
  "div",
@@ -3658,7 +3674,7 @@ function Separator({
3658
3674
  }
3659
3675
 
3660
3676
  // src/ui/sidebar.tsx
3661
- var React6 = __toESM(require("react"), 1);
3677
+ var React7 = __toESM(require("react"), 1);
3662
3678
  var import_class_variance_authority8 = require("class-variance-authority");
3663
3679
  var import_lucide_react18 = require("lucide-react");
3664
3680
 
@@ -3705,9 +3721,9 @@ var SIDEBAR_WIDTH = "16rem";
3705
3721
  var SIDEBAR_WIDTH_MOBILE = "18rem";
3706
3722
  var SIDEBAR_WIDTH_ICON = "3rem";
3707
3723
  var SIDEBAR_KEYBOARD_SHORTCUT = "b";
3708
- var SidebarContext = React6.createContext(null);
3724
+ var SidebarContext = React7.createContext(null);
3709
3725
  function useSidebar() {
3710
- const context = React6.useContext(SidebarContext);
3726
+ const context = React7.useContext(SidebarContext);
3711
3727
  if (!context) {
3712
3728
  throw new Error("useSidebar must be used within a SidebarProvider.");
3713
3729
  }
@@ -3723,10 +3739,10 @@ function SidebarProvider({
3723
3739
  ...props
3724
3740
  }) {
3725
3741
  const isMobile = useIsMobile();
3726
- const [openMobile, setOpenMobile] = React6.useState(false);
3727
- const [_open, _setOpen] = React6.useState(defaultOpen);
3742
+ const [openMobile, setOpenMobile] = React7.useState(false);
3743
+ const [_open, _setOpen] = React7.useState(defaultOpen);
3728
3744
  const open = openProp ?? _open;
3729
- const setOpen = React6.useCallback(
3745
+ const setOpen = React7.useCallback(
3730
3746
  (value) => {
3731
3747
  const openState = typeof value === "function" ? value(open) : value;
3732
3748
  if (setOpenProp) {
@@ -3738,10 +3754,10 @@ function SidebarProvider({
3738
3754
  },
3739
3755
  [setOpenProp, open]
3740
3756
  );
3741
- const toggleSidebar = React6.useCallback(() => {
3757
+ const toggleSidebar = React7.useCallback(() => {
3742
3758
  return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
3743
3759
  }, [isMobile, setOpen, setOpenMobile]);
3744
- React6.useEffect(() => {
3760
+ React7.useEffect(() => {
3745
3761
  const handleKeyDown = (event) => {
3746
3762
  if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
3747
3763
  event.preventDefault();
@@ -3752,7 +3768,7 @@ function SidebarProvider({
3752
3768
  return () => window.removeEventListener("keydown", handleKeyDown);
3753
3769
  }, [toggleSidebar]);
3754
3770
  const state = open ? "expanded" : "collapsed";
3755
- const contextValue = React6.useMemo(
3771
+ const contextValue = React7.useMemo(
3756
3772
  () => ({
3757
3773
  state,
3758
3774
  open,
@@ -4015,10 +4031,10 @@ function SidebarGroup({ className, ...props }) {
4015
4031
  );
4016
4032
  }
4017
4033
  function renderAsChild(children, dataSlot, className, rest) {
4018
- if (!React6.isValidElement(children)) {
4034
+ if (!React7.isValidElement(children)) {
4019
4035
  return null;
4020
4036
  }
4021
- return React6.cloneElement(children, {
4037
+ return React7.cloneElement(children, {
4022
4038
  "data-slot": dataSlot,
4023
4039
  className: cn(
4024
4040
  className,
@@ -4242,7 +4258,7 @@ function SidebarMenuSkeleton({
4242
4258
  showIcon = false,
4243
4259
  ...props
4244
4260
  }) {
4245
- const width = React6.useMemo(() => {
4261
+ const width = React7.useMemo(() => {
4246
4262
  return `${Math.floor(Math.random() * 40) + 50}%`;
4247
4263
  }, []);
4248
4264
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
@@ -4695,9 +4711,9 @@ function Toggle({
4695
4711
  // src/ui/toggle-group.tsx
4696
4712
  var import_toggle2 = require("@base-ui/react/toggle");
4697
4713
  var import_toggle_group = require("@base-ui/react/toggle-group");
4698
- var React7 = __toESM(require("react"), 1);
4714
+ var React8 = __toESM(require("react"), 1);
4699
4715
  var import_jsx_runtime56 = require("react/jsx-runtime");
4700
- var ToggleGroupContext = React7.createContext({
4716
+ var ToggleGroupContext = React8.createContext({
4701
4717
  size: "default",
4702
4718
  variant: "default"
4703
4719
  });
@@ -4730,7 +4746,7 @@ function ToggleGroupItem({
4730
4746
  size,
4731
4747
  ...props
4732
4748
  }) {
4733
- const context = React7.useContext(ToggleGroupContext);
4749
+ const context = React8.useContext(ToggleGroupContext);
4734
4750
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
4735
4751
  import_toggle2.Toggle,
4736
4752
  {
@@ -153,7 +153,13 @@ declare function Badge({ className, variant, ...props }: React.ComponentProps<'s
153
153
  declare function Breadcrumb({ ...props }: React.ComponentProps<'nav'>): React.JSX.Element;
154
154
  declare function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>): React.JSX.Element;
155
155
  declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
156
- declare function BreadcrumbLink({ className, ...props }: React.ComponentProps<'a'>): React.JSX.Element;
156
+ declare function BreadcrumbLink({ className, render, ...props }: React.ComponentProps<'a'> & {
157
+ /**
158
+ * 以宿主元素替换默认 `<a>`(Base UI render 习惯用法,等价 Radix asChild)——
159
+ * 如 Next.js `<Link>` / react-router `<Link>`;class 合并、其余 props 透传。
160
+ */
161
+ render?: React.ReactElement;
162
+ }): React.JSX.Element;
157
163
  declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
158
164
  declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
159
165
  declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
@@ -153,7 +153,13 @@ declare function Badge({ className, variant, ...props }: React.ComponentProps<'s
153
153
  declare function Breadcrumb({ ...props }: React.ComponentProps<'nav'>): React.JSX.Element;
154
154
  declare function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>): React.JSX.Element;
155
155
  declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
156
- declare function BreadcrumbLink({ className, ...props }: React.ComponentProps<'a'>): React.JSX.Element;
156
+ declare function BreadcrumbLink({ className, render, ...props }: React.ComponentProps<'a'> & {
157
+ /**
158
+ * 以宿主元素替换默认 `<a>`(Base UI render 习惯用法,等价 Radix asChild)——
159
+ * 如 Next.js `<Link>` / react-router `<Link>`;class 合并、其余 props 透传。
160
+ */
161
+ render?: React.ReactElement;
162
+ }): React.JSX.Element;
157
163
  declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
158
164
  declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
159
165
  declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
package/dist/ui/index.js CHANGED
@@ -160,7 +160,7 @@ import {
160
160
  toggleVariants,
161
161
  typographyVariants,
162
162
  useCarousel
163
- } from "../chunk-VT5XP4U4.js";
163
+ } from "../chunk-NVORKHWX.js";
164
164
  import {
165
165
  Dialog,
166
166
  DialogClose,
@@ -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.11.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.11.0",
109
+ "@pactor-app/permission": "1.11.0",
110
+ "@pactor-app/router": "1.11.0",
111
+ "@pactor-app/runtime": "1.11.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;