Component Inventory
Drop Frontend — Component Inventory
Auto-generatedProject:from{{PROJECT_NAME}}sourceVersion:code{{VERSION}}analysis.Date:All{{DATE}}fileAuthor:paths{{AUTHOR}}relativeStatus:toDraftsrc/drop-app/src/.| In Review | Approved Reviewers: {{REVIEWERS}}
Document Custom ComponentsHistory
BottomNav
File: components/bottom-nav.tsx
Props: None
Description: Fixed bottom navigation bar with 5 tabs. Uses usePathname() for active state detection. Active tab: text-[#0B6E35], inactive: text-[#9CA3AF].
Navigation Items:
LabelVersion
RouteDate
IconAuthor
Changes
Hjem0.1
/dashboard{{DATE}}
Home (lucide)
Aktivitet{{AUTHOR}}
/history Initial Clock (lucide)
Skann
/scan
IconQrScan (custom)
Kontoer
/accounts
Landmark (lucide)
Profil
/profile
User (lucide)draft
1. Overview
UsedTotal in:components: dashboard,{{N}}
accounts,Library history, profile, scan pages
DropLogo
File:location: src/components/drop-logo.tsx:5
Props:Storybook: { size?: number; className?: string {https://storybook.PROJECT_NAME.example.com}}
(LogoProps) Design Description: Forward D SVG mark — letter "d" with stem sweeping into gold arrow. Default size 40. Colors: #0B6E35 (green body), #D4A017 (gold arrow).
DropWordmark
File: components/drop-logo.tsx:30
Props:source: {{Figma size?:file number; className?: string URL}}
(LogoProps) Owner Description: Text "drop" rendered in Fraunces font, bold, color #1A1A1A. Default size 24 (font-size).
DropLogoFull
File: components/drop-logo.tsx:44
Props:team: { size?: number; className?: string {TEAM_NAME}}
(LogoProps)This
- inventory tracks every reusable component in
Description:{{PROJECT_NAME}}. CombinesIt DropLogofollows markAtomic +Design DropWordmarkcategorization: sideatoms by→ side.molecules Default→ sizeorganisms 40.→ Usedtemplates on marketing/landing→ pages.
DropAppIcon
File: components/drop-logo.tsx:57
Props: { size?: number; className?: string } (LogoProps)
Description: App icon — rounded green square with dollar sign and circular arrows. Default size 64. Used as favicon/app launcher icon.
CookieConsent
File: components/cookie-consent.tsx
Props: None
Description: GDPR cookie consent banner and modal. Manages localStorage consent preferences (necessary, analytics, marketing). Shows banner on first visit. "Tilpass" button opens modal for granular control. Saves consent to /api/consents endpoint.
State: visible, showModal, preferences (CookiePreferences)
Components used: X (lucide), Dialog components
Used in: Root layout
PrePaymentDisclosure
File: components/pre-payment-disclosure.tsx
Props: { amount, fee, exchangeRate, receiveAmount, receiveCurrency, estimatedDelivery, onConfirm, onCancel }
Description: PSD2-compliant pre-payment disclosure modal for remittance. Shows full breakdown: amount, fee (with %), exchange rate, recipient gets, total cost, estimated delivery. Explicit confirm/cancel buttons. Norwegian language.
Components used: Info (lucide)
Used in: /send page (remittance flow)
PWARegister
File: components/pwa-register.tsx
Props: None
Description: Service Worker registration component. Registers /sw.js on mount. Silent registration (console logs only). Returns null (no UI).
Used in: Root layout
Custom2. IconsComponent (Hierarchy Diagram
drop-icons.tsxgraph TB
subgraph Pages
PageLogin["LoginPage"]
PageDashboard["DashboardPage"]
end
subgraph Templates
TplAuth["AuthLayout"]
TplApp["AppLayout"]
end
subgraph Organisms
OrgNavbar["Navbar"]
OrgSidebar["Sidebar"]
OrgDataTable["DataTable"]
OrgUserForm["UserForm"]
end
subgraph Molecules
MolFormField["FormField"]
MolCard["Card"]
MolSearchBar["SearchBar"]
MolDropdown["Dropdown"]
MolPagination["Pagination"]
end
subgraph Atoms
AtomButton["Button"]
AtomInput["Input"]
AtomBadge["Badge"]
AtomSpinner["Spinner"]
AtomAvatar["Avatar"]
AtomIcon["Icon"]
end
Pages --> Templates
Templates --> Organisms
Organisms --> Molecules
Molecules --> Atoms
)
components/bottom-nav.tsxusePathname()text-[#0B6E35]text-[#9CA3AF]| Changes | |||
|---|---|---|---|
1. Overview
UsedTotal in:components: dashboard,{{N}}
accounts,Library history, profile, scan pages
src/components/drop-logo.tsx:5{ size?: number; className?: string {https://storybook.PROJECT_NAME.example.com}}
#0B6E35#D4A017components/drop-logo.tsx:30{{Figma size?:file number; className?: string URL}}
#1A1A1Acomponents/drop-logo.tsx:44{ size?: number; className?: string {TEAM_NAME}}
This
components/drop-logo.tsx:57{ size?: number; className?: string }components/cookie-consent.tsx/api/consentscomponents/pre-payment-disclosure.tsx{ amount, fee, exchangeRate, receiveAmount, receiveCurrency, estimatedDelivery, onConfirm, onCancel }/sendcomponents/pwa-register.tsx/sw.jsdrop-icons.tsxgraph TB
subgraph Pages
PageLogin["LoginPage"]
PageDashboard["DashboardPage"]
end
subgraph Templates
TplAuth["AuthLayout"]
TplApp["AppLayout"]
end
subgraph Organisms
OrgNavbar["Navbar"]
OrgSidebar["Sidebar"]
OrgDataTable["DataTable"]
OrgUserForm["UserForm"]
end
subgraph Molecules
MolFormField["FormField"]
MolCard["Card"]
MolSearchBar["SearchBar"]
MolDropdown["Dropdown"]
MolPagination["Pagination"]
end
subgraph Atoms
AtomButton["Button"]
AtomInput["Input"]
AtomBadge["Badge"]
AtomSpinner["Spinner"]
AtomAvatar["Avatar"]
AtomIcon["Icon"]
end
Pages --> Templates
Templates --> Organisms
Organisms --> Molecules
Molecules --> Atoms
File:TODO: Update components/drop-icons.tsxShareddiagram Propsto Interface:reflect IconPropsactual {component size?:tree.
3. stringAtoms }(Primitive Style:Components)
3.1 stroke, round linecap/linejoin, currentColor fill for theming.Button
| Atom | |||
| `{{Done | |||
src/components/ui/Button/Button.tsx |
|||
{{URL}} |
|||
{{Figma |
Props API:
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
variant |
'primary' | 'secondary' | 'ghost' | 'danger' | 'link' |
'primary' |
No | Visual style variant |
size |
'sm' |
'md' |
No | Button size |
disabled |
boolean |
false |
Disables |
|
loading |
boolean |
false |
No | Shows spinner, disables click |
leftIcon |
ReactNode |
undefined |
No | Icon before label |
rightIcon |
ReactNode |
undefined |
No | Icon after label |
onClick |
(e: MouseEvent) => void |
undefined |
No | Click handler |
type |
'button' | 'submit' | 'reset' |
'button' |
No | HTML button type |
fullWidth |
boolean |
false |
No | 100% width |
Variants & States: primary, secondary, ghost, danger, link × default, hover, focus, active, disabled, loading
Accessibility:
Dependencies: Icon component, Spinner component
3.2 Input
| Property | Value |
|---|---|
| Category | Atom |
| Status | {{Status}} |
| File path | src/components/ui/Input/Input.tsx |
| Storybook | {{URL}} |
Props API:
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
type |
'text' | 'email' | 'password' | 'number' | 'search' | 'tel' | 'url' |
'text' |
No | Input type |
value |
string |
— | Yes (controlled) | Input value |
onChange |
(e: ChangeEvent) => void |
— | Yes | Change handler |
placeholder |
string |
'' |
No | Placeholder text |
disabled |
boolean |
false |
No | Disabled state |
error |
boolean |
false |
No | Triggers error visual state |
errorMessage |
string |
undefined |
No | Error text (also sets aria-describedby) |
leftAdornment |
ReactNode |
undefined |
No | Icon or element left of input |
rightAdornment |
ReactNode |
undefined |
No | Icon or element right of input |
size |
'sm' | 'md' | 'lg' |
'md' |
No | Input height/font size |
Variants & States: default, focused, error, disabled, with-left-icon, with-right-icon
Accessibility:
- Must always be paired with
<label>(use FormField molecule) - Error:
aria-invalid="true"+aria-describedbypointing to error message id - Password: toggle visibility button must have
aria-label
3.3 Badge
| Property | Value |
|---|---|
| Category | Atom |
| Status | {{Status}} |
| File path | src/components/ui/Badge/Badge.tsx |
Props API:
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
variant |
'success' | 'warning' | 'error' | 'info' | 'neutral' |
'neutral' |
No | Semantic color variant |
size |
'sm' | 'md' |
'md' |
No | Badge size |
dot |
boolean |
false |
No | Shows colored dot instead of text |
children |
ReactNode |
— | Yes | Badge content |
TODO: Add remaining atom components following the same pattern (Select, Checkbox, Radio, Toggle, Textarea, Avatar, Tooltip, Spinner, Divider).
4. Molecules (Composite Components)
4.1 FormField
| Property | Value |
|---|---|
| Category | Molecule |
| Status | {{Status}} |
| File path | src/components/ui/FormField/FormField.tsx |
| Composes | Input, Label, ErrorMessage, HelpText |
Props API:
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
label |
string |
— | Yes | Visible label text |
htmlFor |
string |
— | Yes | Links label to input id |
error |
string |
undefined |
No | Error message text |
helpText |
string |
undefined |
No | Helper text below input |
required |
boolean |
false |
No | Shows required indicator |
children |
ReactNode |
— | Yes | Input component |
Accessibility: Label always associated with input via htmlFor/id pair.
4.2 Card
| Property | Value |
|---|---|
| Category | Molecule |
| Status | {{Status}} |
| File path | src/components/ui/Card/Card.tsx |
Props API:
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
variant |
'default' | 'bordered' | 'elevated' |
'default' |
No | Visual style |
padding |
'sm' | 'md' | 'lg' | 'none' |
'md' |
No | Internal padding |
as |
ElementType |
'div' |
No | Polymorphic render element |
children |
ReactNode |
— | Yes | Card content |
Sub-components: Card.Header, Card.Body, Card.Footer
TODO: Add remaining molecule components: Modal, Dropdown, Table, Pagination, Toast, SearchBar, Breadcrumb, Tabs, Accordion, DatePicker.
5. Organisms (Complex Components)
5.1 DataTable
| Property | Value |
|---|---|
| Category | Organism |
| Status | {{Status}} |
| File path | src/components/features/DataTable/DataTable.tsx |
| Dependencies | Table (molecule), Pagination, SearchBar, Spinner, Badge |
Features:
- Sortable columns (client + server-side)
- Pagination (configurable page sizes)
- Row selection (single + multi)
- Column visibility toggle
- Export action slot
- Loading skeleton state
- Empty state slot
- Row action slot (per-row dropdown)
TODO: Document full props API for DataTable.
5.2 Navigation / Sidebar
| Property | Value |
|---|---|
| Category | Organism |
| Status | {{Status}} |
| File path | src/components/layouts/Sidebar/Sidebar.tsx |
TODO: Add remaining organism components.
6. Shared Hooks / Composables Inventory
| Hook | File | Purpose | Used By |
|---|---|---|---|
useDebounce |
src/hooks/useDebounce.ts |
Debounce value changes | SearchBar, Input |
useLocalStorage |
src/hooks/useLocalStorage.ts |
Persistent local state | Theme, preferences |
useMediaQuery |
src/hooks/useMediaQuery.ts |
Responsive breakpoint checks | Layout components |
useClickOutside |
src/hooks/useClickOutside.ts |
Close on outside click | Dropdown, Modal |
useFocusTrap |
src/hooks/useFocusTrap.ts |
Trap focus inside |
|
useToast |
src/hooks/useToast.ts |
Trigger |
Global |
usePermission |
src/hooks/usePermission.ts |
Check user permissions | Auth-gated components |
{{HOOK_NAME}} |
{{PATH}} |
{{PURPOSE}} |
{{CONSUMERS}} |
shadcn/ui7. ComponentsThird-Party Component Usage
Directory: components/ui/
All are standard shadcn/ui primitives built on Radix UI. Styled via Tailwind + CSS variables defined in globals.css.
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
External Dependencies (UI-related)
| Package | Components Used | Wrapping Strategy | |
|---|---|---|---|
{{@radix-ui/react-dialog}} |
{{1.x}} |
Modal |
Wrapped src/components/ui/Modal |
{{@radix-ui/react-select}} |
{{2.x}} |
Select base | Wrapped in src/components/ui/Select |
{{react-hook-form}} |
{{7.x}} |
Form state | Used directly + FormField wrapper |
{{recharts}} |
|||
{{2.x}} |
|||
|
Policy: Never use third-party components directly in feature code — always wrap in local component to control API surface and allow future swap.
8. Component Deprecation Process
Active → Deprecated (soft) → Deprecated (hard) → Removed
| Stage | Action Required |
|---|---|
| Deprecated (soft) | Add @deprecated JSDoc comment, console warning in dev, migration guide in Storybook |
| Deprecated (hard) | TypeScript @deprecated annotation triggers IDE warning, added to removal milestone |
| Removed | Delete component, update CHANGELOG, run codemod if available |
Deprecation notice minimum period: 2 sprint cycles before hard removal.
TODO: Link to CHANGELOG.md for tracked deprecations.
Approval
| Role | Name | Date | Signature |
|---|---|---|---|
| Author | |||
| Frontend Lead | |||
| Design System Owner |