Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
373 changes: 218 additions & 155 deletions docs/docs/contribution/documentation/all-components.mdx

Large diffs are not rendered by default.

92 changes: 47 additions & 45 deletions docs/src/components/api/PropertyTable/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.css';

/**
* PropertyTable Component - API property documentation table
* PropertyTable Component - Modern API property documentation table
* Inspired by Shadcn UI design patterns
*
* @param {Array} properties - Array of property objects
* @param {boolean} showRequired - Show required column (default: true)
Expand All @@ -20,52 +20,54 @@ export default function PropertyTable({
<div className={styles.propertyTable}>
{title && <h3 className={styles.tableTitle}>{title}</h3>}
<div className={styles.tableWrapper}>
<table className={styles.table}>
<thead>
<tr>
<th className={styles.nameColumn}>Property</th>
{showTypes && <th className={styles.typeColumn}>Type</th>}
{showRequired && <th className={styles.requiredColumn}>Required</th>}
<th className={styles.descriptionColumn}>Description</th>
</tr>
</thead>
<tbody>
{properties.map((prop, index) => (
<tr key={index}>
<td className={styles.nameCell}>
<code className={styles.propertyName}>{prop.name}</code>
</td>
{showTypes && (
<td className={styles.typeCell}>
<code className={styles.typeValue}>{prop.type || 'any'}</code>
</td>
)}
{showRequired && (
<td className={styles.requiredCell}>
{prop.required ? (
<span className={styles.requiredBadge}>Yes</span>
) : (
<span className={styles.optionalBadge}>No</span>
)}
<div className={styles.tableContainer}>
<table className={styles.table}>
<thead>
<tr>
<th className={styles.nameColumn}>Property</th>
{showTypes && <th className={styles.typeColumn}>Type</th>}
{showRequired && <th className={styles.requiredColumn}>Required</th>}
<th className={styles.descriptionColumn}>Description</th>
</tr>
</thead>
<tbody>
{properties.map((prop, index) => (
<tr key={index}>
<td className={styles.nameCell}>
<code className={styles.propertyName}>{prop.name}</code>
</td>
)}
<td className={styles.descriptionCell}>
{prop.description || prop.desc || '-'}
{prop.default !== undefined && (
<div className={styles.defaultValue}>
Default: <code>{String(prop.default)}</code>
</div>
{showTypes && (
<td className={styles.typeCell}>
<code className={styles.typeValue}>{prop.type || 'any'}</code>
</td>
)}
{prop.example && (
<div className={styles.exampleValue}>
Example: <code>{String(prop.example)}</code>
</div>
{showRequired && (
<td className={styles.requiredCell}>
{prop.required ? (
<span className={styles.requiredBadge}>Yes</span>
) : (
<span className={styles.optionalBadge}>No</span>
)}
</td>
)}
</td>
</tr>
))}
</tbody>
</table>
<td className={styles.descriptionCell}>
{prop.description || prop.desc || '-'}
{prop.default !== undefined && (
<div className={styles.defaultValue}>
Default: <code>{String(prop.default)}</code>
</div>
)}
{prop.example && (
<div className={styles.exampleValue}>
Example: <code>{String(prop.example)}</code>
</div>
)}
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
);
Expand Down
Loading