@reinvented/design 1.0.0 → 1.2.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/src/components/blocks/auth/auth-card/AuthCard.tsx +2 -2
- package/src/components/blocks/auth/social-login/SocialLoginGroup.tsx +2 -2
- package/src/components/blocks/auth/two-factor/TwoFactorForm.tsx +4 -4
- package/src/components/blocks/communication/activity-item/ActivityItem.tsx +1 -1
- package/src/components/blocks/communication/activity-item/ActivityItemAvatar.tsx +2 -2
- package/src/components/blocks/communication/activity-item/ActivityItemContent.tsx +1 -1
- package/src/components/blocks/communication/chat-bubble/ChatBubble.tsx +1 -1
- package/src/components/blocks/communication/chat-bubble/ChatBubbleAvatar.tsx +2 -2
- package/src/components/blocks/communication/chat-bubble/ChatBubbleMessage.tsx +1 -1
- package/src/components/blocks/communication/chat-bubble/ChatBubbleTimestamp.tsx +1 -1
- package/src/components/blocks/content/article-header/ArticleHeader.tsx +3 -3
- package/src/components/blocks/content/author-card/AuthorCard.tsx +4 -4
- package/src/components/blocks/content/rich-text/RichTextContent.tsx +1 -1
- package/src/components/blocks/data-management/kanban/KanbanBoard.tsx +1 -1
- package/src/components/blocks/data-management/kanban/KanbanCard.tsx +4 -4
- package/src/components/blocks/data-management/kanban/KanbanColumn.tsx +3 -3
- package/src/components/blocks/data-management/tree-view/TreeItem.tsx +2 -2
- package/src/components/blocks/data-management/tree-view/TreeView.tsx +1 -1
- package/src/components/blocks/data-viz/financial-ticker/FinancialTicker.tsx +1 -1
- package/src/components/blocks/data-viz/kpi-card/KpiCard.tsx +2 -2
- package/src/components/blocks/data-viz/stat-grid/StatGrid.tsx +1 -1
- package/src/components/blocks/ecommerce/pricing-tier/PricingFeatureList.tsx +2 -2
- package/src/components/blocks/ecommerce/pricing-tier/PricingHeader.tsx +2 -2
- package/src/components/blocks/ecommerce/pricing-tier/PricingTier.tsx +2 -2
- package/src/components/blocks/ecommerce/product-card/ProductCard.tsx +2 -2
- package/src/components/blocks/ecommerce/product-card/ProductCardContent.tsx +2 -2
- package/src/components/blocks/ecommerce/product-card/ProductCardImage.tsx +1 -1
- package/src/components/blocks/ecommerce/product-card/ProductCardPrice.tsx +1 -1
- package/src/components/blocks/ecommerce/rating-summary/RatingStars.tsx +1 -1
- package/src/components/blocks/feedback/empty-state/EmptyState.tsx +2 -2
- package/src/components/blocks/feedback/error-state/ErrorState.tsx +2 -2
- package/src/components/blocks/feedback/not-found/NotFoundState.tsx +2 -2
- package/src/components/blocks/filtering/faceted-sidebar/FacetedGroup.tsx +2 -2
- package/src/components/blocks/filtering/faceted-sidebar/FacetedSidebar.tsx +2 -2
- package/src/components/blocks/filtering/filter-bar/FilterBar.tsx +4 -4
- package/src/components/blocks/filtering/search-result/SearchResultItem.tsx +2 -2
- package/src/components/blocks/marketing/cta-block/CtaBlock.tsx +2 -2
- package/src/components/blocks/marketing/feature-grid/FeatureGrid.tsx +1 -1
- package/src/components/blocks/marketing/hero-section/HeroSection.tsx +3 -3
- package/src/components/blocks/marketing/testimonial-card/TestimonialCard.tsx +3 -3
- package/src/components/blocks/media/call-controls/CallControlButton.tsx +3 -3
- package/src/components/blocks/media/call-controls/CallControls.tsx +1 -1
- package/src/components/blocks/media/media-player/MediaPlayer.tsx +1 -1
- package/src/components/blocks/media/media-player/MediaPlayerControls.tsx +1 -1
- package/src/components/blocks/media/media-player/MediaPlayerScrubber.tsx +1 -1
- package/src/components/blocks/media/media-player/MediaPlayerVideo.tsx +1 -1
- package/src/components/blocks/navigation/app-sidebar/AppSidebar.tsx +2 -2
- package/src/components/blocks/navigation/app-sidebar/NavItem.tsx +1 -1
- package/src/components/blocks/navigation/context-switcher/ContextSwitcher.tsx +3 -3
- package/src/components/blocks/navigation/top-navbar/TopNavbar.tsx +2 -2
- package/src/components/blocks/onboarding/onboarding-welcome/OnboardingWelcome.tsx +3 -3
- package/src/components/blocks/onboarding/step-wizard/StepWizard.tsx +1 -1
- package/src/components/blocks/profiles/connection-list/ConnectionItem.tsx +3 -3
- package/src/components/blocks/profiles/connection-list/ConnectionList.tsx +1 -1
- package/src/components/blocks/profiles/profile-header/ProfileHeader.tsx +3 -3
- package/src/components/blocks/profiles/profile-stats/ProfileStats.tsx +1 -1
- package/src/components/blocks/scheduling/booking-slot/BookingSlot.tsx +1 -1
- package/src/components/blocks/scheduling/event-card/EventCard.tsx +3 -3
- package/src/components/blocks/scheduling/timeline-row/TimelineRow.tsx +2 -2
- package/src/components/blocks/settings/billing-usage/BillingUsage.tsx +3 -3
- package/src/components/blocks/settings/integration-card/IntegrationCard.tsx +5 -5
- package/src/components/blocks/settings/settings-section/SettingsSection.tsx +1 -1
- package/src/components/ui/accordion.tsx +1 -1
- package/src/components/ui/alert-dialog.tsx +2 -2
- package/src/components/ui/alert.tsx +1 -1
- package/src/components/ui/avatar.tsx +1 -1
- package/src/components/ui/badge.tsx +7 -1
- package/src/components/ui/breadcrumb.tsx +1 -1
- package/src/components/ui/button.tsx +8 -1
- package/src/components/ui/calendar.tsx +2 -2
- package/src/components/ui/card.tsx +1 -1
- package/src/components/ui/carousel.tsx +2 -2
- package/src/components/ui/chart.tsx +1 -1
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/command.tsx +2 -2
- package/src/components/ui/component-placeholder.tsx +1 -1
- package/src/components/ui/context-menu.tsx +1 -1
- package/src/components/ui/dialog.tsx +1 -1
- package/src/components/ui/drawer.tsx +1 -1
- package/src/components/ui/dropdown-menu.tsx +1 -1
- package/src/components/ui/form.tsx +2 -2
- package/src/components/ui/hover-card.tsx +1 -1
- package/src/components/ui/input-otp.tsx +1 -1
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/menubar.tsx +1 -1
- package/src/components/ui/navigation-menu.tsx +1 -1
- package/src/components/ui/pagination.tsx +2 -2
- package/src/components/ui/popover.tsx +1 -1
- package/src/components/ui/progress.tsx +1 -1
- package/src/components/ui/radio-group.tsx +1 -1
- package/src/components/ui/resizable.tsx +1 -1
- package/src/components/ui/scroll-area.tsx +1 -1
- package/src/components/ui/select.tsx +1 -1
- package/src/components/ui/separator.tsx +1 -1
- package/src/components/ui/sheet.tsx +1 -1
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/slider.tsx +1 -1
- package/src/components/ui/sonner.tsx +13 -6
- package/src/components/ui/switch.tsx +1 -1
- package/src/components/ui/table.tsx +1 -1
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/toast.tsx +1 -1
- package/src/components/ui/toaster.tsx +1 -1
- package/src/components/ui/toggle-group.tsx +2 -2
- package/src/components/ui/toggle.tsx +1 -1
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/hooks/use-toast.ts +1 -1
- package/src/styles/tokens.css +1 -1
- package/DESIGN_GUIDE.md +0 -148
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Persona: Consumer Power User
|
|
2
|
+
|
|
3
|
+
Experienced software users who demand efficiency, high data density, and keyboard shortcuts. Examples include developers using dev tools, traders, or prosumer productivity app obsessives.
|
|
4
|
+
|
|
5
|
+
## Characteristics
|
|
6
|
+
- High technical proficiency
|
|
7
|
+
- Uses the app frequently (daily, often hours at a time)
|
|
8
|
+
- Values speed and functionality over simple visual appeal
|
|
9
|
+
- Willing to learn UI paradigms if they make them faster
|
|
10
|
+
- Primarily Desktop
|
|
11
|
+
|
|
12
|
+
## Design Adjustments
|
|
13
|
+
|
|
14
|
+
| Aspect | Adjustment |
|
|
15
|
+
|--------|-----------|
|
|
16
|
+
| **Density** | Higher — compact spacing (`p-3`, `gap-2`), more data visible above the fold |
|
|
17
|
+
| **Typography** | Standard compact — `text-sm` body, `text-xs` metadata, monospace for technical strings |
|
|
18
|
+
| **Navigation** | Comprehensive — sidebar with collapsible sections (`<Accordion>`), keyboard shortcuts ubiquitous |
|
|
19
|
+
| **Actions** | Keyboard-centric — shortcuts explicitly shown in menus using `<DropdownMenuShortcut>` |
|
|
20
|
+
| **Tables/Lists** | Dense — sortable columns, visible metadata, bulk actions without excessive spacing |
|
|
21
|
+
| **Keyboard** | The Command Palette (`<Command>`) triggered by `⌘K` is essential |
|
|
22
|
+
| **Customization** | Allow view toggles (grid vs list), column visibility, and saved filters |
|
|
23
|
+
| **Feedback** | Subtle and non-blocking — use small toasts (`toast()`). No full-screen confirmation blocks |
|
|
24
|
+
|
|
25
|
+
## Component Composition Example
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
<!-- Prosumer Tool Layout -->
|
|
29
|
+
<div className="space-y-4">
|
|
30
|
+
<div className="flex items-center justify-between border-b pb-4">
|
|
31
|
+
<div className="flex items-center gap-4">
|
|
32
|
+
<h2 className="text-lg font-semibold tracking-tight">API Keys</h2>
|
|
33
|
+
<Badge variant="secondary" className="font-mono text-[10px]">PROD</Badge>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div className="flex items-center gap-2">
|
|
37
|
+
<!-- Search triggered via shortcut -->
|
|
38
|
+
<Button variant="outline" size="sm" className="h-8 text-muted-foreground bg-muted/50 border-dashed">
|
|
39
|
+
<Search className="h-3 w-3 mr-2" />
|
|
40
|
+
Search keys
|
|
41
|
+
<kbd className="ml-4 inline-flex items-center rounded border bg-background px-1.5 font-mono text-[10px] font-medium text-muted-foreground">⌘K</kbd>
|
|
42
|
+
</Button>
|
|
43
|
+
<Button size="sm" className="h-8">Generate Key</Button>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<!-- Data Display: Compact, Mono, Copyable -->
|
|
48
|
+
<Card className="rounded-none sm:rounded-md">
|
|
49
|
+
<Table>
|
|
50
|
+
<TableHeader>
|
|
51
|
+
<TableRow className="h-10 hover:bg-transparent">
|
|
52
|
+
<TableHead className="font-medium text-xs">Name</TableHead>
|
|
53
|
+
<TableHead className="font-medium text-xs">Key Prefix</TableHead>
|
|
54
|
+
<TableHead className="font-medium text-xs">Permissions</TableHead>
|
|
55
|
+
<TableHead className="font-medium text-xs">Created</TableHead>
|
|
56
|
+
<TableHead className="text-right w-12"></TableHead>
|
|
57
|
+
</TableRow>
|
|
58
|
+
</TableHeader>
|
|
59
|
+
<TableBody>
|
|
60
|
+
<TableRow className="h-10">
|
|
61
|
+
<TableCell className="font-medium text-sm w-1/4">Production Frontend</TableCell>
|
|
62
|
+
<TableCell className="w-1/4">
|
|
63
|
+
<div className="flex items-center gap-2 group">
|
|
64
|
+
<span className="font-mono text-xs text-muted-foreground">pk_live_51M...</span>
|
|
65
|
+
<Button variant="ghost" size="icon" className="h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity">
|
|
66
|
+
<Copy className="h-3 w-3" />
|
|
67
|
+
</Button>
|
|
68
|
+
</div>
|
|
69
|
+
</TableCell>
|
|
70
|
+
<TableCell className="text-xs">
|
|
71
|
+
<span className="text-muted-foreground">Read-only</span>
|
|
72
|
+
</TableCell>
|
|
73
|
+
<TableCell className="text-xs text-muted-foreground">Oct 12, 2023</TableCell>
|
|
74
|
+
<TableCell className="text-right">
|
|
75
|
+
<DropdownMenu>
|
|
76
|
+
<DropdownMenuTrigger as-child>
|
|
77
|
+
<Button variant="ghost" size="icon" className="h-7 w-7">
|
|
78
|
+
<MoreVertical className="h-4 w-4" />
|
|
79
|
+
</Button>
|
|
80
|
+
</DropdownMenuTrigger>
|
|
81
|
+
<DropdownMenuContent align="end" className="w-48">
|
|
82
|
+
<DropdownMenuItem>
|
|
83
|
+
Edit Scopes
|
|
84
|
+
<DropdownMenuShortcut>⌘E</DropdownMenuShortcut>
|
|
85
|
+
</DropdownMenuItem>
|
|
86
|
+
<DropdownMenuSeparator />
|
|
87
|
+
<DropdownMenuItem className="text-destructive">
|
|
88
|
+
Revoke Key
|
|
89
|
+
<DropdownMenuShortcut>⌫</DropdownMenuShortcut>
|
|
90
|
+
</DropdownMenuItem>
|
|
91
|
+
</DropdownMenuContent>
|
|
92
|
+
</DropdownMenu>
|
|
93
|
+
</TableCell>
|
|
94
|
+
</TableRow>
|
|
95
|
+
</TableBody>
|
|
96
|
+
</Table>
|
|
97
|
+
</Card>
|
|
98
|
+
</div>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Anti-Patterns (DO NOT DO)
|
|
102
|
+
|
|
103
|
+
- ❌ **Do not use massive padding**: Power users loathe `p-6` or `p-8` inside list elements or forms. Keep padding tight (`p-3` or `p-4`) so more information fits on the screen.
|
|
104
|
+
- ❌ **Do not force wizards on experienced users**: While Consumer Casuals love wizards, Power Users despise being funneled into a long 4-step process. Put everything on one dense settings page.
|
|
105
|
+
- ❌ **Do not use icons without labels (unless universally known)**: Even power users get frustrated by "mystery meat" navigation. Give tooltips (`<Tooltip>`) to every icon-only button and provide `<kbd>` shortcuts.
|
|
106
|
+
- ❌ **Do not block the screen with alerts**: Do not pop up an `<AlertDialog>` for trivial actions like "Item Saved". Use a subtle `toast()` at the bottom right.
|
|
107
|
+
|
|
108
|
+
## Layout Preference
|
|
109
|
+
`layouts/sidebar.md` heavily featuring collapsible groups and deep routing. The main view should frequently resemble `layouts/list-detail.md` to avoid constant page loads.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Persona: Creative Professional
|
|
2
|
+
|
|
3
|
+
Designers, writers, and creators who value aesthetics and flexible workflows.
|
|
4
|
+
|
|
5
|
+
## Characteristics
|
|
6
|
+
- High standard for visual aesthetics
|
|
7
|
+
- Uses the app as a daily primary workspace
|
|
8
|
+
- Demands fluidity and high performance
|
|
9
|
+
- Customizes their workspace to fit their unique workflow
|
|
10
|
+
|
|
11
|
+
## Design Adjustments
|
|
12
|
+
|
|
13
|
+
| Aspect | Adjustment |
|
|
14
|
+
|--------|-----------|
|
|
15
|
+
| **Layout** | Canvas-first — minimize chrome to maximize the work area (`p-0` wrappers) |
|
|
16
|
+
| **Visual** | Minimalist but refined — subtle borders (`border-border/50`), refined typography (`tracking-tight`), extra polish |
|
|
17
|
+
| **Spacing** | Generous content spacing but tight tooling — (`gap-8` for content, `gap-1` for toolbars) |
|
|
18
|
+
| **Data Display** | Visual-first — use masonry or rigid `<Card>` grids for assets, rather than `<Table>` |
|
|
19
|
+
| **Customization** | High — include controls like View Options (`<DropdownMenu>`), layouts, zoom levels |
|
|
20
|
+
| **Tools** | Creative-tool patterns — compact toolbar strips (`<Menubar>` style), context properties panel on right |
|
|
21
|
+
|
|
22
|
+
## Component Composition Example
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
<!-- Creative Canvas Interface -->
|
|
26
|
+
<div className="flex h-screen bg-muted/30 overflow-hidden">
|
|
27
|
+
<!-- Minimal Sidebar / Assets Panel -->
|
|
28
|
+
<aside className="w-64 border-r bg-background flex flex-col">
|
|
29
|
+
<div className="p-4 border-b flex items-center justify-between">
|
|
30
|
+
<span className="text-sm font-medium">Assets</span>
|
|
31
|
+
<Button variant="ghost" size="icon" className="h-8 w-8">
|
|
32
|
+
<Plus className="w-4 h-4" />
|
|
33
|
+
</Button>
|
|
34
|
+
</div>
|
|
35
|
+
<ScrollArea className="flex-1 p-2">
|
|
36
|
+
<!-- Tightly packed tool elements -->
|
|
37
|
+
<div className="space-y-1">
|
|
38
|
+
<Button variant="ghost" className="w-full justify-start h-8 px-2 text-xs">
|
|
39
|
+
<FolderIcon className="w-3 h-3 mr-2 text-muted-foreground" />
|
|
40
|
+
Project Files
|
|
41
|
+
</Button>
|
|
42
|
+
<Button variant="ghost" className="w-full justify-start h-8 px-2 text-xs">
|
|
43
|
+
<ImageIcon className="w-3 h-3 mr-2 text-muted-foreground" />
|
|
44
|
+
Library
|
|
45
|
+
</Button>
|
|
46
|
+
</div>
|
|
47
|
+
</ScrollArea>
|
|
48
|
+
</aside>
|
|
49
|
+
|
|
50
|
+
<!-- Central Canvas -->
|
|
51
|
+
<main className="flex-1 flex flex-col">
|
|
52
|
+
<!-- Slim Top Toolbar -->
|
|
53
|
+
<header className="h-12 border-b bg-background flex items-center px-4 justify-between shrink-0">
|
|
54
|
+
<div className="flex items-center gap-1">
|
|
55
|
+
<Button variant="outline" size="sm" className="h-8 shadow-none">
|
|
56
|
+
<MousePointer2 className="w-4 h-4" />
|
|
57
|
+
</Button>
|
|
58
|
+
<Button variant="ghost" size="sm" className="h-8 text-muted-foreground">
|
|
59
|
+
<Hand className="w-4 h-4" />
|
|
60
|
+
</Button>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<!-- View Controls -->
|
|
64
|
+
<div className="flex items-center gap-2">
|
|
65
|
+
<span className="text-xs text-muted-foreground">100%</span>
|
|
66
|
+
<Slider :default-value="[100]" :max="200" :step="10" className="w-24" />
|
|
67
|
+
</div>
|
|
68
|
+
</header>
|
|
69
|
+
|
|
70
|
+
<!-- Canvas Wrapper -->
|
|
71
|
+
<div className="flex-1 overflow-auto p-12 flex items-center justify-center">
|
|
72
|
+
<!-- In mockups: <ComponentPlaceholder name="CanvasView" description="Main creative workspace" height="500px" /> (Mockup Mode Only) -->
|
|
73
|
+
</div>
|
|
74
|
+
</main>
|
|
75
|
+
|
|
76
|
+
<!-- Right Properties Shelf -->
|
|
77
|
+
<aside className="w-72 border-l bg-background hidden lg:block">
|
|
78
|
+
<div className="p-4 border-b">
|
|
79
|
+
<span className="text-sm font-medium">Properties</span>
|
|
80
|
+
</div>
|
|
81
|
+
<div className="p-4 space-y-6">
|
|
82
|
+
<!-- Tightly spaced form controls -->
|
|
83
|
+
<div className="space-y-3">
|
|
84
|
+
<Label className="text-xs text-muted-foreground uppercase tracking-wider">Dimensions</Label>
|
|
85
|
+
<div className="grid grid-cols-2 gap-2">
|
|
86
|
+
<div className="flex items-center gap-2">
|
|
87
|
+
<span className="text-xs text-muted-foreground w-4">W</span>
|
|
88
|
+
<Input className="h-8 text-xs" value="1920" />
|
|
89
|
+
</div>
|
|
90
|
+
<div className="flex items-center gap-2">
|
|
91
|
+
<span className="text-xs text-muted-foreground w-4">H</span>
|
|
92
|
+
<Input className="h-8 text-xs" value="1080" />
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</aside>
|
|
98
|
+
</div>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Anti-Patterns (DO NOT DO)
|
|
102
|
+
|
|
103
|
+
- ❌ **Do not use chunky headers**: Creative apps need vertical space. Do not use a 100px high header with large text. Use compact toolbars (`h-10` or `h-12`).
|
|
104
|
+
- ❌ **Do not lock the user in**: Creatives hate rigid wizards. Give them a canvas where tools and settings are accessible on demand (via collapsible sidebars).
|
|
105
|
+
- ❌ **Do not use large buttons for tools**: Toolbars should use `size="sm"` or `h-8 w-8` icon buttons to maximize screen real estate.
|
|
106
|
+
- ❌ **Do not rely heavily on data tables**: Visual assets are preferred over spreadsheet views. If lists are needed, make them image-first.
|
|
107
|
+
|
|
108
|
+
## Layout Preference
|
|
109
|
+
Content-editor style: minimal topbar, maximized work area, sidebars for properties and layers. See `layouts/sidebar.md`, but consider making sidebars dual-pane (left and right).
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Persona: Enterprise Admin
|
|
2
|
+
|
|
3
|
+
IT administrators, compliance officers, and system managers in large organizations.
|
|
4
|
+
|
|
5
|
+
## Characteristics
|
|
6
|
+
- Deep technical understanding
|
|
7
|
+
- Values speed, bulk actions, and data clarity over aesthetics
|
|
8
|
+
- Needs to monitor system health and resolve incidents quickly
|
|
9
|
+
- Works with massive datasets (users, logs, permissions)
|
|
10
|
+
|
|
11
|
+
## Design Adjustments
|
|
12
|
+
|
|
13
|
+
| Aspect | Adjustment |
|
|
14
|
+
|--------|-----------|
|
|
15
|
+
| **Density** | High — maximum data visibility, compact rows (`p-2`, `gap-2`). Everything must fit above the fold. |
|
|
16
|
+
| **Navigation** | Deep hierarchy — sidebar with nested sections, breadcrumbs (`<Breadcrumb>`) are essential |
|
|
17
|
+
| **Tables** | Core pattern — dense `<Table>` with column sorting, filtering, row selection (`<Checkbox>`), export options |
|
|
18
|
+
| **Audit** | Omnipresent — show who changed what, when (timestamps, user attribution strings) |
|
|
19
|
+
| **Permissions** | Highly visible — role badges (`<Badge>`), access-level indicators, permission matrices |
|
|
20
|
+
| **Actions** | Conservative — `<AlertDialog>` for all state changes, audit trail logging |
|
|
21
|
+
| **Language** | Formal/Technical — "Configure", "Provision", "Revoke Access", "Audit Log" |
|
|
22
|
+
| **Bulk operations** | Essential — header-row selection with floating bulk action bars |
|
|
23
|
+
|
|
24
|
+
## Component Composition Example
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
<!-- Enterprise Data Grid Layout -->
|
|
28
|
+
<div className="space-y-4">
|
|
29
|
+
<div className="flex items-center justify-between">
|
|
30
|
+
<div className="space-y-1">
|
|
31
|
+
<h2 className="text-xl font-semibold tracking-tight">Identity Management</h2>
|
|
32
|
+
<p className="text-xs text-muted-foreground">Manage organizational directories, SAML providers, and user policies.</p>
|
|
33
|
+
</div>
|
|
34
|
+
<div className="flex items-center gap-2">
|
|
35
|
+
<Button variant="outline" size="sm">
|
|
36
|
+
<Download className="w-4 h-4 mr-2" />
|
|
37
|
+
Export CSV
|
|
38
|
+
</Button>
|
|
39
|
+
<Button size="sm">
|
|
40
|
+
<Plus className="w-4 h-4 mr-2" />
|
|
41
|
+
Provision User
|
|
42
|
+
</Button>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<!-- Advanced Filtering Bar -->
|
|
47
|
+
<Card className="p-2 flex items-center gap-2 bg-muted/50 border-dashed">
|
|
48
|
+
<div className="relative flex-1 max-w-sm">
|
|
49
|
+
<Search className="absolute left-2.5 top-2 h-4 w-4 text-muted-foreground" />
|
|
50
|
+
<Input className="h-8 pl-8 text-sm" placeholder="Filter by email, ID or role..." />
|
|
51
|
+
</div>
|
|
52
|
+
<Separator orientation="vertical" className="h-6" />
|
|
53
|
+
<Select>
|
|
54
|
+
<SelectTrigger className="h-8 w-36 text-xs">
|
|
55
|
+
<SelectValue placeholder="Status: Active" />
|
|
56
|
+
</SelectTrigger>
|
|
57
|
+
<!-- Content omitted for brevity -->
|
|
58
|
+
</Select>
|
|
59
|
+
<Select>
|
|
60
|
+
<SelectTrigger className="h-8 w-36 text-xs">
|
|
61
|
+
<SelectValue placeholder="Department: All" />
|
|
62
|
+
</SelectTrigger>
|
|
63
|
+
</Select>
|
|
64
|
+
</Card>
|
|
65
|
+
|
|
66
|
+
<!-- Dense Enterprise Table -->
|
|
67
|
+
<div className="border rounded-md">
|
|
68
|
+
<Table>
|
|
69
|
+
<TableHeader>
|
|
70
|
+
<TableRow className="bg-muted/50">
|
|
71
|
+
<TableHead className="w-12 text-center">
|
|
72
|
+
<Checkbox />
|
|
73
|
+
</TableHead>
|
|
74
|
+
<TableHead className="h-8 px-2 text-xs">User / Email</TableHead>
|
|
75
|
+
<TableHead className="h-8 px-2 text-xs">Role</TableHead>
|
|
76
|
+
<TableHead className="h-8 px-2 text-xs">Status</TableHead>
|
|
77
|
+
<TableHead className="h-8 px-2 text-xs">Last Login</TableHead>
|
|
78
|
+
<TableHead className="h-8 px-2 w-12 text-center"></TableHead>
|
|
79
|
+
</TableRow>
|
|
80
|
+
</TableHeader>
|
|
81
|
+
<TableBody>
|
|
82
|
+
<TableRow v-for="user in users" :key="user.id" className="h-12 border-b">
|
|
83
|
+
<TableCell className="p-2 text-center">
|
|
84
|
+
<Checkbox />
|
|
85
|
+
</TableCell>
|
|
86
|
+
<TableCell className="p-2">
|
|
87
|
+
<div className="font-medium text-sm">{{ user.name }}</div>
|
|
88
|
+
<div className="text-xs text-muted-foreground">{{ user.email }}</div>
|
|
89
|
+
</TableCell>
|
|
90
|
+
<TableCell className="p-2">
|
|
91
|
+
<Badge variant="outline" className="h-5 text-[10px] uppercase">{{ user.role }}</Badge>
|
|
92
|
+
</TableCell>
|
|
93
|
+
<TableCell className="p-2">
|
|
94
|
+
<div className="flex items-center gap-1.5">
|
|
95
|
+
<span className="w-2 h-2 rounded-full bg-success"></span>
|
|
96
|
+
<span className="text-xs">Active</span>
|
|
97
|
+
</div>
|
|
98
|
+
</TableCell>
|
|
99
|
+
<TableCell className="p-2 text-xs text-muted-foreground">
|
|
100
|
+
{{ user.lastLogin }}
|
|
101
|
+
</TableCell>
|
|
102
|
+
<TableCell className="p-2 text-center">
|
|
103
|
+
<DropdownMenu>
|
|
104
|
+
<DropdownMenuTrigger as-child>
|
|
105
|
+
<Button variant="ghost" size="icon" className="h-6 w-6">
|
|
106
|
+
<MoreHorizontal className="h-4 w-4" />
|
|
107
|
+
</Button>
|
|
108
|
+
</DropdownMenuTrigger>
|
|
109
|
+
<DropdownMenuContent align="end">
|
|
110
|
+
<DropdownMenuLabel>Actions</DropdownMenuLabel>
|
|
111
|
+
<DropdownMenuSeparator />
|
|
112
|
+
<DropdownMenuItem>Reset Password</DropdownMenuItem>
|
|
113
|
+
<DropdownMenuItem>Manage Groups</DropdownMenuItem>
|
|
114
|
+
<DropdownMenuSeparator />
|
|
115
|
+
<DropdownMenuItem className="text-destructive">Suspend User</DropdownMenuItem>
|
|
116
|
+
</DropdownMenuContent>
|
|
117
|
+
</DropdownMenu>
|
|
118
|
+
</TableCell>
|
|
119
|
+
</TableRow>
|
|
120
|
+
</TableBody>
|
|
121
|
+
</Table>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Anti-Patterns (DO NOT DO)
|
|
127
|
+
|
|
128
|
+
- ❌ **Do not use large, airy spacing**: Admins hate scrolling. Use `p-2` instead of `p-6`. Make table headers `h-8` instead of `h-12`.
|
|
129
|
+
- ❌ **Do not use Cards for large collections**: Never use a grid of identical Cards to represent 500 users. Always use a `<Table>`.
|
|
130
|
+
- ❌ **Do not hide destructive actions in tooltips**: Deleting a user must be explicit and confirmable via `<AlertDialog>`.
|
|
131
|
+
- ❌ **Do not rely on icons alone for actions**: Use `Icon + Text` (e.g., `Export CSV` not just an export icon) to eliminate ambiguity.
|
|
132
|
+
|
|
133
|
+
## Layout Preference
|
|
134
|
+
Always use `layouts/sidebar.md`. A topbar alone is insufficient for enterprise depth. Breadcrumbs (`<Breadcrumb>`) are mandatory at the top of the main content area.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Visual: Color Usage
|
|
2
|
+
|
|
3
|
+
How to apply semantic colors correctly.
|
|
4
|
+
|
|
5
|
+
## The Color Budget
|
|
6
|
+
|
|
7
|
+
A well-composed page uses color sparingly:
|
|
8
|
+
|
|
9
|
+
- **90% neutral**: `bg-background`, `bg-card`, `text-foreground`, `text-muted-foreground`, `border-border`
|
|
10
|
+
- **8% accent**: `bg-accent`, `bg-muted`, `bg-secondary` (hover states, secondary elements)
|
|
11
|
+
- **2% primary**: `bg-primary`, `text-primary` (CTA buttons, active nav items, key indicators)
|
|
12
|
+
|
|
13
|
+
If every element is colorful, nothing stands out. The primary color is effective because it's rare.
|
|
14
|
+
|
|
15
|
+
## When to Use Each Color
|
|
16
|
+
|
|
17
|
+
| Color | Token Classes | Used For | Frequency |
|
|
18
|
+
|-------|--------------|----------|-----------|
|
|
19
|
+
| **Background** | `bg-background` | Page background | Every page |
|
|
20
|
+
| **Card** | `bg-card` | Card surfaces, overlays | Many containers |
|
|
21
|
+
| **Foreground** | `text-foreground` | Primary text, headings | Most text |
|
|
22
|
+
| **Muted foreground** | `text-muted-foreground` | Descriptions, timestamps, secondary text | Very common |
|
|
23
|
+
| **Border** | `border-border` | Card borders, dividers | Many borders |
|
|
24
|
+
| **Accent** | `bg-accent` | Hover backgrounds, active list items | Interactive states |
|
|
25
|
+
| **Primary** | `bg-primary text-primary-foreground` | Main CTA button, active nav item | 1-2 per section |
|
|
26
|
+
| **Destructive** | `bg-destructive` | Delete buttons, error states | Rare |
|
|
27
|
+
| **Success** | `bg-success` | Confirmation badges | Rare |
|
|
28
|
+
| **Warning** | `bg-warning` | Warning badges | Rare |
|
|
29
|
+
|
|
30
|
+
## Anti-Patterns
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<!-- ❌ Too much primary — everything screams for attention -->
|
|
34
|
+
<div className="bg-primary/10 border-primary">
|
|
35
|
+
<h2 className="text-primary">Section Title</h2>
|
|
36
|
+
<Button>Action 1</Button>
|
|
37
|
+
<Button>Action 2</Button>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<!-- ✅ Restrained primary — one CTA, neutral everything else -->
|
|
41
|
+
<div className="border-border">
|
|
42
|
+
<h2 className="text-foreground">Section Title</h2>
|
|
43
|
+
<Button variant="outline">Action 1</Button>
|
|
44
|
+
<Button>Action 2</Button>
|
|
45
|
+
</div>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Tinted Icon Boxes
|
|
49
|
+
|
|
50
|
+
For feature icons or stat card icons, use a tinted primary background:
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<!-- Primary tint — for feature highlights -->
|
|
54
|
+
<div className="w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center">
|
|
55
|
+
<Zap className="w-5 h-5 text-primary" />
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<!-- Muted — for general-purpose icons -->
|
|
59
|
+
<div className="w-10 h-10 rounded-lg bg-muted flex items-center justify-center">
|
|
60
|
+
<FileText className="w-5 h-5 text-muted-foreground" />
|
|
61
|
+
</div>
|
|
62
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Visual: Dark Mode
|
|
2
|
+
|
|
3
|
+
How the design system handles dark mode and what to keep in mind.
|
|
4
|
+
|
|
5
|
+
## How It Works
|
|
6
|
+
|
|
7
|
+
Dark mode is activated by adding `className="dark"` to the `<html>` element. All CSS token classes automatically resolve to dark values. You do NOT need to add `dark:` variant classes.
|
|
8
|
+
|
|
9
|
+
```css
|
|
10
|
+
/* These resolve automatically: */
|
|
11
|
+
bg-background /* white → near-black */
|
|
12
|
+
bg-card /* white → near-black */
|
|
13
|
+
text-foreground /* near-black → near-white */
|
|
14
|
+
border-border /* light gray → dark gray */
|
|
15
|
+
bg-primary /* emerald → brighter emerald */
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## What You Must Do
|
|
19
|
+
|
|
20
|
+
1. **Use only token-based classes** — never hardcode colors
|
|
21
|
+
2. **Never use white or black directly** — no `bg-white`, `text-black`, `text-gray-500`
|
|
22
|
+
3. **All gradients should use token colors** — `from-primary/20` works in both modes
|
|
23
|
+
4. **Shadows are nearly invisible in dark mode** — rely on `border-border` for container definition
|
|
24
|
+
|
|
25
|
+
## Common Dark Mode Issues and Fixes
|
|
26
|
+
|
|
27
|
+
| Issue | Wrong | Right |
|
|
28
|
+
|-------|-------|-------|
|
|
29
|
+
| White text on white bg | `text-white bg-white` | `text-foreground bg-card` |
|
|
30
|
+
| Hard-coded grays | `text-gray-500` | `text-muted-foreground` |
|
|
31
|
+
| Invisible shadows | `shadow-lg` (only) | `border shadow-lg` (border + shadow) |
|
|
32
|
+
| Harsh contrast | `bg-black text-white` | `bg-card text-card-foreground` |
|
|
33
|
+
| Colored backgrounds | `bg-blue-100` | `bg-primary/10` (use opacity) |
|
|
34
|
+
|
|
35
|
+
## Using Color with Opacity
|
|
36
|
+
|
|
37
|
+
When you need tinted backgrounds that work in both modes, use token colors with opacity:
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
bg-primary/5 <!-- Very subtle primary tint -->
|
|
41
|
+
bg-primary/10 <!-- Light primary tint (feature icon boxes) -->
|
|
42
|
+
bg-primary/20 <!-- Noticeable primary tint (banners, highlights) -->
|
|
43
|
+
bg-destructive/10 <!-- Error/danger tint -->
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
These automatically adapt because the base token color changes.
|
|
47
|
+
|
|
48
|
+
## Testing Rule
|
|
49
|
+
|
|
50
|
+
Every generated UI must look correct in both light and dark mode. If you use semantic tokens consistently, this happens automatically.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Visual: Polish Techniques
|
|
2
|
+
|
|
3
|
+
Subtle effects that elevate a UI from "functional" to "professional."
|
|
4
|
+
|
|
5
|
+
## 1. Frosted Glass Header
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<header className="sticky top-0 z-50 h-14 border-b bg-card/95 backdrop-blur supports-[backdrop-filter]:bg-card/60">
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The `backdrop-blur` creates a frosted glass effect when content scrolls behind the header.
|
|
12
|
+
|
|
13
|
+
## 2. Show-on-Hover Actions
|
|
14
|
+
|
|
15
|
+
Use `group` on the parent, `opacity-0 group-hover:opacity-100` on the action:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
<div className="flex items-center gap-3 group">
|
|
19
|
+
<p className="text-sm">Item name</p>
|
|
20
|
+
<Button variant="ghost" size="icon" className="h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity">
|
|
21
|
+
<Pencil className="w-3 h-3" />
|
|
22
|
+
</Button>
|
|
23
|
+
</div>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 3. Subtle Card Hover
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
className="cursor-pointer transition-colors hover:bg-accent/50"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Not `hover:shadow-md` (which can be jarring). A gentle background tint is cleaner.
|
|
33
|
+
|
|
34
|
+
## 4. Gradient Accents
|
|
35
|
+
|
|
36
|
+
For visual interest in headers or hero areas:
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<div className="h-32 rounded-lg bg-gradient-to-br from-primary/20 via-primary/5 to-transparent" />
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Always use token-based gradients (`from-primary/20`) so they work in dark mode.
|
|
43
|
+
|
|
44
|
+
## 5. Dot Status Indicators
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
<span className="w-2 h-2 rounded-full bg-success" /> <!-- Online/Active -->
|
|
48
|
+
<span className="w-2 h-2 rounded-full bg-warning" /> <!-- Away/Warning -->
|
|
49
|
+
<span className="w-2 h-2 rounded-full bg-muted" /> <!-- Offline/Inactive -->
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 6. Truncation with min-w-0
|
|
53
|
+
|
|
54
|
+
In flex layouts, text won't truncate unless its container has `min-w-0`:
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<div className="flex items-center gap-3">
|
|
58
|
+
<div className="shrink-0"><!-- Fixed-size element --></div>
|
|
59
|
+
<div className="flex-1 min-w-0">
|
|
60
|
+
<p className="truncate">This very long text will properly truncate</p>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 7. Number-Aware Formatting
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
$45,231.89 (currency: font-bold, right-aligned)
|
|
69
|
+
2,350 (counts: font-bold)
|
|
70
|
+
+20.1% (positive change: text-success or text-foreground)
|
|
71
|
+
-8.3% (negative change: text-destructive)
|
|
72
|
+
Mar 15, 2024 (dates: text-muted-foreground)
|
|
73
|
+
2 hours ago (relative time: text-xs text-muted-foreground)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## 8. Consistent Icon Treatment
|
|
77
|
+
|
|
78
|
+
| Context | Size | Color |
|
|
79
|
+
|---------|------|-------|
|
|
80
|
+
| Inside buttons | `w-4 h-4` | Inherits button text color |
|
|
81
|
+
| Navigation items | `w-4 h-4` or `w-5 h-5` | `text-muted-foreground`, active: inherits |
|
|
82
|
+
| Stat card decorative | `h-4 w-4` | `text-muted-foreground` |
|
|
83
|
+
| Empty state central | `w-6 h-6` (in container) | `text-muted-foreground` |
|
|
84
|
+
| Feature highlights | `w-5 h-5` (in bg-primary/10 box) | `text-primary` |
|
|
85
|
+
|
|
86
|
+
## 9. Text Emphasis Patterns
|
|
87
|
+
|
|
88
|
+
```html
|
|
89
|
+
<!-- Primary text with highlight -->
|
|
90
|
+
<span className="font-medium">John Smith</span> updated the project
|
|
91
|
+
|
|
92
|
+
<!-- De-emphasized metadata -->
|
|
93
|
+
<span className="text-xs text-muted-foreground">3 minutes ago</span>
|
|
94
|
+
|
|
95
|
+
<!-- Inline code/value -->
|
|
96
|
+
<code className="bg-muted px-1.5 py-0.5 rounded text-sm font-mono">API_KEY</code>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## 10. Separator Usage
|
|
100
|
+
|
|
101
|
+
Use `<Separator />` to visually break sections within a card or panel. Don't overuse — only between distinctly different content groups. For mere spacing, use `space-y-*` instead.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Visual: Spacing Composition
|
|
2
|
+
|
|
3
|
+
How to use spacing to create visual hierarchy and rhythm on a page.
|
|
4
|
+
|
|
5
|
+
## The Three-Level Rule
|
|
6
|
+
|
|
7
|
+
Every well-designed page uses exactly three levels of spacing:
|
|
8
|
+
|
|
9
|
+
| Level | Gap | Purpose | Example |
|
|
10
|
+
|-------|-----|---------|---------|
|
|
11
|
+
| **Tight** | `gap-1` to `gap-2` (4–8px) | Within a component | Icon + text in a button, Label + Input |
|
|
12
|
+
| **Medium** | `gap-3` to `gap-4` (12–16px) | Between sibling items | Form fields, cards in a grid, list items |
|
|
13
|
+
| **Loose** | `gap-6` to `gap-8` (24–32px) | Between major sections | Page header → stats → table → footer |
|
|
14
|
+
|
|
15
|
+
The contrast between these three levels creates grouping — the eye understands what belongs together because related things are close and unrelated things are far apart.
|
|
16
|
+
|
|
17
|
+
## Page Rhythm Template
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
py-8 ← Top padding
|
|
21
|
+
gap-6/gap-8 ← Between page header and first section
|
|
22
|
+
gap-4 ← Between items within a section (cards, rows)
|
|
23
|
+
gap-2 ← Between elements within an item (label + input)
|
|
24
|
+
gap-6/gap-8 ← Between first section and second section
|
|
25
|
+
gap-4 ← Between items within section
|
|
26
|
+
gap-6/gap-8 ← Between last section and footer
|
|
27
|
+
py-8 ← Bottom padding
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Common Mistakes
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<!-- ❌ Same gap everywhere — flat hierarchy, nothing groups together -->
|
|
34
|
+
<div className="space-y-4">
|
|
35
|
+
<h1>Title</h1>
|
|
36
|
+
<p>Description</p>
|
|
37
|
+
<Card>...</Card>
|
|
38
|
+
<Card>...</Card>
|
|
39
|
+
<h2>Next Section</h2>
|
|
40
|
+
<Card>...</Card>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<!-- ✅ Varied gaps — clear grouping -->
|
|
44
|
+
<div className="space-y-8"> <!-- Loose: between sections -->
|
|
45
|
+
<div className="space-y-1"> <!-- Tight: title + description -->
|
|
46
|
+
<h1 className="text-2xl font-bold">Title</h1>
|
|
47
|
+
<p className="text-muted-foreground">Description</p>
|
|
48
|
+
</div>
|
|
49
|
+
<div className="grid grid-cols-3 gap-4"> <!-- Medium: between cards -->
|
|
50
|
+
<Card>...</Card>
|
|
51
|
+
<Card>...</Card>
|
|
52
|
+
<Card>...</Card>
|
|
53
|
+
</div>
|
|
54
|
+
<div className="space-y-4"> <!-- Medium within section -->
|
|
55
|
+
<h2 className="text-lg font-semibold">Next Section</h2>
|
|
56
|
+
<Card>...</Card>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Card Internal Spacing
|
|
62
|
+
|
|
63
|
+
| Element | Spacing |
|
|
64
|
+
|---------|---------|
|
|
65
|
+
| Card padding | `p-6` (standard) or `p-4` (compact) |
|
|
66
|
+
| Header to content | `CardContent className="p-6 pt-0"` (auto via DS) |
|
|
67
|
+
| Fields inside card | `space-y-4` |
|
|
68
|
+
| Label to input | `space-y-2` |
|
|
69
|
+
| Footer action buttons | `gap-2` |
|