myoperator-mcp 0.2.34 → 0.2.36
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 +48 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1346,27 +1346,57 @@ export interface DialogContentProps
|
|
|
1346
1346
|
hideCloseButton?: boolean;
|
|
1347
1347
|
}
|
|
1348
1348
|
|
|
1349
|
+
// Helper to check if children contain DialogDescription
|
|
1350
|
+
const hasDialogDescription = (children: React.ReactNode): boolean => {
|
|
1351
|
+
let found = false;
|
|
1352
|
+
React.Children.forEach(children, (child) => {
|
|
1353
|
+
if (React.isValidElement(child)) {
|
|
1354
|
+
if (child.type === DialogDescription) {
|
|
1355
|
+
found = true;
|
|
1356
|
+
} else {
|
|
1357
|
+
const childProps = child.props as { children?: React.ReactNode };
|
|
1358
|
+
if (childProps.children) {
|
|
1359
|
+
if (hasDialogDescription(childProps.children)) {
|
|
1360
|
+
found = true;
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
});
|
|
1366
|
+
return found;
|
|
1367
|
+
};
|
|
1368
|
+
|
|
1349
1369
|
const DialogContent = React.forwardRef<
|
|
1350
1370
|
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
1351
1371
|
DialogContentProps
|
|
1352
|
-
>(({ className, children, size, hideCloseButton = false, ...props }, ref) =>
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
)
|
|
1372
|
+
>(({ className, children, size, hideCloseButton = false, ...props }, ref) => {
|
|
1373
|
+
const hasDescription = hasDialogDescription(children);
|
|
1374
|
+
|
|
1375
|
+
return (
|
|
1376
|
+
<DialogPortal>
|
|
1377
|
+
<DialogOverlay />
|
|
1378
|
+
<DialogPrimitive.Content
|
|
1379
|
+
ref={ref}
|
|
1380
|
+
className={cn(dialogContentVariants({ size, className }))}
|
|
1381
|
+
{...props}
|
|
1382
|
+
>
|
|
1383
|
+
{children}
|
|
1384
|
+
{/* Accessibility: Add hidden description if none provided */}
|
|
1385
|
+
{!hasDescription && (
|
|
1386
|
+
<DialogPrimitive.Description className="sr-only">
|
|
1387
|
+
Dialog content
|
|
1388
|
+
</DialogPrimitive.Description>
|
|
1389
|
+
)}
|
|
1390
|
+
{!hideCloseButton && (
|
|
1391
|
+
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
|
|
1392
|
+
<X className="h-4 w-4" />
|
|
1393
|
+
<span className="sr-only">Close</span>
|
|
1394
|
+
</DialogPrimitive.Close>
|
|
1395
|
+
)}
|
|
1396
|
+
</DialogPrimitive.Content>
|
|
1397
|
+
</DialogPortal>
|
|
1398
|
+
);
|
|
1399
|
+
});
|
|
1370
1400
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
1371
1401
|
|
|
1372
1402
|
const DialogHeader = ({
|
package/package.json
CHANGED