aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/design-system
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2023-05-17 10:57:49 +0200
committersonartech <sonartech@sonarsource.com>2023-05-24 20:03:14 +0000
commit76f1bb2ffe4c49b0098d12c9057f8dbc89891714 (patch)
tree71c4c4505576459f289c8b4d27d6a9b1048b9c97 /server/sonar-web/design-system
parent20c81961de9c92422410a5657ed48a3093742bde (diff)
downloadsonarqube-76f1bb2ffe4c49b0098d12c9057f8dbc89891714.tar.gz
sonarqube-76f1bb2ffe4c49b0098d12c9057f8dbc89891714.zip
SONAR-19236 Move security hotspot activity to its own tab
Diffstat (limited to 'server/sonar-web/design-system')
-rw-r--r--server/sonar-web/design-system/src/components/HtmlFormatter.tsx1
-rw-r--r--server/sonar-web/design-system/src/components/Text.tsx14
-rw-r--r--server/sonar-web/design-system/src/components/icons/TrashIcon.tsx23
-rw-r--r--server/sonar-web/design-system/src/components/icons/index.ts1
4 files changed, 36 insertions, 3 deletions
diff --git a/server/sonar-web/design-system/src/components/HtmlFormatter.tsx b/server/sonar-web/design-system/src/components/HtmlFormatter.tsx
index 2142e789a9e..fd44093c0e6 100644
--- a/server/sonar-web/design-system/src/components/HtmlFormatter.tsx
+++ b/server/sonar-web/design-system/src/components/HtmlFormatter.tsx
@@ -22,7 +22,6 @@ import tw from 'twin.macro';
import { themeBorder, themeColor } from '../helpers';
export const HtmlFormatter = styled.div`
- ${tw`sw-my-6`}
${tw`sw-body-sm`}
a {
diff --git a/server/sonar-web/design-system/src/components/Text.tsx b/server/sonar-web/design-system/src/components/Text.tsx
index aff69978ad3..fb6664fc038 100644
--- a/server/sonar-web/design-system/src/components/Text.tsx
+++ b/server/sonar-web/design-system/src/components/Text.tsx
@@ -18,6 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import styled from '@emotion/styled';
+import { ElementType } from 'react';
import tw from 'twin.macro';
import { themeColor, themeContrast } from '../helpers/theme';
@@ -50,9 +51,17 @@ export function TextMuted({ text, className }: { className?: string; text: strin
);
}
-export function PageTitle({ text, className }: { className?: string; text: string }) {
+export function PageTitle({
+ text,
+ className,
+ as = 'h1',
+}: {
+ as?: ElementType;
+ className?: string;
+ text: string;
+}) {
return (
- <StyledPageTitle className={className} title={text}>
+ <StyledPageTitle as={as} className={className} title={text}>
{text}
</StyledPageTitle>
);
@@ -86,6 +95,7 @@ const StyledMutedText = styled(StyledText)`
`;
export const StyledPageTitle = styled(StyledText)`
+ ${tw`sw-block`};
${tw`sw-text-base`}
color: ${themeColor('facetHeader')};
`;
diff --git a/server/sonar-web/design-system/src/components/icons/TrashIcon.tsx b/server/sonar-web/design-system/src/components/icons/TrashIcon.tsx
new file mode 100644
index 00000000000..f4865e6536c
--- /dev/null
+++ b/server/sonar-web/design-system/src/components/icons/TrashIcon.tsx
@@ -0,0 +1,23 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2023 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { TrashIcon as BaseTrashIcon } from '@primer/octicons-react';
+import { OcticonHoc } from './Icon';
+
+export const TrashIcon = OcticonHoc(BaseTrashIcon);
diff --git a/server/sonar-web/design-system/src/components/icons/index.ts b/server/sonar-web/design-system/src/components/icons/index.ts
index 301e4c08af8..27e7dc2d9f6 100644
--- a/server/sonar-web/design-system/src/components/icons/index.ts
+++ b/server/sonar-web/design-system/src/components/icons/index.ts
@@ -66,6 +66,7 @@ export { StatusConfirmedIcon } from './StatusConfirmedIcon';
export { StatusOpenIcon } from './StatusOpenIcon';
export { StatusReopenedIcon } from './StatusReopenedIcon';
export { StatusResolvedIcon } from './StatusResolvedIcon';
+export { TrashIcon } from './TrashIcon';
export { TriangleDownIcon } from './TriangleDownIcon';
export { TriangleLeftIcon } from './TriangleLeftIcon';
export { TriangleRightIcon } from './TriangleRightIcon';