diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx index c207c45..456b692 100644 --- a/app/(tabs)/_layout.tsx +++ b/app/(tabs)/_layout.tsx @@ -1,10 +1,10 @@ import { Tabs } from "expo-router"; +import { Platform } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { HapticTab } from "../../components/haptic-tab"; import { IconSymbol } from "@/components/ui/icon-symbol"; -import { palette } from "@/constants/commander"; -import { Platform } from "react-native"; +import { design } from "@/constants/design-system"; import { useColors } from "@/hooks/use-colors"; export default function TabLayout() { @@ -20,14 +20,14 @@ export default function TabLayout() { headerShown: false, tabBarButton: HapticTab, tabBarHideOnKeyboard: true, - tabBarLabelStyle: { fontSize: 10, fontWeight: "800", letterSpacing: 0.2 }, - tabBarItemStyle: { borderRadius: 12, marginHorizontal: 2, marginVertical: 4 }, - tabBarActiveBackgroundColor: palette.orangeSoft, + tabBarLabelStyle: { fontSize: design.type.eyebrow, fontWeight: "800", letterSpacing: 0.2 }, + tabBarItemStyle: { borderRadius: design.radius.md, marginHorizontal: 2, marginVertical: 4 }, + tabBarActiveBackgroundColor: design.color.orangeSoft, tabBarStyle: { paddingTop: 6, paddingBottom: bottomPadding, height: tabBarHeight, - backgroundColor: palette.paper, + backgroundColor: design.color.surface, borderTopColor: colors.border, borderTopWidth: 1, }, diff --git a/components/commander-state-notice.tsx b/components/commander-state-notice.tsx new file mode 100644 index 0000000..1314e05 --- /dev/null +++ b/components/commander-state-notice.tsx @@ -0,0 +1,60 @@ +import { StyleSheet, Text, View } from "react-native"; + +import { design } from "@/constants/design-system"; + +type CommanderStateNoticeProps = { + title: string; + detail: string; + kind?: "info" | "warning" | "error"; + footer?: string; +}; + +const kindColors = { + info: { accent: design.color.navy, background: "#E9EFF0" }, + warning: { accent: design.color.yellow, background: design.color.yellowSoft }, + error: { accent: design.color.red, background: "#FCECEB" }, +} as const; + +/** Use for empty, permission-denied, unsupported, and recoverable-error states. */ +export function CommanderStateNotice({ + title, + detail, + kind = "info", + footer, +}: CommanderStateNoticeProps) { + const colors = kindColors[kind]; + + return ( + + {title} + {detail} + {footer ? {footer} : null} + + ); +} + +const styles = StyleSheet.create({ + container: { + borderLeftWidth: 3, + borderRadius: design.radius.md, + padding: design.space.md, + gap: design.space.xs, + }, + title: { + fontSize: design.type.body, + fontWeight: "800", + }, + detail: { + color: design.color.text, + fontSize: design.type.caption, + lineHeight: 17, + }, + footer: { + color: design.color.textMuted, + fontSize: design.type.caption, + lineHeight: 16, + }, +}); diff --git a/components/commander-status-badge.tsx b/components/commander-status-badge.tsx new file mode 100644 index 0000000..7bc4e0a --- /dev/null +++ b/components/commander-status-badge.tsx @@ -0,0 +1,42 @@ +import { StyleSheet, Text, View } from "react-native"; + +import { design, type DesignStatus } from "@/constants/design-system"; + +type CommanderStatusBadgeProps = { + status: DesignStatus; + label?: string; + accessibilityLabel?: string; +}; + +export function CommanderStatusBadge({ + status, + label, + accessibilityLabel, +}: CommanderStatusBadgeProps) { + const token = design.status[status]; + const visibleLabel = label ?? token.label; + + return ( + + {visibleLabel} + + ); +} + +const styles = StyleSheet.create({ + badge: { + alignSelf: "flex-start", + borderRadius: design.radius.sm, + paddingHorizontal: design.space.xs, + paddingVertical: 5, + }, + label: { + fontSize: design.type.eyebrow, + fontWeight: "900", + letterSpacing: 0.5, + }, +}); diff --git a/constants/design-system.ts b/constants/design-system.ts new file mode 100644 index 0000000..e291038 --- /dev/null +++ b/constants/design-system.ts @@ -0,0 +1,52 @@ +import { palette } from "@/constants/commander"; + +/** + * Shared visual contract for Droid Commander. + * Keep screen styling consistent; do not use color alone to communicate status. + */ +export const design = { + color: { + ...palette, + background: palette.canvas, + surface: palette.paper, + surfaceSubtle: "#EEF2F1", + text: palette.ink, + textMuted: palette.muted, + border: palette.line, + accent: palette.orange, + }, + space: { + xxs: 4, + xs: 8, + sm: 12, + md: 16, + lg: 20, + xl: 24, + xxl: 32, + }, + radius: { + sm: 8, + md: 12, + card: 16, + panel: 20, + pill: 999, + }, + type: { + eyebrow: 10, + caption: 11, + body: 14, + bodyLineHeight: 20, + section: 18, + title: 30, + }, + status: { + critical: { foreground: palette.red, background: "#FCECEB", label: "CRITICAL" }, + review: { foreground: palette.yellow, background: palette.yellowSoft, label: "REVIEW" }, + clear: { foreground: palette.green, background: palette.greenSoft, label: "CLEAR" }, + limited: { foreground: palette.muted, background: "#EEF1F1", label: "LIMITED" }, + demo: { foreground: palette.navy, background: "#E9EFF0", label: "DEMO" }, + unavailable: { foreground: palette.muted, background: "#EEF1F1", label: "UNAVAILABLE" }, + }, +} as const; + +export type DesignStatus = keyof typeof design.status;