@pstdio/ui 0.10.0 → 0.11.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.
@@ -1,7 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ChatInputQuestionPrompt, ChatInputQuestionResponse } from './chat-input-question-prompt';
3
3
  import { SessionMessage } from './message-types';
4
+ /** Full conversation shell for agent sessions, including messages, input, attachments, and host-provided slots. */
4
5
  interface ChatPanelProps {
6
+ /** Stable conversation identity used to reset ready state when switching sessions. */
5
7
  conversationKey?: string;
6
8
  messages: SessionMessage[];
7
9
  loading?: boolean;
@@ -15,12 +17,14 @@ interface ChatPanelProps {
15
17
  onSubmitMessage?: (text: string, attachments: string[], questionResponse?: ChatInputQuestionResponse) => void;
16
18
  onInterrupt?: () => void;
17
19
  onChatInputChange?: (text: string) => void;
20
+ /** Extra controls rendered near the chat input. */
18
21
  actions?: ReactNode;
19
22
  repoMenu?: ReactNode;
20
23
  attachedResources?: string[];
21
24
  onClearAttachments?: () => void;
22
25
  attachmentList?: ReactNode;
23
26
  approvalPrompt?: ReactNode;
27
+ /** Optional workspace status/control surface rendered above the conversation viewport. */
24
28
  workspaceHub?: ReactNode;
25
29
  workspaceInitializing?: boolean;
26
30
  inputDisabled?: boolean;
@@ -6,6 +6,7 @@ interface DataRendererContentProps {
6
6
  viewMode: DataRendererSettings["viewMode"];
7
7
  boardColumns: DataRendererBoardColumn[];
8
8
  listItems: DataRendererListItem[];
9
+ listExpandedGroups: Record<string, boolean>;
9
10
  selectedRowId: string | null;
10
11
  emptyState?: ReactNode;
11
12
  emptyTitle: string;
@@ -14,6 +15,7 @@ interface DataRendererContentProps {
14
15
  onBoardMoveToGroup: (rowId: string, targetGroupKey: string) => void;
15
16
  onCreateRow?: (columnId: string) => void;
16
17
  onColumnAction?: (columnId: string, actionId: string) => Promise<void> | void;
18
+ onListExpandedGroupChange: (rowId: string, isExpanded: boolean) => void;
17
19
  listKey: string;
18
20
  }
19
21
  export declare const DataRendererContent: (props: DataRendererContentProps) => import("react/jsx-runtime").JSX.Element;
@@ -20,7 +20,9 @@ export interface AttributeBadge {
20
20
  attributeId: string;
21
21
  label: string;
22
22
  color?: string;
23
+ icon?: string | null;
23
24
  }
25
+ export declare const getAttributeBadgeColorPalette: (_badge: AttributeBadge) => string;
24
26
  /**
25
27
  * Per-type default cell summary used by the card / list end-content. Returns
26
28
  * null when the attribute has no displayable value.
@@ -18,12 +18,14 @@ export interface DataRendererListItem {
18
18
  draggable?: boolean;
19
19
  onDropRow?: (rowId: string) => void;
20
20
  }
21
- interface DataRendererListProps {
21
+ export type DataRendererListExpandedState = Record<string, boolean>;
22
+ export interface DataRendererListProps {
22
23
  items: DataRendererListItem[];
23
24
  selectedItemId?: string | null;
25
+ expandedGroups?: DataRendererListExpandedState;
24
26
  onItemClick?: (item: DataRendererListItem) => void;
27
+ onExpandedGroupChange?: (rowId: string, isExpanded: boolean) => void;
25
28
  }
26
- type DataRendererListExpandedState = true | Record<string, boolean>;
27
29
  interface FlattenedDataRendererListItem {
28
30
  id: string;
29
31
  item: DataRendererListItem;
@@ -2,16 +2,22 @@ import { ReactNode } from 'react';
2
2
  import { ResourceContextAction } from '../resource-context-menu';
3
3
  import { DataRendererBoardColumnAction } from './data-renderer-board';
4
4
  import { AttributeDescriptor, DataRendererFilterState, DataRendererRow, DataRendererSettings } from './types';
5
+ /** Board-column behavior and menu configuration for a resolved column group. */
5
6
  export interface BoardColumnConfig {
7
+ /** Chakra color palette used for the column header and group badges. */
6
8
  color?: string;
7
9
  canDragIn?: boolean;
8
10
  canDragOut?: boolean;
9
11
  canCreate?: boolean;
10
12
  actions?: DataRendererBoardColumnAction[];
11
13
  }
14
+ /** Switchable list/board renderer for rows with typed attributes, filtering, grouping, and ordering. */
12
15
  export interface DataRendererProps<TRow extends DataRendererRow = DataRendererRow> {
16
+ /** Stable rows to render. Each row must have an id, title, and attributes map. */
13
17
  rows: TRow[];
18
+ /** Persistent key used by the renderer store for view, filter, grouping, ordering, and list expansion settings. */
14
19
  storageKey: string;
20
+ /** Attribute descriptors that define display, filtering, grouping, ordering, and board columns. */
15
21
  attributes: AttributeDescriptor[];
16
22
  selectedRowId?: string | null;
17
23
  emptyState?: ReactNode;
@@ -22,7 +28,9 @@ export interface DataRendererProps<TRow extends DataRendererRow = DataRendererRo
22
28
  hideToolbar?: boolean;
23
29
  toolbarLeading?: ReactNode;
24
30
  onRowClick?: (row: TRow) => void;
31
+ /** Called when a row attribute changes through drag/drop, board movement, or inline controls. */
25
32
  onAttributeChange?: (rowId: string, attributeId: string, value: unknown) => void;
33
+ /** Called for manual row ordering when a dragged row is dropped before another row. */
26
34
  onReorder?: (rowId: string, beforeRowId?: string) => void;
27
35
  onCreateRow?: (columnId: string) => void;
28
36
  onColumnAction?: (columnId: string, actionId: string) => Promise<void> | void;
@@ -2,10 +2,12 @@ import { DataRendererFilterState, DataRendererSettings } from './types';
2
2
  interface DataRendererSnapshot {
3
3
  settings: DataRendererSettings;
4
4
  filters: DataRendererFilterState;
5
+ expandedGroups: Record<string, boolean>;
5
6
  }
6
7
  interface DataRendererStoreInitialState {
7
8
  settings?: Partial<DataRendererSettings>;
8
9
  filters?: DataRendererFilterState;
10
+ expandedGroups?: Record<string, boolean>;
9
11
  }
10
12
  interface DataRendererState extends DataRendererSnapshot {
11
13
  setViewMode: (viewMode: DataRendererSettings["viewMode"]) => void;
@@ -20,6 +22,7 @@ interface DataRendererState extends DataRendererSnapshot {
20
22
  toggleFilterValue: (attributeId: string, value: string) => void;
21
23
  clearFilter: (attributeId: string) => void;
22
24
  clearAllFilters: () => void;
25
+ setExpandedGroup: (groupId: string, isExpanded: boolean) => void;
23
26
  reset: () => void;
24
27
  }
25
28
  interface CreateDataRendererStoreOptions {
@@ -1,8 +1,12 @@
1
1
  import { EmptyState as ChakraEmptyState } from '@chakra-ui/react';
2
2
  import * as React from "react";
3
+ /** Centered empty-state message with optional icon, description, and follow-up actions. */
3
4
  export interface EmptyStateProps extends ChakraEmptyState.RootProps {
5
+ /** Primary empty-state message. */
4
6
  title: string;
7
+ /** Supporting explanation shown below the title. */
5
8
  description?: string;
9
+ /** Decorative or semantic icon shown above the message. */
6
10
  icon?: React.ReactNode;
7
11
  }
8
12
  export declare const EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
@@ -4,10 +4,12 @@ export interface ListRowNavigationIntent {
4
4
  id?: string;
5
5
  payload?: unknown;
6
6
  }
7
+ /** Context passed to row-level actions so hosts know which section or node triggered the action. */
7
8
  export interface ListRowActionContext {
8
9
  sectionId?: string;
9
10
  nodeId?: string;
10
11
  }
12
+ /** Menu item used by row overflow menus and context menus. */
11
13
  export interface ListRowActionMenuItem {
12
14
  id: string;
13
15
  label: string;
@@ -21,6 +23,7 @@ export interface ListRowActionMenuItem {
21
23
  endContent?: ReactNode;
22
24
  onAction?: () => void;
23
25
  }
26
+ /** Inline action rendered on a row, optionally backed by a menu. */
24
27
  export interface ListRowAction {
25
28
  id: string;
26
29
  label: string;
@@ -35,6 +38,7 @@ export interface ListRowAction {
35
38
  export type ListRowVariant = "default" | "compact" | "tree";
36
39
  export type ListRowTone = "default" | "danger";
37
40
  export type ListRowMenuPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "right" | "right-start" | "right-end" | "left" | "left-start" | "left-end";
41
+ /** Data model for one reusable row, including labels, icons, menus, actions, and children. */
38
42
  export interface ListRowItem {
39
43
  id?: string;
40
44
  label: ReactNode;
@@ -65,10 +69,14 @@ export interface ListRowItem {
65
69
  children?: ListRowItem[];
66
70
  }
67
71
  type ListRowRootProps = ComponentPropsWithoutRef<typeof chakra.div>;
72
+ /** Props for the row surface used by lists, trees, menus, and dense navigation UIs. */
68
73
  export interface ListRowProps extends ListRowItem, Omit<ListRowRootProps, "as" | "asChild" | "children" | "draggable" | "onClick" | "onDragEnd" | "onDragOver" | "onDragStart" | "onDrop" | "onPointerMove" | keyof ListRowItem> {
69
74
  depth?: number;
75
+ /** Applies selected styling without owning selection state. */
70
76
  isSelected?: boolean;
77
+ /** Controls child expansion styling and chevron state. */
71
78
  isExpanded?: boolean;
79
+ /** Forces the expand affordance when children are lazy-loaded or externally controlled. */
72
80
  showExpandToggle?: boolean;
73
81
  variant?: ListRowVariant;
74
82
  tone?: ListRowTone;
@@ -0,0 +1,8 @@
1
+ import { BoxProps } from '@chakra-ui/react';
2
+ import { ReactNode } from 'react';
3
+ interface ParamEditorReadOnlyValueProps extends Omit<BoxProps, "children"> {
4
+ children: ReactNode;
5
+ preserveWhitespace?: boolean;
6
+ }
7
+ export declare const ParamEditorReadOnlyValue: (props: ParamEditorReadOnlyValueProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -15,6 +15,8 @@ interface ResourceContextMenuProps {
15
15
  contentMinWidth?: string;
16
16
  contentBackground?: string;
17
17
  positioning?: MenuRootProps["positioning"];
18
+ /** Keep the menu open after selecting an item — useful for menus that toggle several entries in one pass. */
19
+ closeOnSelect?: MenuRootProps["closeOnSelect"];
18
20
  }
19
21
  export declare const ResourceContextMenu: (props: ResourceContextMenuProps) => import("react/jsx-runtime").JSX.Element;
20
22
  export {};
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { ResourceContextAction } from '../resource-context-menu';
2
3
  import { TreeListLinkComponent, TreeListNavigateEvent, TreeListSection } from '../tree-list/tree-list.types';
3
4
  export interface SidebarProps {
4
5
  storageKey: string;
@@ -6,6 +7,8 @@ export interface SidebarProps {
6
7
  activeNodeId?: string | string[] | null;
7
8
  header?: ReactNode;
8
9
  footer?: ReactNode;
10
+ /** Right-click menu for the empty back area of the tree. Passed straight through to the internal TreeList. */
11
+ backgroundContextActions?: ResourceContextAction[];
9
12
  /** Initial width when resizable. Set explicitly to override the persisted width. */
10
13
  width?: string | number;
11
14
  emptyLabel?: string;
@@ -1,4 +1,3 @@
1
- import { QueryKey } from '@tanstack/react-query';
2
1
  import { TagEditorProps, TagEditorValue } from './tag-editor.types';
3
2
  export interface SaveTagSettingsInput<TValue> {
4
3
  deletedIds: Set<string>;
@@ -10,15 +9,20 @@ type SortableValue = {
10
9
  id: string;
11
10
  sortOrder: number;
12
11
  };
13
- export interface TagSettingsPanelProps<TValue extends SortableValue, TSource> extends EditorLabels {
12
+ export interface TagSettingsPanelProps<TValue extends SortableValue> extends EditorLabels {
14
13
  errorTitle: string;
15
14
  loadingText?: string;
16
- queryKey: QueryKey;
17
- readValues: (source: TSource) => Promise<TValue[]>;
18
- saveValues: (source: TSource, input: SaveTagSettingsInput<TValue>) => Promise<void>;
19
- source: TSource;
15
+ /** Loaded values; pass undefined while the initial load is pending. */
16
+ values: TValue[] | undefined;
17
+ /** Load/save error surfaced by the host's data layer. */
18
+ loadError?: unknown;
19
+ /**
20
+ * Persists the pending edits. The host owns fetching and cache invalidation;
21
+ * the panel resets its delete tracking once the returned promise resolves.
22
+ */
23
+ onSave: (input: SaveTagSettingsInput<TValue>) => Promise<void>;
20
24
  toEditorValue: (value: TValue) => TagEditorValue;
21
25
  valueNeedsUpdate: (original: TValue, draft: TagEditorValue) => boolean;
22
26
  }
23
- export declare const TagSettingsPanel: <TValue extends SortableValue, TSource>(props: TagSettingsPanelProps<TValue, TSource>) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const TagSettingsPanel: <TValue extends SortableValue>(props: TagSettingsPanelProps<TValue>) => import("react/jsx-runtime").JSX.Element;
24
28
  export {};
@@ -1,25 +1,36 @@
1
1
  import { StackProps } from '@chakra-ui/react';
2
2
  import { MouseEvent as ReactMouseEvent, RefObject } from 'react';
3
+ import { ResourceContextAction } from '../resource-context-menu';
3
4
  import { TreeListLinkComponent, TreeListNavigateEvent, TreeListSection } from './tree-list.types';
4
5
  export { buildVirtualRows } from './tree-list-model';
5
6
  type TreeListRowVariant = "compact" | "tree";
7
+ /** Sectioned hierarchical list for files, resources, navigation, and customizable sidebars. */
6
8
  interface TreeListProps {
9
+ /** Ordered sections to render, each containing nested tree nodes. */
7
10
  sections: TreeListSection[];
11
+ /** Controlled section ids that are currently expanded. */
8
12
  expandedSectionIds?: string[];
13
+ /** Controlled node ids that are currently expanded. */
9
14
  expandedNodeIds?: string[];
15
+ /** Active node id, or ids, used for selection styling. */
10
16
  activeNodeId?: string | string[] | null;
17
+ /** Compact rows suit app navigation; tree rows suit file/resource hierarchies. */
11
18
  rowVariant?: TreeListRowVariant;
12
19
  sectionGap?: StackProps["gap"];
13
20
  nodeGap?: StackProps["gap"];
21
+ /** Link renderer used when nodes provide `href`. */
14
22
  linkComponent?: TreeListLinkComponent;
23
+ /** Called when a navigable node is activated. */
15
24
  onNavigate?: (event: TreeListNavigateEvent) => void;
16
25
  onToggleSection?: (sectionId: string) => void;
17
26
  onToggleNode?: (nodeId: string) => void;
18
27
  onSectionContextMenu?: (event: ReactMouseEvent<HTMLElement>, sectionId: string) => void;
28
+ /** Render large trees with virtual rows. Disable when using drag ordering. */
19
29
  virtualize?: boolean;
20
30
  scrollRef?: RefObject<HTMLDivElement | null>;
21
31
  draggable?: boolean;
22
32
  onReorderSections?: (nextSectionIds: string[]) => void;
23
33
  onReorderNodes?: (sectionId: string, nextNodeIds: string[]) => void;
34
+ backgroundContextActions?: ResourceContextAction[];
24
35
  }
25
36
  export declare const TreeList: (props: TreeListProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,11 +4,15 @@ export type TreeListNavigationIntent = ListRowNavigationIntent;
4
4
  export type TreeListActionContext = ListRowActionContext;
5
5
  export type TreeListActionMenuItem = ListRowActionMenuItem;
6
6
  export type TreeListAction = ListRowAction;
7
+ /** Tree node data rendered by `TreeList`; extends the row API used by `ListRow`. */
7
8
  export type TreeListNode = ListRowItem & {
8
9
  id: string;
9
10
  children?: TreeListNode[];
10
11
  hiddenByDefault?: boolean;
12
+ /** When false, the node cannot be hidden from a tree-customization menu (rendered as a disabled, checked row). */
13
+ canHide?: boolean;
11
14
  };
15
+ /** Top-level tree section with optional header, actions, empty state, and child nodes. */
12
16
  export interface TreeListSection {
13
17
  id: string;
14
18
  label?: string;
@@ -18,12 +22,14 @@ export interface TreeListSection {
18
22
  nodes: TreeListNode[];
19
23
  hiddenByDefault?: boolean;
20
24
  }
25
+ /** Navigation payload emitted when a navigable tree node is activated. */
21
26
  export interface TreeListNavigateEvent {
22
27
  sectionId: string;
23
28
  nodeId: string;
24
29
  node: TreeListNode;
25
30
  intent?: TreeListNavigationIntent;
26
31
  }
32
+ /** Props passed to the host-provided tree link component. */
27
33
  export interface TreeListLinkProps {
28
34
  to: string;
29
35
  children: ReactNode;
package/dist/index.d.ts CHANGED
@@ -46,7 +46,6 @@ export type { IntegrationCardProps } from './components/integration-card';
46
46
  export { IntegrationCard } from './components/integration-card';
47
47
  export type { ItemSectionProps } from './components/item-section';
48
48
  export { ItemSection } from './components/item-section';
49
- export { PanelLayout, PanelSectionLayout } from './components/layout';
50
49
  export { ListRow } from './components/list-row/list-row';
51
50
  export type { ListRowAction, ListRowActionContext, ListRowActionMenuItem, ListRowItem, ListRowNavigationIntent, } from './components/list-row/list-row.types';
52
51
  export type { OpenSourceNotice, OpenSourceNoticesScreenProps, } from './components/open-source-notices-screen';