🎨 fix(theme): align UI controls with global radius tokens
Remove hard-coded and capped border radius overrides so shared controls and feature actions consistently follow the active theme radius. - Replace fixed radius utilities with semantic theme-aware radius tokens - Remove redundant `rounded-full` and pixel-based overrides from header, toolbar, Playground, and utility actions - Drop unused `StatusBadge` rounded prop usage - Keep existing component behavior intact while improving global theme consistency
This commit is contained in:
+15
-2
@@ -2,6 +2,7 @@ import { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { VChart } from '@visactor/react-vchart'
|
||||
import { AreaChart, BarChart3, WalletCards } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useThemeRadiusPx } from '@/lib/theme-radius'
|
||||
import type { TimeGranularity } from '@/lib/time'
|
||||
import { VCHART_OPTION } from '@/lib/vchart'
|
||||
import { useThemeCustomization } from '@/context/theme-customization-provider'
|
||||
@@ -41,6 +42,10 @@ export function ConsumptionDistributionChart(
|
||||
const { t } = useTranslation()
|
||||
const { resolvedTheme } = useTheme()
|
||||
const { customization } = useThemeCustomization()
|
||||
const chartRadius = useThemeRadiusPx(
|
||||
'--radius-md',
|
||||
`${customization.preset}:${customization.radius}`
|
||||
)
|
||||
const [chartType, setChartType] = useState<ConsumptionDistributionChartType>(
|
||||
props.defaultChartType ?? 'bar'
|
||||
)
|
||||
@@ -79,9 +84,17 @@ export function ConsumptionDistributionChart(
|
||||
props.loading ? [] : props.data,
|
||||
timeGranularity,
|
||||
t,
|
||||
customization.preset
|
||||
customization.preset,
|
||||
chartRadius
|
||||
),
|
||||
[props.data, props.loading, timeGranularity, t, customization.preset]
|
||||
[
|
||||
props.data,
|
||||
props.loading,
|
||||
timeGranularity,
|
||||
t,
|
||||
customization.preset,
|
||||
chartRadius,
|
||||
]
|
||||
)
|
||||
const spec = chartType === 'bar' ? chartData.spec_line : chartData.spec_area
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useEffect, useMemo, useState, useRef } from 'react'
|
||||
import { VChart } from '@visactor/react-vchart'
|
||||
import { PieChart as PieChartIcon } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useThemeRadiusPx } from '@/lib/theme-radius'
|
||||
import type { TimeGranularity } from '@/lib/time'
|
||||
import { VCHART_OPTION } from '@/lib/vchart'
|
||||
import { useThemeCustomization } from '@/context/theme-customization-provider'
|
||||
@@ -39,6 +40,10 @@ export function ModelCharts(props: ModelChartsProps) {
|
||||
const { t } = useTranslation()
|
||||
const { resolvedTheme } = useTheme()
|
||||
const { customization } = useThemeCustomization()
|
||||
const chartRadius = useThemeRadiusPx(
|
||||
'--radius-md',
|
||||
`${customization.preset}:${customization.radius}`
|
||||
)
|
||||
const [activeTab, setActiveTab] = useState<ModelAnalyticsChartTab>(
|
||||
props.defaultChartTab ?? 'trend'
|
||||
)
|
||||
@@ -77,9 +82,17 @@ export function ModelCharts(props: ModelChartsProps) {
|
||||
props.loading ? [] : props.data,
|
||||
timeGranularity,
|
||||
t,
|
||||
customization.preset
|
||||
customization.preset,
|
||||
chartRadius
|
||||
),
|
||||
[props.data, props.loading, timeGranularity, t, customization.preset]
|
||||
[
|
||||
props.data,
|
||||
props.loading,
|
||||
timeGranularity,
|
||||
t,
|
||||
customization.preset,
|
||||
chartRadius,
|
||||
]
|
||||
)
|
||||
|
||||
const spec = chartData[CHART_SPEC_KEYS[activeTab]]
|
||||
|
||||
+2
-2
@@ -209,7 +209,7 @@ function StartStepItem(props: {
|
||||
)}
|
||||
<span
|
||||
className={cn(
|
||||
'bg-background relative z-10 flex size-8 shrink-0 items-center justify-center rounded-full border shadow-xs',
|
||||
'bg-background relative z-10 flex size-8 shrink-0 items-center justify-center rounded-lg border shadow-xs',
|
||||
props.step.completed && 'border-success/30 bg-success/10'
|
||||
)}
|
||||
>
|
||||
@@ -657,7 +657,7 @@ export function OverviewDashboard() {
|
||||
? t('Setup guide complete')
|
||||
: t('Setup guide')}
|
||||
</h3>
|
||||
<span className='text-muted-foreground bg-background/60 rounded-full border px-2 py-0.5 text-xs'>
|
||||
<span className='text-muted-foreground bg-background/60 rounded-md border px-2 py-0.5 text-xs'>
|
||||
{t('Setup progress: {{completed}}/{{total}}', {
|
||||
completed: completedStepCount,
|
||||
total: startSteps.length,
|
||||
|
||||
@@ -129,6 +129,7 @@ export function UserCharts() {
|
||||
t,
|
||||
topUserLimit,
|
||||
customization.preset,
|
||||
customization.radius,
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
+4
-2
@@ -80,7 +80,8 @@ export function processChartData(
|
||||
data: QuotaDataItem[],
|
||||
timeGranularity: TimeGranularity = 'day',
|
||||
t?: TFunction,
|
||||
themeKey?: string
|
||||
themeKey?: string,
|
||||
chartCornerRadius?: number
|
||||
): ProcessedChartData {
|
||||
const tt: TFunction = t ?? ((x) => x)
|
||||
const otherLabel = tt('Other')
|
||||
@@ -472,7 +473,8 @@ export function processChartData(
|
||||
valueField: 'value',
|
||||
categoryField: 'type',
|
||||
pie: {
|
||||
style: { cornerRadius: 10 },
|
||||
style:
|
||||
chartCornerRadius == null ? {} : { cornerRadius: chartCornerRadius },
|
||||
state: {
|
||||
hover: { outerRadius: 0.85, stroke: '#000', lineWidth: 1 },
|
||||
selected: { outerRadius: 0.85, stroke: '#000', lineWidth: 1 },
|
||||
|
||||
Reference in New Issue
Block a user