import { Meta, StoryObj } from '@storybook/react-vite'; import { FlatTreeItem, LazyTreeItem, NestedTreeItem } from './fixtures'; import { Tree } from './Tree'; import { TreeItemKey } from './useTreeState'; declare const meta: Meta; export default meta; type Story = StoryObj>; /** * Basic tree component with nested items. No selection or drag & drop enabled. * This is the simplest usage of the Tree component. */ export declare const Basic: Story; /** * Tree with deeply nested items (30 levels). Tests the component's ability to handle * extreme nesting depth. Each level contains a single item nested within the previous one. */ export declare const DeeplyNested: Story; /** * Tree with uncontrolled selection state. The tree manages its own selection internally. * Use `defaultValue` to set initial selection and `onChange` to listen for changes. */ export declare const SelectionUncontrolled: Story; /** * Tree with controlled selection state. The parent component controls which items are selected. * Use `value` and `onChange` to fully control the selection state. */ export declare const SelectionControlled: Story; /** * Tree with 'children' selection scope. When you select a node, all its descendants are automatically selected. * This is useful for hierarchical data where selecting a parent implies selecting all children. */ export declare const SelectionScopeChildren: Story; /** * Tree with 'parents' selection scope. When you select a node, all its ancestors are automatically selected. * This is useful when child selection implies parent selection. */ export declare const SelectionScopeParents: Story; /** * Tree with uncontrolled expanded state. The tree manages which nodes are expanded internally. * Use `defaultExpandedValues` to set initial expanded nodes and `onExpandedChange` to listen for changes. */ export declare const ExpansionUncontrolled: Story; /** * Tree with controlled expanded state. The parent component controls which nodes are expanded. * Use `expandedValues` and `onExpandedChange` to fully control the expansion state. * This example shows how to implement "Expand All" and "Collapse All" functionality. */ export declare const ExpansionControlled: Story; /** * Tree with custom action buttons for each item. Use the `renderItem` prop to customize * the appearance of tree items and add custom actions like edit, delete, or create. */ export declare const CustomActions: Story; /** * Tree with a large dataset (2500 items). This demonstrates the component's performance * with many nested items. The tree does not use virtualization. */ export declare const CustomActionsLargeDataset: Story; /** * Tree with lazy loading in uncontrolled mode. Children are loaded on demand when a node is expanded. * Use `onLoadChildren` to load data asynchronously when needed. */ export declare const LazyLoadingUncontrolled: Story; /** * Tree that loads entire subtrees at once. When a node is expanded, all its descendants * are loaded recursively in a single operation. Useful when you want to load complete * branches instead of one level at a time. */ export declare const LazyLoadingSubtree: Story; /** * Tree with lazy loading in controlled mode. The parent component manages the tree state * and manually updates it when children are loaded. This gives you full control over the * loading process and tree structure. */ export declare const LazyLoadingControlled: Story; /** * Combines lazy loading with 'children' selection scope. When selecting a node, * all its descendants are loaded (if needed) and selected automatically. */ export declare const LazyLoadingWithSelection: Story; /** * Tree with drag & drop in uncontrolled mode. Users can reorder items by dragging them. * The tree manages its own state and notifies you of changes via `onMove`. */ export declare const DragAndDropUncontrolled: Story; /** * Tree with drag & drop in controlled mode. The parent component receives the new tree structure * when items are reordered and can update its state accordingly. This gives you full control * over the drag & drop behavior and allows validation before accepting changes. */ export declare const DragAndDropControlled: Story; /** * Tree with flat data structure and drag & drop. Demonstrates working with denormalized data * where items reference their parent via `parentId` instead of nesting children. * The tree automatically builds the hierarchy from flat data. */ export declare const DragAndDropFlatData: Story; /** * Controlled drag & drop with flat data structure. Converts between the tree's nested structure * and your flat data format. This example shows how to maintain a flat data structure while * using the tree component's drag & drop functionality. */ export declare const DragAndDropFlatDataControlled: Story; /** * Combines lazy loading with drag & drop in uncontrolled mode. Children are loaded on demand * and users can reorder items. This is useful for large trees where you don't want to load * all data upfront but still need drag & drop functionality. */ export declare const DragAndDropWithLazyLoading: Story; /** * Combines lazy loading with drag & drop in controlled mode. Gives you full control over * both the loading process and drag & drop operations. This is the most flexible setup * for complex applications that need validation and custom behavior. */ export declare const DragAndDropWithLazyLoadingControlled: Story;