fix: chart types (#10147)

This commit is contained in:
shadcn
2026-03-23 15:58:15 +04:00
committed by GitHub
parent 14bc966fee
commit bebc4356af
19 changed files with 54 additions and 47 deletions

View File

@@ -3,15 +3,13 @@
import * as React from "react"
import { cn } from "@/examples/base/lib/utils"
import * as RechartsPrimitive from "recharts"
import type {
NameType,
ValueType,
} from "recharts/types/component/DefaultTooltipContent"
import type { TooltipValueType } from "recharts"
// Format: { THEME_NAME: CSS_SELECTOR }
const THEMES = { light: "", dark: ".dark" } as const
const INITIAL_DIMENSION = { width: 320, height: 200 } as const
type TooltipNameType = number | string
export type ChartConfig = Record<
string,
@@ -139,7 +137,10 @@ function ChartTooltipContent({
nameKey?: string
labelKey?: string
} & Omit<
RechartsPrimitive.DefaultTooltipContentProps<ValueType, NameType>,
RechartsPrimitive.DefaultTooltipContentProps<
TooltipValueType,
TooltipNameType
>,
"accessibilityLayer"
>) {
const { config } = useChart()

View File

@@ -3,15 +3,13 @@
import * as React from "react"
import { cn } from "@/examples/base/lib/utils"
import * as RechartsPrimitive from "recharts"
import type {
NameType,
ValueType,
} from "recharts/types/component/DefaultTooltipContent"
import type { TooltipValueType } from "recharts"
// Format: { THEME_NAME: CSS_SELECTOR }
const THEMES = { light: "", dark: ".dark" } as const
const INITIAL_DIMENSION = { width: 320, height: 200 } as const
type TooltipNameType = number | string
export type ChartConfig = Record<
string,
@@ -139,7 +137,10 @@ function ChartTooltipContent({
nameKey?: string
labelKey?: string
} & Omit<
RechartsPrimitive.DefaultTooltipContentProps<ValueType, NameType>,
RechartsPrimitive.DefaultTooltipContentProps<
TooltipValueType,
TooltipNameType
>,
"accessibilityLayer"
>) {
const { config } = useChart()

View File

@@ -3,15 +3,13 @@
import * as React from "react"
import { cn } from "@/examples/radix/lib/utils"
import * as RechartsPrimitive from "recharts"
import type {
NameType,
ValueType,
} from "recharts/types/component/DefaultTooltipContent"
import type { TooltipValueType } from "recharts"
// Format: { THEME_NAME: CSS_SELECTOR }
const THEMES = { light: "", dark: ".dark" } as const
const INITIAL_DIMENSION = { width: 320, height: 200 } as const
type TooltipNameType = number | string
export type ChartConfig = Record<
string,
@@ -139,7 +137,10 @@ function ChartTooltipContent({
nameKey?: string
labelKey?: string
} & Omit<
RechartsPrimitive.DefaultTooltipContentProps<ValueType, NameType>,
RechartsPrimitive.DefaultTooltipContentProps<
TooltipValueType,
TooltipNameType
>,
"accessibilityLayer"
>) {
const { config } = useChart()

View File

@@ -3,15 +3,13 @@
import * as React from "react"
import { cn } from "@/examples/radix/lib/utils"
import * as RechartsPrimitive from "recharts"
import type {
NameType,
ValueType,
} from "recharts/types/component/DefaultTooltipContent"
import type { TooltipValueType } from "recharts"
// Format: { THEME_NAME: CSS_SELECTOR }
const THEMES = { light: "", dark: ".dark" } as const
const INITIAL_DIMENSION = { width: 320, height: 200 } as const
type TooltipNameType = number | string
export type ChartConfig = Record<
string,
@@ -139,7 +137,10 @@ function ChartTooltipContent({
nameKey?: string
labelKey?: string
} & Omit<
RechartsPrimitive.DefaultTooltipContentProps<ValueType, NameType>,
RechartsPrimitive.DefaultTooltipContentProps<
TooltipValueType,
TooltipNameType
>,
"accessibilityLayer"
>) {
const { config } = useChart()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -2,10 +2,7 @@
import * as React from "react"
import * as RechartsPrimitive from "recharts"
import type {
NameType,
ValueType,
} from "recharts/types/component/DefaultTooltipContent"
import type { TooltipValueType } from "recharts"
import { cn } from "@/registry/bases/base/lib/utils"
@@ -13,6 +10,7 @@ import { cn } from "@/registry/bases/base/lib/utils"
const THEMES = { light: "", dark: ".dark" } as const
const INITIAL_DIMENSION = { width: 320, height: 200 } as const
type TooltipNameType = number | string
export type ChartConfig = Record<
string,
@@ -140,7 +138,10 @@ function ChartTooltipContent({
nameKey?: string
labelKey?: string
} & Omit<
RechartsPrimitive.DefaultTooltipContentProps<ValueType, NameType>,
RechartsPrimitive.DefaultTooltipContentProps<
TooltipValueType,
TooltipNameType
>,
"accessibilityLayer"
>) {
const { config } = useChart()

View File

@@ -2,10 +2,7 @@
import * as React from "react"
import * as RechartsPrimitive from "recharts"
import type {
NameType,
ValueType,
} from "recharts/types/component/DefaultTooltipContent"
import type { TooltipValueType } from "recharts"
import { cn } from "@/registry/bases/radix/lib/utils"
@@ -13,6 +10,7 @@ import { cn } from "@/registry/bases/radix/lib/utils"
const THEMES = { light: "", dark: ".dark" } as const
const INITIAL_DIMENSION = { width: 320, height: 200 } as const
type TooltipNameType = number | string
export type ChartConfig = Record<
string,
@@ -140,7 +138,10 @@ function ChartTooltipContent({
nameKey?: string
labelKey?: string
} & Omit<
RechartsPrimitive.DefaultTooltipContentProps<ValueType, NameType>,
RechartsPrimitive.DefaultTooltipContentProps<
TooltipValueType,
TooltipNameType
>,
"accessibilityLayer"
>) {
const { config } = useChart()

View File

@@ -2,10 +2,7 @@
import * as React from "react"
import * as RechartsPrimitive from "recharts"
import type {
NameType,
ValueType,
} from "recharts/types/component/DefaultTooltipContent"
import type { TooltipValueType } from "recharts"
import { cn } from "@/lib/utils"
@@ -13,6 +10,7 @@ import { cn } from "@/lib/utils"
const THEMES = { light: "", dark: ".dark" } as const
const INITIAL_DIMENSION = { width: 320, height: 200 } as const
type TooltipNameType = number | string
export type ChartConfig = Record<
string,
@@ -140,7 +138,10 @@ function ChartTooltipContent({
nameKey?: string
labelKey?: string
} & Omit<
RechartsPrimitive.DefaultTooltipContentProps<ValueType, NameType>,
RechartsPrimitive.DefaultTooltipContentProps<
TooltipValueType,
TooltipNameType
>,
"accessibilityLayer"
>) {
const { config } = useChart()