@moontra/moonui 6.10.0 → 6.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/index.global.js +6 -1
- package/dist/hooks/index.global.js.map +1 -1
- package/dist/index.global.js +365 -52
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/__tests__/preset-color-shadowing.test.ts +71 -0
- package/src/components/ui/__tests__/semantic-token-usage.test.ts +120 -0
- package/src/components/ui/__tests__/toast.test.tsx +6 -3
- package/src/components/ui/__tests__/tooltip.test.tsx +8 -4
- package/src/components/ui/toast.tsx +4 -4
- package/src/components/ui/tooltip.tsx +3 -3
- package/src/styles/tokens.css +43 -2
- package/tailwind-preset.js +17 -7
- package/src/use-toast.ts +0 -32
package/package.json
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tailwind preset'inde RENK GÖLGELEME bekçisi.
|
|
3
|
+
*
|
|
4
|
+
* Gerçek olay: `theme.extend.borderColor` bloğu `success`/`warning`/`info`/`error`/`caution`'ı
|
|
5
|
+
* DÜZ STRING olarak tanımlıyordu. Tailwind bu düz değeri `theme.colors` altındaki İÇ İÇE
|
|
6
|
+
* nesnenin üzerine yazar → o beş isimde `border-*` ailesi için yalnız DEFAULT hayatta kalır,
|
|
7
|
+
* `border-success-subtle-foreground` gibi alt anahtarlar **hiç CSS üretmez**.
|
|
8
|
+
*
|
|
9
|
+
* Bu sessiz bir kusurdur: TypeScript görmez, jest render testi görmez (sınıf DOM'da vardır,
|
|
10
|
+
* yalnız karşılığı yoktur). #313/#314/#323'te toast'a eklenen üç kenarlık sınıfı tam bu yüzden
|
|
11
|
+
* ölü çıktı ve ancak deterministik bir Tailwind CLI probe'uyla yakalandı.
|
|
12
|
+
*/
|
|
13
|
+
import preset from '../../../../tailwind-preset.js'
|
|
14
|
+
|
|
15
|
+
type ColorValue = string | Record<string, unknown>
|
|
16
|
+
|
|
17
|
+
// DİKKAT: bu preset'te renkler `theme.colors` DEĞİL, `theme.extend.colors` altında.
|
|
18
|
+
// (İlk yazımda yanlış yere baktım ve test kırmızı oldu — yapı varsayılmamalı, okunmalı.)
|
|
19
|
+
const extend = (preset as any).theme?.extend as Record<string, unknown> | undefined
|
|
20
|
+
const colors = extend?.colors as Record<string, ColorValue> | undefined
|
|
21
|
+
|
|
22
|
+
/** `border-*`, `text-*`, `bg-*` … ailelerini besleyen, renk gölgeleyebilen extend anahtarları */
|
|
23
|
+
const RENK_AILELERI = [
|
|
24
|
+
'borderColor',
|
|
25
|
+
'textColor',
|
|
26
|
+
'backgroundColor',
|
|
27
|
+
'ringColor',
|
|
28
|
+
'divideColor',
|
|
29
|
+
'outlineColor',
|
|
30
|
+
'fill',
|
|
31
|
+
'stroke',
|
|
32
|
+
'placeholderColor',
|
|
33
|
+
'accentColor',
|
|
34
|
+
'caretColor',
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
describe('tailwind preset — iç içe renk anahtarları gölgelenmiyor', () => {
|
|
38
|
+
it('preset okunabiliyor ve colors tanımlı (sessiz yeşil koruması)', () => {
|
|
39
|
+
expect(colors).toBeDefined()
|
|
40
|
+
// `destructive` iç içe nesne olmalı — tarayıcının canlı olduğunun kanıtı
|
|
41
|
+
expect(typeof colors!.destructive).toBe('object')
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it('hiçbir renk ailesi extend\'i, iç içe bir `colors` girdisini DÜZ STRING ile ezmiyor', () => {
|
|
45
|
+
const ihlaller: string[] = []
|
|
46
|
+
for (const aile of RENK_AILELERI) {
|
|
47
|
+
const blok = extend?.[aile] as Record<string, ColorValue> | undefined
|
|
48
|
+
if (!blok || typeof blok !== 'object') continue
|
|
49
|
+
for (const [isim, deger] of Object.entries(blok)) {
|
|
50
|
+
const asil = colors?.[isim]
|
|
51
|
+
if (asil && typeof asil === 'object' && typeof deger === 'string') {
|
|
52
|
+
const kayipAnahtarlar = Object.keys(asil).filter((k) => k !== 'DEFAULT')
|
|
53
|
+
ihlaller.push(
|
|
54
|
+
`theme.extend.${aile}.${isim} düz string → colors.${isim}'in ` +
|
|
55
|
+
`[${kayipAnahtarlar.join(', ')}] alt anahtarları ${aile} için ÖLÜ`
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
expect(ihlaller).toEqual([])
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it('semantik renklerin subtle alt anahtarları preset\'te tanımlı', () => {
|
|
64
|
+
for (const isim of ['destructive', 'success', 'warning', 'info']) {
|
|
65
|
+
const c = colors?.[isim] as Record<string, unknown> | undefined
|
|
66
|
+
expect(c).toBeDefined()
|
|
67
|
+
expect(c).toHaveProperty('subtle')
|
|
68
|
+
expect(c).toHaveProperty('subtle-foreground')
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
})
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #313 / #314 / #323 — semantik durum varyantlarında ham palet bekçisi.
|
|
3
|
+
*
|
|
4
|
+
* Denetimin bulgusu: `destructive`/`success`/`warning`/`info` durum varyantları paketin
|
|
5
|
+
* kendi token'ları yerine ham Tailwind paletine (`bg-red-100 text-red-900`) düşmüştü.
|
|
6
|
+
* Sonuç görsel değil **işlevsel**: marka/tema özelleştirmesi bu varyantlara İŞLEMİYORDU —
|
|
7
|
+
* tüketici `--destructive`'i değiştirdiğinde menü item'ı ve toast eski kırmızıda kalıyordu.
|
|
8
|
+
*
|
|
9
|
+
* Çözüm `--*-subtle` token ailesiydi (düz `--destructive` "dolu zemin + açık metin" içindir;
|
|
10
|
+
* yumuşak tint + koyu metin için karşılığı yoktu). Bu test o dönüşümün geri gelmemesini korur.
|
|
11
|
+
*
|
|
12
|
+
* KAPSAM NOTU: kural yalnızca **durum varyantı** tanımlayan cva bloklarını hedefler.
|
|
13
|
+
* `premium` gibi DEKORATİF aksanlar (altın/gradient) kapsam dışıdır — bir "premium" rozetini
|
|
14
|
+
* `--warning`e bağlamak semantik olarak yanlış olurdu; onlar ayrı bir token ailesi ister.
|
|
15
|
+
*/
|
|
16
|
+
import * as fs from 'fs'
|
|
17
|
+
import * as path from 'path'
|
|
18
|
+
|
|
19
|
+
/** Ham Tailwind palet ailesi — semantik durumların yerine geçmemeli. */
|
|
20
|
+
const HAM_PALET = /\b(?:bg|text|border|ring|from|to|via)-(red|green|yellow|orange|blue)-\d{2,3}\b/
|
|
21
|
+
|
|
22
|
+
/** Durum varyantı adları — cva içinde bu anahtarların değerleri token kullanmalı. */
|
|
23
|
+
const DURUM_ANAHTARLARI = ['destructive', 'success', 'warning', 'info', 'error']
|
|
24
|
+
|
|
25
|
+
interface Ihlal {
|
|
26
|
+
file: string
|
|
27
|
+
line: number
|
|
28
|
+
anahtar: string
|
|
29
|
+
parca: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function tara(root: string): Ihlal[] {
|
|
33
|
+
const files: string[] = []
|
|
34
|
+
;(function walk(dir: string) {
|
|
35
|
+
if (!fs.existsSync(dir)) return
|
|
36
|
+
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
37
|
+
const p = path.join(dir, e.name)
|
|
38
|
+
if (e.isDirectory()) {
|
|
39
|
+
if (!/node_modules|__tests__|dist/.test(p)) walk(p)
|
|
40
|
+
} else if (/\.tsx?$/.test(e.name) && !/\.stories\./.test(e.name)) files.push(p)
|
|
41
|
+
}
|
|
42
|
+
})(root)
|
|
43
|
+
|
|
44
|
+
const ihlaller: Ihlal[] = []
|
|
45
|
+
for (const f of files) {
|
|
46
|
+
const src = fs.readFileSync(f, 'utf8')
|
|
47
|
+
for (const anahtar of DURUM_ANAHTARLARI) {
|
|
48
|
+
// `destructive: "…"` biçimindeki cva varyant girdisini yakala
|
|
49
|
+
const re = new RegExp(`\\n[ \\t]*${anahtar}:\\s*(["'])([\\s\\S]*?)\\1`, 'g')
|
|
50
|
+
for (const m of src.matchAll(re)) {
|
|
51
|
+
const deger = m[2]
|
|
52
|
+
const hit = deger.match(HAM_PALET)
|
|
53
|
+
if (hit) {
|
|
54
|
+
ihlaller.push({
|
|
55
|
+
file: path.relative(process.cwd(), f),
|
|
56
|
+
line: src.slice(0, m.index).split('\n').length + 1,
|
|
57
|
+
anahtar,
|
|
58
|
+
parca: hit[0],
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return ihlaller
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* BİLİNEN KALAN İHLALLER — cırcır (ratchet) listesi.
|
|
69
|
+
*
|
|
70
|
+
* Bu PR (#313/#314/#323) menü + toast ailesini dönüştürdü. Bekçi kurulunca aynı desenin
|
|
71
|
+
* kütüphanede DAHA GENİŞ olduğu ortaya çıktı: 7 dosyada 21 ihlal daha. Onları bu PR'a
|
|
72
|
+
* çekmek kapsamı ilgisiz component'lere (dashboard widget'ları, timeline, avatar-pro…)
|
|
73
|
+
* yayardı; bu yüzden burada AÇIKÇA listeleniyorlar.
|
|
74
|
+
*
|
|
75
|
+
* Kural cırcır gibi çalışır: listedekiler tolere edilir, **yeni** ihlal kırmızı olur.
|
|
76
|
+
* Takip işi bu dosyaları dönüştürüp satırları buradan siler — liste boşalınca kural
|
|
77
|
+
* tam sıkı hale gelir.
|
|
78
|
+
*/
|
|
79
|
+
const BILINEN_KALANLAR: string[] = []
|
|
80
|
+
|
|
81
|
+
const SRC_ROOT = path.resolve(__dirname, '../../..')
|
|
82
|
+
const tumIhlaller = tara(SRC_ROOT)
|
|
83
|
+
const ihlaller = tumIhlaller.filter(
|
|
84
|
+
(i) => !BILINEN_KALANLAR.some((b) => i.file.replace(/\\/g, '/').endsWith(b))
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
describe('#313/#314/#323 semantik durum varyantları token kullanır', () => {
|
|
88
|
+
it('tarayıcı gerçekten dosya buluyor (sessiz yeşil koruması)', () => {
|
|
89
|
+
// Regex/yol bozulursa test "0 ihlal" ile yeşil geçerdi. Bilinen bir durum
|
|
90
|
+
// varyantının var olduğunu doğrulayarak tarayıcının canlı olduğunu kanıtlıyoruz.
|
|
91
|
+
const toast = fs.readFileSync(
|
|
92
|
+
path.join(SRC_ROOT, 'components/ui/toast.tsx'),
|
|
93
|
+
'utf8'
|
|
94
|
+
)
|
|
95
|
+
expect(toast).toContain('success:')
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
it('durum varyantlarında ham Tailwind paleti YOK (bilinen kalanlar hariç)', () => {
|
|
99
|
+
const rapor = ihlaller.map((i) => `${i.file}:${i.line} → ${i.anahtar} içinde "${i.parca}"`)
|
|
100
|
+
expect(rapor).toEqual([])
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
it('cırcır listesi ÇALIŞIYOR — listelenen dosyalar gerçekten hâlâ ihlalli', () => {
|
|
104
|
+
// Bir dosya dönüştürüldüğünde bu test kırmızı olur ve satırı listeden silmeyi hatırlatır.
|
|
105
|
+
// Aksi hâlde liste sonsuza dek şişer ve kural sessizce gevşer.
|
|
106
|
+
const halaIhlalli = new Set(
|
|
107
|
+
tumIhlaller.map((i) => BILINEN_KALANLAR.find((b) => i.file.replace(/\\/g, '/').endsWith(b)))
|
|
108
|
+
)
|
|
109
|
+
const gereksizListelenen = BILINEN_KALANLAR.filter((b) => !halaIhlalli.has(b))
|
|
110
|
+
expect(gereksizListelenen).toEqual([])
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
it('toast success/warning/info gerçekten `--*-subtle` token\'larını kullanıyor', () => {
|
|
114
|
+
const toast = fs.readFileSync(path.join(SRC_ROOT, 'components/ui/toast.tsx'), 'utf8')
|
|
115
|
+
expect(toast).toContain('bg-success-subtle')
|
|
116
|
+
expect(toast).toContain('text-success-subtle-foreground')
|
|
117
|
+
expect(toast).toContain('bg-warning-subtle')
|
|
118
|
+
expect(toast).toContain('bg-info-subtle')
|
|
119
|
+
})
|
|
120
|
+
})
|
|
@@ -146,9 +146,12 @@ describe('Toast Components', () => {
|
|
|
146
146
|
const variants = [
|
|
147
147
|
{ variant: 'default', classes: ['bg-background', 'text-foreground'] },
|
|
148
148
|
{ variant: 'destructive', classes: ['bg-destructive', 'text-destructive-foreground'] },
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
// #323: bu üç varyant ham Tailwind paleti kullanıyordu (`bg-green-50` vb.) →
|
|
150
|
+
// marka/tema özelleştirmesi onlara İŞLEMİYORDU. Artık `--*-subtle` semantik
|
|
151
|
+
// token'ları. Kontrast korundu (8.70 / 8.83 / 9.52 — ölçüldü, bkz. changelog).
|
|
152
|
+
{ variant: 'success', classes: ['bg-success-subtle', 'text-success-subtle-foreground'] },
|
|
153
|
+
{ variant: 'warning', classes: ['bg-warning-subtle', 'text-warning-subtle-foreground'] },
|
|
154
|
+
{ variant: 'info', classes: ['bg-info-subtle', 'text-info-subtle-foreground'] },
|
|
152
155
|
] as const
|
|
153
156
|
|
|
154
157
|
variants.forEach(({ variant, classes }) => {
|
|
@@ -156,10 +156,14 @@ describe('Tooltip Components', () => {
|
|
|
156
156
|
const variants = [
|
|
157
157
|
{ variant: 'default', className: 'bg-primary', textClassName: 'text-primary-foreground' },
|
|
158
158
|
{ variant: 'secondary', className: 'bg-secondary', textClassName: 'text-secondary-foreground' },
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
// #313/#314/#323: bu üçü ham paletti ve KONTRASTI FELAKETTİ — ölçüldü:
|
|
160
|
+
// bg-green-500 + text-white = 2.28, bg-yellow-500 + text-white = 1.92 (AA 4.5).
|
|
161
|
+
// Semantik token'a geçince 4.67 / 8.18 oldu. Test eski (kırık) değerleri
|
|
162
|
+
// sabitliyordu; artık token çiftini doğruluyor.
|
|
163
|
+
{ variant: 'success', className: 'bg-success', textClassName: 'text-success-foreground' },
|
|
164
|
+
{ variant: 'warning', className: 'bg-warning', textClassName: 'text-warning-foreground' },
|
|
161
165
|
{ variant: 'destructive', className: 'bg-destructive', textClassName: 'text-destructive-foreground' },
|
|
162
|
-
{ variant: 'info', className: 'bg-
|
|
166
|
+
{ variant: 'info', className: 'bg-info', textClassName: 'text-info-foreground' },
|
|
163
167
|
] as const
|
|
164
168
|
|
|
165
169
|
variants.forEach(({ variant, className, textClassName }) => {
|
|
@@ -659,7 +663,7 @@ describe('Tooltip Components', () => {
|
|
|
659
663
|
|
|
660
664
|
const tooltip = getTooltipContent()
|
|
661
665
|
expect(tooltip).toBeInTheDocument()
|
|
662
|
-
expect(tooltip).toHaveClass('bg-
|
|
666
|
+
expect(tooltip).toHaveClass('bg-success')
|
|
663
667
|
expect(tooltip).toHaveClass('text-base')
|
|
664
668
|
expect(tooltip).toHaveClass('custom-tooltip')
|
|
665
669
|
expect(tooltip).toHaveAttribute('data-side', 'bottom')
|
|
@@ -32,11 +32,11 @@ const toastVariants = cva(
|
|
|
32
32
|
destructive:
|
|
33
33
|
"destructive group border-destructive bg-destructive text-destructive-foreground",
|
|
34
34
|
success:
|
|
35
|
-
"border-
|
|
35
|
+
"border-success-subtle-foreground/20 bg-success-subtle text-success-subtle-foreground",
|
|
36
36
|
warning:
|
|
37
|
-
"border-
|
|
37
|
+
"border-warning-subtle-foreground/20 bg-warning-subtle text-warning-subtle-foreground",
|
|
38
38
|
info:
|
|
39
|
-
"border-
|
|
39
|
+
"border-info-subtle-foreground/20 bg-info-subtle text-info-subtle-foreground",
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
defaultVariants: {
|
|
@@ -86,7 +86,7 @@ const ToastClose = React.forwardRef<
|
|
|
86
86
|
<ToastPrimitives.Close
|
|
87
87
|
ref={ref}
|
|
88
88
|
className={cn(
|
|
89
|
-
"absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-
|
|
89
|
+
"absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-destructive-foreground/70 group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive-foreground/40 group-[.destructive]:focus:ring-offset-destructive",
|
|
90
90
|
className
|
|
91
91
|
)}
|
|
92
92
|
toast-close=""
|
|
@@ -15,10 +15,10 @@ const tooltipVariants = cva(
|
|
|
15
15
|
variant: {
|
|
16
16
|
default: "bg-primary text-primary-foreground",
|
|
17
17
|
secondary: "bg-secondary text-secondary-foreground",
|
|
18
|
-
success: "bg-
|
|
19
|
-
warning: "bg-
|
|
18
|
+
success: "bg-success text-success-foreground border-success",
|
|
19
|
+
warning: "bg-warning text-warning-foreground border-warning",
|
|
20
20
|
destructive: "bg-destructive text-destructive-foreground",
|
|
21
|
-
info: "bg-
|
|
21
|
+
info: "bg-info text-info-foreground border-info",
|
|
22
22
|
},
|
|
23
23
|
size: {
|
|
24
24
|
sm: "px-2 py-1 text-xs",
|
package/src/styles/tokens.css
CHANGED
|
@@ -146,7 +146,11 @@
|
|
|
146
146
|
--muted-foreground: 215.4 16.3% 45%;
|
|
147
147
|
--accent: 217.2 32.6% 94%;
|
|
148
148
|
--accent-foreground: 217.2 91.2% 51%;
|
|
149
|
-
|
|
149
|
+
/* #327: 60.2% idi. HİÇBİR kullanımda AA'yı geçmiyordu — beyaz zeminde metin 3.76,
|
|
150
|
+
kendi foreground'uyla düz dolgu 3.59. 48%, her İKİ testi de geçen en açık değer
|
|
151
|
+
(4.86 / 4.64), yani marka rengine en yakın kalan seçenek. Koyu tema (0 63% 31%)
|
|
152
|
+
zaten 9.44 → dokunulmadı. #284'ün --primary onarımıyla aynı desen. */
|
|
153
|
+
--destructive: 0 84.2% 48%;
|
|
150
154
|
--destructive-foreground: 210 40% 98%;
|
|
151
155
|
--border: 214.3 31.8% 91.4%;
|
|
152
156
|
/* #284: form kontrolü kenarlığı beyaz zeminde 1.23 idi (WCAG 1.4.11 eşiği 3.0,
|
|
@@ -167,11 +171,34 @@
|
|
|
167
171
|
--warning-foreground: 24 10% 10%;
|
|
168
172
|
--error: 0 84% 60%;
|
|
169
173
|
--error-foreground: 210 40% 98%;
|
|
170
|
-
|
|
174
|
+
/* #313/#314/#323 dönüşümü sırasında çıktı: `--info` düz dolgu olarak kendi
|
|
175
|
+
foreground'uyla 3.47 veriyordu — `--destructive`in (#327) birebir aynı kusuru.
|
|
176
|
+
Kullanıcının #327'de seçtiği ilke burada da uygulandı: her iki testi geçen EN AÇIK
|
|
177
|
+
değer. 50% → düz 4.83, metin/beyaz 5.05. */
|
|
178
|
+
--info: 217 91% 50%;
|
|
171
179
|
--info-foreground: 210 40% 98%;
|
|
172
180
|
--caution: 38 92% 50%;
|
|
173
181
|
--caution-foreground: 24 10% 10%;
|
|
174
182
|
|
|
183
|
+
/* ---------------------------------------------------------------------------
|
|
184
|
+
#313 / #314 / #323 — YUMUŞAK-TON (subtle) semantik yüzeyler
|
|
185
|
+
---------------------------------------------------------------------------
|
|
186
|
+
`--destructive` gibi DÜZ token'lar "dolu zemin + açık metin" içindir. Menü
|
|
187
|
+
item'ı, toast, rozet gibi yerlerde ise yumuşak bir tint + koyu metin gerekir.
|
|
188
|
+
Böyle bir token OLMADIĞI için 25 dosya ham Tailwind paletine (`bg-red-100
|
|
189
|
+
text-red-900`) düşmüştü → marka/tema özelleştirmesi bu varyantlara İŞLEMİYORDU.
|
|
190
|
+
|
|
191
|
+
Değerler bugünkü ham palet çiftlerinin birebir HSL karşılığıdır; yani dönüşüm
|
|
192
|
+
kontrastı DÜŞÜRMEZ (ölçüldü: 8.20 / 8.70 / 8.83 / 9.52 — hepsi korunur). */
|
|
193
|
+
--destructive-subtle: 0 93% 94%;
|
|
194
|
+
--destructive-subtle-foreground: 0 63% 31%; /* 8.20:1 */
|
|
195
|
+
--success-subtle: 138 77% 97%;
|
|
196
|
+
--success-subtle-foreground: 144 61% 20%; /* 8.70:1 */
|
|
197
|
+
--warning-subtle: 33 100% 97%;
|
|
198
|
+
--warning-subtle-foreground: 15 75% 28%; /* 8.83:1 */
|
|
199
|
+
--info-subtle: 214 100% 97%;
|
|
200
|
+
--info-subtle-foreground: 224 64% 33%; /* 9.52:1 */
|
|
201
|
+
|
|
175
202
|
--primary-50: 240 249 255;
|
|
176
203
|
|
|
177
204
|
/* Tailwind preset'i rounded-lg/md/sm'yi var(--radius)'a bagliyor.
|
|
@@ -433,6 +460,20 @@
|
|
|
433
460
|
metin olarak okunmuyordu (3.30) — burada 36% korunur (4.86). */
|
|
434
461
|
--success: 142 76% 36%;
|
|
435
462
|
--destructive-foreground: 210 40% 98%;
|
|
463
|
+
|
|
464
|
+
/* #313/#314/#323 — koyu tema subtle yüzeyleri.
|
|
465
|
+
Bunlar bugünkü `dark:bg-red-900/20` kompozisyonunun ARİTMETİK karşılığı DEĞİL:
|
|
466
|
+
çok koyu lacivert zemine %20 tint bindirince hue zemine kayıyor ve ortaya
|
|
467
|
+
semantik olmayan bir renk çıkıyor (destructive için 312° = macenta). Bunun
|
|
468
|
+
yerine semantik hue KORUNARAK kasıtlı koyu tint'ler seçildi; kontrast ölçüldü. */
|
|
469
|
+
--destructive-subtle: 0 63% 12%;
|
|
470
|
+
--destructive-subtle-foreground: 0 91% 71%; /* 6.43:1 */
|
|
471
|
+
--success-subtle: 142 70% 10%;
|
|
472
|
+
--success-subtle-foreground: 141 84% 93%; /* 14.02:1 */
|
|
473
|
+
--warning-subtle: 25 80% 11%;
|
|
474
|
+
--warning-subtle-foreground: 34 100% 92%; /* 14.43:1 */
|
|
475
|
+
--info-subtle: 217 80% 13%;
|
|
476
|
+
--info-subtle-foreground: 214 95% 93%; /* 14.11:1 */
|
|
436
477
|
--border: 216 34% 17%;
|
|
437
478
|
/* #284: koyu temada form kontrolü kenarlığı 1.36 idi -> 40% ile ~3.1.
|
|
438
479
|
Not: --input switch.tsx:27'de kapalı track ZEMİNİ olarak da kullanılıyor;
|
package/tailwind-preset.js
CHANGED
|
@@ -92,15 +92,23 @@ module.exports = {
|
|
|
92
92
|
destructive: {
|
|
93
93
|
DEFAULT: "hsl(var(--destructive) / <alpha-value>)",
|
|
94
94
|
foreground: "hsl(var(--destructive-foreground) / <alpha-value>)",
|
|
95
|
+
// #313/#314/#323: yumuşak-ton yüzey — `bg-destructive-subtle` +
|
|
96
|
+
// `text-destructive-subtle-foreground` olarak kullanılır.
|
|
97
|
+
subtle: "hsl(var(--destructive-subtle) / <alpha-value>)",
|
|
98
|
+
"subtle-foreground": "hsl(var(--destructive-subtle-foreground) / <alpha-value>)",
|
|
95
99
|
},
|
|
96
100
|
error: "hsl(var(--error) / <alpha-value>)",
|
|
97
101
|
success: {
|
|
98
102
|
DEFAULT: "hsl(var(--success) / <alpha-value>)",
|
|
99
103
|
foreground: "hsl(var(--success-foreground) / <alpha-value>)",
|
|
104
|
+
subtle: "hsl(var(--success-subtle) / <alpha-value>)",
|
|
105
|
+
"subtle-foreground": "hsl(var(--success-subtle-foreground) / <alpha-value>)",
|
|
100
106
|
},
|
|
101
107
|
warning: {
|
|
102
108
|
DEFAULT: "hsl(var(--warning) / <alpha-value>)",
|
|
103
109
|
foreground: "hsl(var(--warning-foreground) / <alpha-value>)",
|
|
110
|
+
subtle: "hsl(var(--warning-subtle) / <alpha-value>)",
|
|
111
|
+
"subtle-foreground": "hsl(var(--warning-subtle-foreground) / <alpha-value>)",
|
|
104
112
|
},
|
|
105
113
|
caution: {
|
|
106
114
|
DEFAULT: "hsl(var(--caution) / <alpha-value>)",
|
|
@@ -109,6 +117,8 @@ module.exports = {
|
|
|
109
117
|
info: {
|
|
110
118
|
DEFAULT: "hsl(var(--info) / <alpha-value>)",
|
|
111
119
|
foreground: "hsl(var(--info-foreground) / <alpha-value>)",
|
|
120
|
+
subtle: "hsl(var(--info-subtle) / <alpha-value>)",
|
|
121
|
+
"subtle-foreground": "hsl(var(--info-subtle-foreground) / <alpha-value>)",
|
|
112
122
|
},
|
|
113
123
|
card: {
|
|
114
124
|
DEFAULT: "hsl(var(--card) / <alpha-value>)",
|
|
@@ -168,13 +178,13 @@ module.exports = {
|
|
|
168
178
|
"gradient-to-br": "linear-gradient(to bottom right, var(--tw-gradient-stops))",
|
|
169
179
|
"gradient-to-bl": "linear-gradient(to bottom left, var(--tw-gradient-stops))",
|
|
170
180
|
},
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
181
|
+
/* #313/#314/#323: `borderColor` extend'i KALDIRILDI.
|
|
182
|
+
Buradaki DÜZ string değerler, `theme.colors` altındaki İÇ İÇE nesneleri
|
|
183
|
+
`border-*` ailesi için EZİYORDU — o beş isimde yalnız DEFAULT hayatta kalıyor,
|
|
184
|
+
`border-success-subtle-foreground` gibi alt anahtarlar hiç CSS ÜRETMİYORDU.
|
|
185
|
+
(Deterministik Tailwind CLI probe'uyla doğrulandı: destructive bu listede
|
|
186
|
+
olmadığı için çalışıyor, diğer üçü çalışmıyordu.)
|
|
187
|
+
`border-*` sınıfları `theme.colors`tan zaten türer; blok gereksizdi. */
|
|
178
188
|
},
|
|
179
189
|
},
|
|
180
190
|
plugins: [],
|
package/src/use-toast.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// Toast hook - şimdilik basit bir implementasyon
|
|
2
|
-
// Gerçek implementasyonda Toaster component'i ile entegre olacak
|
|
3
|
-
|
|
4
|
-
interface ToastOptions {
|
|
5
|
-
title: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
variant?: 'default' | 'destructive';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function toast(options: ToastOptions) {
|
|
11
|
-
// Şimdilik console'a yazdıralım
|
|
12
|
-
// Gerçek implementasyonda toast notification gösterilecek
|
|
13
|
-
console.log('Toast:', options);
|
|
14
|
-
|
|
15
|
-
// Browser'da alert gösterelim (geçici çözüm)
|
|
16
|
-
if (typeof window !== 'undefined') {
|
|
17
|
-
const message = options.description
|
|
18
|
-
? `${options.title}\n\n${options.description}`
|
|
19
|
-
: options.title;
|
|
20
|
-
|
|
21
|
-
// Variant'a göre stil belirle
|
|
22
|
-
if (options.variant === 'destructive') {
|
|
23
|
-
console.error(message);
|
|
24
|
-
} else {
|
|
25
|
-
console.log(message);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const useToast = () => {
|
|
31
|
-
return { toast };
|
|
32
|
-
};
|