diff options
Diffstat (limited to 'server/sonar-web/src/main/js/design-system/components/icons')
93 files changed, 4005 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/design-system/components/icons/AddNewIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/AddNewIcon.tsx new file mode 100644 index 00000000000..83b78dea6b7 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/AddNewIcon.tsx @@ -0,0 +1,44 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; +import { CustomIcon, IconProps } from './Icon'; + +/** @deprecated Use IconPlus from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function AddNewIcon({ fill = 'currentColor', ...iconProps }: Readonly<IconProps>) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M8 0c-.55228 0-1 .44771-1 1v6H1c-.55229 0-1 .44771-1 1 0 .55228.44771 1 1 1h6v6c0 .5523.44772 1 1 1 .55229 0 1-.4477 1-1V9h6c.5523 0 1-.44771 1-1 0-.55228-.4477-1-1-1H9V1c0-.55229-.44771-1-1-1Z" + fill={themeColor(fill)({ theme })} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/BranchIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/BranchIcon.tsx new file mode 100644 index 00000000000..579b6595d80 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/BranchIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { GitBranchIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconGitBranch from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const BranchIcon = OcticonHoc(GitBranchIcon, 'BranchIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/BugIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/BugIcon.tsx new file mode 100644 index 00000000000..d4818cfb8e5 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/BugIcon.tsx @@ -0,0 +1,46 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconBug from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function BugIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <path + d="M10.09,1.88A2.86,2.86,0,0,0,8,1a2.87,2.87,0,0,0-2.11.87A2.93,2.93,0,0,0,5,4h6A2.93,2.93,0,0,0,10.09,1.88Z" + fill={themeColor(fill)({ theme })} + /> + <path + d="M14.54,9H13V5.6L14.3,4.42a.5.5,0,0,0,0-.71.49.49,0,0,0-.7,0L12.17,5H3.82L2.34,3.66a.5.5,0,0,0-.67.74L2.94,5.55V9H1.46a.5.5,0,0,0,0,1H3a5.2,5.2,0,0,0,1.05,2.32l-2,1.81a.5.5,0,1,0,.67.74l2-1.82A4.62,4.62,0,0,0,7,14.1V8A1,1,0,0,1,8,7a.94.94,0,0,1,1,.9v6.17A4.55,4.55,0,0,0,11.18,13l2,1.83a.51.51,0,0,0,.33.13.48.48,0,0,0,.37-.17.49.49,0,0,0,0-.7l-2-1.8a5.34,5.34,0,0,0,1-2.29h1.64a.5.5,0,0,0,0-1Z" + fill={themeColor(fill)({ theme })} + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/CalendarIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/CalendarIcon.tsx new file mode 100644 index 00000000000..1b600d8b42b --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/CalendarIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { CalendarIcon as Octicon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconCalendar from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const CalendarIcon = OcticonHoc(Octicon); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/CheckIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/CheckIcon.tsx new file mode 100644 index 00000000000..bde5e4f4698 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/CheckIcon.tsx @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconCheck from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function CheckIcon({ fill = 'iconCheck', ...iconProps }: IconProps) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M11.6634 5.47789c.2884.29737.2811.77218-.0163 1.06054L7.52211 10.5384c-.29414.2852-.76273.2816-1.05244-.0081l-2-1.99997c-.29289-.29289-.29289-.76777 0-1.06066s.76777-.29289 1.06066 0L7.0081 8.94744l3.5948-3.48586c.2974-.28836.7722-.28105 1.0605.01631Z" + fill={themeColor(fill)({ theme })} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/ChevronDownIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/ChevronDownIcon.tsx new file mode 100644 index 00000000000..208219afd0c --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/ChevronDownIcon.tsx @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconChevronDown from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function ChevronDownIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M12.7236 5.83199c.1953.19527.1953.51185 0 .70711l-4.18499 4.185c-.19526.1953-.51184.1953-.7071 0l-4.18503-4.185c-.19527-.19526-.19527-.51184 0-.70711.19526-.19526.51184-.19526.7071 0l3.83148 3.83148 3.83144-3.83148c.1953-.19526.5119-.19526.7071 0Z" + fill={themeColor(fill)({ theme })} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/ChevronLeftIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/ChevronLeftIcon.tsx new file mode 100644 index 00000000000..38c21ef2462 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/ChevronLeftIcon.tsx @@ -0,0 +1,37 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 ChevronLeftIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M10.16801 12.7236c-.19527.1953-.51185.1953-.70711 0l-4.185-4.18499c-.1953-.19526-.1953-.51184 0-.7071l4.185-4.18503c.19526-.19527.51184-.19527.70711 0 .19526.19526.19526.51184 0 .7071L6.33653 8.18506l3.83148 3.83144c.19526.1953.19526.5119 0 .7071Z" + fill={themeColor(fill)({ theme })} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/ChevronRightIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/ChevronRightIcon.tsx new file mode 100644 index 00000000000..eb09bb6fd29 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/ChevronRightIcon.tsx @@ -0,0 +1,37 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 ChevronRightIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M5.83199 3.2764c.19527-.1953.51185-.1953.70711 0l4.185 4.18499c.1953.19526.1953.51184 0 .7071l-4.185 4.18503c-.19526.19527-.51184.19527-.70711 0-.19526-.19526-.19526-.51184 0-.7071l3.83148-3.83148L5.83199 3.9835c-.19526-.1953-.19526-.5119 0-.7071Z" + fill={themeColor(fill)({ theme })} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/ClockIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/ClockIcon.tsx new file mode 100644 index 00000000000..6c8a8231438 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/ClockIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { ClockIcon as OcticonClockIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconClock from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const ClockIcon = OcticonHoc(OcticonClockIcon, 'ClockIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/CloseIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/CloseIcon.tsx new file mode 100644 index 00000000000..2c0daebf409 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/CloseIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { XIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconX from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const CloseIcon = OcticonHoc(XIcon, 'CloseIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/CodeEllipsisIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/CodeEllipsisIcon.tsx new file mode 100644 index 00000000000..481419392e0 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/CodeEllipsisIcon.tsx @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { IconProps } from '../../components/icons/Icon'; +import { UnfoldDownIcon } from './UnfoldDownIcon'; +import { UnfoldIcon } from './UnfoldIcon'; +import { UnfoldUpIcon } from './UnfoldUpIcon'; + +export const enum CodeEllipsisDirection { + Up = 'up', + Down = 'down', + Middle = 'middle', +} + +interface Props extends IconProps { + direction: CodeEllipsisDirection; +} + +export function CodeEllipsisIcon({ direction, ...props }: Readonly<Props>) { + if (direction === CodeEllipsisDirection.Up) { + return <UnfoldUpIcon {...props} />; + } else if (direction === CodeEllipsisDirection.Down) { + return <UnfoldDownIcon {...props} />; + } + return <UnfoldIcon {...props} />; +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/CodeSmellIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/CodeSmellIcon.tsx new file mode 100644 index 00000000000..e68cc4113e3 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/CodeSmellIcon.tsx @@ -0,0 +1,42 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconCodeSmell from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function CodeSmellIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <path + d="M8,15.1a7,7,0,1,0-7-7A7,7,0,0,0,8,15.1Zm.74-8.9,1.46-2.52a.29.29,0,0,1,.25-.14.3.3,0,0,1,.15,0,5.26,5.26,0,0,1,2.61,4.53.28.28,0,0,1-.29.29H10a.28.28,0,0,1-.29-.29,1.78,1.78,0,0,0-.88-1.51A.29.29,0,0,1,8.75,6.2Zm.11,3.44A.23.23,0,0,1,9,9.6a.29.29,0,0,1,.25.14l1.46,2.52a.18.18,0,0,1,0,.13.3.3,0,0,1-.15.27,5.3,5.3,0,0,1-5.23,0,.3.3,0,0,1-.1-.4L6.73,9.74A.29.29,0,0,1,7,9.6a.23.23,0,0,1,.14,0A1.79,1.79,0,0,0,8.86,9.64ZM5.33,3.59a.3.3,0,0,1,.41.1L7.2,6.21a.29.29,0,0,1-.1.4,1.79,1.79,0,0,0-.87,1.51.28.28,0,0,1-.29.29H3a.32.32,0,0,1-.32-.29A5.26,5.26,0,0,1,5.33,3.59Z" + fill={themeColor(fill)({ theme })} + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/CollapseIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/CollapseIcon.tsx new file mode 100644 index 00000000000..5040cc57804 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/CollapseIcon.tsx @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconCollapse from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function CollapseIcon({ fill = 'currentColor', ...iconProps }: Readonly<IconProps>) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M2.82364 9h4.146a.25.25 0 0 1 .25.25v4.146a.2499.2499 0 0 1-.04199.1391.2503.2503 0 0 1-.11227.0923.24953.24953 0 0 1-.14463.0142.24976.24976 0 0 1-.12811-.0686l-1.543-1.543-2.98844 2.9884a.75009.75009 0 0 1-.52453.2012.75044.75044 0 0 1-.5171-.2196.75.75 0 0 1-.01837-1.0416L4.18964 10.97l-1.543-1.543a.24997.24997 0 0 1-.05439-.27273A.24995.24995 0 0 1 2.82364 9ZM13.396 7.24258H9.24996a.25.25 0 0 1-.25-.25v-4.146a.25.25 0 0 1 .427-.177l1.54304 1.543 3.0112-3.01129a.74997.74997 0 0 1 1.0416.01838.75042.75042 0 0 1 .2196.5171.75005.75005 0 0 1-.2012.52452L12.03 5.27258l1.543 1.543a.2505.2505 0 0 1 .0686.12811.25036.25036 0 0 1-.0142.14463.2503.2503 0 0 1-.0923.11227.2499.2499 0 0 1-.1391.04199Z" + fill={themeColor(fill)({ theme })} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/CommentIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/CommentIcon.tsx new file mode 100644 index 00000000000..f47270b3eba --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/CommentIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { CommentIcon as OcticonCommentIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconComment from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const CommentIcon = OcticonHoc(OcticonCommentIcon, 'CommentIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/CopyIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/CopyIcon.tsx new file mode 100644 index 00000000000..700f8612465 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/CopyIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { CopyIcon as OcticonCopyIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconCopy from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const CopyIcon = OcticonHoc(OcticonCopyIcon, 'CopyIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/DirectoryIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/DirectoryIcon.tsx new file mode 100644 index 00000000000..c3dcaed09df --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/DirectoryIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { FileDirectoryIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconDirectory from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const DirectoryIcon = OcticonHoc(FileDirectoryIcon, 'DirectoryIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/DotFillIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/DotFillIcon.tsx new file mode 100644 index 00000000000..de58443fb59 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/DotFillIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { DotFillIcon as OcticonDotFillIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconDot with the isFilled prop from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const DotFillIcon = OcticonHoc(OcticonDotFillIcon, 'DotFillIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/DraggableIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/DraggableIcon.tsx new file mode 100644 index 00000000000..07c38690112 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/DraggableIcon.tsx @@ -0,0 +1,45 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 styled from '@emotion/styled'; +import { themeColor, themeContrast } from '../../helpers/theme'; +import { CustomIcon, IconProps } from './Icon'; + +export function DraggableIcon({ + fill = 'currentColor', + ...iconProps +}: IconProps & { x: number; y: number }) { + const theme = useTheme(); + const fillColor = themeColor(fill)({ theme }); + const innerFillColor = themeContrast(fill)({ theme }); + + return ( + <StyledCustomIcon {...iconProps}> + <circle cx="8" cy="8" fill={fillColor} r="8" /> + <rect fill={innerFillColor} height="7" width="1" x="6" y="5" /> + <rect fill={innerFillColor} height="7" width="1" x="9" y="5" /> + </StyledCustomIcon> + ); +} + +const StyledCustomIcon = styled(CustomIcon)` + cursor: ew-resize; +`; diff --git a/server/sonar-web/src/main/js/design-system/components/icons/ExecutionFlowIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/ExecutionFlowIcon.tsx new file mode 100644 index 00000000000..6a3a37d101e --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/ExecutionFlowIcon.tsx @@ -0,0 +1,39 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 ExecutionFlowIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + const fillColor = themeColor(fill)({ theme }); + + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M8.8928 7.89282C9.10919 7.67643 9.23076 7.38294 9.23076 7.07692C9.23076 6.7709 9.10919 6.47742 8.8928 6.26103C8.67642 6.04464 8.38293 5.92308 8.07691 5.92308C7.77089 5.92308 7.47741 6.04464 7.26102 6.26103C7.04463 6.47742 6.92307 6.7709 6.92307 7.07692C6.92307 7.38294 7.04463 7.67643 7.26102 7.89282C7.47741 8.1092 7.77089 8.23077 8.07691 8.23077C8.38293 8.23077 8.67642 8.1092 8.8928 7.89282ZM8.8928 3.96974C9.10919 3.75335 9.23076 3.45987 9.23076 3.15385C9.23076 2.84783 9.10919 2.55434 8.8928 2.33795C8.67642 2.12157 8.38293 2 8.07691 2C7.77089 2 7.47741 2.12157 7.26102 2.33795C7.04463 2.55434 6.92307 2.84783 6.92307 3.15385C6.92307 3.45987 7.04463 3.75335 7.26102 3.96974C7.47741 4.18613 7.77089 4.30769 8.07691 4.30769C8.38293 4.30769 8.67642 4.18613 8.8928 3.96974ZM9.54553 13.3917C9.15603 13.7812 8.62776 14 8.07692 14C7.52609 14 6.99782 13.7812 6.60832 13.3917C6.21882 13.0022 6 12.4739 6 11.9231C6 11.3722 6.21882 10.844 6.60832 10.4545C6.99782 10.065 7.52609 9.84615 8.07692 9.84615C8.62776 9.84615 9.15603 10.065 9.54553 10.4545C9.93503 10.844 10.1538 11.3722 10.1538 11.9231C10.1538 12.4739 9.93503 13.0022 9.54553 13.3917ZM7.58739 11.4335C7.71722 11.3037 7.89331 11.2308 8.07692 11.2308C8.26053 11.2308 8.43663 11.3037 8.56646 11.4335C8.69629 11.5634 8.76923 11.7395 8.76923 11.9231C8.76923 12.1067 8.69629 12.2828 8.56646 12.4126C8.43663 12.5424 8.26053 12.6154 8.07692 12.6154C7.89331 12.6154 7.71722 12.5424 7.58739 12.4126C7.45756 12.2828 7.38462 12.1067 7.38462 11.9231C7.38462 11.7395 7.45756 11.5634 7.58739 11.4335Z" + fill={fillColor} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/ExpandIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/ExpandIcon.tsx new file mode 100644 index 00000000000..de74960e9e9 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/ExpandIcon.tsx @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconExpand from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function ExpandIcon({ fill = 'currentColor', ...iconProps }: Readonly<IconProps>) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M10.604 1h4.146a.24994.24994 0 0 1 .25.25v4.146a.24966.24966 0 0 1-.042.13913.24968.24968 0 0 1-.1122.09226.25028.25028 0 0 1-.1447.01423.25034.25034 0 0 1-.1281-.06862L13.03 4.03l-2.9884 2.98838a.75002.75002 0 0 1-1.06001-1.06L11.97 2.97l-1.543-1.543a.25047.25047 0 0 1-.0686-.1281.25035.25035 0 0 1 .0142-.14463.25027.25027 0 0 1 .0923-.11228A.25.25 0 0 1 10.604 1ZM5.39608 14.9813h-4.146a.2499.2499 0 0 1-.17677-.0732.25007.25007 0 0 1-.07323-.1768v-4.146a.25001.25001 0 0 1 .04199-.1391.25037.25037 0 0 1 .11228-.0923.24953.24953 0 0 1 .14463-.0142.24973.24973 0 0 1 .1281.0686l1.543 1.543L5.98132 8.94a.75.75 0 0 1 1.06 1.06l-3.01124 3.0113 1.543 1.543a.24987.24987 0 0 1 .06862.1281.24996.24996 0 0 1-.10649.2569.24964.24964 0 0 1-.13913.042Z" + fill={themeColor(fill)({ theme })} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/FileIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/FileIcon.tsx new file mode 100644 index 00000000000..fb2a67c26e5 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/FileIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { FileIcon as OcticonFileIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconFile from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const FileIcon = OcticonHoc(OcticonFileIcon, 'FileIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/FilterIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/FilterIcon.tsx new file mode 100644 index 00000000000..40a4701b8a6 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/FilterIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { FilterIcon as Icon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconFilter from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const FilterIcon = OcticonHoc(Icon, 'FilterIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/FlagErrorIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/FlagErrorIcon.tsx new file mode 100644 index 00000000000..ec53a97d751 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/FlagErrorIcon.tsx @@ -0,0 +1,41 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconError from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function FlagErrorIcon({ fill = 'iconError', ...iconProps }: IconProps) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + <path + d="M7.364 1.707a1 1 0 0 1 1.414 0l5.657 5.657a1 1 0 0 1 0 1.414l-5.657 5.657a1 1 0 0 1-1.414 0L1.707 8.778a1 1 0 0 1 0-1.414l5.657-5.657ZM7 5a1 1 0 0 1 2 0v3a1 1 0 1 1-2 0V5Zm1 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" + style={{ fill: themeColor(fill)({ theme }) }} + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/FlagInfoIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/FlagInfoIcon.tsx new file mode 100644 index 00000000000..04bb2a9cedd --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/FlagInfoIcon.tsx @@ -0,0 +1,41 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconInfo from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function FlagInfoIcon({ fill = 'iconInfo', ...iconProps }: IconProps) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + <path + d="M14 8A6 6 0 1 1 2 8a6 6 0 0 1 12 0Zm-5 3a1 1 0 1 1-2 0V8a1 1 0 0 1 2 0v3ZM8 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" + style={{ fill: themeColor(fill)({ theme }) }} + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/FlagSuccessIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/FlagSuccessIcon.tsx new file mode 100644 index 00000000000..06a597a4983 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/FlagSuccessIcon.tsx @@ -0,0 +1,41 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconCheckCircle from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function FlagSuccessIcon({ fill = 'iconSuccess', ...iconProps }: IconProps) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + <path + d="M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12Zm3.207-6.793a1 1 0 0 0-1.414-1.414L7 8.586 5.707 7.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0l3.5-3.5Z" + style={{ fill: themeColor(fill)({ theme }) }} + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/FlagWarningIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/FlagWarningIcon.tsx new file mode 100644 index 00000000000..8f4e1441d80 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/FlagWarningIcon.tsx @@ -0,0 +1,42 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconWarning from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function FlagWarningIcon({ fill = 'iconWarning', ...iconProps }: IconProps) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + <path + d="M14.41 12.55a1 1 0 0 1-.893 1.45H2.625a1 1 0 0 1-.892-1.45L7.178 1.766a1 1 0 0 1 1.786 0l5.445 10.782ZM7 6a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0V6Zm1 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" + style={{ fill: themeColor(fill)({ theme }) }} + /> + </CustomIcon> + ); +} +FlagWarningIcon.displayName = 'FlagWarningIcon'; diff --git a/server/sonar-web/src/main/js/design-system/components/icons/HelperHintIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/HelperHintIcon.tsx new file mode 100644 index 00000000000..08b33e90c88 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/HelperHintIcon.tsx @@ -0,0 +1,61 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { Fragment } from 'react'; +import { themeColor, themeContrast } from '../../helpers/theme'; +import { CustomIcon, IconProps } from './Icon'; + +type Props = IconProps & { + raised?: boolean; +}; + +/** @deprecated Use IconQuestionMark from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function HelperHintIcon({ raised, ...iconProps }: Props) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + {raised ? ( + // eslint-disable-next-line react/jsx-fragments + <Fragment> + <circle cx="8" cy="8" fill="var(--echoes-color-icon-subdued)" r="7" /> + <path + d="M6.82812 10.2301H8.44318V10.0852C8.4517 9.25426 8.75 8.86648 9.4233 8.46165C10.2202 7.98864 10.7401 7.36222 10.7401 6.3608C10.7401 4.86932 9.53835 4 7.84659 4C6.29972 4 5.03835 4.80966 5 6.5142H6.73864C6.7642 5.8196 7.27983 5.44886 7.83807 5.44886C8.41335 5.44886 8.87784 5.83239 8.87784 6.42472C8.87784 6.98295 8.47301 7.35369 7.94886 7.68608C7.23295 8.13778 6.83239 8.59375 6.82812 10.0852V10.2301ZM7.66761 12.9574C8.21307 12.9574 8.68608 12.5014 8.69034 11.9347C8.68608 11.3764 8.21307 10.9205 7.66761 10.9205C7.10511 10.9205 6.64063 11.3764 6.64489 11.9347C6.64063 12.5014 7.10511 12.9574 7.66761 12.9574Z" + fill="var(--echoes-color-icon-subdued)" + /> + </Fragment> + ) : ( + // eslint-disable-next-line react/jsx-fragments + <Fragment> + <circle cx="8" cy="8" fill={themeColor('iconHelperHint')({ theme })} r="7" /> + <path + d="M6.82812 10.2301h1.61506v-.1449c.00852-.83094.30682-1.21872.98012-1.62355.7969-.47301 1.3168-1.09943 1.3168-2.10085C10.7401 4.86932 9.53835 4 7.84659 4 6.29972 4 5.03835 4.80966 5 6.5142h1.73864c.02556-.6946.54119-1.06534 1.09943-1.06534.57528 0 1.03977.38353 1.03977.97586 0 .55823-.40483.92897-.92898 1.26136-.71591.4517-1.11647.90767-1.12074 2.39912v.1449Zm.83949 2.7273c.54546 0 1.01847-.456 1.02273-1.0227-.00426-.5583-.47727-1.0142-1.02273-1.0142-.5625 0-1.02698.4559-1.02272 1.0142-.00426.5667.46022 1.0227 1.02272 1.0227Z" + fill={themeContrast('iconHelperHint')({ theme })} + /> + </Fragment> + )} + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/HomeFillIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/HomeFillIcon.tsx new file mode 100644 index 00000000000..f4e93da93d7 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/HomeFillIcon.tsx @@ -0,0 +1,42 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconHome with the isFilled prop from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function HomeFillIcon({ fill = 'iconFavorite', ...iconProps }: IconProps) { + const theme = useTheme(); + const fillColor = themeColor(fill)({ theme }); + return ( + <CustomIcon {...iconProps}> + <path + d="M6.9995 0.280296C6.602 0.280296 6.21634 0.415622 5.906 0.664003L0.657 4.864C0.242 5.196 0 5.699 0 6.23V13.25C0 13.7141 0.184374 14.1593 0.512563 14.4874C0.840752 14.8156 1.28587 15 1.75 15H5.25C5.44891 15 5.63968 14.921 5.78033 14.7803C5.92098 14.6397 6 14.4489 6 14.25V9H8V14.25C8 14.4489 8.07902 14.6397 8.21967 14.7803C8.36032 14.921 8.55109 15 8.75 15H12.25C12.7141 15 13.1592 14.8156 13.4874 14.4874C13.8156 14.1593 14 13.7141 14 13.25V6.231C14 5.699 13.758 5.196 13.343 4.864L8.093 0.664003C7.78266 0.415622 7.397 0.280296 6.9995 0.280296Z" + fill={fillColor} + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/HomeIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/HomeIcon.tsx new file mode 100644 index 00000000000..9b350fdfff5 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/HomeIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { HomeIcon as OcticonHomeIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconHome from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const HomeIcon = OcticonHoc(OcticonHomeIcon, 'HomeIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/Icon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/Icon.tsx new file mode 100644 index 00000000000..17d1b67d3d1 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/Icon.tsx @@ -0,0 +1,127 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { OcticonProps } from '@primer/octicons-react'; +import React from 'react'; +import { theme } from 'twin.macro'; +import { themeColor } from '../../helpers/theme'; +import { CSSColor, ThemeColors } from '../../types/theme'; + +interface Props { + 'aria-hidden'?: boolean | 'true' | 'false'; + 'aria-label'?: string; + children: React.ReactNode; + className?: string; + description?: React.ReactNode; +} + +/** @deprecated Use IconProps from Echoes instead. + * + * Some of the props have been dropped: + * - ~`aria-hidden`~ is now inferred from the absence of an `aria-label` + * - ~`data-guiding-id`~ is no longer passed down to the DOM, put it on a wrapper instead + * - ~`description`~ doesn't exist anymore + * - ~`fill`~ is now `color`. You can use "echoes-colors-icons-*" design tokens for the `color` + * prop. Without a specific `color`, icons take the color of their surroundings (currentColor) + * or have an intrinsic color. + * - ~`height`~ doesn't exist anymore, icons are sized based on the font-size of their parent + * - ~`transform`~ doesn't exist anymore + * - ~`viewbox`~ doesn't exist anymore, icons are sized based on the font-size of their parent + * - ~`width`~ doesn't exist anymore, icons are sized based on the font-size of their parent + */ +export interface IconProps extends Omit<Props, 'children'> { + ['data-guiding-id']?: string; + fill?: ThemeColors | CSSColor; + height?: number; + transform?: string; + viewBox?: string; + width?: number; +} + +const PIXELS_IN_ONE_REM = 16; + +function convertRemToPixel(remString: string) { + return Number(remString.replace('rem', '')) * PIXELS_IN_ONE_REM; +} + +/** @deprecated Don't create new icons based on this, use the ones from Echoes instead. */ +export function CustomIcon(props: Props) { + const { + 'aria-label': ariaLabel, + 'aria-hidden': ariaHidden, + children, + className, + description, + ...iconProps + } = props; + return ( + <svg + aria-hidden={ariaHidden ?? (ariaLabel ? 'false' : 'true')} + aria-label={ariaLabel} + className={className} + fill="none" + height={convertRemToPixel(theme('height.icon'))} + role="img" + style={{ + clipRule: 'evenodd', + display: 'inline-block', + fillRule: 'evenodd', + userSelect: 'none', + verticalAlign: 'middle', + strokeLinejoin: 'round', + strokeMiterlimit: 1.414, + }} + version="1.1" + viewBox="0 0 16 16" + width={convertRemToPixel(theme('width.icon'))} + xmlSpace="preserve" + xmlnsXlink="http://www.w3.org/1999/xlink" + {...iconProps} + > + {description && <desc>{description}</desc>} + {children} + </svg> + ); +} + +/** @deprecated Don't create new icons based on this, use the ones from Echoes instead. */ +export function OcticonHoc( + WrappedOcticon: React.ComponentType<React.PropsWithChildren<OcticonProps>>, + displayName?: string, +): React.ComponentType<React.PropsWithChildren<IconProps>> { + function IconWrapper({ fill, ...props }: IconProps) { + const theme = useTheme(); + + const size = props.width ?? props.height ?? 'small'; + + return ( + <WrappedOcticon + fill={fill && themeColor(fill)({ theme })} + size={size} + verticalAlign="middle" + {...props} + /> + ); + } + + IconWrapper.displayName = displayName ?? WrappedOcticon.displayName ?? WrappedOcticon.name; + return IconWrapper; +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/InProgressVisual.tsx b/server/sonar-web/src/main/js/design-system/components/icons/InProgressVisual.tsx new file mode 100644 index 00000000000..5000ba8ea83 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/InProgressVisual.tsx @@ -0,0 +1,107 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { keyframes, useTheme } from '@emotion/react'; +import styled from '@emotion/styled'; +import { themeColor } from '../../helpers/theme'; + +export function InProgressVisual() { + const theme = useTheme(); + + return ( + <svg className="svg-animated" height="168" width="168" xmlns="http://www.w3.org/2000/svg"> + <path + d="M149 151.15v-61.5c-6 48.4-49.17 61.34-70 61.5h70Z" + fill={themeColor('illustrationShade')({ theme })} + /> + <path + d="M50.94 16.79 34 9.79 37.8 4l13.14 12.79ZM48.5 24.46 38 27.93V21l10.5 3.46ZM125.55 37.07l3.63-9.07 5.1 4.7-8.73 4.37ZM125 43.46 141.5 40v6.93L125 43.46ZM56.93 10.59 50 2.57 56.51 0l.42 10.59Z" + fill={themeColor('illustrationPrimary')({ theme })} + /> + <path + d="M19 57.15v95h8v-95h-8ZM33 73.15h15v-8H33v8ZM56 73.15h15v-8H56v8Z" + fill={themeColor('illustrationSecondary')({ theme })} + /> + <path + clipRule="evenodd" + d="M20 157a7 7 0 0 1-7-7V61a7 7 0 0 1 7-7h28.5v6H20a1 1 0 0 0-1 1v16.88h63v6.24H19V150a1 1 0 0 0 1 1h128a1 1 0 0 0 1-1V61a1 1 0 0 0-1-1h-11v-6h11a7 7 0 0 1 7 7v89a7 7 0 0 1-7 7H20Z" + fill="var(--echoes-color-icon-subdued)" + fillRule="evenodd" + /> + <path + clipRule="evenodd" + d="M91 112.15H66v-6h25v6ZM62.09 129.5 48.6 142.54l-8.72-8.61 4.22-4.27 4.55 4.49 9.25-8.97 4.18 4.32ZM62.09 105.31 48.6 118.35l-8.72-8.6 4.22-4.28 4.55 4.5L57.9 101l4.18 4.31ZM91 137.34H66v-6h25v6Z" + fill={themeColor('illustrationSecondary')({ theme })} + fillRule="evenodd" + /> + <Wheel> + <path + clipRule="evenodd" + d="m115.17 46.11-7.2-4.15a24.21 24.21 0 0 0 1.72-6.41H118v-6.1h-8.31c-.28-2.24-.87-4.4-1.72-6.4l7.2-4.16-3.05-5.28-7.2 4.16a24.55 24.55 0 0 0-4.69-4.7l4.16-7.2-5.28-3.04-4.15 7.2a24.21 24.21 0 0 0-6.41-1.72V0h-6.1v8.31c-2.24.28-4.4.87-6.4 1.72l-4.16-7.2-5.28 3.05 4.16 7.2a24.52 24.52 0 0 0-4.7 4.69l-7.2-4.16-3.04 5.28 7.2 4.15a24.2 24.2 0 0 0-1.72 6.41H53v6.1h8.31c.28 2.24.87 4.4 1.72 6.4l-7.2 4.16 3.05 5.28 7.2-4.16a24.52 24.52 0 0 0 4.69 4.7l-4.16 7.2 5.28 3.04 4.15-7.2c2.02.85 4.17 1.44 6.41 1.72V65h6.1v-8.31a24.2 24.2 0 0 0 6.4-1.72l4.16 7.2 5.28-3.05-4.16-7.2a24.51 24.51 0 0 0 4.7-4.69l7.2 4.16 3.04-5.28ZM85.5 51a18.5 18.5 0 1 0 0-37 18.5 18.5 0 0 0 0 37Z" + fill={themeColor('illustrationPrimary')({ theme })} + fillRule="evenodd" + /> + </Wheel> + <path + clipRule="evenodd" + d="M73 32.5a12.5 12.5 0 0 0 25 0h6a18.5 18.5 0 1 1-37 0h6Z" + fill={themeColor('illustrationInlineBorder')({ theme })} + fillRule="evenodd" + /> + <WheelInverted> + <path + clipRule="evenodd" + d="m105.3 54.74 4.74-2.74 1.93 3.34a18.95 18.95 0 0 1 14.2.06l1.97-3.4 4.74 2.74-1.98 3.44A18.98 18.98 0 0 1 137.76 70H142v6h-4.24a18.98 18.98 0 0 1-6.98 11.91l2.1 3.65-4.74 2.74-2.1-3.64a18.95 18.95 0 0 1-13.93.05l-2.07 3.6-4.74-2.75 2.05-3.55A18.98 18.98 0 0 1 100.24 76H96v-6h4.24a18.98 18.98 0 0 1 6.99-11.91l-1.93-3.35ZM119 86a13 13 0 1 0 0-26 13 13 0 0 0 0 26Z" + fill={themeColor('illustrationSecondary')({ theme })} + fillRule="evenodd" + /> + </WheelInverted> + <circle cx="119" cy="73" fill={themeColor('illustrationPrimary')({ theme })} r="5" /> + </svg> + ); +} + +const rotateKeyFrame = keyframes` + from { + transform: rotateZ(0deg); + } + to { + transform: rotateZ(360deg); + } +`; + +const rotateKeyFrameInverse = keyframes` + from { + transform: rotateZ(360deg); + } + to { + transform: rotateZ(0deg); + } +`; + +const Wheel = styled.g` + transform-origin: 85.5px 32.5px 0; + animation: ${rotateKeyFrame} 3s infinite; +`; + +const WheelInverted = styled.g` + transform-origin: 119px 73px 0; + animation: ${rotateKeyFrameInverse} 3s infinite; +`; diff --git a/server/sonar-web/src/main/js/design-system/components/icons/InheritanceIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/InheritanceIcon.tsx new file mode 100644 index 00000000000..6aa6c41ba47 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/InheritanceIcon.tsx @@ -0,0 +1,65 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconInheritance from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function InheritanceIcon({ fill = 'currentColor', ...iconProps }: Readonly<IconProps>) { + const theme = useTheme(); + const fillColor = themeColor(fill)({ theme }); + return ( + <CustomIcon {...iconProps}> + <mask fill="white" id="path-1-inside-1_3266_8058"> + <rect height="6" rx="0.5" width="6" x="1" y="1" /> + </mask> + <rect + height="6" + mask="url(#path-1-inside-1_3266_8058)" + rx="0.5" + stroke={fillColor} + strokeWidth="3" + width="6" + x="1" + y="1" + /> + <mask fill="white" id="path-2-inside-2_3266_8058"> + <rect height="6" rx="0.5" width="6" x="9" y="9" /> + </mask> + <rect + height="6" + mask="url(#path-2-inside-2_3266_8058)" + rx="0.5" + stroke={fillColor} + strokeWidth="3" + width="6" + x="9" + y="9" + /> + <path d="M4 7V11C4 11.5523 4.44772 12 5 12H9" stroke={fillColor} strokeWidth="1.5" /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/IssueLocationIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/IssueLocationIcon.tsx new file mode 100644 index 00000000000..d9b9fe01199 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/IssueLocationIcon.tsx @@ -0,0 +1,45 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconDot with the isFilled prop from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function IssueLocationIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + const fillColor = themeColor(fill)({ theme }); + + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M8 11C8.79565 11 9.55871 10.6839 10.1213 10.1213C10.6839 9.55871 11 8.79565 11 8C11 7.20435 10.6839 6.44129 10.1213 5.87868C9.55871 5.31607 8.79565 5 8 5C7.20435 5 6.44129 5.31607 5.87868 5.87868C5.31607 6.44129 5 7.20435 5 8C5 8.79565 5.31607 9.55871 5.87868 10.1213C6.44129 10.6839 7.20435 11 8 11ZM8 7C7.73478 7 7.48043 7.10536 7.29289 7.29289C7.10536 7.48043 7 7.73478 7 8C7 8.26522 7.10536 8.51957 7.29289 8.70711C7.48043 8.89464 7.73478 9 8 9C8.26522 9 8.51957 8.89464 8.70711 8.70711C8.89464 8.51957 9 8.26522 9 8C9 7.73478 8.89464 7.48043 8.70711 7.29289C8.51957 7.10536 8.26522 7 8 7Z" + fill={fillColor} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/IssueTypeIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/IssueTypeIcon.tsx new file mode 100644 index 00000000000..a9efdaaac8c --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/IssueTypeIcon.tsx @@ -0,0 +1,65 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { IssueType } from '../../types'; +import { BugIcon } from './BugIcon'; +import { CodeSmellIcon } from './CodeSmellIcon'; +import { IconProps } from './Icon'; +import { SecurityFindingIcon } from './SecurityFindingIcon'; +import { VulnerabilityIcon } from './VulnerabilityIcon'; + +export interface Props extends IconProps { + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents + type: string | IssueType; +} + +export enum IssueTypeEnum { + CODE_SMELL = 'CODE_SMELL', + VULNERABILITY = 'VULNERABILITY', + BUG = 'BUG', + SECURITY_HOTSPOT = 'SECURITY_HOTSPOT', +} + +export function IssueTypeIcon({ type, ...iconProps }: Props) { + switch (type.toLowerCase()) { + case IssueTypeEnum.BUG.toLowerCase(): + case 'bugs': + case 'new_bugs': + case IssueTypeEnum.BUG: + return <BugIcon {...iconProps} />; + case IssueTypeEnum.VULNERABILITY.toLowerCase(): + case 'vulnerabilities': + case 'new_vulnerabilities': + case IssueTypeEnum.VULNERABILITY: + return <VulnerabilityIcon {...iconProps} />; + case IssueTypeEnum.CODE_SMELL.toLowerCase(): + case 'code_smells': + case 'new_code_smells': + case IssueTypeEnum.CODE_SMELL: + return <CodeSmellIcon {...iconProps} />; + case IssueTypeEnum.SECURITY_HOTSPOT.toLowerCase(): + case 'security_hotspots': + case 'new_security_hotspots': + case IssueTypeEnum.SECURITY_HOTSPOT: + return <SecurityFindingIcon {...iconProps} />; + default: + return null; + } +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/LinkIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/LinkIcon.tsx new file mode 100644 index 00000000000..9eb16f90403 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/LinkIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { LinkIcon as Icon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconLink from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const LinkIcon = OcticonHoc(Icon, 'LinkIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/LockIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/LockIcon.tsx new file mode 100644 index 00000000000..e2aba5a119b --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/LockIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { LockIcon as OcticonLockIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconLock from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const LockIcon = OcticonHoc(OcticonLockIcon, 'LockIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/MainBranchIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/MainBranchIcon.tsx new file mode 100644 index 00000000000..0de937e2687 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/MainBranchIcon.tsx @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconBranch from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function MainBranchIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M8.251 2.49932a.75003.75003 0 0 0-.75.75.75001.75001 0 1 0 .75-.75Zm-2.25.75A2.25004 2.25004 0 0 1 7.21713 1.2516a2.25 2.25 0 0 1 2.33319.16148 2.24917 2.24917 0 0 1 .76538.94287c.1639.37851.2206.79478.1639 1.20334a2.25026 2.25026 0 0 1-.48534 1.11323 2.25 2.25 0 0 1-.99326.6988v5.25598c.50069.177.92271.5252 1.1915.9832.2687.458.3669.9963.2771 1.5197a2.25092 2.25092 0 0 1-2.2186 1.8705 2.25092 2.25092 0 0 1-2.21861-1.8705 2.25115 2.25115 0 0 1 .27716-1.5197 2.2514 2.2514 0 0 1 1.19145-.9832V5.37132a2.24999 2.24999 0 0 1-1.5-2.122Zm2.25 8.74998a.74985.74985 0 0 0-.53033.2197.74987.74987 0 0 0-.21967.5303c0 .1989.07902.3897.21967.5304a.75017.75017 0 0 0 1.06066 0 .75023.75023 0 0 0 .21967-.5304.74983.74983 0 0 0-.21967-.5303.74981.74981 0 0 0-.53033-.2197Z" + fill={themeColor(fill)({ theme })} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/MenuHelpIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/MenuHelpIcon.tsx new file mode 100644 index 00000000000..ed38a889edb --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/MenuHelpIcon.tsx @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconQuestionMark from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function MenuHelpIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16Zm.507-5.451H6.66v-.166c.005-1.704.462-2.226 1.28-2.742.6-.38 1.062-.803 1.062-1.441 0-.677-.53-1.116-1.188-1.116-.638 0-1.227.424-1.257 1.218H4.571c.044-1.948 1.486-2.873 3.254-2.873 1.933 0 3.307.993 3.307 2.698 0 1.144-.595 1.86-1.505 2.4-.77.463-1.11.906-1.12 1.856v.166Zm.282 1.948a1.185 1.185 0 0 1-1.169 1.169 1.164 1.164 0 1 1 0-2.328c.624 0 1.164.52 1.169 1.159Z" + fill={themeColor(fill)({ theme })} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/MenuIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/MenuIcon.tsx new file mode 100644 index 00000000000..3a3dbe9c129 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/MenuIcon.tsx @@ -0,0 +1,33 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 styled from '@emotion/styled'; +import { KebabHorizontalIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconMoreVertical from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const MenuIcon = styled(OcticonHoc(KebabHorizontalIcon, 'MenuIcon'))` + transform: rotate(90deg); +`; diff --git a/server/sonar-web/src/main/js/design-system/components/icons/MenuSearchIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/MenuSearchIcon.tsx new file mode 100644 index 00000000000..081e8adebfc --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/MenuSearchIcon.tsx @@ -0,0 +1,44 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconSearch from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function MenuSearchIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M12 7c0 2.76142-2.23858 5-5 5S2 9.76142 2 7s2.23858-5 5-5 5 2.23858 5 5Zm-.8078 5.6064C10.0236 13.4816 8.57234 14 7 14c-3.86599 0-7-3.134-7-7 0-3.86599 3.13401-7 7-7 3.866 0 7 3.13401 7 7 0 1.57234-.5184 3.0236-1.3936 4.1922l3.0505 3.0504c.3905.3906.3905 1.0237 0 1.4143-.3906.3905-1.0237.3905-1.4143 0l-3.0504-3.0505Z" + fill={themeColor(fill)({ theme })} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/MinimizeIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/MinimizeIcon.tsx new file mode 100644 index 00000000000..127e3918343 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/MinimizeIcon.tsx @@ -0,0 +1,38 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconDash from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function MinimizeIcon({ fill = 'currentColor', ...iconProps }: Readonly<IconProps>) { + const theme = useTheme(); + return ( + <CustomIcon {...iconProps}> + <rect fill={themeColor(fill)({ theme })} height="2" rx="1" width="12" x="2" y="11" /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/NoDataIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/NoDataIcon.tsx new file mode 100644 index 00000000000..49e891e77c4 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/NoDataIcon.tsx @@ -0,0 +1,50 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { CustomIcon, IconProps } from './Icon'; + +export interface NoDataIconProps extends IconProps { + size?: 'xs' | 'sm' | 'md'; +} + +const SIZES: Record<NonNullable<NoDataIconProps['size']>, number> = { + xs: 16, + sm: 24, + md: 36, +}; + +export function NoDataIcon({ + fill = 'currentColor', + size = 'md', + ...iconProps +}: Readonly<NoDataIconProps>) { + const iconSize = SIZES[size]; + + return ( + <CustomIcon height={iconSize} width={iconSize} {...iconProps}> + <path + clipRule="evenodd" + d="M16 8C16 12.4183 12.4183 16 8 16C5.5106 16 3.28676 14.863 1.81951 13.0799L15.4913 5.1865C15.8201 6.06172 16 7.00986 16 8ZM14.5574 3.41624L0.750565 11.3876C0.269025 10.3589 0 9.21089 0 8C0 3.58172 3.58172 0 8 0C10.7132 0 13.1109 1.35064 14.5574 3.41624Z" + fill="#E1E6F3" + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/OpenCloseIndicator.tsx b/server/sonar-web/src/main/js/design-system/components/icons/OpenCloseIndicator.tsx new file mode 100644 index 00000000000..19db514b28b --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/OpenCloseIndicator.tsx @@ -0,0 +1,31 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { ChevronDownIcon } from './ChevronDownIcon'; +import { ChevronRightIcon } from './ChevronRightIcon'; +import { IconProps } from './Icon'; + +interface Props extends IconProps { + open: boolean; +} + +export function OpenCloseIndicator({ open, ...iconProps }: Props) { + return open ? <ChevronDownIcon {...iconProps} /> : <ChevronRightIcon {...iconProps} />; +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/OpenNewTabIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/OpenNewTabIcon.tsx new file mode 100644 index 00000000000..b5ca3715322 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/OpenNewTabIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { LinkExternalIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconLinkExternal from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const OpenNewTabIcon = OcticonHoc(LinkExternalIcon, 'OpenNewTabIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/OverridenIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/OverridenIcon.tsx new file mode 100644 index 00000000000..d9b40bea4b4 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/OverridenIcon.tsx @@ -0,0 +1,45 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 OverridenIcon({ fill = 'currentColor', ...iconProps }: Readonly<IconProps>) { + const theme = useTheme(); + const fillColor = themeColor(fill)({ theme }); + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M2.5 2.5L2.5 5.5L5.5 5.5L5.5 2.5L2.5 2.5ZM1.5 1C1.22386 1 1 1.22386 1 1.5L0.999999 6.5C0.999999 6.77614 1.22386 7 1.5 7L6.5 7C6.77614 7 7 6.77614 7 6.5L7 1.5C7 1.22386 6.77614 1 6.5 1L1.5 1Z" + fill={fillColor} + fillRule="evenodd" + /> + <path + clipRule="evenodd" + d="M3.25 11V7H4.78913V11C4.78913 11.1381 4.90398 11.25 5.04565 11.25H9.15V12.75H5.04565C4.05394 12.75 3.25 11.9665 3.25 11Z" + fill={fillColor} + fillRule="evenodd" + /> + <circle cx="11.5" cy="11.5" fill={fillColor} r="3.5" /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/OverviewQGNotComputedIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/OverviewQGNotComputedIcon.tsx new file mode 100644 index 00000000000..2d1122133fd --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/OverviewQGNotComputedIcon.tsx @@ -0,0 +1,136 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +interface Props { + className?: string; +} + +export function OverviewQGNotComputedIcon({ className }: Readonly<Props>) { + const theme = useTheme(); + + return ( + <svg + className={className} + fill="none" + height="168" + role="img" + viewBox="0 0 168 168" + width="168" + xmlns="http://www.w3.org/2000/svg" + > + <path + clipRule="evenodd" + d="M149.542 26.472L141.248 37.2099C140.456 38.2345 140.645 39.7068 141.67 40.4983C142.695 41.2897 144.167 41.1007 144.959 40.076L153.253 29.3382C154.044 28.3135 153.855 26.8413 152.831 26.0498C151.806 25.2583 150.334 25.4473 149.542 26.472ZM137.915 45.3598C141.625 48.2252 146.955 47.5408 149.82 43.8312L158.114 33.0934C160.98 29.3837 160.295 24.0536 156.586 21.1883C152.876 18.3229 147.546 19.0072 144.681 22.7168L136.386 33.4547C133.521 37.1643 134.205 42.4944 137.915 45.3598Z" + fill={themeColor('illustrationPrimary')({ theme })} + fillRule="evenodd" + /> + <path + clipRule="evenodd" + d="M149.385 57.9371C149.385 46.1503 139.83 36.5952 128.043 36.5952C116.257 36.5952 106.702 46.1503 106.702 57.9371C106.702 69.7238 116.257 79.2789 128.043 79.2789C139.83 79.2789 149.385 69.7238 149.385 57.9371ZM155.528 57.9371C155.528 42.7576 143.223 30.4523 128.043 30.4523C112.864 30.4523 100.559 42.7576 100.559 57.9371C100.559 73.1165 112.864 85.4218 128.043 85.4218C143.223 85.4218 155.528 73.1165 155.528 57.9371Z" + fill={themeColor('illustrationPrimary')({ theme })} + fillRule="evenodd" + /> + <path + clipRule="evenodd" + d="M143.6 57.937C143.6 49.3459 136.635 42.3814 128.044 42.3814C119.453 42.3814 112.489 49.3459 112.489 57.937C112.489 66.5281 119.453 73.4925 128.044 73.4925C136.635 73.4925 143.6 66.528 143.6 57.937ZM149.743 57.937C149.743 45.9532 140.028 36.2385 128.044 36.2385C116.06 36.2385 106.346 45.9532 106.346 57.937C106.346 69.9207 116.06 79.6355 128.044 79.6355C140.028 79.6355 149.743 69.9207 149.743 57.937Z" + fill={themeColor('illustrationShade')({ theme })} + fillRule="evenodd" + /> + <path d="M24 40L24 135H32L32 40H24Z" fill={themeColor('illustrationSecondary')({ theme })} /> + <path + d="M38 56L53 56L53 48L38 48L38 56Z" + fill={themeColor('illustrationSecondary')({ theme })} + /> + <path + d="M61 56L76 56L76 48L61 48L61 56Z" + fill={themeColor('illustrationSecondary')({ theme })} + /> + <path + clipRule="evenodd" + d="M88 67.5746H21V61.3297H88V67.5746Z" + fill="var(--echoes-color-icon-subdued)" + fillRule="evenodd" + /> + <path + clipRule="evenodd" + d="M18 133C18 136.866 21.134 140 25 140H153C156.866 140 160 136.866 160 133V78H154V133C154 133.552 153.552 134 153 134H25C24.4477 134 24 133.552 24 133V44C24 43.4477 24.4477 43 25 43H72V37H25C21.134 37 18 40.134 18 44V133Z" + fill="var(--echoes-color-icon-subdued)" + fillRule="evenodd" + /> + <path + clipRule="evenodd" + d="M69.2432 103.219L78.7954 93.6672L74.5527 89.4245L60.7578 103.219L74.5527 117.014L78.7954 112.771L69.2432 103.219Z" + fill={themeColor('illustrationSecondary')({ theme })} + fillRule="evenodd" + /> + <path + clipRule="evenodd" + d="M108.906 103.219L99.3538 93.6672L103.596 89.4246L117.391 103.219L103.596 117.014L99.3538 112.771L108.906 103.219Z" + fill={themeColor('illustrationSecondary')({ theme })} + fillRule="evenodd" + /> + <path + clipRule="evenodd" + d="M81.7179 119.862L91.0929 84.2365L96.8953 85.7635L87.5203 121.388L81.7179 119.862Z" + fill={themeColor('illustrationSecondary')({ theme })} + fillRule="evenodd" + /> + <path + d="M51 128.953C51 141.379 40.9264 151.453 28.5 151.453C16.0736 151.453 6 141.379 6 128.953C6 116.526 16.0736 106.453 28.5 106.453C40.9264 106.453 51 116.526 51 128.953Z" + fill={themeColor('illustrationPrimary')({ theme })} + /> + <path + clipRule="evenodd" + d="M25 131.953V113.953H31V131.953H25Z" + fill={themeColor('backgroundSecondary')({ theme })} + fillRule="evenodd" + /> + <path + clipRule="evenodd" + d="M25 142.453L25 136.453L31 136.453L31 142.453L25 142.453Z" + fill={themeColor('backgroundSecondary')({ theme })} + fillRule="evenodd" + /> + <path + d="M105.398 35.2089L90.7238 24.2245L95.8489 19.5626L105.398 35.2089Z" + fill={themeColor('illustrationPrimary')({ theme })} + /> + <path + d="M99 41.5242L88.5 44.9883L88.5 38.0601L99 41.5242Z" + fill={themeColor('illustrationPrimary')({ theme })} + /> + <path + d="M139.228 86.8865L147.417 92.2112L141.826 96.3028L139.228 86.8865Z" + fill={themeColor('illustrationPrimary')({ theme })} + /> + <path + d="M132 88.5242L135.464 105.024H128.536L132 88.5242Z" + fill={themeColor('illustrationPrimary')({ theme })} + /> + <path + d="M114 29.5242L110.536 19.7742L117.464 19.7742L114 29.5242Z" + fill={themeColor('illustrationPrimary')({ theme })} + /> + </svg> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/OverviewQGPassedIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/OverviewQGPassedIcon.tsx new file mode 100644 index 00000000000..86c6324373e --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/OverviewQGPassedIcon.tsx @@ -0,0 +1,95 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 ( + <svg + className={className} + fill="none" + height="136" + role="img" + viewBox="0 0 154 136" + width="154" + xmlns="http://www.w3.org/2000/svg" + > + <path + d="M18 26.3839L18 128.594H26L26 26.3839H18Z" + fill={themeColor('illustrationSecondary')({ theme })} + /> + <path + d="M32 43.5982L47 43.5982L47 34.9911L32 34.9911L32 43.5982Z" + fill={themeColor('illustrationSecondary')({ theme })} + /> + <path + d="M55 43.5982L70 43.5982L70 34.9911L55 34.9911L55 43.5982Z" + fill={themeColor('illustrationSecondary')({ theme })} + /> + <path d="M15 52.2054L87 52.2054" stroke="var(--echoes-color-icon-subdued)" strokeWidth="6" /> + <path + d="M87 26.3839H19C16.7909 26.3839 15 28.1748 15 30.3839V126.746C15 128.955 16.7909 130.746 19 130.746H147C149.209 130.746 151 128.955 151 126.746V62.9643M136 26.3839H147C149.209 26.3839 151 28.1748 151 30.3839V42.5223" + stroke="var(--echoes-color-icon-subdued)" + strokeWidth="6" + /> + <path + d="M70.6736 103.733L59 91.1733L70.6736 78.614" + stroke={themeColor('illustrationSecondary')({ theme })} + strokeWidth="6" + /> + <path + d="M95.4744 78.614L107.148 91.1733L95.4744 103.733" + stroke={themeColor('illustrationSecondary')({ theme })} + strokeWidth="6" + /> + <path + d="M87.9937 71.5714L78.6187 109.9" + stroke={themeColor('illustrationSecondary')({ theme })} + strokeWidth="6" + /> + <ellipse + cx="22.5" + cy="122.676" + fill={themeColor('illustrationPrimary')({ theme })} + rx="22.5" + ry="22.5" + /> + <path d="M14 121.063L21 128.594L34 114.607" stroke="white" strokeWidth="6" /> + <path + d="M108.684 52.7433C116.712 48.065 123.243 41.1875 127.5 32.9269C131.757 41.1875 138.288 48.065 146.316 52.7433C138.288 57.4216 131.757 64.2991 127.5 72.5597C123.243 64.2991 116.712 57.4216 108.684 52.7433Z" + stroke={themeColor('illustrationPrimary')({ theme })} + strokeWidth="6" + /> + <path + d="M94.8732 23.1563C99.0981 20.5339 102.585 16.8739 105 12.5277C107.415 16.8739 110.902 20.5339 115.127 23.1563C110.902 25.7786 107.415 29.4386 105 33.7848C102.585 29.4386 99.0981 25.7786 94.8732 23.1563Z" + stroke={themeColor('illustrationPrimary')({ theme })} + strokeWidth="4.5" + /> + <path + d="M123.126 8.6317C124.893 7.43681 126.384 5.87768 127.5 4.06049C128.616 5.87768 130.107 7.43681 131.874 8.6317C130.107 9.82658 128.616 11.3857 127.5 13.2029C126.384 11.3857 124.893 9.82658 123.126 8.6317Z" + stroke={themeColor('illustrationPrimary')({ theme })} + strokeWidth="3" + /> + </svg> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/PencilIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/PencilIcon.tsx new file mode 100644 index 00000000000..d33a5fffa40 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/PencilIcon.tsx @@ -0,0 +1,24 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { PencilIcon as PencilOcticonIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +export const PencilIcon = OcticonHoc(PencilOcticonIcon); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/PinIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/PinIcon.tsx new file mode 100644 index 00000000000..bafc55e50d7 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/PinIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { PinIcon as OcticonPinIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconPin from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const PinIcon = OcticonHoc(OcticonPinIcon, 'PinIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/ProjectIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/ProjectIcon.tsx new file mode 100644 index 00000000000..e553f09d892 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/ProjectIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { ProjectIcon as OcticonProjectIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconProject from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const ProjectIcon = OcticonHoc(OcticonProjectIcon, 'ProjectIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/PullRequestIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/PullRequestIcon.tsx new file mode 100644 index 00000000000..0cc9b256453 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/PullRequestIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { GitPullRequestIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconPullrequest from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const PullRequestIcon = OcticonHoc(GitPullRequestIcon, 'PullRequestIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/QualifierIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/QualifierIcon.tsx new file mode 100644 index 00000000000..9021b169ee2 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/QualifierIcon.tsx @@ -0,0 +1,92 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { DirectoryIcon } from './DirectoryIcon'; +import { FileIcon } from './FileIcon'; +import { CustomIcon, IconProps } from './Icon'; +import { ProjectIcon } from './ProjectIcon'; +import { TestFileIcon } from './TestFileIcon'; + +interface Props extends IconProps { + qualifier: string | null | undefined; +} + +const defaultIconfill = 'var(--echoes-color-icon-subdued)'; + +export function QualifierIcon({ qualifier, fill, ...iconProps }: Readonly<Props>) { + const theme = useTheme(); + + if (!qualifier) { + return null; + } + + const icon = { + app: ApplicationIcon({ fill: fill ?? defaultIconfill, ...iconProps }), + dir: <DirectoryIcon fill={fill ?? themeColor('iconDirectory')({ theme })} {...iconProps} />, + fil: <FileIcon fill={fill ?? defaultIconfill} {...iconProps} />, + svw: SubPortfolioIcon({ fill: fill ?? defaultIconfill, ...iconProps }), + trk: <ProjectIcon fill={fill ?? defaultIconfill} {...iconProps} />, + uts: <TestFileIcon fill={fill ?? defaultIconfill} {...iconProps} />, + vw: PortfolioIcon({ fill: fill ?? defaultIconfill, ...iconProps }), + }[qualifier.toLowerCase()]; + + return icon ?? null; +} + +function PortfolioIcon({ fill = 'currentColor', ...iconProps }: Readonly<IconProps>) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <path + d="M14.97 14.97H1.016V1.015H14.97V14.97zm-1-12.955H2.015V13.97H13.97V2.015zm-.973 10.982H9V9h3.997v3.997zM7 12.996H3.004V9H7v3.996zM11.997 10H10v1.997h1.997V10zM6 10H4.004v1.996H6V10zm1-3H3.006V3.006H7V7zm5.985 0H9V3.015h3.985V7zM6 4.006H4.006V6H6V4.006zm5.985.009H10V6h1.985V4.015z" + fill={themeColor(fill)({ theme })} + /> + </CustomIcon> + ); +} + +function ApplicationIcon({ fill = 'currentColor', ...iconProps }: Readonly<IconProps>) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <path + d="M3.014 10.986a2 2 0 1 1-.001 4.001 2 2 0 0 1 .001-4.001zm9.984 0a2 2 0 1 1-.001 4.001 2 2 0 0 1 .001-4.001zm-5.004-.021c1.103 0 2 .896 2 2s-.897 2-2 2a2 2 0 0 1 0-4zm-4.98 1.021a1 1 0 1 1 0 2 1 1 0 0 1 0-2zm9.984 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2zm-5.004-.021a1 1 0 1 1 0 2 1 1 0 0 1 0-2zM2.984 6a2 2 0 1 1-.001 4.001A2 2 0 0 1 2.984 6zm9.984 0a2 2 0 1 1-.001 4.001A2 2 0 0 1 12.968 6zm-5.004-.021c1.103 0 2 .897 2 2a2 2 0 1 1-2-2zM2.984 7a1 1 0 1 1 0 2 1 1 0 0 1 0-2zm9.984 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2zm-5.004-.021a1.001 1.001 0 0 1 0 2 1 1 0 0 1 0-2zM3 1.025a2 2 0 1 1-.001 4.001A2 2 0 0 1 3 1.025zm9.984 0a2 2 0 1 1-.001 4.001 2 2 0 0 1 .001-4.001zM7.98 1.004c1.103 0 2 .896 2 2s-.897 2-2 2a2 2 0 0 1 0-4zM3 2.025a1 1 0 1 1 0 2 1 1 0 0 1 0-2zm9.984 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2zM7.98 2.004a1.001 1.001 0 0 1 0 2 1 1 0 0 1 0-2z" + fill={themeColor(fill)({ theme })} + /> + </CustomIcon> + ); +} + +function SubPortfolioIcon({ fill = 'currentColor', ...iconProps }: Readonly<IconProps>) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <path + d="M14 7h2v9H7v-2H0V0h14v7zM8 8v7h7V8H8zm3 6H9v-2h2v2zm3 0h-2v-2h2v2zm-1-7V1H1v12h6V7h6zm-7 5H2V8h4v4zm5-1H9V9h2v2zm3 0h-2V9h2v2zM5 9H3v2h2V9zm1-3H2V2h4v4zm6 0H8V2h4v4zM5 3H3v2h2V3zm6 0H9v2h2V3z" + fill={themeColor(fill)({ theme })} + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/RecommendedIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/RecommendedIcon.tsx new file mode 100644 index 00000000000..7a8be83a51b --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/RecommendedIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { VerifiedIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconRecommended from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const RecommendedIcon = OcticonHoc(VerifiedIcon, 'RecommendedIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/RequiredIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/RequiredIcon.tsx new file mode 100644 index 00000000000..b410de80d2a --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/RequiredIcon.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 styled from '@emotion/styled'; +import tw from 'twin.macro'; +import { themeColor } from '../../helpers/theme'; + +export function RequiredIcon(props: React.ComponentPropsWithoutRef<'em'>) { + return <StyledEm {...props}>*</StyledEm>; +} + +export const StyledEm = styled.em` + ${tw`sw-typo-default`} + ${tw`sw-not-italic`} + ${tw`sw-ml-2`} + color: ${themeColor('inputRequired')}; +`; diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SearchIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SearchIcon.tsx new file mode 100644 index 00000000000..cc02b360ee6 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SearchIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { SearchIcon as OcticonSearchIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconSearch from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const SearchIcon = OcticonHoc(OcticonSearchIcon, 'SearchIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SecurityFindingIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SecurityFindingIcon.tsx new file mode 100644 index 00000000000..a0a3ef93a0c --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SecurityFindingIcon.tsx @@ -0,0 +1,44 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconSecurityFinding from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function SecurityFindingIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + const fillColor = themeColor(fill)({ theme }); + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M13.2114 3.76857a.8571.8571 0 0 0-.5743-.66L8.13714 1.85714a.90869.90869 0 0 0-.42857 0l-4.5 1.25143c-.3046.08786-.52937.34618-.57429.66-.06857.48857-.63428 4.82572.97715 7.12283a7.7138 7.7138 0 0 0 4.11428 2.9657.72308.72308 0 0 0 .19714 0 .66187.66187 0 0 0 .18857 0 7.65392 7.65392 0 0 0 4.12288-2.9657c1.5732-2.27896 1.0457-6.56583.9786-7.11053l-.0015-.0123Zm-1.6028 4.08857a5.27096 5.27096 0 0 1-.7372 2.07429A6.78813 6.78813 0 0 1 8 12.1429V7.85714h3.6086Zm-3.6086 0H4.22a20.81886 20.81886 0 0 1 0-3.27428L8 3.57143v4.28571Z" + fill={fillColor} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SecurityHotspotIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SecurityHotspotIcon.tsx new file mode 100644 index 00000000000..c8298df6614 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SecurityHotspotIcon.tsx @@ -0,0 +1,42 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconSecurityFinding from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function SecurityHotspotIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <path + d="M14.08 3.23a1 1 0 00-.67-.77L8.16 1a1.06 1.06 0 00-.5 0L2.41 2.46a.94.94 0 00-.67.77c-.08.57-.74 5.63 1.14 8.31A9 9 0 007.68 15a.85.85 0 00.23 0 .78.78 0 00.22 0 8.93 8.93 0 004.81-3.46c1.85-2.68 1.21-7.74 1.14-8.31zM12.21 8a6.15 6.15 0 01-.86 2.42A7.92 7.92 0 018 13V8zM8 3v5H3.59a24.29 24.29 0 010-3.82z" + fill={themeColor(fill)({ theme })} + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SeparatorCircleIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SeparatorCircleIcon.tsx new file mode 100644 index 00000000000..8b880e89742 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SeparatorCircleIcon.tsx @@ -0,0 +1,33 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 styled from '@emotion/styled'; +import tw from 'twin.macro'; +import { themeBorder, themeColor } from '../../helpers/theme'; + +export const SeparatorCircleIcon = styled.div` + ${tw`sw-inline-block`} + ${tw`sw-rounded-1`} + + background-color: ${themeColor('separatorCircle')}; + border: ${themeBorder('default', 'separatorCircle')}; + height: 2px; + width: 2px; +`; diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SeverityBlockerIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SeverityBlockerIcon.tsx new file mode 100644 index 00000000000..bea88299489 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SeverityBlockerIcon.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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, themeContrast } from '../../helpers/theme'; +import { CustomIcon, IconProps } from './Icon'; + +export function SeverityBlockerIcon({ fill = 'iconSeverityMajor', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <circle cx="8" cy="8" fill={themeColor(fill)({ theme })} r="7" /> + <rect fill={themeContrast(fill)({ theme })} height="1.5" rx="0.75" width="6" x="5" y="7.2" /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SeverityCriticalIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SeverityCriticalIcon.tsx new file mode 100644 index 00000000000..7fa0a5a99fb --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SeverityCriticalIcon.tsx @@ -0,0 +1,37 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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, themeContrast } from '../../helpers/theme'; +import { CustomIcon, IconProps } from './Icon'; + +export function SeverityCriticalIcon({ fill = 'iconSeverityMajor', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <circle cx="8" cy="8" fill={themeColor(fill)({ theme })} r="7" /> + <path + d="M5 6.67113C5 6.56986 5.05583 6.47727 5.14421 6.43198L7.88334 5.02823C7.95678 4.99059 8.04322 4.99059 8.11666 5.02823L10.8558 6.43198C10.9442 6.47727 11 6.56986 11 6.67113V10.7324C11 10.9191 10.8181 11.0483 10.6475 10.9827L8.0916 10.0003C8.03254 9.97763 7.96746 9.97763 7.9084 10.0003L5.35247 10.9827C5.18192 11.0483 5 10.9191 5 10.7324V6.67113Z" + fill={themeContrast(fill)({ theme })} + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SeverityInfoIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SeverityInfoIcon.tsx new file mode 100644 index 00000000000..a35b214a78a --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SeverityInfoIcon.tsx @@ -0,0 +1,45 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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, themeContrast } from '../../helpers/theme'; +import { CustomIcon, IconProps } from './Icon'; + +/** @deprecated Use IconInfo from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function SeverityInfoIcon({ fill = 'iconSeverityInfo', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <circle cx="8" cy="8" fill={themeColor(fill)({ theme })} r="7" /> + <path + clipRule="evenodd" + d="M6.5 7.75C6.5 7.55109 6.57902 7.36032 6.71967 7.21967C6.86032 7.07902 7.05109 7 7.25 7H8.25C8.44891 7 8.63968 7.07902 8.78033 7.21967C8.92098 7.36032 9 7.55109 9 7.75V10.5H9.25C9.44891 10.5 9.63968 10.579 9.78033 10.7197C9.92098 10.8603 10 11.0511 10 11.25C10 11.4489 9.92098 11.6397 9.78033 11.7803C9.63968 11.921 9.44891 12 9.25 12H7.25C7.05109 12 6.86032 11.921 6.71967 11.7803C6.57902 11.6397 6.5 11.4489 6.5 11.25C6.5 11.0511 6.57902 10.8603 6.71967 10.7197C6.86032 10.579 7.05109 10.5 7.25 10.5H7.5V8.5H7.25C7.05109 8.5 6.86032 8.42098 6.71967 8.28033C6.57902 8.13968 6.5 7.94891 6.5 7.75ZM8 6C8.26522 6 8.51957 5.89464 8.70711 5.70711C8.89464 5.51957 9 5.26522 9 5C9 4.73478 8.89464 4.48043 8.70711 4.29289C8.51957 4.10536 8.26522 4 8 4C7.73478 4 7.48043 4.10536 7.29289 4.29289C7.10536 4.48043 7 4.73478 7 5C7 5.26522 7.10536 5.51957 7.29289 5.70711C7.48043 5.89464 7.73478 6 8 6Z" + fill={themeContrast(fill)({ theme })} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SeverityMajorIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SeverityMajorIcon.tsx new file mode 100644 index 00000000000..87f073b5305 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SeverityMajorIcon.tsx @@ -0,0 +1,40 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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, themeContrast } from '../../helpers/theme'; +import { CustomIcon, IconProps } from './Icon'; + +export function SeverityMajorIcon({ fill = 'iconSeverityMajor', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <circle cx="8" cy="8" fill={themeColor(fill)({ theme })} r="7" /> + <path + d="M10.7678 9.5 8 6.73223 5.23223 9.5" + stroke={themeContrast(fill)({ theme })} + strokeLinecap="round" + strokeLinejoin="round" + strokeWidth="1.5" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SeverityMinorIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SeverityMinorIcon.tsx new file mode 100644 index 00000000000..fa8828169b6 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SeverityMinorIcon.tsx @@ -0,0 +1,40 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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, themeContrast } from '../../helpers/theme'; +import { CustomIcon, IconProps } from './Icon'; + +export function SeverityMinorIcon({ fill = 'iconSeverityMinor', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <circle cx="8" cy="8" fill={themeColor(fill)({ theme })} r="7" /> + <path + d="M5.23223 6.93223L8 9.7L10.7678 6.93223" + stroke={themeContrast(fill)({ theme })} + strokeLinecap="round" + strokeLinejoin="round" + strokeWidth="1.5" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SnoozeCircleIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SnoozeCircleIcon.tsx new file mode 100644 index 00000000000..7d8319c664a --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SnoozeCircleIcon.tsx @@ -0,0 +1,46 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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, themeContrast } from '../../helpers'; +import { ThemeColors } from '../../types'; +import { CustomIcon, IconProps } from './Icon'; + +interface SnoozeCircleIconProps extends IconProps { + color?: ThemeColors; +} + +export function SnoozeCircleIcon(props: Readonly<SnoozeCircleIconProps>) { + const { color = 'overviewCardWarningIcon', ...rest } = props; + const theme = useTheme(); + + const bgColor = themeColor(color)({ theme }); + const iconColor = themeContrast(color)({ theme }); + + return ( + <CustomIcon height="36" viewBox="0 0 36 36" width="36" {...rest}> + <circle cx="18" cy="18" fill={bgColor} r="18" /> + <path + d="M16.5319 17.2149H18.4624L15.7318 20.2936C15.3281 20.7536 15.6658 21.4613 16.2897 21.4613H19.4681C19.8718 21.4613 20.2021 21.1428 20.2021 20.7536C20.2021 20.3643 19.8718 20.0458 19.4681 20.0458H17.5376L20.2682 16.9672C20.6719 16.5072 20.3342 15.7994 19.7103 15.7994H16.5319C16.1282 15.7994 15.7979 16.1179 15.7979 16.5072C15.7979 16.8964 16.1282 17.2149 16.5319 17.2149ZM24.8265 13.9735C24.5696 14.2707 24.1071 14.3132 23.7915 14.0655L21.538 12.2537C21.2297 11.9989 21.1857 11.553 21.4499 11.2558C21.7069 10.9585 22.1693 10.9161 22.4849 11.1638L24.7384 12.9756C25.0467 13.2304 25.0907 13.6762 24.8265 13.9735ZM11.1735 13.9735C11.4304 14.2778 11.8929 14.3132 12.2012 14.0655L14.4546 12.2537C14.7703 11.9989 14.8143 11.553 14.5501 11.2558C14.2931 10.9514 13.8307 10.9161 13.5224 11.1638L11.2616 12.9756C10.9533 13.2304 10.9093 13.6762 11.1735 13.9735ZM18 13.6762C20.8334 13.6762 23.1382 15.8985 23.1382 18.6304C23.1382 21.3622 20.8334 23.5845 18 23.5845C15.1666 23.5845 12.8618 21.3622 12.8618 18.6304C12.8618 15.8985 15.1666 13.6762 18 13.6762ZM18 12.2608C14.3519 12.2608 11.3937 15.1129 11.3937 18.6304C11.3937 22.1478 14.3519 25 18 25C21.6481 25 24.6063 22.1478 24.6063 18.6304C24.6063 15.1129 21.6481 12.2608 18 12.2608Z" + fill={iconColor} + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityBlockerIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityBlockerIcon.tsx new file mode 100644 index 00000000000..65451a5ddd6 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityBlockerIcon.tsx @@ -0,0 +1,45 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; +import { CustomIcon, IconProps } from './Icon'; + +export function SoftwareImpactSeverityBlockerIcon({ + disabled, + ...iconProps +}: IconProps & { disabled?: boolean }) { + const theme = useTheme(); + + const color = disabled + ? 'var(--echoes-color-icon-disabled)' + : themeColor('iconSoftwareImpactSeverityBlocker')({ theme }); + + return ( + <CustomIcon viewBox="0 0 14 14" {...iconProps}> + <path + clipRule="evenodd" + d="M7 13.375C10.5208 13.375 13.375 10.5208 13.375 7C13.375 3.47918 10.5208 0.625 7 0.625C3.47918 0.625 0.625 3.47918 0.625 7C0.625 10.5208 3.47918 13.375 7 13.375ZM4 6C3.44772 6 3 6.44772 3 7C3 7.55228 3.44772 8 4 8H10C10.5523 8 11 7.55228 11 7C11 6.44772 10.5523 6 10 6H4Z" + fill={color} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityHighIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityHighIcon.tsx new file mode 100644 index 00000000000..e9734376f44 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityHighIcon.tsx @@ -0,0 +1,45 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; +import { CustomIcon, IconProps } from './Icon'; + +export function SoftwareImpactSeverityHighIcon({ + disabled, + ...iconProps +}: IconProps & { disabled?: boolean }) { + const theme = useTheme(); + + const color = disabled + ? 'var(--echoes-color-icon-disabled)' + : themeColor('iconSoftwareImpactSeverityHigh')({ theme }); + + return ( + <CustomIcon viewBox="0 0 14 14" {...iconProps}> + <path + clipRule="evenodd" + d="M7 13.375C10.5208 13.375 13.375 10.5208 13.375 7C13.375 3.47918 10.5208 0.625 7 0.625C3.47918 0.625 0.625 3.47918 0.625 7C0.625 10.5208 3.47918 13.375 7 13.375ZM4.3983 5.57213C4.31781 5.61338 4.26697 5.6977 4.26697 5.78993V9.48856C4.26697 9.65858 4.43265 9.77626 4.58796 9.71657L6.91569 8.82188C6.96948 8.80121 7.02875 8.80121 7.08253 8.82188L9.41026 9.71657C9.56557 9.77626 9.73125 9.65858 9.73125 9.48856V5.78993C9.73125 5.6977 9.68041 5.61338 9.59992 5.57213L7.10536 4.29371C7.03847 4.25944 6.95975 4.25944 6.89286 4.29371L4.3983 5.57213Z" + fill={color} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityInfoIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityInfoIcon.tsx new file mode 100644 index 00000000000..62490f2c572 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityInfoIcon.tsx @@ -0,0 +1,47 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 styled from '@emotion/styled'; +import { IconInfo } from '@sonarsource/echoes-react'; +import { IconProps } from './Icon'; + +const defaultIconSize = 15; + +export function SoftwareImpactSeverityInfoIcon({ + disabled, + ...iconProps +}: IconProps & { disabled?: boolean }) { + const color = disabled ? 'echoes-color-icon-disabled' : 'echoes-color-icon-info'; + + return <StyledIconInfo color={color} {...iconProps} />; +} + +// Info icon is the only one that is imported from echoes, so we need to adjust its size +const StyledIconInfo = styled(IconInfo)` + ${(props: IconProps & { disabled?: boolean }) => { + let size = props.width ?? props.height; + size = size ? size + 1 : defaultIconSize; + + return ` + font-size: ${size}px; + margin-left: -0.5px; + `; + }}; +`; diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityLowIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityLowIcon.tsx new file mode 100644 index 00000000000..012f9436b69 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityLowIcon.tsx @@ -0,0 +1,45 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; +import { CustomIcon, IconProps } from './Icon'; + +export function SoftwareImpactSeverityLowIcon({ + disabled, + ...iconProps +}: IconProps & { disabled?: boolean }) { + const theme = useTheme(); + + const color = disabled + ? 'var(--echoes-color-icon-disabled)' + : themeColor('iconSoftwareImpactSeverityLow')({ theme }); + + return ( + <CustomIcon viewBox="0 0 14 14" {...iconProps}> + <path + clipRule="evenodd" + d="M7 13.375C10.5208 13.375 13.375 10.5208 13.375 7C13.375 3.47918 10.5208 0.625 7 0.625C3.47918 0.625 0.625 3.47918 0.625 7C0.625 10.5208 3.47918 13.375 7 13.375ZM3.94899 6.55761L6.46964 9.07825C6.76253 9.37115 7.2374 9.37115 7.5303 9.07825L10.0509 6.55761C10.3438 6.26472 10.3438 5.78984 10.0509 5.49695C9.75805 5.20406 9.28317 5.20406 8.99028 5.49695L6.99997 7.48727L5.00965 5.49695C4.71676 5.20406 4.24188 5.20406 3.94899 5.49695C3.6561 5.78984 3.6561 6.26472 3.94899 6.55761Z" + fill={color} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityMediumIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityMediumIcon.tsx new file mode 100644 index 00000000000..bcf632761d1 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SoftwareImpactSeverityMediumIcon.tsx @@ -0,0 +1,45 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; +import { CustomIcon, IconProps } from './Icon'; + +export function SoftwareImpactSeverityMediumIcon({ + disabled, + ...iconProps +}: IconProps & { disabled?: boolean }) { + const theme = useTheme(); + + const color = disabled + ? 'var(--echoes-color-icon-disabled)' + : themeColor('iconSoftwareImpactSeverityMedium')({ theme }); + + return ( + <CustomIcon viewBox="0 0 14 14" {...iconProps}> + <path + clipRule="evenodd" + d="M7 13.375C10.5208 13.375 13.375 10.5208 13.375 7C13.375 3.47918 10.5208 0.625 7 0.625C3.47918 0.625 0.625 3.47918 0.625 7C0.625 10.5208 3.47918 13.375 7 13.375ZM10.051 7.83547L7.53033 5.31482C7.23744 5.02193 6.76256 5.02193 6.46967 5.31482L3.94903 7.83547C3.65613 8.12836 3.65613 8.60324 3.94903 8.89613C4.24192 9.18902 4.71679 9.18902 5.00969 8.89613L7 6.90581L8.99031 8.89613C9.28321 9.18902 9.75808 9.18902 10.051 8.89613C10.3439 8.60324 10.3439 8.12836 10.051 7.83547Z" + fill={color} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SortAscendIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SortAscendIcon.tsx new file mode 100644 index 00000000000..2f85106888e --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SortAscendIcon.tsx @@ -0,0 +1,24 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { SortAscIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +export const SortAscendIcon = OcticonHoc(SortAscIcon, 'SortAscendIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/SortDescendIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/SortDescendIcon.tsx new file mode 100644 index 00000000000..99634592da0 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/SortDescendIcon.tsx @@ -0,0 +1,24 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { SortDescIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +export const SortDescendIcon = OcticonHoc(SortDescIcon, 'SortDescendIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/StarFillIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/StarFillIcon.tsx new file mode 100644 index 00000000000..6fcdd73f8d4 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/StarFillIcon.tsx @@ -0,0 +1,37 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 styled from '@emotion/styled'; +import { StarFillIcon as OcticonStarFillIcon } from '@primer/octicons-react'; +import { themeColor } from '../../helpers'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconStar with the isFilled prop from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const StarFillIcon = styled(OcticonHoc(OcticonStarFillIcon))` + // provide a default fill color that is different from the default icon + fill: ${themeColor('iconFavorite')}; +`; + +StarFillIcon.displayName = 'StarFillIcon'; diff --git a/server/sonar-web/src/main/js/design-system/components/icons/StarIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/StarIcon.tsx new file mode 100644 index 00000000000..d3106b1e560 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/StarIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { StarIcon as OcticonStarIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconStar from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const StarIcon = OcticonHoc(OcticonStarIcon, 'StarIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/StatusConfirmedIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/StatusConfirmedIcon.tsx new file mode 100644 index 00000000000..078e87740e1 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/StatusConfirmedIcon.tsx @@ -0,0 +1,41 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconStatusConfirmed from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function StatusConfirmedIcon({ fill = 'iconStatus', ...iconProps }: IconProps) { + const theme = useTheme(); + const fillColor = themeColor(fill)({ theme }); + + return ( + <CustomIcon {...iconProps}> + <circle cx="8" cy="8" r="6.25" stroke={fillColor} strokeWidth="1.5" /> + <circle cx="8" cy="8" fill={fillColor} r="2" /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/StatusOpenIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/StatusOpenIcon.tsx new file mode 100644 index 00000000000..f860ed59146 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/StatusOpenIcon.tsx @@ -0,0 +1,39 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconStatusOpen from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function StatusOpenIcon({ fill = 'iconStatus', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <circle cx="8" cy="8" r="6.25" stroke={themeColor(fill)({ theme })} strokeWidth="1.5" /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/StatusReopenedIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/StatusReopenedIcon.tsx new file mode 100644 index 00000000000..7c42c34f345 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/StatusReopenedIcon.tsx @@ -0,0 +1,46 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconStatusReopened from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function StatusReopenedIcon({ fill = 'iconStatus', ...iconProps }: IconProps) { + const theme = useTheme(); + const fillColor = themeColor(fill)({ theme }); + + return ( + <CustomIcon {...iconProps}> + <circle cx="8" cy="8" r="6.25" stroke={fillColor} strokeWidth="1.5" /> + <path + clipRule="evenodd" + d="M8 14c3.3137 0 6-2.6863 6-6 0-3.31371-2.6863-6-6-6v12Z" + fill={fillColor} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/StatusResolvedIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/StatusResolvedIcon.tsx new file mode 100644 index 00000000000..5a9f9478c96 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/StatusResolvedIcon.tsx @@ -0,0 +1,48 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconStatusResolved from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function StatusResolvedIcon({ + fill = 'var(--echoes-color-icon-subdued)', + ...iconProps +}: IconProps) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <circle cx="8" cy="8" fill={themeColor(fill)({ theme })} r="7" /> + <path + clipRule="evenodd" + d="M11.3105 6.22789c.2884.29737.2811.77219-.0163 1.06054L8.27211 10.25c-.29414.2852-.76273.2816-1.05244-.0081l-2-1.99999c-.29289-.2929-.29289-.76777 0-1.06066.29289-.2929.76777-.2929 1.06066 0L7.7581 8.65901 10.25 6.21158c.2974-.28835.7722-.28105 1.0605.01631Z" + fill="var(--echoes-color-icon-on-color)" + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/TestFileIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/TestFileIcon.tsx new file mode 100644 index 00000000000..bf5c541f2cd --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/TestFileIcon.tsx @@ -0,0 +1,51 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconFileCode from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function TestFileIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + const fillColor = themeColor(fill)({ theme }); + + return ( + <CustomIcon {...iconProps}> + <path + clipRule="evenodd" + d="M3.75 1.5a.25.25 0 0 0-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25V6H9.75A1.75 1.75 0 0 1 8 4.25V1.5H3.75Zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06ZM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0 1 12.25 15h-8.5A1.75 1.75 0 0 1 2 13.25V1.75Z" + fill={fillColor} + fillRule="evenodd" + /> + <path + clipRule="evenodd" + d="M8.605 11.528v-1.514l-.016-1.486.016-1.058 2.544 2.544-2.544 2.544v-1.03ZM7.545 8.5v1.514L7.56 11.5l-.017 1.058L5 10.014 7.544 7.47V8.5Z" + fill={fillColor} + fillRule="evenodd" + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/TrashIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/TrashIcon.tsx new file mode 100644 index 00000000000..63a2eb9ef13 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/TrashIcon.tsx @@ -0,0 +1,24 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { TrashIcon as BaseTrashIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +export const TrashIcon = OcticonHoc(BaseTrashIcon); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/TrendDownCircleIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/TrendDownCircleIcon.tsx new file mode 100644 index 00000000000..a52f1878b68 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/TrendDownCircleIcon.tsx @@ -0,0 +1,40 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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, themeContrast } from '../../helpers'; +import { CustomIcon, IconProps } from './Icon'; + +export function TrendDownCircleIcon(props: Readonly<IconProps>) { + const theme = useTheme(); + + const bgColor = themeColor('overviewCardSuccessIcon')({ theme }); + const iconColor = themeContrast('overviewCardSuccessIcon')({ theme }); + + return ( + <CustomIcon height="36" viewBox="0 0 36 36" width="36" {...props}> + <circle cx="18" cy="16" fill={bgColor} r="16" /> + <path + d="M23.3203 20.3404C23.3658 20.3291 23.4095 20.3116 23.4503 20.2886C23.4845 20.2687 23.5158 20.2441 23.5433 20.2156C23.567 20.1872 23.5886 20.157 23.6078 20.1254C23.6375 20.0862 23.6614 20.0428 23.6785 19.9967L23.6922 19.9051C23.7046 19.8587 23.7097 19.8107 23.7072 19.7627L23.6579 19.6389C23.6794 19.5866 23.6912 19.5308 23.6927 19.4743L22.4586 16.3778C22.3931 16.2136 22.2651 16.0821 22.1026 16.0122C21.9402 15.9424 21.7567 15.9399 21.5924 16.0054C21.4282 16.0709 21.2967 16.1989 21.2268 16.3613C21.157 16.5238 21.1545 16.7073 21.22 16.8715L21.9185 18.6241L18.0143 17.3095L18.5396 13.9999C18.5644 13.8431 18.5326 13.6826 18.4497 13.5473C18.3668 13.4119 18.2383 13.3106 18.0874 13.2615L13.1375 11.6461C13.0541 11.6189 12.9662 11.6084 12.8788 11.6152C12.7914 11.622 12.7062 11.646 12.628 11.6858C12.5499 11.7256 12.4804 11.7805 12.4235 11.8472C12.3666 11.9139 12.3234 11.9912 12.2964 12.0746C12.2485 12.2228 12.254 12.3831 12.3119 12.5277C12.348 12.6188 12.4038 12.7007 12.4751 12.7678C12.5465 12.8348 12.6318 12.8853 12.7249 12.9157L17.1303 14.3534L16.599 17.6297C16.5746 17.7848 16.6057 17.9435 16.6868 18.0779C16.7679 18.2123 16.8939 18.3137 17.0425 18.3643L21.1545 19.7683L19.7302 20.336C19.5659 20.4015 19.4344 20.5295 19.3646 20.6919C19.2947 20.8544 19.2923 21.0379 19.3577 21.2021C19.4232 21.3664 19.5512 21.4979 19.7137 21.5677C19.8761 21.6376 20.0596 21.64 20.2238 21.5746L23.3203 20.3404Z" + fill={iconColor} + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/TrendIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/TrendIcon.tsx new file mode 100644 index 00000000000..9b0ec6dc79a --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/TrendIcon.tsx @@ -0,0 +1,86 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 styled from '@emotion/styled'; +import { + IconArrowDownRight, + IconArrowUpRight, + IconEqual, + IconProps, +} from '@sonarsource/echoes-react'; +import { themeColor } from '../../helpers/theme'; +import { CSSColor, ThemeColors } from '../../types'; + +export const enum TrendDirection { + Down = 'down', + Up = 'up', + Equal = 'equal', +} + +export const enum TrendType { + Positive = 'positive', + Negative = 'negative', + Neutral = 'neutral', + Disabled = 'disabled', +} + +interface Props extends IconProps { + direction: TrendDirection; + type: TrendType; +} + +export function TrendIcon(props: Readonly<Props>) { + const { direction, type, ...iconProps } = props; + + if (direction === TrendDirection.Up) { + return ( + <TrendIconWrapper trendType={type}> + <IconArrowUpRight aria-label="trend-up" {...iconProps} /> + </TrendIconWrapper> + ); + } + + if (direction === TrendDirection.Down) { + return ( + <TrendIconWrapper trendType={type}> + <IconArrowDownRight aria-label="trend-down" {...iconProps} /> + </TrendIconWrapper> + ); + } + + return ( + <TrendIconWrapper trendType={type}> + <IconEqual aria-label="trend-equal" {...iconProps} /> + </TrendIconWrapper> + ); +} + +const ICON_COLORS: Record<TrendType, ThemeColors | CSSColor> = { + [TrendType.Positive]: 'iconTrendPositive', + [TrendType.Negative]: 'iconTrendNegative', + [TrendType.Neutral]: 'iconTrendNeutral', + [TrendType.Disabled]: 'var(--echoes-color-icon-disabled)', +}; + +const TrendIconWrapper = styled.span<{ + trendType: TrendType; +}>` + color: ${({ trendType }) => themeColor(ICON_COLORS[trendType])}; +`; diff --git a/server/sonar-web/src/main/js/design-system/components/icons/TrendUpCircleIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/TrendUpCircleIcon.tsx new file mode 100644 index 00000000000..89e9077b0a1 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/TrendUpCircleIcon.tsx @@ -0,0 +1,47 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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, themeContrast } from '../../helpers'; +import { CustomIcon, IconProps } from './Icon'; + +export function TrendUpCircleIcon(props: Readonly<IconProps>) { + const theme = useTheme(); + + const bgColor = themeColor('overviewCardErrorIcon')({ theme }); + const iconColor = themeContrast('overviewCardErrorIcon')({ theme }); + + return ( + <CustomIcon height="36" viewBox="0 0 36 36" width="36" {...props}> + <circle cx="18" cy="18" fill={bgColor} r="18" /> + <g clipPath="url(#clip0_2971_11471)"> + <path + d="M20.8955 12.253C20.7186 12.1492 20.5107 12.1169 20.3175 12.1633C20.1242 12.2096 19.9615 12.3308 19.8652 12.5001C19.7688 12.6695 19.7467 12.8732 19.8036 13.0663C19.8605 13.2595 19.9919 13.4263 20.1688 13.5301L21.7029 14.4305L16.8273 15.1807C16.6524 15.2084 16.4961 15.2967 16.386 15.43C16.276 15.5633 16.2193 15.7331 16.2258 15.9094L16.4151 19.6577L11.2365 20.409C11.1385 20.4231 11.0453 20.4562 10.9621 20.5065C10.879 20.5568 10.8076 20.6233 10.752 20.7022C10.6963 20.7811 10.6576 20.8708 10.6379 20.9662C10.6183 21.0617 10.6181 21.161 10.6374 21.2584C10.6567 21.3559 10.6952 21.4496 10.7505 21.5343C10.8059 21.619 10.877 21.6929 10.96 21.7518C11.0429 21.8108 11.136 21.8537 11.2339 21.8779C11.3318 21.9022 11.4327 21.9075 11.5306 21.8934L17.3493 21.0493C17.5267 21.0238 17.6858 20.9361 17.798 20.802C17.9101 20.668 17.968 20.4964 17.9612 20.3181L17.8022 16.5791L22.3971 15.8686L21.3833 17.6502C21.287 17.8195 21.2648 18.0232 21.3218 18.2163C21.3787 18.4095 21.5101 18.5763 21.687 18.6802C21.8639 18.784 22.0718 18.8163 22.265 18.7699C22.4583 18.7236 22.6209 18.6024 22.7173 18.4331L24.5341 15.2403C24.5768 15.1605 24.6052 15.0735 24.6182 14.983L24.6157 14.8623C24.6171 14.8187 24.6153 14.7749 24.6102 14.7313C24.5971 14.6769 24.576 14.6244 24.5477 14.5753C24.5303 14.5366 24.51 14.4991 24.487 14.4631C24.4598 14.4263 24.4278 14.3931 24.3918 14.3646C24.3477 14.3042 24.293 14.2519 24.2305 14.2103L20.8955 12.253Z" + fill={iconColor} + /> + </g> + <defs> + <clipPath id="clip0_2971_11471"> + <rect fill="white" height="18" transform="translate(9 9)" width="18" /> + </clipPath> + </defs> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/TriangleDownIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/TriangleDownIcon.tsx new file mode 100644 index 00000000000..2fb7ea858e1 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/TriangleDownIcon.tsx @@ -0,0 +1,24 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { TriangleDownIcon as Octicon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +export const TriangleDownIcon = OcticonHoc(Octicon); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/TriangleLeftIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/TriangleLeftIcon.tsx new file mode 100644 index 00000000000..53ec906cea1 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/TriangleLeftIcon.tsx @@ -0,0 +1,24 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { TriangleLeftIcon as Octicon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +export const TriangleLeftIcon = OcticonHoc(Octicon); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/TriangleRightIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/TriangleRightIcon.tsx new file mode 100644 index 00000000000..386af1e5adc --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/TriangleRightIcon.tsx @@ -0,0 +1,24 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { TriangleRightIcon as Octicon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +export const TriangleRightIcon = OcticonHoc(Octicon); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/TriangleUpIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/TriangleUpIcon.tsx new file mode 100644 index 00000000000..36dcff58a32 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/TriangleUpIcon.tsx @@ -0,0 +1,24 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { TriangleUpIcon as Octicon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +export const TriangleUpIcon = OcticonHoc(Octicon); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/UnfoldDownIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/UnfoldDownIcon.tsx new file mode 100644 index 00000000000..4ab6276fd90 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/UnfoldDownIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { FoldDownIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconUnfoldDown from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const UnfoldDownIcon = OcticonHoc(FoldDownIcon, 'UnfoldDownIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/UnfoldIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/UnfoldIcon.tsx new file mode 100644 index 00000000000..7bf4b7277bd --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/UnfoldIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { UnfoldIcon as OcticonUnfoldIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconUnfold from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const UnfoldIcon = OcticonHoc(OcticonUnfoldIcon, 'UnfoldIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/UnfoldUpIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/UnfoldUpIcon.tsx new file mode 100644 index 00000000000..02f7bab9e4c --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/UnfoldUpIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { FoldUpIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconUnfoldUp from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const UnfoldUpIcon = OcticonHoc(FoldUpIcon, 'UnfoldUpIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/UserGroupIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/UserGroupIcon.tsx new file mode 100644 index 00000000000..8c4b4a7e6e9 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/UserGroupIcon.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { PeopleIcon } from '@primer/octicons-react'; +import { OcticonHoc } from './Icon'; + +/** @deprecated Use IconPeople from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export const UserGroupIcon = OcticonHoc(PeopleIcon, 'UserGroupIcon'); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/VulnerabilityIcon.tsx b/server/sonar-web/src/main/js/design-system/components/icons/VulnerabilityIcon.tsx new file mode 100644 index 00000000000..eda4bbad453 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/VulnerabilityIcon.tsx @@ -0,0 +1,42 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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'; + +/** @deprecated Use IconVulnerability from Echoes instead, if possible. + * + * Be aware that the full icon set is not yet available in Echoes, and therefore you may not be able + * to replace all of the icons yet. There are situations where it is OK to ignore this deprecation + * warning when revisiting old code, but all new code should use the icons from Echoes. + */ +export function VulnerabilityIcon({ fill = 'currentColor', ...iconProps }: IconProps) { + const theme = useTheme(); + + return ( + <CustomIcon {...iconProps}> + <path + d="M12,7.05H6V5a2,2,0,1,1,4,0,1,1,0,0,0,2,0A4,4,0,1,0,4,5V7.06A1.12,1.12,0,0,0,3,8.17V14a1.12,1.12,0,0,0,1.12,1.12H12A1.12,1.12,0,0,0,13.1,14V8.17A1.12,1.12,0,0,0,12,7.05ZM8,13a2,2,0,1,1,2-2A2,2,0,0,1,8,13Z" + fill={themeColor(fill)({ theme })} + /> + </CustomIcon> + ); +} diff --git a/server/sonar-web/src/main/js/design-system/components/icons/__tests__/Icon-test.tsx b/server/sonar-web/src/main/js/design-system/components/icons/__tests__/Icon-test.tsx new file mode 100644 index 00000000000..875785a5e99 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/__tests__/Icon-test.tsx @@ -0,0 +1,55 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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 { CheckIcon } from '@primer/octicons-react'; +import { screen } from '@testing-library/react'; +import { render } from '../../../helpers/testUtils'; +import { CustomIcon, OcticonHoc } from '../Icon'; + +it('should render custom icon correctly', () => { + render( + <CustomIcon> + <path d="test" /> + </CustomIcon>, + ); + + expect(screen.queryByRole('img')).not.toBeInTheDocument(); + expect(screen.getByRole('img', { hidden: true })).toContainHTML('<path d="test"/>'); +}); + +it('should not be hidden when aria-label is set', () => { + render( + <CustomIcon aria-label="test"> + <path d="test" /> + </CustomIcon>, + ); + + expect(screen.getByRole('img')).toBeVisible(); +}); + +describe('Octicon HOC', () => { + it('should render correctly', () => { + const Wrapped = OcticonHoc(CheckIcon, 'TestIcon'); + + render(<Wrapped aria-label="visible" />); + + expect(screen.getByRole('img')).toBeVisible(); + }); +}); diff --git a/server/sonar-web/src/main/js/design-system/components/icons/index.ts b/server/sonar-web/src/main/js/design-system/components/icons/index.ts new file mode 100644 index 00000000000..45d0a0c4ff9 --- /dev/null +++ b/server/sonar-web/src/main/js/design-system/components/icons/index.ts @@ -0,0 +1,107 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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. + */ + +export { AddNewIcon } from './AddNewIcon'; +export { BranchIcon } from './BranchIcon'; +export { BugIcon } from './BugIcon'; +export { CalendarIcon } from './CalendarIcon'; +export { CheckIcon } from './CheckIcon'; +export { ChevronDownIcon } from './ChevronDownIcon'; +export { ChevronLeftIcon } from './ChevronLeftIcon'; +export { ChevronRightIcon } from './ChevronRightIcon'; +export { ClockIcon } from './ClockIcon'; +export { CloseIcon } from './CloseIcon'; +export { CodeEllipsisDirection, CodeEllipsisIcon } from './CodeEllipsisIcon'; +export { CodeSmellIcon } from './CodeSmellIcon'; +export { CollapseIcon } from './CollapseIcon'; +export { CommentIcon } from './CommentIcon'; +export { CopyIcon } from './CopyIcon'; +export { DirectoryIcon } from './DirectoryIcon'; +export { DotFillIcon } from './DotFillIcon'; +export { DraggableIcon } from './DraggableIcon'; +export { ExecutionFlowIcon } from './ExecutionFlowIcon'; +export { ExpandIcon } from './ExpandIcon'; +export { FileIcon } from './FileIcon'; +export { FilterIcon } from './FilterIcon'; +export { FlagErrorIcon } from './FlagErrorIcon'; +export { FlagInfoIcon } from './FlagInfoIcon'; +export { FlagSuccessIcon } from './FlagSuccessIcon'; +export { FlagWarningIcon } from './FlagWarningIcon'; +export { HelperHintIcon } from './HelperHintIcon'; +export { HomeFillIcon } from './HomeFillIcon'; +export { HomeIcon } from './HomeIcon'; +export * from './Icon'; +export { InheritanceIcon } from './InheritanceIcon'; +export { InProgressVisual } from './InProgressVisual'; +export { IssueLocationIcon } from './IssueLocationIcon'; +export { LinkIcon } from './LinkIcon'; +export { LockIcon } from './LockIcon'; +export { MainBranchIcon } from './MainBranchIcon'; +export { MenuHelpIcon } from './MenuHelpIcon'; +export { MenuIcon } from './MenuIcon'; +export { MenuSearchIcon } from './MenuSearchIcon'; +export { MinimizeIcon } from './MinimizeIcon'; +export { NoDataIcon } from './NoDataIcon'; +export { OpenCloseIndicator } from './OpenCloseIndicator'; +export { OpenNewTabIcon } from './OpenNewTabIcon'; +export { OverridenIcon } from './OverridenIcon'; +export { OverviewQGNotComputedIcon } from './OverviewQGNotComputedIcon'; +export { OverviewQGPassedIcon } from './OverviewQGPassedIcon'; +export { PencilIcon } from './PencilIcon'; +export { PinIcon } from './PinIcon'; +export { ProjectIcon } from './ProjectIcon'; +export { PullRequestIcon } from './PullRequestIcon'; +export { QualifierIcon } from './QualifierIcon'; +export { RequiredIcon } from './RequiredIcon'; +export { SecurityHotspotIcon } from './SecurityHotspotIcon'; +export { SeparatorCircleIcon } from './SeparatorCircleIcon'; +export { SeverityBlockerIcon } from './SeverityBlockerIcon'; +export { SeverityCriticalIcon } from './SeverityCriticalIcon'; +export { SeverityInfoIcon } from './SeverityInfoIcon'; +export { SeverityMajorIcon } from './SeverityMajorIcon'; +export { SeverityMinorIcon } from './SeverityMinorIcon'; +export { SnoozeCircleIcon } from './SnoozeCircleIcon'; +export { SoftwareImpactSeverityBlockerIcon } from './SoftwareImpactSeverityBlockerIcon'; +export { SoftwareImpactSeverityHighIcon } from './SoftwareImpactSeverityHighIcon'; +export { SoftwareImpactSeverityInfoIcon } from './SoftwareImpactSeverityInfoIcon'; +export { SoftwareImpactSeverityLowIcon } from './SoftwareImpactSeverityLowIcon'; +export { SoftwareImpactSeverityMediumIcon } from './SoftwareImpactSeverityMediumIcon'; +export { SortAscendIcon } from './SortAscendIcon'; +export { SortDescendIcon } from './SortDescendIcon'; +export { StarFillIcon } from './StarFillIcon'; +export { StarIcon } from './StarIcon'; +export { StatusConfirmedIcon } from './StatusConfirmedIcon'; +export { StatusOpenIcon } from './StatusOpenIcon'; +export { StatusReopenedIcon } from './StatusReopenedIcon'; +export { StatusResolvedIcon } from './StatusResolvedIcon'; +export { TestFileIcon } from './TestFileIcon'; +export { TrashIcon } from './TrashIcon'; +export { TrendDownCircleIcon } from './TrendDownCircleIcon'; +export { TrendDirection, TrendIcon, TrendType } from './TrendIcon'; +export { TrendUpCircleIcon } from './TrendUpCircleIcon'; +export { TriangleDownIcon } from './TriangleDownIcon'; +export { TriangleLeftIcon } from './TriangleLeftIcon'; +export { TriangleRightIcon } from './TriangleRightIcon'; +export { TriangleUpIcon } from './TriangleUpIcon'; +export { UnfoldDownIcon } from './UnfoldDownIcon'; +export { UnfoldIcon } from './UnfoldIcon'; +export { UnfoldUpIcon } from './UnfoldUpIcon'; +export { UserGroupIcon } from './UserGroupIcon'; +export { VulnerabilityIcon } from './VulnerabilityIcon'; |