From 039bcd69762e2f78d946a693a8e1f154f692608d Mon Sep 17 00:00:00 2001 From: amianthus <49116958+SirTenzin@users.noreply.github.com> Date: Thu, 10 Jul 2025 16:16:28 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20remove=20neobrutalism?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite/src/components/ui/brutal-chart.tsx | 356 ------------------ .../customer/analytics/AnalyticsGraph.tsx | 47 --- .../customer/analytics/AnalyticsView.tsx | 2 +- .../customers/customer/analytics/brutal.css | 74 ---- 4 files changed, 1 insertion(+), 478 deletions(-) delete mode 100644 vite/src/components/ui/brutal-chart.tsx delete mode 100644 vite/src/views/customers/customer/analytics/brutal.css diff --git a/vite/src/components/ui/brutal-chart.tsx b/vite/src/components/ui/brutal-chart.tsx deleted file mode 100644 index 327ece973..000000000 --- a/vite/src/components/ui/brutal-chart.tsx +++ /dev/null @@ -1,356 +0,0 @@ -"use client" - -import * as RechartsPrimitive from "recharts" - -import * as React from "react" - -import { cn } from "@/lib/utils" - -// Format: { THEME_NAME: CSS_SELECTOR } -const THEMES = { light: "", dark: ".dark" } as const - -export type BrutalChartConfig = { - [k in string]: { - label?: React.ReactNode - icon?: React.ComponentType - } & ( - | { color?: string; theme?: never } - | { color?: never; theme: Record } - ) -} - -type ChartContextProps = { - config: BrutalChartConfig -} - -const ChartContext = React.createContext(null) - -function useChart() { - const context = React.useContext(ChartContext) - - if (!context) { - throw new Error("useChart must be used within a ") - } - - return context -} - -function ChartContainer({ - id, - className, - children, - config, - ...props -}: React.ComponentProps<"div"> & { - config: BrutalChartConfig - children: React.ComponentProps< - typeof RechartsPrimitive.ResponsiveContainer - >["children"] -}) { - const uniqueId = React.useId() - const chartId = `chart-${id || uniqueId.replace(/:/g, "")}` - - return ( - -
- - - {children} - -
-
- ) -} - -const ChartStyle = ({ id, config }: { id: string; config: BrutalChartConfig }) => { - const colorConfig = Object.entries(config).filter( - ([, config]) => config.theme || config.color, - ) - - if (!colorConfig.length) { - return null - } - - return ( -