fix(ui): collapse plugin header spacing before headers
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
This commit is contained in:
@@ -60,6 +60,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "workspace:^",
|
||||
"@backstage/core-components": "workspace:^",
|
||||
"@storybook/react-vite": "^10.3.3",
|
||||
"@testing-library/jest-dom": "^6.0.0",
|
||||
"@testing-library/react": "^16.0.0",
|
||||
|
||||
@@ -18,18 +18,29 @@
|
||||
|
||||
@layer components {
|
||||
.bui-PluginHeader {
|
||||
margin-bottom: var(--bui-space-6);
|
||||
--bui-plugin-header-margin-bottom: var(--bui-space-6);
|
||||
--bui-plugin-header-toolbar-border-bottom: solid 1px var(--bui-border-1);
|
||||
--bui-plugin-header-tabs-border-bottom: 1px solid var(--bui-border-1);
|
||||
|
||||
margin-bottom: var(--bui-plugin-header-margin-bottom);
|
||||
padding-inline: var(--bui-space-5);
|
||||
margin-top: var(--bui-space-4);
|
||||
}
|
||||
|
||||
.bui-PluginHeader:has(+ .bui-HeaderTop),
|
||||
.bui-PluginHeader:has(+ [data-backstage-core-header]) {
|
||||
--bui-plugin-header-margin-bottom: 0;
|
||||
--bui-plugin-header-toolbar-border-bottom: none;
|
||||
--bui-plugin-header-tabs-border-bottom: none;
|
||||
}
|
||||
|
||||
.bui-PluginHeaderToolbar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
color: var(--bui-fg-primary);
|
||||
border-bottom: solid 1px var(--bui-border-1);
|
||||
border-bottom: var(--bui-plugin-header-toolbar-border-bottom);
|
||||
padding-bottom: var(--bui-space-4);
|
||||
|
||||
&[data-has-tabs] {
|
||||
@@ -79,6 +90,6 @@
|
||||
}
|
||||
|
||||
.bui-PluginHeaderTabsWrapper {
|
||||
border-bottom: 1px solid var(--bui-border-1);
|
||||
border-bottom: var(--bui-plugin-header-tabs-border-bottom);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import preview from '../../../../.storybook/preview';
|
||||
import { Header as CoreHeader } from '@backstage/core-components';
|
||||
import type { StoryFn } from '@storybook/react-vite';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { BUIProvider } from '../provider';
|
||||
@@ -137,6 +138,40 @@ export const SimpleHeader = meta.story({
|
||||
),
|
||||
});
|
||||
|
||||
export const CoreComponentsHeader = meta.story({
|
||||
decorators: [withLayout],
|
||||
render: () => (
|
||||
<>
|
||||
<PluginHeader icon={<RiCodeSSlashLine />} title="APIs" />
|
||||
<CoreHeader title="payments-api" />
|
||||
<PageContent />
|
||||
</>
|
||||
),
|
||||
});
|
||||
|
||||
export const CoreComponentsHeaderWithTabs = meta.story({
|
||||
decorators: [withLayout],
|
||||
render: () => (
|
||||
<>
|
||||
<PluginHeader
|
||||
icon={<RiCodeSSlashLine />}
|
||||
title="APIs"
|
||||
tabs={[
|
||||
{ id: 'overview', label: 'Overview', href: '/apis' },
|
||||
{
|
||||
id: 'definitions',
|
||||
label: 'Definitions',
|
||||
href: '/apis/definitions',
|
||||
},
|
||||
{ id: 'consumers', label: 'Consumers', href: '/apis/consumers' },
|
||||
]}
|
||||
/>
|
||||
<CoreHeader title="payments-api" />
|
||||
<PageContent />
|
||||
</>
|
||||
),
|
||||
});
|
||||
|
||||
export const WithTabs = meta.story({
|
||||
decorators: [withLayout],
|
||||
render: () => (
|
||||
|
||||
Reference in New Issue
Block a user