Merge pull request #24616 from NitinRamnani/chores/stories/nr-2

Added stories for multiple components
This commit is contained in:
Patrik Oldsberg
2024-05-06 14:42:16 +02:00
committed by GitHub
3 changed files with 130 additions and 0 deletions
@@ -0,0 +1,50 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { Content } from './Content';
export default {
title: 'Layout/Content',
component: Content,
};
type Props = {
stretch?: boolean;
noPadding?: boolean;
className?: string;
};
export const Default = (args: Props) => (
<Content {...args}>
<div>This is child of content component</div>
</Content>
);
Default.args = {
stretch: false,
noPadding: false,
};
export const WithNoPadding = (args: Props) => (
<Content {...args}>
<div>This is child of content component</div>
</Content>
);
WithNoPadding.args = {
stretch: true,
noPadding: true,
};
@@ -0,0 +1,45 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { HeaderActionMenu, HeaderActionMenuProps } from './HeaderActionMenu';
export default {
title: 'Layout/HeaderActionMenu',
component: HeaderActionMenu,
};
export const Default = (args: HeaderActionMenuProps) => (
<HeaderActionMenu {...args} />
);
Default.args = {
actionItems: [
{
label: 'Item 1',
secondaryLabel: 'Item 1 secondary label',
disabled: false,
},
{
label: 'Item 2',
secondaryLabel: 'Item 2 secondary label',
disabled: true,
},
{
label: 'Item 3',
secondaryLabel: 'Item 3 secondary label',
disabled: true,
},
],
};
@@ -0,0 +1,35 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { HeaderLabel } from './HeaderLabel';
export default {
title: 'Layout/HeaderLabel',
component: HeaderLabel,
};
type HeaderLabelProps = {
label: string;
value?: string;
url?: string;
};
export const Default = (args: HeaderLabelProps) => <HeaderLabel {...args} />;
Default.args = {
label: 'This is label',
value: 'This is value',
url: 'https://backstage.io',
};