@turk.net/mui 3.0.8 → 3.0.9
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.
|
@@ -70,6 +70,15 @@ sx={{ bgcolor: 'var(--brand-background-1-rest)' }}
|
|
|
70
70
|
- WithSidebar: `@turknet/onehub/layouts/page/WithSidebar`
|
|
71
71
|
- **MUST NOT** use MUI Drawer or AppBar directly
|
|
72
72
|
|
|
73
|
+
**Figma "Header tab navigation" layer → TabBased layout:**
|
|
74
|
+
Eğer Figma tasarımında `"Header tab navigation"` isimli bir layer varsa, bu sayfa TabBased layout içinde bir **sekme** olarak geliştirilmelidir. Header'ı sayfa içinde tekrar oluşturma — layout otomatik olarak sağlar.
|
|
75
|
+
|
|
76
|
+
**Figma "Card" / "Container" layer → Paper elevation={2}:**
|
|
77
|
+
Eğer Figma'da `"Card"` veya `"Container"` isimli bir layer şu stillere sahipse:
|
|
78
|
+
- Background: `#FAFAFA` veya beyaz
|
|
79
|
+
- Box Shadow: `0 0 2px 0 rgba(0,0,0,0.12), 0 1px 2px 0 rgba(0,0,0,0.14)`
|
|
80
|
+
→ `<Paper elevation={2}>` kullan. Tema default `borderRadius: 8px` verir; Figma köşeliyse `sx={{ borderRadius: 0 }}` ile override et.
|
|
81
|
+
|
|
73
82
|
### ICONS — MUST use OneHub icon system
|
|
74
83
|
|
|
75
84
|
- Import from `@turknet/onehub/icons` (SVG components, preferred)
|
|
@@ -436,6 +436,55 @@ You MUST use the `elevation` prop with values **0-24 only**:
|
|
|
436
436
|
|
|
437
437
|
---
|
|
438
438
|
|
|
439
|
+
## 📐 Layout & Figma Recognition
|
|
440
|
+
|
|
441
|
+
### Figma "Header tab navigation" → TabBased Layout
|
|
442
|
+
|
|
443
|
+
**When a Figma design contains a layer named `"Header tab navigation"`:**
|
|
444
|
+
|
|
445
|
+
This is the TabBased layout header. The page MUST be developed as a **tab** within the TabBased layout — do NOT implement the header in your page component.
|
|
446
|
+
|
|
447
|
+
```tsx
|
|
448
|
+
// ❌ WRONG — Recreating the layout header
|
|
449
|
+
function MyPage() {
|
|
450
|
+
return (
|
|
451
|
+
<Box>
|
|
452
|
+
<AppBar>...</AppBar> // ← TabBased header'ı sayfada tekrar oluşturma!
|
|
453
|
+
<Box>page content</Box>
|
|
454
|
+
</Box>
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// ✅ CORRECT — Page content only, layout provides header
|
|
459
|
+
function MyPageContent() {
|
|
460
|
+
return (
|
|
461
|
+
<Box>
|
|
462
|
+
<Typography variant="display.xs.bold">Page Title</Typography>
|
|
463
|
+
{/* sadece sayfa içeriği */}
|
|
464
|
+
</Box>
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
### Figma "Card" / "Container" → Paper elevation={2}
|
|
470
|
+
|
|
471
|
+
**When a Figma design contains a layer named `"Card"` or `"Container"`** with background `#FAFAFA` / white and shadow `0 0 2px + 0 1px 2px rgba`:
|
|
472
|
+
|
|
473
|
+
→ Use `<Paper elevation={2}>` from `@mui/material`
|
|
474
|
+
|
|
475
|
+
```tsx
|
|
476
|
+
// ✅ CORRECT — Match Figma shadow2
|
|
477
|
+
<Paper elevation={2}>
|
|
478
|
+
<Box sx={{ p: theme.spacing(4) }}>
|
|
479
|
+
{/* card content */}
|
|
480
|
+
</Box>
|
|
481
|
+
</Paper>
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
Paper default borderRadius: `8px` (theme). Override with `sx={{ borderRadius: 0 }}` if Figma shows sharp corners.
|
|
485
|
+
|
|
486
|
+
---
|
|
487
|
+
|
|
439
488
|
## 🚨 Common Mistakes to Avoid
|
|
440
489
|
|
|
441
490
|
### Mistake 1: Custom Button Component
|
package/COMPONENT_MAP.md
CHANGED
|
@@ -392,28 +392,67 @@ Tab styling is handled by theme overrides. Use standard MUI Tabs API.
|
|
|
392
392
|
|
|
393
393
|
---
|
|
394
394
|
|
|
395
|
-
##
|
|
395
|
+
## Card / Container → Paper
|
|
396
396
|
|
|
397
|
-
**MUI Component:** `
|
|
397
|
+
**MUI Component:** `Paper` from `@mui/material`
|
|
398
398
|
|
|
399
|
-
|
|
400
|
-
|
|
399
|
+
### Figma Detection Rule
|
|
400
|
+
|
|
401
|
+
**When you see a Figma layer named `"Card"` or `"Container"`** with these style characteristics:
|
|
402
|
+
|
|
403
|
+
- Background: `var(--Neutral-Background-2-Rest, #FAFAFA)` or white
|
|
404
|
+
- Box Shadow: `0 0 2px 0 rgba(0,0,0,0.12), 0 1px 2px 0 rgba(0,0,0,0.14)` (Figma `shadow2`)
|
|
405
|
+
|
|
406
|
+
→ **Use `<Paper elevation={2}>`**
|
|
407
|
+
|
|
408
|
+
```tsx
|
|
409
|
+
// ✅ CORRECT — Figma "Card" / "Container" layer → Paper elevation={2}
|
|
410
|
+
<Paper elevation={2} sx={{ /* sadece ihtiyaç varsa override */ }}>
|
|
411
|
+
{/* card content */}
|
|
412
|
+
</Paper>
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### Figma Styles → MUI Mapping
|
|
416
|
+
|
|
417
|
+
| Figma Style | MUI Prop | Value |
|
|
418
|
+
|-------------|----------|-------|
|
|
419
|
+
| `shadow2` (0 0 2px + 0 1px 2px) | `elevation` | `{2}` |
|
|
420
|
+
| `background: #FAFAFA` / white | background | `neutral.background[1].rest` (tema default) |
|
|
421
|
+
| `borderRadius: 8px` | borderRadius | `theme.shape.borderRadius` (tema default) |
|
|
422
|
+
| `borderRadius: 0px` (köşeli tasarım) | `sx` | `sx={{ borderRadius: 0 }}` ile override |
|
|
423
|
+
|
|
424
|
+
### Corner Radius Behavior
|
|
425
|
+
|
|
426
|
+
- Tema default olarak `borderRadius: 8px` uygular
|
|
427
|
+
- Figma'daki layer köşeli (0px borderRadius) ise: `<Paper elevation={2} sx={{ borderRadius: 0 }}>`
|
|
428
|
+
- Figma'daki layer daha yuvarlaksa: `sx={{ borderRadius: ... }}` ile override edilebilir
|
|
429
|
+
|
|
430
|
+
### Paper Default Properties (from Theme)
|
|
431
|
+
|
|
432
|
+
| Property | Theme Value |
|
|
433
|
+
|----------|-------------|
|
|
401
434
|
| **Border Radius** | `theme.shape.borderRadius` (8px) |
|
|
402
|
-
| **Background** |
|
|
403
|
-
| **
|
|
404
|
-
| **
|
|
435
|
+
| **Background** | `var(--palette-neutral-background-1-rest)` |
|
|
436
|
+
| **Border** | `1px solid var(--palette-neutral-stroke-3-rest)` |
|
|
437
|
+
| **Elevation 0** | Flat (no shadow) |
|
|
438
|
+
| **Elevation 2** | Very subtle shadow (Figma shadow2 equivalent) |
|
|
439
|
+
| **Elevation 4** | Dropdown level |
|
|
440
|
+
| **Elevation 8** | Dialog level |
|
|
405
441
|
|
|
406
442
|
---
|
|
407
443
|
|
|
408
|
-
##
|
|
444
|
+
## Cards (Alternative)
|
|
409
445
|
|
|
410
|
-
**MUI Component:** `
|
|
446
|
+
**MUI Component:** `Card` from `@mui/material`
|
|
447
|
+
|
|
448
|
+
`Card` extends `Paper` with the same styling. Use `Card` when you need `CardContent`, `CardHeader`, `CardActions`, `CardMedia` sub-components. Otherwise prefer `Paper`.
|
|
411
449
|
|
|
412
450
|
| Property | Value |
|
|
413
451
|
|----------|-------|
|
|
414
452
|
| **Border Radius** | `theme.shape.borderRadius` (8px) |
|
|
415
|
-
| **Border** | `--neutral-stroke-3-rest` (`1px solid #f0f0f0`) |
|
|
416
453
|
| **Background** | `--neutral-background-1-rest` |
|
|
454
|
+
| **Default Elevation** | `theme.shadows[0]` (none) |
|
|
455
|
+
| **Elevated** | Use `elevation` prop |
|
|
417
456
|
|
|
418
457
|
---
|
|
419
458
|
|
|
@@ -429,6 +468,57 @@ Tab styling is handled by theme overrides. Use standard MUI Tabs API.
|
|
|
429
468
|
|
|
430
469
|
---
|
|
431
470
|
|
|
471
|
+
## TabBased Layout Recognition
|
|
472
|
+
|
|
473
|
+
**When you see a Figma layer named `"Header tab navigation"`:**
|
|
474
|
+
|
|
475
|
+
This is the **TabBased layout header** — a 56px toolbar with navigation buttons (menu, plus, notifications, calendar, settings, help, bug).
|
|
476
|
+
|
|
477
|
+
**CRITICAL RULE:** AI agents MUST NOT implement this header as part of a page component. The page content MUST be designed as a **tab within the existing TabBased layout**.
|
|
478
|
+
|
|
479
|
+
```tsx
|
|
480
|
+
// ❌ WRONG — Sayfa içinde Header tab navigation'ı tekrar oluşturma
|
|
481
|
+
function MyPage() {
|
|
482
|
+
return (
|
|
483
|
+
<Box>
|
|
484
|
+
{/* Header tab navigation'ı burada oluşturma! */}
|
|
485
|
+
<AppBar>...</AppBar>
|
|
486
|
+
<Box>sayfa içeriği</Box>
|
|
487
|
+
</Box>
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// ✅ CORRECT — Sayfa içeriğini TabBased layout'ta bir sekme olarak oluştur
|
|
492
|
+
// Sayfa, redux tabSlice üzerinden açılır, layout otomatik sağlanır
|
|
493
|
+
function MyPageContent() {
|
|
494
|
+
return (
|
|
495
|
+
<Box sx={{ p: theme.spacing(4) }}>
|
|
496
|
+
{/* sadece sayfa içeriği — header/AppBar YOK */}
|
|
497
|
+
<Typography variant="display.xs.bold">Sayfa Başlığı</Typography>
|
|
498
|
+
...
|
|
499
|
+
</Box>
|
|
500
|
+
);
|
|
501
|
+
}
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
### TabBased Layout Header Specs (from Figma)
|
|
505
|
+
|
|
506
|
+
| Element | Spec |
|
|
507
|
+
|---------|------|
|
|
508
|
+
| **Height** | `56px` |
|
|
509
|
+
| **Horizontal Padding** | `32px` |
|
|
510
|
+
| **Left content** | Navigation buttons (menu toggle, add tab) |
|
|
511
|
+
| **Right content** | Action buttons (notifications, calendar, settings, help, bug report) |
|
|
512
|
+
| **Background** | Theme-handled |
|
|
513
|
+
| **Layout** | `@turknet/onehub/layouts/app/TabBased` |
|
|
514
|
+
|
|
515
|
+
### What This Means for Page Development
|
|
516
|
+
|
|
517
|
+
- **Header tab navigation layer varsa:** Bu sayfa bir TabBased sekmesidir. Sayfa içeriğini geliştir, header'ı layout'a bırak.
|
|
518
|
+
- **Header tab navigation layer yoksa:** Sayfa bağımsız bir sayfadır (örn. login, ayarlar). Kendi header/footer'ını içerebilir.
|
|
519
|
+
|
|
520
|
+
---
|
|
521
|
+
|
|
432
522
|
## Date Picker
|
|
433
523
|
|
|
434
524
|
**MUI Component:** `DatePicker` from `@mui/x-date-pickers`
|
|
@@ -564,4 +654,6 @@ The following MUI components do NOT have theme overrides and MUST NOT be used:
|
|
|
564
654
|
| A date picker | `DatePicker` (from `@mui/x-date-pickers`) |
|
|
565
655
|
| A search with dropdown | `Autocomplete` |
|
|
566
656
|
| Navigation tabs | `Tabs` + `Tab` |
|
|
567
|
-
| A card
|
|
657
|
+
| A card/container (layer name "Card" / "Container") | `Paper elevation={2}` |
|
|
658
|
+
| A card container (generic) | `Card` / `Paper` |
|
|
659
|
+
| "Header tab navigation" layer | DO NOT implement — use TabBased layout instead |
|
package/LLM_GUIDELINES.md
CHANGED
|
@@ -398,6 +398,60 @@ text.xs.{regular|medium|semibold|bold} → 12px
|
|
|
398
398
|
|
|
399
399
|
---
|
|
400
400
|
|
|
401
|
+
## Layout & Figma Recognition
|
|
402
|
+
|
|
403
|
+
### Figma "Header tab navigation" → TabBased Layout
|
|
404
|
+
|
|
405
|
+
**When a Figma design contains a layer named `"Header tab navigation"`:**
|
|
406
|
+
|
|
407
|
+
This indicates the page uses the TabBased layout (56px header toolbar with navigation buttons). The page content MUST be developed as a **tab** within the existing TabBased layout.
|
|
408
|
+
|
|
409
|
+
```tsx
|
|
410
|
+
// ❌ WRONG — Do NOT implement the header in your page
|
|
411
|
+
function MyPage() {
|
|
412
|
+
return (
|
|
413
|
+
<Box>
|
|
414
|
+
<AppBar position="static">...</AppBar> // ← NEVER do this
|
|
415
|
+
<Box>page content</Box>
|
|
416
|
+
</Box>
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// ✅ CORRECT — Page as a tab, layout provides header automatically
|
|
421
|
+
function MyPageContent() {
|
|
422
|
+
return (
|
|
423
|
+
<Box>
|
|
424
|
+
<Typography variant="display.xs.bold">Page Title</Typography>
|
|
425
|
+
{/* page content only */}
|
|
426
|
+
</Box>
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
**Layout is handled by:** `@turknet/onehub/layouts/app/TabBased`
|
|
432
|
+
|
|
433
|
+
### Figma "Card" / "Container" → Paper
|
|
434
|
+
|
|
435
|
+
**When a Figma design contains a layer named `"Card"` or `"Container"`** with:
|
|
436
|
+
- Background: `var(--Neutral-Background-2-Rest, #FAFAFA)` or white
|
|
437
|
+
- Box Shadow: `0 0 2px 0 rgba(0,0,0,0.12), 0 1px 2px 0 rgba(0,0,0,0.14)`
|
|
438
|
+
|
|
439
|
+
→ Use `<Paper elevation={2}>` from `@mui/material`
|
|
440
|
+
|
|
441
|
+
```tsx
|
|
442
|
+
// ✅ CORRECT
|
|
443
|
+
<Paper elevation={2}>
|
|
444
|
+
<Box sx={{ p: theme.spacing(4) }}>
|
|
445
|
+
<Typography variant="text.md.medium">Card Title</Typography>
|
|
446
|
+
{/* card content */}
|
|
447
|
+
</Box>
|
|
448
|
+
</Paper>
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
Paper has `8px` borderRadius by default (from theme). If the Figma design has sharp corners, override with `sx={{ borderRadius: 0 }}`.
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
401
455
|
**Last Updated**: May 2026
|
|
402
456
|
**Version**: 2.0+
|
|
403
457
|
**Package**: @turknet/onehub
|
package/PAGE_PATTERNS.md
CHANGED
|
@@ -495,6 +495,66 @@ enqueueSnackbar('Something went wrong', { variant: 'error' });
|
|
|
495
495
|
|
|
496
496
|
---
|
|
497
497
|
|
|
498
|
+
---
|
|
499
|
+
|
|
500
|
+
## Pattern 9: Figma Layer → Layout Decision
|
|
501
|
+
|
|
502
|
+
### 9.1 — "Header tab navigation" Layer → TabBased Layout
|
|
503
|
+
|
|
504
|
+
**When a Figma design contains a layer named `"Header tab navigation"`:**
|
|
505
|
+
|
|
506
|
+
This is the TabBased layout's header (56px toolbar with navigation/action buttons). The page is designed as a **tab** within the existing TabBased layout.
|
|
507
|
+
|
|
508
|
+
**CRITICAL:** Do NOT implement this header in the page component. The header is handled by `@turknet/onehub/layouts/app/TabBased`.
|
|
509
|
+
|
|
510
|
+
```tsx
|
|
511
|
+
// ❌ WRONG
|
|
512
|
+
function MyPage() {
|
|
513
|
+
return (
|
|
514
|
+
<Box>
|
|
515
|
+
<AppBar>...</AppBar> // ← Bunu yapma!
|
|
516
|
+
<Box>content</Box>
|
|
517
|
+
</Box>
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// ✅ CORRECT
|
|
522
|
+
// Sayfa TabBased layout altında sekme olarak açılır
|
|
523
|
+
// Sadece içeriği geliştir, header'ı layout sağlar
|
|
524
|
+
function MyPageContent() {
|
|
525
|
+
return (
|
|
526
|
+
<Box sx={{ p: theme.spacing(4) }}>
|
|
527
|
+
<Typography variant="display.xs.bold">Sayfa Başlığı</Typography>
|
|
528
|
+
{/* sayfa içeriği */}
|
|
529
|
+
</Box>
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
### 9.2 — "Card" / "Container" Layer → Paper
|
|
535
|
+
|
|
536
|
+
**When a Figma design contains a layer named `"Card"` or `"Container"`** with these styles:
|
|
537
|
+
|
|
538
|
+
| Style | Value |
|
|
539
|
+
|-------|-------|
|
|
540
|
+
| Background | `var(--Neutral-Background-2-Rest, #FAFAFA)` or white |
|
|
541
|
+
| Box Shadow | `0 0 2px 0 rgba(0,0,0,0.12), 0 1px 2px 0 rgba(0,0,0,0.14)` |
|
|
542
|
+
|
|
543
|
+
→ **Use `<Paper elevation={2}>`** from `@mui/material`
|
|
544
|
+
|
|
545
|
+
```tsx
|
|
546
|
+
<Paper elevation={2}>
|
|
547
|
+
<Box sx={{ p: theme.spacing(4) }}>
|
|
548
|
+
<Typography variant="text.md.medium">Card Title</Typography>
|
|
549
|
+
{/* card content */}
|
|
550
|
+
</Box>
|
|
551
|
+
</Paper>
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
**Corner radius:** Paper has `8px` borderRadius by default (from theme). If Figma shows sharp corners (0px), override with `sx={{ borderRadius: 0 }}`.
|
|
555
|
+
|
|
556
|
+
---
|
|
557
|
+
|
|
498
558
|
## Quick Decision Guide
|
|
499
559
|
|
|
500
560
|
| If you need to... | Use Pattern |
|
|
@@ -507,3 +567,5 @@ enqueueSnackbar('Something went wrong', { variant: 'error' });
|
|
|
507
567
|
| Show feedback message | Pattern 6: Notifications |
|
|
508
568
|
| Handle no-data state | Pattern 7: Empty State |
|
|
509
569
|
| Handle loading state | Pattern 8: Loading State |
|
|
570
|
+
| Figma has "Header tab navigation" layer | Pattern 9.1: TabBased layout tab |
|
|
571
|
+
| Figma has "Card" / "Container" layer | Pattern 9.2: Paper elevation={2} |
|