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.

feat: replace Radio components with ToggleGroup in various components (#11391)

Yunus M1a97e90117f3
diff --git a/frontend/plugins/rules/no-antd-components.mjs b/frontend/plugins/rules/no-antd-components.mjs
index fbf342f6b8..21f4982f5b 100644
--- a/frontend/plugins/rules/no-antd-components.mjs
+++ b/frontend/plugins/rules/no-antd-components.mjs
@@ -18,6 +18,8 @@ const BANNED_COMPONENTS = {
'Use @signozhq/ui/typography Typography instead of antd Typography.',
Switch: 'Use @signozhq/ui/switch Switch instead of antd Switch.',
Badge: 'Use @signozhq/ui/badge instead of antd Badge.',
+ Radio:
+ 'Use @signozhq/ui/radio-group RadioGroup (dots) or @signozhq/ui/toggle-group ToggleGroup (segmented buttons) instead of antd Radio.',
Progress: 'Use @signozhq/ui/progress instead of antd Progress.',
Avatar: 'Use @signozhq/ui/avatar instead of antd Avatar.',
};
diff --git a/frontend/src/components/DownloadOptionsMenu/DownloadOptionsMenu.tsx b/frontend/src/components/DownloadOptionsMenu/DownloadOptionsMenu.tsx
index 2ad4a5a94e..5c310227e9 100644
--- a/frontend/src/components/DownloadOptionsMenu/DownloadOptionsMenu.tsx
+++ b/frontend/src/components/DownloadOptionsMenu/DownloadOptionsMenu.tsx
@@ -1,5 +1,6 @@
import { useCallback, useMemo, useState } from 'react';
-import { Button, Popover, Radio, Tooltip } from 'antd';
+import { Button, Popover, Tooltip } from 'antd';
+import { RadioGroup, RadioGroupItem } from '@signozhq/ui/radio-group';
import { Typography } from '@signozhq/ui/typography';
import { TelemetryFieldKey } from 'api/v5/v5';
import { useExportRawData } from 'hooks/useDownloadOptionsMenu/useDownloadOptionsMenu';
@@ -63,27 +64,30 @@ export default function DownloadOptionsMenu({
>
<div className="export-format">
<Typography.Text className="title">FORMAT</Typography.Text>
- <Radio.Group
- value={exportFormat}
- onChange={(e): void => setExportFormat(e.target.value)}
- >
- <Radio value={DownloadFormats.CSV}>csv</Radio>
- <Radio value={DownloadFormats.JSONL}>jsonl</Radio>
- </Radio.Group>
+ <RadioGroup value={exportFormat} onChange={setExportFormat}>
+ <RadioGroupItem value={DownloadFormats.CSV}>csv</RadioGroupItem>
+ <RadioGroupItem value={DownloadFormats.JSONL}>jsonl</RadioGroupItem>
+ </RadioGroup>
</div>
<div className="horizontal-line" />
<div className="row-limit">
<Typography.Text className="title">Number of Rows</Typography.Text>
- <Radio.Group
- value={rowLimit}
- onChange={(e): void => setRowLimit(e.target.value)}
+ <RadioGroup
+ value={String(rowLimit)}
+ onChange={(value): void => setRowLimit(Number(value))}
>
- <Radio value={DownloadRowCounts.TEN_K}>10k</Radio>
- <Radio value={DownloadRowCounts.THIRTY_K}>30k</Radio>
- <Radio value={DownloadRowCounts.FIFTY_K}>50k</Radio>
- </Radio.Group>
+ <RadioGroupItem value={String(DownloadRowCounts.TEN_K)}>
+ 10k
+ </RadioGroupItem>
+ <RadioGroupItem value={String(DownloadRowCounts.THIRTY_K)}>
+ 30k
+ </RadioGroupItem>
+ <RadioGroupItem value={String(DownloadRowCounts.FIFTY_K)}>
+ 50k
+ </RadioGroupItem>
+ </RadioGroup>
</div>
{dataSource !== DataSource.TRACES && (
@@ -92,13 +96,12 @@ export default function DownloadOptionsMenu({
<div className="columns-scope">
<Typography.Text className="title">Columns</Typography.Text>
- <Radio.Group
- value={columnsScope}
- onChange={(e): void => setColumnsScope(e.target.value)}
- >
- <Radio value={DownloadColumnsScopes.ALL}>All</Radio>
- <Radio value={DownloadColumnsScopes.SELECTED}>Selected</Radio>
- </Radio.Group>
+ <RadioGroup value={columnsScope} onChange={setColumnsScope}>
+ <RadioGroupItem value={DownloadColumnsScopes.ALL}>All</RadioGroupItem>
+ <RadioGroupItem value={DownloadColumnsScopes.SELECTED}>
+ Selected
+ </RadioGroupItem>
+ </RadioGroup>
</div>
</>
)}
diff --git a/frontend/src/components/HeaderRightSection/FeedbackModal.tsx b/frontend/src/components/HeaderRightSection/FeedbackModal.tsx
index 52a912f95e..66119d1777 100644
--- a/frontend/src/components/HeaderRightSection/FeedbackModal.tsx
+++ b/frontend/src/components/HeaderRightSection/FeedbackModal.tsx
@@ -1,7 +1,8 @@
import { useCallback, useEffect, useState } from 'react';
import { useLocation } from 'react-router-dom';
import { toast } from '@signozhq/ui/sonner';
-import { Button, Input, Radio, RadioChangeEvent } from 'antd';
+import { Button, Input } from 'antd';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { Typography } from '@signozhq/ui/typography';
import logEvent from 'api/common/logEvent';
import { handleContactSupport } from 'container/Integrations/utils';
@@ -101,13 +102,12 @@ function FeedbackModal({ onClose }: { onClose: () => void }): JSX.Element {
return (
<div className="feedback-modal-container">
<div className="feedback-modal-header">
- <Radio.Group
+ <ToggleGroupSimple
+ type="single"
value={activeTab}
- defaultValue={activeTab}
- optionType="button"
className="feedback-modal-tabs"
- options={items}
- onChange={(e: RadioChangeEvent): void => setActiveTab(e.target.value)}
+ onChange={setActiveTab}
+ items={items}
/>
</div>
<div className="feedback-modal-content">
diff --git a/frontend/src/components/LogDetail/LogDetails.styles.scss b/frontend/src/components/LogDetail/LogDetails.styles.scss
index 34d7c7c267..141efa63d1 100644
--- a/frontend/src/components/LogDetail/LogDetails.styles.scss
+++ b/frontend/src/components/LogDetail/LogDetails.styles.scss
@@ -158,23 +158,23 @@
font-weight: var(--font-weight-normal);
}
- .tab {
+ > button {
border: 1px solid var(--l1-border);
width: 114px;
- }
- .tab::before {
- background: var(--l1-border);
- }
+ &::before {
+ background: var(--l1-border);
+ }
- .selected_view {
- background: var(--l3-background);
- color: var(--l1-foreground);
- border: 1px solid var(--l1-border);
- }
+ &[data-state='on'] {
+ background: var(--l3-background);
+ color: var(--l1-foreground);
+ border: 1px solid var(--l1-border);
- .selected_view::before {
- background: var(--l1-border);
+ &::before {
+ background: var(--l1-border);
+ }
+ }
}
}
diff --git a/frontend/src/components/LogDetail/index.tsx b/frontend/src/components/LogDetail/index.tsx
index e2687a2ed4..ade452ba12 100644
--- a/frontend/src/components/LogDetail/index.tsx
+++ b/frontend/src/components/LogDetail/index.tsx
@@ -4,9 +4,9 @@ import { useSelector } from 'react-redux'; // old code, TODO: fix this correctly
import { useCopyToClipboard, useLocation } from 'react-use';
import { Color, Spacing } from '@signozhq/design-tokens';
import { Button } from '@signozhq/ui/button';
-import { Divider, Drawer, Radio, Tooltip } from 'antd';
+import { Divider, Drawer, Tooltip } from 'antd';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { Typography } from '@signozhq/ui/typography';
-import type { RadioChangeEvent } from 'antd/lib';
import cx from 'classnames';
import { LogType } from 'components/Logs/LogStateIndicator/LogStateIndicator';
import QuerySearch from 'components/QueryBuilderV2/QueryV2/QuerySearch/QuerySearch';
@@ -197,8 +197,8 @@ function LogDetailInner({
const LogJsonData = log ? aggregateAttributesResourcesToString(log) : '';
- const handleModeChange = (e: RadioChangeEvent): void => {
- setSelectedView(e.target.value);
+ const handleModeChange = (value: string): void => {
+ setSelectedView(value as VIEWS);
setIsEdit(false);
setIsFilterVisible(false);
};
@@ -452,56 +452,50 @@ function LogDetailInner({
</div>
<div className="tabs-and-search">
- <Radio.Group
+ <ToggleGroupSimple
+ type="single"
className="views-tabs"
onChange={handleModeChange}
value={selectedView}
- >
- <Radio.Button
- className={
- selectedView === VIEW_TYPES.OVERVIEW ? 'selected_view tab' : 'tab'
- }
- value={VIEW_TYPES.OVERVIEW}
- >
- <div className="view-title">
- <Table size={14} />
- Overview
- </div>
- </Radio.Button>
- <Radio.Button
- className={
- selectedView === VIEW_TYPES.JSON ? 'selected_view tab' : 'tab'
- }
- value={VIEW_TYPES.JSON}
- >
- <div className="view-title">
- <Braces size={14} />
- JSON
- </div>
- </Radio.Button>
- <Radio.Button
- className={
- selectedView === VIEW_TYPES.CONTEXT ? 'selected_view tab' : 'tab'
- }
- value={VIEW_TYPES.CONTEXT}
- >
- <div className="view-title">
- <TextSelect size={14} />
- Context
- </div>
- </Radio.Button>
- <Radio.Button
- className={
- selectedView === VIEW_TYPES.INFRAMETRICS ? 'selected_view tab' : 'tab'
- }
- value={VIEW_TYPES.INFRAMETRICS}
- >
- <div className="view-title">
- <Histogram size="md" />
- Metrics
- </div>
- </Radio.Button>
- </Radio.Group>
+ items={[
+ {
+ value: VIEW_TYPES.OVERVIEW,
+ label: (
+ <div className="view-title">
+ <Table size={14} />
+ Overview
+ </div>
+ ),
+ },
+ {
+ value: VIEW_TYPES.JSON,
+ label: (
+ <div className="view-title">
+ <Braces size={14} />
+ JSON
+ </div>
+ ),
+ },
+ {
+ value: VIEW_TYPES.CONTEXT,
+ label: (
+ <div className="view-title">
+ <TextSelect size={14} />
+ Context
+ </div>
+ ),
+ },
+ {
+ value: VIEW_TYPES.INFRAMETRICS,
+ label: (
+ <div className="view-title">
+ <Histogram size="md" />
+ Metrics
+ </div>
+ ),
+ },
+ ]}
+ />
<div className="log-detail-drawer__actions">
{selectedView === VIEW_TYPES.CONTEXT && (
diff --git a/frontend/src/components/QueryBuilderV2/QueryV2/QueryAddOns/QueryAddOns.styles.scss b/frontend/src/components/QueryBuilderV2/QueryV2/QueryAddOns/QueryAddOns.styles.scss
index 0d4714630b..c79bc185fb 100644
--- a/frontend/src/components/QueryBuilderV2/QueryV2/QueryAddOns/QueryAddOns.styles.scss
+++ b/frontend/src/components/QueryBuilderV2/QueryV2/QueryAddOns/QueryAddOns.styles.scss
@@ -2,6 +2,13 @@
.query-add-ons {
width: 100%;
+
+ .add-on-tab-title {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: var(--margin-2);
+ }
}
.add-ons-list {
@@ -25,7 +32,7 @@
color: var(--l2-foreground);
}
- .tab {
+ > button {
border: 1px solid var(--l1-border);
border-left: none;
min-width: 120px;
@@ -35,21 +42,21 @@
&:first-child {
border-left: 1px solid var(--l1-border);
}
- }
- .tab::before {
- background: var(--l1-border);
- }
+ &::before {
+ background: var(--l1-border);
+ }
- .selected-view {
- color: var(--text-robin-500);
- border: 1px solid var(--l1-border);
+ &[data-state='on'] {
+ color: var(--text-robin-500);
+ border: 1px solid var(--l1-border);
- display: none;
- }
+ display: none;
- .selected-view::before {
- background: var(--l1-border);
+ &::before {
+ background: var(--l1-border);
+ }
+ }
}
}
diff --git a/frontend/src/components/QueryBuilderV2/QueryV2/QueryAddOns/QueryAddOns.tsx b/frontend/src/components/QueryBuilderV2/QueryV2/QueryAddOns/QueryAddOns.tsx
index 957aeacb9a..cd43afadbf 100644
--- a/frontend/src/components/QueryBuilderV2/QueryV2/QueryAddOns/QueryAddOns.tsx
+++ b/frontend/src/components/QueryBuilderV2/QueryV2/QueryAddOns/QueryAddOns.tsx
@@ -1,5 +1,6 @@
import { useCallback, useEffect, useRef, useState } from 'react';
-import { Button, Radio, RadioChangeEvent, Tooltip } from 'antd';
+import { Button, Tooltip } from 'antd';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import InputWithLabel from 'components/InputWithLabel/InputWithLabel';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { GroupByFilter } from 'container/QueryBuilder/filters/GroupByFilter/GroupByFilter';
@@ -250,8 +251,7 @@ function QueryAddOns({
);
}, [panelType, isListViewPanel, query, showReduceTo]);
- const handleOptionClick = (e: RadioChangeEvent): void => {
- const clickedAddOn = e.target.value as AddOn;
+ const handleOptionClick = (clickedAddOn: AddOn): void => {
const isAlreadySelected = selectedViews.some(
(view) => view.key === clickedAddOn.key,
);
@@ -515,15 +515,27 @@ function QueryAddOns({
</div>
)}
- <div className="add-ons-list">
- <Radio.Group
- className="add-ons-tabs"
- onChange={handleOptionClick}
- value={selectedViews}
- >
- {addOns.map((addOn) => (
+ <ToggleGroupSimple
+ type="multiple"
+ className="add-ons-tabs"
+ value={selectedViews.map((view) => view.key)}
+ onChange={(newKeys: string[]): void => {
+ const oldKeys = selectedViews.map((view) => view.key);
+ const toggledKey =
+ newKeys.find((k) => !oldKeys.includes(k)) ??
+ oldKeys.find((k) => !newKeys.includes(k));
+ if (!toggledKey) {
+ return;
+ }
+ const clickedAddOn = addOns.find((a) => a.key === toggledKey);
+ if (clickedAddOn) {
+ handleOptionClick(clickedAddOn);
+ }
+ }}
+ items={addOns.map((addOn) => ({
+ value: addOn.key,
+ label: (
<Tooltip
- key={addOn.key}
title={
<TooltipContent
label={addOn.label}
@@ -534,26 +546,17 @@ function QueryAddOns({
placement="top"
mouseEnterDelay={0.5}
>
- <Radio.Button
- className={
- selectedViews.find((view) => view.key === addOn.key)
- ? 'selected-view tab'
- : 'tab'
- }
- value={addOn}
+ <span
+ className="add-on-tab-title"
+ data-testid={`query-add-on-${addOn.key}`}
>
- <div
- className="add-on-tab-title"
- data-testid={`query-add-on-${addOn.key}`}
- >
- {addOn.icon}
- {addOn.label}
- </div>
- </Radio.Button>
+ {addOn.icon}
+ {addOn.label}
+ </span>
</Tooltip>
- ))}
- </Radio.Group>
- </div>
+ ),
+ }))}
+ />
</div>
);
}
diff --git a/frontend/src/components/ServiceAccountDrawer/AddKeyModal/KeyFormPhase.tsx b/frontend/src/components/ServiceAccountDrawer/AddKeyModal/KeyFormPhase.tsx
index 71d9b0a8a9..e1505b7916 100644
--- a/frontend/src/components/ServiceAccountDrawer/AddKeyModal/KeyFormPhase.tsx
+++ b/frontend/src/components/ServiceAccountDrawer/AddKeyModal/KeyFormPhase.tsx
@@ -2,7 +2,7 @@ import type { Control, UseFormRegister } from 'react-hook-form';
import { Controller } from 'react-hook-form';
import { Button } from '@signozhq/ui/button';
import { Input } from '@signozhq/ui/input';
-import { ToggleGroup, ToggleGroupItem } from '@signozhq/ui/toggle-group';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { DatePicker } from 'antd';
import AuthZTooltip from 'components/AuthZTooltip/AuthZTooltip';
import {
@@ -60,30 +60,21 @@ function KeyFormPhase({
name="expiryMode"
control={control}
render={({ field }): JSX.Element => (
- <ToggleGroup
+ <ToggleGroupSimple
type="single"
value={field.value}
- onChange={(val): void => {
+ onChange={(val: string): void => {
if (val) {
field.onChange(val);
}
}}
size="sm"
className="add-key-modal__expiry-toggle"
- >
- <ToggleGroupItem
- value={ExpiryMode.NONE}
- className="add-key-modal__expiry-toggle-btn"
- >
- No Expiration
- </ToggleGroupItem>
- <ToggleGroupItem
- value={ExpiryMode.DATE}
- className="add-key-modal__expiry-toggle-btn"
- >
- Set Expiration Date
- </ToggleGroupItem>
- </ToggleGroup>
+ items={[
+ { value: ExpiryMode.NONE, label: 'No Expiration' },
+ { value: ExpiryMode.DATE, label: 'Set Expiration Date' },
+ ]}
+ />
)}
/>
</div>
diff --git a/frontend/src/components/ServiceAccountDrawer/EditKeyModal/EditKeyForm.tsx b/frontend/src/components/ServiceAccountDrawer/EditKeyModal/EditKeyForm.tsx
index 749886c383..14d41a7120 100644
--- a/frontend/src/components/ServiceAccountDrawer/EditKeyModal/EditKeyForm.tsx
+++ b/frontend/src/components/ServiceAccountDrawer/EditKeyModal/EditKeyForm.tsx
@@ -4,7 +4,7 @@ import { LockKeyhole, Trash2, X } from '@signozhq/icons';
import { Badge } from '@signozhq/ui/badge';
import { Button } from '@signozhq/ui/button';
import { Input } from '@signozhq/ui/input';
-import { ToggleGroup, ToggleGroupItem } from '@signozhq/ui/toggle-group';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { DatePicker } from 'antd';
import type { ServiceaccounttypesGettableFactorAPIKeyDTO } from 'api/generated/services/sigNoz.schemas';
import AuthZTooltip from 'components/AuthZTooltip/AuthZTooltip';
@@ -101,31 +101,22 @@ function EditKeyForm({
name="expiryMode"
control={control}
render={({ field }): JSX.Element => (
- <ToggleGroup
+ <ToggleGroupSimple
type="single"
value={field.value}
- onChange={(val): void => {
+ onChange={(val: string): void => {
if (val && canUpdate) {
field.onChange(val);
}
}}
+ size="sm"
+ disabled={!canUpdate}
className="edit-key-modal__expiry-toggle"
- >
- <ToggleGroupItem
- value={ExpiryMode.NONE}
- disabled={!canUpdate}
- className="edit-key-modal__expiry-toggle-btn"
- >
- No Expiration
- </ToggleGroupItem>
- <ToggleGroupItem
- value={ExpiryMode.DATE}
- disabled={!canUpdate}
- className="edit-key-modal__expiry-toggle-btn"
- >
- Set Expiration Date
- </ToggleGroupItem>
- </ToggleGroup>
+ items={[
+ { value: ExpiryMode.NONE, label: 'No Expiration' },
+ { value: ExpiryMode.DATE, label: 'Set Expiration Date' },
+ ]}
+ />
)}
/>
</div>
diff --git a/frontend/src/components/ServiceAccountDrawer/ServiceAccountDrawer.tsx b/frontend/src/components/ServiceAccountDrawer/ServiceAccountDrawer.tsx
index 05f76f8893..9a5fd99443 100644
--- a/frontend/src/components/ServiceAccountDrawer/ServiceAccountDrawer.tsx
+++ b/frontend/src/components/ServiceAccountDrawer/ServiceAccountDrawer.tsx
@@ -4,7 +4,7 @@ import { Key, LayoutGrid, Plus, Trash2, X } from '@signozhq/icons';
import { Button } from '@signozhq/ui/button';
import { DrawerWrapper } from '@signozhq/ui/drawer';
import { toast } from '@signozhq/ui/sonner';
-import { ToggleGroup, ToggleGroupItem } from '@signozhq/ui/toggle-group';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { Pagination, Skeleton } from 'antd';
import { convertToApiError } from 'api/ErrorResponseHandlerForGeneratedAPIs';
import {
@@ -395,11 +395,11 @@ function ServiceAccountDrawer({
const drawerContent = (
<div className="sa-drawer__layout">
<div className="sa-drawer__tabs">
- <ToggleGroup
+ <ToggleGroupSimple
type="single"
value={activeTab}
size="sm"
- onChange={(val): void => {
+ onChange={(val: string): void => {
if (val) {
void setActiveTab(val as ServiceAccountDrawerTab);
if (val !== ServiceAccountDrawerTab.Keys) {
@@ -409,25 +409,30 @@ function ServiceAccountDrawer({
}
}}
className="sa-drawer__tab-group"
- >
- <ToggleGroupItem
- value={ServiceAccountDrawerTab.Overview}
- className="sa-drawer__tab"
- >
- <LayoutGrid size={14} />
- Overview
- </ToggleGroupItem>
- <ToggleGroupItem
- value={ServiceAccountDrawerTab.Keys}
- className="sa-drawer__tab"
- >
- <Key size={14} />
- Keys
- {keys.length > 0 && (
- <span className="sa-drawer__tab-count">{keys.length}</span>
- )}
- </ToggleGroupItem>
- </ToggleGroup>
+ items={[
+ {
+ value: ServiceAccountDrawerTab.Overview,
+ label: (
+ <>
+ <LayoutGrid size={14} />
+ Overview
+ </>
+ ),
+ },
+ {
+ value: ServiceAccountDrawerTab.Keys,
+ label: (
+ <>
+ <Key size={14} />
+ Keys
+ {keys.length > 0 && (
+ <span className="sa-drawer__tab-count">{keys.length}</span>
+ )}
+ </>
+ ),
+ },
+ ]}
+ />
{activeTab === ServiceAccountDrawerTab.Keys && (
<AuthZTooltip
checks={[
diff --git a/frontend/src/components/SignozRadioGroup/SignozRadioGroup.styles.scss b/frontend/src/components/SignozRadioGroup/SignozRadioGroup.styles.scss
index c395f0597e..f6077858c3 100644
--- a/frontend/src/components/SignozRadioGroup/SignozRadioGroup.styles.scss
+++ b/frontend/src/components/SignozRadioGroup/SignozRadioGroup.styles.scss
@@ -1,12 +1,6 @@
-.signoz-radio-group.ant-radio-group {
+.signoz-radio-group {
color: var(--l2-foreground);
- &.ant-radio-group-disabled {
- opacity: 0.5;
- pointer-events: none;
- cursor: not-allowed;
- }
-
.view-title {
display: flex;
gap: var(--margin-2);
@@ -30,43 +24,41 @@
}
}
- .tab {
+ > button {
border: 1px solid var(--l1-border);
background: var(--l1-background);
+
&:hover {
color: var(--l1-foreground);
}
&::before {
background: var(--l1-border);
}
- }
- .selected_view {
- &,
- &:hover {
- background: var(--l3-background);
- color: var(--l1-foreground);
- border: 1px solid var(--l1-border);
+ &[data-state='on'] {
+ &,
+ &:hover {
+ background: var(--l3-background);
+ color: var(--l1-foreground);
+ border: 1px solid var(--l1-border);
+ }
+ &::before {
+ background: var(--l3-background);
+ border-left: 1px solid var(--l1-border);
+ }
}
- &::before {
- background: var(--l3-background);
- border-left: 1px solid var(--l1-border);
- }
- }
- &.ant-radio-group-disabled {
- .tab,
- .selected_view {
+ &[disabled],
+ &[data-disabled] {
background: var(--l2-background) !important;
border-color: var(--l1-border) !important;
color: var(--l1-foreground) !important;
- }
- .tab:hover,
- .selected_view:hover {
- background: var(--l2-background) !important;
- border-color: var(--l1-border) !important;
- color: var(--l1-foreground) !important;
+ &:hover {
+ background: var(--l2-background) !important;
+ border-color: var(--l1-border) !important;
+ color: var(--l1-foreground) !important;
+ }
}
}
}
diff --git a/frontend/src/components/SignozRadioGroup/SignozRadioGroup.tsx b/frontend/src/components/SignozRadioGroup/SignozRadioGroup.tsx
index 7404df9979..ed9a6a80c9 100644
--- a/frontend/src/components/SignozRadioGroup/SignozRadioGroup.tsx
+++ b/frontend/src/components/SignozRadioGroup/SignozRadioGroup.tsx
@@ -1,4 +1,4 @@
-import { Radio, RadioChangeEvent } from 'antd';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import './SignozRadioGroup.styles.scss';
@@ -11,7 +11,7 @@ interface Option {
interface SignozRadioGroupProps {
value: string;
options: Option[];
- onChange: (e: RadioChangeEvent) => void;
+ onChange: (value: string) => void;
className?: string;
disabled?: boolean;
}
@@ -24,26 +24,22 @@ function SignozRadioGroup({
disabled = false,
}: SignozRadioGroupProps): JSX.Element {
return (
- <Radio.Group
+ <ToggleGroupSimple
+ type="single"
value={value}
- buttonStyle="solid"
className={`signoz-radio-group ${className}`}
onChange={onChange}
disabled={disabled}
- >
- {options.map((option) => (
- <Radio.Button
- key={option.value}
- value={option.value}
- className={value === option.value ? 'selected_view tab' : 'tab'}
- >
+ items={options.map((option) => ({
+ value: option.value,
+ label: (
<div className="view-title-container">
{option.icon && <div className="icon-container">{option.icon}</div>}
{option.label}
</div>
- </Radio.Button>
- ))}
- </Radio.Group>
+ ),
+ }))}
+ />
);
}
diff --git a/frontend/src/container/AIAssistant/components/ApprovalCard/ApprovalCard.tsx b/frontend/src/container/AIAssistant/components/ApprovalCard/ApprovalCard.tsx
index e922508e68..3ad4517c28 100644
--- a/frontend/src/container/AIAssistant/components/ApprovalCard/ApprovalCard.tsx
+++ b/frontend/src/container/AIAssistant/components/ApprovalCard/ApprovalCard.tsx
@@ -10,7 +10,7 @@ import {
DialogSubtitle,
DialogTitle,
} from '@signozhq/ui/dialog';
-import { ToggleGroup, ToggleGroupItem } from '@signozhq/ui/toggle-group';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { TooltipSimple } from '@signozhq/ui/tooltip';
import type {
ApprovalEventDTO,
@@ -132,45 +132,43 @@ export default function ApprovalCard({
<div className={styles.diffModalBody}>
<p className={styles.diffModalSummary}>{approval.summary}</p>
<div className={styles.diffToolbarRow}>
- <ToggleGroup
+ <ToggleGroupSimple
type="single"
size="sm"
value={viewMode}
- onChange={(next): void => {
- // Radix `single` group can emit '' when the active item is clicked again.
+ onChange={(next: string): void => {
+ // Radix `single` group can emit '' when the active item
+ // is clicked again — preserve the current mode.
if (next === 'split' || next === 'unified') {
setViewMode(next);
}
}}
- >
- <TooltipSimple title="Split view">
- <ToggleGroupItem value="split" aria-label="Split view">
- <Columns2 size={12} />
- </ToggleGroupItem>
- </TooltipSimple>
- <TooltipSimple title="Unified view">
- <ToggleGroupItem value="unified" aria-label="Unified view">
- <List size={12} />
- </ToggleGroupItem>
- </TooltipSimple>
- </ToggleGroup>
- <ToggleGroup
+ items={[
+ {
+ value: 'split',
+ 'aria-label': 'Split view',
+ label: <Columns2 size={12} />,
+ },
+ {
+ value: 'unified',
+ 'aria-label': 'Unified view',
+ label: <List size={12} />,
+ },
+ ]}
+ />
+ <ToggleGroupSimple
type="multiple"
size="sm"
value={wrapText ? ['wrap'] : []}
- onChange={(next): void => setWrapText(next.includes('wrap'))}
- >
- <TooltipSimple
- title={wrapText ? 'Disable text wrap' : 'Wrap long lines'}
- >
- <ToggleGroupItem
- value="wrap"
- aria-label={wrapText ? 'Disable text wrap' : 'Wrap long lines'}
- >
- <WrapText size={12} />
- </ToggleGroupItem>
- </TooltipSimple>
- </ToggleGroup>
+ onChange={(next: string[]): void => setWrapText(next.includes('wrap'))}
+ items={[
+ {
+ value: 'wrap',
+ 'aria-label': wrapText ? 'Disable text wrap' : 'Wrap long lines',
+ label: <WrapText size={12} />,
+ },
+ ]}
+ />
</div>
{approval.diff && (
<DiffView
diff --git a/frontend/src/container/AIAssistant/components/blocks/InteractiveQuestion/InteractiveQuestion.tsx b/frontend/src/container/AIAssistant/components/blocks/InteractiveQuestion/InteractiveQuestion.tsx
index 708a272e81..2f832dc421 100644
--- a/frontend/src/container/AIAssistant/components/blocks/InteractiveQuestion/InteractiveQuestion.tsx
+++ b/frontend/src/container/AIAssistant/components/blocks/InteractiveQuestion/InteractiveQuestion.tsx
@@ -1,8 +1,8 @@
import { useState } from 'react';
import cx from 'classnames';
import { Button } from '@signozhq/ui/button';
-import logEvent from 'api/common/logEvent';
-import { Checkbox, Radio } from 'antd';
+import { RadioGroup, RadioGroupItem } from '@signozhq/ui/radio-group';
+import { Checkbox } from 'antd';
import { AIAssistantEvents } from '../../../events';
import { useAIAssistantAnalyticsContext } from '../../../hooks/useAIAssistantAnalyticsContext';
@@ -11,6 +11,7 @@ import { useMessageContext } from '../../MessageContext';
import blockStyles from '../Block.module.scss';
import styles from './InteractiveQuestion.module.scss';
+import logEvent from 'api/common/logEvent';
interface Option {
value: string;
@@ -81,19 +82,23 @@ export default function InteractiveQuestion({
{question && <p className={blockStyles.title}>{question}</p>}
{type === 'radio' ? (
- <Radio.Group
+ <RadioGroup
className={styles.options}
- onChange={(e): void => {
- setSelected([e.target.value]);
- handleSubmit([e.target.value]);
+ onChange={(value): void => {
+ setSelected([value]);
+ handleSubmit([value]);
}}
>
{normalized.map((opt) => (
- <Radio key={opt.value} value={opt.value} className={styles.option}>
+ <RadioGroupItem
+ key={opt.value}
+ value={opt.value}
+ className={styles.option}
+ >
{opt.label}
- </Radio>
+ </RadioGroupItem>
))}
- </Radio.Group>
+ </RadioGroup>
) : (
<>
<Checkbox.Group
diff --git a/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.styles.scss b/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.styles.scss
index 4e630af4fb..0ee1e788a7 100644
--- a/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.styles.scss
+++ b/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.styles.scss
@@ -161,41 +161,6 @@
justify-content: space-between;
align-items: center;
border-bottom: 1px solid var(--l1-border);
-
- .views-tabs {
- color: var(--l2-foreground);
-
- .view-title {
- display: flex;
- gap: var(--margin-2);
- align-items: center;
- justify-content: center;
- font-size: 14px;
- font-style: normal;
- font-weight: var(--font-weight-normal);
- }
-
- .tab {
- padding: 0 32px;
- background: var(--l3-background);
- border: 1px solid var(--l1-border);
- width: auto;
- }
-
- .tab::before {
- background: var(--l1-border);
- }
-
- .selected_view {
- background: none;
- border: 1px solid var(--l1-border);
- border-bottom: none;
- }
-
- .selected_view::before {
- background: var(--l1-border);
- }
- }
}
}
@@ -699,40 +664,6 @@
left: 50%;
transform: translate(-50%, -50%);
}
-
- .views-tabs {
- color: var(--l2-foreground);
-
- .ant-btn {
- box-shadow: none;
- position: relative;
- }
-
- .tab {
- border: 1px solid var(--l1-border);
- width: 114px;
- z-index: 1;
- }
-
- .tab:hover {
- z-index: 3;
- }
-
- .tab::before {
- background: var(--l2-background);
- }
-
- .selected_view {
- background: var(--l1-border);
- color: var(--l1-foreground);
- border: 1px solid var(--l1-border);
- z-index: 2;
- }
-
- .selected_view::before {
- background: var(--l2-background);
- }
- }
}
.top-services-content {
diff --git a/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.tsx b/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.tsx
index 2e49ddaf9a..5f5fb8b9bc 100644
--- a/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.tsx
+++ b/frontend/src/container/ApiMonitoring/Explorer/Domains/DomainDetails/DomainDetails.tsx
@@ -2,9 +2,9 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
// eslint-disable-next-line no-restricted-imports
import { useSelector } from 'react-redux';
import { Spacing } from '@signozhq/design-tokens';
-import { Button, Divider, Drawer, Radio } from 'antd';
+import { Button, Divider, Drawer } from 'antd';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { Typography } from '@signozhq/ui/typography';
-import type { RadioChangeEvent } from 'antd/lib';
import DateTimeSelectionV2 from 'container/TopNav/DateTimeSelectionV2';
import {
CustomTimeType,
@@ -55,9 +55,9 @@ function DomainDetails({
const [initialFiltersEndPointStats, setInitialFiltersEndPointStats] =
useState<IBuilderQuery['filters']>(domainListFilters);
- const handleTabChange = (e: RadioChangeEvent): void => {
- setSelectedView(e.target.value);
- setParams({ selectedView: e.target.value });
+ const handleTabChange = (value: string): void => {
+ setSelectedView(value as VIEWS);
+ setParams({ selectedView: value });
};
const handleEndPointChange = (name: string): void => {
@@ -224,38 +224,17 @@ function DomainDetails({
timeRange={modalTimeRange}
/>
<div className="views-tabs-container">
- <Radio.Group
- className="views-tabs"
+ <ToggleGroupSimple
+ type="single"
onChange={handleTabChange}
value={selectedView}
- >
- <Radio.Button
- className={
- selectedView === VIEW_TYPES.ALL_ENDPOINTS ? 'selected_view tab' : 'tab'
- }
- value={VIEW_TYPES.ALL_ENDPOINTS}
- >
- <div className="view-title">All Endpoints</div>
- </Radio.Button>
- <Radio.Button
- className={
- selectedView === VIEW_TYPES.ENDPOINT_STATS
- ? 'tab selected_view'
- : 'tab'
- }
- value={VIEW_TYPES.ENDPOINT_STATS}
- >
- <div className="view-title">Endpoint(s) Stats</div>
- </Radio.Button>
- <Radio.Button
- className={
- selectedView === VIEW_TYPES.TOP_ERRORS ? 'tab selected_view' : 'tab'
- }
- value={VIEW_TYPES.TOP_ERRORS}
- >
- <div className="view-title">Top 10 Errors</div>
- </Radio.Button>
- </Radio.Group>
+ size="lg"
+ items={[
+ { value: VIEW_TYPES.ALL_ENDPOINTS, label: 'All Endpoints' },
+ { value: VIEW_TYPES.ENDPOINT_STATS, label: 'Endpoint(s) Stats' },
+ { value: VIEW_TYPES.TOP_ERRORS, label: 'Top 10 Errors' },
+ ]}
+ />
</div>
{selectedView === VIEW_TYPES.ALL_ENDPOINTS && (
<AllEndPoints
diff --git a/frontend/src/container/DashboardContainer/DashboardSettings/General/index.tsx b/frontend/src/container/DashboardContainer/DashboardSettings/General/index.tsx
index 3e0c953753..ee396f84fe 100644
--- a/frontend/src/container/DashboardContainer/DashboardSettings/General/index.tsx
+++ b/frontend/src/container/DashboardContainer/DashboardSettings/General/index.tsx
@@ -1,6 +1,7 @@
import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { Col, Input, Radio, Select, Space, Tooltip } from 'antd';
+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 { useDashboardCursorSyncMode } from 'hooks/dashboard/useDashboardCursorSyncMode';
@@ -213,18 +214,18 @@ function GeneralDashboardSettings(): JSX.Element {
Sync crosshair and tooltip across all the dashboard panels
</Typography.Text>
</div>
- <Radio.Group
+ <ToggleGroupSimple
+ type="single"
value={cursorSyncMode}
- onChange={(e): void => {
- setCursorSyncMode(e.target.value as DashboardCursorSync);
+ onChange={(value: string): void => {
+ setCursorSyncMode(value as DashboardCursorSync);
}}
- >
- <Radio.Button value={DashboardCursorSync.None}>No Sync</Radio.Button>
- <Radio.Button value={DashboardCursorSync.Crosshair}>
- Crosshair
- </Radio.Button>
- <Radio.Button value={DashboardCursorSync.Tooltip}>Tooltip</Radio.Button>
- </Radio.Group>
+ items={[
+ { value: DashboardCursorSync.None, label: 'No Sync' },
+ { value: DashboardCursorSync.Crosshair, label: 'Crosshair' },
+ { value: DashboardCursorSync.Tooltip, label: 'Tooltip' },
+ ]}
+ />
</div>
{cursorSyncMode === DashboardCursorSync.Tooltip && (
<div className={styles.crossPanelSyncRow}>
@@ -237,21 +238,21 @@ function GeneralDashboardSettings(): JSX.Element {
matching ones highlighted
</Typography.Text>
</div>
- <Radio.Group
+ <ToggleGroupSimple
+ type="single"
value={syncTooltipFilterMode}
- onChange={(e): void => {
+ onChange={(value: string): void => {
logEvent(Events.TOOLTIP_SYNC_MODE_CHANGED, {
path: getAbsoluteUrl(window.location.pathname),
- mode: e.target.value,
+ mode: value,
});
- setSyncTooltipFilterMode(e.target.value as SyncTooltipFilterMode);
+ setSyncTooltipFilterMode(value as SyncTooltipFilterMode);
}}
- >
- <Radio.Button value={SyncTooltipFilterMode.All}>All</Radio.Button>
- <Radio.Button value={SyncTooltipFilterMode.Filtered}>
- Filtered
- </Radio.Button>
- </Radio.Group>
+ items={[
+ { value: SyncTooltipFilterMode.All, label: 'All' },
+ { value: SyncTooltipFilterMode.Filtered, label: 'Filtered' },
+ ]}
+ />
</div>
)}
</Col>
diff --git a/frontend/src/container/InfraMonitoringK8s/Base/K8sBaseDetails.tsx b/frontend/src/container/InfraMonitoringK8s/Base/K8sBaseDetails.tsx
index 6db843b50c..5f60aaaa55 100644
--- a/frontend/src/container/InfraMonitoringK8s/Base/K8sBaseDetails.tsx
+++ b/frontend/src/container/InfraMonitoringK8s/Base/K8sBaseDetails.tsx
@@ -8,9 +8,9 @@ import React, {
import { useQuery } from 'react-query';
// eslint-disable-next-line no-restricted-imports
import { Color, Spacing } from '@signozhq/design-tokens';
-import { Button, Divider, Drawer, Radio, Tooltip } from 'antd';
+import { Button, Divider, Drawer, Tooltip } from 'antd';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { Typography } from '@signozhq/ui/typography';
-import type { RadioChangeEvent } from 'antd/lib';
import logEvent from 'api/common/logEvent';
import { combineInitialAndUserExpression } from 'components/QueryBuilderV2/QueryV2/QuerySearch/utils';
import { convertFiltersToExpression } from 'components/QueryBuilderV2/utils';
@@ -330,8 +330,8 @@ export default function K8sBaseDetails<T>({
}
}, [getMinMaxTime, selectedTime]);
- const handleTabChange = (e: RadioChangeEvent): void => {
- setSelectedView(e.target.value);
+ const handleTabChange = (value: string): void => {
+ setSelectedView(value);
setLogFiltersParam(null);
setTracesFiltersParam(null);
setEventsFiltersParam(null);
@@ -339,7 +339,7 @@ export default function K8sBaseDetails<T>({
entity: InfraMonitoringEvents.K8sEntity,
page: InfraMonitoringEvents.DetailedPage,
category: eventCategory,
- view: e.target.value,
+ view: value,
});
};
@@ -520,102 +520,101 @@ export default function K8sBaseDetails<T>({
{!hideDetailViewTabs && (
<div className="views-tabs-container">
- <Radio.Group
+ <ToggleGroupSimple
+ type="single"
className="views-tabs"
onChange={handleTabChange}
value={selectedView}
- >
- {tabVisibility.showMetrics && (
- <Radio.Button
- className={
- selectedView === VIEW_TYPES.METRICS ? 'selected_view tab' : 'tab'
- }
- value={VIEW_TYPES.METRICS}
- >
- <div className="view-title">
- <BarChart size={14} />
- Metrics
- </div>
- </Radio.Button>
- )}
- {tabVisibility.showLogs && (
- <Radio.Button
- className={
- selectedView === VIEW_TYPES.LOGS ? 'selected_view tab' : 'tab'
- }
- value={VIEW_TYPES.LOGS}
- >
- <div className="view-title">
- <ScrollText size={14} />
- Logs
- </div>
- </Radio.Button>
- )}
- {tabVisibility.showTraces && (
- <Radio.Button
- className={
- selectedView === VIEW_TYPES.TRACES ? 'selected_view tab' : 'tab'
- }
- value={VIEW_TYPES.TRACES}
- >
- <div className="view-title">
- <DraftingCompass size={14} />
- Traces
- </div>
- </Radio.Button>
- )}
- {tabVisibility.showEvents && (
- <Radio.Button
- className={
- selectedView === VIEW_TYPES.EVENTS ? 'selected_view tab' : 'tab'
- }
- value={VIEW_TYPES.EVENTS}
- >
- <div className="view-title">
- <ChevronsLeftRight size={14} />
- Events
- </div>
- </Radio.Button>
- )}
- {tabVisibility.showContainers && (
- <Radio.Button
- className={
- selectedView === VIEW_TYPES.CONTAINERS ? 'selected_view tab' : 'tab'
- }
- value={VIEW_TYPES.CONTAINERS}
- >
- <div className="view-title">
- <Package2 size={14} />
- Containers
- </div>
- </Radio.Button>
- )}
- {tabVisibility.showProcesses && (
- <Radio.Button
- className={
- selectedView === VIEW_TYPES.PROCESSES ? 'selected_view tab' : 'tab'
- }
- value={VIEW_TYPES.PROCESSES}
- >
- <div className="view-title">
- <ChevronsLeftRight size={14} />
- Processes
- </div>
- </Radio.Button>
- )}
- {customTabs?.map((tab) => (
- <Radio.Button
- key={tab.key}
- className={selectedView === tab.key ? 'selected_view tab' : 'tab'}
- value={tab.key}
- >
- <div className="view-title">
- {tab.icon}
- {tab.label}
- </div>
- </Radio.Button>
- ))}
- </Radio.Group>
+ items={[
+ ...(tabVisibility.showMetrics
+ ? [
+ {
+ value: VIEW_TYPES.METRICS,
+ label: (
+ <div className="view-title">
+ <BarChart size={14} />
+ Metrics
+ </div>
+ ),
+ },
+ ]
+ : []),
+ ...(tabVisibility.showLogs
+ ? [
+ {
+ value: VIEW_TYPES.LOGS,
+ label: (
+ <div className="view-title">
+ <ScrollText size={14} />
+ Logs
+ </div>
+ ),
+ },
+ ]
+ : []),
+ ...(tabVisibility.showTraces
+ ? [
+ {
+ value: VIEW_TYPES.TRACES,
+ label: (
+ <div className="view-title">
+ <DraftingCompass size={14} />
+ Traces
+ </div>
+ ),
+ },
+ ]
+ : []),
+ ...(tabVisibility.showEvents
+ ? [
+ {
+ value: VIEW_TYPES.EVENTS,
+ label: (
+ <div className="view-title">
+ <ChevronsLeftRight size={14} />
+ Events
+ </div>
+ ),
+ },
+ ]
+ : []),
+ ...(tabVisibility.showContainers
+ ? [
+ {
+ value: VIEW_TYPES.CONTAINERS,
+ label: (
+ <div className="view-title">
+ <Package2 size={14} />
+ Containers
+ </div>
+ ),
+ },
+ ]
+ : []),
+ ...(tabVisibility.showProcesses
+ ? [
+ {
+ value: VIEW_TYPES.PROCESSES,
+ label: (
+ <div className="view-title">
+ <ChevronsLeftRight size={14} />
+ Processes
+ </div>
+ ),
+ },
+ ]
+ : []),
+ ...(customTabs?.map((tab) => ({
+ value: tab.key,
+ label: (
+ <div className="view-title">
+ {tab.icon}
+ {tab.label}
+ </div>
+ ),
+ })) ?? []),
+ ]}
+ />
{selectedView === VIEW_TYPES.LOGS && (
<Tooltip title="Go to Logs Explorer" placement="left">
diff --git a/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/entityDetails.styles.scss b/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/entityDetails.styles.scss
index 3ba6a6909a..75892a27db 100644
--- a/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/entityDetails.styles.scss
+++ b/frontend/src/container/InfraMonitoringK8s/EntityDetailsUtils/entityDetails.styles.scss
@@ -152,23 +152,23 @@
font-weight: var(--font-weight-normal);
}
- .tab {
+ > button {
border: 1px solid var(--l1-border);
width: 114px;
- }
- .tab::before {
- background: var(--l1-border);
- }
+ &::before {
+ background: var(--l1-border);
+ }
- .selected_view {
- background: var(--l1-border);
- color: var(--l1-foreground);
- border: 1px solid var(--l1-border);
- }
+ &[data-state='on'] {
+ background: var(--l1-border);
+ color: var(--l1-foreground);
+ border: 1px solid var(--l1-border);
- .selected_view::before {
- background: var(--l1-border);
+ &::before {
+ background: var(--l1-border);
+ }
+ }
}
}
diff --git a/frontend/src/container/LogDetailedView/InfraMetrics/InfraMetrics.tsx b/frontend/src/container/LogDetailedView/InfraMetrics/InfraMetrics.tsx
index 51e975fbf9..99139fc247 100644
--- a/frontend/src/container/LogDetailedView/InfraMetrics/InfraMetrics.tsx
+++ b/frontend/src/container/LogDetailedView/InfraMetrics/InfraMetrics.tsx
@@ -1,6 +1,5 @@
import { useMemo, useState } from 'react';
import { Empty } from 'antd';
-import type { RadioChangeEvent } from 'antd/lib';
import SignozRadioGroup from 'components/SignozRadioGroup/SignozRadioGroup';
import { History, Table } from '@signozhq/icons';
import { DataSource } from 'types/common/queryBuilder';
@@ -60,8 +59,8 @@ function InfraMetrics({
return options;
}, [podName]);
- const handleModeChange = (e: RadioChangeEvent): void => {
- setSelectedView(e.target.value);
+ const handleModeChange = (value: string): void => {
+ setSelectedView(value);
};
if (!podName && !nodeName && !hostName) {
diff --git a/frontend/src/container/MySettings/__tests__/MySettings.test.tsx b/frontend/src/container/MySettings/__tests__/MySettings.test.tsx
index 4e2cfdaf0f..bedf6dbcc2 100644
--- a/frontend/src/container/MySettings/__tests__/MySettings.test.tsx
+++ b/frontend/src/container/MySettings/__tests__/MySettings.test.tsx
@@ -119,17 +119,17 @@ describe('MySettings Flows', () => {
it('Should have Dark theme selected by default', async () => {
const themeSelector = screen.getByTestId(THEME_SELECTOR_TEST_ID);
- const darkOption = themeSelector.querySelector(
- 'input[value="dark"]',
- ) as HTMLInputElement;
+ const darkOption = within(themeSelector).getByRole('radio', {
+ name: /Dark/,
+ });
expect(darkOption).toBeChecked();
});
it('Should switch theme and log event when Light theme is selected', async () => {
const themeSelector = screen.getByTestId(THEME_SELECTOR_TEST_ID);
- const lightOption = themeSelector.querySelector(
- 'input[value="light"]',
- ) as HTMLInputElement;
+ const lightOption = within(themeSelector).getByRole('radio', {
+ name: /Light/,
+ });
fireEvent.click(lightOption);
diff --git a/frontend/src/container/MySettings/index.tsx b/frontend/src/container/MySettings/index.tsx
index 224fd02996..178ddaa07b 100644
--- a/frontend/src/container/MySettings/index.tsx
+++ b/frontend/src/container/MySettings/index.tsx
@@ -1,7 +1,8 @@
import { useEffect, useState } from 'react';
import { useMutation } from 'react-query';
-import { Radio, RadioChangeEvent, Tag } from 'antd';
+import { Tag } from 'antd';
import { Switch } from '@signozhq/ui/switch';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import setLocalStorageApi from 'api/browser/localstorage/set';
import logEvent from 'api/common/logEvent';
import updateUserPreference from 'api/v1/user/preferences/name/update';
@@ -88,7 +89,7 @@ function MySettings(): JSX.Element {
return isDarkMode ? 'dark' : 'light';
});
- const handleThemeChange = ({ target: { value } }: RadioChangeEvent): void => {
+ const handleThemeChange = (value: string): void => {
logEvent('Account Settings: Theme Changed', {
theme: value,
});
@@ -187,14 +188,12 @@ function MySettings(): JSX.Element {
<div className="user-preference-section-content-item theme-selector">
<div className="user-preference-section-content-item-title-action">
Select your theme
- <Radio.Group
- options={themeOptions}
+ <ToggleGroupSimple
+ type="single"
onChange={handleThemeChange}
value={theme}
- optionType="button"
- buttonStyle="solid"
data-testid="theme-selector"
- size="middle"
+ items={themeOptions}
/>
</div>
diff --git a/frontend/src/container/NewWidget/RightContainer/components/DisconnectValuesSelector/DisconnectValuesModeToggle.tsx b/frontend/src/container/NewWidget/RightContainer/components/DisconnectValuesSelector/DisconnectValuesModeToggle.tsx
index 267988811c..9a9f8f10c5 100644
--- a/frontend/src/container/NewWidget/RightContainer/components/DisconnectValuesSelector/DisconnectValuesModeToggle.tsx
+++ b/frontend/src/container/NewWidget/RightContainer/components/DisconnectValuesSelector/DisconnectValuesModeToggle.tsx
@@ -1,4 +1,4 @@
-import { ToggleGroup, ToggleGroupItem } from '@signozhq/ui/toggle-group';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { Typography } from '@signozhq/ui/typography';
import { DisconnectedValuesMode } from 'lib/uPlotV2/config/types';
@@ -12,27 +12,33 @@ export default function DisconnectValuesModeToggle({
onChange,
}: DisconnectValuesModeToggleProps): JSX.Element {
return (
- <ToggleGroup
+ <ToggleGroupSimple
type="single"
value={value}
size="lg"
- onChange={(newValue): void => {
+ onChange={(newValue: string): void => {
if (newValue) {
onChange(newValue as DisconnectedValuesMode);
}
}}
- >
- <ToggleGroupItem value={DisconnectedValuesMode.Never} aria-label="Never">
- <Typography.Text className="section-heading-small">Never</Typography.Text>
- </ToggleGroupItem>
- <ToggleGroupItem
- value={DisconnectedValuesMode.Threshold}
- aria-label="Threshold"
- >
- <Typography.Text className="section-heading-small">
- Threshold
- </Typography.Text>
- </ToggleGroupItem>
- </ToggleGroup>
+ items={[
+ {
+ value: DisconnectedValuesMode.Never,
+ 'aria-label': 'Never',
+ label: (
+ <Typography.Text className="section-heading-small">Never</Typography.Text>
+ ),
+ },
+ {
+ value: DisconnectedValuesMode.Threshold,
+ 'aria-label': 'Threshold',
+ label: (
+ <Typography.Text className="section-heading-small">
+ Threshold
+ </Typography.Text>
+ ),
+ },
+ ]}
+ />
);
}
diff --git a/frontend/src/container/NewWidget/RightContainer/components/FillModeSelector/FillModeSelector.tsx b/frontend/src/container/NewWidget/RightContainer/components/FillModeSelector/FillModeSelector.tsx
index 64237a914d..32373f56ec 100644
--- a/frontend/src/container/NewWidget/RightContainer/components/FillModeSelector/FillModeSelector.tsx
+++ b/frontend/src/container/NewWidget/RightContainer/components/FillModeSelector/FillModeSelector.tsx
@@ -1,4 +1,4 @@
-import { ToggleGroup, ToggleGroupItem } from '@signozhq/ui/toggle-group';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { Typography } from '@signozhq/ui/typography';
import { FillMode } from 'lib/uPlotV2/config/types';
@@ -16,74 +16,97 @@ export default function FillModeSelector({
return (
<section className="fill-mode-selector control-container">
<Typography.Text className="section-heading">Fill mode</Typography.Text>
- <ToggleGroup
+ <ToggleGroupSimple
type="single"
value={value}
size="lg"
- onChange={(newValue): void => {
+ onChange={(newValue: string): void => {
if (newValue) {
onChange(newValue as FillMode);
}
}}
- >
- <ToggleGroupItem value={FillMode.None} aria-label="None">
- <svg
- className="fill-mode-icon"
- viewBox="0 0 48 48"
- fill="none"
- stroke="#888"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <rect x="8" y="16" width="32" height="16" stroke="#888" fill="none" />
- </svg>
- <Typography.Text className="section-heading-small">None</Typography.Text>
- </ToggleGroupItem>
- <ToggleGroupItem value={FillMode.Solid} aria-label="Solid">
- <svg
- className="fill-mode-icon"
- viewBox="0 0 48 48"
- fill="none"
- stroke="#888"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <rect x="8" y="16" width="32" height="16" fill="#888" />
- </svg>
- <Typography.Text className="section-heading-small">Solid</Typography.Text>
- </ToggleGroupItem>
- <ToggleGroupItem value={FillMode.Gradient} aria-label="Gradient">
- <svg
- className="fill-mode-icon"
- viewBox="0 0 48 48"
- fill="none"
- stroke="#888"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <defs>
- <linearGradient id="fill-gradient" x1="0" y1="0" x2="1" y2="0">
- <stop offset="0%" stopColor="#888" stopOpacity="0.2" />
- <stop offset="100%" stopColor="#888" stopOpacity="0.8" />
- </linearGradient>
- </defs>
- <rect
- x="8"
- y="16"
- width="32"
- height="16"
- fill="url(#fill-gradient)"
- stroke="#888"
- />
- </svg>
- <Typography.Text className="section-heading-small">
- Gradient
- </Typography.Text>
- </ToggleGroupItem>
- </ToggleGroup>
+ items={[
+ {
+ value: FillMode.None,
+ 'aria-label': 'None',
+ label: (
+ <>
+ <svg
+ className="fill-mode-icon"
+ viewBox="0 0 48 48"
+ fill="none"
+ stroke="#888"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ >
+ <rect x="8" y="16" width="32" height="16" stroke="#888" fill="none" />
+ </svg>
+ <Typography.Text className="section-heading-small">
+ None
+ </Typography.Text>
+ </>
+ ),
+ },
+ {
+ value: FillMode.Solid,
+ 'aria-label': 'Solid',
+ label: (
+ <>
+ <svg
+ className="fill-mode-icon"
+ viewBox="0 0 48 48"
+ fill="none"
+ stroke="#888"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ >
+ <rect x="8" y="16" width="32" height="16" fill="#888" />
+ </svg>
+ <Typography.Text className="section-heading-small">
+ Solid
+ </Typography.Text>
+ </>
+ ),
+ },
+ {
+ value: FillMode.Gradient,
+ 'aria-label': 'Gradient',
+ label: (
+ <>
+ <svg
+ className="fill-mode-icon"
+ viewBox="0 0 48 48"
+ fill="none"
+ stroke="#888"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ >
+ <defs>
+ <linearGradient id="fill-gradient" x1="0" y1="0" x2="1" y2="0">
+ <stop offset="0%" stopColor="#888" stopOpacity="0.2" />
+ <stop offset="100%" stopColor="#888" stopOpacity="0.8" />
+ </linearGradient>
+ </defs>
+ <rect
+ x="8"
+ y="16"
+ width="32"
+ height="16"
+ fill="url(#fill-gradient)"
+ stroke="#888"
+ />
+ </svg>
+ <Typography.Text className="section-heading-small">
+ Gradient
+ </Typography.Text>
+ </>
+ ),
+ },
+ ]}
+ />
</section>
);
}
diff --git a/frontend/src/container/NewWidget/RightContainer/components/LineInterpolationSelector/LineInterpolationSelector.tsx b/frontend/src/container/NewWidget/RightContainer/components/LineInterpolationSelector/LineInterpolationSelector.tsx
index 0d738c18ce..49b8596464 100644
--- a/frontend/src/container/NewWidget/RightContainer/components/LineInterpolationSelector/LineInterpolationSelector.tsx
+++ b/frontend/src/container/NewWidget/RightContainer/components/LineInterpolationSelector/LineInterpolationSelector.tsx
@@ -1,4 +1,4 @@
-import { ToggleGroup, ToggleGroupItem } from '@signozhq/ui/toggle-group';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { Typography } from '@signozhq/ui/typography';
import { LineInterpolation } from 'lib/uPlotV2/config/types';
@@ -18,88 +18,98 @@ export default function LineInterpolationSelector({
<Typography.Text className="section-heading">
Line interpolation
</Typography.Text>
- <ToggleGroup
+ <ToggleGroupSimple
type="single"
value={value}
size="lg"
- onChange={(newValue): void => {
+ onChange={(newValue: string): void => {
if (newValue) {
onChange(newValue as LineInterpolation);
}
}}
- >
- <ToggleGroupItem value={LineInterpolation.Linear} aria-label="Linear">
- <svg
- className="line-interpolation-icon"
- viewBox="0 0 48 48"
- fill="none"
- stroke="#888"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <circle cx="8" cy="32" r="3" fill="#888" />
- <circle cx="24" cy="16" r="3" fill="#888" />
- <circle cx="40" cy="32" r="3" fill="#888" />
- <path d="M8 32 L24 16 L40 32" stroke="#888" />
- </svg>
- </ToggleGroupItem>
- <ToggleGroupItem value={LineInterpolation.Spline} aria-label="Spline">
- <svg
- className="line-interpolation-icon"
- viewBox="0 0 48 48"
- fill="none"
- stroke="#888"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <circle cx="8" cy="32" r="3" fill="#888" />
- <circle cx="24" cy="16" r="3" fill="#888" />
- <circle cx="40" cy="32" r="3" fill="#888" />
- <path d="M8 32 C16 8, 32 8, 40 32" />
- </svg>
- </ToggleGroupItem>
- <ToggleGroupItem
- value={LineInterpolation.StepAfter}
- aria-label="Step After"
- >
- <svg
- className="line-interpolation-icon"
- viewBox="0 0 48 48"
- fill="none"
- stroke="#888"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <circle cx="8" cy="32" r="3" fill="#888" />
- <circle cx="24" cy="16" r="3" fill="#888" />
- <circle cx="40" cy="32" r="3" fill="#888" />
- <path d="M8 32 V16 H24 V32 H40" />
- </svg>
- </ToggleGroupItem>
-
- <ToggleGroupItem
- value={LineInterpolation.StepBefore}
- aria-label="Step Before"
- >
- <svg
- className="line-interpolation-icon"
- viewBox="0 0 48 48"
- fill="none"
- stroke="#888"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <circle cx="8" cy="32" r="3" fill="#888" />
- <circle cx="24" cy="16" r="3" fill="#888" />
- <circle cx="40" cy="32" r="3" fill="#888" />
- <path d="M8 32 H24 V16 H40 V32" />
- </svg>
- </ToggleGroupItem>
- </ToggleGroup>
+ items={[
+ {
+ value: LineInterpolation.Linear,
+ 'aria-label': 'Linear',
+ label: (
+ <svg
+ className="line-interpolation-icon"
+ viewBox="0 0 48 48"
+ fill="none"
+ stroke="#888"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ >
+ <circle cx="8" cy="32" r="3" fill="#888" />
+ <circle cx="24" cy="16" r="3" fill="#888" />
+ <circle cx="40" cy="32" r="3" fill="#888" />
+ <path d="M8 32 L24 16 L40 32" stroke="#888" />
+ </svg>
+ ),
+ },
+ {
+ value: LineInterpolation.Spline,
+ 'aria-label': 'Spline',
+ label: (
+ <svg
+ className="line-interpolation-icon"
+ viewBox="0 0 48 48"
+ fill="none"
+ stroke="#888"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ >
+ <circle cx="8" cy="32" r="3" fill="#888" />
+ <circle cx="24" cy="16" r="3" fill="#888" />
+ <circle cx="40" cy="32" r="3" fill="#888" />
+ <path d="M8 32 C16 8, 32 8, 40 32" />
+ </svg>
+ ),
+ },
+ {
+ value: LineInterpolation.StepAfter,
+ 'aria-label': 'Step After',
+ label: (
+ <svg
+ className="line-interpolation-icon"
+ viewBox="0 0 48 48"
+ fill="none"
+ stroke="#888"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ >
+ <circle cx="8" cy="32" r="3" fill="#888" />
+ <circle cx="24" cy="16" r="3" fill="#888" />
+ <circle cx="40" cy="32" r="3" fill="#888" />
+ <path d="M8 32 V16 H24 V32 H40" />
+ </svg>
+ ),
+ },
+ {
+ value: LineInterpolation.StepBefore,
+ 'aria-label': 'Step Before',
+ label: (
+ <svg
+ className="line-interpolation-icon"
+ viewBox="0 0 48 48"
+ fill="none"
+ stroke="#888"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ >
+ <circle cx="8" cy="32" r="3" fill="#888" />
+ <circle cx="24" cy="16" r="3" fill="#888" />
+ <circle cx="40" cy="32" r="3" fill="#888" />
+ <path d="M8 32 H24 V16 H40 V32" />
+ </svg>
+ ),
+ },
+ ]}
+ />
</section>
);
}
diff --git a/frontend/src/container/NewWidget/RightContainer/components/LineStyleSelector/LineStyleSelector.tsx b/frontend/src/container/NewWidget/RightContainer/components/LineStyleSelector/LineStyleSelector.tsx
index 21a7e96ddc..adf5a80c38 100644
--- a/frontend/src/container/NewWidget/RightContainer/components/LineStyleSelector/LineStyleSelector.tsx
+++ b/frontend/src/container/NewWidget/RightContainer/components/LineStyleSelector/LineStyleSelector.tsx
@@ -1,4 +1,4 @@
-import { ToggleGroup, ToggleGroupItem } from '@signozhq/ui/toggle-group';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { Typography } from '@signozhq/ui/typography';
import { LineStyle } from 'lib/uPlotV2/config/types';
@@ -16,46 +16,63 @@ export default function LineStyleSelector({
return (
<section className="line-style-selector control-container">
<Typography.Text className="section-heading">Line style</Typography.Text>
- <ToggleGroup
+ <ToggleGroupSimple
type="single"
value={value}
size="lg"
- onChange={(newValue): void => {
+ onChange={(newValue: string): void => {
if (newValue) {
onChange(newValue as LineStyle);
}
}}
- >
- <ToggleGroupItem value={LineStyle.Solid} aria-label="Solid">
- <svg
- className="line-style-icon"
- viewBox="0 0 48 48"
- fill="none"
- stroke="#888"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <path d="M8 24 L40 24" />
- </svg>
- <Typography.Text className="section-heading-small">Solid</Typography.Text>
- </ToggleGroupItem>
- <ToggleGroupItem value={LineStyle.Dashed} aria-label="Dashed">
- <svg
- className="line-style-icon"
- viewBox="0 0 48 48"
- fill="none"
- stroke="#888"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeDasharray="6 4"
- >
- <path d="M8 24 L40 24" />
- </svg>
- <Typography.Text className="section-heading-small">Dashed</Typography.Text>
- </ToggleGroupItem>
- </ToggleGroup>
+ items={[
+ {
+ value: LineStyle.Solid,
+ 'aria-label': 'Solid',
+ label: (
+ <>
+ <svg
+ className="line-style-icon"
+ viewBox="0 0 48 48"
+ fill="none"
+ stroke="#888"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ >
+ <path d="M8 24 L40 24" />
+ </svg>
+ <Typography.Text className="section-heading-small">
+ Solid
+ </Typography.Text>
+ </>
+ ),
+ },
+ {
+ value: LineStyle.Dashed,
+ 'aria-label': 'Dashed',
+ label: (
+ <>
+ <svg
+ className="line-style-icon"
+ viewBox="0 0 48 48"
+ fill="none"
+ stroke="#888"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeDasharray="6 4"
+ >
+ <path d="M8 24 L40 24" />
+ </svg>
+ <Typography.Text className="section-heading-small">
+ Dashed
+ </Typography.Text>
+ </>
+ ),
+ },
+ ]}
+ />
</section>
);
}
diff --git a/frontend/src/container/OnboardingContainer/Steps/SelectMethod/SelectMethod.tsx b/frontend/src/container/OnboardingContainer/Steps/SelectMethod/SelectMethod.tsx
index f407b9052b..f00cbed78d 100644
--- a/frontend/src/container/OnboardingContainer/Steps/SelectMethod/SelectMethod.tsx
+++ b/frontend/src/container/OnboardingContainer/Steps/SelectMethod/SelectMethod.tsx
@@ -1,5 +1,6 @@
import { useState } from 'react';
-import { Radio, RadioChangeEvent, Space } from 'antd';
+import { Space } from 'antd';
+import { RadioGroup, RadioGroupItem } from '@signozhq/ui/radio-group';
import { Typography } from '@signozhq/ui/typography';
import {
OnboardingMethods,
@@ -10,29 +11,29 @@ export default function SelectMethod(): JSX.Element {
const { selectedMethod, updateSelectedMethod } = useOnboardingContext();
const [value, setValue] = useState(selectedMethod);
- const onChange = (e: RadioChangeEvent): void => {
- setValue(e.target.value);
- updateSelectedMethod(e.target.value);
+ const onChange = (next: string): void => {
+ setValue(next);
+ updateSelectedMethod(next);
};
return (
<div>
- <Radio.Group onChange={onChange} value={value}>
+ <RadioGroup onChange={onChange} value={value}>
<Space direction="vertical">
- <Radio value={OnboardingMethods.QUICK_START}>
+ <RadioGroupItem value={OnboardingMethods.QUICK_START}>
<Typography.Text> Quick Start </Typography.Text> <br />
<small>Send data to SigNoz directly from OpenTelemetry SDK.</small>
- </Radio>
+ </RadioGroupItem>
- <Radio value={OnboardingMethods.RECOMMENDED_STEPS}>
+ <RadioGroupItem value={OnboardingMethods.RECOMMENDED_STEPS}>
<Typography.Text> Use Recommended Steps </Typography.Text> <br />
<small>
Send data to SigNoz via OpenTelemetry Collector (better control on data
you send to SigNoz, collect host metrics & logs).
</small>
- </Radio>
+ </RadioGroupItem>
</Space>
- </Radio.Group>
+ </RadioGroup>
</div>
);
}
diff --git a/frontend/src/container/OptionsMenu/FormatField/FormatField.styles.scss b/frontend/src/container/OptionsMenu/FormatField/FormatField.styles.scss
new file mode 100644
index 0000000000..ef0fd3a1b5
--- /dev/null
+++ b/frontend/src/container/OptionsMenu/FormatField/FormatField.styles.scss
@@ -0,0 +1,9 @@
+.format-field-toggle-group {
+ display: flex;
+ text-align: center;
+
+ > button {
+ font-size: 0.75rem;
+ flex: 1;
+ }
+}
diff --git a/frontend/src/container/OptionsMenu/FormatField/index.tsx b/frontend/src/container/OptionsMenu/FormatField/index.tsx
index f8d1b8b420..0a2ae429ec 100644
--- a/frontend/src/container/OptionsMenu/FormatField/index.tsx
+++ b/frontend/src/container/OptionsMenu/FormatField/index.tsx
@@ -1,21 +1,24 @@
+import './FormatField.styles.scss';
+
import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
-import { RadioChangeEvent } from 'antd';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
+import { LogViewMode } from 'container/LogsTable';
import { FieldTitle } from '../styles';
import { OptionsMenuConfig } from '../types';
-import { FormatFieldWrapper, RadioButton, RadioGroup } from './styles';
+import { FormatFieldWrapper } from './styles';
function FormatField({ config }: FormatFieldProps): JSX.Element | null {
const { t } = useTranslation(['trace']);
const onChange = useCallback(
- (event: RadioChangeEvent) => {
+ (value: string) => {
if (!config) {
return;
}
- config.onChange(event.target.value);
+ config.onChange(value as LogViewMode);
},
[config],
);
@@ -27,16 +30,18 @@ function FormatField({ config }: FormatFieldProps): JSX.Element | null {
return (
<FormatFieldWrapper direction="vertical">
<FieldTitle>{t('options_menu.format')}</FieldTitle>
- <RadioGroup
- size="small"
- buttonStyle="solid"
+ <ToggleGroupSimple
+ type="single"
+ size="sm"
value={config.value}
onChange={onChange}
- >
- <RadioButton value="raw">{t('options_menu.raw')}</RadioButton>
- <RadioButton value="list">{t('options_menu.default')}</RadioButton>
- <RadioButton value="table">{t('options_menu.column')}</RadioButton>
- </RadioGroup>
+ className="format-field-toggle-group"
+ items={[
+ { value: 'raw', label: t('options_menu.raw') },
+ { value: 'list', label: t('options_menu.default') },
+ { value: 'table', label: t('options_menu.column') },
+ ]}
+ />
</FormatFieldWrapper>
);
}
diff --git a/frontend/src/container/OptionsMenu/FormatField/styles.ts b/frontend/src/container/OptionsMenu/FormatField/styles.ts
index d98270a80f..633628ff3f 100644
--- a/frontend/src/container/OptionsMenu/FormatField/styles.ts
+++ b/frontend/src/container/OptionsMenu/FormatField/styles.ts
@@ -1,17 +1,7 @@
-import { Radio, Space } from 'antd';
+import { Space } from 'antd';
import styled from 'styled-components';
export const FormatFieldWrapper = styled(Space)`
width: 100%;
margin-bottom: 1.125rem;
`;
-
-export const RadioGroup = styled(Radio.Group)`
- display: flex;
- text-align: center;
-`;
-
-export const RadioButton = styled(Radio.Button)`
- font-size: 0.75rem;
- flex: 1;
-`;
diff --git a/frontend/src/container/PlannedDowntime/PlannedDowntimeForm.tsx b/frontend/src/container/PlannedDowntime/PlannedDowntimeForm.tsx
index 2039f56099..a4ecfcf828 100644
--- a/frontend/src/container/PlannedDowntime/PlannedDowntimeForm.tsx
+++ b/frontend/src/container/PlannedDowntime/PlannedDowntimeForm.tsx
@@ -8,7 +8,6 @@ import {
FormInstance,
Input,
Modal,
- Radio,
Select,
SelectProps,
Spin,
@@ -55,6 +54,8 @@ import {
} from './PlannedDowntimeutils';
import './PlannedDowntime.styles.scss';
+import { RadioGroupItem } from '@signozhq/ui/radio-group';
+import { RadioGroup } from '@signozhq/ui/radio-group';
dayjs.locale('en');
dayjs.extend(utc);
@@ -470,10 +471,10 @@ export function PlannedDowntimeForm(
initialValue="specific"
className="alert-rule-scope"
>
- <Radio.Group>
- <Radio value="all">All alert rules</Radio>
- <Radio value="specific">Specific alert rules</Radio>
- </Radio.Group>
+ <RadioGroup>
+ <RadioGroupItem value="all">All alert rules</RadioGroupItem>
+ <RadioGroupItem value="specific">Specific alert rules</RadioGroupItem>
+ </RadioGroup>
</Form.Item>
{alertRuleScope === 'specific' && (
<>
diff --git a/frontend/src/container/SpanDetailsDrawer/SpanRelatedSignals/SpanRelatedSignals.tsx b/frontend/src/container/SpanDetailsDrawer/SpanRelatedSignals/SpanRelatedSignals.tsx
index d773477d1c..4817a7c3b1 100644
--- a/frontend/src/container/SpanDetailsDrawer/SpanRelatedSignals/SpanRelatedSignals.tsx
+++ b/frontend/src/container/SpanDetailsDrawer/SpanRelatedSignals/SpanRelatedSignals.tsx
@@ -1,6 +1,6 @@
import { useCallback, useMemo, useState } from 'react';
import { Color, Spacing } from '@signozhq/design-tokens';
-import { Button, Divider, Drawer, RadioChangeEvent } from 'antd';
+import { Button, Divider, Drawer } from 'antd';
import { Typography } from '@signozhq/ui/typography';
import LogsIcon from 'assets/AlertHistory/LogsIcon';
import SignozRadioGroup from 'components/SignozRadioGroup/SignozRadioGroup';
@@ -82,8 +82,8 @@ function SpanRelatedSignals({
isDrawerOpen: isOpen,
});
- const handleTabChange = useCallback((e: RadioChangeEvent): void => {
- setSelectedView(e.target.value);
+ const handleTabChange = useCallback((value: string): void => {
+ setSelectedView(value as RelatedSignalsViews);
}, []);
const tabOptions = useMemo(() => {
diff --git a/frontend/src/pages/MessagingQueues/MQDetails/MQDetails.tsx b/frontend/src/pages/MessagingQueues/MQDetails/MQDetails.tsx
index c5ef3efb5f..b007631ba1 100644
--- a/frontend/src/pages/MessagingQueues/MQDetails/MQDetails.tsx
+++ b/frontend/src/pages/MessagingQueues/MQDetails/MQDetails.tsx
@@ -1,7 +1,7 @@
import { Dispatch, SetStateAction, useEffect, useMemo, useState } from 'react';
// eslint-disable-next-line no-restricted-imports
import { useSelector } from 'react-redux';
-import { Radio } from 'antd';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { QueryParams } from 'constants/query';
import useUrlQuery from 'hooks/useUrlQuery';
import { isEmpty } from 'lodash-es';
@@ -57,24 +57,22 @@ function MessagingQueuesOptions({
setCurrentTab(value);
};
- const renderRadioButtons = (): JSX.Element[] => {
- const detailTypes =
- MQServiceDetailTypePerView(producerLatencyOption)[selectedView] || [];
- return detailTypes.map((detailType) => (
- <Radio.Button key={detailType} value={detailType}>
- {ConsumerLagDetailTitle[detailType]}
- </Radio.Button>
- ));
- };
+ const detailTypes =
+ MQServiceDetailTypePerView(producerLatencyOption)[selectedView] || [];
return (
- <Radio.Group
- onChange={(e): void => handleChange(e.target.value)}
+ <ToggleGroupSimple
+ type="single"
+ onChange={(value: string): void =>
+ handleChange(value as MessagingQueueServiceDetailType)
+ }
value={currentTab}
className="mq-details-options"
- >
- {renderRadioButtons()}
- </Radio.Group>
+ items={detailTypes.map((detailType) => ({
+ value: detailType,
+ label: ConsumerLagDetailTitle[detailType],
+ }))}
+ />
);
}
diff --git a/frontend/src/pages/MessagingQueues/MQDetails/MessagingQueueOverview.tsx b/frontend/src/pages/MessagingQueues/MQDetails/MessagingQueueOverview.tsx
index fa0489cf30..21ecea1fe8 100644
--- a/frontend/src/pages/MessagingQueues/MQDetails/MessagingQueueOverview.tsx
+++ b/frontend/src/pages/MessagingQueues/MQDetails/MessagingQueueOverview.tsx
@@ -2,7 +2,7 @@ import { Dispatch, SetStateAction, useMemo } from 'react';
// eslint-disable-next-line no-restricted-imports
import { useSelector } from 'react-redux';
import { useHistory, useLocation } from 'react-router-dom';
-import { Radio } from 'antd';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { MessagingQueueServicePayload } from 'api/messagingQueues/getConsumerLagDetails';
import { getKafkaSpanEval } from 'api/messagingQueues/getKafkaSpanEval';
import { getPartitionLatencyOverview } from 'api/messagingQueues/getPartitionLatencyOverview';
@@ -35,27 +35,25 @@ function ProducerLatencyTabs({
const history = useHistory();
return (
- <Radio.Group
- onChange={(e): void => {
+ <ToggleGroupSimple
+ type="single"
+ onChange={(value: string): void => {
setConfigDetail(urlQuery, location, history, {});
- setOption(e.target.value);
+ setOption(value as ProducerLatencyOptions);
}}
value={option}
className="mq-details-options"
- >
- <Radio.Button
- value={ProducerLatencyOptions.Producers}
- key={ProducerLatencyOptions.Producers}
- >
- {ProducerLatencyOptions.Producers}
- </Radio.Button>
- <Radio.Button
- value={ProducerLatencyOptions.Consumers}
- key={ProducerLatencyOptions.Consumers}
- >
- {ProducerLatencyOptions.Consumers}
- </Radio.Button>
- </Radio.Group>
+ items={[
+ {
+ value: ProducerLatencyOptions.Producers,
+ label: ProducerLatencyOptions.Producers,
+ },
+ {
+ value: ProducerLatencyOptions.Consumers,
+ label: ProducerLatencyOptions.Consumers,
+ },
+ ]}
+ />
);
}
diff --git a/frontend/src/pages/TraceDetailsV3/TraceWaterfall/TraceWaterfallStates/Success/Filters/Filters.tsx b/frontend/src/pages/TraceDetailsV3/TraceWaterfall/TraceWaterfallStates/Success/Filters/Filters.tsx
index 402ebbad43..1d0c771e7e 100644
--- a/frontend/src/pages/TraceDetailsV3/TraceWaterfall/TraceWaterfallStates/Success/Filters/Filters.tsx
+++ b/frontend/src/pages/TraceDetailsV3/TraceWaterfall/TraceWaterfallStates/Success/Filters/Filters.tsx
@@ -3,7 +3,7 @@ import { useHistory, useLocation } from 'react-router-dom';
import { useCopyToClipboard } from 'react-use';
import { ChevronsRight, Copy, Search, X } from '@signozhq/icons';
import { Switch } from '@signozhq/ui/switch';
-import { ToggleGroup, ToggleGroupItem } from '@signozhq/ui/toggle-group';
+import { ToggleGroupSimple } from '@signozhq/ui/toggle-group';
import { toast } from '@signozhq/ui/sonner';
import { Button } from '@signozhq/ui/button';
import {
@@ -340,22 +340,20 @@ function Filters({
>
{isExpanded && (
<div className={styles.categoryControls}>
- <ToggleGroup
+ <ToggleGroupSimple
type="single"
value={selectedCategory}
- onChange={(value): void => {
+ onChange={(value: SpanCategory): void => {
if (value) {
handleCategoryChange(value as SpanCategory);
}
}}
size="sm"
- >
- {categories.map((category) => (
- <ToggleGroupItem key={category} value={category}>
- {category}
- </ToggleGroupItem>
- ))}
- </ToggleGroup>
+ items={categories.map((category) => ({
+ value: category,
+ label: category,
+ }))}
+ />
</div>
)}
diff --git a/frontend/src/pages/TracesFunnelDetails/components/FunnelConfiguration/InterStepConfig.tsx b/frontend/src/pages/TracesFunnelDetails/components/FunnelConfiguration/InterStepConfig.tsx
index f59a31bb87..997f58f7a4 100644
--- a/frontend/src/pages/TracesFunnelDetails/components/FunnelConfiguration/InterStepConfig.tsx
+++ b/frontend/src/pages/TracesFunnelDetails/components/FunnelConfiguration/InterStepConfig.tsx
@@ -33,10 +33,10 @@ function InterStepConfig({
disabled={!hasEditPermission}
onChange={
hasEditPermission
- ? (e): void =>
+ ? (value): void =>
onStepChange(index, {
...step,
- latency_type: e.target.value,
+ latency_type: value as LatencyOptions,
})
: (): void => {}
}
diff --git a/frontend/src/pages/TracesFunnelDetails/components/FunnelResults/StepsTransitionResults.tsx b/frontend/src/pages/TracesFunnelDetails/components/FunnelResults/StepsTransitionResults.tsx
index 22c3e82e36..f04e15e5e0 100644
--- a/frontend/src/pages/TracesFunnelDetails/components/FunnelResults/StepsTransitionResults.tsx
+++ b/frontend/src/pages/TracesFunnelDetails/components/FunnelResults/StepsTransitionResults.tsx
@@ -38,7 +38,7 @@ function StepsTransitionResults(): JSX.Element {
<SignozRadioGroup
value={selectedTransition}
options={stepTransitions}
- onChange={(e): void => setSelectedTransition(e.target.value)}
+ onChange={setSelectedTransition}
/>
</div>
<div className="steps-transition-results__results">