@pactor-app/ui 1.2.0 → 1.3.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/ui/index.js CHANGED
@@ -72,7 +72,6 @@ import {
72
72
  HoverCard,
73
73
  HoverCardContent,
74
74
  HoverCardTrigger,
75
- Input,
76
75
  InputGroup,
77
76
  InputGroupAddon,
78
77
  InputGroupInput,
@@ -128,18 +127,6 @@ import {
128
127
  SelectSeparator,
129
128
  SelectTrigger,
130
129
  SelectValue,
131
- Separator,
132
- Sheet,
133
- SheetClose,
134
- SheetContent,
135
- SheetDescription,
136
- SheetFooter,
137
- SheetHeader,
138
- SheetOverlay,
139
- SheetPortal,
140
- SheetTitle,
141
- SheetTrigger,
142
- Skeleton,
143
130
  Slider,
144
131
  SliderControl,
145
132
  SliderIndicator,
@@ -173,9 +160,8 @@ import {
173
160
  toggleVariants,
174
161
  typographyVariants,
175
162
  useCarousel
176
- } from "../chunk-Q5NUGUJG.js";
163
+ } from "../chunk-UKA7C3JP.js";
177
164
  import {
178
- Button,
179
165
  Dialog,
180
166
  DialogClose,
181
167
  DialogContent,
@@ -195,9 +181,8 @@ import {
195
181
  DrawerOverlay,
196
182
  DrawerPortal,
197
183
  DrawerTitle,
198
- DrawerTrigger,
199
- buttonVariants
200
- } from "../chunk-F3H23KYG.js";
184
+ DrawerTrigger
185
+ } from "../chunk-F42SGQNW.js";
201
186
  import {
202
187
  Accordion,
203
188
  AccordionContent,
@@ -210,15 +195,446 @@ import {
210
195
  CardFooter,
211
196
  CardHeader,
212
197
  CardTitle,
198
+ Input,
213
199
  Popover,
214
200
  PopoverContent,
215
201
  PopoverTrigger,
202
+ Separator,
203
+ Sheet,
204
+ SheetClose,
205
+ SheetContent,
206
+ SheetDescription,
207
+ SheetFooter,
208
+ SheetHeader,
209
+ SheetOverlay,
210
+ SheetPortal,
211
+ SheetTitle,
212
+ SheetTrigger,
213
+ SidebarContent,
214
+ SidebarFooter,
215
+ SidebarGroup,
216
+ SidebarGroupAction,
217
+ SidebarGroupContent,
218
+ SidebarGroupLabel,
219
+ SidebarHeader,
220
+ SidebarInput,
221
+ SidebarInset,
222
+ SidebarMenu,
223
+ SidebarMenuAction,
224
+ SidebarMenuBadge,
225
+ SidebarMenuButton,
226
+ SidebarMenuItem,
227
+ SidebarMenuSkeleton,
228
+ SidebarMenuSub,
229
+ SidebarMenuSubButton,
230
+ SidebarMenuSubItem,
231
+ SidebarProvider,
232
+ SidebarRail,
233
+ SidebarRoot,
234
+ SidebarSeparator,
235
+ SidebarTrigger,
236
+ Skeleton,
216
237
  Tooltip,
217
238
  TooltipContent,
218
239
  TooltipProvider,
219
- TooltipTrigger
220
- } from "../chunk-2LYMCWEJ.js";
221
- import "../chunk-RQHJBTEU.js";
240
+ TooltipTrigger,
241
+ useSidebar
242
+ } from "../chunk-L4Z7MNYY.js";
243
+ import {
244
+ Button,
245
+ buttonVariants,
246
+ cn
247
+ } from "../chunk-WKJUCGV4.js";
248
+
249
+ // src/ui/attachment.tsx
250
+ import { cva } from "class-variance-authority";
251
+ import * as React from "react";
252
+ import { jsx } from "react/jsx-runtime";
253
+ var attachmentVariants = cva(
254
+ "group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",
255
+ {
256
+ variants: {
257
+ size: {
258
+ default: "gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",
259
+ sm: "gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",
260
+ xs: "gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"
261
+ },
262
+ orientation: {
263
+ horizontal: "min-w-40 items-center",
264
+ vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30"
265
+ }
266
+ }
267
+ }
268
+ );
269
+ function Attachment({
270
+ className,
271
+ state = "done",
272
+ size = "default",
273
+ orientation = "horizontal",
274
+ ...props
275
+ }) {
276
+ return /* @__PURE__ */ jsx(
277
+ "div",
278
+ {
279
+ "data-slot": "attachment",
280
+ "data-state": state,
281
+ "data-size": size,
282
+ "data-orientation": orientation,
283
+ className: cn(attachmentVariants({ size, orientation }), className),
284
+ ...props
285
+ }
286
+ );
287
+ }
288
+ var attachmentMediaVariants = cva(
289
+ "relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5",
290
+ {
291
+ variants: {
292
+ variant: {
293
+ icon: "",
294
+ image: "opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"
295
+ }
296
+ },
297
+ defaultVariants: {
298
+ variant: "icon"
299
+ }
300
+ }
301
+ );
302
+ function AttachmentMedia({
303
+ className,
304
+ variant = "icon",
305
+ ...props
306
+ }) {
307
+ return /* @__PURE__ */ jsx(
308
+ "div",
309
+ {
310
+ "data-slot": "attachment-media",
311
+ "data-variant": variant,
312
+ className: cn(attachmentMediaVariants({ variant }), className),
313
+ ...props
314
+ }
315
+ );
316
+ }
317
+ function AttachmentContent({
318
+ className,
319
+ ...props
320
+ }) {
321
+ return /* @__PURE__ */ jsx(
322
+ "div",
323
+ {
324
+ "data-slot": "attachment-content",
325
+ className: cn(
326
+ "max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",
327
+ className
328
+ ),
329
+ ...props
330
+ }
331
+ );
332
+ }
333
+ function AttachmentTitle({
334
+ className,
335
+ ...props
336
+ }) {
337
+ return /* @__PURE__ */ jsx(
338
+ "span",
339
+ {
340
+ "data-slot": "attachment-title",
341
+ className: cn(
342
+ "block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer",
343
+ className
344
+ ),
345
+ ...props
346
+ }
347
+ );
348
+ }
349
+ function AttachmentDescription({
350
+ className,
351
+ ...props
352
+ }) {
353
+ return /* @__PURE__ */ jsx(
354
+ "span",
355
+ {
356
+ "data-slot": "attachment-description",
357
+ className: cn(
358
+ "mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80",
359
+ "max-w-full",
360
+ className
361
+ ),
362
+ ...props
363
+ }
364
+ );
365
+ }
366
+ function AttachmentActions({
367
+ className,
368
+ ...props
369
+ }) {
370
+ return /* @__PURE__ */ jsx(
371
+ "div",
372
+ {
373
+ "data-slot": "attachment-actions",
374
+ className: cn(
375
+ "relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1",
376
+ className
377
+ ),
378
+ ...props
379
+ }
380
+ );
381
+ }
382
+ function AttachmentAction({
383
+ className,
384
+ variant,
385
+ size = "icon-xs",
386
+ ...props
387
+ }) {
388
+ return /* @__PURE__ */ jsx(
389
+ Button,
390
+ {
391
+ "data-slot": "attachment-action",
392
+ variant: variant ?? "ghost",
393
+ size,
394
+ className: cn(className),
395
+ ...props
396
+ }
397
+ );
398
+ }
399
+ function AttachmentTrigger({
400
+ className,
401
+ asChild = false,
402
+ type,
403
+ children,
404
+ ...props
405
+ }) {
406
+ if (asChild && React.isValidElement(children)) {
407
+ return React.cloneElement(children, {
408
+ "data-slot": "attachment-trigger",
409
+ className: cn(
410
+ "absolute inset-0 z-10 outline-none",
411
+ children.props.className,
412
+ className
413
+ ),
414
+ ...props
415
+ });
416
+ }
417
+ return /* @__PURE__ */ jsx(
418
+ "button",
419
+ {
420
+ "data-slot": "attachment-trigger",
421
+ type: type ?? "button",
422
+ className: cn("absolute inset-0 z-10 outline-none", className),
423
+ ...props,
424
+ children
425
+ }
426
+ );
427
+ }
428
+ function AttachmentGroup({ className, ...props }) {
429
+ return /* @__PURE__ */ jsx(
430
+ "div",
431
+ {
432
+ "data-slot": "attachment-group",
433
+ className: cn(
434
+ "flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start",
435
+ className
436
+ ),
437
+ ...props
438
+ }
439
+ );
440
+ }
441
+
442
+ // src/ui/bubble.tsx
443
+ import * as React2 from "react";
444
+ import { cva as cva2 } from "class-variance-authority";
445
+ import { jsx as jsx2 } from "react/jsx-runtime";
446
+ function BubbleGroup({ className, ...props }) {
447
+ return /* @__PURE__ */ jsx2(
448
+ "div",
449
+ {
450
+ "data-slot": "bubble-group",
451
+ className: cn("flex min-w-0 flex-col gap-2", className),
452
+ ...props
453
+ }
454
+ );
455
+ }
456
+ var bubbleVariants = cva2(
457
+ "group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",
458
+ {
459
+ variants: {
460
+ variant: {
461
+ default: "*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",
462
+ secondary: "*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",
463
+ muted: "*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",
464
+ tinted: "*:data-[slot=bubble-content]:bg-(--bubble-background) *:data-[slot=bubble-content]:text-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-(--bubble-hover-background)",
465
+ outline: "*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-card [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",
466
+ ghost: "border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",
467
+ destructive: "*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"
468
+ }
469
+ },
470
+ defaultVariants: {
471
+ variant: "default"
472
+ }
473
+ }
474
+ );
475
+ function Bubble({
476
+ variant = "default",
477
+ align = "start",
478
+ className,
479
+ ...props
480
+ }) {
481
+ return /* @__PURE__ */ jsx2(
482
+ "div",
483
+ {
484
+ "data-slot": "bubble",
485
+ "data-variant": variant,
486
+ "data-align": align,
487
+ className: cn(bubbleVariants({ variant }), className),
488
+ ...props
489
+ }
490
+ );
491
+ }
492
+ function BubbleContent({
493
+ asChild = false,
494
+ className,
495
+ children,
496
+ ...props
497
+ }) {
498
+ const cls = cn(
499
+ "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",
500
+ className
501
+ );
502
+ if (asChild && React2.isValidElement(children)) {
503
+ return React2.cloneElement(children, {
504
+ "data-slot": "bubble-content",
505
+ className: cn(cls, children.props.className),
506
+ ...props
507
+ });
508
+ }
509
+ return /* @__PURE__ */ jsx2(
510
+ "div",
511
+ {
512
+ "data-slot": "bubble-content",
513
+ className: cls,
514
+ ...props,
515
+ children
516
+ }
517
+ );
518
+ }
519
+ var bubbleReactionsVariants = cva2(
520
+ "absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",
521
+ {
522
+ variants: {
523
+ side: {
524
+ top: "top-0 -translate-y-3/4",
525
+ bottom: "bottom-0 translate-y-3/4"
526
+ },
527
+ align: {
528
+ start: "left-3",
529
+ end: "right-3"
530
+ }
531
+ },
532
+ defaultVariants: {
533
+ side: "bottom",
534
+ align: "end"
535
+ }
536
+ }
537
+ );
538
+ function BubbleReactions({
539
+ side = "bottom",
540
+ align = "end",
541
+ className,
542
+ ...props
543
+ }) {
544
+ return /* @__PURE__ */ jsx2(
545
+ "div",
546
+ {
547
+ "data-slot": "bubble-reactions",
548
+ "data-align": align,
549
+ "data-side": side,
550
+ className: cn(bubbleReactionsVariants({ side, align }), className),
551
+ ...props
552
+ }
553
+ );
554
+ }
555
+
556
+ // src/ui/message.tsx
557
+ import { jsx as jsx3 } from "react/jsx-runtime";
558
+ function MessageGroup({ className, ...props }) {
559
+ return /* @__PURE__ */ jsx3(
560
+ "div",
561
+ {
562
+ "data-slot": "message-group",
563
+ className: cn("flex min-w-0 flex-col gap-2", className),
564
+ ...props
565
+ }
566
+ );
567
+ }
568
+ function Message({
569
+ className,
570
+ align = "start",
571
+ ...props
572
+ }) {
573
+ return /* @__PURE__ */ jsx3(
574
+ "div",
575
+ {
576
+ "data-slot": "message",
577
+ "data-align": align,
578
+ className: cn(
579
+ "group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse",
580
+ className
581
+ ),
582
+ ...props
583
+ }
584
+ );
585
+ }
586
+ function MessageAvatar({ className, ...props }) {
587
+ return /* @__PURE__ */ jsx3(
588
+ "div",
589
+ {
590
+ "data-slot": "message-avatar",
591
+ className: cn(
592
+ "flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8",
593
+ className
594
+ ),
595
+ ...props
596
+ }
597
+ );
598
+ }
599
+ function MessageContent({ className, ...props }) {
600
+ return /* @__PURE__ */ jsx3(
601
+ "div",
602
+ {
603
+ "data-slot": "message-content",
604
+ className: cn(
605
+ "flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end",
606
+ className
607
+ ),
608
+ ...props
609
+ }
610
+ );
611
+ }
612
+ function MessageHeader({ className, ...props }) {
613
+ return /* @__PURE__ */ jsx3(
614
+ "div",
615
+ {
616
+ "data-slot": "message-header",
617
+ className: cn(
618
+ "flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0",
619
+ className
620
+ ),
621
+ ...props
622
+ }
623
+ );
624
+ }
625
+ function MessageFooter({ className, ...props }) {
626
+ return /* @__PURE__ */ jsx3(
627
+ "div",
628
+ {
629
+ "data-slot": "message-footer",
630
+ className: cn(
631
+ "flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end",
632
+ className
633
+ ),
634
+ ...props
635
+ }
636
+ );
637
+ }
222
638
  export {
223
639
  Accordion,
224
640
  AccordionContent,
@@ -239,6 +655,15 @@ export {
239
655
  AlertDialogTrigger,
240
656
  AlertTitle,
241
657
  AspectRatio,
658
+ Attachment,
659
+ AttachmentAction,
660
+ AttachmentActions,
661
+ AttachmentContent,
662
+ AttachmentDescription,
663
+ AttachmentGroup,
664
+ AttachmentMedia,
665
+ AttachmentTitle,
666
+ AttachmentTrigger,
242
667
  Avatar,
243
668
  AvatarFallback,
244
669
  AvatarImage,
@@ -250,6 +675,10 @@ export {
250
675
  BreadcrumbList,
251
676
  BreadcrumbPage,
252
677
  BreadcrumbSeparator,
678
+ Bubble,
679
+ BubbleContent,
680
+ BubbleGroup,
681
+ BubbleReactions,
253
682
  Button,
254
683
  ButtonGroup,
255
684
  CHART_TOKEN_COLORS,
@@ -347,6 +776,12 @@ export {
347
776
  MenubarMenu,
348
777
  MenubarSeparator,
349
778
  MenubarTrigger,
779
+ Message,
780
+ MessageAvatar,
781
+ MessageContent,
782
+ MessageFooter,
783
+ MessageGroup,
784
+ MessageHeader,
350
785
  NavigationMenu,
351
786
  NavigationMenuContent,
352
787
  NavigationMenuItem,
@@ -395,6 +830,29 @@ export {
395
830
  SheetPortal,
396
831
  SheetTitle,
397
832
  SheetTrigger,
833
+ SidebarContent as SidebarContentArea,
834
+ SidebarFooter as SidebarFooterArea,
835
+ SidebarGroup,
836
+ SidebarGroupAction,
837
+ SidebarGroupContent,
838
+ SidebarGroupLabel,
839
+ SidebarHeader as SidebarHeaderArea,
840
+ SidebarInput,
841
+ SidebarInset,
842
+ SidebarMenu,
843
+ SidebarMenuAction,
844
+ SidebarMenuBadge,
845
+ SidebarMenuButton,
846
+ SidebarMenuItem,
847
+ SidebarMenuSkeleton,
848
+ SidebarMenuSub,
849
+ SidebarMenuSubButton,
850
+ SidebarMenuSubItem,
851
+ SidebarProvider,
852
+ SidebarRail,
853
+ SidebarRoot,
854
+ SidebarSeparator,
855
+ SidebarTrigger,
398
856
  Skeleton,
399
857
  Slider,
400
858
  SliderControl,
@@ -433,5 +891,6 @@ export {
433
891
  toastManager,
434
892
  toggleVariants,
435
893
  typographyVariants,
436
- useCarousel
894
+ useCarousel,
895
+ useSidebar
437
896
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pactor-app/ui",
3
- "version": "1.2.0",
3
+ "version": "1.3.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",
@@ -95,6 +95,7 @@
95
95
  "class-variance-authority": "^0.7.1",
96
96
  "clsx": "^2.1.1",
97
97
  "cmdk": "^1.1.1",
98
+ "cn": "^0.2.6",
98
99
  "date-fns": "^4.4.0",
99
100
  "embla-carousel-react": "^8.6.0",
100
101
  "input-otp": "^1.5.0",
@@ -104,10 +105,10 @@
104
105
  "recharts": "^3.10.1",
105
106
  "tailwind-merge": "^3.6.0",
106
107
  "vaul": "^1.1.2",
107
- "@pactor-app/core": "1.2.0",
108
- "@pactor-app/router": "1.2.0",
109
- "@pactor-app/permission": "1.2.0",
110
- "@pactor-app/runtime": "1.2.0"
108
+ "@pactor-app/core": "1.3.0",
109
+ "@pactor-app/permission": "1.3.0",
110
+ "@pactor-app/router": "1.3.0",
111
+ "@pactor-app/runtime": "1.3.0"
111
112
  },
112
113
  "peerDependencies": {
113
114
  "react": ">=18",