@adlas/create-app 1.0.44 → 1.0.45
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/package.json
CHANGED
|
@@ -6,11 +6,52 @@ This document provides comprehensive guidelines for converting Figma designs to
|
|
|
6
6
|
|
|
7
7
|
## 🎯 Core Principles
|
|
8
8
|
|
|
9
|
-
1. **Use
|
|
10
|
-
2. **
|
|
11
|
-
3. **
|
|
12
|
-
4. **
|
|
13
|
-
5. **
|
|
9
|
+
1. **Use HeroUI components first** - Always prefer HeroUI components. Only use Tailwind CSS for custom styling when HeroUI doesn't provide the component
|
|
10
|
+
2. **Use ONLY existing components** - Never create custom implementations when project components exist
|
|
11
|
+
3. **i18n for ALL text** - ALL labels, placeholders, titles, error messages MUST use translation keys
|
|
12
|
+
4. **Navigation from config** - NEVER hardcode URLs. Always use `NAVIGATION_URLS` from config
|
|
13
|
+
5. **HeroUI icons only** - Use icons from HeroUI Figma Kit: https://www.figma.com/design/kFGcjHsNKZx7zh2NxEJXYt/HeroUI-Figma-Kit--Community---Community-?node-id=10-1849
|
|
14
|
+
6. **Follow project structure** - Place files in correct locations as defined below
|
|
15
|
+
7. **Match coding patterns** - Use the same patterns found in existing code
|
|
16
|
+
8. **Type safety first** - Use TypeScript strictly, no `any` types
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 🎨 Component Priority & Usage Strategy
|
|
21
|
+
|
|
22
|
+
### 1. Check HeroUI First
|
|
23
|
+
Before creating ANY component, check if HeroUI provides it:
|
|
24
|
+
- **HeroUI Documentation**: https://heroui.com/docs/components
|
|
25
|
+
- **HeroUI Figma Kit**: https://www.figma.com/design/kFGcjHsNKZx7zh2NxEJXYt/HeroUI-Figma-Kit--Community---Community-
|
|
26
|
+
|
|
27
|
+
### 2. Component Selection Flow
|
|
28
|
+
```
|
|
29
|
+
1. Does HeroUI have this component?
|
|
30
|
+
→ YES: Use HeroUI component (via @/components/ui wrapper if exists)
|
|
31
|
+
→ NO: Go to step 2
|
|
32
|
+
|
|
33
|
+
2. Does project have wrapper in src/components/ui/?
|
|
34
|
+
→ YES: Use the wrapper
|
|
35
|
+
→ NO: Go to step 3
|
|
36
|
+
|
|
37
|
+
3. Build with Tailwind CSS utilities
|
|
38
|
+
→ Use HeroUI theme colors and patterns
|
|
39
|
+
→ Follow mobile-first responsive design
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3. Example Decision Tree
|
|
43
|
+
```tsx
|
|
44
|
+
// Need a Button?
|
|
45
|
+
import { Button } from '@/components/ui'; // ✅ Use HeroUI Button wrapper
|
|
46
|
+
|
|
47
|
+
// Need an Input?
|
|
48
|
+
import { Input } from '@/components/ui'; // ✅ Use HeroUI Input wrapper
|
|
49
|
+
|
|
50
|
+
// Need a Card?
|
|
51
|
+
// HeroUI has Card, but check if wrapper exists in project
|
|
52
|
+
// If not, use Tailwind utilities with HeroUI colors:
|
|
53
|
+
<div className="rounded-lg bg-white p-6 shadow-md"> // ✅ Custom with Tailwind
|
|
54
|
+
```
|
|
14
55
|
|
|
15
56
|
---
|
|
16
57
|
|
|
@@ -172,18 +213,23 @@ import { Modal, Chip, Breadcrumbs, Tabs, Icon } from '@/components/ui';
|
|
|
172
213
|
```
|
|
173
214
|
|
|
174
215
|
### Icons
|
|
216
|
+
|
|
217
|
+
**IMPORTANT**: ALL icons MUST come from HeroUI Figma Kit
|
|
218
|
+
- **Figma Source**: https://www.figma.com/design/kFGcjHsNKZx7zh2NxEJXYt/HeroUI-Figma-Kit--Community---Community-?node-id=10-1849
|
|
219
|
+
- **Available in project**: ChevronDown, ChevronRight, Close, Eye, EyeSlash
|
|
220
|
+
|
|
175
221
|
```tsx
|
|
176
222
|
import { ChevronDownIcon, ChevronRightIcon, CloseIcon, EyeIcon, EyeSlashIcon } from '@/components/icons';
|
|
177
223
|
|
|
178
224
|
<ChevronDownIcon className="h-4 w-4" />
|
|
179
225
|
```
|
|
180
226
|
|
|
181
|
-
**For
|
|
182
|
-
|
|
183
|
-
|
|
227
|
+
**For icons not yet in project**:
|
|
228
|
+
1. Find the icon in HeroUI Figma Kit
|
|
229
|
+
2. Create a new icon component in `src/components/icons/` following the existing pattern
|
|
230
|
+
3. Export it from `src/components/icons/index.ts`
|
|
184
231
|
|
|
185
|
-
|
|
186
|
-
```
|
|
232
|
+
**DO NOT use Lucide, Font Awesome, or other icon libraries**
|
|
187
233
|
|
|
188
234
|
---
|
|
189
235
|
|
|
@@ -315,30 +361,85 @@ export default function LoginForm() {
|
|
|
315
361
|
|
|
316
362
|
## 🌐 Internationalization (i18n)
|
|
317
363
|
|
|
318
|
-
|
|
364
|
+
**CRITICAL**: ALL text content MUST use i18n translation keys
|
|
365
|
+
|
|
366
|
+
### Navigation with i18n
|
|
319
367
|
```tsx
|
|
320
368
|
import { Link } from '@/libs/I18nNavigation';
|
|
369
|
+
import { NAVIGATION_URLS } from '@/config/navigationUrls';
|
|
370
|
+
|
|
371
|
+
// ✅ CORRECT - Using NAVIGATION_URLS
|
|
372
|
+
<Link href={NAVIGATION_URLS.ABOUT}>About</Link>
|
|
321
373
|
|
|
374
|
+
// ❌ WRONG - Hardcoded URL
|
|
322
375
|
<Link href="/about">About</Link>
|
|
323
376
|
```
|
|
324
377
|
|
|
325
|
-
### Translations
|
|
378
|
+
### Translations for ALL text
|
|
326
379
|
```tsx
|
|
327
380
|
import { useTranslations } from 'next-intl';
|
|
328
381
|
|
|
329
382
|
function MyComponent() {
|
|
330
383
|
const t = useTranslations();
|
|
331
384
|
|
|
332
|
-
return
|
|
385
|
+
return (
|
|
386
|
+
<div>
|
|
387
|
+
{/* ✅ CORRECT - Using translation key */}
|
|
388
|
+
<h1>{t('welcome')}</h1>
|
|
389
|
+
<p>{t('description')}</p>
|
|
390
|
+
|
|
391
|
+
{/* ❌ WRONG - Hardcoded text */}
|
|
392
|
+
<h1>Welcome</h1>
|
|
393
|
+
</div>
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Form labels, placeholders, errors - ALL must use i18n
|
|
399
|
+
```tsx
|
|
400
|
+
import { useTranslations } from 'next-intl';
|
|
401
|
+
|
|
402
|
+
function LoginForm() {
|
|
403
|
+
const t = useTranslations();
|
|
404
|
+
|
|
405
|
+
return (
|
|
406
|
+
<form>
|
|
407
|
+
{/* ✅ CORRECT */}
|
|
408
|
+
<Input
|
|
409
|
+
label={t('email')}
|
|
410
|
+
placeholder={t('enterEmail')}
|
|
411
|
+
errorMessage={errors.email?.message ? t(errors.email.message) : undefined}
|
|
412
|
+
/>
|
|
413
|
+
|
|
414
|
+
{/* ❌ WRONG - Hardcoded text */}
|
|
415
|
+
<Input
|
|
416
|
+
label="Email"
|
|
417
|
+
placeholder="Enter your email"
|
|
418
|
+
errorMessage="Invalid email"
|
|
419
|
+
/>
|
|
420
|
+
</form>
|
|
421
|
+
);
|
|
333
422
|
}
|
|
334
423
|
```
|
|
335
424
|
|
|
336
|
-
### Navigation URLs
|
|
425
|
+
### Navigation URLs Reference
|
|
337
426
|
```tsx
|
|
338
427
|
import { NAVIGATION_URLS } from '@/config/navigationUrls';
|
|
339
428
|
|
|
429
|
+
// Available URLs (based on project type):
|
|
430
|
+
NAVIGATION_URLS.ROOT // '/'
|
|
431
|
+
NAVIGATION_URLS.ABOUT // '/about'
|
|
432
|
+
NAVIGATION_URLS.CONTACT // '/contact'
|
|
433
|
+
NAVIGATION_URLS.PRODUCTS.INDEX // '/products'
|
|
434
|
+
NAVIGATION_URLS.PRODUCTS.DETAIL('123') // '/products/123'
|
|
435
|
+
NAVIGATION_URLS.AUTH.LOGIN // '/auth/login'
|
|
436
|
+
NAVIGATION_URLS.DASHBOARD.INDEX // '/dashboard'
|
|
437
|
+
|
|
438
|
+
// ✅ ALWAYS use NAVIGATION_URLS
|
|
340
439
|
<Link href={NAVIGATION_URLS.PRODUCTS.INDEX}>Products</Link>
|
|
341
|
-
|
|
440
|
+
|
|
441
|
+
// ❌ NEVER hardcode URLs
|
|
442
|
+
<Link href="/products">Products</Link>
|
|
342
443
|
```
|
|
343
444
|
|
|
344
445
|
---
|
|
@@ -416,24 +517,30 @@ import { Footer, Navbar } from '@/components/layout';
|
|
|
416
517
|
## ⚠️ CRITICAL RULES
|
|
417
518
|
|
|
418
519
|
### ❌ DO NOT
|
|
419
|
-
1. ❌
|
|
420
|
-
2. ❌
|
|
421
|
-
3. ❌
|
|
422
|
-
4. ❌ Create
|
|
423
|
-
5. ❌ Use
|
|
424
|
-
6. ❌
|
|
425
|
-
7. ❌
|
|
426
|
-
8. ❌
|
|
520
|
+
1. ❌ Use non-HeroUI icons (Lucide, Font Awesome, etc.) - ONLY use HeroUI Figma Kit icons
|
|
521
|
+
2. ❌ Hardcode ANY text - ALL text MUST use i18n translation keys
|
|
522
|
+
3. ❌ Hardcode URLs - ALWAYS use `NAVIGATION_URLS` from config
|
|
523
|
+
4. ❌ Create custom components when HeroUI provides them - check HeroUI first, then project components
|
|
524
|
+
5. ❌ Use CSS modules or styled-components - ONLY Tailwind CSS
|
|
525
|
+
6. ❌ Import from `@heroui/react` directly (use `@/components/ui` wrappers)
|
|
526
|
+
7. ❌ Create duplicate utility functions (check `src/utils/helpers.ts` first)
|
|
527
|
+
8. ❌ Use `any` type in TypeScript
|
|
528
|
+
9. ❌ Ignore responsive design (always implement mobile-first)
|
|
529
|
+
10. ❌ Skip form validation (always use Zod schemas)
|
|
427
530
|
|
|
428
531
|
### ✅ DO
|
|
429
|
-
1. ✅ Use
|
|
430
|
-
2. ✅
|
|
431
|
-
3. ✅
|
|
432
|
-
4. ✅ Use `
|
|
433
|
-
5. ✅
|
|
434
|
-
6. ✅ Use
|
|
435
|
-
7. ✅ Implement
|
|
436
|
-
8. ✅
|
|
532
|
+
1. ✅ Use HeroUI components first (check HeroUI library before creating custom components)
|
|
533
|
+
2. ✅ Use icons ONLY from HeroUI Figma Kit
|
|
534
|
+
3. ✅ Use i18n translation keys for ALL text (labels, placeholders, titles, errors, etc.)
|
|
535
|
+
4. ✅ Use `NAVIGATION_URLS` for ALL navigation links
|
|
536
|
+
5. ✅ Use existing UI components from `src/components/ui/`
|
|
537
|
+
6. ✅ Use Tailwind CSS ONLY for styling (no CSS modules, no styled-components)
|
|
538
|
+
7. ✅ Implement TypeScript strictly with proper types
|
|
539
|
+
8. ✅ Use `'use client'` directive for interactive components
|
|
540
|
+
9. ✅ Follow mobile-first responsive design
|
|
541
|
+
10. ✅ Use semantic color classes from HeroUI theme
|
|
542
|
+
11. ✅ Implement proper loading and error states
|
|
543
|
+
12. ✅ Follow existing code patterns and naming conventions
|
|
437
544
|
|
|
438
545
|
---
|
|
439
546
|
|
|
@@ -441,18 +548,38 @@ import { Footer, Navbar } from '@/components/layout';
|
|
|
441
548
|
|
|
442
549
|
When converting Figma to code, ensure:
|
|
443
550
|
|
|
551
|
+
### Component & Styling
|
|
552
|
+
- [ ] Checked HeroUI library first for component availability
|
|
553
|
+
- [ ] Used HeroUI components via `src/components/ui/` wrappers
|
|
554
|
+
- [ ] Used ONLY HeroUI Figma Kit icons (no Lucide, Font Awesome, etc.)
|
|
555
|
+
- [ ] Applied Tailwind CSS classes only (no custom CSS, no CSS modules)
|
|
556
|
+
- [ ] Followed HeroUI theme colors (bg-background, bg-primary, etc.)
|
|
557
|
+
|
|
558
|
+
### Content & Navigation
|
|
559
|
+
- [ ] ALL text uses i18n translation keys (no hardcoded text)
|
|
560
|
+
- [ ] ALL labels use `t('labelKey')`
|
|
561
|
+
- [ ] ALL placeholders use `t('placeholderKey')`
|
|
562
|
+
- [ ] ALL error messages use `t('errorKey')`
|
|
563
|
+
- [ ] ALL titles and headings use `t('titleKey')`
|
|
564
|
+
- [ ] ALL URLs use `NAVIGATION_URLS` from config (no hardcoded URLs)
|
|
565
|
+
|
|
566
|
+
### Structure & Types
|
|
444
567
|
- [ ] Page created in correct location (`src/app/[locale]/...`)
|
|
445
|
-
- [ ] Used existing UI components from `src/components/ui/`
|
|
446
|
-
- [ ] Applied Tailwind CSS classes only (no custom CSS)
|
|
447
|
-
- [ ] Implemented responsive design (mobile-first)
|
|
448
568
|
- [ ] Added TypeScript types for all data structures
|
|
449
569
|
- [ ] Used `'use client'` for interactive components
|
|
450
|
-
- [ ]
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
- [ ]
|
|
454
|
-
- [ ]
|
|
455
|
-
- [ ]
|
|
570
|
+
- [ ] No `any` types used
|
|
571
|
+
|
|
572
|
+
### Forms & Validation
|
|
573
|
+
- [ ] Implemented forms with Zod validation schemas
|
|
574
|
+
- [ ] Form labels use i18n
|
|
575
|
+
- [ ] Form placeholders use i18n
|
|
576
|
+
- [ ] Form errors use i18n
|
|
577
|
+
|
|
578
|
+
### Responsive & States
|
|
579
|
+
- [ ] Implemented responsive design (mobile-first)
|
|
580
|
+
- [ ] Added proper loading states
|
|
581
|
+
- [ ] Added proper error states
|
|
582
|
+
- [ ] Tested on multiple breakpoints (mobile, tablet, desktop)
|
|
456
583
|
|
|
457
584
|
---
|
|
458
585
|
|
|
@@ -460,14 +587,26 @@ When converting Figma to code, ensure:
|
|
|
460
587
|
|
|
461
588
|
Before finalizing code, verify:
|
|
462
589
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
590
|
+
### Icons & Components
|
|
591
|
+
1. **Icons from HeroUI only** - Check all icons come from HeroUI Figma Kit
|
|
592
|
+
2. **HeroUI components first** - Verify HeroUI library was checked before custom implementation
|
|
593
|
+
3. **No direct HeroUI imports** - Only through `@/components/ui`
|
|
594
|
+
4. **Component reuse** - Don't duplicate existing components
|
|
595
|
+
|
|
596
|
+
### i18n & Navigation
|
|
597
|
+
5. **Zero hardcoded text** - ALL text uses `t('key')`
|
|
598
|
+
6. **Zero hardcoded URLs** - ALL links use `NAVIGATION_URLS`
|
|
599
|
+
7. **Form fields i18n** - Labels, placeholders, errors all use translation keys
|
|
600
|
+
|
|
601
|
+
### Styling & Layout
|
|
602
|
+
8. **Tailwind only** - No CSS modules, no styled-components
|
|
603
|
+
9. **HeroUI theme colors** - Use semantic colors, not arbitrary values
|
|
604
|
+
10. **Consistent spacing** - Use `space-y-*` and `space-x-*` utilities
|
|
605
|
+
11. **Mobile-first** - Base styles for mobile, then `md:`, `lg:`, etc.
|
|
606
|
+
|
|
607
|
+
### TypeScript & Validation
|
|
608
|
+
12. **Proper TypeScript** - No `any`, all props typed
|
|
609
|
+
13. **Form validation** - Zod schemas for all forms
|
|
471
610
|
|
|
472
611
|
---
|
|
473
612
|
|