From 0973a31506b200af9e40e80b5f2e33d469a6666d Mon Sep 17 00:00:00 2001 From: David Cho-Lerat Date: Tue, 11 Apr 2023 12:35:46 +0200 Subject: [PATCH] SONAR-19023 Add icons needed for the project overview page to design-system --- .../design-system/src/components/Checkbox.tsx | 3 +- .../design-system/src/components/Dropdown.tsx | 3 +- .../src/components/InputSearch.tsx | 5 +- .../design-system/src/components/Link.tsx | 3 +- .../__tests__/DropdownMenu-test.tsx | 2 +- .../src/components/clipboard.tsx | 3 +- .../src/components/icons/BranchIcon.tsx | 3 +- .../src/components/icons/BugIcon.tsx | 40 ++++++ .../src/components/icons/CheckIcon.tsx | 3 +- .../src/components/icons/ChevronDownIcon.tsx | 1 + .../src/components/icons/ClockIcon.tsx | 5 +- .../src/components/icons/CloseIcon.tsx | 3 +- .../src/components/icons/CodeSmellIcon.tsx | 36 +++++ .../src/components/icons/CopyIcon.tsx | 5 +- .../src/components/icons/FlagErrorIcon.tsx | 1 + .../src/components/icons/FlagInfoIcon.tsx | 1 + .../src/components/icons/FlagSuccessIcon.tsx | 1 + .../src/components/icons/FlagWarningIcon.tsx | 1 + .../src/components/icons/HelperHintIcon.tsx | 3 +- .../src/components/icons/HomeFillIcon.tsx | 3 +- .../src/components/icons/HomeIcon.tsx | 5 +- .../src/components/icons/Icon.tsx | 1 + .../src/components/icons/MainBranchIcon.tsx | 3 +- .../src/components/icons/MenuHelpIcon.tsx | 3 +- .../src/components/icons/MenuIcon.tsx | 6 +- .../src/components/icons/MenuSearchIcon.tsx | 3 +- .../src/components/icons/OpenNewTabIcon.tsx | 3 +- .../icons/OverviewQGNotComputedIcon.tsx | 132 ++++++++++++++++++ .../components/icons/OverviewQGPassedIcon.tsx | 99 +++++++++++++ .../src/components/icons/PullRequestIcon.tsx | 3 +- .../src/components/icons/SearchIcon.tsx | 5 +- .../components/icons/SecurityHotspotIcon.tsx | 36 +++++ .../src/components/icons/StarIcon.tsx | 5 +- .../components/icons/VulnerabilityIcon.tsx | 36 +++++ .../src/components/icons/index.ts | 29 ++-- 35 files changed, 452 insertions(+), 42 deletions(-) create mode 100644 server/sonar-web/design-system/src/components/icons/BugIcon.tsx create mode 100644 server/sonar-web/design-system/src/components/icons/CodeSmellIcon.tsx create mode 100644 server/sonar-web/design-system/src/components/icons/OverviewQGNotComputedIcon.tsx create mode 100644 server/sonar-web/design-system/src/components/icons/OverviewQGPassedIcon.tsx create mode 100644 server/sonar-web/design-system/src/components/icons/SecurityHotspotIcon.tsx create mode 100644 server/sonar-web/design-system/src/components/icons/VulnerabilityIcon.tsx diff --git a/server/sonar-web/design-system/src/components/Checkbox.tsx b/server/sonar-web/design-system/src/components/Checkbox.tsx index 80bd53e02d5..ad5848ecb8c 100644 --- a/server/sonar-web/design-system/src/components/Checkbox.tsx +++ b/server/sonar-web/design-system/src/components/Checkbox.tsx @@ -17,12 +17,13 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import styled from '@emotion/styled'; import React from 'react'; import tw from 'twin.macro'; import { themeBorder, themeColor, themeContrast } from '../helpers/theme'; import DeferredSpinner from './DeferredSpinner'; -import CheckIcon from './icons/CheckIcon'; +import { CheckIcon } from './icons/CheckIcon'; import { CustomIcon } from './icons/Icon'; interface Props { diff --git a/server/sonar-web/design-system/src/components/Dropdown.tsx b/server/sonar-web/design-system/src/components/Dropdown.tsx index 3eccd54e68f..28cd84dfdcd 100644 --- a/server/sonar-web/design-system/src/components/Dropdown.tsx +++ b/server/sonar-web/design-system/src/components/Dropdown.tsx @@ -17,13 +17,14 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import React from 'react'; import { translate } from '../helpers/l10n'; import { PopupPlacement, PopupZLevel } from '../helpers/positioning'; import { InputSizeKeys } from '../types/theme'; import { DropdownMenu } from './DropdownMenu'; import DropdownToggler from './DropdownToggler'; -import MenuIcon from './icons/MenuIcon'; +import { MenuIcon } from './icons/MenuIcon'; import { InteractiveIcon } from './InteractiveIcon'; type OnClickCallback = (event?: React.MouseEvent) => void; diff --git a/server/sonar-web/design-system/src/components/InputSearch.tsx b/server/sonar-web/design-system/src/components/InputSearch.tsx index ba7ee3cd6e6..2330a050058 100644 --- a/server/sonar-web/design-system/src/components/InputSearch.tsx +++ b/server/sonar-web/design-system/src/components/InputSearch.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import styled from '@emotion/styled'; import classNames from 'classnames'; import { debounce } from 'lodash'; @@ -28,8 +29,8 @@ import { themeBorder, themeColor, themeContrast } from '../helpers/theme'; import { isDefined } from '../helpers/types'; import { InputSizeKeys } from '../types/theme'; import DeferredSpinner from './DeferredSpinner'; -import CloseIcon from './icons/CloseIcon'; -import SearchIcon from './icons/SearchIcon'; +import { CloseIcon } from './icons/CloseIcon'; +import { SearchIcon } from './icons/SearchIcon'; import { InteractiveIcon } from './InteractiveIcon'; interface Props { diff --git a/server/sonar-web/design-system/src/components/Link.tsx b/server/sonar-web/design-system/src/components/Link.tsx index 5f427ece7e2..8b0f846bb91 100644 --- a/server/sonar-web/design-system/src/components/Link.tsx +++ b/server/sonar-web/design-system/src/components/Link.tsx @@ -17,13 +17,14 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { css } from '@emotion/react'; import styled from '@emotion/styled'; import React, { HTMLAttributeAnchorTarget } from 'react'; import { Link as RouterLink, LinkProps as RouterLinkProps } from 'react-router-dom'; import tw, { theme as twTheme } from 'twin.macro'; import { themeBorder, themeColor } from '../helpers/theme'; -import OpenNewTabIcon from './icons/OpenNewTabIcon'; +import { OpenNewTabIcon } from './icons/OpenNewTabIcon'; import { TooltipWrapperInner } from './Tooltip'; export interface LinkProps extends RouterLinkProps { diff --git a/server/sonar-web/design-system/src/components/__tests__/DropdownMenu-test.tsx b/server/sonar-web/design-system/src/components/__tests__/DropdownMenu-test.tsx index 350c6874e22..1e68ae1d22e 100644 --- a/server/sonar-web/design-system/src/components/__tests__/DropdownMenu-test.tsx +++ b/server/sonar-web/design-system/src/components/__tests__/DropdownMenu-test.tsx @@ -32,7 +32,7 @@ import { ItemNavLink, ItemRadioButton, } from '../DropdownMenu'; -import MenuIcon from '../icons/MenuIcon'; +import { MenuIcon } from '../icons/MenuIcon'; import Tooltip from '../Tooltip'; beforeEach(() => { diff --git a/server/sonar-web/design-system/src/components/clipboard.tsx b/server/sonar-web/design-system/src/components/clipboard.tsx index 1e3763cb911..50141fd929f 100644 --- a/server/sonar-web/design-system/src/components/clipboard.tsx +++ b/server/sonar-web/design-system/src/components/clipboard.tsx @@ -17,13 +17,14 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import classNames from 'classnames'; import Clipboard from 'clipboard'; import React from 'react'; import { INTERACTIVE_TOOLTIP_DELAY } from '../helpers/constants'; import { translate } from '../helpers/l10n'; import { ButtonSecondary } from './buttons'; -import CopyIcon from './icons/CopyIcon'; +import { CopyIcon } from './icons/CopyIcon'; import { IconProps } from './icons/Icon'; import { DiscreetInteractiveIcon, InteractiveIcon, InteractiveIconSize } from './InteractiveIcon'; import Tooltip from './Tooltip'; diff --git a/server/sonar-web/design-system/src/components/icons/BranchIcon.tsx b/server/sonar-web/design-system/src/components/icons/BranchIcon.tsx index 532434ea26c..39e078746f5 100644 --- a/server/sonar-web/design-system/src/components/icons/BranchIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/BranchIcon.tsx @@ -17,7 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { GitBranchIcon } from '@primer/octicons-react'; import { OcticonHoc } from './Icon'; -export default OcticonHoc(GitBranchIcon, 'BranchIcon'); +export const BranchIcon = OcticonHoc(GitBranchIcon, 'BranchIcon'); diff --git a/server/sonar-web/design-system/src/components/icons/BugIcon.tsx b/server/sonar-web/design-system/src/components/icons/BugIcon.tsx new file mode 100644 index 00000000000..bf1410e1065 --- /dev/null +++ b/server/sonar-web/design-system/src/components/icons/BugIcon.tsx @@ -0,0 +1,40 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import { useTheme } from '@emotion/react'; +import { themeColor } from '../../helpers/theme'; +import { CustomIcon, IconProps } from './Icon'; + +export function BugIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + + + + + ); +} diff --git a/server/sonar-web/design-system/src/components/icons/CheckIcon.tsx b/server/sonar-web/design-system/src/components/icons/CheckIcon.tsx index dff5e8b4455..5b42e8dba45 100644 --- a/server/sonar-web/design-system/src/components/icons/CheckIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/CheckIcon.tsx @@ -17,11 +17,12 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { useTheme } from '@emotion/react'; import { themeColor } from '../../helpers/theme'; import { CustomIcon, IconProps } from './Icon'; -export default function CheckIcon({ fill = 'iconCheck', ...iconProps }: IconProps) { +export function CheckIcon({ fill = 'iconCheck', ...iconProps }: IconProps) { const theme = useTheme(); return ( diff --git a/server/sonar-web/design-system/src/components/icons/ChevronDownIcon.tsx b/server/sonar-web/design-system/src/components/icons/ChevronDownIcon.tsx index b34e8800098..0f711a38f76 100644 --- a/server/sonar-web/design-system/src/components/icons/ChevronDownIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/ChevronDownIcon.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { useTheme } from '@emotion/react'; import { themeColor } from '../../helpers/theme'; import { CustomIcon, IconProps } from './Icon'; diff --git a/server/sonar-web/design-system/src/components/icons/ClockIcon.tsx b/server/sonar-web/design-system/src/components/icons/ClockIcon.tsx index 15f81c7a302..23bb59c2f6d 100644 --- a/server/sonar-web/design-system/src/components/icons/ClockIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/ClockIcon.tsx @@ -17,7 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { ClockIcon } from '@primer/octicons-react'; + +import { ClockIcon as OcticonClockIcon } from '@primer/octicons-react'; import { OcticonHoc } from './Icon'; -export default OcticonHoc(ClockIcon); +export const ClockIcon = OcticonHoc(OcticonClockIcon, 'ClockIcon'); diff --git a/server/sonar-web/design-system/src/components/icons/CloseIcon.tsx b/server/sonar-web/design-system/src/components/icons/CloseIcon.tsx index 79fb0888398..26ec6f2eea5 100644 --- a/server/sonar-web/design-system/src/components/icons/CloseIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/CloseIcon.tsx @@ -17,7 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { XIcon } from '@primer/octicons-react'; import { OcticonHoc } from './Icon'; -export default OcticonHoc(XIcon, 'CloseIcon'); +export const CloseIcon = OcticonHoc(XIcon, 'CloseIcon'); diff --git a/server/sonar-web/design-system/src/components/icons/CodeSmellIcon.tsx b/server/sonar-web/design-system/src/components/icons/CodeSmellIcon.tsx new file mode 100644 index 00000000000..0a5e4f2221b --- /dev/null +++ b/server/sonar-web/design-system/src/components/icons/CodeSmellIcon.tsx @@ -0,0 +1,36 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import { useTheme } from '@emotion/react'; +import { themeColor } from '../../helpers/theme'; +import { CustomIcon, IconProps } from './Icon'; + +export function CodeSmellIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + + + + ); +} diff --git a/server/sonar-web/design-system/src/components/icons/CopyIcon.tsx b/server/sonar-web/design-system/src/components/icons/CopyIcon.tsx index e9f12579961..95f2890160c 100644 --- a/server/sonar-web/design-system/src/components/icons/CopyIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/CopyIcon.tsx @@ -17,7 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { CopyIcon } from '@primer/octicons-react'; + +import { CopyIcon as OcticonCopyIcon } from '@primer/octicons-react'; import { OcticonHoc } from './Icon'; -export default OcticonHoc(CopyIcon); +export const CopyIcon = OcticonHoc(OcticonCopyIcon, 'CopyIcon'); diff --git a/server/sonar-web/design-system/src/components/icons/FlagErrorIcon.tsx b/server/sonar-web/design-system/src/components/icons/FlagErrorIcon.tsx index 519b9a387a0..83509b0a23b 100644 --- a/server/sonar-web/design-system/src/components/icons/FlagErrorIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/FlagErrorIcon.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { useTheme } from '@emotion/react'; import { themeColor } from '../../helpers/theme'; import { CustomIcon, IconProps } from './Icon'; diff --git a/server/sonar-web/design-system/src/components/icons/FlagInfoIcon.tsx b/server/sonar-web/design-system/src/components/icons/FlagInfoIcon.tsx index 3aef3045e4a..5e7e9b473dc 100644 --- a/server/sonar-web/design-system/src/components/icons/FlagInfoIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/FlagInfoIcon.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { useTheme } from '@emotion/react'; import { themeColor } from '../../helpers/theme'; import { CustomIcon, IconProps } from './Icon'; diff --git a/server/sonar-web/design-system/src/components/icons/FlagSuccessIcon.tsx b/server/sonar-web/design-system/src/components/icons/FlagSuccessIcon.tsx index 748b8a5bc31..fdc0d77ed33 100644 --- a/server/sonar-web/design-system/src/components/icons/FlagSuccessIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/FlagSuccessIcon.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { useTheme } from '@emotion/react'; import { themeColor } from '../../helpers/theme'; import { CustomIcon, IconProps } from './Icon'; diff --git a/server/sonar-web/design-system/src/components/icons/FlagWarningIcon.tsx b/server/sonar-web/design-system/src/components/icons/FlagWarningIcon.tsx index 0550bbb9c96..4945a44ea43 100644 --- a/server/sonar-web/design-system/src/components/icons/FlagWarningIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/FlagWarningIcon.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { useTheme } from '@emotion/react'; import { themeColor } from '../../helpers/theme'; import { CustomIcon, IconProps } from './Icon'; diff --git a/server/sonar-web/design-system/src/components/icons/HelperHintIcon.tsx b/server/sonar-web/design-system/src/components/icons/HelperHintIcon.tsx index 0a5e6961634..ea7774b84d6 100644 --- a/server/sonar-web/design-system/src/components/icons/HelperHintIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/HelperHintIcon.tsx @@ -17,11 +17,12 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { useTheme } from '@emotion/react'; import { themeColor, themeContrast } from '../../helpers/theme'; import { CustomIcon, IconProps } from './Icon'; -export default function HelperHintIcon({ fill = 'currentColor', ...iconProps }: IconProps) { +export function HelperHintIcon(iconProps: IconProps) { const theme = useTheme(); return ( diff --git a/server/sonar-web/design-system/src/components/icons/HomeFillIcon.tsx b/server/sonar-web/design-system/src/components/icons/HomeFillIcon.tsx index 72d7cd65059..91d31f028cc 100644 --- a/server/sonar-web/design-system/src/components/icons/HomeFillIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/HomeFillIcon.tsx @@ -17,11 +17,12 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { useTheme } from '@emotion/react'; import { themeColor } from '../../helpers/theme'; import { CustomIcon, IconProps } from './Icon'; -export default function HomeFillIcon({ fill = 'iconFavorite', ...iconProps }: IconProps) { +export function HomeFillIcon({ fill = 'iconFavorite', ...iconProps }: IconProps) { const theme = useTheme(); const fillColor = themeColor(fill)({ theme }); return ( diff --git a/server/sonar-web/design-system/src/components/icons/HomeIcon.tsx b/server/sonar-web/design-system/src/components/icons/HomeIcon.tsx index a4a6d07ba01..f10bb82d74a 100644 --- a/server/sonar-web/design-system/src/components/icons/HomeIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/HomeIcon.tsx @@ -17,7 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { HomeIcon } from '@primer/octicons-react'; + +import { HomeIcon as OcticonHomeIcon } from '@primer/octicons-react'; import { OcticonHoc } from './Icon'; -export default OcticonHoc(HomeIcon); +export const HomeIcon = OcticonHoc(OcticonHomeIcon, 'HomeIcon'); diff --git a/server/sonar-web/design-system/src/components/icons/Icon.tsx b/server/sonar-web/design-system/src/components/icons/Icon.tsx index 5edea8c38c0..a9a246a0c21 100644 --- a/server/sonar-web/design-system/src/components/icons/Icon.tsx +++ b/server/sonar-web/design-system/src/components/icons/Icon.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { useTheme } from '@emotion/react'; import { OcticonProps } from '@primer/octicons-react'; import React from 'react'; diff --git a/server/sonar-web/design-system/src/components/icons/MainBranchIcon.tsx b/server/sonar-web/design-system/src/components/icons/MainBranchIcon.tsx index e954c1e74e0..ca4af3e1981 100644 --- a/server/sonar-web/design-system/src/components/icons/MainBranchIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/MainBranchIcon.tsx @@ -17,11 +17,12 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { useTheme } from '@emotion/react'; import { themeColor } from '../../helpers/theme'; import { CustomIcon, IconProps } from './Icon'; -export default function MainBranchIcon({ fill = 'currentColor', ...iconProps }: IconProps) { +export function MainBranchIcon({ fill = 'currentColor', ...iconProps }: IconProps) { const theme = useTheme(); return ( diff --git a/server/sonar-web/design-system/src/components/icons/MenuHelpIcon.tsx b/server/sonar-web/design-system/src/components/icons/MenuHelpIcon.tsx index 5fcebecdf93..108dce3a417 100644 --- a/server/sonar-web/design-system/src/components/icons/MenuHelpIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/MenuHelpIcon.tsx @@ -17,11 +17,12 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { useTheme } from '@emotion/react'; import { themeColor } from '../../helpers/theme'; import { CustomIcon, IconProps } from './Icon'; -export default function MenuHelpIcon({ fill = 'currentColor', ...iconProps }: IconProps) { +export function MenuHelpIcon({ fill = 'currentColor', ...iconProps }: IconProps) { const theme = useTheme(); return ( diff --git a/server/sonar-web/design-system/src/components/icons/MenuIcon.tsx b/server/sonar-web/design-system/src/components/icons/MenuIcon.tsx index ea30d7ddf9a..2e3b99820af 100644 --- a/server/sonar-web/design-system/src/components/icons/MenuIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/MenuIcon.tsx @@ -17,13 +17,11 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import styled from '@emotion/styled'; import { KebabHorizontalIcon } from '@primer/octicons-react'; import { OcticonHoc } from './Icon'; -const MenuIcon = styled(OcticonHoc(KebabHorizontalIcon))` +export const MenuIcon = styled(OcticonHoc(KebabHorizontalIcon, 'MenuIcon'))` transform: rotate(90deg); `; - -MenuIcon.displayName = 'MenuIcon'; -export default MenuIcon; diff --git a/server/sonar-web/design-system/src/components/icons/MenuSearchIcon.tsx b/server/sonar-web/design-system/src/components/icons/MenuSearchIcon.tsx index a09077285e8..2ec2898dc52 100644 --- a/server/sonar-web/design-system/src/components/icons/MenuSearchIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/MenuSearchIcon.tsx @@ -17,11 +17,12 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { useTheme } from '@emotion/react'; import { themeColor } from '../../helpers/theme'; import { CustomIcon, IconProps } from './Icon'; -export default function MenuSearchIcon({ fill = 'currentColor', ...iconProps }: IconProps) { +export function MenuSearchIcon({ fill = 'currentColor', ...iconProps }: IconProps) { const theme = useTheme(); return ( diff --git a/server/sonar-web/design-system/src/components/icons/OpenNewTabIcon.tsx b/server/sonar-web/design-system/src/components/icons/OpenNewTabIcon.tsx index f856c0ce7ee..47aa519c669 100644 --- a/server/sonar-web/design-system/src/components/icons/OpenNewTabIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/OpenNewTabIcon.tsx @@ -17,7 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { LinkExternalIcon } from '@primer/octicons-react'; import { OcticonHoc } from './Icon'; -export default OcticonHoc(LinkExternalIcon, 'OpenNewTabIcon'); +export const OpenNewTabIcon = OcticonHoc(LinkExternalIcon, 'OpenNewTabIcon'); diff --git a/server/sonar-web/design-system/src/components/icons/OverviewQGNotComputedIcon.tsx b/server/sonar-web/design-system/src/components/icons/OverviewQGNotComputedIcon.tsx new file mode 100644 index 00000000000..8bb6bb012f0 --- /dev/null +++ b/server/sonar-web/design-system/src/components/icons/OverviewQGNotComputedIcon.tsx @@ -0,0 +1,132 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import { useTheme } from '@emotion/react'; +import { themeColor } from '../../helpers/theme'; + +export function OverviewQGNotComputedIcon({ className }: { className?: string }) { + const theme = useTheme(); + + return ( + + + + + + + + + + + + + + + + + + + + + + ); +} diff --git a/server/sonar-web/design-system/src/components/icons/OverviewQGPassedIcon.tsx b/server/sonar-web/design-system/src/components/icons/OverviewQGPassedIcon.tsx new file mode 100644 index 00000000000..e535d8f799d --- /dev/null +++ b/server/sonar-web/design-system/src/components/icons/OverviewQGPassedIcon.tsx @@ -0,0 +1,99 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import { useTheme } from '@emotion/react'; +import { themeColor } from '../../helpers/theme'; + +export function OverviewQGPassedIcon({ className }: { className?: string }) { + const theme = useTheme(); + + return ( + + + + + + + + + + + + + + + + ); +} diff --git a/server/sonar-web/design-system/src/components/icons/PullRequestIcon.tsx b/server/sonar-web/design-system/src/components/icons/PullRequestIcon.tsx index 4f058f00f00..a91eaa04faa 100644 --- a/server/sonar-web/design-system/src/components/icons/PullRequestIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/PullRequestIcon.tsx @@ -17,7 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { GitPullRequestIcon } from '@primer/octicons-react'; import { OcticonHoc } from './Icon'; -export default OcticonHoc(GitPullRequestIcon, 'PullRequestIcon'); +export const PullRequestIcon = OcticonHoc(GitPullRequestIcon, 'PullRequestIcon'); diff --git a/server/sonar-web/design-system/src/components/icons/SearchIcon.tsx b/server/sonar-web/design-system/src/components/icons/SearchIcon.tsx index 674ac699a6e..f629c1e9460 100644 --- a/server/sonar-web/design-system/src/components/icons/SearchIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/SearchIcon.tsx @@ -17,7 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { SearchIcon } from '@primer/octicons-react'; + +import { SearchIcon as OcticonSearchIcon } from '@primer/octicons-react'; import { OcticonHoc } from './Icon'; -export default OcticonHoc(SearchIcon); +export const SearchIcon = OcticonHoc(OcticonSearchIcon, 'SearchIcon'); diff --git a/server/sonar-web/design-system/src/components/icons/SecurityHotspotIcon.tsx b/server/sonar-web/design-system/src/components/icons/SecurityHotspotIcon.tsx new file mode 100644 index 00000000000..8f5b06a44e6 --- /dev/null +++ b/server/sonar-web/design-system/src/components/icons/SecurityHotspotIcon.tsx @@ -0,0 +1,36 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import { useTheme } from '@emotion/react'; +import { themeColor } from '../../helpers/theme'; +import { CustomIcon, IconProps } from './Icon'; + +export function SecurityHotspotIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + + + + ); +} diff --git a/server/sonar-web/design-system/src/components/icons/StarIcon.tsx b/server/sonar-web/design-system/src/components/icons/StarIcon.tsx index f83c9a340a5..bb0913640a1 100644 --- a/server/sonar-web/design-system/src/components/icons/StarIcon.tsx +++ b/server/sonar-web/design-system/src/components/icons/StarIcon.tsx @@ -17,7 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { StarIcon } from '@primer/octicons-react'; + +import { StarIcon as OcticonStarIcon } from '@primer/octicons-react'; import { OcticonHoc } from './Icon'; -export default OcticonHoc(StarIcon); +export const StarIcon = OcticonHoc(OcticonStarIcon, 'StarIcon'); diff --git a/server/sonar-web/design-system/src/components/icons/VulnerabilityIcon.tsx b/server/sonar-web/design-system/src/components/icons/VulnerabilityIcon.tsx new file mode 100644 index 00000000000..dcede54c339 --- /dev/null +++ b/server/sonar-web/design-system/src/components/icons/VulnerabilityIcon.tsx @@ -0,0 +1,36 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import { useTheme } from '@emotion/react'; +import { themeColor } from '../../helpers/theme'; +import { CustomIcon, IconProps } from './Icon'; + +export function VulnerabilityIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + + + + ); +} diff --git a/server/sonar-web/design-system/src/components/icons/index.ts b/server/sonar-web/design-system/src/components/icons/index.ts index 303600bd9be..b57a9b5862f 100644 --- a/server/sonar-web/design-system/src/components/icons/index.ts +++ b/server/sonar-web/design-system/src/components/icons/index.ts @@ -17,19 +17,26 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -export { default as BranchIcon } from './BranchIcon'; + +export { BranchIcon } from './BranchIcon'; +export { BugIcon } from './BugIcon'; export { ChevronDownIcon } from './ChevronDownIcon'; -export { default as ClockIcon } from './ClockIcon'; +export { ClockIcon } from './ClockIcon'; +export { CodeSmellIcon } from './CodeSmellIcon'; export { FlagErrorIcon } from './FlagErrorIcon'; export { FlagInfoIcon } from './FlagInfoIcon'; export { FlagSuccessIcon } from './FlagSuccessIcon'; export { FlagWarningIcon } from './FlagWarningIcon'; -export { default as HelperHintIcon } from './HelperHintIcon'; -export { default as HomeFillIcon } from './HomeFillIcon'; -export { default as HomeIcon } from './HomeIcon'; -export { default as MainBranchIcon } from './MainBranchIcon'; -export { default as MenuHelpIcon } from './MenuHelpIcon'; -export { default as MenuSearchIcon } from './MenuSearchIcon'; -export { default as OpenNewTabIcon } from './OpenNewTabIcon'; -export { default as PullRequestIcon } from './PullRequestIcon'; -export { default as StarIcon } from './StarIcon'; +export { HelperHintIcon } from './HelperHintIcon'; +export { HomeFillIcon } from './HomeFillIcon'; +export { HomeIcon } from './HomeIcon'; +export { MainBranchIcon } from './MainBranchIcon'; +export { MenuHelpIcon } from './MenuHelpIcon'; +export { MenuSearchIcon } from './MenuSearchIcon'; +export { OpenNewTabIcon } from './OpenNewTabIcon'; +export { OverviewQGNotComputedIcon } from './OverviewQGNotComputedIcon'; +export { OverviewQGPassedIcon } from './OverviewQGPassedIcon'; +export { PullRequestIcon } from './PullRequestIcon'; +export { SecurityHotspotIcon } from './SecurityHotspotIcon'; +export { StarIcon } from './StarIcon'; +export { VulnerabilityIcon } from './VulnerabilityIcon'; -- 2.39.5