From 2549ce097cec7c76dcaef6bf9292acb989f405e7 Mon Sep 17 00:00:00 2001 From: kovakmedya Date: Thu, 30 Apr 2026 08:03:00 +0300 Subject: [PATCH] =?UTF-8?q?feat(ui):=20white-label=20theme=20customizer=20?= =?UTF-8?q?panel=20=E2=80=94=20T=C3=BCrk=C3=A7e=20+=20sans=C3=BCrl=C3=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Yan paneldeki görünüm özelleştirme widget'ı template branding'inden arındırıldı: - 'Customizer' → 'Görünüm' - Tab adları: 'Theme'/'Layout' → 'Renk'/'Düzen' - 'Shadcn UI Theme Presets' → 'Hazır temalar' - 'Tweakcn Theme Presets' → 'Genişletilmiş temalar' (kaynak adı uygulamada görünmüyor) - 'Random' → 'Rastgele', 'Choose ... Theme' → 'Tema seçin' - 'Radius' → 'Köşe yuvarlama' - 'Mode' / 'Light' / 'Dark' → 'Görünüm modu' / 'Açık' / 'Koyu' - 'Import Theme' → 'Tema içe aktar' (modal başlığı + butonlar dahil) - 'Brand Colors' → 'Marka renkleri'; alt etiketler de TR - 'Sidebar Variant'/'Collapsible Mode'/'Position' → 'Kenar çubuğu stili / Daraltma davranışı / Kenar çubuğu konumu', açıklamalar TR - Constants (theme-customizer-constants): name alanları Türkçe (Default→Standart, Floating→Yüzen, Inset→İçeri çekik, Off Canvas→Gizle, Icon→İkon, None→Sabit, Left→Sol, Right→Sağ; brand color isimleri de Türkçeye çevrildi) - Tweakcn.com reklam kartı **tamamen kaldırıldı** (artık 3rd party link yok). Onun yerine import butonunun altına nötr bir ipucu yazısı: 'tweakcn.com gibi araçlardan dışa aktardığınız JSON tema dosyasını yükleyebilirsiniz.' — yani aracı bilgi olarak veriyoruz, reklam değil. - Reset/X butonlarına a11y label + tooltip eklendi. Theme datasını ('colorThemes' / 'tweakcnThemes' from @/config/theme-data) ve hook adlarını ('applyTweakcnTheme', 'tweakcn-theme-presets') aynen bıraktım — kullanıcıya görünmüyor, refactor maliyetli, runtime davranışı identical. --- .../theme-customizer/import-modal.tsx | 9 ++- src/components/theme-customizer/index.tsx | 33 ++++++--- .../theme-customizer/layout-tab.tsx | 29 ++++---- src/components/theme-customizer/theme-tab.tsx | 73 ++++++------------- src/config/theme-customizer-constants.ts | 51 ++++++------- 5 files changed, 89 insertions(+), 106 deletions(-) diff --git a/src/components/theme-customizer/import-modal.tsx b/src/components/theme-customizer/import-modal.tsx index a8d8e51..62c9011 100644 --- a/src/components/theme-customizer/import-modal.tsx +++ b/src/components/theme-customizer/import-modal.tsx @@ -66,9 +66,10 @@ export function ImportModal({ open, onOpenChange, onImport }: ImportModalProps) - Import Custom CSS + Tema CSS'i içe aktar - Paste your CSS theme below. Include both :root (light mode) and .dark (dark mode) sections with CSS variables like --primary, --background, etc. The theme will automatically switch between light and dark modes. + CSS temasını aşağıya yapıştırın. Açık tema için :root ve koyu tema için{" "} + .dark bölümleri olmalı; --primary, --background gibi CSS değişkenlerini içerir. Açık/koyu mod arasında otomatik geçiş yapılır.
@@ -94,10 +95,10 @@ export function ImportModal({ open, onOpenChange, onImport }: ImportModalProps)
diff --git a/src/components/theme-customizer/index.tsx b/src/components/theme-customizer/index.tsx index ee05018..e0a2aaa 100644 --- a/src/components/theme-customizer/index.tsx +++ b/src/components/theme-customizer/index.tsx @@ -96,18 +96,31 @@ export function ThemeCustomizer({ open, onOpenChange }: ThemeCustomizerProps) {
- Customizer + Görünüm
- -
- Customize the them and layout of your dashboard. + Panelin renklerini ve düzenini özelleştirin. @@ -115,13 +128,13 @@ export function ThemeCustomizer({ open, onOpenChange }: ThemeCustomizerProps) {
- Theme - Layout + + Renk + + + Düzen + - {/* - Theme - Layout - */}
diff --git a/src/components/theme-customizer/layout-tab.tsx b/src/components/theme-customizer/layout-tab.tsx index 81f8b86..3bccc7d 100644 --- a/src/components/theme-customizer/layout-tab.tsx +++ b/src/components/theme-customizer/layout-tab.tsx @@ -30,16 +30,15 @@ export function LayoutTab() { return (
- {/* Sidebar Configuration */} + {/* Kenar çubuğu ayarları */}
- {/* Sidebar Variant */}
- + {sidebarConfig.variant && (

- {sidebarConfig.variant === "sidebar" && "Default: Standard sidebar layout"} - {sidebarConfig.variant === "floating" && "Floating: Floating sidebar with border"} - {sidebarConfig.variant === "inset" && "Inset: Inset sidebar with rounded corners"} + {sidebarConfig.variant === "sidebar" && "Standart: klasik kenar çubuğu"} + {sidebarConfig.variant === "floating" && "Yüzen: çerçeveli, yüzen kenar çubuğu"} + {sidebarConfig.variant === "inset" && "İçeri çekik: yuvarlak köşeli içeri çekik"}

)}
@@ -84,15 +83,15 @@ export function LayoutTab() { - {/* Sidebar Collapsible Mode */} + {/* Daraltma davranışı */}
- + {sidebarConfig.collapsible && (

- {sidebarConfig.collapsible === "offcanvas" && "Off Canvas: Slides out of view"} - {sidebarConfig.collapsible === "icon" && "Icon: Collapses to icon only"} - {sidebarConfig.collapsible === "none" && "None: Always visible"} + {sidebarConfig.collapsible === "offcanvas" && "Gizle: kenar görünümden tamamen kayar"} + {sidebarConfig.collapsible === "icon" && "İkon: sadece ikonlar görünür"} + {sidebarConfig.collapsible === "none" && "Sabit: her zaman açık"}

)}
@@ -152,14 +151,14 @@ export function LayoutTab() { - {/* Sidebar Side */} + {/* Kenar çubuğu konumu */}
- + {sidebarConfig.side && (

- {sidebarConfig.side === "left" && "Left: Sidebar positioned on the left side"} - {sidebarConfig.side === "right" && "Right: Sidebar positioned on the right side"} + {sidebarConfig.side === "left" && "Sol: kenar çubuğu solda"} + {sidebarConfig.side === "right" && "Sağ: kenar çubuğu sağda"}

)}
diff --git a/src/components/theme-customizer/theme-tab.tsx b/src/components/theme-customizer/theme-tab.tsx index 187f4e6..f229083 100644 --- a/src/components/theme-customizer/theme-tab.tsx +++ b/src/components/theme-customizer/theme-tab.tsx @@ -1,6 +1,6 @@ "use client" -import { Palette, Dices, Upload, ExternalLink, Sun, Moon } from 'lucide-react' +import { Dices, Upload, Sun, Moon } from 'lucide-react' import { Button } from '@/components/ui/button' import { Label } from '@/components/ui/label' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' @@ -87,25 +87,25 @@ export function ThemeTab({
- {/* Shadcn UI Theme Presets */} + {/* Hazır temalar */}
- +
{ setSelectedTweakcnTheme(value) - setSelectedTheme("") // Clear shadcn selection + setSelectedTheme("") // Clear other selection setBrandColorsValues({}) // Clear brand colors state setImportedTheme(null) // Clear imported theme const selectedPreset = tweakcnThemes.find(t => t.value === value)?.preset @@ -162,7 +162,7 @@ export function ThemeTab({ } }}> - +
@@ -198,9 +198,9 @@ export function ThemeTab({ - {/* Radius Selection */} + {/* Köşe yuvarlama */}
- +
{radiusOptions.map((option) => (
- {/* Mode Section */} + {/* Görünüm modu */}
- +
- {/* Import Theme Button */} + {/* Tema içe aktar */}
+

+ tweakcn.com gibi araçlardan dışa aktardığınız JSON tema dosyasını yükleyebilirsiniz. +

- {/* Brand Colors Section */} + {/* Marka renkleri */} - + {baseColors.map((color) => ( @@ -282,34 +285,6 @@ export function ThemeTab({ - - {/* Tweakcn */} -
-
- - Advanced Customization -
-

- For advanced theme customization with real-time preview, visual color picker, and hundreds of prebuilt themes, visit{" "} - - tweakcn.com - -

- -
) } diff --git a/src/config/theme-customizer-constants.ts b/src/config/theme-customizer-constants.ts index d9d9e50..311fe15 100644 --- a/src/config/theme-customizer-constants.ts +++ b/src/config/theme-customizer-constants.ts @@ -1,12 +1,11 @@ -import type { - SidebarVariant, - SidebarCollapsibleOption, - SidebarSideOption, - RadiusOption, - BrandColor -} from '@/types/theme-customizer' +import type { + SidebarVariant, + SidebarCollapsibleOption, + SidebarSideOption, + RadiusOption, + BrandColor, +} from "@/types/theme-customizer" -// Radius options export const radiusOptions: RadiusOption[] = [ { name: "0", value: "0rem" }, { name: "0.3", value: "0.3rem" }, @@ -15,34 +14,30 @@ export const radiusOptions: RadiusOption[] = [ { name: "1.0", value: "1rem" }, ] -// Sidebar variant options export const sidebarVariants: SidebarVariant[] = [ - { name: "Default", value: "sidebar", description: "Standard sidebar layout" }, - { name: "Floating", value: "floating", description: "Floating sidebar with border" }, - { name: "Inset", value: "inset", description: "Inset sidebar with rounded corners" }, + { name: "Standart", value: "sidebar", description: "Klasik kenar çubuğu" }, + { name: "Yüzen", value: "floating", description: "Çerçeveli, yüzen kenar çubuğu" }, + { name: "İçeri çekik", value: "inset", description: "Yuvarlak köşeli içeri çekik kenar" }, ] -// Sidebar collapsible options export const sidebarCollapsibleOptions: SidebarCollapsibleOption[] = [ - { name: "Off Canvas", value: "offcanvas", description: "Slides out of view" }, - { name: "Icon", value: "icon", description: "Collapses to icon only" }, - { name: "None", value: "none", description: "Always visible" }, + { name: "Gizle", value: "offcanvas", description: "Görünümden tamamen kayar" }, + { name: "İkon", value: "icon", description: "Sadece ikonlar görünür" }, + { name: "Sabit", value: "none", description: "Her zaman açık" }, ] -// Sidebar side options export const sidebarSideOptions: SidebarSideOption[] = [ - { name: "Left", value: "left" }, - { name: "Right", value: "right" }, + { name: "Sol", value: "left" }, + { name: "Sağ", value: "right" }, ] -// Define brand colors for custom color inputs export const baseColors: BrandColor[] = [ - { name: "Primary", cssVar: "--primary" }, - { name: "Primary Foreground", cssVar: "--primary-foreground" }, - { name: "Secondary", cssVar: "--secondary" }, - { name: "Secondary Foreground", cssVar: "--secondary-foreground" }, - { name: "Accent", cssVar: "--accent" }, - { name: "Accent Foreground", cssVar: "--accent-foreground" }, - { name: "Muted", cssVar: "--muted" }, - { name: "Muted Foreground", cssVar: "--muted-foreground" }, + { name: "Birincil", cssVar: "--primary" }, + { name: "Birincil — yazı", cssVar: "--primary-foreground" }, + { name: "İkincil", cssVar: "--secondary" }, + { name: "İkincil — yazı", cssVar: "--secondary-foreground" }, + { name: "Vurgu", cssVar: "--accent" }, + { name: "Vurgu — yazı", cssVar: "--accent-foreground" }, + { name: "Soluk", cssVar: "--muted" }, + { name: "Soluk — yazı", cssVar: "--muted-foreground" }, ]