Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion packages/ui-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@node-core/ui-components",
"version": "1.6.2",
"version": "1.6.3",
"type": "module",
"exports": {
"./*": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
}

.root {
@apply flex
@apply mb-1
flex
flex-col
gap-4
rounded-sm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,17 @@ export const Nested: Story = {
},
],
},
{
name: 'Returns',
kind: 'return',
description: 'description',
type: (
<>
<a href="#">&lt;Promise&gt;</a>|
<a href="#">&lt;AsyncIterable&gt;</a>
</>
),
},
],
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,26 @@ const renderSignature = (param: SignatureDefinition, index: number) => (

const FunctionSignature: FC<FunctionSignatureProps> = ({ title, items }) => {
if (title) {
const attributes: Array<SignatureDefinition> = [];
Comment thread
canerakdas marked this conversation as resolved.
const returnTypes: Array<SignatureDefinition> = [];

for (const item of items) {
(item.kind === 'return' ? returnTypes : attributes).push(item);
}

return (
<Signature title={title}>
{items.map((param, i) => renderSignature(param, i))}
</Signature>
<>
<Signature title={title}>
{attributes.map((param, i) => renderSignature(param, i))}
</Signature>
{returnTypes.length > 0 && (
<Signature>
{returnTypes.map((param, i) =>
renderSignature(param, attributes.length + i)
)}
</Signature>
)}
Comment thread
canerakdas marked this conversation as resolved.
Outdated
</>
);
}

Expand Down
Loading