Skip to content

Commit

Permalink
Add Carbon Icons and upgrade Ant Design (#5416)
Browse files Browse the repository at this point in the history
  • Loading branch information
gilluminate authored Oct 24, 2024
1 parent 4bec008 commit 04a0873
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 169 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ The types of changes are:
### Fixed
- Fixed Snowflake DSR integration failing with syntax error [#5417](https://github.com/ethyca/fides/pull/5417)

### Developer Experience
- Added Carbon Icons to FidesUI [#5416](https://github.com/ethyca/fides/pull/5416)

## [2.48.0](https://github.com/ethyca/fidesplus/compare/2.47.1...2.48.0)

### Added
Expand Down
39 changes: 5 additions & 34 deletions clients/admin-ui/src/features/common/ClipboardButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,16 @@ enum TooltipText {

const useClipboardButton = (copyText: string) => {
const { onCopy } = useClipboard(copyText);

const [highlighted, setHighlighted] = useState(false);
const [tooltipText, setTooltipText] = useState(TooltipText.COPY);

const handleMouseDown = () => {
const handleClick = () => {
setTooltipText(TooltipText.COPIED);
onCopy();
};
const handleMouseUp = () => {
setHighlighted(false);
};

const handleMouseEnter = () => {
setHighlighted(true);
};
const handleMouseLeave = () => {
setHighlighted(false);
};

return {
tooltipText,
highlighted,
handleMouseDown,
handleMouseUp,
handleMouseEnter,
handleMouseLeave,
handleClick,
setTooltipText,
};
};
Expand All @@ -54,17 +38,8 @@ interface ClipboardButtonProps
}

const ClipboardButton = ({ copyText, ...props }: ClipboardButtonProps) => {
const {
tooltipText,
highlighted,
handleMouseDown,
handleMouseUp,
handleMouseEnter,
handleMouseLeave,
setTooltipText,
} = useClipboardButton(copyText);

const iconColor = !highlighted ? "gray.600" : "complimentary.500";
const { tooltipText, handleClick, setTooltipText } =
useClipboardButton(copyText);

return (
<Tooltip
Expand All @@ -80,15 +55,11 @@ const ClipboardButton = ({ copyText, ...props }: ClipboardButtonProps) => {
>
<Button
icon={<CopyIcon />}
color={iconColor}
aria-label="copy"
type="text"
data-testid="clipboard-btn"
{...props}
onClick={handleMouseDown}
onMouseUp={handleMouseUp}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
onClick={handleClick}
/>
</Tooltip>
);
Expand Down
3 changes: 2 additions & 1 deletion clients/fidesui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
"clean": "rm -rf node_modules"
},
"dependencies": {
"@carbon/icons-react": "^11.51.0",
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/react": "^2.8.2",
"antd": "^5.20.0",
"antd": "^5.21.5",
"chakra-react-select": "^4.7.6",
"typescript": "^4.9.5"
},
Expand Down
7 changes: 7 additions & 0 deletions clients/fidesui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ export { AddIcon, LinkIcon, QuestionIcon, WarningIcon } from "./icons";
export * from "./icons";
/* eslint-enable import/export */

/**
* prefixed icons from Carbon Icons
* @example <Icons.download size={14} />
*/
export * as Icons from "@carbon/icons-react";
/* end prefixed icons */

export * from "./FidesUIProvider";
export { extendTheme, theme } from "./FidesUITheme";

Expand Down
Loading

0 comments on commit 04a0873

Please sign in to comment.