import * as React from 'react'; import type { Meta, StoryObj } from '@storybook/react-vite'; import { TreeSelect } from './tree-select'; import { Label } from '../label/label'; const treeData = [ { value: 'eng', title: 'Engineering', children: [ { value: 'frontend', title: 'Frontend' }, { value: 'backend', title: 'Backend' }, { value: 'platform', title: 'Platform' }, ], }, { value: 'design', title: 'Design', children: [ { value: 'product-design', title: 'Product design' }, { value: 'brand', title: 'Brand' }, ], }, { value: 'ops', title: 'Operations' }, ]; const meta = { title: 'Components/TreeSelect', component: TreeSelect, parameters: { layout: 'centered', docs: { description: { component: 'Select whose options are a tree — categories, org units, folder paths. Combobox flattens its options, which loses the parent/child relationship that makes a taxonomy navigable. This keeps the hierarchy, and with `treeCheckable` adds branches whose checked state propagates both ways.', }, }, }, tags: ['autodocs'], args: { treeData, placeholder: 'Pick a team', treeDefaultExpandAll: true }, decorators: [(Story) =>
Value: {value.length ? value.join(', ') : '—'}