-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new PropsTable for server doc [MDS-788] (#2473)
* add props table component * new PropsTable for server doc [MDS-788]
- Loading branch information
Showing
15 changed files
with
210 additions
and
16 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
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
9 changes: 7 additions & 2 deletions
9
...s/shared/exampleSection/HeaderSection.tsx → docs/app/components/shared/HeaderSection.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
2 changes: 1 addition & 1 deletion
2
.../shared/exampleSection/ExampleSection.tsx → ...omponents/shared/exampleSection/index.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
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,40 @@ | ||
import type { Data } from './index'; | ||
|
||
type PropsTableItemProps = { | ||
prop: Data; | ||
}; | ||
|
||
const PropsTableItem = ({ prop }: PropsTableItemProps) => { | ||
const { name, type, defaultState, description } = prop; | ||
return ( | ||
<div className="flex flex-col gap-4 pb-6 relative after:content-[''] after:absolute after:h-px after:bg-beerus after:inset-x-0 after:bottom-0 "> | ||
<div className="flex w-full items-center gap-6 text-moon-16"> | ||
<span className="w-[8.75rem] min-w-[8.75rem] overflow-hidden whitespace-nowrap text-ellipsis font-semibold"> | ||
Prop | ||
</span> | ||
<p> | ||
<span className="py-1 px-2 bg-frieza-10 text-frieza rounded-moon-i-xs"> | ||
{name} | ||
</span> | ||
</p> | ||
</div> | ||
<div className="flex w-full items-center gap-6 text-moon-16 "> | ||
<span className="w-[8.75rem] min-w-[8.75rem] font-semibold overflow-hidden whitespace-nowrap text-ellipsis"> | ||
Default | ||
</span> | ||
<p>{defaultState || '-'}</p> | ||
</div> | ||
<div className="flex flex-col md:flex-row w-full md:items-center gap-6 text-moon-16 "> | ||
<span className="md:w-[8.75rem] md:min-w-[8.75rem] font-semibold overflow-hidden whitespace-nowrap text-ellipsis"> | ||
Description | ||
</span> | ||
<p>{description}</p> | ||
</div> | ||
<div className="md:pl-[8.75rem]"> | ||
<p className="text-moon-16 text-frieza md:pl-6">{type}</p> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PropsTableItem; |
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 PropsTableItem from './PropsTableItem'; | ||
import HeaderSection from '../HeaderSection'; | ||
|
||
export type Data = { | ||
name: string; | ||
type: string; | ||
defaultState: string | React.ReactNode; | ||
description: string; | ||
}; | ||
|
||
type TableProps = { | ||
data: Data[]; | ||
title?: string; | ||
description?: string | JSX.Element; | ||
}; | ||
|
||
const PropsTable = ({ data, title, description }: TableProps) => { | ||
return ( | ||
<section className="flex flex-col gap-6"> | ||
<HeaderSection title={title} description={description} className="pb-6" /> | ||
<hr className="h-px bg-beerus w-full" /> | ||
{data.map((prop: Data) => ( | ||
<PropsTableItem prop={prop} key={prop.name} /> | ||
))} | ||
</section> | ||
); | ||
}; | ||
|
||
export default PropsTable; |