@mastra/playground-ui 30.0.2-alpha.2 → 31.0.0-alpha.4

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/dist/index.cjs.js +233 -75
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.css +201 -27
  5. package/dist/index.es.js +227 -70
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/src/domains/logs/hooks/use-logs.d.ts +13 -1267
  8. package/dist/src/domains/traces/hooks/use-branch.d.ts +5 -46
  9. package/dist/src/domains/traces/hooks/use-span-detail.d.ts +6 -44
  10. package/dist/src/domains/traces/hooks/use-trace-light-spans.d.ts +5 -18
  11. package/dist/src/domains/traces/hooks/use-trace-spans.d.ts +5 -46
  12. package/dist/src/domains/traces/hooks/use-traces.d.ts +15 -1539
  13. package/dist/src/ds/components/ButtonsGroup/buttons-group.stories.d.ts +30 -0
  14. package/dist/src/ds/components/Command/command.d.ts +7 -72
  15. package/dist/src/ds/components/FormFieldBlocks/fields/search-field-block.d.ts +2 -1
  16. package/dist/src/ds/components/Input/input.d.ts +3 -3
  17. package/dist/src/ds/components/Input/input.stories.d.ts +4 -0
  18. package/dist/src/ds/components/InputGroup/input-group.d.ts +7 -2
  19. package/dist/src/ds/components/InputGroup/input-group.stories.d.ts +3 -0
  20. package/dist/src/ds/components/ListSearch/list-search.d.ts +2 -1
  21. package/dist/src/ds/components/Searchbar/searchbar.d.ts +4 -1
  22. package/dist/src/ds/components/Searchbar/searchbar.stories.d.ts +3 -0
  23. package/dist/src/ds/components/Textarea/textarea.d.ts +3 -3
  24. package/dist/src/ds/components/Textarea/textarea.stories.d.ts +1 -0
  25. package/dist/src/ds/primitives/form-element.d.ts +6 -4
  26. package/dist/src/lib/formatting.d.ts +1 -0
  27. package/package.json +6 -6
package/dist/index.cjs.js CHANGED
@@ -3644,12 +3644,14 @@ const formElementSizes = {
3644
3644
  lg: "h-form-lg"
3645
3645
  };
3646
3646
  const formElementFocus = "focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal";
3647
- const formElementFocusWithin = "focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal";
3648
- const formElementRadius = "rounded-md";
3649
- const sharedFormElementStyle = "bg-surface2 border border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg";
3650
3647
  const sharedFormElementFocusStyle = "outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40";
3651
3648
  const sharedFormElementDisabledStyle = "disabled:opacity-50 disabled:cursor-not-allowed";
3652
- const formElementTransition = "transition-all duration-normal ease-out-custom";
3649
+ const inputFocusBorderVisible = "focus-visible:border-neutral5/50";
3650
+ const inputFocusBorderWithin = "focus-within:border-neutral5/50";
3651
+ const inputHoverBorderWithin = "[&:hover:not(:focus-within)]:border-border2";
3652
+ const inputSurfaceAndFocusStyle = "bg-surface-overlay-soft border border-border1 text-neutral5 hover:text-neutral6 hover:bg-surface-overlay-strong hover:border-border2 outline-hidden focus-visible:outline-hidden focus-visible:bg-surface-overlay-strong " + inputFocusBorderVisible;
3653
+ const inputOutlineAndFocusStyle = "bg-transparent border border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 outline-hidden focus-visible:outline-hidden " + inputFocusBorderVisible;
3654
+ const unstyledFormElementStyle = "border-0 bg-transparent outline-hidden focus-visible:outline-hidden";
3653
3655
 
3654
3656
  const TEXT_MODE_ADORNMENTS = cn(
3655
3657
  "gap-[.75em] rounded-full",
@@ -3726,6 +3728,7 @@ const Button = React.forwardRef(
3726
3728
  ref,
3727
3729
  disabled,
3728
3730
  "aria-label": ariaLabel,
3731
+ "data-variant": variant,
3729
3732
  className: cn(buttonVariants({ variant, size: resolvedSize }), isLabelless && "[&>svg]:opacity-75", className),
3730
3733
  ...props,
3731
3734
  children: content
@@ -6031,14 +6034,18 @@ const textareaVariants = cva(
6031
6034
  {
6032
6035
  variants: {
6033
6036
  variant: {
6034
- default: cn(sharedFormElementStyle, sharedFormElementFocusStyle, sharedFormElementDisabledStyle),
6035
- unstyled: "border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"
6037
+ default: cn(inputSurfaceAndFocusStyle, "rounded-xl", sharedFormElementDisabledStyle),
6038
+ filled: cn(inputSurfaceAndFocusStyle, "rounded-xl", sharedFormElementDisabledStyle),
6039
+ outline: cn(inputOutlineAndFocusStyle, "rounded-xl", sharedFormElementDisabledStyle),
6040
+ unstyled: unstyledFormElementStyle
6036
6041
  },
6042
+ // Text tokens mirror the Input size scale (sm→ui-sm, md/default→ui-md, lg→ui-lg)
6043
+ // so a Textarea reads at the same size as a sibling Input.
6037
6044
  size: {
6038
6045
  sm: "px-2 py-1.5 text-ui-sm",
6039
- md: "px-3 py-2 text-ui-sm",
6046
+ md: "px-3 py-2 text-ui-md",
6040
6047
  default: "px-3 py-2 text-ui-md",
6041
- lg: "px-4 py-3 text-ui-sm"
6048
+ lg: "px-4 py-3 text-ui-lg"
6042
6049
  }
6043
6050
  },
6044
6051
  defaultVariants: {
@@ -6054,8 +6061,7 @@ const Textarea = React__namespace.forwardRef(
6054
6061
  {
6055
6062
  className: cn(
6056
6063
  textareaVariants({ variant, size }),
6057
- // Error state styling
6058
- error && "border-error focus:ring-error focus:shadow-glow-accent2",
6064
+ error && "border-error focus-visible:border-error",
6059
6065
  className
6060
6066
  ),
6061
6067
  "data-testid": testId,
@@ -6927,6 +6933,7 @@ const SelectTrigger = React__namespace.forwardRef(
6927
6933
  select.Select.Trigger,
6928
6934
  {
6929
6935
  ref,
6936
+ "data-slot": "select-trigger",
6930
6937
  className: cn(
6931
6938
  "inline-flex w-full cursor-pointer select-none items-center justify-between gap-1.5 whitespace-nowrap",
6932
6939
  formElementSizes[size],
@@ -7177,8 +7184,21 @@ function CodeBlock$1({
7177
7184
  }
7178
7185
  );
7179
7186
  }
7187
+ function tokenStyle(token, isDark) {
7188
+ if (token.htmlStyle && typeof token.htmlStyle === "object") {
7189
+ const vars = token.htmlStyle;
7190
+ const color = isDark ? vars["--shiki-dark"] : vars["--shiki-light"];
7191
+ const background = isDark ? vars["--shiki-dark-bg"] : vars["--shiki-light-bg"];
7192
+ const style = {};
7193
+ if (color) style.color = color;
7194
+ if (background) style.backgroundColor = background;
7195
+ return Object.keys(style).length ? style : void 0;
7196
+ }
7197
+ return token.color ? { color: token.color } : void 0;
7198
+ }
7180
7199
  function HighlightedCode({ code, lang }) {
7181
7200
  const [tokens, setTokens] = React__namespace.useState(null);
7201
+ const isDark = useTheme().resolvedTheme === "dark";
7182
7202
  React__namespace.useEffect(() => {
7183
7203
  if (!lang) {
7184
7204
  setTokens(null);
@@ -7199,14 +7219,7 @@ function HighlightedCode({ code, lang }) {
7199
7219
  return /* @__PURE__ */ jsxRuntime.jsx("pre", { className: preClass, children: code });
7200
7220
  }
7201
7221
  return /* @__PURE__ */ jsxRuntime.jsx("pre", { className: preClass, children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: tokens.map((line, lineIndex) => /* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
7202
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: line.map((token, tokenIndex) => /* @__PURE__ */ jsxRuntime.jsx(
7203
- "span",
7204
- {
7205
- className: "text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",
7206
- children: token.content
7207
- },
7208
- tokenIndex
7209
- )) }),
7222
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: line.map((token, tokenIndex) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: tokenStyle(token, isDark), children: token.content }, tokenIndex)) }),
7210
7223
  lineIndex !== tokens.length - 1 && "\n"
7211
7224
  ] }, lineIndex)) }) });
7212
7225
  }
@@ -7678,13 +7691,25 @@ const inputVariants = cva(
7678
7691
  "flex w-full text-neutral6 border bg-transparent",
7679
7692
  "transition-all duration-normal ease-out-custom",
7680
7693
  "placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal",
7681
- "focus:placeholder:opacity-70"
7694
+ "focus:placeholder:opacity-70",
7695
+ // type="number": hide native browser spinner arrows (they clip the pill).
7696
+ // For incrementable numeric inputs, compose <InputGroup> with +/- buttons
7697
+ // instead — see the NumberWithStepper story. WebKit uses the spin-button
7698
+ // pseudo-elements; Firefox needs `appearance: textfield` on the input.
7699
+ "[&::-webkit-outer-spin-button]:appearance-none [&::-webkit-outer-spin-button]:m-0",
7700
+ "[&::-webkit-inner-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0",
7701
+ "[&[type=number]]:[appearance:textfield]",
7702
+ // type="search": drop WebKit's native clear button so the DS owns the search chrome.
7703
+ // Compose an <InputGroup> with an InputGroupButton to add a clear control.
7704
+ "[&::-webkit-search-cancel-button]:appearance-none"
7682
7705
  ),
7683
7706
  {
7684
7707
  variants: {
7685
7708
  variant: {
7686
- default: cn(sharedFormElementStyle, sharedFormElementFocusStyle, sharedFormElementDisabledStyle),
7687
- unstyled: "border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"
7709
+ default: cn(inputSurfaceAndFocusStyle, "rounded-full", sharedFormElementDisabledStyle),
7710
+ filled: cn(inputSurfaceAndFocusStyle, "rounded-full", sharedFormElementDisabledStyle),
7711
+ outline: cn(inputOutlineAndFocusStyle, "rounded-full", sharedFormElementDisabledStyle),
7712
+ unstyled: unstyledFormElementStyle
7688
7713
  },
7689
7714
  size: {
7690
7715
  sm: `${formElementSizes.sm} text-ui-sm px-[.75em]`,
@@ -7705,12 +7730,7 @@ const Input = React__namespace.forwardRef(
7705
7730
  "input",
7706
7731
  {
7707
7732
  type,
7708
- className: cn(
7709
- inputVariants({ variant, size }),
7710
- // Error state styling
7711
- error && "border-error focus:ring-error focus:shadow-glow-accent2",
7712
- className
7713
- ),
7733
+ className: cn(inputVariants({ variant, size }), error && "border-error focus-visible:border-error", className),
7714
7734
  "data-testid": testId,
7715
7735
  ref,
7716
7736
  "aria-invalid": error,
@@ -7777,6 +7797,7 @@ function SearchFieldBlock({
7777
7797
  onReset,
7778
7798
  className,
7779
7799
  size,
7800
+ variant,
7780
7801
  isMinimized,
7781
7802
  onMinimizedChange
7782
7803
  }) {
@@ -7816,6 +7837,7 @@ function SearchFieldBlock({
7816
7837
  placeholder,
7817
7838
  onChange,
7818
7839
  size,
7840
+ variant,
7819
7841
  className: cn(
7820
7842
  size === "sm" && "pl-8 pr-8",
7821
7843
  size === "md" && "pl-9 pr-9",
@@ -7929,27 +7951,75 @@ const HoverCardContent = React__namespace.forwardRef(
7929
7951
  );
7930
7952
  HoverCardContent.displayName = "HoverCardContent";
7931
7953
 
7932
- const InputGroupSizeContext = React__namespace.createContext("md");
7933
- const inputGroupClassName = cn(
7934
- "group/input-group relative flex w-full min-w-0 items-stretch",
7935
- "bg-surface2 border border-border1 text-neutral6",
7936
- "hover:border-border2",
7937
- formElementRadius,
7938
- formElementFocusWithin,
7954
+ const inputGroupBaseClassName = cn(
7955
+ // `flex-1` (not `min-w-0`) lets the root fill a flex row while keeping its content-floor
7956
+ // so it never collapses to 0. `items-center` centres the control: it carries its own
7957
+ // h-form-* (2px taller than the root's content box), so stretch would push its text low
7958
+ // / overflow the bottom border, while centring overlaps the (transparent) borders cleanly.
7959
+ "group/input-group relative flex w-full flex-1 items-center",
7960
+ "border border-border1 text-neutral6",
7939
7961
  transitions.all,
7940
7962
  "has-[:disabled]:opacity-50 has-[:disabled]:cursor-not-allowed",
7941
- "has-[[aria-invalid=true]]:border-error has-[[aria-invalid=true]]:focus-within:ring-error has-[[aria-invalid=true]]:focus-within:shadow-glow-accent2",
7942
- "has-[>[data-align=block-start]]:flex-col",
7943
- "has-[>[data-align=block-end]]:flex-col",
7963
+ "has-[[aria-invalid=true]]:border-error",
7964
+ // Height is on the root (border-box) so the group matches a same-size sibling control.
7965
+ // Auto height when vertical (block-* addon) or wrapping a textarea.
7966
+ "has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:h-auto",
7967
+ "has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:h-auto",
7968
+ "has-[textarea]:h-auto",
7944
7969
  "has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:pl-0",
7945
7970
  "has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:pr-0",
7946
- // In flex-col, flex-1 collapses the input to basis-0. Force flex-none so `h-form-*` applies.
7971
+ // In flex-col, flex-1 zeroes the control's height; force flex-none + w-full instead.
7947
7972
  "has-[>[data-align=block-start]]:[&>[data-slot=input-group-control]]:flex-none has-[>[data-align=block-start]]:[&>[data-slot=input-group-control]]:w-full",
7948
7973
  "has-[>[data-align=block-end]]:[&>[data-slot=input-group-control]]:flex-none has-[>[data-align=block-end]]:[&>[data-slot=input-group-control]]:w-full"
7949
7974
  );
7950
- const InputGroup = React__namespace.forwardRef(({ className, size = "md", ...props }, ref) => {
7951
- return /* @__PURE__ */ jsxRuntime.jsx(InputGroupSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, role: "group", "data-slot": "input-group", className: cn(inputGroupClassName, className), ...props }) });
7975
+ const inputGroupRoundedTextareaClassName = cn(
7976
+ // Pill (rounded-full) only fits single-line inline shapes. Fall back to rounded-xl
7977
+ // whenever the group goes vertical (block-* addon) or wraps a textarea.
7978
+ "has-[>[data-align=block-start]]:rounded-xl",
7979
+ "has-[>[data-align=block-end]]:rounded-xl",
7980
+ "has-[textarea]:rounded-xl"
7981
+ );
7982
+ const inputGroupFilledVariant = cn(
7983
+ "bg-surface-overlay-soft rounded-full",
7984
+ "hover:bg-surface-overlay-strong",
7985
+ inputHoverBorderWithin,
7986
+ "outline-hidden focus-within:outline-hidden focus-within:bg-surface-overlay-strong",
7987
+ inputFocusBorderWithin,
7988
+ inputGroupRoundedTextareaClassName
7989
+ );
7990
+ const inputGroupVariants = cva(inputGroupBaseClassName, {
7991
+ variants: {
7992
+ variant: {
7993
+ default: inputGroupFilledVariant,
7994
+ filled: inputGroupFilledVariant,
7995
+ outline: cn(
7996
+ "bg-transparent rounded-full",
7997
+ inputHoverBorderWithin,
7998
+ "outline-hidden focus-within:outline-hidden",
7999
+ inputFocusBorderWithin,
8000
+ inputGroupRoundedTextareaClassName
8001
+ )
8002
+ }
8003
+ },
8004
+ defaultVariants: {
8005
+ variant: "default"
8006
+ }
7952
8007
  });
8008
+ const InputGroup = React__namespace.forwardRef(
8009
+ ({ className, size = "md", variant, ...props }, ref) => {
8010
+ return /* @__PURE__ */ jsxRuntime.jsx(
8011
+ "div",
8012
+ {
8013
+ ref,
8014
+ role: "group",
8015
+ "data-slot": "input-group",
8016
+ "data-size": size,
8017
+ className: cn(inputGroupVariants({ variant }), formElementSizes[size], className),
8018
+ ...props
8019
+ }
8020
+ );
8021
+ }
8022
+ );
7953
8023
  InputGroup.displayName = "InputGroup";
7954
8024
  const inputGroupAddonVariants = cva(
7955
8025
  cn(
@@ -7994,15 +8064,20 @@ const InputGroupAddon = React__namespace.forwardRef(
7994
8064
  }
7995
8065
  );
7996
8066
  InputGroupAddon.displayName = "InputGroupAddon";
7997
- const inputGroupControlTextSize = {
7998
- sm: "text-ui-sm",
7999
- md: "text-ui-md",
8000
- default: "text-ui-md",
8001
- lg: "text-ui-lg"
8002
- };
8067
+ const inputGroupControlHeightBySize = cn(
8068
+ "group-data-[size=sm]/input-group:h-form-sm",
8069
+ "group-data-[size=md]/input-group:h-form-md",
8070
+ "group-data-[size=default]/input-group:h-form-default",
8071
+ "group-data-[size=lg]/input-group:h-form-lg"
8072
+ );
8073
+ const inputGroupControlTextBySize = cn(
8074
+ "group-data-[size=sm]/input-group:text-ui-sm",
8075
+ "group-data-[size=md]/input-group:text-ui-md",
8076
+ "group-data-[size=default]/input-group:text-ui-md",
8077
+ "group-data-[size=lg]/input-group:text-ui-lg"
8078
+ );
8003
8079
  const InputGroupInput = React__namespace.forwardRef(
8004
8080
  ({ className, testId, error, type = "text", ...props }, ref) => {
8005
- const size = React__namespace.useContext(InputGroupSizeContext);
8006
8081
  return /* @__PURE__ */ jsxRuntime.jsx(
8007
8082
  "input",
8008
8083
  {
@@ -8012,12 +8087,23 @@ const InputGroupInput = React__namespace.forwardRef(
8012
8087
  "data-testid": testId,
8013
8088
  "aria-invalid": error,
8014
8089
  className: cn(
8090
+ // Height matches the root box (which is fixed/border-box, so it doesn't grow);
8091
+ // this also keeps the control from collapsing in block mode (flex-col).
8015
8092
  "flex-1 min-w-0 bg-transparent text-neutral6 px-3 outline-hidden",
8016
- formElementSizes[size],
8017
- inputGroupControlTextSize[size],
8093
+ inputGroupControlHeightBySize,
8094
+ inputGroupControlTextBySize,
8018
8095
  "placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal",
8019
8096
  "focus:placeholder:opacity-70",
8020
8097
  "disabled:cursor-not-allowed",
8098
+ // Hide native number-spinner arrows so consumers can compose their own
8099
+ // stepper (see the NumberWithStepper story). WebKit uses the spin-button
8100
+ // pseudo-elements; Firefox needs `appearance: textfield` on the input.
8101
+ "[&::-webkit-outer-spin-button]:appearance-none [&::-webkit-outer-spin-button]:m-0",
8102
+ "[&::-webkit-inner-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0",
8103
+ "[&[type=number]]:[appearance:textfield]",
8104
+ // type="search": drop WebKit's native clear button so it doesn't double up with a
8105
+ // custom clear control (e.g. the scorers toolbar's InputGroupButton).
8106
+ "[&::-webkit-search-cancel-button]:appearance-none",
8021
8107
  className
8022
8108
  ),
8023
8109
  ...props
@@ -8028,7 +8114,6 @@ const InputGroupInput = React__namespace.forwardRef(
8028
8114
  InputGroupInput.displayName = "InputGroupInput";
8029
8115
  const InputGroupTextarea = React__namespace.forwardRef(
8030
8116
  ({ className, testId, error, ...props }, ref) => {
8031
- const size = React__namespace.useContext(InputGroupSizeContext);
8032
8117
  return /* @__PURE__ */ jsxRuntime.jsx(
8033
8118
  "textarea",
8034
8119
  {
@@ -8038,7 +8123,7 @@ const InputGroupTextarea = React__namespace.forwardRef(
8038
8123
  "aria-invalid": error,
8039
8124
  className: cn(
8040
8125
  "flex-1 min-w-0 min-h-[60px] resize-y bg-transparent text-neutral6 px-3 py-2 outline-hidden",
8041
- inputGroupControlTextSize[size],
8126
+ inputGroupControlTextBySize,
8042
8127
  "placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal",
8043
8128
  "focus:placeholder:opacity-70",
8044
8129
  "disabled:cursor-not-allowed",
@@ -8496,8 +8581,18 @@ function PropertyFilterActions({
8496
8581
 
8497
8582
  const ButtonsGroupOrientationContext = React__namespace.createContext("horizontal");
8498
8583
  const buttonsGroupVariants = cva(
8499
- // Elevate the focused child's border above its siblings so it isn't clipped in close-spacing.
8500
- cn("flex", "[&>*:focus-visible]:relative [&>*:focus-visible]:z-10"),
8584
+ // Lift the hovered/focused segment so its full border paints over the collapsed seam (else a
8585
+ // neighbour clips a side / the seam ignores the active colour). Use `:focus-visible`, NOT
8586
+ // `:focus-within`: a mouse click leaves a plain `:focus` on a button, which would otherwise
8587
+ // keep its seam border highlighted until blur. `:has(:focus-visible)` covers a nested
8588
+ // focusable (the <input> inside an InputGroup); text inputs match :focus-visible on click too,
8589
+ // which is the wanted behaviour for a field.
8590
+ cn(
8591
+ "flex",
8592
+ "[&>*:hover]:relative [&>*:hover]:z-10",
8593
+ "[&>*:focus-visible]:relative [&>*:focus-visible]:z-10",
8594
+ "[&>*:has(:focus-visible)]:relative [&>*:has(:focus-visible)]:z-10"
8595
+ ),
8501
8596
  {
8502
8597
  variants: {
8503
8598
  orientation: {
@@ -8513,24 +8608,50 @@ const buttonsGroupVariants = cva(
8513
8608
  {
8514
8609
  orientation: "horizontal",
8515
8610
  spacing: "close",
8516
- // Skip separators when collapsing borders so they stay visible.
8611
+ // Flatten inner corners. A segment rounds its right edge off having a *real* segment
8612
+ // somewhere after it (general sibling `~`, not `:not(:last-child)` and not adjacent
8613
+ // `+`). This survives non-segment children that frameworks inject between/around the
8614
+ // real ones: Base UI's trailing `<input aria-hidden>` (Select), and the visually
8615
+ // -hidden focus guards (`[data-base-ui-focus-guard]`) + positioner anchor (`[aria-owns]`)
8616
+ // a Menu/Popover inserts while OPEN — without this a DropdownMenu split-button seam
8617
+ // breaks the moment the menu opens. The same ignore-list is applied to every seam rule.
8517
8618
  className: cn(
8518
- "[&>*:not(:last-child)]:rounded-r-none",
8519
- "[&>*:not(:first-child)]:rounded-l-none",
8520
- "[&>*:not([data-slot=buttons-group-separator]):not(:first-child)]:-ml-px"
8619
+ "[&>*:has(~_*:not([aria-hidden=true]):not([data-base-ui-focus-guard]):not([aria-owns]))]:rounded-r-none",
8620
+ "[&>*:not(:first-child):not([aria-hidden=true]):not([data-base-ui-focus-guard]):not([aria-owns])]:rounded-l-none",
8621
+ // One-line seam: `-ml-px` overlaps adjacent borders onto the same pixel. Filled
8622
+ // segments (opaque bg: default/primary buttons, the text chip) keep their own
8623
+ // border — the bg hides the neighbour's. Transparent/outline segments null their
8624
+ // left border at rest (so the neighbour's shows without doubling) and reveal it on
8625
+ // hover / keyboard-focus, where the z-10 lift paints the complete border on top.
8626
+ "[&>*:not([data-slot=buttons-group-separator]):not([aria-hidden=true]):not([data-base-ui-focus-guard]):not([aria-owns]):not(:first-child)]:-ml-px",
8627
+ "[&>*:not([data-slot=buttons-group-separator]):not([data-slot=buttons-group-text]):not([data-variant=default]):not([data-variant=primary]):not([aria-hidden=true]):not([data-base-ui-focus-guard]):not([aria-owns]):not(:first-child):not(:hover):not(:focus-visible):not(:has(:focus-visible))]:border-l-transparent",
8628
+ // `primary` is filled but borderless — give it (only) an inset-shadow divider.
8629
+ "[&>[data-variant=primary]:not([aria-hidden=true]):not(:first-child)]:shadow-[inset_1px_0_0_0_var(--color-border1)]",
8630
+ // Animate only colour/bg so the seam + ring snap (no fade desynced from the z-10 drop).
8631
+ "[&>*:not([data-slot=buttons-group-separator]):not([aria-hidden=true])]:transition-[color,background-color]",
8632
+ // Group owns sizing (no consumer width classes): fill on flex/InputGroup/input,
8633
+ // content-width on a Select trigger (descendant rule beats the trigger's `w-full`).
8634
+ "[&>[data-slot=select-trigger]]:w-fit [&>[data-slot=select-trigger]]:flex-none",
8635
+ "[&>input]:flex-1"
8521
8636
  )
8522
8637
  },
8523
8638
  {
8524
8639
  orientation: "vertical",
8525
8640
  spacing: "close",
8526
- // Children carry `rounded-full` (capsule) which looks awkward when stacked vertically.
8527
- // Replace the outer corners with a regular `rounded-xl` and flatten the inner ones.
8641
+ // Children are capsules (rounded-full); re-round the outer ends to rounded-xl and
8642
+ // flatten the touching ones. Unlike the horizontal block, these use plain structural
8643
+ // selectors (no aria-hidden / data-base-ui-focus-guard / aria-owns ignore-list): vertical
8644
+ // close-spacing is only used with plain buttons, so it never hosts a Select/DropdownMenu
8645
+ // that injects guard siblings. Mirror the horizontal ignore-list here if one ever does.
8528
8646
  className: cn(
8529
8647
  "[&>*:not(:last-child)]:rounded-b-none",
8530
8648
  "[&>*:not(:first-child)]:rounded-t-none",
8531
8649
  "[&>:first-child]:rounded-t-xl",
8532
8650
  "[&>:last-child]:rounded-b-xl",
8533
- "[&>*:not([data-slot=buttons-group-separator]):not(:first-child)]:-mt-px"
8651
+ "[&>*:not([data-slot=buttons-group-separator]):not(:first-child)]:-mt-px",
8652
+ "[&>*:not([data-slot=buttons-group-separator]):not([data-slot=buttons-group-text]):not([data-variant=default]):not([data-variant=primary]):not(:first-child):not(:hover):not(:focus-visible):not(:has(:focus-visible))]:border-t-transparent",
8653
+ "[&>[data-variant=primary]:not(:first-child)]:shadow-[inset_0_1px_0_0_var(--color-border1)]",
8654
+ "[&>*:not([data-slot=buttons-group-separator])]:transition-[color,background-color]"
8534
8655
  )
8535
8656
  }
8536
8657
  ],
@@ -9463,12 +9584,30 @@ const searchbarSizeClasses = {
9463
9584
  lg: formElementSizes.lg,
9464
9585
  default: formElementSizes.default
9465
9586
  };
9587
+ const searchbarFilledSurface = cn(
9588
+ "bg-surface-overlay-soft rounded-full",
9589
+ "hover:bg-surface-overlay-strong",
9590
+ inputHoverBorderWithin,
9591
+ "outline-hidden focus-within:outline-hidden focus-within:bg-surface-overlay-strong",
9592
+ inputFocusBorderWithin
9593
+ );
9594
+ const searchbarVariantClasses = {
9595
+ default: searchbarFilledSurface,
9596
+ filled: searchbarFilledSurface,
9597
+ outline: cn(
9598
+ "bg-transparent rounded-full",
9599
+ inputHoverBorderWithin,
9600
+ "outline-hidden focus-within:outline-hidden",
9601
+ inputFocusBorderWithin
9602
+ )
9603
+ };
9466
9604
  const Searchbar = ({
9467
9605
  onSearch,
9468
9606
  label,
9469
9607
  placeholder,
9470
9608
  debounceMs = 300,
9471
9609
  size = "md",
9610
+ variant = "outline",
9472
9611
  className
9473
9612
  }) => {
9474
9613
  const id = React.useId();
@@ -9503,10 +9642,8 @@ const Searchbar = ({
9503
9642
  {
9504
9643
  className: cn(
9505
9644
  "border border-border1 flex w-full items-center gap-2 overflow-hidden pl-2 pr-1",
9506
- formElementRadius,
9507
- formElementFocusWithin,
9508
9645
  transitions.all,
9509
- "hover:border-neutral2",
9646
+ searchbarVariantClasses[variant],
9510
9647
  searchbarSizeClasses[size],
9511
9648
  className
9512
9649
  ),
@@ -9521,7 +9658,7 @@ const Searchbar = ({
9521
9658
  type: "text",
9522
9659
  placeholder,
9523
9660
  className: cn(
9524
- "bg-transparent text-ui-md placeholder:text-neutral3 block w-full px-2 outline-hidden",
9661
+ "bg-transparent text-ui-md placeholder:text-neutral2 block w-full px-2 outline-hidden",
9525
9662
  searchbarSizeClasses[size]
9526
9663
  ),
9527
9664
  name: id,
@@ -14076,7 +14213,8 @@ const ListSearch = ({
14076
14213
  placeholder,
14077
14214
  debounceMs = 300,
14078
14215
  size,
14079
- value: controlledValue
14216
+ value: controlledValue,
14217
+ variant = "outline"
14080
14218
  }) => {
14081
14219
  const id = React.useId();
14082
14220
  const [internalValue, setInternalValue] = React.useState(controlledValue ?? "");
@@ -14113,6 +14251,7 @@ const ListSearch = ({
14113
14251
  onChange: handleChange,
14114
14252
  onReset: handleReset,
14115
14253
  size,
14254
+ variant,
14116
14255
  className: "w-full max-w-[30rem]"
14117
14256
  }
14118
14257
  );
@@ -15726,6 +15865,16 @@ const formatJSON = async (code) => {
15726
15865
  });
15727
15866
  return formatted;
15728
15867
  };
15868
+ const formatTypeScript = async (code) => {
15869
+ const [prettier, prettierPluginBabel, prettierPluginEstree] = await loadPrettier();
15870
+ const formatted = await prettier.format(code, {
15871
+ parser: "babel-ts",
15872
+ printWidth: 80,
15873
+ tabWidth: 2,
15874
+ plugins: [prettierPluginBabel, prettierPluginEstree]
15875
+ });
15876
+ return formatted;
15877
+ };
15729
15878
  const isValidJson = (str) => {
15730
15879
  try {
15731
15880
  const obj = JSON.parse(str);
@@ -20577,7 +20726,11 @@ const NoTracesInfo = ({ datePreset, dateFrom, dateTo } = {}) => {
20577
20726
  };
20578
20727
 
20579
20728
  const IMMUTABLE_CACHE_TIME$2 = 1e3 * 60 * 60 * 24 * 30;
20580
- function useBranch({ traceId, spanId, depth }) {
20729
+ function useBranch({
20730
+ traceId,
20731
+ spanId,
20732
+ depth
20733
+ }) {
20581
20734
  const client = react.useMastraClient();
20582
20735
  return reactQuery.useQuery({
20583
20736
  queryKey: ["branch", traceId, spanId, depth],
@@ -20801,7 +20954,11 @@ function mergeDeltaIntoPage0(old, delta, listMode) {
20801
20954
  }
20802
20955
  return { ...old, pages: [updatedFirst, ...rest] };
20803
20956
  }
20804
- const useTraces = ({ filters, listMode = "traces", polling = {} }) => {
20957
+ const useTraces = ({
20958
+ filters,
20959
+ listMode = "traces",
20960
+ polling = {}
20961
+ }) => {
20805
20962
  const {
20806
20963
  deltaPollIntervalMs = DEFAULT_POLLING_CONFIG.deltaPollIntervalMs,
20807
20964
  deltaChaseIntervalMs = DEFAULT_POLLING_CONFIG.deltaChaseIntervalMs,
@@ -21801,13 +21958,13 @@ const useLogs = ({ filters } = {}) => {
21801
21958
  retry: false,
21802
21959
  refetchInterval: 1e4
21803
21960
  });
21804
- const { hasNextPage, isFetchingNextPage, fetchNextPage } = query;
21961
+ const { hasNextPage, isFetchingNextPage, fetchNextPage, data, isLoading, isError, error } = query;
21805
21962
  React.useEffect(() => {
21806
21963
  if (isEndOfListInView && hasNextPage && !isFetchingNextPage) {
21807
21964
  void fetchNextPage();
21808
21965
  }
21809
21966
  }, [isEndOfListInView, hasNextPage, isFetchingNextPage, fetchNextPage]);
21810
- return { ...query, data: query.data, setEndOfListElement };
21967
+ return { data, hasNextPage, isFetchingNextPage, fetchNextPage, isLoading, isError, error, setEndOfListElement };
21811
21968
  };
21812
21969
 
21813
21970
  const LOG_PARAM = "logId";
@@ -22526,14 +22683,12 @@ exports.fileToBase64 = fileToBase64;
22526
22683
  exports.flattenSchemaToVariables = flattenSchemaToVariables;
22527
22684
  exports.focusRing = focusRing;
22528
22685
  exports.formElementFocus = formElementFocus;
22529
- exports.formElementFocusWithin = formElementFocusWithin;
22530
- exports.formElementRadius = formElementRadius;
22531
22686
  exports.formElementSizes = formElementSizes;
22532
- exports.formElementTransition = formElementTransition;
22533
22687
  exports.formatCompact = formatCompact;
22534
22688
  exports.formatCost = formatCost;
22535
22689
  exports.formatHierarchicalSpans = formatHierarchicalSpans;
22536
22690
  exports.formatJSON = formatJSON;
22691
+ exports.formatTypeScript = formatTypeScript;
22537
22692
  exports.generateDefaultValues = generateDefaultValues;
22538
22693
  exports.getAllSpanIds = getAllSpanIds;
22539
22694
  exports.getChildFieldOptions = getChildFieldOptions;
@@ -22561,7 +22716,11 @@ exports.hasAnyMetricsFilterParams = hasAnyMetricsFilterParams;
22561
22716
  exports.hasAnyTraceFilterParams = hasAnyTraceFilterParams;
22562
22717
  exports.highlight = highlight;
22563
22718
  exports.hoverEffects = hoverEffects;
22564
- exports.inputVariants = inputVariants;
22719
+ exports.inputFocusBorderVisible = inputFocusBorderVisible;
22720
+ exports.inputFocusBorderWithin = inputFocusBorderWithin;
22721
+ exports.inputHoverBorderWithin = inputHoverBorderWithin;
22722
+ exports.inputOutlineAndFocusStyle = inputOutlineAndFocusStyle;
22723
+ exports.inputSurfaceAndFocusStyle = inputSurfaceAndFocusStyle;
22565
22724
  exports.is401UnauthorizedError = is401UnauthorizedError;
22566
22725
  exports.is403ForbiddenError = is403ForbiddenError;
22567
22726
  exports.isBranchesNotSupportedError = isBranchesNotSupportedError;
@@ -22588,15 +22747,14 @@ exports.saveMetricsFiltersToStorage = saveMetricsFiltersToStorage;
22588
22747
  exports.saveTraceFiltersToStorage = saveTraceFiltersToStorage;
22589
22748
  exports.sharedFormElementDisabledStyle = sharedFormElementDisabledStyle;
22590
22749
  exports.sharedFormElementFocusStyle = sharedFormElementFocusStyle;
22591
- exports.sharedFormElementStyle = sharedFormElementStyle;
22592
22750
  exports.shouldRetryQuery = shouldRetryQuery;
22593
22751
  exports.spanTypePrefixes = spanTypePrefixes;
22594
22752
  exports.stringToColor = stringToColor;
22595
- exports.textareaVariants = textareaVariants;
22596
22753
  exports.toSigFigs = toSigFigs;
22597
22754
  exports.toast = toast;
22598
22755
  exports.transitions = transitions;
22599
22756
  exports.truncateString = truncateString;
22757
+ exports.unstyledFormElementStyle = unstyledFormElementStyle;
22600
22758
  exports.useActiveResourcesKpiMetrics = useActiveResourcesKpiMetrics;
22601
22759
  exports.useActiveThreadsKpiMetrics = useActiveThreadsKpiMetrics;
22602
22760
  exports.useAgentRunsKpiMetrics = useAgentRunsKpiMetrics;