eglador-ui-react 0.1.0-alpha.2 → 0.1.0-alpha.20
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/CLAUDE.md +84 -0
- package/README.md +25 -9
- package/claude/OVERVIEW.md +496 -0
- package/claude/SKILL.md +433 -0
- package/claude/customization.md +244 -0
- package/claude/evals/evals.json +258 -0
- package/claude/rules/carousel.md +240 -0
- package/claude/rules/charts.md +268 -0
- package/claude/rules/composition.md +399 -0
- package/claude/rules/dataTable.md +382 -0
- package/claude/rules/fileManager.md +214 -0
- package/claude/rules/forms.md +306 -0
- package/claude/rules/icons.md +159 -0
- package/claude/rules/imageCropper.md +248 -0
- package/claude/rules/styling.md +179 -0
- package/claude/rules/theme.md +127 -0
- package/dist/index.d.mts +2631 -8
- package/dist/index.d.ts +2631 -8
- package/dist/index.js +10795 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10689 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +63 -6
- package/scripts/update-claude-md.js +102 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@claude/SKILL.md
|
|
2
|
+
# eglador-ui-react Skill Rules
|
|
3
|
+
|
|
4
|
+
Bu projede tüm UI geliştirmeleri "eglador-ui-react" tasarım sistemi üzerine kuruludur.
|
|
5
|
+
Yeni component yazmadan önce mevcut bileşenler kullanılmalı, tasarım sistemi dışına yalnızca zorunlu durumlarda çıkılmalıdır.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Zorunlu Okunacak Dosyalar
|
|
10
|
+
|
|
11
|
+
Her task başlamadan önce aşağıdaki dosyaları mutlaka incele:
|
|
12
|
+
|
|
13
|
+
- "node_modules/eglador-ui-react/CLAUDE.md"
|
|
14
|
+
- "node_modules/eglador-ui-react/claude/SKILL.md"
|
|
15
|
+
|
|
16
|
+
Bu dosyalardaki:
|
|
17
|
+
- component API yapıları
|
|
18
|
+
- variant sistemi
|
|
19
|
+
- spacing kuralları
|
|
20
|
+
- responsive yaklaşım
|
|
21
|
+
- accessibility standartları
|
|
22
|
+
- animation kullanımı
|
|
23
|
+
- theme/token yapısı
|
|
24
|
+
|
|
25
|
+
tam olarak uygulanmalıdır.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
# Ana UI Kuralları
|
|
30
|
+
|
|
31
|
+
## 1. Önce Var Olan Componentleri Kullan
|
|
32
|
+
|
|
33
|
+
Yeni UI geliştirirken sıralama:
|
|
34
|
+
|
|
35
|
+
1. Önce "eglador-ui-react" içinde hazır component var mı kontrol et
|
|
36
|
+
2. Varsa doğrudan onu kullan
|
|
37
|
+
3. Yoksa compose ederek çöz
|
|
38
|
+
4. En son custom component oluştur
|
|
39
|
+
|
|
40
|
+
Asla gereksiz:
|
|
41
|
+
- custom button
|
|
42
|
+
- custom modal
|
|
43
|
+
- custom input
|
|
44
|
+
- custom card
|
|
45
|
+
- custom dropdown
|
|
46
|
+
oluşturma.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
# Component Öncelik Sistemi
|
|
51
|
+
|
|
52
|
+
Tercih sırası:
|
|
53
|
+
|
|
54
|
+
1. "eglador-ui-react"
|
|
55
|
+
2. mevcut proje componentleri
|
|
56
|
+
3. compose edilmiş wrapper
|
|
57
|
+
4. custom implementation
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
# Yasaklar
|
|
62
|
+
|
|
63
|
+
## Bunları Yapma
|
|
64
|
+
|
|
65
|
+
- inline style kullanma
|
|
66
|
+
- hardcoded color kullanma
|
|
67
|
+
- rastgele spacing verme
|
|
68
|
+
- magic number kullanma
|
|
69
|
+
- tailwind ile component override etme
|
|
70
|
+
- existing component yerine duplicate component yazma
|
|
71
|
+
- custom animation yazmadan önce library animationlarını kontrol etmeden ilerleme
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
# Design Token Kuralları
|
|
76
|
+
|
|
77
|
+
## Renkler
|
|
78
|
+
|
|
79
|
+
Sadece design token kullan:
|
|
80
|
+
|
|
81
|
+
KÖTÜ:
|
|
82
|
+
```tsx
|
|
83
|
+
className="bg-blue-500 text-white"
|
|
84
|
+
```
|
package/README.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# eglador-ui-react
|
|
4
4
|
|
|
5
|
+
[](https://www.npmjs.com/package/eglador-ui-react)
|
|
6
|
+
[](https://www.npmjs.com/package/eglador-ui-react)
|
|
7
|
+
[](https://github.com/kenangundogan/eglador-ui-react/blob/main/LICENSE)
|
|
8
|
+

|
|
9
|
+

|
|
10
|
+

|
|
11
|
+
|
|
5
12
|
A lightweight, reusable UI component library built with **Tailwind CSS v4** for React-based projects.
|
|
6
13
|
|
|
7
14
|
## Installation
|
|
@@ -12,6 +19,8 @@ npm install eglador-ui-react
|
|
|
12
19
|
|
|
13
20
|
**Peer dependencies:** `react >= 18` | `react-dom >= 18` | `tailwindcss ^4`
|
|
14
21
|
|
|
22
|
+
**Optional (for Carousel):** `embla-carousel ^8` | `embla-carousel-react ^8` | plugin packages as needed (`embla-carousel-autoplay`, `embla-carousel-fade`, etc.)
|
|
23
|
+
|
|
15
24
|
## Setup
|
|
16
25
|
|
|
17
26
|
Add the following to your global stylesheet (e.g. `app/globals.css`) so Tailwind can detect the component classes:
|
|
@@ -24,15 +33,21 @@ Add the following to your global stylesheet (e.g. `app/globals.css`) so Tailwind
|
|
|
24
33
|
## Usage
|
|
25
34
|
|
|
26
35
|
```tsx
|
|
27
|
-
import { Button,
|
|
36
|
+
import { Button, Input, Modal } from "eglador-ui-react";
|
|
28
37
|
```
|
|
29
38
|
|
|
30
39
|
## Components
|
|
31
40
|
|
|
32
|
-
|
|
|
33
|
-
|
|
34
|
-
| **
|
|
35
|
-
| **
|
|
41
|
+
| Category | Components |
|
|
42
|
+
|----------|-----------|
|
|
43
|
+
| **Actions** | Button, ButtonGroup, Link, SpeedDial |
|
|
44
|
+
| **Forms** | Input, InputGroup, InputOTP, Calendar, DatePicker, DateTimePicker, Textarea, Select, NativeSelect, MultiSelect, Checkbox, CheckboxGroup, Radio, RadioGroup, Switch, Label |
|
|
45
|
+
| **Feedback** | Alert, Notification, Toast, Progress, Spinner, Skeleton |
|
|
46
|
+
| **Navigation** | NavigationMenu, Menubar, Pagination, Stepper, Breadcrumb |
|
|
47
|
+
| **Data Display** | DataTable, Table, Accordion, Tabs, TreeView, Badge, Avatar, Empty, Kbd, Tooltip, Typography, Typewriter |
|
|
48
|
+
| **Overlays** | Dialog, Drawer, Dropdown, Popover, HoverCard, AlertDialog, ContextMenu, Command |
|
|
49
|
+
| **Layout** | Sidebar, Separator, Collapsible, AspectRatio, ScrollArea, Resizable |
|
|
50
|
+
| **Media** | MediaImage, MediaVideo, Carousel |
|
|
36
51
|
|
|
37
52
|
## Development
|
|
38
53
|
|
|
@@ -46,10 +61,11 @@ npm run typecheck # run typescript type checking
|
|
|
46
61
|
|
|
47
62
|
## Publishing
|
|
48
63
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
64
|
+
Publishing is automated via GitHub Actions. When a GitHub Release is created, the package is automatically published to npm.
|
|
65
|
+
|
|
66
|
+
1. Update `version` in `package.json`
|
|
67
|
+
2. Commit and push
|
|
68
|
+
3. Create a GitHub Release with a matching tag (e.g. `v0.1.0-alpha.20`)
|
|
53
69
|
|
|
54
70
|
## Compatibility
|
|
55
71
|
|
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
# Eglador Skill — Kapsamlı Genel Bakış
|
|
2
|
+
|
|
3
|
+
Bu klasör, `eglador-ui-react` bileşen kütüphanesiyle çalışan projelerde AI agent'ların (Antigravity vb.) doğru kod üretmesini sağlayan bir **skill (beceri) paketidir**. Skill okununca agent, kütüphaneyi derin şekilde öğrenmiş bir geliştirici gibi davranır.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Neden Var? — Skill Olmadan Ne Olur?
|
|
8
|
+
|
|
9
|
+
`eglador-ui-react` kendi composition API'sine, kendi ikon sistemine ve kendi stil mantığına sahip bir kütüphanedir. Herhangi bir AI agent bu kütüphaneyi doğrudan tanımaz. Skill olmadan agent şu hataları yapar:
|
|
10
|
+
|
|
11
|
+
### ❌ Hata 1 — Yanlış Composition API Kullanımı
|
|
12
|
+
|
|
13
|
+
Agent, `Table` bileşenini Radix/shadcn tarzı sub-component export'ları olduğunu varsayarak şunu yazar:
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
// ❌ Bu import'lar YOKTUR — runtime'da hata verir
|
|
17
|
+
import { TableHead, TableBody, TableRow, TableCell } from "eglador-ui-react"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Oysa doğrusu:
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
// ✅ Sub-component'ler parent üzerinden nokta notasyonuyla erişilir
|
|
24
|
+
import { Table } from "eglador-ui-react"
|
|
25
|
+
|
|
26
|
+
<Table variant="striped">
|
|
27
|
+
<Table.Head>
|
|
28
|
+
<Table.Row>
|
|
29
|
+
<Table.Header>Ürün</Table.Header>
|
|
30
|
+
<Table.Header align="right">Fiyat</Table.Header>
|
|
31
|
+
</Table.Row>
|
|
32
|
+
</Table.Head>
|
|
33
|
+
<Table.Body>
|
|
34
|
+
<Table.Row>
|
|
35
|
+
<Table.Cell>Laptop</Table.Cell>
|
|
36
|
+
<Table.Cell align="right">₺24.999</Table.Cell>
|
|
37
|
+
</Table.Row>
|
|
38
|
+
</Table.Body>
|
|
39
|
+
</Table>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
### ❌ Hata 2 — Tekil Bileşene Alt Bileşen Yazmak
|
|
45
|
+
|
|
46
|
+
Bileşenin `Select` olduğunu bilen agent, Radix Select alışkanlığıyla şunu yazar:
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
// ❌ Select'in .Trigger, .Content, .Item alt bileşenleri YOKTUR
|
|
50
|
+
<Select>
|
|
51
|
+
<Select.Trigger placeholder="Ülke seç..." />
|
|
52
|
+
<Select.Content>
|
|
53
|
+
<Select.Group>
|
|
54
|
+
<Select.Item value="tr">Türkiye</Select.Item>
|
|
55
|
+
</Select.Group>
|
|
56
|
+
</Select.Content>
|
|
57
|
+
</Select>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Oysa `Select` tekil bir bileşendir:
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
// ✅ Doğru — options prop'uyla çalışır
|
|
64
|
+
<Select
|
|
65
|
+
value={value}
|
|
66
|
+
onChange={(val) => setValue(val)}
|
|
67
|
+
options={[
|
|
68
|
+
{ label: "Türkiye", value: "tr" },
|
|
69
|
+
{ label: "Almanya", value: "de" },
|
|
70
|
+
{ label: "Fransa", value: "fr" },
|
|
71
|
+
]}
|
|
72
|
+
placeholder="Ülke seç..."
|
|
73
|
+
/>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Aynı sorun şu bileşenlerde de olur: `Alert`, `Empty`, `Accordion`, `Badge`, `MultiSelect`, `InputOTP`, `Skeleton`, `Separator`, `Spinner`, `Progress`, `Tooltip` vb.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
### ❌ Hata 3 — Dış İkon Kütüphanesi Import Etmek
|
|
81
|
+
|
|
82
|
+
Agent, `lucide-react` veya `@tabler/icons-react` kullandığını varsayarak:
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
// ❌ Yanlış — dış kütüphane
|
|
86
|
+
import { Search, Trash2, ChevronDown } from "lucide-react"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Bu kütüphanede tüm ikonlar **`eglador-ui-react`'tan** gelir ve **`Icon` sufixiyle** biter:
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
// ✅ Doğru — dahili ikon sistemi (40+ ikon)
|
|
93
|
+
import { SearchIcon, TrashIcon, ChevronDownIcon } from "eglador-ui-react"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Ayrıca agent yanlışlıkla sufixsiz isimler kullanabilir:
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
// ❌ Bu isimler YOKTUR
|
|
100
|
+
import { Search, Trash, ChevronDown, X, Check, Warning } from "eglador-ui-react"
|
|
101
|
+
|
|
102
|
+
// ✅ Doğru isimler
|
|
103
|
+
import { SearchIcon, TrashIcon, ChevronDownIcon, XIcon, CheckIcon, WarningIcon } from "eglador-ui-react"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### ❌ Hata 4 — Grafiğe `<Chart type="...">` Yazmak
|
|
109
|
+
|
|
110
|
+
Agent, kütüphanede tek bir `Chart` bileşeni olduğunu varsayarak:
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
// ❌ Chart diye tek bir bileşen YOKTUR
|
|
114
|
+
import { Chart } from "eglador-ui-react"
|
|
115
|
+
<Chart type="bar" data={salesData} />
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Her grafik türü **ayrı** bileşendir:
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
// ✅ Doğru
|
|
122
|
+
import { BarChart, LineChart, AreaChart, PieChart } from "eglador-ui-react"
|
|
123
|
+
|
|
124
|
+
<BarChart
|
|
125
|
+
data={[
|
|
126
|
+
{ ay: "Oca", gelir: 4000, gider: 2400 },
|
|
127
|
+
{ ay: "Şub", gelir: 3000, gider: 1398 },
|
|
128
|
+
]}
|
|
129
|
+
series={[
|
|
130
|
+
{ dataKey: "gelir", name: "Gelir", color: "#3b82f6" },
|
|
131
|
+
{ dataKey: "gider", name: "Gider", color: "#ef4444" },
|
|
132
|
+
]}
|
|
133
|
+
xAxis={{ dataKey: "ay" }}
|
|
134
|
+
height={300}
|
|
135
|
+
legend
|
|
136
|
+
/>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Ayrıca Recharts'ı doğrudan import etmek de hatalıdır:
|
|
140
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
// ❌ Recharts doğrudan import etme
|
|
143
|
+
import { BarChart, Bar, XAxis, YAxis, Tooltip } from "recharts"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
### ❌ Hata 5 — `className` ile Renk Override Yazmak
|
|
149
|
+
|
|
150
|
+
Agent, bileşenin rengini `className` ile değiştirmeye çalışır:
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
// ❌ Yanlış — renk override
|
|
154
|
+
<Button className="bg-blue-500 text-white hover:bg-blue-600">Kaydet</Button>
|
|
155
|
+
<Badge className="rounded-full bg-green-100 text-green-800 text-xs">Aktif</Badge>
|
|
156
|
+
<Alert className="bg-yellow-50 border border-yellow-200 text-yellow-800">Dikkat!</Alert>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Bu kütüphanede renkler `variant` ve `color` prop'larıyla yönetilir:
|
|
160
|
+
|
|
161
|
+
```tsx
|
|
162
|
+
// ✅ Doğru
|
|
163
|
+
<Button variant="solid" color="primary">Kaydet</Button>
|
|
164
|
+
<Badge variant="soft" color="success" shape="pill">Aktif</Badge>
|
|
165
|
+
<Alert color="warning" title="Dikkat!">Açıklama metni</Alert>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
`className` yalnızca **layout** için kullanılır: `max-w-xl`, `mx-auto`, `mt-4`, `w-full` gibi.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### ❌ Hata 6 — `space-y-*` ile Boşluk Vermek
|
|
173
|
+
|
|
174
|
+
Agent, dikey boşluk için Tailwind'in eski utility'sini kullanır:
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
// ❌ Yanlış
|
|
178
|
+
<div className="space-y-4">
|
|
179
|
+
<Input placeholder="Ad" />
|
|
180
|
+
<Input placeholder="Soyad" />
|
|
181
|
+
</div>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Bu kütüphanede `flex` + `gap-*` tercih edilir:
|
|
185
|
+
|
|
186
|
+
```tsx
|
|
187
|
+
// ✅ Doğru
|
|
188
|
+
<div className="flex flex-col gap-4">
|
|
189
|
+
<Input placeholder="Ad" />
|
|
190
|
+
<Input placeholder="Soyad" />
|
|
191
|
+
</div>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
### ❌ Hata 7 — Input Üzerinde Absolute Positioned İkon Yazmak
|
|
197
|
+
|
|
198
|
+
Agent, arama ikonu olan bir input için wrapper div + absolute positioning yazar:
|
|
199
|
+
|
|
200
|
+
```tsx
|
|
201
|
+
// ❌ Yanlış — gereksiz wrapper
|
|
202
|
+
<div className="relative">
|
|
203
|
+
<SearchIcon className="absolute left-3 top-1/2 -translate-y-1/2 size-4 text-gray-400" />
|
|
204
|
+
<input className="pl-10 border rounded-md" placeholder="Ara..." />
|
|
205
|
+
</div>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
`Input` bileşeni `icon` ve `iconRight` prop'larına sahiptir:
|
|
209
|
+
|
|
210
|
+
```tsx
|
|
211
|
+
// ✅ Doğru
|
|
212
|
+
<Input placeholder="Ara..." icon={<SearchIcon />} />
|
|
213
|
+
<Input placeholder="Şifre" type="password" iconRight={<XIcon />} />
|
|
214
|
+
<Input state="error" errorMessage="Geçersiz e-posta" />
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
### ❌ Hata 8 — `Button` İçine Manuel `Spinner` Koymak
|
|
220
|
+
|
|
221
|
+
Agent, butonun yükleme durumu için Spinner bileşenini compose eder:
|
|
222
|
+
|
|
223
|
+
```tsx
|
|
224
|
+
// ❌ Yanlış — Spinner gereksiz
|
|
225
|
+
<Button disabled>
|
|
226
|
+
<Spinner className="size-4 mr-2" />
|
|
227
|
+
Kaydediliyor...
|
|
228
|
+
</Button>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
`Button` bileşeni dahili `loading` prop'una sahiptir:
|
|
232
|
+
|
|
233
|
+
```tsx
|
|
234
|
+
// ✅ Doğru — loading prop'u butonu otomatik devre dışı bırakır ve spinner gösterir
|
|
235
|
+
<Button loading color="primary">Kaydediliyor...</Button>
|
|
236
|
+
|
|
237
|
+
// Ayrıca: soft renk tonu variant değil, ayrı boolean prop'tur
|
|
238
|
+
<Button soft color="primary">Soft Primary</Button> // ✅
|
|
239
|
+
<Button variant="soft" color="primary">...</Button> // ❌ variant="soft" yoktur
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
### ❌ Hata 9 — Dark Mode için `class="dark"` Eklemek
|
|
245
|
+
|
|
246
|
+
Agent, `next-themes` veya manuel dark mode için class tabanlı geçiş uygular:
|
|
247
|
+
|
|
248
|
+
```tsx
|
|
249
|
+
// ❌ Yanlış — class tabanlı geçiş eglador ile uyumsuz
|
|
250
|
+
<ThemeProvider attribute="class">
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
```tsx
|
|
254
|
+
// ❌ Yanlış — className toggle
|
|
255
|
+
document.documentElement.classList.toggle("dark")
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Bu kütüphane **`data-theme` attribute** tabanlıdır:
|
|
259
|
+
|
|
260
|
+
```tsx
|
|
261
|
+
// ✅ Doğru — next-themes ile
|
|
262
|
+
<ThemeProvider attribute="data-theme" defaultTheme="system" enableSystem>
|
|
263
|
+
|
|
264
|
+
// ✅ Doğru — manuel toggle
|
|
265
|
+
import { toggleTheme, setTheme } from "eglador-ui-react"
|
|
266
|
+
|
|
267
|
+
toggleTheme() // dark ↔ light geçişi
|
|
268
|
+
setTheme("dark") // direkt set etme
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
### ❌ Hata 10 — `AlertDialog.Title` Sub-component'i Kullanmak
|
|
274
|
+
|
|
275
|
+
Agent, Dialog ile AlertDialog'u karıştırır ve olmayan sub-component yazar:
|
|
276
|
+
|
|
277
|
+
```tsx
|
|
278
|
+
// ❌ AlertDialog.Title YOKTUR
|
|
279
|
+
<AlertDialog.Content>
|
|
280
|
+
<AlertDialog.Header>
|
|
281
|
+
<AlertDialog.Title>Silmek istediğine emin misin?</AlertDialog.Title>
|
|
282
|
+
</AlertDialog.Header>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
`AlertDialog.Header` içine **doğrudan metin** yazılır, `icon` prop'u ayrıca verilir:
|
|
286
|
+
|
|
287
|
+
```tsx
|
|
288
|
+
// ✅ Doğru
|
|
289
|
+
<AlertDialog color="danger">
|
|
290
|
+
<AlertDialog.Trigger asChild>
|
|
291
|
+
<Button color="danger">Sil</Button>
|
|
292
|
+
</AlertDialog.Trigger>
|
|
293
|
+
<AlertDialog.Content>
|
|
294
|
+
<AlertDialog.Header icon={<TrashIcon />}>
|
|
295
|
+
Bu kaydı silmek istediğine emin misin?
|
|
296
|
+
</AlertDialog.Header>
|
|
297
|
+
<AlertDialog.Description>
|
|
298
|
+
Bu işlem geri alınamaz.
|
|
299
|
+
</AlertDialog.Description>
|
|
300
|
+
<AlertDialog.Footer>
|
|
301
|
+
<AlertDialog.Cancel asChild>
|
|
302
|
+
<Button variant="outline">İptal</Button>
|
|
303
|
+
</AlertDialog.Cancel>
|
|
304
|
+
<AlertDialog.Action asChild>
|
|
305
|
+
<Button color="danger">Evet, Sil</Button>
|
|
306
|
+
</AlertDialog.Action>
|
|
307
|
+
</AlertDialog.Footer>
|
|
308
|
+
</AlertDialog.Content>
|
|
309
|
+
</AlertDialog>
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
### ❌ Hata 11 — `Command.Item`'ı Grupsuz Kullanmak
|
|
315
|
+
|
|
316
|
+
Agent, `Command.Item`'ı direkt `Command.List` içine koyar:
|
|
317
|
+
|
|
318
|
+
```tsx
|
|
319
|
+
// ❌ Yanlış — Command.Item her zaman Command.Group içinde olmalı
|
|
320
|
+
<Command.List>
|
|
321
|
+
<Command.Item onSelect={() => {}}>Profil</Command.Item>
|
|
322
|
+
<Command.Item onSelect={() => {}}>Ayarlar</Command.Item>
|
|
323
|
+
</Command.List>
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
Doğrusu:
|
|
327
|
+
|
|
328
|
+
```tsx
|
|
329
|
+
// ✅ Doğru
|
|
330
|
+
<Command.List>
|
|
331
|
+
<Command.Group heading="Sayfalar">
|
|
332
|
+
<Command.Item icon={<UserIcon />} shortcut="⌘P" onSelect={() => navigate("/profil")}>
|
|
333
|
+
Profil
|
|
334
|
+
</Command.Item>
|
|
335
|
+
</Command.Group>
|
|
336
|
+
<Command.Separator />
|
|
337
|
+
<Command.Group heading="Aksiyonlar">
|
|
338
|
+
<Command.Item icon={<SearchIcon />} onSelect={handleSearch}>
|
|
339
|
+
Gelişmiş Arama
|
|
340
|
+
</Command.Item>
|
|
341
|
+
</Command.Group>
|
|
342
|
+
<Command.Empty>Sonuç bulunamadı.</Command.Empty>
|
|
343
|
+
</Command.List>
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
### ❌ Hata 12 — `InputGroup` İçine `InputGroup.Input` Yazmak
|
|
349
|
+
|
|
350
|
+
Agent, `InputGroup` için olmayan bir sub-component kullanır:
|
|
351
|
+
|
|
352
|
+
```tsx
|
|
353
|
+
// ❌ InputGroup.Input diye bir bileşen YOKTUR
|
|
354
|
+
<InputGroup>
|
|
355
|
+
<InputGroup.Input placeholder="alan-adi" />
|
|
356
|
+
</InputGroup>
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Raw `Input` doğrudan `InputGroup` içine konur:
|
|
360
|
+
|
|
361
|
+
```tsx
|
|
362
|
+
// ✅ Doğru — Text (statik metin) ve Addon (buton/aksiyon)
|
|
363
|
+
<InputGroup>
|
|
364
|
+
<InputGroup.Text>https://</InputGroup.Text>
|
|
365
|
+
<Input placeholder="alan-adi" />
|
|
366
|
+
<InputGroup.Addon>
|
|
367
|
+
<Button color="primary">Kaydet</Button>
|
|
368
|
+
</InputGroup.Addon>
|
|
369
|
+
</InputGroup>
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## Skill'in Kapsamı — Hangi Konuları Yönetir?
|
|
375
|
+
|
|
376
|
+
| Kural Dosyası | Kapsam |
|
|
377
|
+
|---------------|--------|
|
|
378
|
+
| `SKILL.md` | Ana talimat — tüm kuralların özeti, composition haritası, bileşen seçim tablosu |
|
|
379
|
+
| `rules/composition.md` | Hangi bileşen composition API kullanır, tekil bileşen kuralları, Dialog/AlertDialog/Tabs/Command örnekleri |
|
|
380
|
+
| `rules/forms.md` | Input, InputGroup, Select, MultiSelect, NativeSelect, Checkbox, Radio, Switch, DatePicker, OTP, validation |
|
|
381
|
+
| `rules/styling.md` | `className` sadece layout, `variant`+`color` kullan, `space-y-*` yasak, `size-*`, `cn()`, dark mode override yasağı |
|
|
382
|
+
| `rules/icons.md` | 40+ dahili ikon listesi, `Icon` sufixi zorunluluğu, `icon`/`iconRight` prop kullanımı, `strokeWidth` |
|
|
383
|
+
| `rules/charts.md` | `LineChart`/`BarChart`/`AreaChart`/`PieChart`/`DonutChart`/`RadarChart`/`RadialChart` props, `series`, eksen ayarları |
|
|
384
|
+
| `rules/carousel.md` | `Carousel` props, `loop`, `autoplay`, `showNavigation`, `showPagination`, responsive |
|
|
385
|
+
| `rules/fileManager.md` | `FileManager` sub-component'leri, `FileManagerItem` tipi, `defaultView`, callback'ler |
|
|
386
|
+
| `rules/theme.md` | `toggleTheme()`, `setTheme()`, `data-theme` attribute, next-themes entegrasyonu |
|
|
387
|
+
| `customization.md` | Tailwind v4 `light-dark()` sistemi, özel token ekleme (`@theme inline`), dark mode, wrapper bileşen pattern |
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## Klasör Yapısı
|
|
392
|
+
|
|
393
|
+
```
|
|
394
|
+
.agents/skills/eglador/
|
|
395
|
+
├── SKILL.md # Agent'ın okuduğu ana talimat (430 satır)
|
|
396
|
+
├── OVERVIEW.md # Bu dosya — geliştirici odaklı özet
|
|
397
|
+
├── customization.md # Tailwind v4 light-dark() sistemi, özel token ekleme
|
|
398
|
+
├── agents/
|
|
399
|
+
│ └── openai.yml # Agent konfigürasyonu
|
|
400
|
+
├── assets/
|
|
401
|
+
│ ├── eglador.png
|
|
402
|
+
│ └── eglador-small.png
|
|
403
|
+
├── evals/
|
|
404
|
+
│ └── evals.json # 18 adet gerçek test senaryosu
|
|
405
|
+
└── rules/
|
|
406
|
+
├── styling.md
|
|
407
|
+
├── composition.md
|
|
408
|
+
├── forms.md
|
|
409
|
+
├── icons.md
|
|
410
|
+
├── charts.md
|
|
411
|
+
├── carousel.md
|
|
412
|
+
├── fileManager.md
|
|
413
|
+
└── theme.md
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## Evals — Skill Nasıl Test Edilir?
|
|
419
|
+
|
|
420
|
+
`evals/evals.json` dosyası, skill'in ne kadar doğru çalıştığını ölçen **18 test senaryosu** içerir. Her senaryo şunlardan oluşur:
|
|
421
|
+
|
|
422
|
+
- **`prompt`** — Agent'a verilen gerçekçi görev
|
|
423
|
+
- **`expected_output`** — Beklenen çıktının özeti
|
|
424
|
+
- **`expectations`** — Kontrol edilecek somut kurallar listesi
|
|
425
|
+
|
|
426
|
+
### Örnek Eval Senaryoları
|
|
427
|
+
|
|
428
|
+
**Senaryo #1 — Kullanıcı Kayıt Formu:**
|
|
429
|
+
> *"Ad, e-posta ve şifre alanları olsun. E-posta hatalıysa kırmızı kenarlık ve hata mesajı göstersin. Arama ikonu olan input da olsun."*
|
|
430
|
+
|
|
431
|
+
Beklenenler:
|
|
432
|
+
- `state="error"` prop'u kullanılır, `className="border-red-500"` yazılmaz
|
|
433
|
+
- `icon={<SearchIcon />}` prop'u kullanılır, absolute positioned wrapper yapılmaz
|
|
434
|
+
- `SearchIcon` `eglador-ui-react`'tan import edilir, `lucide-react`'tan değil
|
|
435
|
+
- `gap-*` ile dikey boşluk verilir, `space-y-*` kullanılmaz
|
|
436
|
+
|
|
437
|
+
**Senaryo #5 — Bar Grafik:**
|
|
438
|
+
> *"Ocak-Haziran arası aylık gelir-gider bar grafiği. Gelir mavi, gider kırmızı. Tooltip ve legend olsun."*
|
|
439
|
+
|
|
440
|
+
Beklenenler:
|
|
441
|
+
- `BarChart` `eglador-ui-react`'tan import edilir, `Chart` diye tekil bileşen kullanılmaz
|
|
442
|
+
- Recharts doğrudan import edilmez
|
|
443
|
+
- `series=[{ dataKey: "gelir", color: "#3b82f6" }]` formatı kullanılır
|
|
444
|
+
- `CHART_SEMANTIC_COLORS` ile renk verilebilir
|
|
445
|
+
|
|
446
|
+
**Senaryo #10 — Loading Butonu:**
|
|
447
|
+
> *"Butona tıklandığında loading state'e geçsin. Soft primary renkte olsun."*
|
|
448
|
+
|
|
449
|
+
Beklenenler:
|
|
450
|
+
- `loading={isLoading}` prop'u kullanılır, içine `<Spinner />` konmaz
|
|
451
|
+
- `soft` boolean prop'u kullanılır, `variant="soft"` yazılmaz
|
|
452
|
+
- `loading` otomatik devre dışı bıraktığı için ayrıca `disabled` yazılmaz
|
|
453
|
+
|
|
454
|
+
**Senaryo #11 — Tema Toggle:**
|
|
455
|
+
> *"Dark/light tema arası geçiş. Tercih localStorage'a kaydedilsin."*
|
|
456
|
+
|
|
457
|
+
Beklenenler:
|
|
458
|
+
- `toggleTheme()` `eglador-ui-react`'tan import edilir
|
|
459
|
+
- `data-theme` attribute kullanılır, `class="dark"` eklenmez
|
|
460
|
+
- `next-themes` varsa `attribute="data-theme"` kullanılır, `attribute="class"` değil
|
|
461
|
+
|
|
462
|
+
---
|
|
463
|
+
|
|
464
|
+
## Skill Ne Zaman Devreye Girer?
|
|
465
|
+
|
|
466
|
+
Agent şu durumlarda bu skill'i otomatik okur:
|
|
467
|
+
|
|
468
|
+
1. Projede `eglador-ui-react` import'u olan bir dosya açıldığında
|
|
469
|
+
2. "eglador bileşeni oluştur", "eglador ile düzelt", "eglador'da stilize et" gibi bir istek geldiğinde
|
|
470
|
+
3. `Table`, `Dialog`, `AlertDialog`, `Select`, `Alert`, `Accordion`, `Empty` gibi kütüphane bileşenlerinde hata çözülürken
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
|
|
474
|
+
## Kısa Başvuru — En Çok Karıştırılan Kurallar
|
|
475
|
+
|
|
476
|
+
| Konu | Kural |
|
|
477
|
+
|------|-------|
|
|
478
|
+
| **Sub-component import** | `Table.Head` kullan, `TableHead` import etme |
|
|
479
|
+
| **Select** | `options` prop'u ile çalışır, `.Trigger/.Item` sub-component'i yoktur |
|
|
480
|
+
| **Alert** | `title` prop'u kullan, `<Alert.Title>` sub-component'i yoktur |
|
|
481
|
+
| **Accordion** | `title` prop'u zorunlu, `<Accordion.Item>` yoktur |
|
|
482
|
+
| **Empty** | `icon`, `title`, `description`, `action` prop'ları ile çalışır |
|
|
483
|
+
| **Button loading** | `loading` prop'u; `Spinner` compose etme, `variant="soft"` yok, `soft` boolean |
|
|
484
|
+
| **İkon import** | `SearchIcon` — sufixsiz `Search` değil, `lucide-react` değil |
|
|
485
|
+
| **AlertDialog başlık** | `<AlertDialog.Header>` içine direkt metin yaz, `.Title` sub-component'i yok |
|
|
486
|
+
| **Command.Item** | Her zaman `Command.Group` içinde olmalı |
|
|
487
|
+
| **InputGroup input** | Raw `<Input>` koy, `<InputGroup.Input>` diye sub-component yok |
|
|
488
|
+
| **Grafik** | `BarChart`/`LineChart` vb., `Chart type="..."` değil, Recharts import etme |
|
|
489
|
+
| **Dark mode** | `toggleTheme()` / `setTheme()` kullan; `data-theme` attribute, `class="dark"` veya `classList.toggle("dark")` değil |
|
|
490
|
+
| **Tema bileşeni** | `Theme` adında React bileşeni yoktur — `toggleTheme()` ve `setTheme()` utility fonksiyonları kullan |
|
|
491
|
+
| **next-themes** | `attribute="data-theme"`, `attribute="class"` değil |
|
|
492
|
+
| **Renk** | `variant`+`color` prop'u, className ile `bg-*` değil |
|
|
493
|
+
| **Boşluk** | `flex gap-4`, `space-y-4` değil |
|
|
494
|
+
| **Eşit boyut** | `size-10`, `w-10 h-10` değil |
|
|
495
|
+
| **Koşullu sınıf** | `cn()` kullan, template literal ternary yazma |
|
|
496
|
+
| **Overlay z-index** | Dialog, Drawer, Dropdown kendi z-index'ini yönetir, manuel ekleme |
|