@vvedantb/ui 0.76.0 → 0.77.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.
@@ -1278,6 +1278,60 @@ export const MessageBranchPage = t0 => {
1278
1278
  }
1279
1279
  return t3;
1280
1280
  };
1281
+ /**
1282
+ * A small card of message actions laid over the top right corner of a message.
1283
+ * It takes no layout space. It shows on hover or focus of the nearest `group`
1284
+ * ancestor, and stays up while a menu inside it is open. Put it in a
1285
+ * `group relative` wrapper around the message.
1286
+ */
1287
+ export const MessageCornerToolbar = t0 => {
1288
+ const $ = _c(11);
1289
+ let children;
1290
+ let className;
1291
+ let props;
1292
+ if ($[0] !== t0) {
1293
+ ({
1294
+ className,
1295
+ children,
1296
+ ...props
1297
+ } = t0);
1298
+ $[0] = t0;
1299
+ $[1] = children;
1300
+ $[2] = className;
1301
+ $[3] = props;
1302
+ } else {
1303
+ children = $[1];
1304
+ className = $[2];
1305
+ props = $[3];
1306
+ }
1307
+ const merge = useCn();
1308
+ let t1;
1309
+ if ($[4] !== className || $[5] !== merge) {
1310
+ t1 = merge("pointer-events-none absolute -top-8 right-2 z-10 flex items-center gap-0.5 rounded-control bg-popover p-0.5 opacity-0 smooth-shadow-ring-md transition-opacity group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100 has-[[data-state=open]]:pointer-events-auto has-[[data-state=open]]:opacity-100", className);
1311
+ $[4] = className;
1312
+ $[5] = merge;
1313
+ $[6] = t1;
1314
+ } else {
1315
+ t1 = $[6];
1316
+ }
1317
+ let t2;
1318
+ if ($[7] !== children || $[8] !== props || $[9] !== t1) {
1319
+ t2 = /*#__PURE__*/_jsx("div", {
1320
+ role: "toolbar",
1321
+ "aria-label": "Message actions",
1322
+ className: t1,
1323
+ ...props,
1324
+ children: children
1325
+ });
1326
+ $[7] = children;
1327
+ $[8] = props;
1328
+ $[9] = t1;
1329
+ $[10] = t2;
1330
+ } else {
1331
+ t2 = $[10];
1332
+ }
1333
+ return t2;
1334
+ };
1281
1335
  export const MessageToolbar = t0 => {
1282
1336
  const $ = _c(11);
1283
1337
  let children;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vvedantb/ui",
3
- "version": "0.76.0",
3
+ "version": "0.77.0",
4
4
  "license": "MIT",
5
5
  "description": "Shared React 19 UI for web apps: one main JavaScript entry (primitives, shell pieces, app helpers including the Convex and Clerk provider, VITE env parsing and ensure-user, artifact viewers over the @vvedantb/server artifacts core, native tokens), third-party brand logos (also @vvedantb/ui/logos), motion-driven animated SVG icons (@vvedantb/ui/icons/animated), a client entry without @vvedantb/server, convex or Clerk for Chrome extensions, design-token CSS, shared Tailwind v4 CSS, a Tailwind preset and packaged Instrument Sans fonts.",
6
6
  "type": "module",
@@ -555,6 +555,33 @@ export const MessageBranchPage = ({
555
555
  </ButtonGroupText>
556
556
  );
557
557
  };
558
+ export type MessageCornerToolbarProps = ComponentProps<"div">;
559
+ /**
560
+ * A small card of message actions laid over the top right corner of a message.
561
+ * It takes no layout space. It shows on hover or focus of the nearest `group`
562
+ * ancestor, and stays up while a menu inside it is open. Put it in a
563
+ * `group relative` wrapper around the message.
564
+ */
565
+ export const MessageCornerToolbar = ({
566
+ className,
567
+ children,
568
+ ...props
569
+ }: MessageCornerToolbarProps) => {
570
+ const merge = useCn();
571
+ return (
572
+ <div
573
+ role="toolbar"
574
+ aria-label="Message actions"
575
+ className={merge(
576
+ "pointer-events-none absolute -top-8 right-2 z-10 flex items-center gap-0.5 rounded-control bg-popover p-0.5 opacity-0 smooth-shadow-ring-md transition-opacity group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100 has-[[data-state=open]]:pointer-events-auto has-[[data-state=open]]:opacity-100",
577
+ className,
578
+ )}
579
+ {...props}
580
+ >
581
+ {children}
582
+ </div>
583
+ );
584
+ };
558
585
  export type MessageToolbarProps = ComponentProps<"div">;
559
586
  export const MessageToolbar = ({
560
587
  className,