Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ const actionsGroupContainer = css({
position: 'absolute',
display: 'flex',
alignItems: 'center',
gap: spacing[2],
gap: spacing[200],
width: '100%',
top: spacing[2] + spacing[1],
paddingLeft: spacing[3],
paddingRight: spacing[3],
top: spacing[300],
paddingLeft: spacing[300],
paddingRight: spacing[300],
pointerEvents: 'none',
});

Expand Down Expand Up @@ -44,6 +44,13 @@ const actionsGroupSignalPopover = css({
display: 'block !important',
});

const expandButton = css({
'& > div:has(svg)': {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does feel brittle, if something changes in how leafygreen orientates their buttons internally this could start looking different. Not sure if there's a better way to do this though, looking at the docs I don't think this is exposed for folks. Looks fine, mostly calling it out in case there's a way anyone else knows of, and also something we can watch out for when updating leafygreen deps.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - I agree this is brittle. I should have made that more obvious in my PR: I've proposed a change to LG to upstream this mongodb/leafygreen-ui#2535.

paddingLeft: 3,
paddingRight: 3,
},
});

function useElementParentHoverState<T extends HTMLElement>(
ref: React.RefObject<T>
): boolean {
Expand Down Expand Up @@ -159,7 +166,7 @@ const DocumentActionsGroup: React.FunctionComponent<
aria-pressed={expanded}
data-testid="expand-document-button"
onClick={onExpand}
className={actionsGroupItem}
className={cx(actionsGroupItem, expandButton)}
tooltipText={expanded ? 'Collapse all' : 'Expand all'}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ const expandButton = css({

const hadronElement = css({
display: 'flex',
paddingLeft: spacing[2],
paddingRight: spacing[2],
paddingLeft: spacing[50],
paddingRight: spacing[50],
marginTop: 1,
});

Expand Down Expand Up @@ -239,7 +239,7 @@ const elementRemovedDarkMode = css({

const elementActions = css({
flex: 'none',
width: spacing[3],
width: spacing[300],
position: 'relative',
});

Expand Down Expand Up @@ -364,7 +364,7 @@ const elementKeyDarkMode = css({
});

const calculateElementSpacerWidth = (editable: boolean, level: number) => {
return (editable ? spacing[200] : 0) + spacing[400] * level;
return (editable ? spacing[100] : 0) + spacing[400] * level;
};

export const calculateShowMoreToggleOffset = ({
Expand All @@ -377,10 +377,10 @@ export const calculateShowMoreToggleOffset = ({
alignWithNestedExpandIcon: boolean;
}) => {
// the base padding that we have on all elements rendered in the document
const BASE_PADDING_LEFT = spacing[200];
const BASE_PADDING_LEFT = spacing[50];
const OFFSET_WHEN_EDITABLE = editable
? // space taken by element actions
spacing[400] +
spacing[300] +
// space and margin taken by line number element
spacing[400] +
spacing[100] +
Expand Down
Loading