@pactor-app/ui 1.2.0 → 1.7.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.
@@ -1,101 +1,41 @@
1
1
  import {
2
2
  cn
3
- } from "./chunk-RQHJBTEU.js";
4
-
5
- // src/ui/button.tsx
6
- import { Button as ButtonPrimitive } from "@base-ui/react/button";
7
- import { cva } from "class-variance-authority";
8
- import * as React from "react";
9
- import { jsx } from "react/jsx-runtime";
10
- var buttonVariants = cva(
11
- "inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
12
- {
13
- variants: {
14
- variant: {
15
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
16
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20",
17
- outline: "border border-border bg-background hover:bg-accent hover:text-accent-foreground",
18
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19
- ghost: "hover:bg-accent hover:text-accent-foreground",
20
- link: "text-primary underline-offset-4 hover:underline"
21
- },
22
- size: {
23
- default: "h-9 px-4 py-2",
24
- sm: "h-8 gap-1.5 rounded-md px-3 text-xs",
25
- lg: "h-10 rounded-md px-6",
26
- icon: "size-9"
27
- }
28
- },
29
- defaultVariants: {
30
- variant: "default",
31
- size: "default"
32
- }
33
- }
34
- );
35
- function Button({
36
- className,
37
- variant,
38
- size,
39
- asChild = false,
40
- children,
41
- ...props
42
- }) {
43
- if (asChild && React.isValidElement(children)) {
44
- return /* @__PURE__ */ jsx(
45
- ButtonPrimitive,
46
- {
47
- "data-slot": "button",
48
- className: cn(buttonVariants({ variant, size, className })),
49
- render: children,
50
- ...props
51
- }
52
- );
53
- }
54
- return /* @__PURE__ */ jsx(
55
- ButtonPrimitive,
56
- {
57
- "data-slot": "button",
58
- className: cn(buttonVariants({ variant, size, className })),
59
- ...props,
60
- children
61
- }
62
- );
63
- }
3
+ } from "./chunk-WKJUCGV4.js";
64
4
 
65
5
  // src/ui/dialog.tsx
66
6
  import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
67
7
  import { XIcon } from "lucide-react";
68
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
69
9
  function Dialog({
70
10
  ...props
71
11
  }) {
72
- return /* @__PURE__ */ jsx2(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
12
+ return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
73
13
  }
74
14
  function DialogTrigger({
75
15
  ...props
76
16
  }) {
77
- return /* @__PURE__ */ jsx2(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
17
+ return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
78
18
  }
79
19
  function DialogPortal({
80
20
  ...props
81
21
  }) {
82
- return /* @__PURE__ */ jsx2(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
22
+ return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
83
23
  }
84
24
  function DialogClose({
85
25
  ...props
86
26
  }) {
87
- return /* @__PURE__ */ jsx2(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
27
+ return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
88
28
  }
89
29
  function DialogOverlay({
90
30
  className,
91
31
  ...props
92
32
  }) {
93
- return /* @__PURE__ */ jsx2(
33
+ return /* @__PURE__ */ jsx(
94
34
  DialogPrimitive.Backdrop,
95
35
  {
96
36
  "data-slot": "dialog-overlay",
97
37
  className: cn(
98
- "fixed inset-0 z-50 bg-black/50 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",
99
39
  className
100
40
  ),
101
41
  ...props
@@ -109,13 +49,13 @@ function DialogContent({
109
49
  ...props
110
50
  }) {
111
51
  return /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
112
- /* @__PURE__ */ jsx2(DialogOverlay, {}),
52
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
113
53
  /* @__PURE__ */ jsxs(
114
54
  DialogPrimitive.Popup,
115
55
  {
116
56
  "data-slot": "dialog-content",
117
57
  className: cn(
118
- "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-background p-6 shadow-lg 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 sm:max-w-lg",
119
59
  className
120
60
  ),
121
61
  ...props,
@@ -125,7 +65,7 @@ function DialogContent({
125
65
  DialogPrimitive.Close,
126
66
  {
127
67
  "data-slot": "dialog-close",
128
- render: /* @__PURE__ */ jsx2(
68
+ render: /* @__PURE__ */ jsx(
129
69
  "button",
130
70
  {
131
71
  type: "button",
@@ -133,8 +73,8 @@ function DialogContent({
133
73
  }
134
74
  ),
135
75
  children: [
136
- /* @__PURE__ */ jsx2(XIcon, {}),
137
- /* @__PURE__ */ jsx2("span", { className: "sr-only", children: "Close" })
76
+ /* @__PURE__ */ jsx(XIcon, {}),
77
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
138
78
  ]
139
79
  }
140
80
  )
@@ -144,7 +84,7 @@ function DialogContent({
144
84
  ] });
145
85
  }
146
86
  function DialogHeader({ className, ...props }) {
147
- return /* @__PURE__ */ jsx2(
87
+ return /* @__PURE__ */ jsx(
148
88
  "div",
149
89
  {
150
90
  "data-slot": "dialog-header",
@@ -154,7 +94,7 @@ function DialogHeader({ className, ...props }) {
154
94
  );
155
95
  }
156
96
  function DialogFooter({ className, ...props }) {
157
- return /* @__PURE__ */ jsx2(
97
+ return /* @__PURE__ */ jsx(
158
98
  "div",
159
99
  {
160
100
  "data-slot": "dialog-footer",
@@ -170,7 +110,7 @@ function DialogTitle({
170
110
  className,
171
111
  ...props
172
112
  }) {
173
- return /* @__PURE__ */ jsx2(
113
+ return /* @__PURE__ */ jsx(
174
114
  DialogPrimitive.Title,
175
115
  {
176
116
  "data-slot": "dialog-title",
@@ -183,7 +123,7 @@ function DialogDescription({
183
123
  className,
184
124
  ...props
185
125
  }) {
186
- return /* @__PURE__ */ jsx2(
126
+ return /* @__PURE__ */ jsx(
187
127
  DialogPrimitive.Description,
188
128
  {
189
129
  "data-slot": "dialog-description",
@@ -195,36 +135,36 @@ function DialogDescription({
195
135
 
196
136
  // src/ui/drawer.tsx
197
137
  import { Drawer as DrawerPrimitive } from "vaul";
198
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
138
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
199
139
  function Drawer({
200
140
  ...props
201
141
  }) {
202
- return /* @__PURE__ */ jsx3(DrawerPrimitive.Root, { "data-slot": "drawer", ...props });
142
+ return /* @__PURE__ */ jsx2(DrawerPrimitive.Root, { "data-slot": "drawer", ...props });
203
143
  }
204
144
  function DrawerTrigger({
205
145
  ...props
206
146
  }) {
207
- return /* @__PURE__ */ jsx3(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
147
+ return /* @__PURE__ */ jsx2(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
208
148
  }
209
149
  function DrawerPortal({
210
150
  ...props
211
151
  }) {
212
- return /* @__PURE__ */ jsx3(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", ...props });
152
+ return /* @__PURE__ */ jsx2(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", ...props });
213
153
  }
214
154
  function DrawerClose({
215
155
  ...props
216
156
  }) {
217
- return /* @__PURE__ */ jsx3(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...props });
157
+ return /* @__PURE__ */ jsx2(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...props });
218
158
  }
219
159
  function DrawerOverlay({
220
160
  className,
221
161
  ...props
222
162
  }) {
223
- return /* @__PURE__ */ jsx3(
163
+ return /* @__PURE__ */ jsx2(
224
164
  DrawerPrimitive.Overlay,
225
165
  {
226
166
  "data-slot": "drawer-overlay",
227
- className: cn("fixed inset-0 z-50 bg-black/50", className),
167
+ className: cn("fixed inset-0 z-50 bg-(--overlay-background)", className),
228
168
  ...props
229
169
  }
230
170
  );
@@ -235,13 +175,13 @@ function DrawerContent({
235
175
  ...props
236
176
  }) {
237
177
  return /* @__PURE__ */ jsxs2(DrawerPortal, { "data-slot": "drawer-portal", children: [
238
- /* @__PURE__ */ jsx3(DrawerOverlay, {}),
178
+ /* @__PURE__ */ jsx2(DrawerOverlay, {}),
239
179
  /* @__PURE__ */ jsxs2(
240
180
  DrawerPrimitive.Content,
241
181
  {
242
182
  "data-slot": "drawer-content",
243
183
  className: cn(
244
- "group/drawer-content fixed z-50 flex h-auto flex-col border-border bg-background",
184
+ "group/drawer-content fixed z-50 flex h-auto flex-col border-border bg-popover",
245
185
  "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",
246
186
  "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",
247
187
  "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",
@@ -250,7 +190,7 @@ function DrawerContent({
250
190
  ),
251
191
  ...props,
252
192
  children: [
253
- /* @__PURE__ */ jsx3("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" }),
193
+ /* @__PURE__ */ jsx2("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" }),
254
194
  children
255
195
  ]
256
196
  }
@@ -258,7 +198,7 @@ function DrawerContent({
258
198
  ] });
259
199
  }
260
200
  function DrawerHeader({ className, ...props }) {
261
- return /* @__PURE__ */ jsx3(
201
+ return /* @__PURE__ */ jsx2(
262
202
  "div",
263
203
  {
264
204
  "data-slot": "drawer-header",
@@ -268,7 +208,7 @@ function DrawerHeader({ className, ...props }) {
268
208
  );
269
209
  }
270
210
  function DrawerFooter({ className, ...props }) {
271
- return /* @__PURE__ */ jsx3(
211
+ return /* @__PURE__ */ jsx2(
272
212
  "div",
273
213
  {
274
214
  "data-slot": "drawer-footer",
@@ -281,7 +221,7 @@ function DrawerTitle({
281
221
  className,
282
222
  ...props
283
223
  }) {
284
- return /* @__PURE__ */ jsx3(
224
+ return /* @__PURE__ */ jsx2(
285
225
  DrawerPrimitive.Title,
286
226
  {
287
227
  "data-slot": "drawer-title",
@@ -294,7 +234,7 @@ function DrawerDescription({
294
234
  className,
295
235
  ...props
296
236
  }) {
297
- return /* @__PURE__ */ jsx3(
237
+ return /* @__PURE__ */ jsx2(
298
238
  DrawerPrimitive.Description,
299
239
  {
300
240
  "data-slot": "drawer-description",
@@ -305,8 +245,6 @@ function DrawerDescription({
305
245
  }
306
246
 
307
247
  export {
308
- buttonVariants,
309
- Button,
310
248
  Dialog,
311
249
  DialogTrigger,
312
250
  DialogPortal,
@@ -2,7 +2,7 @@ import {
2
2
  Icon,
3
3
  Menu,
4
4
  Sidebar
5
- } from "./chunk-HJPHJKVA.js";
5
+ } from "./chunk-ZM3WJZZ7.js";
6
6
  import {
7
7
  Accordion,
8
8
  AccordionContent,
@@ -15,10 +15,10 @@ import {
15
15
  Popover,
16
16
  PopoverContent,
17
17
  PopoverTrigger
18
- } from "./chunk-2LYMCWEJ.js";
18
+ } from "./chunk-L4Z7MNYY.js";
19
19
  import {
20
20
  cn
21
- } from "./chunk-RQHJBTEU.js";
21
+ } from "./chunk-WKJUCGV4.js";
22
22
 
23
23
  // src/layout/admin/menu-chain.ts
24
24
  function findMenuChain(registry, menuId) {
@@ -121,7 +121,7 @@ function navigateMenuItem(menu, bridge) {
121
121
  }
122
122
  bridge.push(menu.path);
123
123
  }
124
- var menuItemClass = "flex w-full cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-left text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50";
124
+ var menuItemClass = "flex w-full cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-left text-sm text-muted-foreground transition-colors hover:bg-(--menu-hover-background) hover:text-(--menu-hover-foreground) disabled:pointer-events-none disabled:opacity-50";
125
125
  function CollapsedGroupFlyout({
126
126
  menu,
127
127
  registry,
@@ -227,7 +227,7 @@ function MenuTree({
227
227
  className: cn(
228
228
  menuItemClass,
229
229
  "mx-auto size-10 justify-center px-0 font-semibold",
230
- menu.id === activeMenuId && "bg-accent font-semibold text-accent-foreground"
230
+ menu.id === activeMenuId && "bg-(--menu-active-background) font-semibold text-(--menu-active-foreground)"
231
231
  ),
232
232
  disabled: menu.disabled,
233
233
  title: menu.title,
@@ -290,7 +290,7 @@ function MenuTree({
290
290
  "data-active": menu.id === activeMenuId || void 0,
291
291
  className: cn(
292
292
  menuItemClass,
293
- menu.id === activeMenuId && "bg-accent font-semibold text-accent-foreground"
293
+ menu.id === activeMenuId && "bg-(--menu-active-background) font-semibold text-(--menu-active-foreground)"
294
294
  ),
295
295
  disabled: menu.disabled,
296
296
  title: menu.title,
@@ -396,7 +396,7 @@ function AdminLayout({
396
396
  {
397
397
  "data-slot": "admin-header",
398
398
  className: cn(
399
- "flex h-14 items-center gap-4 border-b border-border bg-background px-6",
399
+ "flex h-14 items-center gap-4 border-b border-border bg-card px-6",
400
400
  fixedHeader && "sticky top-0 z-20"
401
401
  ),
402
402
  children: [
@@ -423,7 +423,7 @@ function AdminLayout({
423
423
  className: cn(
424
424
  menuItemClass,
425
425
  "size-10 justify-center px-0 font-semibold",
426
- (menu.id === secondaryTopId || menu.id === activeTopId) && "bg-accent text-accent-foreground"
426
+ (menu.id === secondaryTopId || menu.id === activeTopId) && "bg-(--menu-active-background) text-(--menu-active-foreground)"
427
427
  ),
428
428
  disabled: menu.disabled,
429
429
  title: menu.title,
@@ -447,7 +447,7 @@ function AdminLayout({
447
447
  "data-slot": "admin-sidebar",
448
448
  "data-collapsed": effectiveCollapsed || void 0,
449
449
  className: cn(
450
- "shrink-0 overflow-auto border-r border-border bg-background py-2",
450
+ "shrink-0 overflow-auto border-r border-border bg-sidebar py-2",
451
451
  effectiveCollapsed ? "w-16 px-1.5" : "w-52",
452
452
  fixedSider && (mode === "side-full" ? "sticky top-0 h-screen" : "sticky top-14 h-[calc(100vh-3.5rem)]")
453
453
  ),
@@ -494,7 +494,7 @@ function AdminLayout({
494
494
  "data-slot": "admin-collapse-trigger",
495
495
  "aria-label": effectiveCollapsed ? t("pactor.layout.expandSidebar") : t("pactor.layout.collapseSidebar"),
496
496
  "aria-expanded": !effectiveCollapsed,
497
- className: "sticky bottom-0 flex w-full cursor-pointer items-center justify-center border-t border-border bg-background py-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
497
+ className: "sticky bottom-0 flex w-full cursor-pointer items-center justify-center border-t border-border bg-sidebar py-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
498
498
  onClick: () => setCollapsed((value) => !value),
499
499
  children: effectiveCollapsed ? "\xBB" : "\xAB"
500
500
  }
@@ -508,7 +508,7 @@ function AdminLayout({
508
508
  {
509
509
  "data-slot": "admin-tabs",
510
510
  role: "tablist",
511
- className: "flex items-center gap-1 border-b border-border bg-background px-4 pt-2",
511
+ className: "flex items-center gap-1 border-b border-border bg-card px-4 pt-2",
512
512
  children: tabs.map((tab, index) => /* @__PURE__ */ jsxs(
513
513
  "div",
514
514
  {
@@ -517,7 +517,7 @@ function AdminLayout({
517
517
  role: "presentation",
518
518
  className: cn(
519
519
  "inline-flex items-center gap-1 rounded-t-md border border-b-0 border-border px-3 py-1.5 text-sm",
520
- tab.key === currentPath ? "bg-background font-medium text-foreground" : "bg-muted text-muted-foreground"
520
+ tab.key === currentPath ? "bg-card font-medium text-foreground" : "bg-muted text-muted-foreground"
521
521
  ),
522
522
  children: [
523
523
  /* @__PURE__ */ jsx(
@@ -827,7 +827,7 @@ function LandingLayout({
827
827
  "header",
828
828
  {
829
829
  "data-slot": "landing-navbar",
830
- className: "border-b border-border bg-background",
830
+ className: "border-b border-border bg-card",
831
831
  children: navbar
832
832
  }
833
833
  ),