@mastra/playground-ui 27.0.0-alpha.7 → 27.0.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +651 -0
  2. package/dist/index.cjs.js +878 -447
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.css +279 -88
  5. package/dist/index.es.js +864 -442
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/src/domains/traces/components/format-hierarchical-spans.d.ts +7 -1
  8. package/dist/src/domains/traces/components/index.d.ts +1 -0
  9. package/dist/src/domains/traces/components/span-data-panel-view.d.ts +7 -1
  10. package/dist/src/domains/traces/components/trace-data-panel-view.d.ts +7 -1
  11. package/dist/src/domains/traces/components/traces-list-mode-toggle.d.ts +12 -0
  12. package/dist/src/domains/traces/components/traces-list-view.d.ts +8 -1
  13. package/dist/src/domains/traces/components/traces-toolbar.d.ts +5 -1
  14. package/dist/src/domains/traces/hooks/index.d.ts +2 -0
  15. package/dist/src/domains/traces/hooks/use-branch.d.ts +52 -0
  16. package/dist/src/domains/traces/hooks/use-trace-list-navigation.d.ts +7 -2
  17. package/dist/src/domains/traces/hooks/use-trace-or-branch-spans.d.ts +25 -0
  18. package/dist/src/domains/traces/hooks/use-trace-url-state.d.ts +12 -1
  19. package/dist/src/domains/traces/trace-filters.d.ts +3 -0
  20. package/dist/src/ds/components/Button/Button.d.ts +1 -1
  21. package/dist/src/ds/components/ButtonsGroup/buttons-group.d.ts +30 -5
  22. package/dist/src/ds/components/ButtonsGroup/buttons-group.stories.d.ts +5 -0
  23. package/dist/src/ds/components/Combobox/combobox-styles.d.ts +19 -11
  24. package/dist/src/ds/components/Combobox/combobox.d.ts +3 -3
  25. package/dist/src/ds/components/Combobox/combobox.stories.d.ts +1 -0
  26. package/dist/src/ds/components/Combobox/index.d.ts +1 -0
  27. package/dist/src/ds/components/Command/command.d.ts +1 -1
  28. package/dist/src/ds/components/Input/input.d.ts +2 -2
  29. package/dist/src/ds/components/InputGroup/index.d.ts +1 -0
  30. package/dist/src/ds/components/InputGroup/input-group.d.ts +44 -0
  31. package/dist/src/ds/components/InputGroup/input-group.stories.d.ts +17 -0
  32. package/dist/src/ds/components/PropertyFilter/property-filter-applied.d.ts +11 -1
  33. package/dist/src/ds/components/PropertyFilter/property-filter-creator.d.ts +7 -1
  34. package/dist/src/ds/components/ScrollArea/scroll-area.d.ts +28 -7
  35. package/dist/src/ds/components/ScrollArea/scroll-area.stories.d.ts +4 -0
  36. package/dist/src/ds/components/StatusBadge/StatusBadge.d.ts +1 -1
  37. package/dist/src/ds/components/Tabs/tabs-list.d.ts +8 -2
  38. package/dist/src/ds/components/Tabs/tabs.stories.d.ts +2 -0
  39. package/dist/src/ds/components/Textarea/textarea.d.ts +2 -2
  40. package/dist/src/index.d.ts +1 -1
  41. package/package.json +7 -8
  42. package/dist/src/ds/components/Threads/index.d.ts +0 -1
  43. package/dist/src/ds/components/Threads/threads.d.ts +0 -28
  44. package/dist/src/ds/components/Threads/threads.stories.d.ts +0 -12
@@ -8,5 +8,11 @@ type TimelineSpan = {
8
8
  endedAt?: Date | string | null;
9
9
  parentSpanId?: string | null;
10
10
  };
11
- export declare const formatHierarchicalSpans: (spans: TimelineSpan[]) => UISpan[];
11
+ /**
12
+ * When `anchorSpanId` is provided, that span is treated as the displayed root
13
+ * regardless of its `parentSpanId` -- the branch-subtree case from `getBranch`,
14
+ * where the anchor has a real parent that's outside the returned set. Without
15
+ * it, the displayed roots are the spans with no parent (the trace case).
16
+ */
17
+ export declare const formatHierarchicalSpans: (spans: TimelineSpan[], anchorSpanId?: string) => UISpan[];
12
18
  export {};
@@ -15,5 +15,6 @@ export { SpanDetailsView, type SpanDetailsViewProps } from './span-details-view'
15
15
  export { TraceDetailsView, type TraceDetailsViewProps } from './trace-details-view';
16
16
  export { TracesLayout, type TracesLayoutProps } from './traces-layout';
17
17
  export { TracesListView, type TracesListViewProps, type TracesListViewTrace } from './traces-list-view';
18
+ export { TracesListModeToggle, type TracesListModeToggleProps } from './traces-list-mode-toggle';
18
19
  export { TracesErrorContent, type TracesErrorContentProps } from './traces-error-content';
19
20
  export { NoTracesInfo, type NoTracesInfoProps } from './no-traces-info';
@@ -33,5 +33,11 @@ export interface SpanDataPanelViewProps {
33
33
  }) => ReactNode;
34
34
  /** Optional count shown in the "Feedback" tab label. */
35
35
  feedbackTabBadge?: ReactNode;
36
+ /**
37
+ * Whether this span is the displayed root of the current view (trace root or
38
+ * branch anchor). Controls visibility of trace-level metadata fields. Defaults
39
+ * to `span.parentSpanId == null` (trace case) when omitted.
40
+ */
41
+ isAnchor?: boolean;
36
42
  }
37
- export declare function SpanDataPanelView({ traceId, spanId, span, isLoading, onClose, onPrevious, onNext, activeTab, onTabChange, scoringTabSlot, scoringTabBadge, feedbackTabSlot, feedbackTabBadge, }: SpanDataPanelViewProps): import("react/jsx-runtime").JSX.Element;
43
+ export declare function SpanDataPanelView({ traceId, spanId, span, isLoading, onClose, onPrevious, onNext, activeTab, onTabChange, scoringTabSlot, scoringTabBadge, feedbackTabSlot, feedbackTabBadge, isAnchor, }: SpanDataPanelViewProps): import("react/jsx-runtime").JSX.Element;
@@ -24,5 +24,11 @@ export interface TraceDataPanelViewProps {
24
24
  /** When both are provided, renders an "Open trace page" button. */
25
25
  LinkComponent?: LinkComponent;
26
26
  traceHref?: string;
27
+ /**
28
+ * Span treated as the displayed root of the timeline. Required for branch
29
+ * subtrees from `getBranch` where the anchor has a real parent that's outside
30
+ * `spans`. When omitted, the span with no parent is used (trace case).
31
+ */
32
+ anchorSpanId?: string;
27
33
  }
28
- export declare function TraceDataPanelView({ traceId, spans, isLoading, onClose, onSpanSelect, onEvaluateTrace, onSaveAsDatasetItem, initialSpanId, onPrevious, onNext, collapsed: controlledCollapsed, onCollapsedChange, placement, timelineChartWidth, LinkComponent, traceHref, }: TraceDataPanelViewProps): import("react/jsx-runtime").JSX.Element;
34
+ export declare function TraceDataPanelView({ traceId, spans, isLoading, onClose, onSpanSelect, onEvaluateTrace, onSaveAsDatasetItem, initialSpanId, onPrevious, onNext, collapsed: controlledCollapsed, onCollapsedChange, placement, timelineChartWidth, LinkComponent, traceHref, anchorSpanId, }: TraceDataPanelViewProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { TraceListMode } from '../trace-filters';
2
+ export interface TracesListModeToggleProps {
3
+ value: TraceListMode;
4
+ onChange: (mode: TraceListMode) => void;
5
+ disabled?: boolean;
6
+ }
7
+ /**
8
+ * Dropdown switcher between the two list modes on the Observability traces page:
9
+ * - `traces` — one row per top-level run (each trace's root anchor).
10
+ * - `branches` — one row per anchor span, including ones nested inside other runs.
11
+ */
12
+ export declare function TracesListModeToggle({ value, onChange, disabled }: TracesListModeToggleProps): import("react/jsx-runtime").JSX.Element;
@@ -8,6 +8,8 @@ export type TraceAttributes = {
8
8
  };
9
9
  export type TracesListViewTrace = {
10
10
  traceId: string;
11
+ /** Required for branch rows; absent on plain trace rows (which are root-rooted). */
12
+ spanId?: string | null;
11
13
  name: string;
12
14
  entityType?: string | null;
13
15
  entityId?: string | null;
@@ -27,6 +29,11 @@ export type TracesListViewProps = {
27
29
  filtersApplied?: boolean;
28
30
  /** Currently featured/selected trace — its row gets the highlighted background. */
29
31
  featuredTraceId?: string | null;
32
+ /**
33
+ * Required in branches mode to disambiguate rows sharing a `traceId`. When set,
34
+ * a row is featured only when both `traceId` and `spanId` match.
35
+ */
36
+ featuredSpanId?: string | null;
30
37
  /** Called when a row is clicked. The current selection logic (toggle on same id) is the consumer's call. */
31
38
  onTraceClick: (trace: TracesListViewTrace) => void;
32
39
  groupByThread?: boolean;
@@ -37,4 +44,4 @@ export type TracesListViewProps = {
37
44
  * indexed item array, renders only the visible window via TanStack Virtual, and
38
45
  * uses DataList primitives for layout (CSS Grid with subgrid rows).
39
46
  */
40
- export declare function TracesListView({ traces, isLoading, isFetchingNextPage, hasNextPage, setEndOfListElement, filtersApplied, featuredTraceId, onTraceClick, groupByThread, threadTitles, }: TracesListViewProps): import("react/jsx-runtime").JSX.Element;
47
+ export declare function TracesListView({ traces, isLoading, isFetchingNextPage, hasNextPage, setEndOfListElement, filtersApplied, featuredTraceId, featuredSpanId, onTraceClick, groupByThread, threadTitles, }: TracesListViewProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from '../../../../node_modules/@types/react';
1
2
  import { PropertyFilterField, PropertyFilterToken } from '../../../ds/components/PropertyFilter/types';
2
3
  type TracesToolbarProps = {
3
4
  /** Keep all filter pills but reset each value to its neutral state
@@ -14,6 +15,9 @@ type TracesToolbarProps = {
14
15
  filterTokens: PropertyFilterToken[];
15
16
  onFilterTokensChange: (tokens: PropertyFilterToken[]) => void;
16
17
  autoFocusFilterFieldId?: string;
18
+ /** Field ids rendered as read-only pills (cannot be edited or removed). */
19
+ lockedFieldIds?: readonly string[];
20
+ lockedTooltipContent?: ReactNode;
17
21
  };
18
- export declare function TracesToolbar({ onClear, onRemoveAll, onSave, onRemoveSaved, isLoading, filterFields, filterTokens, onFilterTokensChange, autoFocusFilterFieldId, }: TracesToolbarProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function TracesToolbar({ onClear, onRemoveAll, onSave, onRemoveSaved, isLoading, filterFields, filterTokens, onFilterTokensChange, autoFocusFilterFieldId, lockedFieldIds, lockedTooltipContent, }: TracesToolbarProps): import("react/jsx-runtime").JSX.Element;
19
23
  export {};
@@ -1,6 +1,8 @@
1
1
  export { getAllSpanIds, getSpanDescendantIds } from './get-all-span-ids';
2
+ export { useBranch, type UseBranchArgs } from './use-branch';
2
3
  export { useSpanDetail } from './use-span-detail';
3
4
  export { useTraceLightSpans } from './use-trace-light-spans';
5
+ export { useTraceOrBranchSpans, type UseTraceOrBranchSpansArgs, type UseTraceOrBranchSpansResult, } from './use-trace-or-branch-spans';
4
6
  export { useTraceSpans } from './use-trace-spans';
5
7
  export { useTraces } from './use-traces';
6
8
  export { useTags } from './use-tags';
@@ -0,0 +1,52 @@
1
+ export interface UseBranchArgs {
2
+ traceId: string | null | undefined;
3
+ spanId: string | null | undefined;
4
+ depth?: number;
5
+ }
6
+ export declare function useBranch({ traceId, spanId, depth }: UseBranchArgs): import('@tanstack/react-query').UseQueryResult<{
7
+ traceId: string;
8
+ spans: {
9
+ createdAt: Date;
10
+ updatedAt: Date | null;
11
+ name: string;
12
+ spanType: import('@mastra/core/observability').SpanType;
13
+ isEvent: boolean;
14
+ startedAt: Date;
15
+ traceId: string;
16
+ spanId: string;
17
+ experimentId?: string | null | undefined;
18
+ attributes?: Record<string, unknown> | null | undefined;
19
+ links?: unknown[] | null | undefined;
20
+ input?: unknown;
21
+ output?: unknown;
22
+ error?: unknown;
23
+ endedAt?: Date | null | undefined;
24
+ requestContext?: Record<string, unknown> | null | undefined;
25
+ metadata?: Record<string, unknown> | null | undefined;
26
+ tags?: string[] | null | undefined;
27
+ source?: string | null | undefined;
28
+ entityType?: import('@mastra/core/storage').EntityType | null | undefined;
29
+ entityId?: string | null | undefined;
30
+ entityName?: string | null | undefined;
31
+ parentEntityType?: import('@mastra/core/storage').EntityType | null | undefined;
32
+ parentEntityId?: string | null | undefined;
33
+ parentEntityName?: string | null | undefined;
34
+ rootEntityType?: import('@mastra/core/storage').EntityType | null | undefined;
35
+ rootEntityId?: string | null | undefined;
36
+ rootEntityName?: string | null | undefined;
37
+ userId?: string | null | undefined;
38
+ organizationId?: string | null | undefined;
39
+ resourceId?: string | null | undefined;
40
+ runId?: string | null | undefined;
41
+ sessionId?: string | null | undefined;
42
+ threadId?: string | null | undefined;
43
+ requestId?: string | null | undefined;
44
+ environment?: string | null | undefined;
45
+ serviceName?: string | null | undefined;
46
+ scope?: Record<string, unknown> | null | undefined;
47
+ entityVersionId?: string | null | undefined;
48
+ parentEntityVersionId?: string | null | undefined;
49
+ rootEntityVersionId?: string | null | undefined;
50
+ parentSpanId?: string | null | undefined;
51
+ }[];
52
+ }, Error>;
@@ -1,11 +1,16 @@
1
1
  /**
2
2
  * Derives previous/next *trace* navigation handlers from the current traces list and the featured
3
- * trace id. Returns undefined for handlers that are out of bounds so the consumer can render
3
+ * row. Returns undefined for handlers that are out of bounds so the consumer can render
4
4
  * disabled UI. Mirrors the shape of `useTraceSpanNavigation`.
5
+ *
6
+ * In branches mode rows share a `traceId`, so the consumer can pass a `featuredSpanId` to
7
+ * disambiguate the active row (and receive the new row's `spanId` on prev/next). In traces
8
+ * mode `featuredSpanId` should be null/undefined; only the `traceId` is used.
5
9
  */
6
10
  export declare function useTraceListNavigation<T extends {
7
11
  traceId: string;
8
- }>(traces: T[], featuredTraceId: string | undefined, onTraceChange: (traceId: string) => void): {
12
+ spanId?: string | null;
13
+ }>(traces: T[], featuredTraceId: string | undefined, featuredSpanId: string | null | undefined, onTraceChange: (traceId: string, spanId?: string) => void): {
9
14
  featuredTraceIdx: number;
10
15
  handlePreviousTrace: (() => void) | undefined;
11
16
  handleNextTrace: (() => void) | undefined;
@@ -0,0 +1,25 @@
1
+ import { LightSpanRecord } from '@mastra/core/storage';
2
+ import { TraceListMode } from '../trace-filters';
3
+ export interface UseTraceOrBranchSpansArgs {
4
+ traceId: string | null | undefined;
5
+ /** Required when `listMode === 'branches'` — the anchor span identifying the displayed
6
+ * subtree. The hook fetches `getBranch(traceId, anchorSpanId)`. Intra-panel span selection
7
+ * is separate (the caller's `spanIdParam`); the anchor stays put while it changes. */
8
+ anchorSpanId?: string | null;
9
+ listMode: TraceListMode;
10
+ depth?: number;
11
+ }
12
+ export interface UseTraceOrBranchSpansResult {
13
+ spans: LightSpanRecord[] | undefined;
14
+ /** Set in branches mode; undefined in traces mode (which uses parentSpanId == null). */
15
+ anchorSpanId: string | undefined;
16
+ isLoading: boolean;
17
+ isError: boolean;
18
+ error: unknown;
19
+ }
20
+ /**
21
+ * Unified data source for the trace/span detail panel. Returns trace spans (full tree from the
22
+ * root) in traces mode, or branch spans (subtree rooted at `anchorSpanId`) in branches mode.
23
+ * Only the active query fires; the inactive one is disabled via its `enabled` flag.
24
+ */
25
+ export declare function useTraceOrBranchSpans({ traceId, anchorSpanId, listMode, depth, }: UseTraceOrBranchSpansArgs): UseTraceOrBranchSpansResult;
@@ -23,13 +23,22 @@ export interface UseTraceUrlStateResult {
23
23
  datePresetRef: React.MutableRefObject<TraceDatePreset>;
24
24
  traceIdParam: string | undefined;
25
25
  spanIdParam: string | undefined;
26
+ /** Branch-mode only: the anchor span that defines the displayed subtree. Stable while the
27
+ * user navigates between spans inside the panel (which only changes `spanIdParam`). */
28
+ anchorSpanIdParam: string | undefined;
26
29
  spanTabParam: SpanTab | undefined;
27
30
  scoreIdParam: string | undefined;
28
31
  listMode: TraceListMode;
29
32
  selectedEntityOption: EntityOptions | undefined;
30
33
  selectedStatus: TraceStatusFilter | undefined;
31
34
  filterTokens: PropertyFilterToken[];
32
- handleTraceClick: (traceId: string) => void;
35
+ /**
36
+ * Selects a row. In traces mode pass just `traceId` (and optionally a `spanId` for an
37
+ * initial span selection in the panel). In branches mode also pass `anchorSpanId` — the
38
+ * branch identity, kept stable while the user navigates between spans inside the panel.
39
+ * Branch rows are identified by (traceId, anchorSpanId); trace rows by traceId alone.
40
+ */
41
+ handleTraceClick: (traceId: string, spanId?: string, anchorSpanId?: string) => void;
33
42
  /** Convenience: clears the featured trace selection. Equivalent to `handleTraceClick('')`. */
34
43
  handleTraceClose: () => void;
35
44
  handleSpanChange: (spanId: string | null) => void;
@@ -37,6 +46,8 @@ export interface UseTraceUrlStateResult {
37
46
  handleSpanClose: () => void;
38
47
  handleSpanTabChange: (tab: SpanTab) => void;
39
48
  handleScoreChange: (scoreId: string | null) => void;
49
+ /** Switches the list view between traces and branches. Clears the current selection. */
50
+ handleListModeChange: (mode: TraceListMode) => void;
40
51
  handleFilterTokensChange: (nextTokens: PropertyFilterToken[]) => void;
41
52
  handleDateChange: (value: Date | undefined, type: 'from' | 'to') => void;
42
53
  handleDatePresetChange: (preset: TraceDatePreset) => void;
@@ -43,6 +43,9 @@ export declare const TRACE_SYNTHETIC_FILTER_FIELD_IDS: readonly ["rootEntityType
43
43
  export declare const TRACE_ROOT_ENTITY_TYPE_PARAM = "rootEntityType";
44
44
  export declare const TRACE_STATUS_PARAM = "status";
45
45
  export declare const TRACE_LIST_MODE_PARAM = "listMode";
46
+ /** Branch-mode only: identifies the anchor span that defines the displayed subtree.
47
+ * Stable across intra-panel span navigation (which only changes `spanId`). */
48
+ export declare const TRACE_ANCHOR_SPAN_ID_PARAM = "anchorSpanId";
46
49
  export declare const TRACE_LIST_MODE_VALUES: Set<"traces" | "branches">;
47
50
  export type TraceListMode = 'traces' | 'branches';
48
51
  export declare const TRACE_DATE_PRESET_PARAM = "datePreset";
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
2
2
  import { default as React } from '../../../../node_modules/@types/react';
3
3
  export declare const buttonVariants: (props?: ({
4
4
  variant?: "link" | "default" | "primary" | "cta" | "ghost" | "outline" | null | undefined;
5
- size?: "default" | "lg" | "sm" | "md" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
5
+ size?: "default" | "sm" | "md" | "lg" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  type ButtonVariantsProps = VariantProps<typeof buttonVariants>;
8
8
  export type ButtonVariant = NonNullable<ButtonVariantsProps['variant']>;
@@ -1,6 +1,31 @@
1
- export type ButtonsGroupProps = {
2
- children: React.ReactNode;
3
- className?: string;
4
- spacing?: 'default' | 'close';
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import { FormElementSize } from '../../primitives/form-element';
3
+ import * as React from 'react';
4
+ type Orientation = 'horizontal' | 'vertical';
5
+ declare const buttonsGroupVariants: (props?: ({
6
+ orientation?: "horizontal" | "vertical" | null | undefined;
7
+ spacing?: "default" | "close" | null | undefined;
8
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
9
+ type ButtonsGroupVariantsProps = VariantProps<typeof buttonsGroupVariants>;
10
+ export type ButtonsGroupSpacing = NonNullable<ButtonsGroupVariantsProps['spacing']>;
11
+ export type ButtonsGroupProps = React.ComponentPropsWithoutRef<'div'> & {
12
+ orientation?: Orientation;
13
+ spacing?: ButtonsGroupSpacing;
5
14
  };
6
- export declare function ButtonsGroup({ children, className, spacing }: ButtonsGroupProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare const ButtonsGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
16
+ orientation?: Orientation;
17
+ spacing?: ButtonsGroupSpacing;
18
+ } & React.RefAttributes<HTMLDivElement>>;
19
+ export type ButtonsGroupSeparatorProps = React.ComponentPropsWithoutRef<'div'> & {
20
+ orientation?: Orientation;
21
+ };
22
+ export declare const ButtonsGroupSeparator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
23
+ orientation?: Orientation;
24
+ } & React.RefAttributes<HTMLDivElement>>;
25
+ export type ButtonsGroupTextProps = React.ComponentPropsWithoutRef<'div'> & {
26
+ size?: FormElementSize;
27
+ };
28
+ export declare const ButtonsGroupText: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
29
+ size?: FormElementSize;
30
+ } & React.RefAttributes<HTMLDivElement>>;
31
+ export { buttonsGroupVariants };
@@ -7,3 +7,8 @@ export declare const Default: Story;
7
7
  export declare const DefaultSpacing: Story;
8
8
  export declare const CloseSpacing: Story;
9
9
  export declare const AsSplitButton: Story;
10
+ export declare const Vertical: Story;
11
+ export declare const VerticalCloseSpacing: Story;
12
+ export declare const WithSeparator: Story;
13
+ export declare const VerticalWithSeparator: Story;
14
+ export declare const WithText: Story;
@@ -1,8 +1,14 @@
1
1
  export declare const comboboxStyles: {
2
2
  /** Root wrapper */
3
3
  readonly root: "flex flex-col gap-1.5";
4
- /** Trigger — form input look, sized to mirror SelectTrigger. */
4
+ /** Trigger base shared layout/typography for all variants. */
5
5
  readonly trigger: string;
6
+ /** Variant: default — bordered form input look. */
7
+ readonly triggerDefault: string;
8
+ /** Variant: ghost — borderless, hover-only surface. */
9
+ readonly triggerGhost: string;
10
+ /** Variant: link — text-only trigger. */
11
+ readonly triggerLink: string;
6
12
  /** Trigger with error state */
7
13
  readonly triggerError: "border-accent2 hover:border-accent2 focus-visible:border-accent2";
8
14
  /** Chevron icon in trigger */
@@ -20,19 +26,21 @@ export declare const comboboxStyles: {
20
26
  /** Search input */
21
27
  readonly searchInput: string;
22
28
  /** Empty state */
23
- readonly empty: "not-empty:block hidden py-6 text-center text-ui-smd text-neutral3";
29
+ readonly empty: "not-empty:block hidden py-4 text-center text-ui-smd text-neutral3";
24
30
  /** Options list */
25
31
  readonly list: "max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1";
26
- /** Option item base — rounded-lg (8px) sits concentrically inside rounded-xl + p-1. */
32
+ /** Option item base — rounded-md sits concentrically inside rounded-xl + p-1. */
27
33
  readonly item: string;
28
- /** Option item with selected state (single select) — quiet emphasis, no accent fill. */
29
- readonly itemSelected: "data-selected:text-neutral6";
30
- /** Check indicator container */
31
- readonly checkContainer: "flex h-4 w-4 shrink-0 items-center justify-center";
34
+ /** Multi-select item keeps the left checkbox slot, no right indicator. */
35
+ readonly itemMulti: string;
36
+ /** Right-aligned slot grouping end content + selection check. */
37
+ readonly itemRightSlot: "ml-auto flex items-center gap-2 shrink-0";
38
+ /** Check indicator container — inline, fixed 16x16, shown only when item is selected. */
39
+ readonly checkContainer: "flex h-4 w-4 shrink-0 items-center justify-center text-accent1";
32
40
  /** Check icon (single select) */
33
- readonly checkIcon: string;
41
+ readonly checkIcon: "h-3.5 w-3.5";
34
42
  /** Checkbox container (multi select) */
35
- readonly checkbox: "flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border";
43
+ readonly checkbox: "flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border";
36
44
  /** Checkbox selected state */
37
45
  readonly checkboxSelected: "bg-accent1 border-accent1";
38
46
  /** Checkbox unselected state */
@@ -47,8 +55,8 @@ export declare const comboboxStyles: {
47
55
  readonly optionLabel: "truncate";
48
56
  /** Option description */
49
57
  readonly optionDescription: "text-ui-sm text-neutral3 truncate";
50
- /** Option end slot */
51
- readonly optionEnd: "ml-auto";
58
+ /** Option end slot — `ml-auto` makes it push right inside flex containers (used by multi-select). */
59
+ readonly optionEnd: "ml-auto flex items-center shrink-0";
52
60
  /** Error message */
53
61
  readonly error: "text-ui-sm text-accent2";
54
62
  };
@@ -7,6 +7,7 @@ export type ComboboxOption = {
7
7
  start?: React.ReactNode;
8
8
  end?: React.ReactNode;
9
9
  };
10
+ export type ComboboxVariant = 'default' | 'ghost' | 'link';
10
11
  export type ComboboxProps = {
11
12
  options: ComboboxOption[];
12
13
  value?: string;
@@ -16,12 +17,11 @@ export type ComboboxProps = {
16
17
  emptyText?: string;
17
18
  className?: string;
18
19
  disabled?: boolean;
19
- /** Kept for API compatibility; trigger styling is intrinsic to the Combobox now. */
20
- variant?: 'default' | 'ghost' | 'link';
20
+ variant?: ComboboxVariant;
21
21
  size?: Exclude<FormElementSize, 'lg'>;
22
22
  open?: boolean;
23
23
  onOpenChange?: (open: boolean) => void;
24
24
  container?: HTMLElement | ShadowRoot | null | React.RefObject<HTMLElement | ShadowRoot | null>;
25
25
  error?: string;
26
26
  };
27
- export declare function Combobox({ options, value, onValueChange, placeholder, searchPlaceholder, emptyText, className, disabled, size, open, onOpenChange, container, error, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
27
+ export declare function Combobox({ options, value, onValueChange, placeholder, searchPlaceholder, emptyText, className, disabled, variant, size, open, onOpenChange, container, error, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
@@ -10,4 +10,5 @@ export declare const Disabled: Story;
10
10
  export declare const CustomEmptyText: Story;
11
11
  export declare const ManyOptions: Story;
12
12
  export declare const Variants: Story;
13
+ export declare const WithDescriptions: Story;
13
14
  export declare const Sizes: Story;
@@ -1,3 +1,4 @@
1
1
  export * from './combobox';
2
2
  export * from './multi-combobox';
3
3
  export { comboboxStyles } from './combobox-styles';
4
+ export { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox';
@@ -26,7 +26,7 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
26
26
  ref?: React.Ref<HTMLInputElement>;
27
27
  } & {
28
28
  asChild?: boolean;
29
- }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
29
+ }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "type"> & {
30
30
  value?: string;
31
31
  onValueChange?: (search: string) => void;
32
32
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  declare const inputVariants: (props?: ({
4
4
  variant?: "default" | "unstyled" | null | undefined;
5
- size?: "default" | "lg" | "sm" | "md" | null | undefined;
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> & {
8
8
  testId?: string;
@@ -10,7 +10,7 @@ export type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size
10
10
  };
11
11
  declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & VariantProps<(props?: ({
12
12
  variant?: "default" | "unstyled" | null | undefined;
13
- size?: "default" | "lg" | "sm" | "md" | null | undefined;
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;
@@ -0,0 +1 @@
1
+ export * from './input-group';
@@ -0,0 +1,44 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import { ButtonProps } from '../Button/Button';
3
+ import { FormElementSize } from '../../primitives/form-element';
4
+ import * as React from 'react';
5
+ export type InputGroupProps = React.ComponentPropsWithoutRef<'div'> & {
6
+ size?: FormElementSize;
7
+ };
8
+ declare const InputGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
9
+ size?: FormElementSize;
10
+ } & React.RefAttributes<HTMLDivElement>>;
11
+ declare const inputGroupAddonVariants: (props?: ({
12
+ align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
13
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
14
+ export type InputGroupAddonProps = React.ComponentPropsWithoutRef<'div'> & VariantProps<typeof inputGroupAddonVariants>;
15
+ declare const InputGroupAddon: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & VariantProps<(props?: ({
16
+ align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
17
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
18
+ export type InputGroupInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> & {
19
+ testId?: string;
20
+ error?: boolean;
21
+ };
22
+ declare const InputGroupInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & {
23
+ testId?: string;
24
+ error?: boolean;
25
+ } & React.RefAttributes<HTMLInputElement>>;
26
+ export type InputGroupTextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {
27
+ testId?: string;
28
+ error?: boolean;
29
+ };
30
+ declare const InputGroupTextarea: React.ForwardRefExoticComponent<React.TextareaHTMLAttributes<HTMLTextAreaElement> & {
31
+ testId?: string;
32
+ error?: boolean;
33
+ } & React.RefAttributes<HTMLTextAreaElement>>;
34
+ export type InputGroupTextProps = React.ComponentPropsWithoutRef<'span'>;
35
+ declare const InputGroupText: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
36
+ export type InputGroupButtonProps = Omit<ButtonProps, 'size' | 'variant'> & {
37
+ size?: ButtonProps['size'];
38
+ variant?: ButtonProps['variant'];
39
+ };
40
+ declare const InputGroupButton: React.ForwardRefExoticComponent<Omit<ButtonProps, "size" | "variant"> & {
41
+ size?: ButtonProps["size"];
42
+ variant?: ButtonProps["variant"];
43
+ } & React.RefAttributes<HTMLButtonElement>>;
44
+ export { InputGroup, InputGroupAddon, InputGroupInput, InputGroupTextarea, InputGroupText, InputGroupButton };
@@ -0,0 +1,17 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { InputGroup } from './input-group';
3
+ declare const meta: Meta<typeof InputGroup>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof InputGroup>;
6
+ export declare const Default: Story;
7
+ export declare const WithInlineStartIcon: Story;
8
+ export declare const WithInlineEndButton: Story;
9
+ export declare const WithLeadingAndTrailing: Story;
10
+ export declare const WithText: Story;
11
+ export declare const WithKbd: Story;
12
+ export declare const BlockStartAddon: Story;
13
+ export declare const BlockEndAddon: Story;
14
+ export declare const Sizes: Story;
15
+ export declare const Disabled: Story;
16
+ export declare const Invalid: Story;
17
+ export declare const Textarea: Story;
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from '../../../../node_modules/@types/react';
1
2
  import { PropertyFilterField, PropertyFilterToken } from './types';
2
3
  export type PropertyFilterAppliedProps = {
3
4
  fields: PropertyFilterField[];
@@ -9,6 +10,15 @@ export type PropertyFilterAppliedProps = {
9
10
  * its input so the user can start typing immediately.
10
11
  */
11
12
  autoFocusFieldId?: string;
13
+ /**
14
+ * Field ids whose pills must remain visible and read-only — value stays
15
+ * displayed but cannot be edited or removed. Use when an upstream context
16
+ * (e.g. agent-scoped traces tab) pre-applies a filter that the user must
17
+ * not be able to clear.
18
+ */
19
+ lockedFieldIds?: readonly string[];
20
+ /** Tooltip content shown on hover/focus of any locked pill. */
21
+ lockedTooltipContent?: ReactNode;
12
22
  };
13
23
  /**
14
24
  * Applied filter pills. Text/id-style tokens render with an always-active
@@ -18,4 +28,4 @@ export type PropertyFilterAppliedProps = {
18
28
  * popover as the Filter Creator so the user can update selections in place.
19
29
  * Creation lives in a separate component (PropertyFilterCreator).
20
30
  */
21
- export declare function PropertyFilterApplied({ fields, tokens, onTokensChange, disabled, autoFocusFieldId, }: PropertyFilterAppliedProps): import("react/jsx-runtime").JSX.Element | null;
31
+ export declare function PropertyFilterApplied({ fields, tokens, onTokensChange, disabled, autoFocusFieldId, lockedFieldIds, lockedTooltipContent, }: PropertyFilterAppliedProps): import("react/jsx-runtime").JSX.Element | null;
@@ -14,6 +14,12 @@ export type PropertyFilterCreatorProps = {
14
14
  * can type the value inline instead of in this popover.
15
15
  */
16
16
  onStartTextFilter?: (fieldId: string) => void;
17
+ /**
18
+ * Field ids hidden from the Add Filter dropdown. Use to prevent users from
19
+ * recreating a filter that an upstream context already owns (e.g. the agent
20
+ * id when viewing the agent-scoped traces tab).
21
+ */
22
+ hiddenFieldIds?: readonly string[];
17
23
  };
18
24
  /**
19
25
  * Minimal Linear-style filter creator: a `+ Filter` button whose popover walks
@@ -23,4 +29,4 @@ export type PropertyFilterCreatorProps = {
23
29
  * separate side popover with checkboxes — each check adds its own applied
24
30
  * filter and the main popover stays open so users can pick many.
25
31
  */
26
- export declare function PropertyFilterCreator({ fields, tokens, onTokensChange, label, disabled, size, onStartTextFilter, }: PropertyFilterCreatorProps): import("react/jsx-runtime").JSX.Element;
32
+ export declare function PropertyFilterCreator({ fields, tokens, onTokensChange, label, disabled, size, onStartTextFilter, hiddenFieldIds, }: PropertyFilterCreatorProps): import("react/jsx-runtime").JSX.Element;
@@ -1,20 +1,41 @@
1
- import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
1
+ import { ScrollArea as ScrollAreaPrimitive } from '@base-ui/react/scroll-area';
2
2
  import * as React from 'react';
3
+ type Orientation = 'vertical' | 'horizontal' | 'both';
4
+ export type MaskSides = {
5
+ top?: boolean;
6
+ bottom?: boolean;
7
+ left?: boolean;
8
+ right?: boolean;
9
+ /** Shorthand: sets both `left` and `right`. Per-side keys override. */
10
+ x?: boolean;
11
+ /** Shorthand: sets both `top` and `bottom`. Per-side keys override. */
12
+ y?: boolean;
13
+ };
14
+ /**
15
+ * - `true` / omitted: fade the edges that match `orientation`.
16
+ * - `false`: no fade.
17
+ * - object: per-side override on top of the orientation default.
18
+ */
19
+ export type ScrollAreaMask = boolean | MaskSides;
3
20
  export type ScrollAreaProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> & {
4
21
  viewPortClassName?: string;
5
22
  maxHeight?: string;
6
23
  autoScroll?: boolean;
7
- orientation?: 'vertical' | 'horizontal' | 'both';
8
- /** Fade content at the edges where it's clipped by overflow. */
24
+ orientation?: Orientation;
25
+ /** Fade content at the edges where it's clipped by overflow. Defaults to the axes matching `orientation`. */
26
+ mask?: ScrollAreaMask;
27
+ /** @deprecated Use `mask` instead. Retained for backward compatibility. */
9
28
  showMask?: boolean;
10
29
  };
11
- declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
30
+ declare const ScrollArea: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react/scroll-area').ScrollAreaRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
12
31
  viewPortClassName?: string;
13
32
  maxHeight?: string;
14
33
  autoScroll?: boolean;
15
- orientation?: "vertical" | "horizontal" | "both";
16
- /** Fade content at the edges where it's clipped by overflow. */
34
+ orientation?: Orientation;
35
+ /** Fade content at the edges where it's clipped by overflow. Defaults to the axes matching `orientation`. */
36
+ mask?: ScrollAreaMask;
37
+ /** @deprecated Use `mask` instead. Retained for backward compatibility. */
17
38
  showMask?: boolean;
18
39
  } & React.RefAttributes<HTMLDivElement>>;
19
- declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
40
+ declare const ScrollBar: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react/scroll-area').ScrollAreaScrollbarProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
20
41
  export { ScrollArea, ScrollBar };
@@ -8,3 +8,7 @@ export declare const WithMaxHeight: Story;
8
8
  export declare const HorizontalScroll: Story;
9
9
  export declare const CodeBlock: Story;
10
10
  export declare const ChatMessages: Story;
11
+ export declare const MaskDisabled: Story;
12
+ export declare const MaskTopOnly: Story;
13
+ export declare const MaskBothAxes: Story;
14
+ export declare const MaskYOnly: Story;