@reinvented/design 1.0.0 → 1.1.0
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/README.md +1 -1
- package/SKILL.md +214 -0
- package/package.json +4 -3
- package/skills/apps/analytics.md +103 -0
- package/skills/apps/booking-scheduling.md +97 -0
- package/skills/apps/content-management.md +52 -0
- package/skills/apps/crm.md +80 -0
- package/skills/apps/e-commerce.md +109 -0
- package/skills/apps/education.md +79 -0
- package/skills/apps/finance.md +68 -0
- package/skills/apps/health-fitness.md +72 -0
- package/skills/apps/marketplace.md +99 -0
- package/skills/apps/messaging.md +84 -0
- package/skills/apps/portfolio-personal.md +90 -0
- package/skills/apps/project-management.md +95 -0
- package/skills/apps/saas-dashboard.md +104 -0
- package/skills/apps/social-platform.md +50 -0
- package/skills/blocks/auth.md +106 -0
- package/skills/blocks/communication.md +98 -0
- package/skills/blocks/content.md +107 -0
- package/skills/blocks/data-management.md +109 -0
- package/skills/blocks/data-viz.md +92 -0
- package/skills/blocks/ecommerce.md +126 -0
- package/skills/blocks/feedback.md +97 -0
- package/skills/blocks/filtering.md +127 -0
- package/skills/blocks/marketing.md +136 -0
- package/skills/blocks/media.md +102 -0
- package/skills/blocks/navigation.md +136 -0
- package/skills/blocks/onboarding.md +75 -0
- package/skills/blocks/profiles.md +131 -0
- package/skills/blocks/scheduling.md +117 -0
- package/skills/blocks/settings.md +102 -0
- package/skills/components/advanced-components.md +142 -0
- package/skills/components/avatar.md +92 -0
- package/skills/components/badge.md +105 -0
- package/skills/components/button.md +87 -0
- package/skills/components/card.md +144 -0
- package/skills/components/chart.md +88 -0
- package/skills/components/dialog.md +109 -0
- package/skills/components/dropdown-menu.md +117 -0
- package/skills/components/extended-components.md +187 -0
- package/skills/components/feedback.md +165 -0
- package/skills/components/form.md +112 -0
- package/skills/components/input.md +107 -0
- package/skills/components/map.md +53 -0
- package/skills/components/navigation.md +73 -0
- package/skills/components/overlay.md +77 -0
- package/skills/components/page-header.md +51 -0
- package/skills/components/select.md +175 -0
- package/skills/components/table.md +102 -0
- package/skills/components/tabs.md +105 -0
- package/skills/components/utilities.md +138 -0
- package/skills/devices/desktop.md +43 -0
- package/skills/devices/mobile.md +77 -0
- package/skills/foundation/design-principles.md +77 -0
- package/skills/foundation/design-tokens.md +121 -0
- package/skills/foundation/mockup-generation.md +118 -0
- package/skills/foundation/rules.md +54 -0
- package/skills/foundation/tailwind-usage.md +204 -0
- package/skills/layouts/dashboard.md +71 -0
- package/skills/layouts/full-page-form.md +75 -0
- package/skills/layouts/list-detail.md +70 -0
- package/skills/layouts/marketing.md +70 -0
- package/skills/layouts/responsive.md +67 -0
- package/skills/layouts/settings-page.md +106 -0
- package/skills/layouts/sidebar.md +73 -0
- package/skills/layouts/topbar.md +68 -0
- package/skills/patterns/auth.md +131 -0
- package/skills/patterns/content-display.md +164 -0
- package/skills/patterns/dashboards.md +104 -0
- package/skills/patterns/data-tables.md +113 -0
- package/skills/patterns/empty-states.md +71 -0
- package/skills/patterns/error-states.md +73 -0
- package/skills/patterns/forms.md +136 -0
- package/skills/patterns/loading-states.md +92 -0
- package/skills/patterns/navigation.md +113 -0
- package/skills/patterns/notifications.md +91 -0
- package/skills/patterns/onboarding.md +42 -0
- package/skills/patterns/search.md +55 -0
- package/skills/patterns/settings.md +132 -0
- package/skills/patterns/user-profiles.md +67 -0
- package/skills/personas/business-operator.md +114 -0
- package/skills/personas/consumer-casual.md +60 -0
- package/skills/personas/consumer-power-user.md +109 -0
- package/skills/personas/creative-professional.md +109 -0
- package/skills/personas/enterprise-admin.md +134 -0
- package/skills/visual/color-usage.md +62 -0
- package/skills/visual/dark-mode.md +50 -0
- package/skills/visual/polish-techniques.md +101 -0
- package/skills/visual/spacing-composition.md +69 -0
- package/skills/visual/transitions-animations.md +66 -0
- package/skills/visual/typography-hierarchy.md +66 -0
- package/DESIGN_GUIDE.md +0 -148
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Tabs, Accordion, Collapsible
|
|
2
|
+
|
|
3
|
+
Content organization components for showing/hiding sections.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@reinvented/design'
|
|
7
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@reinvented/design'
|
|
8
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@reinvented/design'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Tabs
|
|
12
|
+
|
|
13
|
+
Switch between related content panels within a single view.
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<Tabs default-value="overview" className="w-full">
|
|
17
|
+
<TabsList>
|
|
18
|
+
<TabsTrigger value="overview">Overview</TabsTrigger>
|
|
19
|
+
<TabsTrigger value="analytics">Analytics</TabsTrigger>
|
|
20
|
+
<TabsTrigger value="settings">Settings</TabsTrigger>
|
|
21
|
+
</TabsList>
|
|
22
|
+
<TabsContent value="overview" className="mt-4">
|
|
23
|
+
<!-- Overview content -->
|
|
24
|
+
</TabsContent>
|
|
25
|
+
<TabsContent value="analytics" className="mt-4">
|
|
26
|
+
<!-- Analytics content -->
|
|
27
|
+
</TabsContent>
|
|
28
|
+
<TabsContent value="settings" className="mt-4">
|
|
29
|
+
<!-- Settings content -->
|
|
30
|
+
</TabsContent>
|
|
31
|
+
</Tabs>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### When to Use Tabs
|
|
35
|
+
- **Related content within one entity**: (Overview / Activity / Settings for a project)
|
|
36
|
+
- **Alternative views of same data**: (Table / Cards / Chart views)
|
|
37
|
+
- **3–6 tabs maximum** — if you need more, use sidebar navigation instead
|
|
38
|
+
|
|
39
|
+
### Tabs with Counts
|
|
40
|
+
```tsx
|
|
41
|
+
<TabsTrigger value="open">
|
|
42
|
+
Open <Badge variant="secondary" className="ml-1.5">12</Badge>
|
|
43
|
+
</TabsTrigger>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Accordion
|
|
47
|
+
|
|
48
|
+
Vertically stacked sections that expand/collapse. Use for FAQs, settings groups, or long lists of optional content.
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
<Accordion type="single" collapsible className="w-full">
|
|
52
|
+
<AccordionItem value="item-1">
|
|
53
|
+
<AccordionTrigger>General Settings</AccordionTrigger>
|
|
54
|
+
<AccordionContent>
|
|
55
|
+
<!-- Settings content -->
|
|
56
|
+
</AccordionContent>
|
|
57
|
+
</AccordionItem>
|
|
58
|
+
<AccordionItem value="item-2">
|
|
59
|
+
<AccordionTrigger>Notifications</AccordionTrigger>
|
|
60
|
+
<AccordionContent>
|
|
61
|
+
<!-- Notification settings -->
|
|
62
|
+
</AccordionContent>
|
|
63
|
+
</AccordionItem>
|
|
64
|
+
</Accordion>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Accordion Types
|
|
68
|
+
| Type | Behavior | When to Use |
|
|
69
|
+
|------|----------|-------------|
|
|
70
|
+
| `type="single" collapsible` | One item open at a time, can close all | Default for most use cases |
|
|
71
|
+
| `type="multiple"` | Multiple items can be open simultaneously | FAQ pages, filter groups |
|
|
72
|
+
|
|
73
|
+
## Collapsible
|
|
74
|
+
|
|
75
|
+
Single expand/collapse section. Use for "show more" or optional advanced content.
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
<Collapsible v-model:open="isOpen">
|
|
79
|
+
<div className="flex items-center justify-between">
|
|
80
|
+
<h4 className="text-sm font-semibold">Advanced Options</h4>
|
|
81
|
+
<CollapsibleTrigger as-child>
|
|
82
|
+
<Button variant="ghost" size="icon" className="h-8 w-8">
|
|
83
|
+
<ChevronsUpDown className="w-4 h-4" />
|
|
84
|
+
</Button>
|
|
85
|
+
</CollapsibleTrigger>
|
|
86
|
+
</div>
|
|
87
|
+
<CollapsibleContent className="mt-2 space-y-2">
|
|
88
|
+
<!-- Hidden content -->
|
|
89
|
+
</CollapsibleContent>
|
|
90
|
+
</Collapsible>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Decision Tree
|
|
94
|
+
```
|
|
95
|
+
Are these related panels for the same entity?
|
|
96
|
+
├─ Yes → Tabs
|
|
97
|
+
├─ No
|
|
98
|
+
│ ├─ Multiple expandable sections (FAQ, settings)? → Accordion
|
|
99
|
+
│ └─ Single "show more" section? → Collapsible
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Anti-Patterns (DO NOT DO)
|
|
103
|
+
|
|
104
|
+
- ❌ **Do not hack Tab internals**: Never manually override the paddings, heights, or active states of `<TabsList>` or `<TabsTrigger>` (e.g., adding `h-7 px-0` to a trigger or `h-8 p-0` to a list). This will break text wrapping and ruin the layout, especially if the trigger contains an icon. Shadcn components are designed to work out-of-the-box.
|
|
105
|
+
- ❌ **Do not hardcode active states**: Never use `data-[state=active]:bg-warning` to invent custom active tab indicators on the fly. The component handles its own accessible active state natively.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Utility Components
|
|
2
|
+
|
|
3
|
+
Separator, Skeleton, Toggle, ToggleGroup, Command, and ComponentPlaceholder (Mockup Mode Only).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { Separator } from '@reinvented/design'
|
|
7
|
+
import { Skeleton } from '@reinvented/design'
|
|
8
|
+
import { Toggle } from '@reinvented/design'
|
|
9
|
+
import { ToggleGroup, ToggleGroupItem } from '@reinvented/design'
|
|
10
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from '@reinvented/design'
|
|
11
|
+
import { ComponentPlaceholder } from '@reinvented/design'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Separator
|
|
15
|
+
|
|
16
|
+
Visual divider between content sections.
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
<Separator /> <!-- Horizontal (default) -->
|
|
20
|
+
<Separator orientation="vertical" className="h-4" /> <!-- Vertical -->
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Use between form sections, within cards to divide content groups, in dropdown menus (`DropdownMenuSeparator`).
|
|
24
|
+
|
|
25
|
+
## Skeleton
|
|
26
|
+
|
|
27
|
+
Loading placeholders. Must match the shape and layout of the actual content they replace.
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
<!-- User list item skeleton -->
|
|
31
|
+
<div className="flex items-center gap-3 p-4">
|
|
32
|
+
<Skeleton className="w-10 h-10 rounded-full" />
|
|
33
|
+
<div className="flex-1 space-y-2">
|
|
34
|
+
<Skeleton className="h-4 w-3/4" />
|
|
35
|
+
<Skeleton className="h-3 w-1/2" />
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<!-- Stat card skeleton -->
|
|
40
|
+
<Card>
|
|
41
|
+
<CardHeader className="pb-2">
|
|
42
|
+
<Skeleton className="h-4 w-24" />
|
|
43
|
+
</CardHeader>
|
|
44
|
+
<CardContent>
|
|
45
|
+
<Skeleton className="h-8 w-20 mb-1" />
|
|
46
|
+
<Skeleton className="h-3 w-32" />
|
|
47
|
+
</CardContent>
|
|
48
|
+
</Card>
|
|
49
|
+
|
|
50
|
+
<!-- Table row skeleton -->
|
|
51
|
+
<TableRow>
|
|
52
|
+
<TableCell><Skeleton className="h-4 w-32" /></TableCell>
|
|
53
|
+
<TableCell><Skeleton className="h-4 w-48" /></TableCell>
|
|
54
|
+
<TableCell><Skeleton className="h-5 w-16 rounded-full" /></TableCell>
|
|
55
|
+
<TableCell className="text-right"><Skeleton className="h-4 w-16 ml-auto" /></TableCell>
|
|
56
|
+
</TableRow>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Rules:
|
|
60
|
+
- Skeletons must mirror the real content's shape, size, and position
|
|
61
|
+
- Show 3–5 skeleton items for lists
|
|
62
|
+
- Use `rounded-full` for avatar skeletons, `rounded-md` for badges
|
|
63
|
+
|
|
64
|
+
## Toggle & ToggleGroup
|
|
65
|
+
|
|
66
|
+
Pressed/unpressed state buttons. Use for view switching or formatting toolbar buttons.
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
<!-- Single toggle -->
|
|
70
|
+
<Toggle aria-label="Toggle bold">
|
|
71
|
+
<Bold className="w-4 h-4" />
|
|
72
|
+
</Toggle>
|
|
73
|
+
|
|
74
|
+
<!-- View switcher -->
|
|
75
|
+
<ToggleGroup type="single" defaultValue="viewMode">
|
|
76
|
+
<ToggleGroupItem value="grid" aria-label="Grid view">
|
|
77
|
+
<LayoutGrid className="w-4 h-4" />
|
|
78
|
+
</ToggleGroupItem>
|
|
79
|
+
<ToggleGroupItem value="list" aria-label="List view">
|
|
80
|
+
<List className="w-4 h-4" />
|
|
81
|
+
</ToggleGroupItem>
|
|
82
|
+
</ToggleGroup>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Command
|
|
86
|
+
|
|
87
|
+
Searchable command palette / combobox. Use for command-K menus or searchable selection lists.
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
<Command className="rounded-lg border shadow-md">
|
|
91
|
+
<CommandInput placeholder="Type a command or search..." />
|
|
92
|
+
<CommandList>
|
|
93
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
94
|
+
<CommandGroup heading="Suggestions">
|
|
95
|
+
<CommandItem>
|
|
96
|
+
<Calendar className="w-4 h-4" /> Calendar
|
|
97
|
+
</CommandItem>
|
|
98
|
+
<CommandItem>
|
|
99
|
+
<Search className="w-4 h-4" /> Search
|
|
100
|
+
</CommandItem>
|
|
101
|
+
</CommandGroup>
|
|
102
|
+
<CommandSeparator />
|
|
103
|
+
<CommandGroup heading="Settings">
|
|
104
|
+
<CommandItem>
|
|
105
|
+
<Settings className="w-4 h-4" /> Settings
|
|
106
|
+
</CommandItem>
|
|
107
|
+
</CommandGroup>
|
|
108
|
+
</CommandList>
|
|
109
|
+
</Command>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
For a command-K dialog, wrap in `Dialog`:
|
|
113
|
+
```tsx
|
|
114
|
+
<Dialog>
|
|
115
|
+
<DialogContent className="p-0">
|
|
116
|
+
<Command>
|
|
117
|
+
<!-- ... -->
|
|
118
|
+
</Command>
|
|
119
|
+
</DialogContent>
|
|
120
|
+
</Dialog>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## ComponentPlaceholder (Mockup Mode Only)
|
|
124
|
+
|
|
125
|
+
In mockup mode, use this when a component doesn't exist in the DS (charts, maps, rich text editors, video players). In production, use actual third-party libraries instead.
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
<ComponentPlaceholder
|
|
129
|
+
name="AreaChart"
|
|
130
|
+
description="Revenue trend over the last 12 months with monthly breakdown"
|
|
131
|
+
height="300px"
|
|
132
|
+
/>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Always provide:
|
|
136
|
+
- `name`: What the component would be called
|
|
137
|
+
- `description`: What it would show (specific enough to communicate the intent)
|
|
138
|
+
- `height`: Approximate height to reserve in the layout
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Device: Desktop
|
|
2
|
+
|
|
3
|
+
Viewport ≥ 768px. This covers standard laptops, large monitors, and tablets (which behave like small desktops in landscape).
|
|
4
|
+
|
|
5
|
+
## Breakpoints Used
|
|
6
|
+
|
|
7
|
+
| Prefix | Min Width | Usage |
|
|
8
|
+
|--------|-----------|-------|
|
|
9
|
+
| `sm:` | 640px | 2-column grids, side-by-side buttons |
|
|
10
|
+
| `md:` | 768px | Desktop layout kicks in — sidebars, multi-panel |
|
|
11
|
+
| `lg:` | 1024px | Full multi-column grids (3-4 cols), wide content areas |
|
|
12
|
+
| `xl:` | 1280px | Max-width containers fully visible |
|
|
13
|
+
|
|
14
|
+
## Layout Rules
|
|
15
|
+
|
|
16
|
+
- **Content container**: Always constrain width with `max-w-7xl mx-auto px-6` — don't let lines of text span 1400px+
|
|
17
|
+
- **Sidebar**: Use `w-64` (256px), visible from `md:` breakpoint up
|
|
18
|
+
- **Grids**: 2 cols at `sm:`, 3 cols at `lg:`, 4 cols at `lg:` for stat cards
|
|
19
|
+
- **Spacing**: Standard `gap-4` for grids, `gap-6` to `gap-8` between major sections
|
|
20
|
+
- **Side-by-side panels**: List-detail layouts work well on desktop
|
|
21
|
+
|
|
22
|
+
## Responsive Pattern Summary
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<!-- Grid: stack → 2 → 3 cols -->
|
|
26
|
+
className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4"
|
|
27
|
+
|
|
28
|
+
<!-- Stack on small, row on larger -->
|
|
29
|
+
className="flex flex-col sm:flex-row gap-4"
|
|
30
|
+
|
|
31
|
+
<!-- Page header: stack on small, row on larger -->
|
|
32
|
+
className="flex flex-col sm:flex-row sm:items-center justify-between gap-4"
|
|
33
|
+
|
|
34
|
+
<!-- Full width on mobile, auto on desktop -->
|
|
35
|
+
className="w-full sm:w-auto"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Tablets
|
|
39
|
+
|
|
40
|
+
Tablets in landscape (1024px+) behave like desktops. Tablets in portrait (768–1024px) may need:
|
|
41
|
+
- `md:` breakpoint adjustments (sidebar visible but narrower, or use Sheet drawer)
|
|
42
|
+
- Touch-friendly targets: keep interactive elements at `h-10` (40px) minimum
|
|
43
|
+
- The standard responsive grid system handles tablet seamlessly — no special treatment needed
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Device: Mobile
|
|
2
|
+
|
|
3
|
+
Viewport < 768px. Smartphones in portrait mode.
|
|
4
|
+
|
|
5
|
+
## Core Principles
|
|
6
|
+
|
|
7
|
+
Everything is single-column. Touch targets are large. Navigation is simplified.
|
|
8
|
+
|
|
9
|
+
## Layout Adaptations
|
|
10
|
+
|
|
11
|
+
### No Sidebar
|
|
12
|
+
Replace sidebar navigation with one of:
|
|
13
|
+
|
|
14
|
+
**Bottom tabs** (recommended for consumer apps, max 5 items):
|
|
15
|
+
*Note: Only include bottom nav if you are explicitly generating a full app shell. For specific inner views, omit top/bottom root navigation.*
|
|
16
|
+
```tsx
|
|
17
|
+
<nav className="fixed bottom-0 left-0 right-0 border-t bg-card z-50">
|
|
18
|
+
<div className="flex items-center justify-around h-14">
|
|
19
|
+
<button v-for="tab in tabs" :key="tab.label"
|
|
20
|
+
className={cn('flex flex-col items-center gap-1 p-2 text-xs transition-colors',
|
|
21
|
+
tab.active ? 'text-primary' : 'text-muted-foreground')}>
|
|
22
|
+
<component :is="tab.icon" className="w-5 h-5" />
|
|
23
|
+
<span>{{ tab.label }}</span>
|
|
24
|
+
</button>
|
|
25
|
+
</div>
|
|
26
|
+
</nav>
|
|
27
|
+
<!-- Add pb-16 to main content to clear bottom nav -->
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Hamburger menu** (for complex apps):
|
|
31
|
+
```tsx
|
|
32
|
+
<Sheet>
|
|
33
|
+
<SheetTrigger as-child>
|
|
34
|
+
<Button variant="ghost" size="icon">
|
|
35
|
+
<Menu className="w-5 h-5" />
|
|
36
|
+
</Button>
|
|
37
|
+
</SheetTrigger>
|
|
38
|
+
<SheetContent side="left" className="w-64 p-0">
|
|
39
|
+
<!-- Reuse sidebar nav content -->
|
|
40
|
+
</SheetContent>
|
|
41
|
+
</Sheet>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Single Column Everything
|
|
45
|
+
```html
|
|
46
|
+
className="grid grid-cols-1 gap-4" <!-- All grids collapse to 1 column -->
|
|
47
|
+
className="px-4 py-6" <!-- Tighter page padding than desktop -->
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Component Swaps
|
|
51
|
+
|
|
52
|
+
| Desktop Pattern | Mobile Alternative |
|
|
53
|
+
|----------------|-------------------|
|
|
54
|
+
| Data table | Card list (stacked cards with key info) |
|
|
55
|
+
| Dialog | Bottom Sheet (`Sheet side="bottom"`) |
|
|
56
|
+
| Horizontal toolbar | Simplified — fewer filters, icon-only buttons |
|
|
57
|
+
| Side-by-side panels | Drill-down navigation (list page → detail page) |
|
|
58
|
+
| Dropdown menus | Bottom Sheet action list |
|
|
59
|
+
| Stat cards (4 cols) | 2-column grid or horizontal scroll |
|
|
60
|
+
|
|
61
|
+
### Touch Targets
|
|
62
|
+
- **Minimum 44px** height (`h-11`) for all tappable elements
|
|
63
|
+
- Use `size="lg"` buttons for primary actions
|
|
64
|
+
- No hover-dependent interactions — everything must work on tap
|
|
65
|
+
|
|
66
|
+
### Content Adjustments
|
|
67
|
+
- **Content padding**: `px-4` (not `px-6`)
|
|
68
|
+
- **Page titles**: `text-xl font-bold` (slightly smaller than desktop's `text-2xl`)
|
|
69
|
+
- **Tables → cards**: Replace tabular data with stacked card layouts showing key fields
|
|
70
|
+
- **Button groups**: Stack vertically with `w-full` on each button
|
|
71
|
+
|
|
72
|
+
## Rules
|
|
73
|
+
- Maximum 5 bottom tab items
|
|
74
|
+
- No hover-only interactions — everything must be accessible via tap
|
|
75
|
+
- Full-width primary action buttons
|
|
76
|
+
- Bottom Sheet instead of Dialog for most interactions
|
|
77
|
+
- `pb-16` on main content when using fixed bottom navigation
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Design Principles
|
|
2
|
+
|
|
3
|
+
These principles define what "good" looks like. Every decision should trace back to one of these.
|
|
4
|
+
|
|
5
|
+
## 1. Quiet Confidence
|
|
6
|
+
|
|
7
|
+
The UI should feel assured, not loud. Avoid heavy borders, intense shadows, and saturated backgrounds. Instead, use:
|
|
8
|
+
- Subtle `border-border` borders (1px, muted)
|
|
9
|
+
- Minimal shadows (`shadow-sm` on cards, `shadow-lg` only on overlays)
|
|
10
|
+
- Generous whitespace that lets content breathe
|
|
11
|
+
- A restrained color palette where `primary` is used sparingly for key actions
|
|
12
|
+
|
|
13
|
+
**Good**: A clean card with a thin border, a clear title, and a well-spaced content area.
|
|
14
|
+
**Bad**: A card with a thick colored border, a gradient header, heavy drop shadow, and cramped content.
|
|
15
|
+
|
|
16
|
+
## 2. Clear Visual Hierarchy
|
|
17
|
+
|
|
18
|
+
Every view must have an obvious reading order. Achieve this through:
|
|
19
|
+
- **One `text-2xl font-bold` page title** per view — the most prominent text element
|
|
20
|
+
- **Section headings at `text-lg font-semibold`** — clearly subordinate to the page title
|
|
21
|
+
- **Body text at `text-sm`** — the default reading size
|
|
22
|
+
- **Secondary text always uses `text-muted-foreground`** — visually recedes
|
|
23
|
+
- **Primary actions stand out** — use the default Button variant; secondary actions use `variant="outline"` or `variant="ghost"`
|
|
24
|
+
|
|
25
|
+
The eye should flow: Title → Stats/Summary → Primary Content → Secondary Content → Actions.
|
|
26
|
+
|
|
27
|
+
## 3. Purposeful Density
|
|
28
|
+
|
|
29
|
+
Show enough content to feel real, but not so much that it overwhelms:
|
|
30
|
+
|
|
31
|
+
| Element | Too sparse | Right | Too dense |
|
|
32
|
+
|---------|-----------|-------|-----------|
|
|
33
|
+
| Table rows | 1–2 | 5–8 | 20+ without pagination |
|
|
34
|
+
| Stat cards | 1 | 3–4 | 8+ |
|
|
35
|
+
| Sidebar links | 1–2 | 4–7 | 15+ |
|
|
36
|
+
| Form fields per section | 1 | 3–5 | 10+ without grouping |
|
|
37
|
+
|
|
38
|
+
## 4. Consistent Rhythm
|
|
39
|
+
|
|
40
|
+
Pages should have a predictable spatial cadence:
|
|
41
|
+
- **Within a group** (e.g., label + input): `gap-2` (8px)
|
|
42
|
+
- **Between items** (e.g., cards in a list): `gap-4` (16px)
|
|
43
|
+
- **Between sections** (e.g., header → content → footer): `gap-6` (24px) or `gap-8` (32px)
|
|
44
|
+
|
|
45
|
+
Never use the same gap for all three levels. The contrast creates hierarchy.
|
|
46
|
+
|
|
47
|
+
## 5. Component-First
|
|
48
|
+
|
|
49
|
+
Never write raw HTML when a design system component exists. Every `<button>` must be `<Button>`, every `<input>` must be `<Input>`, every `<select>` must be `<Select>`. The design system components carry the correct tokens, accessibility attributes, and interaction states.
|
|
50
|
+
|
|
51
|
+
## 6. Token-Driven Color
|
|
52
|
+
|
|
53
|
+
Never hardcode colors. The token system ensures light/dark mode compatibility:
|
|
54
|
+
- Page backgrounds: `bg-background`
|
|
55
|
+
- Card surfaces: `bg-card`
|
|
56
|
+
- Primary text: `text-foreground`
|
|
57
|
+
- Secondary text: `text-muted-foreground`
|
|
58
|
+
- Borders: `border-border`
|
|
59
|
+
- Primary actions: `bg-primary text-primary-foreground`
|
|
60
|
+
- Destructive actions: `bg-destructive text-destructive-foreground`
|
|
61
|
+
|
|
62
|
+
## 7. Resilient States
|
|
63
|
+
|
|
64
|
+
Every view must handle four states:
|
|
65
|
+
1. **Loading**: Skeleton placeholders matching the shape of real content
|
|
66
|
+
2. **Empty**: Centered icon + title + description + CTA button
|
|
67
|
+
3. **Error**: Alert banner with retry action, or toast for mutations
|
|
68
|
+
4. **Populated**: The primary UI with realistic data
|
|
69
|
+
|
|
70
|
+
## 8. Invisible Polish
|
|
71
|
+
|
|
72
|
+
The best UIs feel good without the user knowing why. This comes from:
|
|
73
|
+
- **Hover states on interactive elements**: `hover:bg-accent/50` on clickable cards, `hover:bg-accent` on list items
|
|
74
|
+
- **Smooth transitions**: `transition-colors duration-150` on all interactive elements
|
|
75
|
+
- **Proper cursor**: `cursor-pointer` on clickable elements
|
|
76
|
+
- **Focus rings**: Built into DS components via `ring` token
|
|
77
|
+
- **Consistent icon sizing**: `w-4 h-4` inline, `w-5 h-5` in nav, `w-12 h-12` in empty states
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Design Tokens
|
|
2
|
+
|
|
3
|
+
All values are defined as CSS custom properties and exposed through Tailwind utility classes. Never hardcode colors, spacing, or typography — always use tokens.
|
|
4
|
+
|
|
5
|
+
## Colors
|
|
6
|
+
|
|
7
|
+
Brand color is **Emerald green**.
|
|
8
|
+
|
|
9
|
+
### Semantic Color Tokens
|
|
10
|
+
|
|
11
|
+
| Token | Tailwind Classes | Light Value | Dark Value | When to Use |
|
|
12
|
+
|-------|-----------------|-------------|------------|-------------|
|
|
13
|
+
| `background` | `bg-background` | White | Near-black `hsl(240 10% 3.9%)` | Page backgrounds |
|
|
14
|
+
| `foreground` | `text-foreground` | Near-black | Near-white | Primary text |
|
|
15
|
+
| `card` | `bg-card` | White | Near-black | Card and container surfaces |
|
|
16
|
+
| `card-foreground` | `text-card-foreground` | Near-black | Near-white | Text inside cards |
|
|
17
|
+
| `primary` | `bg-primary`, `text-primary` | Emerald `hsl(160 84% 39%)` | Brighter emerald `hsl(160 84% 45%)` | Primary buttons, links, active states |
|
|
18
|
+
| `primary-foreground` | `text-primary-foreground` | White | White | Text on primary backgrounds |
|
|
19
|
+
| `secondary` | `bg-secondary` | Light zinc | Dark zinc `hsl(240 3.7% 15.9%)` | Secondary buttons, subtle backgrounds |
|
|
20
|
+
| `secondary-foreground` | `text-secondary-foreground` | Dark | Light | Text on secondary backgrounds |
|
|
21
|
+
| `muted` | `bg-muted` | Light zinc | Dark zinc | Muted backgrounds, disabled states, chip backgrounds |
|
|
22
|
+
| `muted-foreground` | `text-muted-foreground` | Medium gray | Light gray | Secondary text, captions, timestamps, placeholders |
|
|
23
|
+
| `accent` | `bg-accent` | Light zinc | Dark zinc | Hover backgrounds for list items, nav items |
|
|
24
|
+
| `destructive` | `bg-destructive` | Red | Darker red | Delete buttons, error states |
|
|
25
|
+
| `border` | `border-border` | Light gray | Dark gray | All borders |
|
|
26
|
+
| `input` | `border-input` | Light gray | Dark gray | Input field borders |
|
|
27
|
+
| `ring` | `ring-ring` | Emerald | Emerald | Focus rings |
|
|
28
|
+
|
|
29
|
+
### Status Colors
|
|
30
|
+
|
|
31
|
+
| Token | Tailwind Classes | When to Use |
|
|
32
|
+
|-------|-----------------|-------------|
|
|
33
|
+
| `success` | `bg-success text-success-foreground` | Confirmation badges, success alerts |
|
|
34
|
+
| `warning` | `bg-warning text-warning-foreground` | Warning badges, caution alerts |
|
|
35
|
+
| `info` | `bg-info text-info-foreground` | Informational badges, info alerts |
|
|
36
|
+
|
|
37
|
+
### Color Usage Rules
|
|
38
|
+
|
|
39
|
+
- **Primary** (`bg-primary`): Use sparingly — only for the main CTA button, active nav items, and key interactive elements. Overusing primary color makes the UI feel noisy.
|
|
40
|
+
- **Muted foreground** (`text-muted-foreground`): The workhorse for secondary text. Use for descriptions, timestamps, helper text, table column headers.
|
|
41
|
+
- **Accent** (`bg-accent`): Hover/active state background for interactive list items and nav links. Not for static content.
|
|
42
|
+
- **Destructive** (`bg-destructive`): Only for genuinely destructive actions (delete, remove). Never for warnings.
|
|
43
|
+
- **NEVER invent new semantic solid colors**: Do not stack arbitrary Tailwind utilities (e.g., `bg-green-500` or `bg-blue-500`) to create custom filled buttons or alerts. Stick ONLY to `primary`, `secondary`, `destructive`, `muted`, or `warning/success/info`.
|
|
44
|
+
- **NEVER use filled backgrounds for icons**: Icons should generally be transparent with `text-muted-foreground` or `text-primary`. Do not place icons inside saturated `bg-color/10` or solid colored squares/circles (especially in Stat Cards) as it breaks the Shadcn aesthetic.
|
|
45
|
+
|
|
46
|
+
## Typography
|
|
47
|
+
|
|
48
|
+
Font: **Inter** (loaded via Google Fonts, fallback: system sans-serif).
|
|
49
|
+
|
|
50
|
+
| Class | Size | Weight | Use |
|
|
51
|
+
|-------|------|--------|-----|
|
|
52
|
+
| `text-3xl font-bold` | 30px / Bold | 700 | Hero headings (rare, marketing pages) |
|
|
53
|
+
| `text-2xl font-bold` | 24px / Bold | 700 | Page titles — exactly one per view |
|
|
54
|
+
| `text-xl font-semibold` | 20px / Semibold | 600 | Page subtitles (under the title) |
|
|
55
|
+
| `text-lg font-semibold` | 18px / Semibold | 600 | Section headings inside a page |
|
|
56
|
+
| `text-base` | 16px / Normal | 400 | Default body text (rarely used — prefer text-sm) |
|
|
57
|
+
| `text-sm` | 14px / Normal | 400 | Standard body text, table cells, form labels |
|
|
58
|
+
| `text-sm font-medium` | 14px / Medium | 500 | Labels, emphasized body text, nav items |
|
|
59
|
+
| `text-xs text-muted-foreground` | 12px / Normal | 400 | Timestamps, captions, metadata |
|
|
60
|
+
|
|
61
|
+
### Typography Rules
|
|
62
|
+
|
|
63
|
+
- **`text-sm` is the default reading size**, not `text-base`. shadcn UIs are compact.
|
|
64
|
+
- **Page titles** (`text-2xl font-bold`): Exactly one per view. Always at the top.
|
|
65
|
+
- **Line height**: Use `leading-tight` (1.25) for headings, default (1.5) for body.
|
|
66
|
+
- **Never use `text-lg` or larger for body text** — it makes the UI feel inflated.
|
|
67
|
+
|
|
68
|
+
## Spacing
|
|
69
|
+
|
|
70
|
+
Based on 4px increments. Use Tailwind utilities exclusively.
|
|
71
|
+
|
|
72
|
+
| Class | Value | When to Use |
|
|
73
|
+
|-------|-------|-------------|
|
|
74
|
+
| `gap-1` | 4px | Icon-to-text within a button |
|
|
75
|
+
| `gap-1.5` | 6px | Tight groupings (badge + text) |
|
|
76
|
+
| `gap-2` | 8px | Label-to-input, items within a small group |
|
|
77
|
+
| `gap-3` | 12px | Between form fields, inline elements |
|
|
78
|
+
| `gap-4` | 16px | Between cards in a grid, between list items |
|
|
79
|
+
| `gap-6` | 24px | Between major page sections |
|
|
80
|
+
| `gap-8` | 32px | Between top-level page regions |
|
|
81
|
+
| `p-4` | 16px | Standard internal padding (compact cards) |
|
|
82
|
+
| `p-6` | 24px | Standard card padding, modal content padding |
|
|
83
|
+
| `px-6 py-8` | 24px / 32px | Page-level padding around content |
|
|
84
|
+
|
|
85
|
+
### Three-Level Spacing Rule
|
|
86
|
+
|
|
87
|
+
Every page should use three levels of spacing, creating visual grouping:
|
|
88
|
+
|
|
89
|
+
1. **Tight** (`gap-1` to `gap-2`): Between elements within a component (icon + label, label + input)
|
|
90
|
+
2. **Medium** (`gap-3` to `gap-4`): Between sibling items (form fields, cards in a grid, list items)
|
|
91
|
+
3. **Loose** (`gap-6` to `gap-8`): Between major sections (page header → content → footer)
|
|
92
|
+
|
|
93
|
+
## Borders and Radius
|
|
94
|
+
|
|
95
|
+
| Class | Value | When to Use |
|
|
96
|
+
|-------|-------|-------------|
|
|
97
|
+
| `rounded-sm` | ~6px | Small inner elements |
|
|
98
|
+
| `rounded-md` | ~8px | Inputs, buttons, small containers |
|
|
99
|
+
| `rounded-lg` | 10px | Cards, dialogs, containers |
|
|
100
|
+
| `rounded-full` | 50% | Avatars, status dots |
|
|
101
|
+
| `border` | 1px solid `border-border` | Card borders, section dividers |
|
|
102
|
+
| `divide-y` | 1px borders between children | Lists, table-like layouts |
|
|
103
|
+
|
|
104
|
+
## Shadows
|
|
105
|
+
|
|
106
|
+
| Class | When to Use |
|
|
107
|
+
|-------|-------------|
|
|
108
|
+
| `shadow-sm` | Subtle — default cards (often unnecessary since borders define cards) |
|
|
109
|
+
| `shadow-md` | Dropdowns, popovers, floating elements |
|
|
110
|
+
| `shadow-lg` | Modals, dialogs, command palette |
|
|
111
|
+
|
|
112
|
+
In dark mode, shadows are nearly invisible. Rely on borders (`border-border`) for elevation in dark mode.
|
|
113
|
+
|
|
114
|
+
## Transitions
|
|
115
|
+
|
|
116
|
+
| Class | When to Use |
|
|
117
|
+
|-------|-------------|
|
|
118
|
+
| `transition-colors duration-150` | Hover state color changes (buttons, links, list items) |
|
|
119
|
+
| `transition-shadow duration-150` | Card hover shadow lift |
|
|
120
|
+
| `transition-all duration-200` | Multi-property transitions (modals appearing, tooltips) |
|
|
121
|
+
| `transition-transform duration-150` | Scale effects (button press: `active:scale-[0.98]`) |
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Mockup Generation Mode
|
|
2
|
+
|
|
3
|
+
> **This file is ONLY relevant when generating standalone mockups.** Skip this file if you're building production code with real data, routing, and APIs.
|
|
4
|
+
|
|
5
|
+
Mockups are single-file Vue SFC demos that simulate a real UI without backend connections. They need special handling for data, images, and missing components.
|
|
6
|
+
|
|
7
|
+
## Output Format
|
|
8
|
+
|
|
9
|
+
Generate a **single Vue 3 SFC file**:
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
// React Component
|
|
13
|
+
import { ref, computed } from 'react'
|
|
14
|
+
import { Button, Card, CardHeader, CardTitle, CardContent } from '@reinvented/design'
|
|
15
|
+
import { Plus, Search } from 'lucide-react'
|
|
16
|
+
|
|
17
|
+
// Reactive state and dummy data here
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export default function Component() {
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
<!-- Your UI here -->
|
|
24
|
+
</>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
<!-- Only if absolutely needed for animations -->
|
|
29
|
+
<style scoped>
|
|
30
|
+
</style>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Available Imports
|
|
34
|
+
|
|
35
|
+
**Only these three packages exist in mockup mode.** Nothing else is installed.
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { ... } from 'react' // ref, computed, watch, onMounted, reactive, etc.
|
|
39
|
+
import { ... } from '@reinvented/design' // All DS components + cn() + toast
|
|
40
|
+
import { ... } from 'lucide-react' // All Lucide icons
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
No axios, no fetch, no lodash, no react-router-dom, no pinia. Data visualization should exclusively use the built-in Shadcn chart components (`AreaChart`, `BarChart`, `LineChart`, `DonutChart` from `@reinvented/design`). DO NOT use third-party chart libraries and DO NOT use `ComponentPlaceholder` for standard charts.
|
|
44
|
+
|
|
45
|
+
## Dummy Data
|
|
46
|
+
|
|
47
|
+
Fill the UI with **realistic, believable data**. This is critical for the mockup to feel real.
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
// ✅ Good — believable, diverse names and data
|
|
51
|
+
const teamMembers = ref([
|
|
52
|
+
{ id: 1, name: 'Sarah Chen', email: 'sarah.chen@acme.co', role: 'Engineering Lead', status: 'active' },
|
|
53
|
+
{ id: 2, name: 'Marcus Johnson', email: 'marcus.j@acme.co', role: 'Product Designer', status: 'active' },
|
|
54
|
+
{ id: 3, name: 'Priya Sharma', email: 'priya.s@acme.co', role: 'Frontend Developer', status: 'away' },
|
|
55
|
+
{ id: 4, name: 'Alex Rivera', email: 'alex.r@acme.co', role: 'Backend Engineer', status: 'active' },
|
|
56
|
+
{ id: 5, name: 'Emma Watson', email: 'emma.w@acme.co', role: 'QA Engineer', status: 'offline' },
|
|
57
|
+
])
|
|
58
|
+
|
|
59
|
+
// ❌ Bad — generic, fake-looking
|
|
60
|
+
const users = ref([
|
|
61
|
+
{ id: 1, name: 'User 1', email: 'user1@test.com' },
|
|
62
|
+
{ id: 2, name: 'Test User', email: 'test@example.com' },
|
|
63
|
+
])
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Use plausible amounts ($12,450 not $1), realistic dates (Mar 15, 2024 not 01/01/2000), and genuine-sounding company/project names.
|
|
67
|
+
|
|
68
|
+
## Image Replacements
|
|
69
|
+
|
|
70
|
+
In mockups, never use `<img>` tags or image URLs. Replace with CSS gradient backgrounds:
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
<!-- Avatar Fallback (Do NOT use vibrant gradients, stick to Shadcn defaults) -->
|
|
74
|
+
<Avatar className="w-10 h-10">
|
|
75
|
+
<AvatarFallback className="bg-muted text-muted-foreground">
|
|
76
|
+
{{ user.name.split(' ').map(n => n[0]).join('') }}
|
|
77
|
+
</AvatarFallback>
|
|
78
|
+
</Avatar>
|
|
79
|
+
|
|
80
|
+
<!-- Hero/banner image placeholder -->
|
|
81
|
+
<div className="w-full h-48 rounded-lg bg-gradient-to-br from-primary/20 via-primary/5 to-transparent" />
|
|
82
|
+
<!-- Thumbnail -->
|
|
83
|
+
<div className="w-16 h-16 rounded-md bg-gradient-to-br from-muted to-muted/50" />
|
|
84
|
+
<!-- Product image -->
|
|
85
|
+
<div className="aspect-square rounded-lg bg-gradient-to-br from-secondary to-secondary/50" />
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Missing Components — ComponentPlaceholder
|
|
89
|
+
|
|
90
|
+
If you need a component that doesn't exist in the DS (maps, calendars, code editors, rich text editors), use `ComponentPlaceholder`:
|
|
91
|
+
|
|
92
|
+
**NOTE:** Do NOT use `ComponentPlaceholder` for standard charts! `BarChart`, `AreaChart`, `LineChart`, and `DonutChart` are fully supported natively via `@reinvented/design`.
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
import { ComponentPlaceholder } from '@reinvented/design'
|
|
96
|
+
|
|
97
|
+
<ComponentPlaceholder
|
|
98
|
+
name="InteractiveMap"
|
|
99
|
+
description="Map showing multiple geographic locations with pins"
|
|
100
|
+
height="300px"
|
|
101
|
+
/>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Always provide:
|
|
105
|
+
- `name`: What the component would be called
|
|
106
|
+
- `description`: What it would show (specific enough to communicate the intent)
|
|
107
|
+
- `height`: Approximate height to reserve in the layout
|
|
108
|
+
|
|
109
|
+
## Device Chrome & Navigation
|
|
110
|
+
|
|
111
|
+
Do NOT render fake device hardware or OS-level chrome (e.g., phone bezels, status bars with time/wifi/battery, or browser address bars).
|
|
112
|
+
Mockups should only render the app's UI elements, filling the available viewport naturally. The testing environment will handle simulating device screens.
|
|
113
|
+
|
|
114
|
+
Similarly, only include layout navigation (like sidebars, bottom tabs, or back buttons) if you are explicitly designing a full-page root layout. If you are asked to design a specific inner view, do not wrap it in a root nav shell — just render the view itself.
|
|
115
|
+
|
|
116
|
+
## Dark Mode
|
|
117
|
+
|
|
118
|
+
Mockups render with the `.dark` class on `<html>` by default. All token-based classes automatically resolve to dark values. You do NOT need to add `dark:` variants — just use the semantic tokens.
|