Skip to content

Commit

Permalink
[Design adjustments] Replace RibbonIcon with ClipboardIcon (#1751)
Browse files Browse the repository at this point in the history
* refactor: replace the RibbonIcon with the ClipboardIcon

* chore: adjust changeset

* refactor: introduce new icon color in design system
  • Loading branch information
timonrey authored Jul 12, 2023
1 parent 0348ca3 commit 81f0bc6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-falcons-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-docs/ui-kit': patch
---

Replace the "Ribbon" icon with the "Clipboard" icon. The icon is being displayed next to section headers.
10 changes: 8 additions & 2 deletions packages/ui-kit/src/components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import reactIs from 'react-is';
import { css } from '@emotion/react';
import styled from '@emotion/styled';
import Tooltip from '@commercetools-uikit/tooltip';
import { RibbonSvgIcon } from '../icons';
import { ClipboardIcon } from '@commercetools-uikit/icons';
import { colors, dimensions, typography, tokens } from '../design-system';
import { CodeBlockMarkdownWrapper as CodeBlock } from './multi-code-block';
import copyToClipboard from '../utils/copy-to-clipboard';
Expand Down Expand Up @@ -334,6 +334,10 @@ const CopyArea = styled.div`
cursor: pointer;
`;

const IconColorWrapper = styled.div`
fill: ${colors.light.iconSecondary};
`;

const TooltipBodyComponent = styled.div`
background-color: ${colors.light.surfaceCodeCopy};
color: ${colors.light.textInverted};
Expand Down Expand Up @@ -386,7 +390,9 @@ const withCopyToClipboard =
onClose={handleTooltipClose}
>
<CopyArea onClick={handleCopyToClipboardClick}>
<RibbonSvgIcon />
<IconColorWrapper>
<ClipboardIcon />
</IconColorWrapper>
</CopyArea>
</Tooltip>
</Component>
Expand Down
4 changes: 4 additions & 0 deletions packages/ui-kit/src/design-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export type ThemeColorTokens = {
linkNavigation: string;
// Headlines
headlinePrimary: string;
// Icons
iconSecondary: string;
};

export type ThemeCodeBlocksColorTokens = {
Expand Down Expand Up @@ -126,6 +128,8 @@ export const colors: ThemeColors = {
linkNavigation: designTokens.colorInfo,
// Headlines
headlinePrimary: '#003037',
// Icons
iconSecondary: '#949494',
// Code blocks
// We support 2 theme versions: a primary one and a secondary one.
// This is not to be confused with a (potential) website theme, hence
Expand Down
18 changes: 0 additions & 18 deletions packages/ui-kit/src/icons/generated/Ribbon.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/ui-kit/src/icons/generated/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 81f0bc6

Please sign in to comment.