-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from catenax-ng/feat/613/NewCardDesignAdded
- Loading branch information
Showing
10 changed files
with
176 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://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. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
********************************************************************************/ | ||
|
||
import { ComponentStory } from '@storybook/react' | ||
|
||
import { ContentCard as Component } from './ContentCard' | ||
|
||
export default { | ||
title: 'Cards', | ||
component: Component, | ||
argTypes: {}, | ||
} | ||
|
||
const Template: ComponentStory<typeof Component> = (args: any) => ( | ||
<Component {...args} /> | ||
) | ||
|
||
const item = { | ||
title: 'ISO_14001_EMAS_or_national_certification', | ||
chipText: 'ISO_14001_EMAS_or_national_certification', | ||
heading: 'Business Partner Level: ', | ||
detail: 'BPN1, BPN2, BPN3, BPN4', | ||
} | ||
|
||
export const ContentCard = Template.bind({}) | ||
ContentCard.args = item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://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. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
********************************************************************************/ | ||
|
||
import { Box, Typography, useTheme } from '@mui/material' | ||
import { CardChip, StatusVariants } from './CardChip' | ||
|
||
export interface ContentCardProps { | ||
title: string | ||
chipText: string | ||
heading?: string | ||
detail?: string | ||
} | ||
|
||
export const ContentCard = ({ | ||
title, | ||
chipText, | ||
heading, | ||
detail | ||
}: ContentCardProps) => { | ||
const theme = useTheme() | ||
|
||
return ( | ||
<Box | ||
key={title} | ||
sx={{ | ||
width: '270px', | ||
minWidth: '270px', | ||
paddingRight: '10px', | ||
paddingLeft: '10px', | ||
marginBottom: '20px', | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
height: '200px', | ||
width: 'auto', | ||
boxSizing: 'border-box', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
padding: '16px 28px', | ||
background: '#FFFFFF', | ||
border: '1px solid #DCDCDC', | ||
borderRadius: '20px', | ||
flex: 'none', | ||
order: 1, | ||
alignSelf: 'stretch', | ||
flexGrow: 0, | ||
cursor: 'pointer', | ||
':hover': { | ||
boxShadow: theme.shadows['20'], | ||
}, | ||
}} | ||
> | ||
<Box sx={{ marginBottom: '20px' }}> | ||
<CardChip status={StatusVariants.enabled} statusText={chipText} /> | ||
</Box> | ||
<Typography | ||
variant="h4" | ||
sx={{ | ||
height: '60px', | ||
'-webkit-line-clamp': '2', | ||
lineClamp: '2', | ||
display: '-webkit-box', | ||
'-webkit-box-orient': 'vertical', | ||
boxOrient: 'vertical', | ||
wordBreak: 'break-all', | ||
overflow: 'hidden', | ||
marginBottom: '6px' | ||
}} | ||
> | ||
{title} | ||
</Typography> | ||
{ | ||
detail && | ||
<Box sx={{ lineHeight: 'normal' }}> | ||
<Typography | ||
variant="body3" | ||
sx={{ | ||
fontSize: '12px', | ||
fontWeight: '600' | ||
}} | ||
> | ||
{heading} | ||
</Typography> | ||
<Typography | ||
variant="body3" | ||
sx={{ | ||
fontSize: '12px' | ||
}} | ||
> | ||
{detail} | ||
</Typography> | ||
</Box> | ||
} | ||
</Box> | ||
</Box> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters