Skip to content

Commit

Permalink
Merge branch 'main' into fix-react-attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
nmerget authored Apr 11, 2024
2 parents bf422e6 + 6c433ce commit c895358
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/shared/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ export type DefaultVariantProps = {

export type IconProps = {
/**
* Define an icon by it's identifier (like e.g. _account_, compare to [Icons](https://db-ui.github.io/mono/review/main/foundations/icons) to get displayed in front of the elements content.
* Define an icon by its identifier (like e.g. _account_, compare to [Icons](https://db-ui.github.io/mono/review/main/foundations/icons/overview)) to get displayed in front of the elements content.
*/
icon?: IconTypes;
};

export type IconAfterProps = {
/**
* Define an icon by it's identifier (like e.g. _account_, compare to [Icons](https://db-ui.github.io/mono/review/main/foundations/icons) to get displayed in front of the elements content.
* Define an icon by its identifier (like e.g. _account_, compare to [Icons](https://db-ui.github.io/mono/review/main/foundations/icons/overview)) to get displayed in front of the elements content.
*/
iconAfter?: IconTypes;
};
Expand Down
21 changes: 13 additions & 8 deletions showcases/patternhub/scripts/get-properties-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,19 @@ const getPropertiesFile = ({ displayName, description, props }) => {
'No description'
} `;
propertyTable += `| ${property.tsType.type ?? property.tsType.name} `;
propertyTable += `| ${
options
? `<pre><code className="code-pre-wrap">${options.replaceAll(
'<T>',
''
)}</code></pre>`
: ''
} |\n`;

if (['icon', 'iconAfter', 'messageIcon'].includes(propertyKey)) {
propertyTable += `| [IconTypes](https://db-ui.github.io/mono/review/main/foundations/icons/overview) |\n`;
} else {
propertyTable += `| ${
options
? `<pre><code className="code-pre-wrap">${options.replaceAll(
'<T>',
''
)}</code></pre>`
: ''
} |\n`;
}
}

return `
Expand Down
4 changes: 3 additions & 1 deletion showcases/patternhub/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export const getUnionElements = (options, elements) => {
options.push(
element.name === 'literal'
? element.value
: getUnionElements(options, element.elements)
: element.elements
? getUnionElements(options, element.elements)
: element.name
);
}
}
Expand Down

0 comments on commit c895358

Please sign in to comment.