@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/COMPONENT_MAP.md
ADDED
|
@@ -0,0 +1,567 @@
|
|
|
1
|
+
# OneHub Component Map
|
|
2
|
+
|
|
3
|
+
> **Purpose:** Definitive mapping of Figma design patterns to Material UI components with exact props (variant, size, color, severity).
|
|
4
|
+
>
|
|
5
|
+
> **Critical Rule:** AI agents MUST use ONLY the components and prop combinations listed below. Any deviation is a design violation.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## How to Use This Map
|
|
10
|
+
|
|
11
|
+
1. Identify the UI element in Figma (e.g., a blue button with text)
|
|
12
|
+
2. Find the matching pattern below
|
|
13
|
+
3. Use the exact MUI component and props listed
|
|
14
|
+
4. Do NOT invent new variant/size/color combinations
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Button
|
|
19
|
+
|
|
20
|
+
**MUI Component:** `Button` from `@mui/material`
|
|
21
|
+
|
|
22
|
+
| # | Figma Pattern | Variant | Size | Color | Key Visual Traits |
|
|
23
|
+
|---|--------------|---------|------|-------|-------------------|
|
|
24
|
+
| B1 | Primary / Filled Blue | `contained` | `medium` | `primary` | Blue bg (`--brand-background-1-rest`), white text, `borderRadius: 8px`, `height: 32px` |
|
|
25
|
+
| B2 | Primary / Filled Large | `contained` | `large` | `primary` | Same as B1 but taller |
|
|
26
|
+
| B3 | Primary / Filled Small | `contained` | `small` | `primary` | Same as B1 but smaller |
|
|
27
|
+
| B4 | Secondary / Outlined | `outlined` | `medium` | `secondary` | Gray border (`--neutral-stroke-1-rest`), transparent bg, dark text |
|
|
28
|
+
| B5 | Secondary / Outlined Large | `outlined` | `large` | `secondary` | Same as B4 but taller |
|
|
29
|
+
| B6 | Secondary / Outlined Small | `outlined` | `small` | `secondary` | Same as B4 but smaller |
|
|
30
|
+
| B7 | Text / Ghost | `text` | `medium` | `primary` | No bg, no border, blue text |
|
|
31
|
+
| B8 | Text / Ghost Small | `text` | `small` | `primary` | Same as B7 but smaller |
|
|
32
|
+
| B9 | Error / Danger | `contained` | `medium` | `error` | Red bg, white text |
|
|
33
|
+
| B10 | Error / Outlined | `outlined` | `medium` | `error` | Red border, transparent bg, red text |
|
|
34
|
+
| B11 | Icon Only (transparent) | `text` | `medium` | `primary` | No padding, transparent bg, `--neutral-background-subtle-rest` |
|
|
35
|
+
| B12 | Icon Only (gray bg) | `text` | `medium` | `secondary` | Gray bg (`--neutral-background-2-rest`), border |
|
|
36
|
+
| B13 | Filter Button (gray) | `text` | `medium` | `secondary` | Gray bg (`--neutral-background-2-rest`), `neutral-stroke-1` border, icon+text |
|
|
37
|
+
| B14 | Filter Button (clear) | `text` | `medium` | `primary` | Transparent bg, delete icon, no text or "Temizle" |
|
|
38
|
+
|
|
39
|
+
### Button State Tokens
|
|
40
|
+
|
|
41
|
+
| State | Background | Foreground | Border |
|
|
42
|
+
|-------|------------|------------|--------|
|
|
43
|
+
| **rest** | `brand.background[1].rest` | `neutral.foreground.on.brand.rest` | none |
|
|
44
|
+
| **hover** | `brand.background[1].hover` | `neutral.foreground.on.brand.hover` | none |
|
|
45
|
+
| **pressed** | `brand.background[1].pressed` | `neutral.foreground.on.brand.pressed` | none |
|
|
46
|
+
| **disabled** | `neutral.background.disabled.rest` | `neutral.foreground.disabled.rest` | none |
|
|
47
|
+
| **focus** | `brand.background[1].rest` | `neutral.foreground.on.brand.rest` | `neutral.stroke.focus.rest` |
|
|
48
|
+
|
|
49
|
+
> Button states are auto-handled by the theme overrides. Do NOT manually apply hover/pressed styles.
|
|
50
|
+
|
|
51
|
+
### Invalid Button Combinations
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
// ❌ WRONG — color="success" not defined in theme
|
|
55
|
+
<Button color="success">Save</Button>
|
|
56
|
+
|
|
57
|
+
// ❌ WRONG — variant="outlined" with color="primary" but without size
|
|
58
|
+
<Button variant="outlined" color="primary">Delete</Button>
|
|
59
|
+
|
|
60
|
+
// ✅ CORRECT
|
|
61
|
+
<Button variant="outlined" size="medium" color="error">Delete</Button>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## TextField / Input
|
|
67
|
+
|
|
68
|
+
**MUI Component:** `TextField` from `@mui/material`
|
|
69
|
+
|
|
70
|
+
| # | Figma Pattern | Color | Size | Key Visual Traits |
|
|
71
|
+
|---|--------------|-------|------|-------------------|
|
|
72
|
+
| T1 | Default Input | `neutral` | `medium` | Gray border, white bg |
|
|
73
|
+
| T2 | Brand Input | `brand` | `medium` | Blue border/focus |
|
|
74
|
+
| T3 | Error Input | `danger` | `medium` | Red border, error text |
|
|
75
|
+
| T4 | Large Input | `neutral` | `large` | Taller input field |
|
|
76
|
+
| T5 | Disabled Input | `neutral` | `medium` | Gray bg, disabled border |
|
|
77
|
+
| T6 | Read-only Input | `neutral` | `medium` | No border, subtle bg |
|
|
78
|
+
|
|
79
|
+
### TextField Label
|
|
80
|
+
|
|
81
|
+
**MUI Component:** `InputLabel` (auto-wrapped by TextField)
|
|
82
|
+
|
|
83
|
+
| Size | Typography |
|
|
84
|
+
|------|-----------|
|
|
85
|
+
| `small` | `text.xs.regular` (`12px`, `400`) |
|
|
86
|
+
| `medium` | `text.sm.regular` (`14px`, `400`) |
|
|
87
|
+
| `large` | `text.sm.regular` (`14px`, `400`) |
|
|
88
|
+
|
|
89
|
+
### TextField Helper Text
|
|
90
|
+
|
|
91
|
+
**MUI Component:** `FormHelperText`
|
|
92
|
+
|
|
93
|
+
| Type | Typography | Color |
|
|
94
|
+
|------|-----------|-------|
|
|
95
|
+
| default | `text.xs.regular` | `neutral.foreground[3].rest` |
|
|
96
|
+
| error | `text.xs.regular` | `danger.foreground[1].rest` |
|
|
97
|
+
|
|
98
|
+
### Invalid TextField Combinations
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
// ❌ WRONG — color="primary" not defined for TextField
|
|
102
|
+
<TextField color="primary" />
|
|
103
|
+
|
|
104
|
+
// ❌ WRONG — using MUI default sizes
|
|
105
|
+
<TextField size="small" /> // Use "small" only if defined in theme
|
|
106
|
+
|
|
107
|
+
// ✅ CORRECT
|
|
108
|
+
<TextField color="neutral" size="medium" />
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Select / Dropdown
|
|
114
|
+
|
|
115
|
+
**MUI Component:** `Select` from `@mui/material`
|
|
116
|
+
|
|
117
|
+
Uses same color/size system as TextField.
|
|
118
|
+
|
|
119
|
+
| # | Figma Pattern | Color | Size |
|
|
120
|
+
|---|--------------|-------|------|
|
|
121
|
+
| S1 | Default Select | `neutral` | `medium` |
|
|
122
|
+
| S2 | Brand Select | `brand` | `medium` |
|
|
123
|
+
| S3 | Error Select | `danger` | `medium` |
|
|
124
|
+
| S4 | Large Select | `neutral` | `large` |
|
|
125
|
+
|
|
126
|
+
**MenuItem:** Standard `MenuItem` from `@mui/material`. Text uses `text.sm.regular`.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Checkbox
|
|
131
|
+
|
|
132
|
+
**MUI Component:** `Checkbox` from `@mui/material`
|
|
133
|
+
|
|
134
|
+
| # | Figma Pattern | Color | Size |
|
|
135
|
+
|---|--------------|-------|------|
|
|
136
|
+
| C1 | Default Checkbox | `primary` | `small` (16px) |
|
|
137
|
+
| C2 | Error Checkbox | `error` | `small` (16px) |
|
|
138
|
+
|
|
139
|
+
### Checkbox Visual Specs
|
|
140
|
+
|
|
141
|
+
| Property | Value |
|
|
142
|
+
|----------|-------|
|
|
143
|
+
| Size | `16px × 16px` |
|
|
144
|
+
| Border Radius | `4px` |
|
|
145
|
+
| Unchecked Border | `--neutral-stroke-accessible-rest` (`#616161`) |
|
|
146
|
+
| Checked Background | `--brand-background-compound-rest` (`#2970ff`) |
|
|
147
|
+
| Check Icon Color | White |
|
|
148
|
+
|
|
149
|
+
### Figma Radio (Radio-style Checkbox)
|
|
150
|
+
|
|
151
|
+
Figma's "Radio" uses the same `CheckboxBase` component with `rounded-[8px]` for radio-style selection (used in filter panels):
|
|
152
|
+
|
|
153
|
+
| Figma Pattern | MUI Component | Props |
|
|
154
|
+
|--------------|---------------|-------|
|
|
155
|
+
| Radio (filter) | `Radio` or `Checkbox` | `color="primary"` — 16px, `borderRadius: 8px` |
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Radio
|
|
160
|
+
|
|
161
|
+
**MUI Component:** `Radio` from `@mui/material`
|
|
162
|
+
|
|
163
|
+
| # | Figma Pattern | Color | Size |
|
|
164
|
+
|---|--------------|-------|------|
|
|
165
|
+
| R1 | Default Radio | `primary` | `small` (16px) |
|
|
166
|
+
| R2 | Error Radio | `error` | `small` (16px) |
|
|
167
|
+
|
|
168
|
+
### Radio Visual Specs
|
|
169
|
+
|
|
170
|
+
| Property | Value |
|
|
171
|
+
|----------|-------|
|
|
172
|
+
| Size | `16px × 16px` |
|
|
173
|
+
| Border Radius | `8px` (fully rounded) |
|
|
174
|
+
| Unchecked Border | `--neutral-stroke-accessible-rest` |
|
|
175
|
+
| Checked Fill | `--brand-background-compound-rest` |
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Switch
|
|
180
|
+
|
|
181
|
+
**MUI Component:** `Switch` from `@mui/material`
|
|
182
|
+
|
|
183
|
+
| # | Figma Pattern | Color | Size |
|
|
184
|
+
|---|--------------|-------|------|
|
|
185
|
+
| SW1 | Default Switch | `primary` | `medium` |
|
|
186
|
+
| SW2 | Small Switch | `primary` | `small` |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Chip / Badge / Tag
|
|
191
|
+
|
|
192
|
+
**MUI Component:** `Chip` from `@mui/material`
|
|
193
|
+
|
|
194
|
+
### Chip Variants
|
|
195
|
+
|
|
196
|
+
| # | Figma Pattern | Variant | Color | Size |
|
|
197
|
+
|---|--------------|---------|-------|------|
|
|
198
|
+
| CH1 | Filled (brand/blue) | `filled` | `primary` | `medium` |
|
|
199
|
+
| CH2 | Tint (light blue bg) | `tint` | `primary` | `medium` |
|
|
200
|
+
| CH3 | Outline (bordered) | `outline` | `primary` | `medium` |
|
|
201
|
+
| CH4 | Ghost (text only) | `ghost` | `primary` | `medium` |
|
|
202
|
+
| CH5 | Filled Error | `filled` | `error` | `medium` |
|
|
203
|
+
| CH6 | Tint Error | `tint` | `error` | `medium` |
|
|
204
|
+
|
|
205
|
+
### Filter Tags (from Figma)
|
|
206
|
+
|
|
207
|
+
Figma shows "Badge" with `rounded-[16px]`, `brand-background-2-rest` bg, `brand-stroke-2-rest` border, `brand-foreground-2-rest` text, `text.xs.medium`:
|
|
208
|
+
|
|
209
|
+
| Figma Name | MUI Component | Variant | Color | Size |
|
|
210
|
+
|-----------|---------------|---------|-------|------|
|
|
211
|
+
| Filter Tag (active) | `Chip` | `tint` | `primary` | `small` |
|
|
212
|
+
| Filter Tag (with remove) | `Chip` | `tint` | `primary` | `small` + `onDelete` |
|
|
213
|
+
|
|
214
|
+
### Chip Typography
|
|
215
|
+
|
|
216
|
+
| Size | Typography |
|
|
217
|
+
|------|-----------|
|
|
218
|
+
| `small` | `text.xs.medium` (`12px`, `500`) |
|
|
219
|
+
| `medium` | `text.sm.medium` (`14px`, `500`) |
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Badge (Notification Badge)
|
|
224
|
+
|
|
225
|
+
**MUI Component:** `Badge` from `@mui/material`
|
|
226
|
+
|
|
227
|
+
| # | Figma Pattern | Color | Size |
|
|
228
|
+
|---|--------------|-------|------|
|
|
229
|
+
| BD1 | Default Badge | `default` | `medium` |
|
|
230
|
+
| BD2 | Brand Badge | `brand` | `medium` |
|
|
231
|
+
| BD3 | Success Badge | `success` | `medium` |
|
|
232
|
+
| BD4 | Danger Badge | `danger` | `medium` |
|
|
233
|
+
| BD5 | Warning Badge | `warning` | `medium` |
|
|
234
|
+
| BD6 | Important Badge | `important` | `medium` |
|
|
235
|
+
| BD7 | Dot Badge (6px) | `default` | `dot` |
|
|
236
|
+
| BD8 | Small Badge | `default` | `small` |
|
|
237
|
+
|
|
238
|
+
### Dot Badge (from Figma)
|
|
239
|
+
|
|
240
|
+
Figma shows a `size-[6px]` dot indicator next to task descriptions. This maps to:
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
// Use Badge with dot size
|
|
244
|
+
<Badge color="default" size="dot" variant="dot">
|
|
245
|
+
<Icon />
|
|
246
|
+
</Badge>
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Status Badges (Customer Status)
|
|
252
|
+
|
|
253
|
+
Figma shows status labels: `Dondurulmus`, `Aktif`, `Hizmet disi`. These are not MUI Badge — they use `Chip`:
|
|
254
|
+
|
|
255
|
+
| Figma Pattern | MUI Component | Variant | Color |
|
|
256
|
+
|--------------|---------------|---------|-------|
|
|
257
|
+
| Active status | `Chip` | `tint` | `success` |
|
|
258
|
+
| Frozen status | `Chip` | `tint` | `warning` |
|
|
259
|
+
| Out of service | `Chip` | `tint` | `error` |
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Alert
|
|
264
|
+
|
|
265
|
+
**MUI Component:** `Alert` from `@mui/material`
|
|
266
|
+
|
|
267
|
+
| # | Figma Pattern | Severity | Variant |
|
|
268
|
+
|---|--------------|----------|---------|
|
|
269
|
+
| A1 | Success Alert | `success` | `standard` |
|
|
270
|
+
| A2 | Warning Alert | `warning` | `standard` |
|
|
271
|
+
| A3 | Error Alert | `error` | `standard` |
|
|
272
|
+
| A4 | Info Alert | `info` | `standard` |
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Snackbar / Toast
|
|
277
|
+
|
|
278
|
+
**MUI Component:** `Snackbar` from `@mui/material` + `Alert` inside
|
|
279
|
+
|
|
280
|
+
```typescript
|
|
281
|
+
// Standard pattern for notifications
|
|
282
|
+
<Snackbar open={open} autoHideDuration={6000} onClose={handleClose}>
|
|
283
|
+
<Alert severity="success" variant="standard" onClose={handleClose}>
|
|
284
|
+
Operation completed successfully
|
|
285
|
+
</Alert>
|
|
286
|
+
</Snackbar>
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Dialog / Modal
|
|
292
|
+
|
|
293
|
+
**MUI Component:** `Dialog` from `@mui/material`
|
|
294
|
+
|
|
295
|
+
| Property | Value |
|
|
296
|
+
|----------|-------|
|
|
297
|
+
| **Paper Elevation** | `theme.shadows[6]` (28px blur) |
|
|
298
|
+
| **Paper Border Radius** | `theme.shape.borderRadius` (8px) |
|
|
299
|
+
| **Backdrop** | `--neutral-background-overlay-rest` |
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
// Standard pattern
|
|
303
|
+
<Dialog open={open} onClose={handleClose}>
|
|
304
|
+
<DialogTitle>Title</DialogTitle>
|
|
305
|
+
<DialogContent>
|
|
306
|
+
<DialogContentText>Description</DialogContentText>
|
|
307
|
+
</DialogContent>
|
|
308
|
+
<DialogActions>
|
|
309
|
+
<Button variant="outlined" size="medium" color="secondary" onClick={handleClose}>
|
|
310
|
+
Cancel
|
|
311
|
+
</Button>
|
|
312
|
+
<Button variant="contained" size="medium" color="primary" onClick={handleConfirm}>
|
|
313
|
+
Confirm
|
|
314
|
+
</Button>
|
|
315
|
+
</DialogActions>
|
|
316
|
+
</Dialog>
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Menu (Dropdown Menu)
|
|
322
|
+
|
|
323
|
+
**MUI Component:** `Menu` + `MenuItem` from `@mui/material`
|
|
324
|
+
|
|
325
|
+
| Property | Value |
|
|
326
|
+
|----------|-------|
|
|
327
|
+
| **Paper Elevation** | `theme.shadows[4]` (8px blur) |
|
|
328
|
+
| **Border Radius** | `theme.shape.borderRadius` (8px) |
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Tooltip
|
|
333
|
+
|
|
334
|
+
**MUI Component:** `Tooltip` from `@mui/material`
|
|
335
|
+
|
|
336
|
+
Tooltip styling is handled by theme overrides. Use standard MUI Tooltip API.
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## Table / Data Grid
|
|
341
|
+
|
|
342
|
+
OneHub tables are **not** MUI `Table` — they use custom styled `Box` rows with flex layout.
|
|
343
|
+
|
|
344
|
+
### Table Structure (from Figma)
|
|
345
|
+
|
|
346
|
+
| Element | Figma Height | Background | Border |
|
|
347
|
+
|---------|-------------|------------|--------|
|
|
348
|
+
| **Table Header** | `40px` | `--neutral-background-2-rest` (`#fafafa`) | Bottom: `--neutral-stroke-3-rest` |
|
|
349
|
+
| **Table Row** | `56px` | `--neutral-background-1-rest` (white) | Bottom: `--neutral-stroke-3-rest` |
|
|
350
|
+
| **Table Row Hover** | `56px` | — | Bottom: `--neutral-stroke-3-rest` |
|
|
351
|
+
| **Table Cell Padding** | — | — | `paddingLeft: 32px, paddingRight: 32px` |
|
|
352
|
+
| **Pagination Row** | `56px` | `--neutral-background-1-rest` | Top: `--neutral-stroke-3-rest` |
|
|
353
|
+
|
|
354
|
+
### Table Typography
|
|
355
|
+
|
|
356
|
+
| Element | Typography | Color |
|
|
357
|
+
|---------|-----------|-------|
|
|
358
|
+
| Header text | `text.xs.medium` (`12px`, `500`) | `neutral.foreground[1].rest` |
|
|
359
|
+
| Row primary text | `text.sm.medium` (`14px`, `500`) | `neutral.foreground[1].rest` |
|
|
360
|
+
| Row secondary text | `text.sm.regular` (`14px`, `400`) | `neutral.foreground[4].rest` |
|
|
361
|
+
| Date number (large) | `text.lg.medium` (`18px`, `500`) | `neutral.foreground[2].rest` |
|
|
362
|
+
| Date month (small) | `text.sm.regular` (`14px`, `400`) | `neutral.foreground[4].rest` |
|
|
363
|
+
|
|
364
|
+
### Search & Filter Bar
|
|
365
|
+
|
|
366
|
+
| Element | MUI Component(s) | Notes |
|
|
367
|
+
|---------|-----------------|-------|
|
|
368
|
+
| Search Input | `TextField` color="neutral" size="medium" + search icon | `placeholder="Ara"` |
|
|
369
|
+
| Filter Button | `Button` variant="text" size="medium" color="secondary" | Gray bg, border, filter icon + "Filtreler" |
|
|
370
|
+
| Active Filter Tags | `Chip` variant="tint" color="primary" size="small" | `onDelete` for remove |
|
|
371
|
+
| Clear Button | `Button` variant="text" size="medium" color="primary" | Transparent bg, delete icon |
|
|
372
|
+
|
|
373
|
+
### Pagination
|
|
374
|
+
|
|
375
|
+
| Element | MUI Component |
|
|
376
|
+
|---------|---------------|
|
|
377
|
+
| Pagination controls | `Pagination` or `TablePagination` from `@mui/material` |
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
## Tabs
|
|
382
|
+
|
|
383
|
+
**MUI Component:** `Tabs` + `Tab` from `@mui/material`
|
|
384
|
+
|
|
385
|
+
Tab styling is handled by theme overrides. Use standard MUI Tabs API.
|
|
386
|
+
|
|
387
|
+
| Property | Figma Spec |
|
|
388
|
+
|----------|-----------|
|
|
389
|
+
| Tab indicator | Blue, `2px` height |
|
|
390
|
+
| Active tab text | `text.sm.semibold`, `brand.foreground[1].rest` |
|
|
391
|
+
| Inactive tab text | `text.sm.regular`, `neutral.foreground[2].rest` |
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## Cards
|
|
396
|
+
|
|
397
|
+
**MUI Component:** `Card` / `Paper` from `@mui/material`
|
|
398
|
+
|
|
399
|
+
| Property | Value |
|
|
400
|
+
|----------|-------|
|
|
401
|
+
| **Border Radius** | `theme.shape.borderRadius` (8px) |
|
|
402
|
+
| **Background** | `--neutral-background-1-rest` |
|
|
403
|
+
| **Default Elevation** | `theme.shadows[0]` (none) |
|
|
404
|
+
| **Elevated** | `theme.shadows[3]` (4px blur) |
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## Paper
|
|
409
|
+
|
|
410
|
+
**MUI Component:** `Paper` from `@mui/material`
|
|
411
|
+
|
|
412
|
+
| Property | Value |
|
|
413
|
+
|----------|-------|
|
|
414
|
+
| **Border Radius** | `theme.shape.borderRadius` (8px) |
|
|
415
|
+
| **Border** | `--neutral-stroke-3-rest` (`1px solid #f0f0f0`) |
|
|
416
|
+
| **Background** | `--neutral-background-1-rest` |
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
## Sidebar / Navigation
|
|
421
|
+
|
|
422
|
+
**Layout Component:** `WithSidebarLayout` from `@turknet/onehub/layouts/page/WithSidebar`
|
|
423
|
+
|
|
424
|
+
| Property | Figma Spec |
|
|
425
|
+
|----------|-----------|
|
|
426
|
+
| Width | `256px` (collapsed: `64px`) |
|
|
427
|
+
| Background | Varies (light/dark) |
|
|
428
|
+
| Nav items | `CollapsableListItem` |
|
|
429
|
+
|
|
430
|
+
---
|
|
431
|
+
|
|
432
|
+
## Date Picker
|
|
433
|
+
|
|
434
|
+
**MUI Component:** `DatePicker` from `@mui/x-date-pickers`
|
|
435
|
+
|
|
436
|
+
DatePicker styling is handled by theme overrides. Uses `dayjs` adapter.
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
## Autocomplete
|
|
441
|
+
|
|
442
|
+
**MUI Component:** `Autocomplete` from `@mui/material`
|
|
443
|
+
|
|
444
|
+
| # | Figma Pattern | Size |
|
|
445
|
+
|---|--------------|------|
|
|
446
|
+
| AC1 | Default Autocomplete | `medium` |
|
|
447
|
+
| AC2 | Large Autocomplete | `large` |
|
|
448
|
+
|
|
449
|
+
Uses same color system as TextField.
|
|
450
|
+
|
|
451
|
+
---
|
|
452
|
+
|
|
453
|
+
## Slider
|
|
454
|
+
|
|
455
|
+
**MUI Component:** `Slider` from `@mui/material`
|
|
456
|
+
|
|
457
|
+
Slider styling is handled by theme overrides.
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
## Link
|
|
462
|
+
|
|
463
|
+
**MUI Component:** `Link` from `@mui/material`
|
|
464
|
+
|
|
465
|
+
| Property | Value |
|
|
466
|
+
|----------|-------|
|
|
467
|
+
| Color | `brand.foreground.compound.rest` |
|
|
468
|
+
| Typography | Inherits from parent |
|
|
469
|
+
|
|
470
|
+
---
|
|
471
|
+
|
|
472
|
+
## Icon
|
|
473
|
+
|
|
474
|
+
**Icons:** Import from `@turknet/onehub/icons` (SVG React components) or the project's Tune icon font.
|
|
475
|
+
|
|
476
|
+
```typescript
|
|
477
|
+
// Preferred: SVG icon from theme package
|
|
478
|
+
import { CheckIcon, ChevronDownIcon, SearchIcon } from '@turknet/onehub/icons'
|
|
479
|
+
|
|
480
|
+
// Alternative: Tune icon font (if project uses it)
|
|
481
|
+
import { TuneIcon } from '@/components/ui/icon'
|
|
482
|
+
<TuneIcon name="check" />
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
## Avatar
|
|
488
|
+
|
|
489
|
+
**MUI Component:** `Avatar` from `@mui/material`
|
|
490
|
+
|
|
491
|
+
| # | Size | Dimensions |
|
|
492
|
+
|---|------|-----------|
|
|
493
|
+
| AV1 | `dot` | `8px` |
|
|
494
|
+
| AV2 | `extra-small` | `24px` |
|
|
495
|
+
| AV3 | `small` | `32px` |
|
|
496
|
+
| AV4 | `medium` | `40px` |
|
|
497
|
+
| AV5 | `large` | `48px` |
|
|
498
|
+
| AV6 | `extra-large` | `64px` |
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
## List
|
|
503
|
+
|
|
504
|
+
**MUI Component:** `List` / `ListItem` / `ListItemButton` from `@mui/material`
|
|
505
|
+
|
|
506
|
+
List styling is handled by theme overrides.
|
|
507
|
+
|
|
508
|
+
---
|
|
509
|
+
|
|
510
|
+
## Typography
|
|
511
|
+
|
|
512
|
+
**MUI Component:** `Typography` from `@mui/material`
|
|
513
|
+
|
|
514
|
+
See `DESIGN_TOKENS_MAP.md#typography-token-map` for the complete variant list.
|
|
515
|
+
|
|
516
|
+
```typescript
|
|
517
|
+
// ✅ CORRECT — Use defined variants
|
|
518
|
+
<Typography variant="text.sm.medium">Label</Typography>
|
|
519
|
+
<Typography variant="display.xs.bold">Page Title</Typography>
|
|
520
|
+
|
|
521
|
+
// ❌ WRONG — MUI default variants are DISABLED
|
|
522
|
+
<Typography variant="h1">Title</Typography>
|
|
523
|
+
<Typography variant="body1">Text</Typography>
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
---
|
|
527
|
+
|
|
528
|
+
## Components NOT Allowed (No Theme Override)
|
|
529
|
+
|
|
530
|
+
The following MUI components do NOT have theme overrides and MUST NOT be used:
|
|
531
|
+
|
|
532
|
+
| Component | Reason | Alternative |
|
|
533
|
+
|-----------|--------|-------------|
|
|
534
|
+
| `ToggleButton` | Not overridden | Use `Chip` or `Button` group |
|
|
535
|
+
| `Rating` | Not overridden | Custom solution |
|
|
536
|
+
| `SpeedDial` | Not overridden | Custom solution |
|
|
537
|
+
| `BottomNavigation` | Not overridden | Custom solution |
|
|
538
|
+
| `MobileStepper` | Not overridden | Custom solution |
|
|
539
|
+
| `ImageList` | Not overridden | CSS Grid/Flex |
|
|
540
|
+
|
|
541
|
+
---
|
|
542
|
+
|
|
543
|
+
## Quick Reference: Figma → MUI
|
|
544
|
+
|
|
545
|
+
| If you see in Figma... | Use this MUI component |
|
|
546
|
+
|------------------------|----------------------|
|
|
547
|
+
| A filled blue button | `Button variant="contained" color="primary"` |
|
|
548
|
+
| An outlined gray button | `Button variant="outlined" color="secondary"` |
|
|
549
|
+
| A text-only button | `Button variant="text" color="primary"` |
|
|
550
|
+
| A text input field | `TextField color="neutral"` |
|
|
551
|
+
| A dropdown selector | `Select color="neutral"` |
|
|
552
|
+
| A checkbox | `Checkbox color="primary"` |
|
|
553
|
+
| A radio button | `Radio color="primary"` |
|
|
554
|
+
| A toggle switch | `Switch color="primary"` |
|
|
555
|
+
| A blue tag/chip | `Chip variant="tint" color="primary"` |
|
|
556
|
+
| A red error chip | `Chip variant="tint" color="error"` |
|
|
557
|
+
| A filter pill with X | `Chip variant="tint" color="primary" onDelete={...}` |
|
|
558
|
+
| A status dot (6px) | `Badge size="dot" color="..."` |
|
|
559
|
+
| A table header | Custom Box with `text.xs.medium` |
|
|
560
|
+
| A table data row | Custom Box with `text.sm.medium` / `text.sm.regular` |
|
|
561
|
+
| A success message | `Alert severity="success"` |
|
|
562
|
+
| A modal/dialog | `Dialog` |
|
|
563
|
+
| A tooltip on hover | `Tooltip` |
|
|
564
|
+
| A date picker | `DatePicker` (from `@mui/x-date-pickers`) |
|
|
565
|
+
| A search with dropdown | `Autocomplete` |
|
|
566
|
+
| Navigation tabs | `Tabs` + `Tab` |
|
|
567
|
+
| A card container | `Card` / `Paper` |
|