diff --git a/.changeset/heavy-pets-own.md b/.changeset/heavy-pets-own.md new file mode 100644 index 00000000000..2c8beda7e23 --- /dev/null +++ b/.changeset/heavy-pets-own.md @@ -0,0 +1,5 @@ +--- +"@primer/react": patch +--- + +Adds lines to indicate the depth of items in a TreeView diff --git a/src/TreeView/TreeView.tsx b/src/TreeView/TreeView.tsx index 4c1c7c97839..f0ff0c69bb1 100644 --- a/src/TreeView/TreeView.tsx +++ b/src/TreeView/TreeView.tsx @@ -339,7 +339,6 @@ const Item: React.FC = ({ color: 'fg.default', borderRadius: 2, cursor: 'pointer', - transition: 'background 33.333ms linear', '&:hover': { backgroundColor: 'actionListItem.default.hoverBg' }, @@ -361,6 +360,9 @@ const Item: React.FC = ({ } }} > + + + {hasSubTree ? ( { @@ -405,6 +407,39 @@ const Item: React.FC = ({ ) } +/** Lines to indicate the depth of an item in a TreeView */ +const LevelIndicatorLines: React.FC<{level: number}> = ({level}) => { + return ( + + {Array.from({length: level - 1}).map((_, index) => ( + + ))} + + ) +} + // ---------------------------------------------------------------------------- // TreeView.LinkItem