Skip to content

Commit

Permalink
Fixed display of colors for the IconButton in the property explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
siarhei-epam committed Oct 31, 2024
1 parent eadccbd commit 45baeb6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion app/src/docs/IconButton.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,23 @@ export class IconButtonDoc extends BaseDocsBlock {
[TSkin.Promo]: { type: '@epam/promo:IconButtonProps', component: promo.IconButton },
},
doc: (doc: DocBuilder<promo.IconButtonProps | loveship.IconButtonProps| uui.IconButtonProps>) => {
const mapNeutralColor: Record<string, string> = {
loveship_dark: 'neutral-10',
electric: 'neutral-95',
vanilla_thunder: 'control-bg-hover',
};

const mapSecondaryColor: Record<string, string> = {
loveship: 'neutral-50',
promo: 'neutral-50',
loveship_dark: 'neutral-40',
};

doc.merge('color', {
editorType: getColorPickerComponent({
...COLOR_MAP,
neutral: `var(--uui-${getCurrentTheme() === 'loveship_dark' ? 'neutral-10' : 'neutral-60'})`,
neutral: `var(--uui-${!!mapNeutralColor[getCurrentTheme()] ? mapNeutralColor[getCurrentTheme()] : 'neutral-60'})`,
secondary: `var(--uui-${!!mapSecondaryColor[getCurrentTheme()] ? mapSecondaryColor[getCurrentTheme()] : 'secondary-50'})`,
}),
});
doc.setDefaultPropExample('onClick', () => true);
Expand Down

0 comments on commit 45baeb6

Please sign in to comment.