@turk.net/mui 3.0.7 → 3.0.8
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/.opencode/rules/design-compliance.md +119 -0
- package/.opencode/skills/onehub-design-verification/SKILL.md +315 -0
- package/.opencode/skills/turknet-onehub-component-usage/SKILL.md +16 -16
- package/COMPONENT_GLOSSARY.md +500 -0
- package/COMPONENT_MAP.md +567 -0
- package/DESIGN_RULES.md +399 -0
- package/DESIGN_SOURCES.md +198 -0
- package/DESIGN_TOKENS_MAP.md +271 -0
- package/ESLINT_DESIGN_RULES.md +392 -0
- package/LLM_EXAMPLES.md +183 -169
- package/LLM_GUIDELINES.md +192 -192
- package/PAGE_PATTERNS.md +509 -0
- package/SKILL_SETUP.md +237 -200
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/dist/theme/index.js +1 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +1 -0
- package/dist/theme/index.mjs.map +1 -1
- package/package.json +20 -3
- package/scripts/verify-design.js +351 -0
package/LLM_EXAMPLES.md
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
# LLM Examples
|
|
1
|
+
# LLM Examples — Correct vs. Incorrect Usage
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This document demonstrates correct and incorrect usage of Material UI components according to the `@turknet/onehub` theme package rules.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Table of Contents
|
|
8
8
|
|
|
9
|
-
1. [Button
|
|
10
|
-
2. [TextField
|
|
11
|
-
3. [Typography
|
|
9
|
+
1. [Button Component](#button-component)
|
|
10
|
+
2. [TextField Component](#textfield-component)
|
|
11
|
+
3. [Typography Component](#typography-component)
|
|
12
12
|
4. [Select & MenuItem](#select--menuitem)
|
|
13
13
|
5. [Checkbox, Radio, Switch](#checkbox-radio-switch)
|
|
14
14
|
6. [Alert & Snackbar](#alert--snackbar)
|
|
15
|
-
7. [Card
|
|
16
|
-
8. [Dialog
|
|
17
|
-
9. [List
|
|
18
|
-
10. [Table
|
|
15
|
+
7. [Card Component](#card-component)
|
|
16
|
+
8. [Dialog Component](#dialog-component)
|
|
17
|
+
9. [List Component](#list-component)
|
|
18
|
+
10. [Table Component](#table-component)
|
|
19
19
|
11. [Paper & Elevation](#paper--elevation)
|
|
20
20
|
12. [Chip & Badge](#chip--badge)
|
|
21
|
-
13. [
|
|
21
|
+
13. [Common Mistakes](#common-mistakes)
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
-
## Button
|
|
25
|
+
## Button Component
|
|
26
26
|
|
|
27
|
-
### ✅
|
|
27
|
+
### ✅ Correct Usage
|
|
28
28
|
|
|
29
29
|
```tsx
|
|
30
|
-
// ✅
|
|
30
|
+
// ✅ Basic button
|
|
31
31
|
import { Button } from '@mui/material';
|
|
32
32
|
|
|
33
33
|
<Button variant="contained" color="primary" size="medium">
|
|
@@ -44,7 +44,7 @@ import { Button } from '@mui/material';
|
|
|
44
44
|
Sil
|
|
45
45
|
</Button>
|
|
46
46
|
|
|
47
|
-
// ✅ Extra-small button (
|
|
47
|
+
// ✅ Extra-small button (theme-specific)
|
|
48
48
|
<Button variant="contained" color="primary" size="extra-small">
|
|
49
49
|
Kısa
|
|
50
50
|
</Button>
|
|
@@ -54,7 +54,7 @@ import { Button } from '@mui/material';
|
|
|
54
54
|
Büyük
|
|
55
55
|
</Button>
|
|
56
56
|
|
|
57
|
-
// ✅ Button
|
|
57
|
+
// ✅ Button with icon
|
|
58
58
|
import { DeleteIcon } from '@turknet/onehub/icons';
|
|
59
59
|
|
|
60
60
|
<Button
|
|
@@ -86,25 +86,25 @@ import { DeleteIcon } from '@turknet/onehub/icons';
|
|
|
86
86
|
</Button>
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
### ❌
|
|
89
|
+
### ❌ Incorrect Usage
|
|
90
90
|
|
|
91
91
|
```tsx
|
|
92
|
-
// ❌
|
|
92
|
+
// ❌ Undefined variant — You MUST ONLY use: "contained", "outlined", "text"
|
|
93
93
|
<Button variant="gradient" color="primary">
|
|
94
94
|
Gradient Button
|
|
95
95
|
</Button>
|
|
96
96
|
|
|
97
|
-
// ❌
|
|
97
|
+
// ❌ Undefined size — You MUST ONLY use: "extra-small", "small", "medium", "large", "extra-large"
|
|
98
98
|
<Button size="huge">
|
|
99
99
|
Buton
|
|
100
100
|
</Button>
|
|
101
101
|
|
|
102
|
-
// ❌
|
|
102
|
+
// ❌ Undefined color — You MUST ONLY use: "primary", "secondary", "error", "info", "success", "warning"
|
|
103
103
|
<Button color="unknown">
|
|
104
104
|
Buton
|
|
105
105
|
</Button>
|
|
106
106
|
|
|
107
|
-
// ❌ Custom button component
|
|
107
|
+
// ❌ Custom button component — You MUST NEVER write custom button components
|
|
108
108
|
function CustomButton() {
|
|
109
109
|
return (
|
|
110
110
|
<div style={{
|
|
@@ -120,7 +120,7 @@ function CustomButton() {
|
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
// ❌ Inline style override
|
|
123
|
+
// ❌ Inline style override — You MUST NEVER use the `style` prop
|
|
124
124
|
<Button
|
|
125
125
|
variant="contained"
|
|
126
126
|
color="primary"
|
|
@@ -129,7 +129,7 @@ function CustomButton() {
|
|
|
129
129
|
Renkli Buton
|
|
130
130
|
</Button>
|
|
131
131
|
|
|
132
|
-
// ❌ sx
|
|
132
|
+
// ❌ Overriding theme rules with sx — You MUST NEVER override theme styling via `sx`
|
|
133
133
|
<Button
|
|
134
134
|
variant="contained"
|
|
135
135
|
sx={{
|
|
@@ -143,14 +143,14 @@ function CustomButton() {
|
|
|
143
143
|
|
|
144
144
|
---
|
|
145
145
|
|
|
146
|
-
## TextField
|
|
146
|
+
## TextField Component
|
|
147
147
|
|
|
148
|
-
### ✅
|
|
148
|
+
### ✅ Correct Usage
|
|
149
149
|
|
|
150
150
|
```tsx
|
|
151
151
|
import { TextField } from '@mui/material';
|
|
152
152
|
|
|
153
|
-
// ✅
|
|
153
|
+
// ✅ Basic usage
|
|
154
154
|
<TextField
|
|
155
155
|
label="Ad Soyadı"
|
|
156
156
|
variant="outlined"
|
|
@@ -159,7 +159,7 @@ import { TextField } from '@mui/material';
|
|
|
159
159
|
fullWidth
|
|
160
160
|
/>
|
|
161
161
|
|
|
162
|
-
// ✅
|
|
162
|
+
// ✅ With brand color
|
|
163
163
|
<TextField
|
|
164
164
|
label="Email"
|
|
165
165
|
variant="outlined"
|
|
@@ -168,7 +168,7 @@ import { TextField } from '@mui/material';
|
|
|
168
168
|
type="email"
|
|
169
169
|
/>
|
|
170
170
|
|
|
171
|
-
// ✅
|
|
171
|
+
// ✅ Error state
|
|
172
172
|
<TextField
|
|
173
173
|
label="Şifre"
|
|
174
174
|
variant="outlined"
|
|
@@ -179,7 +179,7 @@ import { TextField } from '@mui/material';
|
|
|
179
179
|
helperText="Şifre en az 8 karakter olmalıdır"
|
|
180
180
|
/>
|
|
181
181
|
|
|
182
|
-
// ✅
|
|
182
|
+
// ✅ Helper text (success)
|
|
183
183
|
<TextField
|
|
184
184
|
label="Username"
|
|
185
185
|
variant="outlined"
|
|
@@ -188,7 +188,7 @@ import { TextField } from '@mui/material';
|
|
|
188
188
|
helperText="6-20 karakter arasında"
|
|
189
189
|
/>
|
|
190
190
|
|
|
191
|
-
// ✅
|
|
191
|
+
// ✅ With placeholder
|
|
192
192
|
<TextField
|
|
193
193
|
variant="outlined"
|
|
194
194
|
color="neutral"
|
|
@@ -196,7 +196,7 @@ import { TextField } from '@mui/material';
|
|
|
196
196
|
placeholder="Ara..."
|
|
197
197
|
/>
|
|
198
198
|
|
|
199
|
-
// ✅
|
|
199
|
+
// ✅ With icon/adornment
|
|
200
200
|
import { SearchIcon } from '@turknet/onehub/icons';
|
|
201
201
|
import { InputAdornment } from '@mui/material';
|
|
202
202
|
|
|
@@ -236,30 +236,30 @@ import { InputAdornment } from '@mui/material';
|
|
|
236
236
|
/>
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
-
### ❌
|
|
239
|
+
### ❌ Incorrect Usage
|
|
240
240
|
|
|
241
241
|
```tsx
|
|
242
|
-
// ❌ color prop
|
|
242
|
+
// ❌ Missing `color` prop — You MUST always provide a color prop. Use "neutral" or "brand".
|
|
243
243
|
<TextField
|
|
244
244
|
label="Ad"
|
|
245
245
|
variant="outlined"
|
|
246
246
|
/>
|
|
247
|
-
// ✅
|
|
247
|
+
// ✅ CORRECT: color="neutral" or color="brand"
|
|
248
248
|
|
|
249
|
-
// ❌
|
|
249
|
+
// ❌ Undefined color — You MUST ONLY use: "neutral", "brand", "danger", "success"
|
|
250
250
|
<TextField
|
|
251
251
|
label="Ad"
|
|
252
252
|
variant="outlined"
|
|
253
253
|
color="unknown"
|
|
254
254
|
/>
|
|
255
255
|
|
|
256
|
-
// ❌
|
|
256
|
+
// ❌ Undefined variant — You MUST ONLY use: "outlined", "filled", "standard"
|
|
257
257
|
<TextField
|
|
258
258
|
label="Ad"
|
|
259
259
|
variant="gradient"
|
|
260
260
|
/>
|
|
261
261
|
|
|
262
|
-
// ❌ Custom input component
|
|
262
|
+
// ❌ Custom input component — You MUST NEVER write custom input components
|
|
263
263
|
function CustomInput() {
|
|
264
264
|
return (
|
|
265
265
|
<input
|
|
@@ -273,13 +273,13 @@ function CustomInput() {
|
|
|
273
273
|
);
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
// ❌ Inline style
|
|
276
|
+
// ❌ Inline style — You MUST NEVER use the `style` prop
|
|
277
277
|
<TextField
|
|
278
278
|
label="Ad"
|
|
279
279
|
style={{backgroundColor: '#f0f0f0'}}
|
|
280
280
|
/>
|
|
281
281
|
|
|
282
|
-
// ❌ HTML input
|
|
282
|
+
// ❌ HTML input element — You MUST NEVER use raw HTML input elements
|
|
283
283
|
<input
|
|
284
284
|
type="text"
|
|
285
285
|
placeholder="Ad"
|
|
@@ -289,59 +289,59 @@ function CustomInput() {
|
|
|
289
289
|
|
|
290
290
|
---
|
|
291
291
|
|
|
292
|
-
## Typography
|
|
292
|
+
## Typography Component
|
|
293
293
|
|
|
294
|
-
### ✅
|
|
294
|
+
### ✅ Correct Usage
|
|
295
295
|
|
|
296
296
|
```tsx
|
|
297
297
|
import { Typography } from '@mui/material';
|
|
298
298
|
|
|
299
|
-
// ✅
|
|
299
|
+
// ✅ Main heading (top-level page heading)
|
|
300
300
|
<Typography variant="display.lg.bold">
|
|
301
301
|
Sayfanın Başlığı
|
|
302
302
|
</Typography>
|
|
303
303
|
|
|
304
|
-
// ✅
|
|
304
|
+
// ✅ Subheading
|
|
305
305
|
<Typography variant="display.md.semibold">
|
|
306
306
|
Alt Başlık
|
|
307
307
|
</Typography>
|
|
308
308
|
|
|
309
|
-
// ✅
|
|
309
|
+
// ✅ Section heading
|
|
310
310
|
<Typography variant="display.sm.semibold">
|
|
311
311
|
Bölüm Başlığı
|
|
312
312
|
</Typography>
|
|
313
313
|
|
|
314
|
-
// ✅
|
|
314
|
+
// ✅ Body text
|
|
315
315
|
<Typography variant="text.md.regular">
|
|
316
316
|
Gövde metni, açıklamalar, normal içerik
|
|
317
317
|
</Typography>
|
|
318
318
|
|
|
319
|
-
// ✅
|
|
319
|
+
// ✅ Emphasized text (when emphasis is needed)
|
|
320
320
|
<Typography variant="text.md.semibold">
|
|
321
321
|
Önemli metin
|
|
322
322
|
</Typography>
|
|
323
323
|
|
|
324
|
-
// ✅
|
|
324
|
+
// ✅ Strong emphasis
|
|
325
325
|
<Typography variant="text.md.bold">
|
|
326
326
|
Çok Önemli Metin
|
|
327
327
|
</Typography>
|
|
328
328
|
|
|
329
|
-
// ✅
|
|
329
|
+
// ✅ Small helper text
|
|
330
330
|
<Typography variant="text.sm.regular">
|
|
331
331
|
Yardımcı bilgi, açıklama
|
|
332
332
|
</Typography>
|
|
333
333
|
|
|
334
|
-
// ✅
|
|
334
|
+
// ✅ Extra-small text
|
|
335
335
|
<Typography variant="text.xs.regular">
|
|
336
336
|
Footer metin, bildiri
|
|
337
337
|
</Typography>
|
|
338
338
|
|
|
339
|
-
// ✅
|
|
339
|
+
// ✅ Single-line truncation
|
|
340
340
|
<Typography variant="text.md.regular" noWrap>
|
|
341
341
|
Çok uzun metin tek satırda kısaltılır...
|
|
342
342
|
</Typography>
|
|
343
343
|
|
|
344
|
-
// ✅
|
|
344
|
+
// ✅ Multi-line truncation
|
|
345
345
|
<Typography
|
|
346
346
|
variant="text.md.regular"
|
|
347
347
|
sx={{
|
|
@@ -355,38 +355,38 @@ import { Typography } from '@mui/material';
|
|
|
355
355
|
</Typography>
|
|
356
356
|
```
|
|
357
357
|
|
|
358
|
-
### ❌
|
|
358
|
+
### ❌ Incorrect Usage
|
|
359
359
|
|
|
360
360
|
```tsx
|
|
361
|
-
// ❌ Material UI
|
|
361
|
+
// ❌ Material UI default variants — You MUST NEVER use default MUI variants. Use theme-specific variants ONLY.
|
|
362
362
|
<Typography variant="h1">
|
|
363
363
|
Başlık
|
|
364
364
|
</Typography>
|
|
365
|
-
// ✅
|
|
365
|
+
// ✅ CORRECT: variant="display.lg.bold"
|
|
366
366
|
|
|
367
367
|
<Typography variant="body1">
|
|
368
368
|
Metin
|
|
369
369
|
</Typography>
|
|
370
|
-
// ✅
|
|
370
|
+
// ✅ CORRECT: variant="text.md.regular"
|
|
371
371
|
|
|
372
|
-
// ❌ HTML
|
|
372
|
+
// ❌ HTML heading/paragraph tags — You MUST NEVER use raw HTML tags for text
|
|
373
373
|
<h1>Başlık</h1>
|
|
374
374
|
<h2>Alt Başlık</h2>
|
|
375
375
|
<p>Metin</p>
|
|
376
|
-
// ✅
|
|
376
|
+
// ✅ CORRECT: Use Typography component
|
|
377
377
|
|
|
378
|
-
// ❌ Div
|
|
378
|
+
// ❌ Div for text — You MUST NEVER use a <div> for plain text content
|
|
379
379
|
<div>Bu sadece metin</div>
|
|
380
|
-
// ✅
|
|
380
|
+
// ✅ CORRECT: <Typography variant="text.md.regular">
|
|
381
381
|
|
|
382
|
-
// ❌ Inline style
|
|
382
|
+
// ❌ Inline style — You MUST NEVER use the `style` prop for typography
|
|
383
383
|
<Typography
|
|
384
384
|
style={{fontSize: '20px', fontWeight: 'bold'}}
|
|
385
385
|
>
|
|
386
386
|
Metin
|
|
387
387
|
</Typography>
|
|
388
388
|
|
|
389
|
-
// ❌
|
|
389
|
+
// ❌ Undefined variant — You MUST ONLY use variants from the theme's Untitled UI design system
|
|
390
390
|
<Typography variant="super-large-bold">
|
|
391
391
|
Metin
|
|
392
392
|
</Typography>
|
|
@@ -396,12 +396,12 @@ import { Typography } from '@mui/material';
|
|
|
396
396
|
|
|
397
397
|
## Select & MenuItem
|
|
398
398
|
|
|
399
|
-
### ✅
|
|
399
|
+
### ✅ Correct Usage
|
|
400
400
|
|
|
401
401
|
```tsx
|
|
402
402
|
import { Select, MenuItem, FormControl, InputLabel } from '@mui/material';
|
|
403
403
|
|
|
404
|
-
// ✅
|
|
404
|
+
// ✅ Basic Select
|
|
405
405
|
<FormControl fullWidth>
|
|
406
406
|
<InputLabel>Kategori</InputLabel>
|
|
407
407
|
<Select
|
|
@@ -415,7 +415,7 @@ import { Select, MenuItem, FormControl, InputLabel } from '@mui/material';
|
|
|
415
415
|
</Select>
|
|
416
416
|
</FormControl>
|
|
417
417
|
|
|
418
|
-
// ✅ TextField
|
|
418
|
+
// ✅ TextField as Select
|
|
419
419
|
<TextField
|
|
420
420
|
select
|
|
421
421
|
label="Ülke"
|
|
@@ -462,16 +462,16 @@ import { Select, MenuItem, FormControl, InputLabel } from '@mui/material';
|
|
|
462
462
|
</TextField>
|
|
463
463
|
```
|
|
464
464
|
|
|
465
|
-
### ❌
|
|
465
|
+
### ❌ Incorrect Usage
|
|
466
466
|
|
|
467
467
|
```tsx
|
|
468
|
-
// ❌ HTML select
|
|
468
|
+
// ❌ HTML select element — You MUST NEVER use raw HTML <select> elements
|
|
469
469
|
<select>
|
|
470
470
|
<option>Seçenek 1</option>
|
|
471
471
|
<option>Seçenek 2</option>
|
|
472
472
|
</select>
|
|
473
473
|
|
|
474
|
-
// ❌ Custom Select component
|
|
474
|
+
// ❌ Custom Select component — You MUST NEVER write custom Select components
|
|
475
475
|
function CustomSelect() {
|
|
476
476
|
return (
|
|
477
477
|
<div
|
|
@@ -486,12 +486,12 @@ function CustomSelect() {
|
|
|
486
486
|
);
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
-
// ❌ MenuItem
|
|
489
|
+
// ❌ Select without MenuItem — You MUST always wrap options in MenuItem components
|
|
490
490
|
<Select color="neutral">
|
|
491
491
|
{/* Missing MenuItem */}
|
|
492
492
|
</Select>
|
|
493
493
|
|
|
494
|
-
// ❌
|
|
494
|
+
// ❌ Undefined color — You MUST ONLY use: "neutral", "brand"
|
|
495
495
|
<Select color="unknown">
|
|
496
496
|
<MenuItem value="option1">Seçenek 1</MenuItem>
|
|
497
497
|
</Select>
|
|
@@ -501,7 +501,7 @@ function CustomSelect() {
|
|
|
501
501
|
|
|
502
502
|
## Checkbox, Radio, Switch
|
|
503
503
|
|
|
504
|
-
### ✅
|
|
504
|
+
### ✅ Correct Usage
|
|
505
505
|
|
|
506
506
|
```tsx
|
|
507
507
|
import {
|
|
@@ -515,18 +515,18 @@ import {
|
|
|
515
515
|
RadioGroup
|
|
516
516
|
} from '@mui/material';
|
|
517
517
|
|
|
518
|
-
// ✅
|
|
518
|
+
// ✅ Basic Checkbox
|
|
519
519
|
<Checkbox
|
|
520
520
|
color="primary"
|
|
521
521
|
/>
|
|
522
522
|
|
|
523
|
-
// ✅ Checkbox
|
|
523
|
+
// ✅ Checkbox with label — You MUST use FormControlLabel
|
|
524
524
|
<FormControlLabel
|
|
525
525
|
control={<Checkbox color="primary" />}
|
|
526
526
|
label="Şartları Kabul Ediyorum"
|
|
527
527
|
/>
|
|
528
528
|
|
|
529
|
-
// ✅ Checkbox
|
|
529
|
+
// ✅ Checkbox group
|
|
530
530
|
<FormControl>
|
|
531
531
|
<FormLabel>Tercihler</FormLabel>
|
|
532
532
|
<FormGroup>
|
|
@@ -541,17 +541,17 @@ import {
|
|
|
541
541
|
</FormGroup>
|
|
542
542
|
</FormControl>
|
|
543
543
|
|
|
544
|
-
// ✅
|
|
544
|
+
// ✅ Basic Radio
|
|
545
545
|
<Radio color="primary" />
|
|
546
546
|
|
|
547
|
-
// ✅ Radio
|
|
547
|
+
// ✅ Radio with label
|
|
548
548
|
<FormControlLabel
|
|
549
549
|
value="option1"
|
|
550
550
|
control={<Radio color="primary" />}
|
|
551
551
|
label="Seçenek 1"
|
|
552
552
|
/>
|
|
553
553
|
|
|
554
|
-
// ✅ Radio
|
|
554
|
+
// ✅ Radio group
|
|
555
555
|
<FormControl>
|
|
556
556
|
<FormLabel>Tema Seçimi</FormLabel>
|
|
557
557
|
<RadioGroup defaultValue="light">
|
|
@@ -568,10 +568,10 @@ import {
|
|
|
568
568
|
</RadioGroup>
|
|
569
569
|
</FormControl>
|
|
570
570
|
|
|
571
|
-
// ✅
|
|
571
|
+
// ✅ Basic Switch
|
|
572
572
|
<Switch color="primary" />
|
|
573
573
|
|
|
574
|
-
// ✅ Switch
|
|
574
|
+
// ✅ Switch with label
|
|
575
575
|
<FormControlLabel
|
|
576
576
|
control={<Switch color="primary" />}
|
|
577
577
|
label="Aktiv Et"
|
|
@@ -584,64 +584,64 @@ import {
|
|
|
584
584
|
/>
|
|
585
585
|
```
|
|
586
586
|
|
|
587
|
-
### ❌
|
|
587
|
+
### ❌ Incorrect Usage
|
|
588
588
|
|
|
589
589
|
```tsx
|
|
590
|
-
// ❌ HTML input
|
|
590
|
+
// ❌ HTML inputs — You MUST NEVER use raw HTML <input type="checkbox"> or <input type="radio">
|
|
591
591
|
<input type="checkbox" />
|
|
592
592
|
<input type="radio" />
|
|
593
593
|
|
|
594
|
-
// ❌
|
|
594
|
+
// ❌ Undefined color — You MUST ONLY use: "primary", "secondary", "error", "info", "success", "warning"
|
|
595
595
|
<Checkbox color="unknown" />
|
|
596
596
|
<Radio color="unknown" />
|
|
597
597
|
<Switch color="unknown" />
|
|
598
598
|
|
|
599
|
-
// ❌ FormControlLabel
|
|
599
|
+
// ❌ Missing FormControlLabel — You MUST use FormControlLabel to display a label alongside the control
|
|
600
600
|
<Checkbox color="primary" />
|
|
601
|
-
// ✅
|
|
601
|
+
// ✅ CORRECT: Use FormControlLabel to show the label
|
|
602
602
|
```
|
|
603
603
|
|
|
604
604
|
---
|
|
605
605
|
|
|
606
606
|
## Alert & Snackbar
|
|
607
607
|
|
|
608
|
-
### ✅
|
|
608
|
+
### ✅ Correct Usage
|
|
609
609
|
|
|
610
610
|
```tsx
|
|
611
611
|
import { Alert, Snackbar, AlertTitle } from '@mui/material';
|
|
612
612
|
|
|
613
|
-
// ✅
|
|
613
|
+
// ✅ Success alert
|
|
614
614
|
<Alert severity="success">
|
|
615
615
|
İşlem başarıyla tamamlandı!
|
|
616
616
|
</Alert>
|
|
617
617
|
|
|
618
|
-
// ✅
|
|
618
|
+
// ✅ Warning alert
|
|
619
619
|
<Alert severity="warning">
|
|
620
620
|
Uyarı: Dikkat edin!
|
|
621
621
|
</Alert>
|
|
622
622
|
|
|
623
|
-
// ✅
|
|
623
|
+
// ✅ Error alert
|
|
624
624
|
<Alert severity="error">
|
|
625
625
|
Hata: İşlem başarısız oldu!
|
|
626
626
|
</Alert>
|
|
627
627
|
|
|
628
|
-
// ✅
|
|
628
|
+
// ✅ Info alert
|
|
629
629
|
<Alert severity="info">
|
|
630
630
|
Bilgi: Yeni feature eklenmiştir.
|
|
631
631
|
</Alert>
|
|
632
632
|
|
|
633
|
-
// ✅ Alert title
|
|
633
|
+
// ✅ Alert with title — You MUST use AlertTitle for titled alerts
|
|
634
634
|
<Alert severity="error">
|
|
635
635
|
<AlertTitle>Hata</AlertTitle>
|
|
636
636
|
Lütfen tüm alanları doldurunuz!
|
|
637
637
|
</Alert>
|
|
638
638
|
|
|
639
|
-
// ✅ Alert icon
|
|
639
|
+
// ✅ Alert without icon
|
|
640
640
|
<Alert severity="success" icon={false}>
|
|
641
641
|
Başarılı
|
|
642
642
|
</Alert>
|
|
643
643
|
|
|
644
|
-
// ✅ Snackbar
|
|
644
|
+
// ✅ Snackbar for temporary notifications
|
|
645
645
|
const [open, setOpen] = React.useState(false);
|
|
646
646
|
|
|
647
647
|
<Snackbar
|
|
@@ -655,20 +655,20 @@ const [open, setOpen] = React.useState(false);
|
|
|
655
655
|
</Snackbar>
|
|
656
656
|
```
|
|
657
657
|
|
|
658
|
-
### ❌
|
|
658
|
+
### ❌ Incorrect Usage
|
|
659
659
|
|
|
660
660
|
```tsx
|
|
661
|
-
// ❌
|
|
661
|
+
// ❌ Missing severity — You MUST always provide a `severity` prop
|
|
662
662
|
<Alert>
|
|
663
663
|
Sadece bir mesaj
|
|
664
664
|
</Alert>
|
|
665
665
|
|
|
666
|
-
// ❌
|
|
666
|
+
// ❌ Undefined severity — You MUST ONLY use: "success", "warning", "error", "info"
|
|
667
667
|
<Alert severity="unknown">
|
|
668
668
|
Mesaj
|
|
669
669
|
</Alert>
|
|
670
670
|
|
|
671
|
-
// ❌ Custom alert component
|
|
671
|
+
// ❌ Custom alert component — You MUST NEVER write custom alert components
|
|
672
672
|
function CustomAlert() {
|
|
673
673
|
return (
|
|
674
674
|
<div style={{
|
|
@@ -685,9 +685,9 @@ function CustomAlert() {
|
|
|
685
685
|
|
|
686
686
|
---
|
|
687
687
|
|
|
688
|
-
## Card
|
|
688
|
+
## Card Component
|
|
689
689
|
|
|
690
|
-
### ✅
|
|
690
|
+
### ✅ Correct Usage
|
|
691
691
|
|
|
692
692
|
```tsx
|
|
693
693
|
import {
|
|
@@ -699,7 +699,7 @@ import {
|
|
|
699
699
|
Typography
|
|
700
700
|
} from '@mui/material';
|
|
701
701
|
|
|
702
|
-
// ✅
|
|
702
|
+
// ✅ Basic Card
|
|
703
703
|
<Card>
|
|
704
704
|
<CardContent>
|
|
705
705
|
<Typography variant="text.md.regular">
|
|
@@ -708,7 +708,7 @@ import {
|
|
|
708
708
|
</CardContent>
|
|
709
709
|
</Card>
|
|
710
710
|
|
|
711
|
-
// ✅ Card
|
|
711
|
+
// ✅ Full Card structure — You MUST use CardHeader, CardContent, and CardActions sub-components
|
|
712
712
|
<Card>
|
|
713
713
|
<CardHeader
|
|
714
714
|
title="Kart Başlığı"
|
|
@@ -729,7 +729,7 @@ import {
|
|
|
729
729
|
</CardActions>
|
|
730
730
|
</Card>
|
|
731
731
|
|
|
732
|
-
// ✅ Card elevation
|
|
732
|
+
// ✅ Card with elevation
|
|
733
733
|
<Card elevation={4}>
|
|
734
734
|
<CardContent>
|
|
735
735
|
<Typography variant="display.sm.semibold">
|
|
@@ -739,10 +739,10 @@ import {
|
|
|
739
739
|
</Card>
|
|
740
740
|
```
|
|
741
741
|
|
|
742
|
-
### ❌
|
|
742
|
+
### ❌ Incorrect Usage
|
|
743
743
|
|
|
744
744
|
```tsx
|
|
745
|
-
// ❌ Div
|
|
745
|
+
// ❌ Div as card — You MUST NEVER use a raw <div> as a card
|
|
746
746
|
<div style={{
|
|
747
747
|
padding: '20px',
|
|
748
748
|
border: '1px solid #ddd',
|
|
@@ -751,7 +751,7 @@ import {
|
|
|
751
751
|
Özel Kart
|
|
752
752
|
</div>
|
|
753
753
|
|
|
754
|
-
// ❌ CardHeader
|
|
754
|
+
// ❌ Header without CardHeader — You MUST use CardHeader for card headings
|
|
755
755
|
<Card>
|
|
756
756
|
<div style={{padding: '16px', borderBottom: '1px solid #ddd'}}>
|
|
757
757
|
<h2>Başlık</h2>
|
|
@@ -762,9 +762,9 @@ import {
|
|
|
762
762
|
|
|
763
763
|
---
|
|
764
764
|
|
|
765
|
-
## Dialog
|
|
765
|
+
## Dialog Component
|
|
766
766
|
|
|
767
|
-
### ✅
|
|
767
|
+
### ✅ Correct Usage
|
|
768
768
|
|
|
769
769
|
```tsx
|
|
770
770
|
import {
|
|
@@ -776,7 +776,7 @@ import {
|
|
|
776
776
|
Typography
|
|
777
777
|
} from '@mui/material';
|
|
778
778
|
|
|
779
|
-
// ✅
|
|
779
|
+
// ✅ Basic Dialog — You MUST use DialogTitle, DialogContent, and DialogActions sub-components
|
|
780
780
|
const [open, setOpen] = React.useState(false);
|
|
781
781
|
|
|
782
782
|
<Dialog open={open} onClose={() => setOpen(false)}>
|
|
@@ -796,7 +796,7 @@ const [open, setOpen] = React.useState(false);
|
|
|
796
796
|
</DialogActions>
|
|
797
797
|
</Dialog>
|
|
798
798
|
|
|
799
|
-
// ✅
|
|
799
|
+
// ✅ Delete confirmation dialog
|
|
800
800
|
<Dialog open={open} onClose={() => setOpen(false)}>
|
|
801
801
|
<DialogTitle>Silme Onayı</DialogTitle>
|
|
802
802
|
<DialogContent>
|
|
@@ -818,7 +818,7 @@ const [open, setOpen] = React.useState(false);
|
|
|
818
818
|
</DialogActions>
|
|
819
819
|
</Dialog>
|
|
820
820
|
|
|
821
|
-
// ✅
|
|
821
|
+
// ✅ Wide dialog
|
|
822
822
|
<Dialog
|
|
823
823
|
open={open}
|
|
824
824
|
onClose={() => setOpen(false)}
|
|
@@ -843,10 +843,10 @@ const [open, setOpen] = React.useState(false);
|
|
|
843
843
|
</Dialog>
|
|
844
844
|
```
|
|
845
845
|
|
|
846
|
-
### ❌
|
|
846
|
+
### ❌ Incorrect Usage
|
|
847
847
|
|
|
848
848
|
```tsx
|
|
849
|
-
// ❌ Custom modal dialog
|
|
849
|
+
// ❌ Custom modal dialog — You MUST NEVER build custom modal/dialog implementations
|
|
850
850
|
function CustomDialog() {
|
|
851
851
|
return (
|
|
852
852
|
<div style={{
|
|
@@ -871,7 +871,7 @@ function CustomDialog() {
|
|
|
871
871
|
);
|
|
872
872
|
}
|
|
873
873
|
|
|
874
|
-
// ❌ Dialog
|
|
874
|
+
// ❌ Dialog without structured sub-components — You MUST use DialogTitle, DialogContent, and DialogActions
|
|
875
875
|
<Dialog open={open}>
|
|
876
876
|
Tüm içerik bir div'de
|
|
877
877
|
</Dialog>
|
|
@@ -879,9 +879,9 @@ function CustomDialog() {
|
|
|
879
879
|
|
|
880
880
|
---
|
|
881
881
|
|
|
882
|
-
## List
|
|
882
|
+
## List Component
|
|
883
883
|
|
|
884
|
-
### ✅
|
|
884
|
+
### ✅ Correct Usage
|
|
885
885
|
|
|
886
886
|
```tsx
|
|
887
887
|
import {
|
|
@@ -894,7 +894,7 @@ import {
|
|
|
894
894
|
} from '@mui/material';
|
|
895
895
|
import { StarIcon } from '@turknet/onehub/icons';
|
|
896
896
|
|
|
897
|
-
// ✅
|
|
897
|
+
// ✅ Basic List
|
|
898
898
|
<List>
|
|
899
899
|
<ListItem>
|
|
900
900
|
<ListItemText primary="Öğe 1" />
|
|
@@ -904,7 +904,7 @@ import { StarIcon } from '@turknet/onehub/icons';
|
|
|
904
904
|
</ListItem>
|
|
905
905
|
</List>
|
|
906
906
|
|
|
907
|
-
// ✅ List
|
|
907
|
+
// ✅ List with icons
|
|
908
908
|
<List>
|
|
909
909
|
<ListItem>
|
|
910
910
|
<ListItemIcon><StarIcon /></ListItemIcon>
|
|
@@ -916,7 +916,7 @@ import { StarIcon } from '@turknet/onehub/icons';
|
|
|
916
916
|
</ListItem>
|
|
917
917
|
</List>
|
|
918
918
|
|
|
919
|
-
// ✅ List secondary
|
|
919
|
+
// ✅ List with secondary text
|
|
920
920
|
<List>
|
|
921
921
|
<ListItem>
|
|
922
922
|
<ListItemText
|
|
@@ -932,7 +932,7 @@ import { StarIcon } from '@turknet/onehub/icons';
|
|
|
932
932
|
</ListItem>
|
|
933
933
|
</List>
|
|
934
934
|
|
|
935
|
-
// ✅
|
|
935
|
+
// ✅ Clickable ListItem — You MUST use ListItemButton for clickable items
|
|
936
936
|
<List>
|
|
937
937
|
<ListItemButton>
|
|
938
938
|
<ListItemIcon><StarIcon /></ListItemIcon>
|
|
@@ -940,7 +940,7 @@ import { StarIcon } from '@turknet/onehub/icons';
|
|
|
940
940
|
</ListItemButton>
|
|
941
941
|
</List>
|
|
942
942
|
|
|
943
|
-
// ✅ Divider
|
|
943
|
+
// ✅ With Divider
|
|
944
944
|
<List>
|
|
945
945
|
<ListItem>
|
|
946
946
|
<ListItemText primary="Öğe 1" />
|
|
@@ -962,22 +962,22 @@ import { StarIcon } from '@turknet/onehub/icons';
|
|
|
962
962
|
</List>
|
|
963
963
|
```
|
|
964
964
|
|
|
965
|
-
### ❌
|
|
965
|
+
### ❌ Incorrect Usage
|
|
966
966
|
|
|
967
967
|
```tsx
|
|
968
|
-
// ❌ HTML ul/li
|
|
968
|
+
// ❌ HTML ul/li — You MUST NEVER use raw HTML list elements
|
|
969
969
|
<ul>
|
|
970
970
|
<li>Öğe 1</li>
|
|
971
971
|
<li>Öğe 2</li>
|
|
972
972
|
</ul>
|
|
973
973
|
|
|
974
|
-
// ❌ Div
|
|
974
|
+
// ❌ Div as list — You MUST NEVER use <div> elements to build lists
|
|
975
975
|
<div>
|
|
976
976
|
<div>Öğe 1</div>
|
|
977
977
|
<div>Öğe 2</div>
|
|
978
978
|
</div>
|
|
979
979
|
|
|
980
|
-
// ❌ ListItemText
|
|
980
|
+
// ❌ Missing ListItemText — You MUST always use ListItemText for list item content
|
|
981
981
|
<List>
|
|
982
982
|
<ListItem>
|
|
983
983
|
Sadece metin
|
|
@@ -987,9 +987,9 @@ import { StarIcon } from '@turknet/onehub/icons';
|
|
|
987
987
|
|
|
988
988
|
---
|
|
989
989
|
|
|
990
|
-
## Table
|
|
990
|
+
## Table Component
|
|
991
991
|
|
|
992
|
-
### ✅
|
|
992
|
+
### ✅ Correct Usage
|
|
993
993
|
|
|
994
994
|
```tsx
|
|
995
995
|
import {
|
|
@@ -1001,7 +1001,7 @@ import {
|
|
|
1001
1001
|
Paper
|
|
1002
1002
|
} from '@mui/material';
|
|
1003
1003
|
|
|
1004
|
-
// ✅
|
|
1004
|
+
// ✅ Basic table — You MUST wrap the table in a Paper component
|
|
1005
1005
|
<Paper>
|
|
1006
1006
|
<Table>
|
|
1007
1007
|
<TableHead>
|
|
@@ -1026,7 +1026,7 @@ import {
|
|
|
1026
1026
|
</Table>
|
|
1027
1027
|
</Paper>
|
|
1028
1028
|
|
|
1029
|
-
// ✅ Striped table (
|
|
1029
|
+
// ✅ Striped table (alternating row colors)
|
|
1030
1030
|
<Table>
|
|
1031
1031
|
<TableHead>
|
|
1032
1032
|
<TableRow sx={{backgroundColor: 'neutral.background.2'}}>
|
|
@@ -1059,10 +1059,10 @@ import {
|
|
|
1059
1059
|
</Table>
|
|
1060
1060
|
```
|
|
1061
1061
|
|
|
1062
|
-
### ❌
|
|
1062
|
+
### ❌ Incorrect Usage
|
|
1063
1063
|
|
|
1064
1064
|
```tsx
|
|
1065
|
-
// ❌ HTML table
|
|
1065
|
+
// ❌ HTML table — You MUST NEVER use raw HTML <table> elements
|
|
1066
1066
|
<table>
|
|
1067
1067
|
<thead>
|
|
1068
1068
|
<tr>
|
|
@@ -1078,13 +1078,13 @@ import {
|
|
|
1078
1078
|
</tbody>
|
|
1079
1079
|
</table>
|
|
1080
1080
|
|
|
1081
|
-
// ❌ Div
|
|
1081
|
+
// ❌ Div as table — You MUST NEVER build tables using <div> with display:flex
|
|
1082
1082
|
<div style={{display: 'flex'}}>
|
|
1083
1083
|
<div style={{flex: 1}}>Ad</div>
|
|
1084
1084
|
<div style={{flex: 1}}>Email</div>
|
|
1085
1085
|
</div>
|
|
1086
1086
|
|
|
1087
|
-
// ❌ TableCell
|
|
1087
|
+
// ❌ Missing TableCell — You MUST always use TableCell inside TableRow
|
|
1088
1088
|
<Table>
|
|
1089
1089
|
<TableBody>
|
|
1090
1090
|
<TableRow>
|
|
@@ -1099,7 +1099,7 @@ import {
|
|
|
1099
1099
|
|
|
1100
1100
|
## Paper & Elevation
|
|
1101
1101
|
|
|
1102
|
-
### ✅
|
|
1102
|
+
### ✅ Correct Usage
|
|
1103
1103
|
|
|
1104
1104
|
```tsx
|
|
1105
1105
|
import { Paper, Typography, Box } from '@mui/material';
|
|
@@ -1144,20 +1144,20 @@ import { Paper, Typography, Box } from '@mui/material';
|
|
|
1144
1144
|
</Paper>
|
|
1145
1145
|
```
|
|
1146
1146
|
|
|
1147
|
-
### ❌
|
|
1147
|
+
### ❌ Incorrect Usage
|
|
1148
1148
|
|
|
1149
1149
|
```tsx
|
|
1150
|
-
// ❌
|
|
1150
|
+
// ❌ Undefined elevation — You MUST ONLY use elevation values: 0, 2, 4, 8, 12, 16, 24
|
|
1151
1151
|
<Paper elevation={100}>
|
|
1152
1152
|
İçerik
|
|
1153
1153
|
</Paper>
|
|
1154
1154
|
|
|
1155
|
-
// ❌ Inline box shadow
|
|
1155
|
+
// ❌ Inline box shadow — You MUST NEVER apply boxShadow via inline styles
|
|
1156
1156
|
<div style={{boxShadow: '0 10px 30px rgba(0,0,0,0.2)'}}>
|
|
1157
1157
|
Özel gölge
|
|
1158
1158
|
</div>
|
|
1159
1159
|
|
|
1160
|
-
// ❌ Paper
|
|
1160
|
+
// ❌ Box shadow via sx instead of Paper — You MUST use Paper with elevation
|
|
1161
1161
|
<Box sx={{boxShadow: '0 4px 8px rgba(0,0,0,0.1)'}}>
|
|
1162
1162
|
İçerik
|
|
1163
1163
|
</Box>
|
|
@@ -1167,13 +1167,13 @@ import { Paper, Typography, Box } from '@mui/material';
|
|
|
1167
1167
|
|
|
1168
1168
|
## Chip & Badge
|
|
1169
1169
|
|
|
1170
|
-
### ✅
|
|
1170
|
+
### ✅ Correct Usage
|
|
1171
1171
|
|
|
1172
1172
|
```tsx
|
|
1173
1173
|
import { Chip, Badge, Avatar } from '@mui/material';
|
|
1174
1174
|
import { DeleteIcon, StarIcon } from '@turknet/onehub/icons';
|
|
1175
1175
|
|
|
1176
|
-
// ✅
|
|
1176
|
+
// ✅ Basic chip
|
|
1177
1177
|
<Chip label="Kategori" variant="filled" color="primary" />
|
|
1178
1178
|
|
|
1179
1179
|
// ✅ Outline chip
|
|
@@ -1190,7 +1190,7 @@ import { DeleteIcon, StarIcon } from '@turknet/onehub/icons';
|
|
|
1190
1190
|
onDelete={() => console.log('deleted')}
|
|
1191
1191
|
/>
|
|
1192
1192
|
|
|
1193
|
-
// ✅
|
|
1193
|
+
// ✅ Chip with icon
|
|
1194
1194
|
<Chip
|
|
1195
1195
|
icon={<StarIcon />}
|
|
1196
1196
|
label="Favori"
|
|
@@ -1198,12 +1198,12 @@ import { DeleteIcon, StarIcon } from '@turknet/onehub/icons';
|
|
|
1198
1198
|
color="primary"
|
|
1199
1199
|
/>
|
|
1200
1200
|
|
|
1201
|
-
// ✅
|
|
1201
|
+
// ✅ Basic badge
|
|
1202
1202
|
<Badge badgeContent={4} color="error">
|
|
1203
1203
|
<MailIcon />
|
|
1204
1204
|
</Badge>
|
|
1205
1205
|
|
|
1206
|
-
// ✅
|
|
1206
|
+
// ✅ Badge on Avatar
|
|
1207
1207
|
<Badge badgeContent={2} color="success">
|
|
1208
1208
|
<Avatar>A</Avatar>
|
|
1209
1209
|
</Badge>
|
|
@@ -1218,10 +1218,10 @@ import { DeleteIcon, StarIcon } from '@turknet/onehub/icons';
|
|
|
1218
1218
|
</Badge>
|
|
1219
1219
|
```
|
|
1220
1220
|
|
|
1221
|
-
### ❌
|
|
1221
|
+
### ❌ Incorrect Usage
|
|
1222
1222
|
|
|
1223
1223
|
```tsx
|
|
1224
|
-
// ❌ Custom chip
|
|
1224
|
+
// ❌ Custom chip — You MUST NEVER build custom chip/tag components
|
|
1225
1225
|
function CustomChip() {
|
|
1226
1226
|
return (
|
|
1227
1227
|
<div style={{
|
|
@@ -1235,7 +1235,7 @@ function CustomChip() {
|
|
|
1235
1235
|
);
|
|
1236
1236
|
}
|
|
1237
1237
|
|
|
1238
|
-
// ❌ Span
|
|
1238
|
+
// ❌ Span as badge — You MUST NEVER build custom badge components
|
|
1239
1239
|
<span style={{
|
|
1240
1240
|
position: 'relative',
|
|
1241
1241
|
display: 'inline-block'
|
|
@@ -1259,12 +1259,14 @@ function CustomChip() {
|
|
|
1259
1259
|
|
|
1260
1260
|
---
|
|
1261
1261
|
|
|
1262
|
-
##
|
|
1262
|
+
## Common Mistakes
|
|
1263
1263
|
|
|
1264
|
-
###
|
|
1264
|
+
### Mistake 1: Writing Custom Components
|
|
1265
|
+
|
|
1266
|
+
You MUST NEVER create custom implementations of MUI components. You MUST ONLY use the components provided by `@mui/material`.
|
|
1265
1267
|
|
|
1266
1268
|
```tsx
|
|
1267
|
-
// ❌
|
|
1269
|
+
// ❌ INCORRECT
|
|
1268
1270
|
function CustomButton() {
|
|
1269
1271
|
return (
|
|
1270
1272
|
<button style={{...}}>
|
|
@@ -1273,7 +1275,7 @@ function CustomButton() {
|
|
|
1273
1275
|
);
|
|
1274
1276
|
}
|
|
1275
1277
|
|
|
1276
|
-
// ✅
|
|
1278
|
+
// ✅ CORRECT
|
|
1277
1279
|
import { Button } from '@mui/material';
|
|
1278
1280
|
|
|
1279
1281
|
<Button variant="contained" color="primary">
|
|
@@ -1281,43 +1283,49 @@ import { Button } from '@mui/material';
|
|
|
1281
1283
|
</Button>
|
|
1282
1284
|
```
|
|
1283
1285
|
|
|
1284
|
-
###
|
|
1286
|
+
### Mistake 2: Undefined Props
|
|
1287
|
+
|
|
1288
|
+
You MUST ONLY use props that are defined in the theme. You MUST NEVER pass arbitrary or custom prop values.
|
|
1285
1289
|
|
|
1286
1290
|
```tsx
|
|
1287
|
-
// ❌
|
|
1291
|
+
// ❌ INCORRECT
|
|
1288
1292
|
<Button variant="gradient" size="super-large">
|
|
1289
1293
|
Buton
|
|
1290
1294
|
</Button>
|
|
1291
1295
|
|
|
1292
|
-
// ✅
|
|
1296
|
+
// ✅ CORRECT
|
|
1293
1297
|
<Button variant="contained" size="extra-large">
|
|
1294
1298
|
Buton
|
|
1295
1299
|
</Button>
|
|
1296
1300
|
```
|
|
1297
1301
|
|
|
1298
|
-
###
|
|
1302
|
+
### Mistake 3: Inline Styles
|
|
1303
|
+
|
|
1304
|
+
You MUST NEVER use the `style` prop on components. You MUST ONLY use the component's defined props (variant, color, size, etc.) to control appearance.
|
|
1299
1305
|
|
|
1300
1306
|
```tsx
|
|
1301
|
-
// ❌
|
|
1307
|
+
// ❌ INCORRECT
|
|
1302
1308
|
<Button style={{backgroundColor: '#FF0000', padding: '20px'}}>
|
|
1303
1309
|
Kırmızı Buton
|
|
1304
1310
|
</Button>
|
|
1305
1311
|
|
|
1306
|
-
// ✅
|
|
1312
|
+
// ✅ CORRECT
|
|
1307
1313
|
<Button variant="contained" color="error">
|
|
1308
1314
|
Kırmızı Buton
|
|
1309
1315
|
</Button>
|
|
1310
1316
|
```
|
|
1311
1317
|
|
|
1312
|
-
###
|
|
1318
|
+
### Mistake 4: Text Without Typography
|
|
1319
|
+
|
|
1320
|
+
You MUST NEVER use raw HTML tags (`<h1>`, `<p>`, `<div>`) for text content. You MUST ONLY use the Typography component.
|
|
1313
1321
|
|
|
1314
1322
|
```tsx
|
|
1315
|
-
// ❌
|
|
1323
|
+
// ❌ INCORRECT
|
|
1316
1324
|
<div>Bu sadece bir metin</div>
|
|
1317
1325
|
<h1>Başlık</h1>
|
|
1318
1326
|
<p>Açıklama</p>
|
|
1319
1327
|
|
|
1320
|
-
// ✅
|
|
1328
|
+
// ✅ CORRECT
|
|
1321
1329
|
<Typography variant="text.md.regular">
|
|
1322
1330
|
Bu bir metin
|
|
1323
1331
|
</Typography>
|
|
@@ -1329,20 +1337,22 @@ import { Button } from '@mui/material';
|
|
|
1329
1337
|
</Typography>
|
|
1330
1338
|
```
|
|
1331
1339
|
|
|
1332
|
-
###
|
|
1340
|
+
### Mistake 5: Using Shared Colors on Components
|
|
1341
|
+
|
|
1342
|
+
You MUST NOT use `theme.palette.shared` colors directly on MUI components. You MUST ONLY use the component's `color` prop with allowed values. Shared colors MUST ONLY be used in custom (non-MUI) components.
|
|
1333
1343
|
|
|
1334
1344
|
```tsx
|
|
1335
|
-
// ❌
|
|
1345
|
+
// ❌ INCORRECT: Using shared color on Button
|
|
1336
1346
|
<Button style={{backgroundColor: theme.palette.shared.green[3]}}>
|
|
1337
1347
|
Buton
|
|
1338
1348
|
</Button>
|
|
1339
1349
|
|
|
1340
|
-
// ✅
|
|
1350
|
+
// ✅ CORRECT: Use Button's color prop
|
|
1341
1351
|
<Button variant="contained" color="primary">
|
|
1342
1352
|
Buton
|
|
1343
1353
|
</Button>
|
|
1344
1354
|
|
|
1345
|
-
// ✅
|
|
1355
|
+
// ✅ CORRECT: Shared colors are allowed in custom components only
|
|
1346
1356
|
const CustomBadge = () => (
|
|
1347
1357
|
<div style={{backgroundColor: theme.palette.shared.purple[3]}}>
|
|
1348
1358
|
Custom İçerik
|
|
@@ -1350,34 +1360,38 @@ const CustomBadge = () => (
|
|
|
1350
1360
|
);
|
|
1351
1361
|
```
|
|
1352
1362
|
|
|
1353
|
-
###
|
|
1363
|
+
### Mistake 6: Shadow Without Elevation
|
|
1364
|
+
|
|
1365
|
+
You MUST NEVER apply shadows via inline styles or `sx`. You MUST ONLY use the Paper component with the `elevation` prop.
|
|
1354
1366
|
|
|
1355
1367
|
```tsx
|
|
1356
|
-
// ❌
|
|
1368
|
+
// ❌ INCORRECT
|
|
1357
1369
|
<div style={{boxShadow: '0 4px 8px rgba(0,0,0,0.1)'}}>
|
|
1358
1370
|
İçerik
|
|
1359
1371
|
</div>
|
|
1360
1372
|
|
|
1361
|
-
// ✅
|
|
1373
|
+
// ✅ CORRECT
|
|
1362
1374
|
<Paper elevation={4}>
|
|
1363
1375
|
İçerik
|
|
1364
1376
|
</Paper>
|
|
1365
1377
|
```
|
|
1366
1378
|
|
|
1367
|
-
###
|
|
1379
|
+
### Mistake 7: Non-Material-UI Component Libraries
|
|
1380
|
+
|
|
1381
|
+
You MUST NEVER import components from other UI libraries (Chakra UI, React Bootstrap, etc.). You MUST ONLY import from `@mui/material`.
|
|
1368
1382
|
|
|
1369
1383
|
```tsx
|
|
1370
|
-
// ❌
|
|
1384
|
+
// ❌ INCORRECT
|
|
1371
1385
|
import { Button } from 'chakra-ui';
|
|
1372
1386
|
import Button from 'react-bootstrap/Button';
|
|
1373
1387
|
|
|
1374
|
-
// ✅
|
|
1388
|
+
// ✅ CORRECT
|
|
1375
1389
|
import { Button } from '@mui/material';
|
|
1376
1390
|
```
|
|
1377
1391
|
|
|
1378
1392
|
---
|
|
1379
1393
|
|
|
1380
|
-
**
|
|
1394
|
+
**Reference**: Read `LLM_GUIDELINES.md` for more detailed information.
|
|
1381
1395
|
|
|
1382
|
-
**
|
|
1383
|
-
**
|
|
1396
|
+
**Last Updated**: June 2026
|
|
1397
|
+
**Version**: 2.1
|