diff --git a/lib/ui/src/modules/ui/components/left_panel/stories.js b/lib/ui/src/modules/ui/components/left_panel/stories.js index b111e5e7e4b..aa1e364d426 100755 --- a/lib/ui/src/modules/ui/components/left_panel/stories.js +++ b/lib/ui/src/modules/ui/components/left_panel/stories.js @@ -1,11 +1,121 @@ -import { Treebeard, theme } from 'react-treebeard'; +import { Treebeard, decorators } from 'react-treebeard'; import PropTypes from 'prop-types'; import React from 'react'; import { isSelectedHierarchy } from '../../libs/hierarchy'; +import { baseFonts } from '../theme'; const hierarchySeparatorColor = '#CCC'; const hierarchySeparatorOffset = '15px'; +const treeStyle = { + tree: { + base: { + listStyle: 'none', + margin: 0, + padding: 0, + fontFamily: baseFonts.fontFamily, + fontSize: '15px', + }, + node: { + base: { + position: 'relative', + }, + link: { + cursor: 'pointer', + position: 'relative', + padding: '0px 5px', + display: 'block', + }, + activeLink: { + fontWeight: 'bold', + backgroundColor: '#EEE', + }, + toggle: { + base: { + position: 'relative', + display: 'inline-block', + verticalAlign: 'top', + marginLeft: '-5px', + height: '24px', + width: '24px', + }, + wrapper: { + position: 'absolute', + top: '50%', + left: '50%', + margin: '-7px 0 0 -7px', + height: '14px', + }, + height: 14, + width: 14, + arrow: { + fill: '#9DA5AB', + strokeWidth: 0, + }, + }, + header: { + base: { + display: 'inline-block', + verticalAlign: 'top', + // color: '#9DA5AB' + }, + connector: { + width: '2px', + height: '12px', + borderLeft: 'solid 2px black', + borderBottom: 'solid 2px black', + position: 'absolute', + top: '0px', + left: '-21px', + }, + title: { + lineHeight: '24px', + verticalAlign: 'middle', + }, + }, + subtree: { + listStyle: 'none', + paddingLeft: '19px', + }, + }, + }, +}; + +function HeaderDecorator(props) { + const { style, node } = props; + + const newStyleTitle = { + ...style.title, + }; + + if (!node.children || !node.children.length) { + newStyleTitle.fontSize = '13px'; + } + + return ( +