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
14 changes: 2 additions & 12 deletions code/addons/docs/src/blocks/components/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const ChildrenContainer = styled.div<PreviewProps & { layout: Layout }>(
flexWrap: 'wrap',
overflow: 'auto',
flexDirection: isColumn ? 'column' : 'row',
width: 'fit-content',

'& .innerZoomElementWrapper > *': isColumn
? {
Expand Down Expand Up @@ -173,18 +172,9 @@ const PositionedToolbar = styled(Toolbar)({
height: 40,
});

const Relative = styled.div(({ theme }) => ({
const Relative = styled.div({
overflow: 'hidden',
position: 'relative',
display: 'flex',
flexWrap: 'wrap',
gap: theme.layoutMargin,
}));

const RelativeActionBar = styled(ActionBar)({
position: 'relative',
marginLeft: 'auto',
alignSelf: 'flex-end',
});

/**
Expand Down Expand Up @@ -288,7 +278,7 @@ export const Preview: FC<PreviewProps> = ({
)}
</Zoom.Element>
</ChildrenContainer>
<RelativeActionBar actionItems={actionItems} />
<ActionBar actionItems={actionItems} />
</Relative>
</ZoomContext.Provider>
{withSource && expanded && source}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ const Wrapper = styled.div<WrapperProps>(
({ theme }) => ({
position: 'relative',
overflow: 'hidden',
display: 'flex',
flexWrap: 'wrap',
gap: theme.layoutMargin,
color: theme.color.defaultText,
}),
({ theme, bordered }) =>
Expand Down Expand Up @@ -101,16 +98,6 @@ const UnstyledScroller = ({ children, className }: ScrollAreaProps) => (
const Scroller = styled(UnstyledScroller)(
{
position: 'relative',
width: 'fit-content',
maxWidth: '100%',
'> div': {
width: 'fit-content',
maxWidth: '100%',
'> div > pre': {
width: 'fit-content',
maxWidth: '100%',
},
},
},
({ theme }) => themedSyntax(theme)
);
Expand All @@ -133,16 +120,11 @@ See https://github.com/storybookjs/storybook/issues/18090
const Code = styled.div(({ theme }) => ({
flex: 1,
paddingLeft: 2, // TODO: To match theming/global.ts for now
paddingRight: theme.layoutMargin,
opacity: 1,
fontFamily: theme.typography.fonts.mono,
}));

const RelativeActionBar = styled(ActionBar)({
position: 'relative',
marginLeft: 'auto',
alignSelf: 'flex-end',
});

const processLineNumber = (row: any) => {
const children = [...row.children];
const lineNumberNode = children[0];
Expand Down Expand Up @@ -265,7 +247,7 @@ export const SyntaxHighlighter = ({
</Scroller>

{copyable ? (
<RelativeActionBar actionItems={[{ title: copied ? 'Copied' : 'Copy', onClick }]} />
<ActionBar actionItems={[{ title: copied ? 'Copied' : 'Copy', onClick }]} />
) : null}
</Wrapper>
);
Expand Down
Loading