Skip to content

Commit 88c8fdd

Browse files
var-porodpellier
authored andcommitted
docs(tree-view): add story for default expanded value in technical information
1 parent 7c2d979 commit 88c8fdd

File tree

6 files changed

+15
-960
lines changed

6 files changed

+15
-960
lines changed

packages/ods-react/src/components/tree-view/src/components/tree-view-node-branch/TreeViewNodeBranch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const TreeViewNodeBranch: FC<TreeViewNodeBranchProp> = forwardRef(({
6464
aria-disabled={ isDisabled }
6565
className={ style['tree-view-node-branch__control'] }
6666
data-disabled={ isDisabled ? true : undefined }
67-
role="checkbox"
67+
role={ multiple ? 'checkbox' : 'group' }
6868
tabIndex={ isDisabled ? -1 : undefined }>
6969
<VendorTreeView.BranchIndicator className={ style['tree-view-node-branch__control__chevron'] }>
7070
<Icon name={ ICON_NAME.chevronRight } />

packages/ods-react/src/components/tree-view/src/components/tree-view-node/TreeViewNode.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@ import { TreeViewNodeBranch } from '../tree-view-node-branch/TreeViewNodeBranch'
55
import { TreeViewNodeItem } from '../tree-view-node-item/TreeViewNodeItem';
66

77
interface TreeViewNodeProp extends Omit<ComponentPropsWithRef<'div'>, 'children'> {
8+
/**
9+
* Label content or custom render function.
10+
*/
811
children?: ReactNode | ((arg: TreeViewCustomRendererArg) => ReactNode);
12+
/** @internal **/
913
indexPath?: number[];
14+
/**
15+
* The tree node to render.
16+
*/
1017
item: TreeViewItem;
1118
}
1219

packages/storybook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"start": "yarn generate:versions && storybook dev -p 6006 --no-open"
1212
},
1313
"dependencies": {
14-
"@ark-ui/react": "5.19.0",
14+
"@ark-ui/react": "5.25.0",
1515
"@ovhcloud/ods-react": "19.1.0",
1616
"@ovhcloud/ods-themes": "19.1.0",
1717
"classnames": "2.5.1",

packages/storybook/stories/components/tree-view/documentation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ import { REACT_COMPONENTS_TITLE, STORY } from '../../../src/constants/meta';
1616

1717
<Heading label="Overview" level={ 2 } />
1818

19-
The **Tree View** component displays hierarchical data in a parent-child structure. It allows users to expand, collapse, and interact with nested items.
2019
<IdentityCard aliases={ [] }
2120
figmaLink="https://www.figma.com/design/9jDDTcR4a9jPRFcdjawAlf/branch/8NZfqeptysMQInF02WaIJR"
2221
githubUrl="https://github.com/ovh/design-system/tree/master/packages/ods-react/src/components/tree-view"
2322
name="Tree View"
2423
startingVersion={ 19 }>
24+
The **Tree View** component displays hierarchical data in a parent-child structure. It allows users to expand, collapse, and interact with nested items.
2525
</IdentityCard>
2626

2727
<Heading label="Anatomy" level={ 2 } />

packages/storybook/stories/components/tree-view/technical-information.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ import * as TreeViewStories from './tree-view.stories';
4242

4343
<OdsCanvas of={ TreeViewStories.CustomRender } sourceState="shown" />
4444

45+
<Heading label="Default expanded" level={ 3 } />
46+
47+
<OdsCanvas of={ TreeViewStories.DefaultExpandedValue } sourceState="shown" />
48+
4549
<Heading label="Controlled" level={ 3 } />
4650

4751
<OdsCanvas of={ TreeViewStories.Controlled } sourceState="shown" />

0 commit comments

Comments
 (0)