Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

chore: migrate antd Tag to badge (#11421)

Manika Malhotra0a3717e0d88d
diff --git a/frontend/plugins/rules/no-antd-components.mjs b/frontend/plugins/rules/no-antd-components.mjs
index 5ff575bcc9..0e8d595646 100644
--- a/frontend/plugins/rules/no-antd-components.mjs
+++ b/frontend/plugins/rules/no-antd-components.mjs
@@ -25,6 +25,7 @@ const BANNED_COMPONENTS = {
Progress: 'Use @signozhq/ui/progress instead of antd Progress.',
Avatar: 'Use @signozhq/ui/avatar instead of antd Avatar.',
Divider: 'Use @signozhq/ui/divider Divider instead of antd Divider.',
+ Tag: 'Use @signozhq/ui/badge Bagde instead of antd Tag.',
};
export default {
diff --git a/frontend/src/components/Tags/Tags.styles.scss b/frontend/src/components/Badges/Badges.styles.scss
similarity index 86%
rename from frontend/src/components/Tags/Tags.styles.scss
rename to frontend/src/components/Badges/Badges.styles.scss
index 57a9c3f2e2..eaec9d3112 100644
--- a/frontend/src/components/Tags/Tags.styles.scss
+++ b/frontend/src/components/Badges/Badges.styles.scss
@@ -14,11 +14,6 @@
.ant-form-item {
margin-bottom: 0;
}
-
- .ant-tag {
- margin-right: 0;
- background: var(--card);
- }
}
.add-tag-container {
diff --git a/frontend/src/components/Tags/Tags.tsx b/frontend/src/components/Badges/Badges.tsx
similarity index 86%
rename from frontend/src/components/Tags/Tags.tsx
rename to frontend/src/components/Badges/Badges.tsx
index 4f3699ee30..ffe57b2ee2 100644
--- a/frontend/src/components/Tags/Tags.tsx
+++ b/frontend/src/components/Badges/Badges.tsx
@@ -1,11 +1,12 @@
import React, { Dispatch, SetStateAction, useState } from 'react';
import { Check, Plus, X } from '@signozhq/icons';
-import { Button, Flex, Tag } from 'antd';
+import { Button, Flex } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import Input from 'components/Input';
-import './Tags.styles.scss';
+import './Badges.styles.scss';
-function Tags({ tags, setTags }: AddTagsProps): JSX.Element {
+function Badges({ tags, setTags }: AddTagsProps): JSX.Element {
const [inputValue, setInputValue] = useState<string>('');
const [inputVisible, setInputVisible] = useState<boolean>(false);
@@ -46,14 +47,18 @@ function Tags({ tags, setTags }: AddTagsProps): JSX.Element {
return (
<div className="tags-container">
{tags.map<React.ReactNode>((tag) => (
- <Tag
+ <Badge
key={tag}
- closable
+ color="vanilla"
style={{ userSelect: 'none' }}
- onClose={(): void => handleClose(tag)}
+ closable
+ onClose={(e): void => {
+ e.preventDefault();
+ handleClose(tag);
+ }}
>
- <span>{tag}</span>
- </Tag>
+ {tag}
+ </Badge>
))}
{inputVisible && (
@@ -113,4 +118,4 @@ interface AddTagsProps {
setTags: Dispatch<SetStateAction<string[]>>;
}
-export default Tags;
+export default Badges;
diff --git a/frontend/src/components/ClientSideQBSearch/ClientSideQBSearch.tsx b/frontend/src/components/ClientSideQBSearch/ClientSideQBSearch.tsx
index 3c2dde7161..435188243b 100644
--- a/frontend/src/components/ClientSideQBSearch/ClientSideQBSearch.tsx
+++ b/frontend/src/components/ClientSideQBSearch/ClientSideQBSearch.tsx
@@ -9,7 +9,7 @@ import {
useState,
} from 'react';
import { Color } from '@signozhq/design-tokens';
-import { Select, Tag, Tooltip } from 'antd';
+import { Select, Tooltip } from 'antd';
import {
OPERATORS,
QUERY_BUILDER_OPERATORS_BY_TYPES,
@@ -51,6 +51,7 @@ import { popupContainer } from 'utils/selectPopupContainer';
import { v4 as uuid } from 'uuid';
import './ClientSideQBSearch.styles.scss';
+import { Badge } from '@signozhq/ui/badge';
export interface AttributeKey {
key: string;
@@ -547,10 +548,14 @@ function ClientSideQBSearch(
return (
<span className="qb-search-bar-tokenised-tags">
- <Tag
- closable={!searchValue && closable}
- onClose={onCloseHandler}
+ <Badge
+ color="vanilla"
className={tagDetails?.key?.type || ''}
+ closable={!searchValue && closable}
+ onClose={(e): void => {
+ e.preventDefault();
+ onCloseHandler();
+ }}
>
<Tooltip title={chipValue}>
<TypographyText
@@ -566,7 +571,7 @@ function ClientSideQBSearch(
{chipValue}
</TypographyText>
</Tooltip>
- </Tag>
+ </Badge>
</span>
);
};
diff --git a/frontend/src/components/ErrorModal/ErrorModal.tsx b/frontend/src/components/ErrorModal/ErrorModal.tsx
index 5e50a94e2c..f2682fc934 100644
--- a/frontend/src/components/ErrorModal/ErrorModal.tsx
+++ b/frontend/src/components/ErrorModal/ErrorModal.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import { Color } from '@signozhq/design-tokens';
-import { Button, Modal, Tag } from 'antd';
+import { Button, Modal } from 'antd';
import { CircleAlert, X } from '@signozhq/icons';
import KeyValueLabel from 'periscope/components/KeyValueLabel';
import { useAppContext } from 'providers/App/App';
@@ -9,6 +9,7 @@ import APIError from 'types/api/error';
import ErrorContent from './components/ErrorContent';
import './ErrorModal.styles.scss';
+import { Badge } from '@signozhq/ui/badge';
type Props = {
error: APIError;
@@ -45,14 +46,17 @@ function ErrorModal({
return (
<>
{!triggerComponent ? (
- <Tag
+ <span
className="error-modal__trigger"
- icon={<CircleAlert size={14} color={Color.BG_CHERRY_500} />}
- color="error"
+ role="button"
+ tabIndex={0}
onClick={(): void => setVisible(true)}
+ onKeyDown={undefined}
>
- error
- </Tag>
+ <Badge color="error">
+ <CircleAlert size={14} color={Color.BG_CHERRY_500} /> error
+ </Badge>
+ </span>
) : (
React.cloneElement(triggerComponent, {
onClick: () => setVisible(true),
diff --git a/frontend/src/components/QueryBuilderV2/QueryV2/QuerySearch/QuerySearch.tsx b/frontend/src/components/QueryBuilderV2/QueryV2/QuerySearch/QuerySearch.tsx
index e79ca4e429..8e7e5fc246 100644
--- a/frontend/src/components/QueryBuilderV2/QueryV2/QuerySearch/QuerySearch.tsx
+++ b/frontend/src/components/QueryBuilderV2/QueryV2/QuerySearch/QuerySearch.tsx
@@ -14,7 +14,8 @@ import { Color } from '@signozhq/design-tokens';
import { copilot } from '@uiw/codemirror-theme-copilot';
import { githubLight } from '@uiw/codemirror-theme-github';
import CodeMirror, { EditorView, keymap, Prec } from '@uiw/react-codemirror';
-import { Button, Card, Collapse, Popover, Tag, Tooltip } from 'antd';
+import { Button, Card, Collapse, Popover, Tooltip } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { getKeySuggestions } from 'api/querySuggestions/getKeySuggestions';
import { getValueSuggestions } from 'api/querySuggestions/getValueSuggestion';
import cx from 'classnames';
@@ -664,26 +665,26 @@ function QuerySearch({
// Helper function to render a badge for the current context mode
const renderContextBadge = (): JSX.Element => {
if (!editingMode) {
- return <Tag>Unknown</Tag>;
+ return <Badge color="vanilla">Unknown</Badge>;
}
switch (editingMode) {
case 'key':
- return <Tag color="blue">Key</Tag>;
+ return <Badge color="robin">Key</Badge>;
case 'operator':
- return <Tag color="purple">Operator</Tag>;
+ return <Badge color="sakura">Operator</Badge>;
case 'value':
- return <Tag color="green">Value</Tag>;
+ return <Badge color="forest">Value</Badge>;
case 'conjunction':
- return <Tag color="orange">Conjunction</Tag>;
+ return <Badge color="amber">Conjunction</Badge>;
case 'function':
- return <Tag color="cyan">Function</Tag>;
+ return <Badge color="aqua">Function</Badge>;
case 'parenthesis':
- return <Tag color="magenta">Parenthesis</Tag>;
+ return <Badge color="sakura">Parenthesis</Badge>;
case 'bracketList':
- return <Tag color="red">Bracket List</Tag>;
+ return <Badge color="cherry">Bracket List</Badge>;
default:
- return <Tag>Unknown</Tag>;
+ return <Badge color="vanilla">Unknown</Badge>;
}
};
@@ -1304,34 +1305,37 @@ function QuerySearch({
Currently editing: {renderContextBadge()}
{queryContext?.keyToken && (
<span className="triplet-info">
- Key: <Tag>{queryContext.keyToken}</Tag>
+ Key: <Badge color="vanilla">{queryContext.keyToken}</Badge>
</span>
)}
{queryContext?.operatorToken && (
<span className="triplet-info">
- Operator: <Tag>{queryContext.operatorToken}</Tag>
+ Operator: <Badge color="vanilla">{queryContext.operatorToken}</Badge>
</span>
)}
{queryContext?.valueToken && (
<span className="triplet-info">
- Value: <Tag>{queryContext.valueToken}</Tag>
+ Value: <Badge color="vanilla">{queryContext.valueToken}</Badge>
</span>
)}
{queryContext?.currentPair && (
<span className="triplet-info query-pair-info">
- Current pair: <Tag color="blue">{queryContext.currentPair.key}</Tag>
- <Tag color="purple">{queryContext.currentPair.operator}</Tag>
+ Current pair: <Badge color="robin">{queryContext.currentPair.key}</Badge>
+ <Badge color="sakura">{queryContext.currentPair.operator}</Badge>
{queryContext.currentPair.value && (
- <Tag color="green">{queryContext.currentPair.value}</Tag>
+ <Badge color="forest">{queryContext.currentPair.value}</Badge>
)}
- <Tag color={queryContext.currentPair.isComplete ? 'success' : 'warning'}>
+ <Badge
+ color={queryContext.currentPair.isComplete ? 'success' : 'warning'}
+ >
{queryContext.currentPair.isComplete ? 'Complete' : 'Incomplete'}
- </Tag>
+ </Badge>
</span>
)}
{queryContext?.queryPairs && queryContext.queryPairs.length > 0 && (
<span className="triplet-info">
- Total pairs: <Tag color="blue">{queryContext.queryPairs.length}</Tag>
+ Total pairs:{' '}
+ <Badge color="robin">{queryContext.queryPairs.length}</Badge>
</span>
)}
</div>
diff --git a/frontend/src/components/TableRenderer/TagWithToolTip.tsx b/frontend/src/components/TableRenderer/BadgeWithTooltip.tsx
similarity index 55%
rename from frontend/src/components/TableRenderer/TagWithToolTip.tsx
rename to frontend/src/components/TableRenderer/BadgeWithTooltip.tsx
index 9fa1aca363..fee7d590dc 100644
--- a/frontend/src/components/TableRenderer/TagWithToolTip.tsx
+++ b/frontend/src/components/TableRenderer/BadgeWithTooltip.tsx
@@ -1,36 +1,34 @@
-import { Tag, Tooltip } from 'antd';
+import { Tooltip } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { getLabelRenderingValue } from './utils';
-function TagWithToolTip({
+function BadgeWithTooltip({
label,
value,
- color,
-}: TagWithToolTipProps): JSX.Element {
+}: BadgeWithTooltipProps): JSX.Element {
const tooltipTitle =
value && value[label] ? `${label}: ${value[label]}` : label;
return (
<div key={label}>
<Tooltip title={tooltipTitle}>
- <Tag className="label-column--tag" color={color}>
+ <Badge className="label-column--tag" color="vanilla">
{getLabelRenderingValue(label, value && value[label])}
- </Tag>
+ </Badge>
</Tooltip>
</div>
);
}
-type TagWithToolTipProps = {
+type BadgeWithTooltipProps = {
label: string;
- color?: string;
value?: {
[key: string]: string;
};
};
-TagWithToolTip.defaultProps = {
+BadgeWithTooltip.defaultProps = {
value: undefined,
- color: undefined,
};
-export default TagWithToolTip;
+export default BadgeWithTooltip;
diff --git a/frontend/src/components/TableRenderer/LabelColumn.tsx b/frontend/src/components/TableRenderer/LabelColumn.tsx
index 38e2a2cddc..74a544c3fa 100644
--- a/frontend/src/components/TableRenderer/LabelColumn.tsx
+++ b/frontend/src/components/TableRenderer/LabelColumn.tsx
@@ -1,12 +1,13 @@
-import { Popover, Tag } from 'antd';
+import { Popover } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { LabelColumnProps } from './TableRenderer.types';
-import TagWithToolTip from './TagWithToolTip';
+import BadgeWithTooltip from './BadgeWithTooltip';
import { getLabelAndValueContent } from './utils';
import './LabelColumn.styles.scss';
-function LabelColumn({ labels, value, color }: LabelColumnProps): JSX.Element {
+function LabelColumn({ labels, value }: LabelColumnProps): JSX.Element {
const newLabels = labels.length > 3 ? labels.slice(0, 3) : labels;
const remainingLabels = labels.length > 3 ? labels.slice(3) : [];
@@ -14,7 +15,7 @@ function LabelColumn({ labels, value, color }: LabelColumnProps): JSX.Element {
<div className="label-column">
{newLabels.map(
(label: string): JSX.Element => (
- <TagWithToolTip key={label} label={label} color={color} value={value} />
+ <BadgeWithTooltip key={label} label={label} value={value} />
),
)}
{remainingLabels.length > 0 && (
@@ -26,9 +27,9 @@ function LabelColumn({ labels, value, color }: LabelColumnProps): JSX.Element {
{labels.map(
(label: string): JSX.Element => (
<div key={label}>
- <Tag className="label-column--tag" color={color}>
+ <Badge className="label-column--tag" color="vanilla">
{getLabelAndValueContent(label, value && value[label])}
- </Tag>
+ </Badge>
</div>
),
)}
@@ -36,9 +37,9 @@ function LabelColumn({ labels, value, color }: LabelColumnProps): JSX.Element {
}
trigger="hover"
>
- <Tag className="label-column--tag" color={color}>
+ <Badge className="label-column--tag" color="vanilla">
+{remainingLabels.length}
- </Tag>
+ </Badge>
</Popover>
)}
</div>
diff --git a/frontend/src/container/ApiMonitoring/utils.tsx b/frontend/src/container/ApiMonitoring/utils.tsx
index c4e4c9c062..80cd36606c 100644
--- a/frontend/src/container/ApiMonitoring/utils.tsx
+++ b/frontend/src/container/ApiMonitoring/utils.tsx
@@ -1,7 +1,8 @@
import { ReactNode } from 'react';
import { Color } from '@signozhq/design-tokens';
-import { TableColumnType as ColumnType, Tag, Tooltip } from 'antd';
+import { TableColumnType as ColumnType, Tooltip } from 'antd';
import { Progress } from '@signozhq/ui/progress';
+import { Badge } from '@signozhq/ui/badge';
import { convertFiltersToExpressionWithExistingQuery } from 'components/QueryBuilderV2/utils';
import {
FiltersType,
@@ -972,13 +973,9 @@ export const getEndPointsColumnsConfig = (
})()}
{isGroupedByAttribute
? text.split(',').map((value) => (
- <Tag
- key={value}
- color={Color.BG_SLATE_100}
- className="endpoint-group-tag-item"
- >
+ <Badge key={value} color="vanilla" className="endpoint-group-tag-item">
{value === '' ? '<no-value>' : value}
- </Tag>
+ </Badge>
))
: endPointName}
</div>
diff --git a/frontend/src/container/BillingContainer/BillingContainer.tsx b/frontend/src/container/BillingContainer/BillingContainer.tsx
index 63ee1cdafd..28a3c2513c 100644
--- a/frontend/src/container/BillingContainer/BillingContainer.tsx
+++ b/frontend/src/container/BillingContainer/BillingContainer.tsx
@@ -14,8 +14,8 @@ import {
Skeleton,
Table,
TableColumnsType as ColumnsType,
- Tag,
} from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import getUsage, { UsageResponsePayloadProps } from 'api/billing/getUsage';
import logEvent from 'api/common/logEvent';
import updateCreditCardApi from 'api/v1/checkout/create';
@@ -434,7 +434,7 @@ export default function BillingContainer(): JSX.Element {
<Flex vertical>
<Typography.Title level={5} style={{ marginTop: 2, fontWeight: 500 }}>
{isCloudUserVal ? t('teams_cloud') : t('teams')}{' '}
- {isFreeTrial ? <Tag color="success"> Free Trial </Tag> : ''}
+ {isFreeTrial ? <Badge color="success"> Free Trial </Badge> : ''}
</Typography.Title>
{!isLoading && !isFetchingBillingData && !showGracePeriodMessage ? (
diff --git a/frontend/src/container/CreateAlertRule/SelectAlertType/index.tsx b/frontend/src/container/CreateAlertRule/SelectAlertType/index.tsx
index 33553ea68b..5088af299e 100644
--- a/frontend/src/container/CreateAlertRule/SelectAlertType/index.tsx
+++ b/frontend/src/container/CreateAlertRule/SelectAlertType/index.tsx
@@ -1,6 +1,7 @@
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
-import { Row, Tag } from 'antd';
+import { Row } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Typography } from '@signozhq/ui/typography';
import logEvent from 'api/common/logEvent';
import { ALERTS_DATA_SOURCE_MAP } from 'constants/alerts';
@@ -66,13 +67,7 @@ function SelectAlertType({ onSelect }: SelectAlertTypeProps): JSX.Element {
<AlertTypeCard
key={option.selection}
title={option.title}
- extra={
- option.isBeta ? (
- <Tag bordered={false} color="geekblue">
- Beta
- </Tag>
- ) : undefined
- }
+ extra={option.isBeta ? <Badge color="robin">Beta</Badge> : undefined}
onClick={(e): void => {
onSelect(option.selection, isModifierKeyPressed(e));
}}
diff --git a/frontend/src/container/DashboardContainer/DashboardDescription/index.tsx b/frontend/src/container/DashboardContainer/DashboardDescription/index.tsx
index c0f3eba7b1..eac6124346 100644
--- a/frontend/src/container/DashboardContainer/DashboardDescription/index.tsx
+++ b/frontend/src/container/DashboardContainer/DashboardDescription/index.tsx
@@ -16,7 +16,8 @@ import {
Plus,
X,
} from '@signozhq/icons';
-import { Button, Card, Input, Modal, Popover, Tag, Tooltip } from 'antd';
+import { Button, Card, Input, Modal, Popover, Tooltip } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Typography } from '@signozhq/ui/typography';
import logEvent from 'api/common/logEvent';
import ConfigureIcon from 'assets/Integrations/ConfigureIcon';
@@ -506,9 +507,9 @@ function DashboardDescription(props: DashboardDescriptionProps): JSX.Element {
{(tags?.length || 0) > 0 && (
<div className="dashboard-tags">
{tags?.map((tag) => (
- <Tag key={tag} className="tag">
+ <Badge key={tag} className="tag" color="vanilla">
{tag}
- </Tag>
+ </Badge>
))}
</div>
)}
diff --git a/frontend/src/container/DashboardContainer/DashboardSettings/DashboardVariableSettings/VariableItem/VariableItem.styles.scss b/frontend/src/container/DashboardContainer/DashboardSettings/DashboardVariableSettings/VariableItem/VariableItem.styles.scss
index a7ee76202a..90d39d1933 100644
--- a/frontend/src/container/DashboardContainer/DashboardSettings/DashboardVariableSettings/VariableItem/VariableItem.styles.scss
+++ b/frontend/src/container/DashboardContainer/DashboardSettings/DashboardVariableSettings/VariableItem/VariableItem.styles.scss
@@ -359,7 +359,7 @@
flex-flow: wrap;
gap: 8px;
- .ant-tag {
+ [data-slot='badge'] {
height: 30px;
color: var(--l1-foreground);
font-family: 'Space Mono';
diff --git a/frontend/src/container/DashboardContainer/DashboardSettings/DashboardVariableSettings/VariableItem/VariableItem.tsx b/frontend/src/container/DashboardContainer/DashboardSettings/DashboardVariableSettings/VariableItem/VariableItem.tsx
index 91d8b2b812..125bf2e2bc 100644
--- a/frontend/src/container/DashboardContainer/DashboardSettings/DashboardVariableSettings/VariableItem/VariableItem.tsx
+++ b/frontend/src/container/DashboardContainer/DashboardSettings/DashboardVariableSettings/VariableItem/VariableItem.tsx
@@ -5,7 +5,8 @@ import { useQuery } from 'react-query';
import { useSelector } from 'react-redux';
import { orange } from '@ant-design/colors';
import { Color } from '@signozhq/design-tokens';
-import { Button, Collapse, Input, Select, Tag } from 'antd';
+import { Button, Collapse, Input, Select } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Switch } from '@signozhq/ui/switch';
import { Typography } from '@signozhq/ui/typography';
import dashboardVariablesQuery from 'api/dashboard/variables/dashboardVariablesQuery';
@@ -542,9 +543,9 @@ function VariableItem({
}}
>
Dynamic
- <Tag bordered={false} className="sidenav-beta-tag" color="geekblue">
+ <Badge color="robin" className="sidenav-beta-tag">
Beta
- </Tag>
+ </Badge>
</Button>
<Button
type="text"
@@ -599,9 +600,9 @@ function VariableItem({
}}
>
Query
- <Tag bordered={false} className="sidenav-beta-tag" color="warning">
+ <Badge color="amber" className="sidenav-beta-tag">
Not Recommended
- </Tag>
+ </Badge>
<div onClick={(e): void => e.stopPropagation()}>
<TextToolTip
text="Learn why we don't recommend"
@@ -733,7 +734,9 @@ function VariableItem({
<Typography style={{ color: orange[5] }}>{errorPreview}</Typography>
) : (
map(previewValues, (value, idx) => (
- <Tag key={`${value}${idx}`}>{value.toString()}</Tag>
+ <Badge key={`${value}${idx}`} color="vanilla">
+ {value.toString()}
+ </Badge>
))
)}
</div>
diff --git a/frontend/src/container/DashboardContainer/DashboardSettings/General/AddTags/AddTags.styles.scss b/frontend/src/container/DashboardContainer/DashboardSettings/General/AddBadges/AddBadges.module.scss
similarity index 61%
rename from frontend/src/container/DashboardContainer/DashboardSettings/General/AddTags/AddTags.styles.scss
rename to frontend/src/container/DashboardContainer/DashboardSettings/General/AddBadges/AddBadges.module.scss
index c99497ccae..3595128141 100644
--- a/frontend/src/container/DashboardContainer/DashboardSettings/General/AddTags/AddTags.styles.scss
+++ b/frontend/src/container/DashboardContainer/DashboardSettings/General/AddBadges/AddBadges.module.scss
@@ -1,20 +1,17 @@
-.tags-input {
+.badgesContainer {
display: flex;
- border: none;
- padding: 0px;
- width: 183px;
- height: 24px;
- padding: 3px 1px;
- flex-shrink: 0;
+ align-items: center;
+ flex-flow: wrap;
+ gap: 6px;
}
-.tag-container {
+.badgeContainer {
color: var(--bg-sienna-400);
font-family: 'Space Mono';
font-size: 13px;
font-style: normal;
font-weight: 500;
- line-height: 20px; /* 153.846% */
+ line-height: 20px;
letter-spacing: 0.52px;
height: 24px;
flex-shrink: 0;
@@ -22,9 +19,30 @@
border: 1px solid color-mix(in srgb, var(--bg-sienna-500) 20%, transparent);
background: color-mix(in srgb, var(--bg-sienna-500) 10%, transparent);
padding: 2px 8px;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.inputContainer {
+ > div {
+ margin: 0;
+ }
+ padding-left: 0px !important;
+ padding-right: 0px !important;
+}
+
+.tagsInput {
+ display: flex;
+ border: none;
+ padding: 0px;
+ width: 183px;
+ height: 24px;
+ padding: 3px 1px;
+ flex-shrink: 0;
}
-.edit-input {
+.editInput {
.ant-form-item {
margin-bottom: 0px;
}
diff --git a/frontend/src/container/DashboardContainer/DashboardSettings/General/AddTags/index.tsx b/frontend/src/container/DashboardContainer/DashboardSettings/General/AddBadges/index.tsx
similarity index 82%
rename from frontend/src/container/DashboardContainer/DashboardSettings/General/AddTags/index.tsx
rename to frontend/src/container/DashboardContainer/DashboardSettings/General/AddBadges/index.tsx
index 050aa7ff5a..ffc894787c 100644
--- a/frontend/src/container/DashboardContainer/DashboardSettings/General/AddTags/index.tsx
+++ b/frontend/src/container/DashboardContainer/DashboardSettings/General/AddBadges/index.tsx
@@ -1,10 +1,9 @@
import { Dispatch, SetStateAction, useState } from 'react';
import { Col, Tooltip } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import Input from 'components/Input';
-import { InputContainer, NewTagContainer, TagsContainer } from './styles';
-
-import './AddTags.styles.scss';
+import styles from './AddBadges.module.scss';
function AddTags({ tags, setTags }: AddTagsProps): JSX.Element {
const [inputValue, setInputValue] = useState<string>('');
@@ -39,11 +38,11 @@ function AddTags({ tags, setTags }: AddTagsProps): JSX.Element {
};
return (
- <TagsContainer>
+ <div className={styles.badgesContainer}>
{tags.map((tag, index) => {
if (editInputIndex === index) {
return (
- <Col key={tag} lg={4} className="edit-input">
+ <Col key={tag} lg={4} className={styles.editInput}>
<Input
size="small"
value={editInputValue}
@@ -60,11 +59,15 @@ function AddTags({ tags, setTags }: AddTagsProps): JSX.Element {
const isLongTag = tag.length > 20;
const tagElem = (
- <NewTagContainer
- closable
+ <Badge
key={tag}
- onClose={(): void => handleClose(tag)}
- className="tag-container"
+ color="vanilla"
+ className={styles.badgeContainer}
+ closable
+ onClose={(e): void => {
+ e.preventDefault();
+ handleClose(tag);
+ }}
>
<span
onDoubleClick={(e): void => {
@@ -75,7 +78,7 @@ function AddTags({ tags, setTags }: AddTagsProps): JSX.Element {
>
{isLongTag ? `${tag.slice(0, 20)}...` : tag}
</span>
- </NewTagContainer>
+ </Badge>
);
return isLongTag ? (
@@ -87,11 +90,11 @@ function AddTags({ tags, setTags }: AddTagsProps): JSX.Element {
);
})}
- <InputContainer>
+ <Col className={styles.inputContainer}>
<Input
type="text"
value={inputValue}
- rootClassName="tags-input"
+ rootClassName={styles.tagsInput}
placeholder="Start typing your tag name"
onChangeHandler={(event): void =>
onChangeHandler(event.target.value, setInputValue)
@@ -99,8 +102,8 @@ function AddTags({ tags, setTags }: AddTagsProps): JSX.Element {
onBlurHandler={handleInputConfirm}
onPressEnterHandler={handleInputConfirm}
/>
- </InputContainer>
- </TagsContainer>
+ </Col>
+ </div>
);
}
diff --git a/frontend/src/container/DashboardContainer/DashboardSettings/General/AddTags/styles.ts b/frontend/src/container/DashboardContainer/DashboardSettings/General/AddTags/styles.ts
deleted file mode 100644
index 1fbc8a6974..0000000000
--- a/frontend/src/container/DashboardContainer/DashboardSettings/General/AddTags/styles.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { Col, Tag } from 'antd';
-import styled from 'styled-components';
-
-export const TagsContainer = styled.div`
- display: flex;
- align-items: center;
- flex-flow: wrap;
- gap: 6px;
-`;
-
-export const NewTagContainer = styled(Tag)`
- &&& {
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 100%;
-
- svg {
- margin-right: 0.2rem;
- }
- }
-`;
-
-export const InputContainer = styled(Col)`
- > div {
- margin: 0;
- }
- padding-left: 0px !important;
- padding-right: 0px !important;
-`;
diff --git a/frontend/src/container/DashboardContainer/DashboardSettings/General/index.tsx b/frontend/src/container/DashboardContainer/DashboardSettings/General/index.tsx
index ee396f84fe..2adc612707 100644
--- a/frontend/src/container/DashboardContainer/DashboardSettings/General/index.tsx
+++ b/frontend/src/container/DashboardContainer/DashboardSettings/General/index.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
import { Col, Input, Select, Space, Tooltip } from 'antd';
import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { Typography } from '@signozhq/ui/typography';
-import AddTags from 'container/DashboardContainer/DashboardSettings/General/AddTags';
+import AddTags from 'container/DashboardContainer/DashboardSettings/General/AddBadges';
import { useDashboardCursorSyncMode } from 'hooks/dashboard/useDashboardCursorSyncMode';
import { useSyncTooltipFilterMode } from 'hooks/dashboard/useSyncTooltipFilterMode';
import { useUpdateDashboard } from 'hooks/dashboard/useUpdateDashboard';
diff --git a/frontend/src/container/FormAlertRules/labels/QueryChip.tsx b/frontend/src/container/FormAlertRules/labels/QueryChip.tsx
deleted file mode 100644
index 64c75d297a..0000000000
--- a/frontend/src/container/FormAlertRules/labels/QueryChip.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { QueryChipContainer, QueryChipItem } from './styles';
-import { ILabelRecord } from './types';
-
-interface QueryChipProps {
- queryData: ILabelRecord;
- onRemove: (id: string) => void;
-}
-
-export default function QueryChip({
- queryData,
- onRemove,
-}: QueryChipProps): JSX.Element {
- const { key, value } = queryData;
- return (
- <QueryChipContainer>
- <QueryChipItem
- closable={key !== 'severity' && key !== 'description'}
- onClose={(): void => onRemove(key)}
- >
- {key}: {value}
- </QueryChipItem>
- </QueryChipContainer>
- );
-}
diff --git a/frontend/src/container/FormAlertRules/labels/index.tsx b/frontend/src/container/FormAlertRules/labels/index.tsx
index f66577f451..8c055a6031 100644
--- a/frontend/src/container/FormAlertRules/labels/index.tsx
+++ b/frontend/src/container/FormAlertRules/labels/index.tsx
@@ -7,8 +7,8 @@ import { map } from 'lodash-es';
import { Labels } from 'types/api/alerts/def';
import { v4 as uuid } from 'uuid';
-import QueryChip from './QueryChip';
-import { QueryChipItem, SearchContainer } from './styles';
+import { Badge } from '@signozhq/ui/badge';
+import { QueryChipContainer, QueryChipItem, SearchContainer } from './styles';
import { ILabelRecord } from './types';
import { createQuery, flattenLabels, prepareLabels } from './utils';
@@ -147,12 +147,24 @@ function LabelSelect({
<SearchContainer isDarkMode={isDarkMode} disabled={false}>
<div style={{ display: 'inline-flex', flexWrap: 'wrap' }}>
{queries.length > 0 &&
- map(
- queries,
- (query): JSX.Element => (
- <QueryChip key={query.key} queryData={query} onRemove={handleClose} />
- ),
- )}
+ map(queries, (query): JSX.Element => {
+ const isClosable =
+ query.key !== 'severity' && query.key !== 'description';
+ return (
+ <QueryChipContainer key={query.key}>
+ <Badge
+ color="vanilla"
+ closable={isClosable}
+ onClose={(e): void => {
+ e.preventDefault();
+ handleClose(query.key);
+ }}
+ >
+ {query.key}: {query.value}
+ </Badge>
+ </QueryChipContainer>
+ );
+ })}
</div>
<div>
{map(staging, (item) => (
diff --git a/frontend/src/container/FormAlertRules/labels/styles.ts b/frontend/src/container/FormAlertRules/labels/styles.ts
index 01210e3edc..1395959ace 100644
--- a/frontend/src/container/FormAlertRules/labels/styles.ts
+++ b/frontend/src/container/FormAlertRules/labels/styles.ts
@@ -1,5 +1,5 @@
import { grey } from '@ant-design/colors';
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import styled from 'styled-components';
interface SearchContainerProps {
@@ -27,8 +27,11 @@ export const QueryChipContainer = styled.span`
background: ${grey.primary}44;
}
}
+ [data-slot='badge'] {
+ margin-right: 0.1rem;
+ }
`;
-export const QueryChipItem = styled(Tag)`
+export const QueryChipItem = styled(Badge)`
margin-right: 0.1rem;
`;
diff --git a/frontend/src/container/Home/AlertRules/AlertRules.tsx b/frontend/src/container/Home/AlertRules/AlertRules.tsx
index d25eb9b1e4..da7cf51c23 100644
--- a/frontend/src/container/Home/AlertRules/AlertRules.tsx
+++ b/frontend/src/container/Home/AlertRules/AlertRules.tsx
@@ -1,6 +1,7 @@
import { useEffect, useState } from 'react';
import { Link, useLocation } from 'react-router-dom';
-import { Button, Skeleton, Tag } from 'antd';
+import { Button, Skeleton } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import logEvent from 'api/common/logEvent';
import { useListRules } from 'api/generated/services/rules';
import type { RuletypesRuleDTO } from 'api/generated/services/sigNoz.schemas';
@@ -177,12 +178,14 @@ export default function AlertRules({
</div>
<div className="alert-rule-item-description home-data-item-tag">
- <Tag color={rule?.labels?.severity}>{rule?.labels?.severity}</Tag>
+ <Badge color="sienna" variant="outline">
+ {rule?.labels?.severity}
+ </Badge>
{rule.state === 'firing' && (
- <Tag color="red" className="firing-tag">
+ <Badge color="cherry" variant="outline" className="firing-tag">
{rule.state}
- </Tag>
+ </Badge>
)}
</div>
</div>
diff --git a/frontend/src/container/Home/Dashboards/Dashboards.tsx b/frontend/src/container/Home/Dashboards/Dashboards.tsx
index 4f5f65d7b8..5135ba7716 100644
--- a/frontend/src/container/Home/Dashboards/Dashboards.tsx
+++ b/frontend/src/container/Home/Dashboards/Dashboards.tsx
@@ -1,6 +1,7 @@
import { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
-import { Button, Skeleton, Tag } from 'antd';
+import { Button, Skeleton } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import logEvent from 'api/common/logEvent';
import ROUTES from 'constants/routes';
import { useGetAllDashboard } from 'hooks/dashboard/useGetAllDashboard';
@@ -148,9 +149,9 @@ export default function Dashboards({
<div className="alert-rule-item-description home-data-item-tag">
{dashboard.data.tags?.map((tag) => (
- <Tag color={tag} key={tag}>
+ <Badge color="sienna" variant="outline" key={tag}>
{tag}
- </Tag>
+ </Badge>
))}
</div>
</div>
diff --git a/frontend/src/container/Home/Home.styles.scss b/frontend/src/container/Home/Home.styles.scss
index aea30a5084..3422b4e772 100644
--- a/frontend/src/container/Home/Home.styles.scss
+++ b/frontend/src/container/Home/Home.styles.scss
@@ -574,30 +574,7 @@
.home-data-item-tag {
display: flex;
-
- .ant-tag {
- display: flex;
- padding: 2px 12px;
- justify-content: center;
- align-items: center;
- gap: 4px;
- border-radius: 20px;
- border: 1px solid color-mix(in srgb, var(--bg-sienna-500) 20%, transparent);
- background: color-mix(in srgb, var(--bg-sienna-500) 10%, transparent);
-
- color: var(--bg-sienna-400);
- text-align: center;
- font-family: Inter;
- font-size: 12px;
- font-style: normal;
- line-height: 20px; /* 142.857% */
- letter-spacing: -0.07px;
- }
-
- .firing-tag {
- color: var(--bg-sakura-500);
- background: color-mix(in srgb, var(--danger-background) 10%, transparent);
- }
+ gap: 6px;
}
&.services-list-container {
diff --git a/frontend/src/container/Home/SavedViews/SavedViews.tsx b/frontend/src/container/Home/SavedViews/SavedViews.tsx
index ffbb190509..4b2b3b842a 100644
--- a/frontend/src/container/Home/SavedViews/SavedViews.tsx
+++ b/frontend/src/container/Home/SavedViews/SavedViews.tsx
@@ -1,6 +1,7 @@
import { useEffect, useMemo, useState } from 'react';
import { Link } from 'react-router-dom';
-import { Button, Skeleton, Tag } from 'antd';
+import { Button, Skeleton } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import logEvent from 'api/common/logEvent';
import { getViewDetailsUsingViewKey } from 'components/ExplorerCard/utils';
import ROUTES from 'constants/routes';
@@ -249,9 +250,9 @@ export default function SavedViews({
}
return (
- <Tag color={tag} key={tag}>
+ <Badge color="sienna" key={tag}>
{tag}
- </Tag>
+ </Badge>
);
})}
</div>
diff --git a/frontend/src/container/InfraMonitoringHosts/constants.tsx b/frontend/src/container/InfraMonitoringHosts/constants.tsx
index 488b4324e7..85bceea908 100644
--- a/frontend/src/container/InfraMonitoringHosts/constants.tsx
+++ b/frontend/src/container/InfraMonitoringHosts/constants.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import { Color } from '@signozhq/design-tokens';
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Progress } from '@signozhq/ui/progress';
import { Typography } from '@signozhq/ui/typography';
import {
@@ -52,14 +52,14 @@ export const hostDetailsMetadataConfig: K8sDetailsMetadataConfig<HostData>[] = [
label: 'STATUS',
getValue: (h): string => (h.active ? 'ACTIVE' : 'INACTIVE'),
render: (value, h): React.ReactNode => (
- <Tag
+ <Badge
+ variant="outline"
className={`${infraHostsStyles.infraMonitoringTags} ${
h.active ? infraHostsStyles.tagsActive : infraHostsStyles.tagsInactive
}`}
- bordered
>
{value}
- </Tag>
+ </Badge>
),
},
{
@@ -67,9 +67,9 @@ export const hostDetailsMetadataConfig: K8sDetailsMetadataConfig<HostData>[] = [
getValue: (h): string => h.os || '-',
render: (value): React.ReactNode =>
value !== '-' ? (
- <Tag className={infraHostsStyles.infraMonitoringTags} bordered>
+ <Badge variant="outline" className={infraHostsStyles.infraMonitoringTags}>
{value}
- </Tag>
+ </Badge>
) : (
<Typography.Text>-</Typography.Text>
),
diff --git a/frontend/src/container/InfraMonitoringHosts/table.config.tsx b/frontend/src/container/InfraMonitoringHosts/table.config.tsx
index ab2808790f..610cfe1777 100644
--- a/frontend/src/container/InfraMonitoringHosts/table.config.tsx
+++ b/frontend/src/container/InfraMonitoringHosts/table.config.tsx
@@ -1,5 +1,6 @@
import React from 'react';
-import { Tag, Tooltip } from 'antd';
+import { Tooltip } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { HostData } from 'api/infraMonitoring/getHostLists';
import TanStackTable, { TableColumnDef } from 'components/TanStackTableView';
import { getGroupByEl } from 'container/InfraMonitoringK8s/Base/utils';
@@ -92,14 +93,13 @@ export const hostColumnsConfig: TableColumnDef<HostData>[] = [
cell: ({ value }): React.ReactNode => {
const active = value as boolean;
return (
- <Tag
- bordered
+ <Badge
className={`${styles.statusTag} ${
active ? styles.statusTagActive : styles.statusTagInactive
}`}
>
{active ? 'ACTIVE' : 'INACTIVE'}
- </Tag>
+ </Badge>
);
},
},
diff --git a/frontend/src/container/InfraMonitoringK8s/Base/K8sHeader.module.scss b/frontend/src/container/InfraMonitoringK8s/Base/K8sHeader.module.scss
index 508f1a2ac3..4b8762a173 100644
--- a/frontend/src/container/InfraMonitoringK8s/Base/K8sHeader.module.scss
+++ b/frontend/src/container/InfraMonitoringK8s/Base/K8sHeader.module.scss
@@ -14,7 +14,7 @@
font-size: 12px;
}
- :global(.ant-tag .ant-typography) {
+ :global([data-slot='badge'] .ant-typography) {
font-size: 12px;
}
}
diff --git a/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityEvents/EntityEvents.module.scss b/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityEvents/EntityEvents.module.scss
index 609318bb29..4f83ae614d 100644
--- a/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityEvents/EntityEvents.module.scss
+++ b/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityEvents/EntityEvents.module.scss
@@ -19,7 +19,7 @@
font-size: 12px;
}
- :global(.ant-tag .ant-typography) {
+ :global([data-slot='badge'] .ant-typography) {
font-size: 12px;
}
}
diff --git a/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityLogs/EntityLogs.module.scss b/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityLogs/EntityLogs.module.scss
index 7b4a669776..f7119791d6 100644
--- a/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityLogs/EntityLogs.module.scss
+++ b/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityLogs/EntityLogs.module.scss
@@ -19,7 +19,7 @@
font-size: 12px;
}
- :global(.ant-tag .ant-typography) {
+ :global([data-slot='badge'] .ant-typography) {
font-size: 12px;
}
}
diff --git a/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityTraces/EntityTraces.module.scss b/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityTraces/EntityTraces.module.scss
index 41751eb195..b2fac5dc3b 100644
--- a/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityTraces/EntityTraces.module.scss
+++ b/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityTraces/EntityTraces.module.scss
@@ -19,7 +19,7 @@
font-size: 12px;
}
- :global(.ant-tag .ant-typography) {
+ :global([data-slot='badge'] .ant-typography) {
font-size: 12px;
}
}
diff --git a/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityTraces/traceListColumns.tsx b/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityTraces/traceListColumns.tsx
index 592c70d89e..da4101ad2a 100644
--- a/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityTraces/traceListColumns.tsx
+++ b/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/EntityTraces/traceListColumns.tsx
@@ -1,4 +1,5 @@
-import { TableColumnsType as ColumnsType, Tag } from 'antd';
+import { TableColumnsType as ColumnsType } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Typography } from '@signozhq/ui/typography';
import { DATE_TIME_FORMATS } from 'constants/dateTimeFormats';
import { getMs } from 'container/Trace/Filters/Panel/PanelBody/Duration/util';
@@ -93,9 +94,9 @@ export const getTraceListColumns = (
if (primaryKey === 'httpMethod' || primaryKey === 'responseStatusCode') {
return (
<BlockLink to={getTraceLink(itemData)} openInNewTab>
- <Tag data-testid={key} color="magenta">
+ <Badge data-testid={key} color="sakura">
{getValueForKey(itemData, key)}
- </Tag>
+ </Badge>
</BlockLink>
);
}
diff --git a/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/entityDetails.styles.scss b/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/entityDetails.styles.scss
index 75892a27db..438320c6d4 100644
--- a/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/entityDetails.styles.scss
+++ b/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/entityDetails.styles.scss
@@ -213,7 +213,7 @@
font-size: 12px;
}
- .ant-tag .ant-typography {
+ [data-slot='badge'] .ant-typography {
font-size: 12px;
}
}
@@ -349,7 +349,7 @@
font-size: 12px;
}
- .ant-tag .ant-typography {
+ [data-slot='badge'] .ant-typography {
font-size: 12px;
}
}
diff --git a/frontend/src/container/IngestionSettings/MultiIngestionSettings.tsx b/frontend/src/container/IngestionSettings/MultiIngestionSettings.tsx
index c9a236d642..5086fb3760 100644
--- a/frontend/src/container/IngestionSettings/MultiIngestionSettings.tsx
+++ b/frontend/src/container/IngestionSettings/MultiIngestionSettings.tsx
@@ -18,7 +18,6 @@ import {
Table,
TablePaginationConfig,
TableProps as AntDTableProps,
- Tag,
Tooltip,
} from 'antd';
import { Switch } from '@signozhq/ui/switch';
@@ -41,7 +40,7 @@ import {
} from 'api/generated/services/sigNoz.schemas';
import { AxiosError } from 'axios';
import { getYAxisFormattedValue } from 'components/Graph/yAxisConfig';
-import Tags from 'components/Tags/Tags';
+import Badges from 'components/Badges/Badges';
import { UniversalYAxisUnit } from 'components/YAxisUnitSelector/types';
import { SOMETHING_WENT_WRONG } from 'constants/api';
import { DATE_TIME_FORMATS } from 'constants/dateTimeFormats';
@@ -1055,7 +1054,10 @@ function MultiIngestionSettings(): JSX.Element {
<div className="ingestion-key-tags">
{APIKey.tags.map((tag, index) => (
// eslint-disable-next-line react/no-array-index-key
- <Tag key={`${tag}-${index}`}> {tag} </Tag>
+ <Badge key={`${tag}-${index}`} color="vanilla">
+ {' '}
+ {tag}{' '}
+ </Badge>
))}
</div>
</div>
@@ -1834,7 +1836,7 @@ function MultiIngestionSettings(): JSX.Element {
</Form.Item>
<Form.Item name="tags" label="Tags">
- <Tags tags={updatedTags} setTags={setUpdatedTags} />
+ <Badges tags={updatedTags} setTags={setUpdatedTags} />
</Form.Item>
<Form.Item
@@ -1924,7 +1926,7 @@ function MultiIngestionSettings(): JSX.Element {
</Form.Item>
<Form.Item name="tags" label="Tags">
- <Tags tags={updatedTags} setTags={setUpdatedTags} />
+ <Badges tags={updatedTags} setTags={setUpdatedTags} />
</Form.Item>
</Form>
</Modal>
diff --git a/frontend/src/container/ListAlertRules/ListAlert.tsx b/frontend/src/container/ListAlertRules/ListAlert.tsx
index 371c808267..0d09eb01cd 100644
--- a/frontend/src/container/ListAlertRules/ListAlert.tsx
+++ b/frontend/src/container/ListAlertRules/ListAlert.tsx
@@ -310,9 +310,7 @@ function ListAlert({ allAlertRules, refetch }: ListAlertProps): JSX.Element {
return <Typography>-</Typography>;
}
- return (
- <LabelColumn labels={withOutSeverityKeys} value={value} color="magenta" />
- );
+ return <LabelColumn labels={withOutSeverityKeys} value={value} />;
},
},
];
diff --git a/frontend/src/container/ListAlertRules/TableComponents/Status.tsx b/frontend/src/container/ListAlertRules/TableComponents/Status.tsx
index fe628492c1..aeae5f80d7 100644
--- a/frontend/src/container/ListAlertRules/TableComponents/Status.tsx
+++ b/frontend/src/container/ListAlertRules/TableComponents/Status.tsx
@@ -1,26 +1,46 @@
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import type { RuletypesRuleDTO } from 'api/generated/services/sigNoz.schemas';
function Status({ status }: StatusProps): JSX.Element {
switch (status) {
case 'inactive': {
- return <Tag color="green">OK</Tag>;
+ return (
+ <Badge color="forest" variant="outline">
+ OK
+ </Badge>
+ );
}
case 'pending': {
- return <Tag color="orange">Pending</Tag>;
+ return (
+ <Badge color="amber" variant="outline">
+ Pending
+ </Badge>
+ );
}
case 'firing': {
- return <Tag color="red">Firing</Tag>;
+ return (
+ <Badge color="cherry" variant="outline">
+ Firing
+ </Badge>
+ );
}
case 'disabled': {
- return <Tag>Disabled</Tag>;
+ return (
+ <Badge color="vanilla" variant="outline">
+ Disabled
+ </Badge>
+ );
}
default: {
- return <Tag color="default">Unknown</Tag>;
+ return (
+ <Badge color="vanilla" variant="outline">
+ Unknown
+ </Badge>
+ );
}
}
}
diff --git a/frontend/src/container/ListOfDashboard/DashboardsList.tsx b/frontend/src/container/ListOfDashboard/DashboardsList.tsx
index fb66f2909a..9ef85c0ba3 100644
--- a/frontend/src/container/ListOfDashboard/DashboardsList.tsx
+++ b/frontend/src/container/ListOfDashboard/DashboardsList.tsx
@@ -21,9 +21,9 @@ import {
Popover,
Skeleton,
Table,
- Tag,
Tooltip,
} from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Switch } from '@signozhq/ui/switch';
import { Typography } from '@signozhq/ui/typography';
import type { TableProps } from 'antd/lib';
@@ -419,15 +419,15 @@ function DashboardsList(): JSX.Element {
{dashboard?.tags && dashboard.tags.length > 0 && (
<div className="dashboard-tags">
{dashboard.tags.slice(0, 3).map((tag) => (
- <Tag className="tag" key={tag}>
+ <Badge className="tag" color="vanilla" key={tag}>
{tag}
- </Tag>
+ </Badge>
))}
{dashboard.tags.length > 3 && (
- <Tag className="tag" key={dashboard.tags[3]}>
+ <Badge className="tag" color="vanilla" key={dashboard.tags[3]}>
+ <span> {dashboard.tags.length - 3} </span>
- </Tag>
+ </Badge>
)}
</div>
)}
diff --git a/frontend/src/container/LogDetailedView/FieldRenderer.styles.ts b/frontend/src/container/LogDetailedView/FieldRenderer.styles.ts
index 62bb220c7e..99942af6ce 100644
--- a/frontend/src/container/LogDetailedView/FieldRenderer.styles.ts
+++ b/frontend/src/container/LogDetailedView/FieldRenderer.styles.ts
@@ -1,7 +1,7 @@
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import styled from 'styled-components';
-export const TagContainer = styled(Tag)`
+export const TagContainer = styled(Badge)`
&&& {
border-color: var(--bg-slate-400);
border-radius: 0.25rem;
diff --git a/frontend/src/container/LogDetailedView/Overview.styles.scss b/frontend/src/container/LogDetailedView/Overview.styles.scss
index b470f81496..a0a413c4b1 100644
--- a/frontend/src/container/LogDetailedView/Overview.styles.scss
+++ b/frontend/src/container/LogDetailedView/Overview.styles.scss
@@ -84,7 +84,7 @@
padding-top: 12px;
}
- .ant-tag-borderless {
+ [data-slot='badge'] {
border-radius: 2px;
background: color-mix(in srgb, var(--bg-robin-400) 8%, transparent);
}
diff --git a/frontend/src/container/LogDetailedView/Overview.tsx b/frontend/src/container/LogDetailedView/Overview.tsx
index edd6f168ce..3b1148b711 100644
--- a/frontend/src/container/LogDetailedView/Overview.tsx
+++ b/frontend/src/container/LogDetailedView/Overview.tsx
@@ -3,8 +3,9 @@ import MEditor, { EditorProps, Monaco } from '@monaco-editor/react';
import { Color } from '@signozhq/design-tokens';
import { Button } from '@signozhq/ui/button';
import { Switch } from '@signozhq/ui/switch';
-import { Collapse, Input, Tag } from 'antd';
+import { Collapse, Input } from 'antd';
import { Divider } from '@signozhq/ui/divider';
+import { Badge } from '@signozhq/ui/badge';
import { Typography } from '@signozhq/ui/typography';
import { AddToQueryHOCProps } from 'components/Logs/AddToQueryHOC';
import { ChangeViewFunctionType } from 'container/ExplorerOptions/types';
@@ -105,11 +106,11 @@ function Overview({
{
key: '1',
label: (
- <Tag bordered={false}>
+ <Badge color="vanilla">
<Typography.Text style={{ color: Color.BG_ROBIN_400 }}>
body
</Typography.Text>
- </Tag>
+ </Badge>
),
children: (
<div className="logs-body-content">
@@ -143,7 +144,7 @@ function Overview({
</div>
</div>
),
- // extra: <Tag className="tag">JSON</Tag>,
+ // extra: <Badge className="tag" color="vanilla">JSON</Badge>,
className: 'collapse-content',
},
]}
@@ -164,11 +165,11 @@ function Overview({
className="attribute-tab-header"
onClick={toogleAttributePanelOpenState}
>
- <Tag bordered={false}>
+ <Badge color="vanilla">
<Typography.Text style={{ color: Color.BG_ROBIN_400 }}>
Attributes
</Typography.Text>
- </Tag>
+ </Badge>
{isAttributesExpanded && (
<Button
diff --git a/frontend/src/container/LogExplorerQuerySection/LogsExplorerQuerySection.styles.scss b/frontend/src/container/LogExplorerQuerySection/LogsExplorerQuerySection.styles.scss
index 9e3f3b4ca2..64ac2f69db 100644
--- a/frontend/src/container/LogExplorerQuerySection/LogsExplorerQuerySection.styles.scss
+++ b/frontend/src/container/LogExplorerQuerySection/LogsExplorerQuerySection.styles.scss
@@ -11,7 +11,7 @@
font-size: 12px;
}
- .ant-tag .ant-typography {
+ [data-slot='badge'] .ant-typography {
font-size: 12px;
}
}
diff --git a/frontend/src/container/MySettings/index.tsx b/frontend/src/container/MySettings/index.tsx
index 178ddaa07b..e24f976164 100644
--- a/frontend/src/container/MySettings/index.tsx
+++ b/frontend/src/container/MySettings/index.tsx
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import { useMutation } from 'react-query';
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Switch } from '@signozhq/ui/switch';
import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import setLocalStorageApi from 'api/browser/localstorage/set';
@@ -65,9 +65,7 @@ function MySettings(): JSX.Element {
label: (
<div className="theme-option">
<Sun size={12} data-testid="light-theme-icon" /> Light{' '}
- <Tag bordered={false} color="geekblue">
- Beta
- </Tag>
+ <Badge color="robin">Beta</Badge>
</div>
),
value: 'light',
diff --git a/frontend/src/container/NewWidget/styles.ts b/frontend/src/container/NewWidget/styles.ts
index c8ead97f79..b568a0c7b5 100644
--- a/frontend/src/container/NewWidget/styles.ts
+++ b/frontend/src/container/NewWidget/styles.ts
@@ -1,4 +1,3 @@
-import { Tag as AntDTag } from 'antd';
import styled from 'styled-components';
export const Container = styled.div`
@@ -19,7 +18,3 @@ export const PanelContainer = styled.div`
display: flex;
overflow-y: auto;
`;
-
-export const Tag = styled(AntDTag)`
- margin: 0;
-`;
diff --git a/frontend/src/container/PipelinePage/PipelineListsView/TableComponents/Tags.tsx b/frontend/src/container/PipelinePage/PipelineListsView/TableComponents/Tags.tsx
index 2f373b2051..cc087fbb1e 100644
--- a/frontend/src/container/PipelinePage/PipelineListsView/TableComponents/Tags.tsx
+++ b/frontend/src/container/PipelinePage/PipelineListsView/TableComponents/Tags.tsx
@@ -1,12 +1,12 @@
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
function Tags({ tags }: TagsProps): JSX.Element {
return (
<span>
{tags?.map((tag) => (
- <Tag color="magenta" key={tag}>
+ <Badge color="sakura" key={tag}>
{tag}
- </Tag>
+ </Badge>
))}
</span>
);
diff --git a/frontend/src/container/PipelinePage/components/TagInput.tsx b/frontend/src/container/PipelinePage/components/TagInput.tsx
index 4d302e5781..7ff1d781b0 100644
--- a/frontend/src/container/PipelinePage/components/TagInput.tsx
+++ b/frontend/src/container/PipelinePage/components/TagInput.tsx
@@ -1,7 +1,8 @@
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { CircleAlert, CircleX } from '@signozhq/icons';
-import { Button, Input, InputRef, message, Modal, Tag, Tooltip } from 'antd';
+import { Button, Input, InputRef, message, Modal, Tooltip } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { tagInputStyle } from '../PipelineListsView/config';
import { TagInputWrapper } from './styles';
@@ -90,22 +91,26 @@ function TagInput({
}
const isLongTag = tag.length > 20;
const tagElem = (
- <Tag
+ <Badge
key={tag}
- closable
+ color="vanilla"
style={{ userSelect: 'none' }}
- onClose={handleClose(tag)}
+ closable
+ onClose={(e): void => {
+ e.preventDefault();
+ handleClose(tag)();
+ }}
>
<span
- onDoubleClick={(e): void => {
+ onDoubleClick={(ev): void => {
setEditInputIndex(index);
setEditInputValue(tag);
- e.preventDefault();
+ ev.preventDefault();
}}
>
{isLongTag ? `${tag.slice(0, 20)}...` : tag}
</span>
- </Tag>
+ </Badge>
);
return isLongTag ? (
<Tooltip title={tag} key={tag}>
diff --git a/frontend/src/container/PipelinePage/tests/__snapshots__/Tags.test.tsx.snap b/frontend/src/container/PipelinePage/tests/__snapshots__/Tags.test.tsx.snap
index 6803c0ee9e..cf4f31f6a2 100644
--- a/frontend/src/container/PipelinePage/tests/__snapshots__/Tags.test.tsx.snap
+++ b/frontend/src/container/PipelinePage/tests/__snapshots__/Tags.test.tsx.snap
@@ -4,12 +4,20 @@ exports[`PipelinePage container test should render Tags section 1`] = `
<DocumentFragment>
<span>
<span
- class="ant-tag ant-tag-magenta css-dev-only-do-not-override-2i2tap"
+ class="_badge_1etd5_1"
+ data-capitalize="false"
+ data-color="sakura"
+ data-slot="badge"
+ data-variant="default"
>
server
</span>
<span
- class="ant-tag ant-tag-magenta css-dev-only-do-not-override-2i2tap"
+ class="_badge_1etd5_1"
+ data-capitalize="false"
+ data-color="sakura"
+ data-slot="badge"
+ data-variant="default"
>
app
</span>
diff --git a/frontend/src/container/PlannedDowntime/PlannedDowntime.styles.scss b/frontend/src/container/PlannedDowntime/PlannedDowntime.styles.scss
index c22ef03129..759637ca80 100644
--- a/frontend/src/container/PlannedDowntime/PlannedDowntime.styles.scss
+++ b/frontend/src/container/PlannedDowntime/PlannedDowntime.styles.scss
@@ -53,12 +53,6 @@
margin-bottom: 8px;
overflow: auto;
max-height: 100px;
- .ant-tag {
- user-select: none;
- height: 28px;
- display: inline-flex;
- align-items: center;
- }
}
.ant-select {
@@ -109,61 +103,8 @@
}
.alert-rule-tags {
- .ant-tag {
- display: flex;
- align-items: center;
- border: 1px solid color-mix(in srgb, var(--bg-robin-400) 20%, transparent);
- background: color-mix(in srgb, var(--bg-robin-400) 10%, transparent);
- box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
- padding-right: 0px;
- border-right: 0;
- color: var(--bg-robin-400);
-
- .ant-tag-close-icon {
- height: 28px;
- width: 20px !important;
- justify-content: center;
- border-left: 1px solid
- color-mix(in srgb, var(--bg-robin-400) 20%, transparent);
- border-radius: 0px 2px 2px 0px;
- background: color-mix(in srgb, var(--bg-robin-400) 30%, transparent);
- border-right: 1px solid
- color-mix(in srgb, var(--bg-robin-400) 20%, transparent);
- margin-right: 0px;
-
- svg {
- fill: var(--primary-background);
- }
- }
- }
.non-closable-tag {
padding-right: 7px;
- border-right: 1px solid
- color-mix(in srgb, var(--bg-robin-400) 20%, transparent);
- }
-
- .red-tag.non-closable-tag {
- border-right: 1px solid
- color-mix(in srgb, var(--bg-sakura-500) 20%, transparent) !important;
- }
-
- .red-tag {
- border: 1px solid color-mix(in srgb, var(--bg-sakura-500) 20%, transparent);
- background: color-mix(in srgb, var(--bg-sakura-500) 10%, transparent);
- border-right: 0;
- color: var(--bg-sakura-400);
-
- .ant-tag-close-icon {
- background: color-mix(in srgb, var(--bg-sakura-500) 30%, transparent);
- border-left: 1px solid
- color-mix(in srgb, var(--bg-sakura-500) 20%, transparent);
- border-right: 1px solid
- color-mix(in srgb, var(--bg-sakura-500) 20%, transparent);
-
- svg {
- fill: var(--bg-sakura-500);
- }
- }
}
}
@@ -271,9 +212,6 @@
line-height: 18px;
letter-spacing: -0.07px;
}
- .ant-tag {
- border-radius: 20px;
- }
.action-btn {
display: flex;
@@ -328,12 +266,6 @@
width: 540px;
max-height: 100px;
overflow: auto;
-
- .ant-tag {
- height: 28px;
- display: flex;
- align-items: center;
- }
}
.ant-collapse-content-active {
border-top: 0;
diff --git a/frontend/src/container/PlannedDowntime/PlannedDowntimeList.tsx b/frontend/src/container/PlannedDowntime/PlannedDowntimeList.tsx
index a0a229a586..de97f6c7a6 100644
--- a/frontend/src/container/PlannedDowntime/PlannedDowntimeList.tsx
+++ b/frontend/src/container/PlannedDowntime/PlannedDowntimeList.tsx
@@ -1,7 +1,8 @@
import React, { ReactNode, useEffect } from 'react';
import { UseQueryResult } from 'react-query';
import { Color } from '@signozhq/design-tokens';
-import { Collapse, Flex, Space, Table, TableProps, Tag, Tooltip } from 'antd';
+import { Collapse, Flex, Space, Table, TableProps, Tooltip } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Typography } from '@signozhq/ui/typography';
import type { DefaultOptionType } from 'antd/es/select';
import type {
@@ -48,21 +49,24 @@ export function AlertRuleTags(props: AlertRuleTagsProps): JSX.Element {
{selectedTags?.map((tag: DefaultOptionType, index: number) => {
const isLongTag = (tag?.label as string)?.length > 20;
const tagElem = (
- <Tag
+ <Badge
key={tag.value}
- onClose={(): void => handleClose?.(tag?.value)}
- closable={closable}
+ color={index % 2 ? 'sakura' : 'robin'}
+ variant="outline"
className={cx(
{ 'red-tag': index % 2 },
{ 'non-closable-tag': !closable },
)}
+ closable={closable}
+ onClose={(e): void => {
+ e.preventDefault();
+ handleClose?.(tag?.value);
+ }}
>
- <span>
- {isLongTag
- ? `${(tag?.label as string | null)?.slice(0, 20)}...`
- : tag?.label}
- </span>
- </Tag>
+ {isLongTag
+ ? `${(tag?.label as string | null)?.slice(0, 20)}...`
+ : tag?.label}
+ </Badge>
);
return isLongTag ? (
<Tooltip title={tag?.label} key={tag?.value}>
@@ -93,7 +97,7 @@ function HeaderComponent({
<Flex className="header-content" justify="space-between">
<Flex gap={8}>
<Typography>{name}</Typography>
- <Tag>{duration}</Tag>
+ <Badge color="vanilla">{duration}</Badge>
</Flex>
{isCrudEnabled && (
@@ -155,9 +159,7 @@ export function CollapseListContent({
created_by_name ? (
<Flex gap={8}>
<Typography>{created_by_name}</Typography>
- {created_by_email && (
- <Tag style={{ borderRadius: 20 }}>{created_by_email}</Tag>
- )}
+ {created_by_email && <Badge color="vanilla">{created_by_email}</Badge>}
</Flex>
) : (
'-'
@@ -204,7 +206,9 @@ export function CollapseListContent({
selectedTags={alertOptions}
/>
) : (
- <Tag className="all-alerts-tag">All alert rules</Tag>
+ <Badge className="all-alerts-tag" color="vanilla">
+ All alert rules
+ </Badge>
),
)}
</Flex>
diff --git a/frontend/src/container/QueryBuilder/components/HavingFilterTag/HavingFilterTag.styled.ts b/frontend/src/container/QueryBuilder/components/HavingFilterTag/HavingFilterTag.styled.ts
index 1ef2b4dd36..3ac7279dfa 100644
--- a/frontend/src/container/QueryBuilder/components/HavingFilterTag/HavingFilterTag.styled.ts
+++ b/frontend/src/container/QueryBuilder/components/HavingFilterTag/HavingFilterTag.styled.ts
@@ -1,11 +1,11 @@
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import styled from 'styled-components';
export const StyledText = styled.span`
cursor: pointer;
`;
-export const StyledTag = styled(Tag)`
+export const StyledTag = styled(Badge)`
margin-top: 0.125rem;
margin-bottom: 0.125rem;
padding-left: 0.5rem;
diff --git a/frontend/src/container/QueryBuilder/components/HavingFilterTag/HavingFilterTag.tsx b/frontend/src/container/QueryBuilder/components/HavingFilterTag/HavingFilterTag.tsx
index 03314c38af..f2b36d099f 100644
--- a/frontend/src/container/QueryBuilder/components/HavingFilterTag/HavingFilterTag.tsx
+++ b/frontend/src/container/QueryBuilder/components/HavingFilterTag/HavingFilterTag.tsx
@@ -12,7 +12,14 @@ export function HavingFilterTag({
};
return (
- <StyledTag closable={closable} onClose={onClose}>
+ <StyledTag
+ color="vanilla"
+ closable={closable}
+ onClose={(e): void => {
+ e.preventDefault();
+ onClose();
+ }}
+ >
<span role="button" tabIndex={0} onClick={handleClick}>
<StyledText>{value}</StyledText>
</span>
diff --git a/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/index.tsx b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/index.tsx
index 3afdea01b3..bcdd77e588 100644
--- a/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/index.tsx
+++ b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/index.tsx
@@ -9,7 +9,8 @@ import {
useState,
} from 'react';
import { useLocation } from 'react-router-dom';
-import { Button, Select, Spin, Tag, Tooltip } from 'antd';
+import { Button, Select, Spin, Tooltip } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Typography } from '@signozhq/ui/typography';
import cx from 'classnames';
import {
@@ -199,7 +200,14 @@ function QueryBuilderSearch({
const isDisabled = !!searchValue;
return (
- <Tag closable={!searchValue && closable} onClose={onCloseHandler}>
+ <Badge
+ color="vanilla"
+ closable={!searchValue && closable}
+ onClose={(e): void => {
+ e.preventDefault();
+ onCloseHandler();
+ }}
+ >
<Tooltip title={chipValue}>
<TypographyText
$isInNin={isInNin}
@@ -213,7 +221,7 @@ function QueryBuilderSearch({
{chipValue}
</TypographyText>
</Tooltip>
- </Tag>
+ </Badge>
);
};
diff --git a/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/style.ts b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/style.ts
index c41c0920d1..b1c4471cc9 100644
--- a/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/style.ts
+++ b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/style.ts
@@ -1,5 +1,5 @@
import { Check } from '@signozhq/icons';
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import styled from 'styled-components';
export const TypographyText = styled.span<{
@@ -22,7 +22,7 @@ export const StyledCheckOutlined = styled(Check)`
float: right;
`;
-export const TagContainer = styled(Tag)`
+export const TagContainer = styled(Badge)`
&&& {
display: inline-block;
border-radius: 3px;
diff --git a/frontend/src/container/QueryBuilder/filters/QueryBuilderSearchV2/QueryBuilderSearchV2.styles.scss b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearchV2/QueryBuilderSearchV2.styles.scss
index e1e9aec33d..b42c9d88f1 100644
--- a/frontend/src/container/QueryBuilder/filters/QueryBuilderSearchV2/QueryBuilderSearchV2.styles.scss
+++ b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearchV2/QueryBuilderSearchV2.styles.scss
@@ -225,7 +225,7 @@
}
.qb-search-bar-tokenised-tags {
- .ant-tag {
+ [data-slot='badge'] {
display: flex;
align-items: center;
border-radius: 2px 0px 0px 2px;
@@ -244,7 +244,7 @@
padding: 2px 6px;
}
- .ant-tag-close-icon {
+ .close-icon {
display: flex;
align-items: center;
justify-content: center;
@@ -265,7 +265,7 @@
font-size: 14px;
}
- .ant-tag-close-icon {
+ .close-icon {
background: color-mix(in srgb, var(--bg-aqua-400) 6%, transparent);
}
}
@@ -278,7 +278,7 @@
font-size: 14px;
}
- .ant-tag-close-icon {
+ .close-icon {
background: color-mix(in srgb, var(--bg-sienna-400) 10%, transparent);
}
}
@@ -292,7 +292,7 @@
font-size: 14px;
}
- .ant-tag-close-icon {
+ .close-icon {
background: color-mix(in srgb, var(--bg-robin-400) 10%, transparent);
}
}
diff --git a/frontend/src/container/QueryBuilder/filters/QueryBuilderSearchV2/QueryBuilderSearchV2.tsx b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearchV2/QueryBuilderSearchV2.tsx
index 2e3e77d966..c85f5b991f 100644
--- a/frontend/src/container/QueryBuilder/filters/QueryBuilderSearchV2/QueryBuilderSearchV2.tsx
+++ b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearchV2/QueryBuilderSearchV2.tsx
@@ -8,7 +8,8 @@ import {
useRef,
useState,
} from 'react';
-import { Select, Spin, Tag, Tooltip } from 'antd';
+import { Select, Spin, Tooltip } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import cx from 'classnames';
import {
DATA_TYPE_VS_ATTRIBUTE_VALUES_KEY,
@@ -954,10 +955,14 @@ function QueryBuilderSearchV2(
return (
<span className="qb-search-bar-tokenised-tags">
- <Tag
- closable={!searchValue && closable}
- onClose={onCloseHandler}
+ <Badge
+ color="vanilla"
className={tagDetails?.key?.type || ''}
+ closable={!searchValue && closable}
+ onClose={(e): void => {
+ e.preventDefault();
+ onCloseHandler();
+ }}
>
<Tooltip title={chipValue}>
<TypographyText
@@ -972,7 +977,7 @@ function QueryBuilderSearchV2(
{chipValue}
</TypographyText>
</Tooltip>
- </Tag>
+ </Badge>
</span>
);
};
diff --git a/frontend/src/container/ResourceAttributeFilterV2/ResourceAttributesFilter.styles.scss b/frontend/src/container/ResourceAttributeFilterV2/ResourceAttributesFilter.styles.scss
index 661bd6caf4..e06776a197 100644
--- a/frontend/src/container/ResourceAttributeFilterV2/ResourceAttributesFilter.styles.scss
+++ b/frontend/src/container/ResourceAttributeFilterV2/ResourceAttributesFilter.styles.scss
@@ -10,7 +10,7 @@
font-size: 12px;
}
- .ant-tag .ant-typography {
+ [data-slot='badge'] .ant-typography {
font-size: 12px;
}
}
diff --git a/frontend/src/container/ResourceAttributesFilter/components/QueryChip/QueryChip.tsx b/frontend/src/container/ResourceAttributesFilter/components/QueryChip/QueryChip.tsx
index ac7a95f171..539aa0c515 100644
--- a/frontend/src/container/ResourceAttributesFilter/components/QueryChip/QueryChip.tsx
+++ b/frontend/src/container/ResourceAttributesFilter/components/QueryChip/QueryChip.tsx
@@ -18,13 +18,22 @@ function QueryChip({ queryData, onClose }: IQueryChipProps): JSX.Element {
featureFlags?.find((flag) => flag.name === FeatureKeys.DOT_METRICS_ENABLED)
?.active || false;
+ const isClosable =
+ queryData.tagKey !== getResourceDeploymentKeys(dotMetricsEnabled);
+
return (
<QueryChipContainer>
- <QueryChipItem>{convertMetricKeyToTrace(queryData.tagKey)}</QueryChipItem>
- <QueryChipItem>{queryData.operator}</QueryChipItem>
+ <QueryChipItem color="vanilla">
+ {convertMetricKeyToTrace(queryData.tagKey)}
+ </QueryChipItem>
+ <QueryChipItem color="vanilla">{queryData.operator}</QueryChipItem>
<QueryChipItem
- closable={queryData.tagKey !== getResourceDeploymentKeys(dotMetricsEnabled)}
- onClose={onCloseHandler}
+ color="vanilla"
+ closable={isClosable}
+ onClose={(e): void => {
+ e.preventDefault();
+ onCloseHandler();
+ }}
>
{queryData.tagValue.join(', ')}
</QueryChipItem>
diff --git a/frontend/src/container/ResourceAttributesFilter/styles.ts b/frontend/src/container/ResourceAttributesFilter/styles.ts
index 390190d2e4..3616eb164e 100644
--- a/frontend/src/container/ResourceAttributesFilter/styles.ts
+++ b/frontend/src/container/ResourceAttributesFilter/styles.ts
@@ -1,5 +1,5 @@
import { grey } from '@ant-design/colors';
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import styled from 'styled-components';
export const SearchContainer = styled.div`
@@ -23,6 +23,6 @@ export const QueryChipContainer = styled.span`
}
`;
-export const QueryChipItem = styled(Tag)`
+export const QueryChipItem = styled(Badge)`
margin-right: 0.1rem;
`;
diff --git a/frontend/src/container/RoutingPolicies/RoutingPolicyListItem.tsx b/frontend/src/container/RoutingPolicies/RoutingPolicyListItem.tsx
index 17e6a23faf..4d850366d8 100644
--- a/frontend/src/container/RoutingPolicies/RoutingPolicyListItem.tsx
+++ b/frontend/src/container/RoutingPolicies/RoutingPolicyListItem.tsx
@@ -1,5 +1,6 @@
import { Color } from '@signozhq/design-tokens';
-import { Button, Collapse, Flex, Tag } from 'antd';
+import { Button, Collapse, Flex } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Typography } from '@signozhq/ui/typography';
import { DATE_TIME_FORMATS } from 'constants/dateTimeFormats';
import { PenLine, Trash2 } from '@signozhq/icons';
@@ -118,7 +119,9 @@ function PolicyListItemContent({
<Typography>Channels</Typography>
<div>
{routingPolicy.channels.map((channel) => (
- <Tag key={channel}>{channel}</Tag>
+ <Badge key={channel} color="vanilla">
+ {channel}
+ </Badge>
))}
</div>
</div>
diff --git a/frontend/src/container/SideNav/NavItem/NavItem.tsx b/frontend/src/container/SideNav/NavItem/NavItem.tsx
index 3ce4dea098..9130ee99c9 100644
--- a/frontend/src/container/SideNav/NavItem/NavItem.tsx
+++ b/frontend/src/container/SideNav/NavItem/NavItem.tsx
@@ -1,4 +1,5 @@
-import { Tag, Tooltip } from 'antd';
+import { Tooltip } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import cx from 'classnames';
import { Pin, PinOff } from '@signozhq/icons';
@@ -58,17 +59,17 @@ export default function NavItem({
{isBeta && (
<div className="nav-item-beta">
- <Tag bordered={false} className="sidenav-beta-tag">
+ <Badge color="robin" className="sidenav-beta-tag">
Beta
- </Tag>
+ </Badge>
</div>
)}
{isNew && (
<div className="nav-item-new">
- <Tag bordered={false} className="sidenav-new-tag">
+ <Badge color="robin" className="sidenav-new-tag">
New
- </Tag>
+ </Badge>
</div>
)}
diff --git a/frontend/src/container/Trace/TraceTable/index.tsx b/frontend/src/container/Trace/TraceTable/index.tsx
index 0aa62f4108..2db758dc49 100644
--- a/frontend/src/container/Trace/TraceTable/index.tsx
+++ b/frontend/src/container/Trace/TraceTable/index.tsx
@@ -1,7 +1,8 @@
import { HTMLAttributes } from 'react';
// eslint-disable-next-line no-restricted-imports
import { useDispatch, useSelector } from 'react-redux';
-import { TableColumnsType as ColumnsType, TableProps, Tag } from 'antd';
+import { TableColumnsType as ColumnsType, TableProps } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Typography } from '@signozhq/ui/typography';
import { ResizeTable } from 'components/ResizeTable';
import { DATE_TIME_FORMATS } from 'constants/dateTimeFormats';
@@ -70,7 +71,7 @@ function TraceTable(): JSX.Element {
if (value.length === 0) {
return <Typography>-</Typography>;
}
- return <Tag color="magenta">{value}</Tag>;
+ return <Badge color="sakura">{value}</Badge>;
};
const columns: ColumnsType<TableType> = [
diff --git a/frontend/src/container/TracesExplorer/ListView/utils.tsx b/frontend/src/container/TracesExplorer/ListView/utils.tsx
index 37b21d5706..45921c8295 100644
--- a/frontend/src/container/TracesExplorer/ListView/utils.tsx
+++ b/frontend/src/container/TracesExplorer/ListView/utils.tsx
@@ -1,6 +1,6 @@
import { Link } from 'react-router-dom';
import type { TableColumnsType as ColumnsType } from 'antd';
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Typography } from '@signozhq/ui/typography';
import { TelemetryFieldKey } from 'api/v5/v5';
import { DATE_TIME_FORMATS } from 'constants/dateTimeFormats';
@@ -107,9 +107,9 @@ export const getListColumns = (
) {
return (
<BlockLink to={getTraceLink(item)} openInNewTab={false}>
- <Tag data-testid={name} color="magenta">
+ <Badge data-testid={name} color="sakura" variant="outline">
{value}
- </Tag>
+ </Badge>
</BlockLink>
);
}
diff --git a/frontend/src/container/TriggeredAlerts/Filter.tsx b/frontend/src/container/TriggeredAlerts/Filter.tsx
index 26a6cad928..f22c458a2e 100644
--- a/frontend/src/container/TriggeredAlerts/Filter.tsx
+++ b/frontend/src/container/TriggeredAlerts/Filter.tsx
@@ -1,6 +1,7 @@
import { useCallback, useMemo, useRef } from 'react';
import type { SelectProps } from 'antd';
-import { Tag, Tooltip } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
+import { Tooltip } from 'antd';
import type { BaseOptionType } from 'antd/es/select';
import { Alerts } from 'types/api/alerts/getTriggered';
@@ -83,14 +84,17 @@ function Filter({
const { closable, onClose, label } = props;
return (
- <Tag
- color="magenta"
- closable={closable}
- onClose={onClose}
+ <Badge
+ color="sakura"
style={{ marginRight: 3 }}
+ closable={closable}
+ onClose={(e): void => {
+ e.preventDefault();
+ onClose();
+ }}
>
{label}
- </Tag>
+ </Badge>
);
};
diff --git a/frontend/src/container/TriggeredAlerts/FilteredTable/ExapandableRow.tsx b/frontend/src/container/TriggeredAlerts/FilteredTable/ExapandableRow.tsx
index 4b94d85dcc..c1bb2d87ea 100644
--- a/frontend/src/container/TriggeredAlerts/FilteredTable/ExapandableRow.tsx
+++ b/frontend/src/container/TriggeredAlerts/FilteredTable/ExapandableRow.tsx
@@ -1,4 +1,4 @@
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Typography } from '@signozhq/ui/typography';
import { DATE_TIME_FORMATS } from 'constants/dateTimeFormats';
import { useTimezone } from 'providers/Timezone';
@@ -51,7 +51,7 @@ function ExapandableRow({ allAlerts }: ExapandableRowProps): JSX.Element {
<TableCell minWidth="90px" overflowX="scroll">
<div>
{tags.map((e) => (
- <Tag key={e}>{`${e}:${labels[e]}`}</Tag>
+ <Badge color="vanilla" key={e}>{`${e}:${labels[e]}`}</Badge>
))}
</div>
</TableCell>
diff --git a/frontend/src/container/TriggeredAlerts/FilteredTable/TableRow.tsx b/frontend/src/container/TriggeredAlerts/FilteredTable/TableRow.tsx
index 2dfa6049cd..3223509b97 100644
--- a/frontend/src/container/TriggeredAlerts/FilteredTable/TableRow.tsx
+++ b/frontend/src/container/TriggeredAlerts/FilteredTable/TableRow.tsx
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { SquareMinus, SquarePlus } from '@signozhq/icons';
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { Alerts } from 'types/api/alerts/getTriggered';
import ExapandableRow from './ExapandableRow';
@@ -26,9 +26,9 @@ function TableRowComponent({
</IconContainer>
<>
{tags.map((tag) => (
- <Tag color="magenta" key={tag}>
+ <Badge color="sakura" key={tag}>
{tag}
- </Tag>
+ </Badge>
))}
</>
</StatusContainer>
diff --git a/frontend/src/container/TriggeredAlerts/NoFilterTable.tsx b/frontend/src/container/TriggeredAlerts/NoFilterTable.tsx
index a86d5c892f..c6ff8e6daf 100644
--- a/frontend/src/container/TriggeredAlerts/NoFilterTable.tsx
+++ b/frontend/src/container/TriggeredAlerts/NoFilterTable.tsx
@@ -59,9 +59,7 @@ function NoFilterTable({
return <Typography>-</Typography>;
}
- return (
- <LabelColumn labels={withOutSeverityKeys} value={labels} color="magenta" />
- );
+ return <LabelColumn labels={withOutSeverityKeys} value={labels} />;
},
},
{
diff --git a/frontend/src/container/TriggeredAlerts/TableComponents/AlertStatus.tsx b/frontend/src/container/TriggeredAlerts/TableComponents/AlertStatus.tsx
index 51564e65fa..d3c345e7a3 100644
--- a/frontend/src/container/TriggeredAlerts/TableComponents/AlertStatus.tsx
+++ b/frontend/src/container/TriggeredAlerts/TableComponents/AlertStatus.tsx
@@ -1,21 +1,21 @@
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
function Severity({ severity }: SeverityProps): JSX.Element {
switch (severity) {
case 'unprocessed': {
- return <Tag color="green">UnProcessed</Tag>;
+ return <Badge color="forest">UnProcessed</Badge>;
}
case 'active': {
- return <Tag color="red">Firing</Tag>;
+ return <Badge color="cherry">Firing</Badge>;
}
case 'suppressed': {
- return <Tag color="red">Suppressed</Tag>;
+ return <Badge color="cherry">Suppressed</Badge>;
}
default: {
- return <Tag color="default">Unknown Status</Tag>;
+ return <Badge color="vanilla">Unknown Status</Badge>;
}
}
}
diff --git a/frontend/src/periscope/components/BetaTag/BetaTag.tsx b/frontend/src/periscope/components/BetaTag/BetaTag.tsx
index 55a4e79d58..fd333e003f 100644
--- a/frontend/src/periscope/components/BetaTag/BetaTag.tsx
+++ b/frontend/src/periscope/components/BetaTag/BetaTag.tsx
@@ -1,9 +1,5 @@
-import { Tag } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
export default function BetaTag(): JSX.Element {
- return (
- <Tag bordered={false} color="geekblue">
- Beta
- </Tag>
- );
+ return <Badge color="robin">Beta</Badge>;
}
diff --git a/frontend/src/periscope/components/Tabs2/Tabs2.tsx b/frontend/src/periscope/components/Tabs2/Tabs2.tsx
index 834dcaf94a..08c14b5e80 100644
--- a/frontend/src/periscope/components/Tabs2/Tabs2.tsx
+++ b/frontend/src/periscope/components/Tabs2/Tabs2.tsx
@@ -1,6 +1,7 @@
import { useState } from 'react';
import { Color } from '@signozhq/design-tokens';
-import { Button, Tag } from 'antd';
+import { Button } from 'antd';
+import { Badge } from '@signozhq/ui/badge';
import { TimelineFilter } from 'container/AlertHistory/types';
import { Undo } from '@signozhq/icons';
@@ -65,11 +66,7 @@ function Tabs2({
>
{tab.label}
- {tab.isBeta && (
- <Tag bordered={false} color="geekblue">
- Beta
- </Tag>
- )}
+ {tab.isBeta && <Badge color="robin">Beta</Badge>}
</Button>
))}
</Button.Group>