@mastra/playground-ui 22.1.3-alpha.2 → 22.1.3-alpha.3

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.es.js CHANGED
@@ -3365,7 +3365,8 @@ const variantClasses$4 = {
3365
3365
  ghost: "bg-transparent border-2 border-transparent hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral4",
3366
3366
  inputLike: sharedFormElementStyle,
3367
3367
  light: "",
3368
- outline: ""
3368
+ outline: "",
3369
+ link: "inline-flex justify-start rounded-none h-auto px-0 bg-transparent text-neutral3 hover:text-neutral4 gap-1 [&>svg]:mx-0 w-auto [&>svg]:opacity-70"
3369
3370
  };
3370
3371
  const sharedStyles = cn(
3371
3372
  "flex items-center justify-center gap-[.75em] leading-0 transition-colors duration-200 ease-out-custom rounded-lg",
@@ -3384,7 +3385,7 @@ function resolveVariant(variant) {
3384
3385
  function buttonVariants(options) {
3385
3386
  const variant = resolveVariant(options?.variant || "default");
3386
3387
  const size = options?.size || "default";
3387
- return cn(sharedStyles, variantClasses$4[variant], sizeClasses$4[size], options?.iconOnly && "[&>svg]:opacity-75");
3388
+ return cn(sharedStyles, sizeClasses$4[size], variantClasses$4[variant], options?.iconOnly && "[&>svg]:opacity-75");
3388
3389
  }
3389
3390
  function flattenChildren(children) {
3390
3391
  const result = [];
@@ -4953,7 +4954,7 @@ const defaultOptions = {
4953
4954
  },
4954
4955
  unstyled: true,
4955
4956
  classNames: {
4956
- toast: "bg-surface3 w-full h-auto rounded-lg gap-2 border border-border1 px-3 py-2 flex items-center justify-between pointer-events-auto shadow-card :data-content:flex-1",
4957
+ toast: "bg-surface3 w-full h-auto rounded-xl gap-2 border border-border1 px-3 py-2 flex items-center justify-between pointer-events-auto shadow-card :data-content:flex-1",
4957
4958
  title: "text-xs font-medium text-neutral5",
4958
4959
  description: "text-xs text-neutral3",
4959
4960
  cancelButton: "bg-transparent! hover:bg-surface2! border-none! rounded-md! p-1.5! m-0! text-neutral3! hover:text-neutral6! shrink-0 transition-all",
@@ -6456,47 +6457,36 @@ const DropdownMenuGroup = DropdownMenuPrimitive.Group;
6456
6457
  const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
6457
6458
  const DropdownMenuSub = DropdownMenuPrimitive.Sub;
6458
6459
  const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
6459
- const DropdownMenuTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
6460
- DropdownMenuPrimitive.Trigger,
6461
- {
6462
- ref,
6463
- className: cn(
6464
- "cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-white/30 focus-visible:rounded-sm",
6465
- className
6466
- ),
6467
- ...props,
6468
- children
6469
- }
6470
- ));
6460
+ const itemClass = cn(
6461
+ "relative flex cursor-pointer select-none items-center gap-3 rounded-lg px-3 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 [&>span]:truncate [&_svg]:size-4 [&_svg]:shrink-0 focus-visible:outline-hidden focus-visible:ring-0",
6462
+ "[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&>svg]:mx-[-.25em] [&:hover>svg]:opacity-100"
6463
+ );
6464
+ const DropdownMenuTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Trigger, { ref, className: cn("cursor-pointer", className), ...props, children }));
6471
6465
  DropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;
6472
6466
  const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
6473
6467
  DropdownMenuPrimitive.SubTrigger,
6474
6468
  {
6475
6469
  ref,
6476
- className: cn(
6477
- "hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-[state=open]:bg-surface4 flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 focus-visible:outline-hidden focus-visible:ring-0",
6478
- inset && "pl-8",
6479
- className
6480
- ),
6470
+ className: cn(itemClass, "data-[state=open]:bg-surface4", inset && "pl-8", className),
6481
6471
  ...props,
6482
6472
  children: [
6483
6473
  children,
6484
- /* @__PURE__ */ jsx(ChevronDown, { className: "ml-auto -rotate-90" })
6474
+ /* @__PURE__ */ jsx("span", { className: "ml-auto pl-2", children: /* @__PURE__ */ jsx(ChevronDown, { className: "-rotate-90 opacity-50" }) })
6485
6475
  ]
6486
6476
  }
6487
6477
  ));
6488
6478
  DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
6489
- const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
6479
+ const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
6490
6480
  DropdownMenuPrimitive.SubContent,
6491
6481
  {
6492
6482
  ref,
6493
6483
  className: cn(
6494
- "bg-surface3 backdrop-blur-xl data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-32 overflow-auto overflow-x-hidden rounded-lg",
6484
+ "bg-surface3 backdrop-blur-xl data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",
6495
6485
  className
6496
6486
  ),
6497
6487
  ...props
6498
6488
  }
6499
- ));
6489
+ ) }));
6500
6490
  DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
6501
6491
  const DropdownMenuContent = React.forwardRef(({ className, container, sideOffset = 8, ...props }, ref) => {
6502
6492
  return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { container, children: /* @__PURE__ */ jsx(
@@ -6505,7 +6495,7 @@ const DropdownMenuContent = React.forwardRef(({ className, container, sideOffset
6505
6495
  ref,
6506
6496
  sideOffset,
6507
6497
  className: cn(
6508
- "bg-surface3 data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 backdrop-blur-xl text-neutral4 z-50 min-w-32 overflow-auto rounded-lg p-2 shadow-md",
6498
+ "bg-surface3 data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 backdrop-blur-xl text-neutral4 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",
6509
6499
  className
6510
6500
  ),
6511
6501
  ...props
@@ -6513,27 +6503,13 @@ const DropdownMenuContent = React.forwardRef(({ className, container, sideOffset
6513
6503
  ) });
6514
6504
  });
6515
6505
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
6516
- const DropdownMenuItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
6517
- DropdownMenuPrimitive.Item,
6518
- {
6519
- ref,
6520
- className: cn(
6521
- "relative flex cursor-pointer select-none items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 [&>span]:truncate [&_svg]:size-4 [&_svg]:shrink-0 focus-visible:outline-hidden focus-visible:ring-0",
6522
- "[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&>svg]:mx-[-.25em] [&:hover>svg]:opacity-100",
6523
- className
6524
- ),
6525
- ...props
6526
- }
6527
- ));
6506
+ const DropdownMenuItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Item, { ref, className: cn(itemClass, className), ...props }));
6528
6507
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
6529
6508
  const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
6530
6509
  DropdownMenuPrimitive.CheckboxItem,
6531
6510
  {
6532
6511
  ref,
6533
- className: cn(
6534
- "hover:bg-surface4 focus:bg-surface4 active:bg-surface5 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 relative flex w-full cursor-pointer select-none items-center gap-4 rounded-md px-2 py-1.5 text-sm transition-colors text-neutral4 data-disabled:pointer-events-none data-disabled:opacity-50 focus-visible:outline-hidden focus-visible:ring-0",
6535
- className
6536
- ),
6512
+ className: cn(itemClass, "w-full gap-4 px-2", className),
6537
6513
  checked,
6538
6514
  ...props,
6539
6515
  children: [
@@ -6568,14 +6544,7 @@ const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref)
6568
6544
  }
6569
6545
  ));
6570
6546
  DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
6571
- const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
6572
- DropdownMenuPrimitive.Separator,
6573
- {
6574
- ref,
6575
- className: cn("dark:bg-white/10 bg-black/10 -mx-1 my-1 h-px", className),
6576
- ...props
6577
- }
6578
- ));
6547
+ const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Separator, { ref, className: cn("bg-border1/50 -mx-1.5 my-1 h-0.5", className), ...props }));
6579
6548
  DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
6580
6549
  const DropdownMenuShortcut = ({ className, ...props }) => {
6581
6550
  return /* @__PURE__ */ jsx("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props });
@@ -7409,8 +7378,8 @@ const PopoverContent = React.forwardRef(({ className, align = "center", sideOffs
7409
7378
  align,
7410
7379
  sideOffset,
7411
7380
  className: cn(
7412
- "z-50 w-72 rounded-md border border-border1 bg-surface3 text-neutral5 shadow-md focus-visible:outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
7413
- className && /\bp-\S+/.test(className) ? false : `p-4`,
7381
+ "z-50 w-72 rounded-xl border-2 border-border1/50 bg-surface3 text-neutral5 shadow-md focus-visible:outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
7382
+ className && /\bp[trblxy]?-\S+/.test(className) ? false : `py-3.5 px-3`,
7414
7383
  className
7415
7384
  ),
7416
7385
  ...props
@@ -9392,7 +9361,7 @@ function Notification({
9392
9361
  if (!localIsVisible) return null;
9393
9362
  const typeStyles = {
9394
9363
  info: "bg-surface4 border-border1",
9395
- error: "bg-accent2Darker border-accent2/30",
9364
+ error: "bg-accent2Darker border-accent2/20",
9396
9365
  success: "bg-accent1Darker border-accent1/30",
9397
9366
  warning: "bg-accent6Darker border-accent6/30"
9398
9367
  };
@@ -9406,7 +9375,7 @@ function Notification({
9406
9375
  "div",
9407
9376
  {
9408
9377
  className: cn(
9409
- "grid grid-cols-[auto_1fr_auto] gap-3 rounded-lg border p-4 text-ui-md text-neutral4 items-start",
9378
+ "grid grid-cols-[auto_1fr_auto] gap-3 rounded-xl border py-2.5 px-3.5 text-ui-md text-neutral4 items-start",
9410
9379
  "shadow-card",
9411
9380
  transitions.all,
9412
9381
  isAnimatingOut ? "animate-out fade-out-0 slide-out-to-right-2 duration-200" : "animate-in fade-in-0 slide-in-from-right-2 duration-300",
@@ -10488,24 +10457,36 @@ function ItemListTextCell({ children, isLoading, className }) {
10488
10457
  }
10489
10458
 
10490
10459
  const sizeClasses = {
10491
- small: "text-[11px] pt-[5px] pb-[4px]",
10492
- default: "text-[12px] pt-[5px] pb-[4px] ",
10493
- large: "text-[13px] pt-[5px] pb-[4px] "
10460
+ small: "text-[10.5px] pt-[5px] pb-[4px]",
10461
+ default: "text-[11.5px] pt-[5px] pb-[4px] ",
10462
+ large: "text-[12.5px] pt-[5px] pb-[4px] "
10494
10463
  };
10495
10464
  const bgColorClasses = {
10496
- gray: { bright: "bg-neutral-700", muted: "bg-neutral-700/80" },
10497
- red: { bright: "bg-red-900", muted: "bg-red-900/80" },
10498
- orange: { bright: "bg-yellow-900", muted: "bg-yellow-900/80" },
10499
- blue: { bright: "bg-blue-800", muted: "bg-blue-800/80" },
10500
- green: { bright: "bg-green-900", muted: "bg-green-900/80" },
10501
- purple: { bright: "bg-purple-900", muted: "bg-purple-900/80" },
10502
- yellow: { bright: "bg-yellow-700", muted: "bg-yellow-700/80" },
10503
- cyan: { bright: "bg-cyan-900", muted: "bg-cyan-900/80" },
10504
- pink: { bright: "bg-pink-900", muted: "bg-pink-900/80" }
10465
+ gray: {
10466
+ bright: "bg-neutral-500/30",
10467
+ muted: "bg-neutral-500/10"
10468
+ },
10469
+ red: { bright: "bg-red-500/30", muted: "bg-red-500/10" },
10470
+ orange: {
10471
+ bright: "bg-orange-500/30",
10472
+ muted: "bg-orange-500/10"
10473
+ },
10474
+ blue: { bright: "bg-blue-500/30", muted: "bg-blue-500/10" },
10475
+ green: { bright: "bg-green-500/30", muted: "bg-green-500/10" },
10476
+ purple: {
10477
+ bright: "bg-purple-500/30",
10478
+ muted: "bg-purple-500/10"
10479
+ },
10480
+ yellow: {
10481
+ bright: "bg-yellow-500/30",
10482
+ muted: "bg-yellow-500/10"
10483
+ },
10484
+ cyan: { bright: "bg-cyan-500/30", muted: "bg-cyan-500/10" },
10485
+ pink: { bright: "bg-pink-500/30", muted: "bg-pink-500/10" }
10505
10486
  };
10506
10487
  const txtIntensityClasses = {
10507
- bright: "text-neutral4",
10508
- muted: "text-neutral3"
10488
+ bright: "text-neutral4/90",
10489
+ muted: "text-neutral3/90"
10509
10490
  };
10510
10491
  const Chip = ({
10511
10492
  color = "gray",
@@ -10519,7 +10500,7 @@ const Chip = ({
10519
10500
  "span",
10520
10501
  {
10521
10502
  className: cn(
10522
- "inline-flex items-center rounded-md uppercase px-[0.5em] gap-[0.4em] tracking-wide font-normal",
10503
+ "inline-flex items-center rounded-lg uppercase px-1.5 gap-[0.4em] tracking-wide font-normal",
10523
10504
  // general styles for svg icons within the chip
10524
10505
  "[&>svg]:w-[1em] [&>svg]:h-[1em] [&>svg]:translate-y-[-0.02em] [&>svg]:mx-[-0.2em]",
10525
10506
  // if the chip has only one child and it's an svg, make it fully opaque
@@ -12455,18 +12436,16 @@ function DataKeysAndValuesKey({ className, children }) {
12455
12436
  return /* @__PURE__ */ jsx("dt", { className: cn("text-ui-smd text-neutral2 shrink-0 py-0.5", className), children });
12456
12437
  }
12457
12438
 
12439
+ const GRID_TEMPLATES = {
12440
+ 1: "auto 1fr",
12441
+ 2: "auto auto auto 1fr",
12442
+ 3: "auto auto auto auto auto 1fr"
12443
+ };
12458
12444
  function DataKeysAndValuesRoot({ className, children, numOfCol = 1 }) {
12459
- return /* @__PURE__ */ jsx(
12460
- "dl",
12461
- {
12462
- className: cn("grid gap-x-4 gap-y-1.5 grid-cols-[auto_1fr]", className),
12463
- style: numOfCol === 2 ? { gridTemplateColumns: "auto 1fr auto 1fr" } : void 0,
12464
- children
12465
- }
12466
- );
12445
+ return /* @__PURE__ */ jsx("dl", { className: cn("grid gap-x-4 gap-y-1.5", className), style: { gridTemplateColumns: GRID_TEMPLATES[numOfCol] }, children });
12467
12446
  }
12468
12447
 
12469
- const dataKeysAndValuesValueStyles = "text-ui-smd text-neutral3 min-w-0 py-0.5";
12448
+ const dataKeysAndValuesValueStyles = "text-ui-smd text-neutral3 min-w-0 py-0.5 pr-6";
12470
12449
 
12471
12450
  function DataKeysAndValuesValue({ className, children }) {
12472
12451
  return /* @__PURE__ */ jsx("dd", { className: cn(dataKeysAndValuesValueStyles, "truncate", className), children });
@@ -12566,7 +12545,13 @@ function DataPanelContent({ children, ref }) {
12566
12545
  }
12567
12546
 
12568
12547
  function DataPanelHeader({ className, children }) {
12569
- return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-between gap-2 border-b border-border1 mx-4 py-3", className), children });
12548
+ return /* @__PURE__ */ jsx(
12549
+ "div",
12550
+ {
12551
+ className: cn("flex items-center justify-between gap-2 border-b border-border1 mx-4 py-3 min-h-14", className),
12552
+ children
12553
+ }
12554
+ );
12570
12555
  }
12571
12556
 
12572
12557
  function DataPanelHeading({ className, children }) {
@@ -12603,7 +12588,7 @@ function DataPanelRoot({ collapsed, children }) {
12603
12588
  {
12604
12589
  className: cn(
12605
12590
  "flex flex-col bg-surface2 border border-border1 rounded-xl overflow-hidden",
12606
- collapsed ? "h-auto" : "h-full"
12591
+ collapsed ? "h-auto" : "max-h-full"
12607
12592
  ),
12608
12593
  children
12609
12594
  }
@@ -14002,12 +13987,17 @@ const getFileContentType = async (url) => {
14002
13987
  }
14003
13988
  return contentType;
14004
13989
  } catch {
14005
- const urlObject = new URL(url);
14006
- const pathname = urlObject.pathname;
14007
- const extension = pathname.split(".").pop();
14008
- if (!extension) return void 0;
14009
- const lowerCaseExtension = extension.toLowerCase();
14010
- return EXTENSION_TO_MIME[lowerCaseExtension];
13990
+ try {
13991
+ const urlObject = new URL(url);
13992
+ const pathname = urlObject.pathname;
13993
+ const extension = pathname.split(".").pop();
13994
+ if (!extension) return void 0;
13995
+ return EXTENSION_TO_MIME[extension.toLowerCase()];
13996
+ } catch {
13997
+ const extension = url.split(".").pop()?.split(/[?#]/)[0];
13998
+ if (!extension) return void 0;
13999
+ return EXTENSION_TO_MIME[extension.toLowerCase()];
14000
+ }
14011
14001
  }
14012
14002
  };
14013
14003