diff --git a/src/ds/EmptyState.tsx b/src/ds/EmptyState.tsx new file mode 100644 index 0000000..4d09b25 --- /dev/null +++ b/src/ds/EmptyState.tsx @@ -0,0 +1,48 @@ +import { Icon, type IconName } from "./icons"; + +/** A designed empty / low-data state: a soft icon medallion, a title, and a + * one-line hint. Replaces the bare "Гүйлгээ алга" text so a quiet screen still + * feels intentional. */ +export function EmptyState({ + icon, + title, + hint, + compact = false, +}: { + icon: IconName; + title: string; + hint?: string; + compact?: boolean; +}) { + return ( +
+ + + + {title} + {hint ? ( + {hint} + ) : null} +
+ ); +} diff --git a/src/ds/IconChip.tsx b/src/ds/IconChip.tsx new file mode 100644 index 0000000..4f5d069 --- /dev/null +++ b/src/ds/IconChip.tsx @@ -0,0 +1,35 @@ +import { Icon, type IconName } from "./icons"; + +/** The rounded, tinted icon square used on every list row (transactions, + * accounts, assets, planner categories, profile menu). One source of truth for + * the chip so all rows share the exact same shape/size. */ +export function IconChip({ + icon, + tint, + fg, + size = 40, +}: { + icon: IconName; + tint: string; + fg: string; + size?: number; +}) { + const radius = Math.round(size * 0.32); + return ( + + + + ); +} diff --git a/src/ds/SectionHeader.tsx b/src/ds/SectionHeader.tsx new file mode 100644 index 0000000..3be92ff --- /dev/null +++ b/src/ds/SectionHeader.tsx @@ -0,0 +1,44 @@ +import type { ReactNode } from "react"; +import { Icon } from "./icons"; + +/** A section title with an optional trailing action (e.g. a `+` add button). + * Used to head every list block so spacing + type are consistent. */ +export function SectionHeader({ + title, + action, + onAction, + actionLabel, +}: { + title: string; + action?: ReactNode; + onAction?: () => void; + actionLabel?: string; +}) { + return ( +
+

{title}

+ {onAction ? ( + + ) : ( + action ?? null + )} +
+ ); +} diff --git a/src/ds/index.ts b/src/ds/index.ts index 6b84b0d..83262cd 100644 --- a/src/ds/index.ts +++ b/src/ds/index.ts @@ -17,3 +17,6 @@ export { Card } from "./Card"; export type { CardProps } from "./Card"; export * from "./categoryStyle"; export * from "./icons"; +export * from "./IconChip"; +export * from "./SectionHeader"; +export * from "./EmptyState";