wealth/docs/decisions/0005-island-components-take...

23 lines
1.8 KiB
Markdown

# 0005 Island product components take their text as props
Status: Proposed · Area: design · Date: 2026-10-04 · Decided by: agent
## Context
The Lumina Design System draws product components (post, prediction, and subscription cards, creator stats, tier options, the support sheet) and a status vocabulary that pairs each status with one tone and icon. Both apps use them, and every one shows Persian copy, but island can't read the platform's translations.
## Decision
- Island holds Lumina's product components (`PostCard`, `PredictionCard`, `SubscriptionCard`, `CreatorStats`, `TierOption`, `SupportSheet`) and the status vocabulary: `StatusKey` maps to a tone and icon in `StatusBadge`'s `STATUS_STYLES`.
- They take every text as props: `children`, or one `labels` object per component that the platform fills from i18next. Island never imports i18next and never hard-codes copy, defaults included.
- Their data props are island's own types with the API's values (`PredictionData`, `SubscriptionStatus`). Island never imports from `platforms/` or a feature's entities; the platform's models map each `*Payload` to these props.
- Page composition (which sections a page has, and where each card goes) stays in the platform and app templates.
## Alternatives
- Product components as `platforms/market` organisms: island stays domain-free, but the design system splits across two projects, away from the atoms and tokens it builds on.
- i18next inside island: island would depend on the platform's locale files and i18n setup.
## Consequences
- Island is Lumina's design system, not a product-neutral one.
- A new status needs a `StatusKey` and a `STATUS_STYLES` entry in island, and its label in the platform's translations.
- The platform builds each `labels` object once per list, not once per card.
- Debt: `StepProgress` joins its `aria-valuetext` with a hard-coded «،».