@pactor-app/ui 0.1.0 → 1.1.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.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createShadcnComponentRegistry } from './components/index.cjs';
2
- export { Alert, AlertProps, AlertVariant, Button, ButtonProps, ButtonSize, ButtonVariant, Card, CardProps, FieldRule, Flex, FlexProps, Form, FormContextValue, FormProps, Grid, GridProps, Input, InputProps, Page, PageProps, Select, SelectOption, SelectProps, Statistic, StatisticProps, TabItem, Table, TableColumn, TablePagination, TablePaginationInfo, TableProps, Tabs, TabsProps, registerShadcnComponents, shadcnComponents, useFormContext } from './components/index.cjs';
2
+ export { Accordion, AccordionItemData, AccordionProps, Alert, AlertDialog, AlertDialogProps, AlertProps, AlertVariant, AspectRatio, AspectRatioProps, Avatar, AvatarProps, Badge, BadgeProps, BadgeVariant, Breadcrumb, BreadcrumbItemData, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, ButtonSize, ButtonVariant, Calendar, CalendarProps, Card, CardProps, Carousel, CarouselImage, CarouselItemData, CarouselProps, Chart, ChartProps, ChartType, Checkbox, CheckboxProps, Collapsible, CollapsibleProps, Combobox, ComboboxOption, ComboboxProps, Command, CommandGroupData, CommandItemData, CommandProps, Content, ContentProps, ContextMenu, ContextMenuItemData, ContextMenuProps, DataTable, DataTableColumn, DataTablePagination, DataTableProps, DataTableSort, DataTableSortOrder, Dialog, DialogProps, Drawer, DrawerPlacement, DrawerProps, DropdownMenu, DropdownMenuItemData, DropdownMenuProps, Empty, EmptyProps, Field, FieldProps, FieldRule, Flex, FlexProps, Footer, FooterProps, Form, FormContextValue, FormProps, Grid, GridProps, Header, HeaderBrandPosition, HeaderDropdown, HeaderDropdownItem, HeaderLocale, HeaderMenuItem, HeaderProps, HeaderUser, HeaderUserItem, HoverCard, HoverCardProps, ICONS, Icon, IconProps, IconSize, Input, InputGroup, InputGroupProps, InputOTP, InputOTPProps, InputProps, Item, ItemProps, Kbd, KbdProps, Label, LabelProps, Layout, LayoutProps, Link, LinkProps, Menu, MenuItem, MenuProps, Menubar, MenubarLeafItem, MenubarMenuData, MenubarProps, NavigationMenu, NavigationMenuChildItem, NavigationMenuItemData, NavigationMenuProps, Page, PageProps, Pagination, PaginationProps, Popover, PopoverProps, Progress, ProgressProps, RadioGroup, RadioGroupOption, RadioGroupProps, RailTooltip, Resizable, ResizablePanelData, ResizableProps, ScrollArea, ScrollAreaProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, SheetSide, Sidebar, SidebarBrand, SidebarNavItem, SidebarProps, Sider, SiderProps, Skeleton, SkeletonProps, SkeletonShape, Slider, SliderProps, Sonner, SonnerProps, Spinner, SpinnerProps, SpinnerSize, Statistic, StatisticProps, Switch, SwitchProps, TabItem, Table, TableColumn, TablePagination, TablePaginationInfo, TableProps, Tabs, TabsProps, Text, TextProps, TextType, Textarea, TextareaProps, Toggle, ToggleGroup, ToggleGroupOption, ToggleGroupProps, ToggleProps, Tooltip, TooltipProps, Typography, TypographyProps, TypographyVariant, normalizeIconName, registerShadcnComponents, shadcnComponents, useFormContext, useSidebarDrawer } from './components/index.cjs';
3
3
  import { createShadcnLayoutRegistry } from './layout/index.cjs';
4
4
  export { AdminBrand, AdminLayoutBreakpoint, AdminLayoutConfig, AdminLayoutMode, AdminLayoutProps, BlankLayoutProps, LandingLayoutProps, LayoutComponent, LayoutRegistry, LoginBrand, LoginLayoutProps, ShadcnAdminLayout, ShadcnBlankLayout, ShadcnLandingLayout, ShadcnLoginLayout, collectDefaultOpenKeys, findMenuChain, registerShadcnLayouts, resolveLayout } from './layout/index.cjs';
5
5
  import { ShadcnInteractionProvider, ShadcnOverlayHost } from './interaction/index.cjs';
@@ -7,6 +7,11 @@ export { InteractionProviderProps, OVERLAY_CANCEL_PAYLOAD, OverlayConfig, Overla
7
7
  import '@pactor-app/runtime';
8
8
  import 'react';
9
9
  import '@pactor-app/core';
10
+ import 'lucide-react';
11
+ import './typography-DsGdDBc2.cjs';
12
+ import 'class-variance-authority/types';
13
+ import '@base-ui/react/toggle';
14
+ import 'class-variance-authority';
10
15
  import '@pactor-app/permission';
11
16
  import '@pactor-app/router';
12
17
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createShadcnComponentRegistry } from './components/index.js';
2
- export { Alert, AlertProps, AlertVariant, Button, ButtonProps, ButtonSize, ButtonVariant, Card, CardProps, FieldRule, Flex, FlexProps, Form, FormContextValue, FormProps, Grid, GridProps, Input, InputProps, Page, PageProps, Select, SelectOption, SelectProps, Statistic, StatisticProps, TabItem, Table, TableColumn, TablePagination, TablePaginationInfo, TableProps, Tabs, TabsProps, registerShadcnComponents, shadcnComponents, useFormContext } from './components/index.js';
2
+ export { Accordion, AccordionItemData, AccordionProps, Alert, AlertDialog, AlertDialogProps, AlertProps, AlertVariant, AspectRatio, AspectRatioProps, Avatar, AvatarProps, Badge, BadgeProps, BadgeVariant, Breadcrumb, BreadcrumbItemData, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, ButtonSize, ButtonVariant, Calendar, CalendarProps, Card, CardProps, Carousel, CarouselImage, CarouselItemData, CarouselProps, Chart, ChartProps, ChartType, Checkbox, CheckboxProps, Collapsible, CollapsibleProps, Combobox, ComboboxOption, ComboboxProps, Command, CommandGroupData, CommandItemData, CommandProps, Content, ContentProps, ContextMenu, ContextMenuItemData, ContextMenuProps, DataTable, DataTableColumn, DataTablePagination, DataTableProps, DataTableSort, DataTableSortOrder, Dialog, DialogProps, Drawer, DrawerPlacement, DrawerProps, DropdownMenu, DropdownMenuItemData, DropdownMenuProps, Empty, EmptyProps, Field, FieldProps, FieldRule, Flex, FlexProps, Footer, FooterProps, Form, FormContextValue, FormProps, Grid, GridProps, Header, HeaderBrandPosition, HeaderDropdown, HeaderDropdownItem, HeaderLocale, HeaderMenuItem, HeaderProps, HeaderUser, HeaderUserItem, HoverCard, HoverCardProps, ICONS, Icon, IconProps, IconSize, Input, InputGroup, InputGroupProps, InputOTP, InputOTPProps, InputProps, Item, ItemProps, Kbd, KbdProps, Label, LabelProps, Layout, LayoutProps, Link, LinkProps, Menu, MenuItem, MenuProps, Menubar, MenubarLeafItem, MenubarMenuData, MenubarProps, NavigationMenu, NavigationMenuChildItem, NavigationMenuItemData, NavigationMenuProps, Page, PageProps, Pagination, PaginationProps, Popover, PopoverProps, Progress, ProgressProps, RadioGroup, RadioGroupOption, RadioGroupProps, RailTooltip, Resizable, ResizablePanelData, ResizableProps, ScrollArea, ScrollAreaProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, SheetSide, Sidebar, SidebarBrand, SidebarNavItem, SidebarProps, Sider, SiderProps, Skeleton, SkeletonProps, SkeletonShape, Slider, SliderProps, Sonner, SonnerProps, Spinner, SpinnerProps, SpinnerSize, Statistic, StatisticProps, Switch, SwitchProps, TabItem, Table, TableColumn, TablePagination, TablePaginationInfo, TableProps, Tabs, TabsProps, Text, TextProps, TextType, Textarea, TextareaProps, Toggle, ToggleGroup, ToggleGroupOption, ToggleGroupProps, ToggleProps, Tooltip, TooltipProps, Typography, TypographyProps, TypographyVariant, normalizeIconName, registerShadcnComponents, shadcnComponents, useFormContext, useSidebarDrawer } from './components/index.js';
3
3
  import { createShadcnLayoutRegistry } from './layout/index.js';
4
4
  export { AdminBrand, AdminLayoutBreakpoint, AdminLayoutConfig, AdminLayoutMode, AdminLayoutProps, BlankLayoutProps, LandingLayoutProps, LayoutComponent, LayoutRegistry, LoginBrand, LoginLayoutProps, ShadcnAdminLayout, ShadcnBlankLayout, ShadcnLandingLayout, ShadcnLoginLayout, collectDefaultOpenKeys, findMenuChain, registerShadcnLayouts, resolveLayout } from './layout/index.js';
5
5
  import { ShadcnInteractionProvider, ShadcnOverlayHost } from './interaction/index.js';
@@ -7,6 +7,11 @@ export { InteractionProviderProps, OVERLAY_CANCEL_PAYLOAD, OverlayConfig, Overla
7
7
  import '@pactor-app/runtime';
8
8
  import 'react';
9
9
  import '@pactor-app/core';
10
+ import 'lucide-react';
11
+ import './typography-DsGdDBc2.js';
12
+ import 'class-variance-authority/types';
13
+ import '@base-ui/react/toggle';
14
+ import 'class-variance-authority';
10
15
  import '@pactor-app/permission';
11
16
  import '@pactor-app/router';
12
17
 
package/dist/index.js CHANGED
@@ -1,21 +1,79 @@
1
1
  import {
2
+ Accordion,
2
3
  Alert,
4
+ AlertDialog,
5
+ AspectRatio,
6
+ Avatar,
7
+ Badge,
8
+ Breadcrumb,
3
9
  Button,
10
+ ButtonGroup,
11
+ Calendar,
4
12
  Card,
13
+ Carousel,
14
+ Chart,
15
+ Checkbox,
16
+ Collapsible,
17
+ Combobox,
18
+ Command,
19
+ Content,
20
+ ContextMenu,
21
+ DataTable,
22
+ Dialog,
23
+ Drawer,
24
+ DropdownMenu,
25
+ Empty,
26
+ Field,
5
27
  Flex,
28
+ Footer,
6
29
  Form,
7
30
  Grid,
31
+ Header,
32
+ HoverCard,
8
33
  Input,
34
+ InputGroup,
35
+ InputOTP,
36
+ Item,
37
+ Kbd,
38
+ Label,
39
+ Layout,
40
+ Link,
41
+ Menu,
42
+ Menubar,
43
+ NavigationMenu,
9
44
  Page,
45
+ Pagination,
46
+ Popover,
47
+ Progress,
48
+ RadioGroup,
49
+ RailTooltip,
50
+ Resizable,
51
+ ScrollArea,
10
52
  Select,
53
+ Separator,
54
+ Sheet,
55
+ Sidebar,
56
+ Sider,
57
+ Skeleton,
58
+ Slider,
59
+ Sonner,
60
+ Spinner,
11
61
  Statistic,
62
+ Switch,
12
63
  Table,
13
64
  Tabs,
65
+ Text,
66
+ Textarea,
67
+ Toggle,
68
+ ToggleGroup,
69
+ Tooltip,
70
+ Typography,
14
71
  createShadcnComponentRegistry,
15
72
  registerShadcnComponents,
16
73
  shadcnComponents,
17
- useFormContext
18
- } from "./chunk-XGOTHOI6.js";
74
+ useFormContext,
75
+ useSidebarDrawer
76
+ } from "./chunk-6B5ZX7L3.js";
19
77
  import {
20
78
  OVERLAY_CANCEL_PAYLOAD,
21
79
  OverlayManager,
@@ -23,7 +81,7 @@ import {
23
81
  ShadcnOverlayHost,
24
82
  createUiBridge,
25
83
  registerInteractionActions
26
- } from "./chunk-OH3U6PCM.js";
84
+ } from "./chunk-BZSRLTQQ.js";
27
85
  import {
28
86
  ShadcnAdminLayout,
29
87
  ShadcnBlankLayout,
@@ -34,12 +92,15 @@ import {
34
92
  findMenuChain,
35
93
  registerShadcnLayouts,
36
94
  resolveLayout
37
- } from "./chunk-DMK6RSTK.js";
38
- import "./chunk-OUTSIJMO.js";
39
- import "./chunk-QDTVOJ5P.js";
40
- import "./chunk-QWZ23QLS.js";
41
- import "./chunk-SNFDI77B.js";
42
- import "./chunk-57NRUZ5G.js";
95
+ } from "./chunk-GV5R6TUT.js";
96
+ import {
97
+ ICONS,
98
+ Icon,
99
+ normalizeIconName
100
+ } from "./chunk-6JNCDPGS.js";
101
+ import "./chunk-BVHAP22U.js";
102
+ import "./chunk-F3H23KYG.js";
103
+ import "./chunk-GL7IO22L.js";
43
104
  import "./chunk-RQHJBTEU.js";
44
105
 
45
106
  // src/index.ts
@@ -52,36 +113,97 @@ var shadcnUiKit = {
52
113
  }
53
114
  };
54
115
  export {
116
+ Accordion,
55
117
  Alert,
118
+ AlertDialog,
119
+ AspectRatio,
120
+ Avatar,
121
+ Badge,
122
+ Breadcrumb,
56
123
  Button,
124
+ ButtonGroup,
125
+ Calendar,
57
126
  Card,
127
+ Carousel,
128
+ Chart,
129
+ Checkbox,
130
+ Collapsible,
131
+ Combobox,
132
+ Command,
133
+ Content,
134
+ ContextMenu,
135
+ DataTable,
136
+ Dialog,
137
+ Drawer,
138
+ DropdownMenu,
139
+ Empty,
140
+ Field,
58
141
  Flex,
142
+ Footer,
59
143
  Form,
60
144
  Grid,
145
+ Header,
146
+ HoverCard,
147
+ ICONS,
148
+ Icon,
61
149
  Input,
150
+ InputGroup,
151
+ InputOTP,
152
+ Item,
153
+ Kbd,
154
+ Label,
155
+ Layout,
156
+ Link,
157
+ Menu,
158
+ Menubar,
159
+ NavigationMenu,
62
160
  OVERLAY_CANCEL_PAYLOAD,
63
161
  OverlayManager,
64
162
  Page,
163
+ Pagination,
164
+ Popover,
165
+ Progress,
166
+ RadioGroup,
167
+ RailTooltip,
168
+ Resizable,
169
+ ScrollArea,
65
170
  Select,
171
+ Separator,
66
172
  ShadcnAdminLayout,
67
173
  ShadcnBlankLayout,
68
174
  ShadcnInteractionProvider,
69
175
  ShadcnLandingLayout,
70
176
  ShadcnLoginLayout,
71
177
  ShadcnOverlayHost,
178
+ Sheet,
179
+ Sidebar,
180
+ Sider,
181
+ Skeleton,
182
+ Slider,
183
+ Sonner,
184
+ Spinner,
72
185
  Statistic,
186
+ Switch,
73
187
  Table,
74
188
  Tabs,
189
+ Text,
190
+ Textarea,
191
+ Toggle,
192
+ ToggleGroup,
193
+ Tooltip,
194
+ Typography,
75
195
  collectDefaultOpenKeys,
76
196
  createShadcnComponentRegistry,
77
197
  createShadcnLayoutRegistry,
78
198
  createUiBridge,
79
199
  findMenuChain,
200
+ normalizeIconName,
80
201
  registerInteractionActions,
81
202
  registerShadcnComponents,
82
203
  registerShadcnLayouts,
83
204
  resolveLayout,
84
205
  shadcnComponents,
85
206
  shadcnUiKit,
86
- useFormContext
207
+ useFormContext,
208
+ useSidebarDrawer
87
209
  };
@@ -189,7 +189,7 @@ function registerInteractionActions(actions, manager, ui) {
189
189
  );
190
190
  }
191
191
  const params = action.params ?? {};
192
- const type = params["type"];
192
+ const type = params["messageType"] ?? params["type"];
193
193
  const text = params["text"];
194
194
  if (type === "success" || type === "error" || type === "warning") {
195
195
  message[type](text);
@@ -207,6 +207,7 @@ function isRecord(value) {
207
207
  }
208
208
 
209
209
  // src/interaction/provider.tsx
210
+ var import_runtime2 = require("@pactor-app/runtime");
210
211
  var import_react = require("react");
211
212
  var import_react_dom = require("react-dom");
212
213
 
@@ -418,6 +419,7 @@ function ShadcnInteractionProvider({
418
419
  }) {
419
420
  const [confirmState, setConfirmState] = (0, import_react.useState)(null);
420
421
  const [toasts, setToasts] = (0, import_react.useState)([]);
422
+ const { t } = (0, import_runtime2.useI18n)();
421
423
  const { modal, message } = (0, import_react.useMemo)(() => {
422
424
  const pushToast = (type, content) => {
423
425
  const id = Date.now() + Math.random();
@@ -481,8 +483,8 @@ function ShadcnInteractionProvider({
481
483
  )
482
484
  ] }),
483
485
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(DialogFooter, { children: [
484
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Button, { type: "button", variant: "outline", onClick: handleCancel, children: "\u53D6\u6D88" }),
485
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Button, { type: "button", onClick: handleOk, children: "\u786E\u5B9A" })
486
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Button, { type: "button", variant: "outline", onClick: handleCancel, children: t("pactor.alertDialog.cancel") }),
487
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Button, { type: "button", onClick: handleOk, children: t("pactor.alertDialog.confirm") })
486
488
  ] })
487
489
  ] })
488
490
  }
@@ -516,9 +518,94 @@ function ShadcnInteractionProvider({
516
518
 
517
519
  // src/interaction/host.tsx
518
520
  var import_lucide_react2 = require("lucide-react");
519
- var import_runtime2 = require("@pactor-app/runtime");
521
+ var import_runtime3 = require("@pactor-app/runtime");
520
522
  var import_react2 = require("react");
523
+
524
+ // src/ui/drawer.tsx
525
+ var import_vaul = require("vaul");
521
526
  var import_jsx_runtime4 = require("react/jsx-runtime");
527
+ function Drawer({
528
+ ...props
529
+ }) {
530
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_vaul.Drawer.Root, { "data-slot": "drawer", ...props });
531
+ }
532
+ function DrawerPortal({
533
+ ...props
534
+ }) {
535
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_vaul.Drawer.Portal, { "data-slot": "drawer-portal", ...props });
536
+ }
537
+ function DrawerClose({
538
+ ...props
539
+ }) {
540
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_vaul.Drawer.Close, { "data-slot": "drawer-close", ...props });
541
+ }
542
+ function DrawerOverlay({
543
+ className,
544
+ ...props
545
+ }) {
546
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
547
+ import_vaul.Drawer.Overlay,
548
+ {
549
+ "data-slot": "drawer-overlay",
550
+ className: cn("fixed inset-0 z-50 bg-black/50", className),
551
+ ...props
552
+ }
553
+ );
554
+ }
555
+ function DrawerContent({
556
+ className,
557
+ children,
558
+ ...props
559
+ }) {
560
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(DrawerPortal, { "data-slot": "drawer-portal", children: [
561
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DrawerOverlay, {}),
562
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
563
+ import_vaul.Drawer.Content,
564
+ {
565
+ "data-slot": "drawer-content",
566
+ className: cn(
567
+ "group/drawer-content fixed z-50 flex h-auto flex-col border-border bg-background",
568
+ "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
569
+ "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
570
+ "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
571
+ "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
572
+ className
573
+ ),
574
+ ...props,
575
+ children: [
576
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }),
577
+ children
578
+ ]
579
+ }
580
+ )
581
+ ] });
582
+ }
583
+ function DrawerHeader({ className, ...props }) {
584
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
585
+ "div",
586
+ {
587
+ "data-slot": "drawer-header",
588
+ className: cn("flex flex-col gap-1.5 p-4", className),
589
+ ...props
590
+ }
591
+ );
592
+ }
593
+ function DrawerTitle({
594
+ className,
595
+ ...props
596
+ }) {
597
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
598
+ import_vaul.Drawer.Title,
599
+ {
600
+ "data-slot": "drawer-title",
601
+ className: cn("font-semibold text-foreground", className),
602
+ ...props
603
+ }
604
+ );
605
+ }
606
+
607
+ // src/interaction/host.tsx
608
+ var import_jsx_runtime5 = require("react/jsx-runtime");
522
609
  function toCssWidth(width) {
523
610
  if (width === void 0) {
524
611
  return void 0;
@@ -526,7 +613,7 @@ function toCssWidth(width) {
526
613
  return typeof width === "number" ? `${width}px` : width;
527
614
  }
528
615
  function ShadcnOverlayHost({ manager, resolvePage }) {
529
- const renderer = (0, import_runtime2.useRenderer)();
616
+ const renderer = (0, import_runtime3.useRenderer)();
530
617
  const stack = (0, import_react2.useSyncExternalStore)(
531
618
  (onChange) => manager.subscribe(onChange),
532
619
  () => manager.stack()
@@ -542,7 +629,7 @@ function ShadcnOverlayHost({ manager, resolvePage }) {
542
629
  },
543
630
  () => `${renderer.context.state.getVersion()}:${renderer.context.data.getVersion()}`
544
631
  );
545
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: stack.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
632
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: stack.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
546
633
  OverlayEntryView,
547
634
  {
548
635
  entry,
@@ -559,6 +646,7 @@ function OverlayEntryView({
559
646
  renderer,
560
647
  resolvePage
561
648
  }) {
649
+ const { t } = (0, import_runtime3.useI18n)();
562
650
  const handleCancel = () => manager.close(entry.id);
563
651
  let body = null;
564
652
  if (entry.content) {
@@ -567,7 +655,7 @@ function OverlayEntryView({
567
655
  parent: manager.parentScopeOf(entry.id)
568
656
  });
569
657
  } else if (entry.page) {
570
- body = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
658
+ body = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
571
659
  PageOverlayBody,
572
660
  {
573
661
  entry,
@@ -577,9 +665,9 @@ function OverlayEntryView({
577
665
  );
578
666
  }
579
667
  if (entry.type === "drawer") {
580
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ShadcnDrawerView, { entry, onCancel: handleCancel, children: body });
668
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ShadcnDrawerView, { entry, onCancel: handleCancel, children: body });
581
669
  }
582
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
670
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
583
671
  Dialog,
584
672
  {
585
673
  open: true,
@@ -588,7 +676,7 @@ function OverlayEntryView({
588
676
  handleCancel();
589
677
  }
590
678
  },
591
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
679
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
592
680
  DialogContent,
593
681
  {
594
682
  "data-slot": "overlay-modal",
@@ -596,25 +684,25 @@ function OverlayEntryView({
596
684
  style: entry.width === void 0 ? void 0 : { width: toCssWidth(entry.width) },
597
685
  showCloseButton: false,
598
686
  children: [
599
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(DialogHeader, { children: [
600
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DialogTitle, { children: entry.title ?? "" }),
601
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
687
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(DialogHeader, { children: [
688
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DialogTitle, { children: entry.title ?? "" }),
689
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
602
690
  DialogClose,
603
691
  {
604
- render: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
692
+ render: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
605
693
  "button",
606
694
  {
607
695
  type: "button",
608
696
  "data-slot": "overlay-modal-close",
609
- "aria-label": "\u5173\u95ED",
697
+ "aria-label": t("pactor.overlay.close"),
610
698
  className: "absolute top-4 right-4 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none",
611
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.XIcon, { className: "size-4" })
699
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.XIcon, { className: "size-4" })
612
700
  }
613
701
  )
614
702
  }
615
703
  )
616
704
  ] }),
617
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "data-slot": "overlay-modal-body", children: body })
705
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { "data-slot": "overlay-modal-body", children: body })
618
706
  ]
619
707
  }
620
708
  )
@@ -626,64 +714,51 @@ function ShadcnDrawerView({
626
714
  onCancel,
627
715
  children
628
716
  }) {
629
- (0, import_react2.useEffect)(() => {
630
- const handleKeyDown = (event) => {
631
- if (event.key === "Escape") {
632
- onCancel();
633
- }
634
- };
635
- document.addEventListener("keydown", handleKeyDown);
636
- return () => {
637
- document.removeEventListener("keydown", handleKeyDown);
638
- };
639
- }, [onCancel]);
717
+ const { t } = (0, import_runtime3.useI18n)();
640
718
  const panelStyle = entry.width === void 0 ? void 0 : { width: toCssWidth(entry.width) };
641
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { "data-slot": "drawer-root", children: [
642
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
643
- "div",
644
- {
645
- "data-slot": "drawer-mask",
646
- "data-testid": "drawer-mask",
647
- className: "fixed inset-0 z-50 bg-black/50",
648
- onClick: onCancel
649
- }
650
- ),
651
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
652
- "div",
653
- {
654
- "data-slot": "drawer-panel",
655
- role: "dialog",
656
- "aria-modal": "true",
657
- "aria-label": entry.title,
658
- style: panelStyle,
659
- className: "fixed inset-y-0 right-0 z-50 flex w-96 max-w-full flex-col border-l border-border bg-background shadow-lg",
660
- children: [
661
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
662
- "div",
663
- {
664
- "data-slot": "drawer-header",
665
- className: "flex items-center justify-between border-b border-border px-6 py-4",
666
- children: [
667
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-lg font-semibold", children: entry.title ?? "" }),
668
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
669
- "button",
670
- {
671
- type: "button",
672
- "data-slot": "drawer-close",
673
- "aria-label": "\u5173\u95ED",
674
- className: "cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none",
675
- onClick: onCancel,
676
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.XIcon, { className: "size-4" })
677
- }
678
- )
679
- ]
680
- }
681
- ),
682
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "data-slot": "drawer-body", className: "flex-1 overflow-auto p-6", children })
683
- ]
684
- }
685
- )
686
- ] });
719
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
720
+ Drawer,
721
+ {
722
+ direction: "right",
723
+ open: true,
724
+ onOpenChange: (open) => {
725
+ if (!open) {
726
+ onCancel();
727
+ }
728
+ },
729
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
730
+ DrawerContent,
731
+ {
732
+ "data-slot": "drawer-panel",
733
+ className: cn(entry.width !== void 0 && "sm:max-w-none"),
734
+ style: panelStyle,
735
+ children: [
736
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
737
+ DrawerHeader,
738
+ {
739
+ "data-slot": "drawer-header",
740
+ className: "flex flex-row items-center justify-between border-b border-border px-6 py-4",
741
+ children: [
742
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DrawerTitle, { className: "text-lg", children: entry.title ?? "" }),
743
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DrawerClose, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
744
+ "button",
745
+ {
746
+ type: "button",
747
+ "data-slot": "drawer-close",
748
+ "aria-label": t("pactor.overlay.close"),
749
+ className: "cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none",
750
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.XIcon, { className: "size-4" })
751
+ }
752
+ ) })
753
+ ]
754
+ }
755
+ ),
756
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { "data-slot": "drawer-body", className: "flex-1 overflow-auto p-6", children })
757
+ ]
758
+ }
759
+ )
760
+ }
761
+ );
687
762
  }
688
763
  function PageOverlayBody({
689
764
  entry,
@@ -710,7 +785,7 @@ function PageOverlayBody({
710
785
  return;
711
786
  }
712
787
  const host = renderer.context;
713
- created = (0, import_runtime2.createPageRuntime)(pageDsl, {
788
+ created = (0, import_runtime3.createPageRuntime)(pageDsl, {
714
789
  app: host.app,
715
790
  user: host.user,
716
791
  components: host.components,
@@ -734,12 +809,12 @@ function PageOverlayBody({
734
809
  };
735
810
  }, [entry.id]);
736
811
  if (error) {
737
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { role: "alert", children: error.message });
812
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { role: "alert", children: error.message });
738
813
  }
739
814
  if (!child) {
740
815
  return null;
741
816
  }
742
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_runtime2.PageRuntimeView, { runtime: child });
817
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_runtime3.PageRuntimeView, { runtime: child });
743
818
  }
744
819
  // Annotate the CommonJS export names for ESM import in node:
745
820
  0 && (module.exports = {
@@ -125,8 +125,10 @@ declare function createUiBridge(): UiBridge;
125
125
  * - `confirm`:`params.title` / `params.content` → UiBridge 注入的
126
126
  * modal.confirm,确认返回 data `true`,取消返回 `false`;UiBridge
127
127
  * 未注入 modal 时返回 `{ ok: false }` 受控失败
128
- * - `message`:`params.type`(success / error / info / warning,缺省
129
- * info)+ `params.text` UiBridge 注入的 message;未注入时受控失败
128
+ * - `message`:`params.messageType`(success / error / info / warning
129
+ * 缺省 info;推荐别名——params `type` 键会被动作引擎 isOpaque
130
+ * 约定跳过表达式求值)+ `params.text` → UiBridge 注入的 message;
131
+ * 未注入时受控失败。`params.type` 保留为兼容别名(静态文案可用)
130
132
  *
131
133
  * 已注册的同名动作不会被覆盖(与 registerBuiltinActions 同约定)。
132
134
  */
@@ -164,9 +166,9 @@ interface OverlayHostProps {
164
166
  /**
165
167
  * ShadcnOverlayHost:与 pactor-interaction 的 OverlayHost(antd 版)契约一致——
166
168
  * 订阅同一 OverlayManager 堆栈逐条渲染;type 为 modal 用 vendored shadcn
167
- * Dialog、drawer 用自绘固定右侧面板 + 遮罩(无 drawer 原语);title/width
168
- * 原样应用;UI 取消(X / 遮罩 / Escape)触发取消语义 close(resolve
169
- * `{ success: false }`)。
169
+ * Dialog、drawer vendored drawer 原语(vaul,与 DSL 弹层适配器同一套
170
+ * src/ui 原语,design D4);title/width 原样应用;UI 取消(X / 遮罩 /
171
+ * Escape)触发取消语义 close(resolve `{ success: false }`)。
170
172
  *
171
173
  * 与 antd 版相同:必须位于 PageRuntime 的 React Context 之内;DSL content
172
174
  * 经当前 Renderer 的 `renderChildren` 渲染,作用域注入
@@ -125,8 +125,10 @@ declare function createUiBridge(): UiBridge;
125
125
  * - `confirm`:`params.title` / `params.content` → UiBridge 注入的
126
126
  * modal.confirm,确认返回 data `true`,取消返回 `false`;UiBridge
127
127
  * 未注入 modal 时返回 `{ ok: false }` 受控失败
128
- * - `message`:`params.type`(success / error / info / warning,缺省
129
- * info)+ `params.text` UiBridge 注入的 message;未注入时受控失败
128
+ * - `message`:`params.messageType`(success / error / info / warning
129
+ * 缺省 info;推荐别名——params `type` 键会被动作引擎 isOpaque
130
+ * 约定跳过表达式求值)+ `params.text` → UiBridge 注入的 message;
131
+ * 未注入时受控失败。`params.type` 保留为兼容别名(静态文案可用)
130
132
  *
131
133
  * 已注册的同名动作不会被覆盖(与 registerBuiltinActions 同约定)。
132
134
  */
@@ -164,9 +166,9 @@ interface OverlayHostProps {
164
166
  /**
165
167
  * ShadcnOverlayHost:与 pactor-interaction 的 OverlayHost(antd 版)契约一致——
166
168
  * 订阅同一 OverlayManager 堆栈逐条渲染;type 为 modal 用 vendored shadcn
167
- * Dialog、drawer 用自绘固定右侧面板 + 遮罩(无 drawer 原语);title/width
168
- * 原样应用;UI 取消(X / 遮罩 / Escape)触发取消语义 close(resolve
169
- * `{ success: false }`)。
169
+ * Dialog、drawer vendored drawer 原语(vaul,与 DSL 弹层适配器同一套
170
+ * src/ui 原语,design D4);title/width 原样应用;UI 取消(X / 遮罩 /
171
+ * Escape)触发取消语义 close(resolve `{ success: false }`)。
170
172
  *
171
173
  * 与 antd 版相同:必须位于 PageRuntime 的 React Context 之内;DSL content
172
174
  * 经当前 Renderer 的 `renderChildren` 渲染,作用域注入