-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a45c22
commit f2cda3d
Showing
10 changed files
with
79 additions
and
61 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
17 changes: 17 additions & 0 deletions
17
packages/ui/src/components/ExampleDescription/ExampleDescription.styles.ts
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,17 @@ | ||
import { styled } from '@mui/material'; | ||
|
||
import { Words } from '../Words'; | ||
|
||
export const Features = styled('ul')(({ theme }) => ({ | ||
display: 'grid', | ||
gridTemplateColumns: '1fr', | ||
rowGap: theme.spacing(1), | ||
listStyle: 'inside', | ||
padding: 0, | ||
margin: 0, | ||
})); | ||
|
||
export const Feature = styled(Words)(({ theme }) => ({ | ||
textWrap: 'balance', | ||
lineHeight: 1.65, | ||
})); |
29 changes: 29 additions & 0 deletions
29
packages/ui/src/components/ExampleDescription/ExampleDescription.tsx
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,29 @@ | ||
import type { ReactNode } from 'react'; | ||
|
||
import { Words } from '../Words'; | ||
import { Feature, Features } from './ExampleDescription.styles'; | ||
|
||
export interface ExampleDescriptionProps { | ||
description: ReactNode; | ||
features?: ReactNode[]; | ||
} | ||
|
||
export const ExampleDescription = ({ description, features = [] }: ExampleDescriptionProps) => { | ||
return ( | ||
<> | ||
<Words variant='body2' mb={features.length === 0 ? 0 : 1.25}> | ||
{description} | ||
</Words> | ||
|
||
{features.length > 0 && ( | ||
<Features> | ||
{features.map((features, index) => ( | ||
<Feature key={index} variant='body2' component='li'> | ||
{features} | ||
</Feature> | ||
))} | ||
</Features> | ||
)} | ||
</> | ||
); | ||
}; |
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 @@ | ||
export * from './ExampleDescription'; |
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