Skip to content
Merged
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
376 changes: 219 additions & 157 deletions website/docs/contribution/documentation/all-components.mdx

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,15 @@ const config = {
darkTheme: prismThemes.dracula,
additionalLanguages: ['solidity'],
},
algolia: {
appId: process.env.ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_API_KEY,
indexName: process.env.ALGOLIA_INDEX_NAME || 'compose',
contextualSearch: true,
},
// Only include Algolia config if appId is available (for production)
...(process.env.ALGOLIA_APP_ID && {
algolia: {
appId: process.env.ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_API_KEY,
indexName: process.env.ALGOLIA_INDEX_NAME || 'compose',
contextualSearch: true,
},
}),
}),
};

Expand Down
99 changes: 48 additions & 51 deletions website/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,58 +20,55 @@ 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>
);
}





}
Loading