@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
@@ -6,9 +6,39 @@ type Story = StoryObj<typeof ButtonsGroup>;
6
6
  export declare const Default: Story;
7
7
  export declare const DefaultSpacing: Story;
8
8
  export declare const CloseSpacing: Story;
9
+ /**
10
+ * A split button: a primary action joined to a chevron that opens a real menu of related
11
+ * actions. The chevron is a `DropdownMenu.Trigger asChild`, so it stays a real `Button` and
12
+ * the group fuses the two into one pill with a single divider — no width or corner classes on
13
+ * either segment. (`DropdownMenu` renders no DOM of its own, so the trigger is still a direct
14
+ * child of the group; the menu content is portaled out.)
15
+ */
9
16
  export declare const AsSplitButton: Story;
10
17
  export declare const Vertical: Story;
11
18
  export declare const VerticalCloseSpacing: Story;
12
19
  export declare const WithSeparator: Story;
13
20
  export declare const VerticalWithSeparator: Story;
21
+ /**
22
+ * A stepper: two outline buttons joined to a read-only value segment. The middle value
23
+ * uses `ButtonsGroupText` (a filled chip). Because that segment is filled (opaque bg) the
24
+ * group keeps its own border as the seam, so both dividers render as a single clean line.
25
+ */
26
+ export declare const Stepper: Story;
27
+ /** `ButtonsGroupText` as an actual text label segment (e.g. a unit) next to a control. */
14
28
  export declare const WithText: Story;
29
+ /**
30
+ * Searchbar + dropdown fused into a single pill — the recommended composition. The search
31
+ * segment is an `InputGroup` (icon + input in one bordered box) nested inside the
32
+ * `ButtonsGroup` merger; an interactive clear button would go in an `InputGroupAddon`
33
+ * (`align="inline-end"`) with an `InputGroupButton`.
34
+ *
35
+ * No layout classes on the children (`flex-1`/`min-w-0`/`shrink-0`): the group owns sizing in
36
+ * `spacing="close"` — the InputGroup fills the row and the Select trigger sizes to its content.
37
+ * The group collapses the touching borders into a divider and flattens the inner corners,
38
+ * leaving the outer pill rounded.
39
+ *
40
+ * Only one class is passed: `rounded-full` on the `SelectTrigger`, an intentional shape choice
41
+ * so its outer corner matches the InputGroup pill (the trigger's standalone default is
42
+ * `rounded-lg`). The `w-[420px]` on the group is just the demo container width.
43
+ */
44
+ export declare const SearchWithDropdown: Story;
@@ -1,83 +1,18 @@
1
1
  import { Dialog } from '../Dialog';
2
2
  import * as React from 'react';
3
- declare const Command: React.ForwardRefExoticComponent<Omit<{
4
- children?: React.ReactNode;
5
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
6
- ref?: React.Ref<HTMLDivElement>;
7
- } & {
8
- asChild?: boolean;
9
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
10
- label?: string;
11
- shouldFilter?: boolean;
12
- filter?: (value: string, search: string, keywords?: string[]) => number;
13
- defaultValue?: string;
14
- value?: string;
15
- onValueChange?: (value: string) => void;
16
- loop?: boolean;
17
- disablePointerSelection?: boolean;
18
- vimBindings?: boolean;
19
- } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
3
+ declare const Command: React.ForwardRefExoticComponent<any>;
20
4
  type CommandDialogProps = Omit<React.ComponentPropsWithoutRef<typeof Dialog>, 'children'> & {
21
5
  children?: React.ReactNode;
22
6
  title?: string;
23
7
  description?: string;
24
8
  };
25
9
  declare const CommandDialog: ({ children, title, description, ...props }: CommandDialogProps) => import("react/jsx-runtime").JSX.Element;
26
- declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
27
- ref?: React.Ref<HTMLInputElement>;
28
- } & {
29
- asChild?: boolean;
30
- }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "type"> & {
31
- value?: string;
32
- onValueChange?: (search: string) => void;
33
- } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
34
- declare const CommandList: React.ForwardRefExoticComponent<Omit<{
35
- children?: React.ReactNode;
36
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
37
- ref?: React.Ref<HTMLDivElement>;
38
- } & {
39
- asChild?: boolean;
40
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
41
- label?: string;
42
- } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
43
- declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
44
- children?: React.ReactNode;
45
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
46
- ref?: React.Ref<HTMLDivElement>;
47
- } & {
48
- asChild?: boolean;
49
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
50
- declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
51
- children?: React.ReactNode;
52
- } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
53
- ref?: React.Ref<HTMLDivElement>;
54
- } & {
55
- asChild?: boolean;
56
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
57
- heading?: React.ReactNode;
58
- value?: string;
59
- forceMount?: boolean;
60
- } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
61
- declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
62
- ref?: React.Ref<HTMLDivElement>;
63
- } & {
64
- asChild?: boolean;
65
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
66
- alwaysRender?: boolean;
67
- } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
68
- declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
69
- children?: React.ReactNode;
70
- } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
71
- ref?: React.Ref<HTMLDivElement>;
72
- } & {
73
- asChild?: boolean;
74
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "onSelect" | "disabled" | "value"> & {
75
- disabled?: boolean;
76
- onSelect?: (value: string) => void;
77
- value?: string;
78
- keywords?: string[];
79
- forceMount?: boolean;
80
- } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const CommandInput: React.ForwardRefExoticComponent<any>;
11
+ declare const CommandList: React.ForwardRefExoticComponent<any>;
12
+ declare const CommandEmpty: React.ForwardRefExoticComponent<any>;
13
+ declare const CommandGroup: React.ForwardRefExoticComponent<any>;
14
+ declare const CommandSeparator: React.ForwardRefExoticComponent<any>;
15
+ declare const CommandItem: React.ForwardRefExoticComponent<any>;
81
16
  declare const CommandShortcut: {
82
17
  ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
83
18
  displayName: string;
@@ -16,7 +16,8 @@ export type SearchFieldBlockProps = {
16
16
  layout?: 'horizontal' | 'vertical';
17
17
  className?: string;
18
18
  size?: InputProps['size'];
19
+ variant?: InputProps['variant'];
19
20
  isMinimized?: boolean;
20
21
  onMinimizedChange?: (minimized: boolean) => void;
21
22
  };
22
- export declare function SearchFieldBlock({ name, helpText, errorMsg, required, disabled, value, label, labelIsHidden, layout, placeholder, onChange, onReset, className, size, isMinimized, onMinimizedChange, }: SearchFieldBlockProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function SearchFieldBlock({ name, helpText, errorMsg, required, disabled, value, label, labelIsHidden, layout, placeholder, onChange, onReset, className, size, variant, isMinimized, onMinimizedChange, }: SearchFieldBlockProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  declare const inputVariants: (props?: ({
4
- variant?: "default" | "unstyled" | null | undefined;
4
+ variant?: "default" | "outline" | "unstyled" | "filled" | null | undefined;
5
5
  size?: "default" | "sm" | "md" | "lg" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  export type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> & VariantProps<typeof inputVariants> & {
@@ -9,10 +9,10 @@ export type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size
9
9
  error?: boolean;
10
10
  };
11
11
  declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & VariantProps<(props?: ({
12
- variant?: "default" | "unstyled" | null | undefined;
12
+ variant?: "default" | "outline" | "unstyled" | "filled" | null | undefined;
13
13
  size?: "default" | "sm" | "md" | "lg" | null | undefined;
14
14
  } & import('class-variance-authority/types').ClassProp) | undefined) => string> & {
15
15
  testId?: string;
16
16
  error?: boolean;
17
17
  } & React.RefAttributes<HTMLInputElement>>;
18
- export { Input, inputVariants };
18
+ export { Input };
@@ -6,9 +6,13 @@ type Story = StoryObj<typeof Input>;
6
6
  export declare const Default: Story;
7
7
  export declare const Variants: Story;
8
8
  export declare const Sizes: Story;
9
+ export declare const Filled: Story;
10
+ export declare const Outline: Story;
9
11
  export declare const Disabled: Story;
10
12
  export declare const WithValue: Story;
11
13
  export declare const Email: Story;
12
14
  export declare const Password: Story;
13
15
  export declare const Number: Story;
14
16
  export declare const SizesWithButton: Story;
17
+ export declare const Error: Story;
18
+ export declare const OnDifferentSurfaces: Story;
@@ -2,12 +2,17 @@ import { VariantProps } from 'class-variance-authority';
2
2
  import { ButtonProps } from '../Button/Button';
3
3
  import { FormElementSize } from '../../primitives/form-element';
4
4
  import * as React from 'react';
5
+ declare const inputGroupVariants: (props?: ({
6
+ variant?: "default" | "outline" | "filled" | null | undefined;
7
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
5
8
  export type InputGroupProps = React.ComponentPropsWithoutRef<'div'> & {
6
9
  size?: FormElementSize;
7
- };
10
+ } & VariantProps<typeof inputGroupVariants>;
8
11
  declare const InputGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
9
12
  size?: FormElementSize;
10
- } & React.RefAttributes<HTMLDivElement>>;
13
+ } & VariantProps<(props?: ({
14
+ variant?: "default" | "outline" | "filled" | null | undefined;
15
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
11
16
  declare const inputGroupAddonVariants: (props?: ({
12
17
  align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
13
18
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof InputGroup>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof InputGroup>;
6
6
  export declare const Default: Story;
7
+ export declare const Variants: Story;
7
8
  export declare const WithInlineStartIcon: Story;
8
9
  export declare const WithInlineEndButton: Story;
9
10
  export declare const WithLeadingAndTrailing: Story;
@@ -15,3 +16,5 @@ export declare const Sizes: Story;
15
16
  export declare const Disabled: Story;
16
17
  export declare const Invalid: Story;
17
18
  export declare const Textarea: Story;
19
+ export declare const NumberWithStepper: Story;
20
+ export declare const OnDifferentSurfaces: Story;
@@ -11,5 +11,6 @@ export type ListSearchProps = {
11
11
  * (e.g. from a Reset button). If omitted, ListSearch manages its own state.
12
12
  */
13
13
  value?: string;
14
+ variant?: InputProps['variant'];
14
15
  };
15
- export declare const ListSearch: ({ onSearch, label, placeholder, debounceMs, size, value: controlledValue, }: ListSearchProps) => import("react/jsx-runtime").JSX.Element;
16
+ export declare const ListSearch: ({ onSearch, label, placeholder, debounceMs, size, value: controlledValue, variant, }: ListSearchProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,16 @@
1
1
  import { FormElementSize } from '../../primitives/form-element';
2
+ type SearchbarVariant = 'default' | 'filled' | 'outline';
2
3
  export type SearchbarProps = {
3
4
  onSearch: (search: string) => void;
4
5
  label: string;
5
6
  placeholder: string;
6
7
  debounceMs?: number;
7
8
  size?: FormElementSize;
9
+ variant?: SearchbarVariant;
8
10
  className?: string;
9
11
  };
10
- export declare const Searchbar: ({ onSearch, label, placeholder, debounceMs, size, className, }: SearchbarProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const Searchbar: ({ onSearch, label, placeholder, debounceMs, size, variant, className, }: SearchbarProps) => import("react/jsx-runtime").JSX.Element;
11
13
  export declare const SearchbarWrapper: ({ children }: {
12
14
  children: React.ReactNode;
13
15
  }) => import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -5,7 +5,10 @@ export default meta;
5
5
  type Story = StoryObj<typeof Searchbar>;
6
6
  export declare const Default: Story;
7
7
  export declare const AgentSearch: Story;
8
+ export declare const Variants: Story;
8
9
  export declare const WithCustomDebounce: Story;
9
10
  export declare const WithWrapper: Story;
10
11
  export declare const InteractiveSearch: Story;
11
12
  export declare const InSidebarContext: Story;
13
+ export declare const Sizes: Story;
14
+ export declare const OnDifferentSurfaces: Story;
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  declare const textareaVariants: (props?: ({
4
- variant?: "default" | "unstyled" | null | undefined;
4
+ variant?: "default" | "outline" | "unstyled" | "filled" | null | undefined;
5
5
  size?: "default" | "sm" | "md" | "lg" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  export type TextareaProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> & VariantProps<typeof textareaVariants> & {
@@ -9,10 +9,10 @@ export type TextareaProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElemen
9
9
  error?: boolean;
10
10
  };
11
11
  declare const Textarea: React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> & VariantProps<(props?: ({
12
- variant?: "default" | "unstyled" | null | undefined;
12
+ variant?: "default" | "outline" | "unstyled" | "filled" | null | undefined;
13
13
  size?: "default" | "sm" | "md" | "lg" | null | undefined;
14
14
  } & import('class-variance-authority/types').ClassProp) | undefined) => string> & {
15
15
  testId?: string;
16
16
  error?: boolean;
17
17
  } & React.RefAttributes<HTMLTextAreaElement>>;
18
- export { Textarea, textareaVariants };
18
+ export { Textarea };
@@ -8,3 +8,4 @@ export declare const Variants: Story;
8
8
  export declare const Sizes: Story;
9
9
  export declare const Error: Story;
10
10
  export declare const Disabled: Story;
11
+ export declare const OnDifferentSurfaces: Story;
@@ -5,10 +5,12 @@ export declare const formElementSizes: {
5
5
  readonly lg: "h-form-lg";
6
6
  };
7
7
  export declare const formElementFocus = "focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal";
8
- export declare const formElementFocusWithin = "focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal";
9
- export declare const formElementRadius = "rounded-md";
10
- export declare const sharedFormElementStyle = "bg-surface2 border border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg";
11
8
  export declare const sharedFormElementFocusStyle = "outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40";
12
9
  export declare const sharedFormElementDisabledStyle = "disabled:opacity-50 disabled:cursor-not-allowed";
13
- export declare const formElementTransition = "transition-all duration-normal ease-out-custom";
10
+ export declare const inputFocusBorderVisible = "focus-visible:border-neutral5/50";
11
+ export declare const inputFocusBorderWithin = "focus-within:border-neutral5/50";
12
+ export declare const inputHoverBorderWithin = "[&:hover:not(:focus-within)]:border-border2";
13
+ export declare const inputSurfaceAndFocusStyle: string;
14
+ export declare const inputOutlineAndFocusStyle: string;
15
+ export declare const unstyledFormElementStyle = "border-0 bg-transparent outline-hidden focus-visible:outline-hidden";
14
16
  export type FormElementSize = keyof typeof formElementSizes;
@@ -1,2 +1,3 @@
1
1
  export declare const formatJSON: (code: string) => Promise<string>;
2
+ export declare const formatTypeScript: (code: string) => Promise<string>;
2
3
  export declare const isValidJson: (str: string) => boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mastra/playground-ui",
3
3
  "type": "module",
4
- "version": "30.0.2-alpha.2",
4
+ "version": "31.0.0-alpha.4",
5
5
  "description": "Mastra Playground components",
6
6
  "main": "dist/index.umd.js",
7
7
  "module": "dist/index.es.js",
@@ -85,8 +85,8 @@
85
85
  "react": ">=19.0.0",
86
86
  "react-dom": ">=19.0.0",
87
87
  "tailwindcss": "^4.0.0",
88
- "@mastra/client-js": "^1.21.2-alpha.2",
89
- "@mastra/react": "0.4.3-alpha.2"
88
+ "@mastra/client-js": "^1.22.0-alpha.4",
89
+ "@mastra/react": "0.4.3-alpha.4"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@storybook/addon-a11y": "^10.3.6",
@@ -122,10 +122,10 @@
122
122
  "vite-plugin-dts": "^4.5.4",
123
123
  "vite-plugin-lib-inject-css": "^2.2.2",
124
124
  "vitest": "4.1.5",
125
- "@mastra/react": "0.4.3-alpha.2",
126
- "@mastra/core": "1.38.0-alpha.2",
127
125
  "@internal/lint": "0.0.99",
128
- "@mastra/client-js": "^1.21.2-alpha.2"
126
+ "@mastra/client-js": "^1.22.0-alpha.4",
127
+ "@mastra/core": "1.38.0-alpha.4",
128
+ "@mastra/react": "0.4.3-alpha.4"
129
129
  },
130
130
  "homepage": "https://mastra.ai",
131
131
  "repository": {