@aramiworks/design 0.0.0-stage → 1.1.1
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 +10 -2
- package/dist/index.d.mts +2260 -0
- package/dist/index.d.ts +2260 -0
- package/dist/index.js +6931 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +6862 -0
- package/dist/index.mjs.map +1 -0
- package/manifest.json +1121 -0
- package/package.json +108 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/theme/ThemeProvider.tsx","../src/theme/tokens.generated.ts","../src/organisms/action-bar/ActionBar.tsx","../src/atoms/safe-area/SafeArea.tsx","../src/atoms/icon/Icon.tsx","../src/atoms/spinner/Spinner.tsx","../src/atoms/pressable-surface/PressableSurface.tsx","../src/atoms/text/Text.tsx","../src/atoms/button/Button.tsx","../src/organisms/action-card/ActionCard.tsx","../src/organisms/rating-stars/RatingStars.tsx","../src/organisms/action-toggle/ActionToggle.tsx","../src/organisms/alert-dialog/AlertDialog.tsx","../src/theme/ThemeScope.tsx","../src/organisms/amount-input/AmountInput.tsx","../src/atoms/field-frame/FieldFrame.tsx","../src/atoms/input/Input.tsx","../src/molecules/field/Field.tsx","../src/organisms/app-bar/AppBar.tsx","../src/organisms/banner/Banner.tsx","../src/organisms/bar-chart-card/BarChartCard.tsx","../src/atoms/surface/Surface.tsx","../src/molecules/sheet/Sheet.tsx","../src/atoms/icon-button/IconButton.tsx","../src/organisms/bottom-sheet/BottomSheet.tsx","../src/organisms/brand-mark/BrandMark.tsx","../src/organisms/composer/Composer.tsx","../src/molecules/select-trigger/SelectTrigger.tsx","../src/organisms/date-field/DateField.tsx","../src/organisms/detail-header/DetailHeader.tsx","../src/organisms/empty-state/EmptyState.tsx","../src/organisms/suggestion-chips/SuggestionChips.tsx","../src/organisms/entry-card/EntryCard.tsx","../src/organisms/image-strip/ImageStrip.tsx","../src/atoms/image/Image.tsx","../src/organisms/image-picker-tile/ImagePickerTile.tsx","../src/organisms/error-state/ErrorState.tsx","../src/organisms/filter-chip-group/FilterChipGroup.tsx","../src/atoms/divider/Divider.tsx","../src/organisms/floating-card/FloatingCard.tsx","../src/organisms/image-carousel/ImageCarousel.tsx","../src/organisms/form-section/FormSection.tsx","../src/atoms/text-link/TextLink.tsx","../src/organisms/image-viewer/ImageViewer.tsx","../src/organisms/labeled-divider/LabeledDivider.tsx","../src/organisms/legend/Legend.tsx","../src/atoms/star-count/StarCount.tsx","../src/organisms/list-row/ListRow.tsx","../src/atoms/switch/Switch.tsx","../src/molecules/list-item/ListItem.tsx","../src/atoms/avatar/Avatar.tsx","../src/organisms/list-section/ListSection.tsx","../src/organisms/live-caption/LiveCaption.tsx","../src/organisms/message-bubble/MessageBubble.tsx","../src/organisms/typing-indicator/TypingIndicator.tsx","../src/organisms/message-list/MessageList.tsx","../src/organisms/meter-card/MeterCard.tsx","../src/organisms/progress-bar/ProgressBar.tsx","../src/organisms/progress-bar/progressShare.ts","../src/organisms/month-calendar/MonthCalendar.tsx","../src/organisms/month-calendar/calendar.ts","../src/organisms/navigation-rail/NavigationRail.tsx","../src/organisms/orb/Orb.tsx","../src/organisms/profile-header/ProfileHeader.tsx","../src/organisms/progress-ring/ProgressRing.tsx","../src/atoms/ring/Ring.tsx","../src/organisms/ranked-row/RankedRow.tsx","../src/organisms/scroll-to-bottom-fab/ScrollToBottomFab.tsx","../src/organisms/search-bar/SearchBar.tsx","../src/organisms/search-select/SearchSelect.tsx","../src/molecules/option-list/OptionList.tsx","../src/organisms/sectioned-list/SectionedList.tsx","../src/organisms/segmented-control/SegmentedControl.tsx","../src/organisms/select/Select.tsx","../src/organisms/settings-section/SettingsSection.tsx","../src/organisms/skeleton-list/SkeletonList.tsx","../src/organisms/snackbar/Snackbar.tsx","../src/organisms/snackbar/bottomBarInset.ts","../src/organisms/social-sign-in-button/SocialSignInButton.tsx","../src/organisms/stat-tile/StatTile.tsx","../src/organisms/summary-card/SummaryCard.tsx","../src/organisms/tab-bar/TabBar.tsx","../src/organisms/tab-strip/TabStrip.tsx","../src/organisms/text-field/TextField.tsx","../src/templates/app-shell/AppShell.tsx","../src/templates/auth-template/AuthTemplate.tsx","../src/templates/chat-template/ChatTemplate.tsx","../src/templates/detail-template/DetailTemplate.tsx","../src/templates/form-template/FormTemplate.tsx","../src/templates/list-template/ListTemplate.tsx","../src/templates/lock-template/LockTemplate.tsx","../src/templates/overlay-template/OverlayTemplate.tsx","../src/templates/settings-template/SettingsTemplate.tsx","../src/templates/split-layout/SplitLayout.tsx","../src/templates/voice-template/VoiceTemplate.tsx"],"sourcesContent":["// Public API of @aramiworks/design.\n// Only organisms, templates, ThemeProvider and useTheme are exported (D5).\n// Atoms and molecules are internal and must never be re-exported here.\nexport * from \"./theme\";\nexport * from \"./organisms\";\nexport * from \"./templates\";\n","import { createContext, useContext, useMemo, type ReactNode } from \"react\";\nimport {\n View,\n useColorScheme,\n type StyleProp,\n type ViewStyle,\n} from \"react-native\";\nimport { vars } from \"nativewind\";\nimport {\n baseVars,\n themeColors,\n themeVars,\n type ThemeColorName,\n type ThemeMode,\n type ThemeName,\n} from \"./tokens.generated\";\n\nexport type { ThemeColorName, ThemeMode, ThemeName };\n\n/** Every color token as a ready-to-use string (`\"hsl(358, 100%, 67%)\"`), keyed by token name. */\nexport type ThemeColors = Readonly<Record<ThemeColorName, string>>;\n\n/** `system` follows the device appearance. */\nexport type ThemeModePreference = ThemeMode | \"system\";\n\nexport interface ThemeContextValue {\n /** Active theme name. */\n theme: ThemeName;\n /** Mode the provider was given (`system`, `light` or `dark`). */\n mode: ThemeModePreference;\n /** Mode actually applied after resolving `system`. */\n resolvedMode: ThemeMode;\n /**\n * Resolved colors for the active theme and `resolvedMode`. Only for things token classes\n * cannot reach: native map markers, a status bar, a web focus ring, a chart engine. Never\n * hard-code a color instead (D61).\n */\n colors: ThemeColors;\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\n/**\n * Internal: the provider's variable style, so a layer rendered outside its view (a React\n * Native `Modal`, which react-native-web portals to `document.body`) can set the same\n * variables again. Read through `ThemeScope`; not part of the public API.\n */\nexport const ThemeVarsContext = createContext<StyleProp<ViewStyle> | null>(\n null,\n);\n\nexport interface ThemeProviderProps {\n /** Bundled theme to apply. */\n theme: ThemeName;\n /** Light, dark, or follow the device. Defaults to `system`. */\n mode?: ThemeModePreference;\n children: ReactNode;\n}\n\n/**\n * Applies a bundled theme to everything below it by setting the token CSS\n * variables with NativeWind `vars()` (D6, D14). Wrap the app root once.\n */\nexport function ThemeProvider({\n theme,\n mode = \"system\",\n children,\n}: ThemeProviderProps) {\n const system = useColorScheme();\n const resolvedMode: ThemeMode =\n mode === \"system\" ? (system === \"dark\" ? \"dark\" : \"light\") : mode;\n\n const value = useMemo(\n () => ({\n theme,\n mode,\n resolvedMode,\n colors: themeColors[theme][resolvedMode],\n }),\n [theme, mode, resolvedMode],\n );\n const style = useMemo(\n () => [\n { flex: 1 },\n vars({ ...baseVars, ...themeVars[theme][resolvedMode] }),\n ],\n [theme, resolvedMode],\n );\n\n return (\n <ThemeContext.Provider value={value}>\n <ThemeVarsContext.Provider value={style}>\n <View style={style}>{children}</View>\n </ThemeVarsContext.Provider>\n </ThemeContext.Provider>\n );\n}\n\n/** Reads the active theme. Must be called below a `ThemeProvider`. */\nexport function useTheme(): ThemeContextValue {\n const ctx = useContext(ThemeContext);\n if (!ctx) throw new Error(\"useTheme must be used within a ThemeProvider\");\n return ctx;\n}\n","// Generated by scripts/tokens-build.ts from tokens/themes.json. DO NOT EDIT.\n// Run `npm run tokens:build` after changing the token file.\n\nexport type ThemeName = \"coral\" | \"macaron\";\nexport type ThemeMode = \"light\" | \"dark\";\n\nexport const baseVars = {\n \"--radius-sm\": \"4px\",\n \"--radius-md\": \"8px\",\n \"--radius-lg\": \"12px\",\n \"--radius-xl\": \"16px\",\n \"--radius-full\": \"9999px\",\n \"--font-sans\": \"Pretendard-Regular\",\n \"--font-sans-medium\": \"Pretendard-Medium\",\n \"--font-sans-semibold\": \"Pretendard-SemiBold\",\n \"--font-display\": \"Pretendard-Bold\"\n} as const;\n\nexport const themeVars: Record<ThemeName, Record<ThemeMode, Record<string, string>>> = {\n \"coral\": {\n \"light\": {\n \"--background\": \"0 0% 100%\",\n \"--foreground\": \"0 0% 15%\",\n \"--card\": \"0 0% 98%\",\n \"--card-foreground\": \"0 0% 15%\",\n \"--popover\": \"0 0% 98%\",\n \"--popover-foreground\": \"0 0% 15%\",\n \"--primary\": \"358 100% 67%\",\n \"--primary-foreground\": \"0 0% 100%\",\n \"--secondary\": \"0 0% 96%\",\n \"--secondary-foreground\": \"0 0% 15%\",\n \"--muted\": \"0 0% 42%\",\n \"--muted-foreground\": \"0 0% 42%\",\n \"--accent\": \"358 100% 67%\",\n \"--accent-foreground\": \"0 0% 100%\",\n \"--destructive\": \"0 72% 51%\",\n \"--destructive-foreground\": \"0 0% 100%\",\n \"--border\": \"0 0% 90%\",\n \"--input\": \"0 0% 90%\",\n \"--ring\": \"358 100% 67%\",\n \"--gold\": \"43 100% 50%\",\n \"--gold-dark\": \"43 100% 45%\",\n \"--silver\": \"0 0% 75%\",\n \"--bronze\": \"25 60% 50%\",\n \"--medal-foreground\": \"0 0% 15%\",\n \"--info\": \"217 91% 48%\",\n \"--info-foreground\": \"0 0% 100%\"\n },\n \"dark\": {\n \"--background\": \"222 47% 11%\",\n \"--foreground\": \"210 40% 98%\",\n \"--card\": \"224 47% 13%\",\n \"--card-foreground\": \"210 40% 98%\",\n \"--popover\": \"224 47% 13%\",\n \"--popover-foreground\": \"210 40% 98%\",\n \"--primary\": \"358 100% 67%\",\n \"--primary-foreground\": \"0 0% 100%\",\n \"--secondary\": \"217 33% 17%\",\n \"--secondary-foreground\": \"210 40% 98%\",\n \"--muted\": \"215 20% 35%\",\n \"--muted-foreground\": \"215 20% 55%\",\n \"--accent\": \"358 100% 67%\",\n \"--accent-foreground\": \"0 0% 100%\",\n \"--destructive\": \"0 84% 60%\",\n \"--destructive-foreground\": \"0 0% 100%\",\n \"--border\": \"217 33% 20%\",\n \"--input\": \"217 33% 20%\",\n \"--ring\": \"358 100% 67%\",\n \"--gold\": \"43 100% 50%\",\n \"--gold-dark\": \"43 100% 55%\",\n \"--silver\": \"0 0% 75%\",\n \"--bronze\": \"25 60% 50%\",\n \"--medal-foreground\": \"0 0% 15%\",\n \"--info\": \"213 94% 68%\",\n \"--info-foreground\": \"222 47% 11%\"\n }\n },\n \"macaron\": {\n \"light\": {\n \"--background\": \"0 0% 100%\",\n \"--foreground\": \"0 0% 15%\",\n \"--card\": \"0 0% 98%\",\n \"--card-foreground\": \"0 0% 15%\",\n \"--popover\": \"0 0% 98%\",\n \"--popover-foreground\": \"0 0% 15%\",\n \"--primary\": \"358 100% 67%\",\n \"--primary-foreground\": \"0 0% 100%\",\n \"--secondary\": \"0 0% 96%\",\n \"--secondary-foreground\": \"0 0% 15%\",\n \"--muted\": \"0 0% 42%\",\n \"--muted-foreground\": \"0 0% 42%\",\n \"--accent\": \"358 100% 67%\",\n \"--accent-foreground\": \"0 0% 100%\",\n \"--destructive\": \"0 72% 51%\",\n \"--destructive-foreground\": \"0 0% 100%\",\n \"--border\": \"0 0% 90%\",\n \"--input\": \"0 0% 90%\",\n \"--ring\": \"358 100% 67%\",\n \"--gold\": \"43 100% 50%\",\n \"--gold-dark\": \"43 100% 45%\",\n \"--silver\": \"0 0% 75%\",\n \"--bronze\": \"25 60% 50%\",\n \"--medal-foreground\": \"0 0% 15%\",\n \"--info\": \"217 91% 48%\",\n \"--info-foreground\": \"0 0% 100%\"\n },\n \"dark\": {\n \"--background\": \"0 0% 7%\",\n \"--foreground\": \"0 0% 93%\",\n \"--card\": \"0 0% 11%\",\n \"--card-foreground\": \"0 0% 93%\",\n \"--popover\": \"0 0% 11%\",\n \"--popover-foreground\": \"0 0% 93%\",\n \"--primary\": \"358 100% 67%\",\n \"--primary-foreground\": \"0 0% 100%\",\n \"--secondary\": \"0 0% 15%\",\n \"--secondary-foreground\": \"0 0% 93%\",\n \"--muted\": \"0 0% 62%\",\n \"--muted-foreground\": \"0 0% 62%\",\n \"--accent\": \"358 100% 67%\",\n \"--accent-foreground\": \"0 0% 100%\",\n \"--destructive\": \"0 84% 60%\",\n \"--destructive-foreground\": \"0 0% 100%\",\n \"--border\": \"0 0% 20%\",\n \"--input\": \"0 0% 24%\",\n \"--ring\": \"358 100% 67%\",\n \"--gold\": \"43 100% 50%\",\n \"--gold-dark\": \"43 100% 45%\",\n \"--silver\": \"0 0% 75%\",\n \"--bronze\": \"25 60% 50%\",\n \"--medal-foreground\": \"0 0% 15%\",\n \"--info\": \"213 94% 68%\",\n \"--info-foreground\": \"222 47% 11%\"\n }\n }\n};\n\n/** A color token name, the CSS variable without its `--` (`primary`, `muted-foreground`). */\nexport type ThemeColorName =\n | \"background\"\n | \"foreground\"\n | \"card\"\n | \"card-foreground\"\n | \"popover\"\n | \"popover-foreground\"\n | \"primary\"\n | \"primary-foreground\"\n | \"secondary\"\n | \"secondary-foreground\"\n | \"muted\"\n | \"muted-foreground\"\n | \"accent\"\n | \"accent-foreground\"\n | \"destructive\"\n | \"destructive-foreground\"\n | \"border\"\n | \"input\"\n | \"ring\"\n | \"gold\"\n | \"gold-dark\"\n | \"silver\"\n | \"bronze\"\n | \"medal-foreground\"\n | \"info\"\n | \"info-foreground\";\n\n/** Ready-to-use color strings per theme and mode, for code that cannot use token classes (D61). */\nexport const themeColors: Record<ThemeName, Record<ThemeMode, Record<ThemeColorName, string>>> = {\n \"coral\": {\n \"light\": {\n \"background\": \"hsl(0, 0%, 100%)\",\n \"foreground\": \"hsl(0, 0%, 15%)\",\n \"card\": \"hsl(0, 0%, 98%)\",\n \"card-foreground\": \"hsl(0, 0%, 15%)\",\n \"popover\": \"hsl(0, 0%, 98%)\",\n \"popover-foreground\": \"hsl(0, 0%, 15%)\",\n \"primary\": \"hsl(358, 100%, 67%)\",\n \"primary-foreground\": \"hsl(0, 0%, 100%)\",\n \"secondary\": \"hsl(0, 0%, 96%)\",\n \"secondary-foreground\": \"hsl(0, 0%, 15%)\",\n \"muted\": \"hsl(0, 0%, 42%)\",\n \"muted-foreground\": \"hsl(0, 0%, 42%)\",\n \"accent\": \"hsl(358, 100%, 67%)\",\n \"accent-foreground\": \"hsl(0, 0%, 100%)\",\n \"destructive\": \"hsl(0, 72%, 51%)\",\n \"destructive-foreground\": \"hsl(0, 0%, 100%)\",\n \"border\": \"hsl(0, 0%, 90%)\",\n \"input\": \"hsl(0, 0%, 90%)\",\n \"ring\": \"hsl(358, 100%, 67%)\",\n \"gold\": \"hsl(43, 100%, 50%)\",\n \"gold-dark\": \"hsl(43, 100%, 45%)\",\n \"silver\": \"hsl(0, 0%, 75%)\",\n \"bronze\": \"hsl(25, 60%, 50%)\",\n \"medal-foreground\": \"hsl(0, 0%, 15%)\",\n \"info\": \"hsl(217, 91%, 48%)\",\n \"info-foreground\": \"hsl(0, 0%, 100%)\"\n },\n \"dark\": {\n \"background\": \"hsl(222, 47%, 11%)\",\n \"foreground\": \"hsl(210, 40%, 98%)\",\n \"card\": \"hsl(224, 47%, 13%)\",\n \"card-foreground\": \"hsl(210, 40%, 98%)\",\n \"popover\": \"hsl(224, 47%, 13%)\",\n \"popover-foreground\": \"hsl(210, 40%, 98%)\",\n \"primary\": \"hsl(358, 100%, 67%)\",\n \"primary-foreground\": \"hsl(0, 0%, 100%)\",\n \"secondary\": \"hsl(217, 33%, 17%)\",\n \"secondary-foreground\": \"hsl(210, 40%, 98%)\",\n \"muted\": \"hsl(215, 20%, 35%)\",\n \"muted-foreground\": \"hsl(215, 20%, 55%)\",\n \"accent\": \"hsl(358, 100%, 67%)\",\n \"accent-foreground\": \"hsl(0, 0%, 100%)\",\n \"destructive\": \"hsl(0, 84%, 60%)\",\n \"destructive-foreground\": \"hsl(0, 0%, 100%)\",\n \"border\": \"hsl(217, 33%, 20%)\",\n \"input\": \"hsl(217, 33%, 20%)\",\n \"ring\": \"hsl(358, 100%, 67%)\",\n \"gold\": \"hsl(43, 100%, 50%)\",\n \"gold-dark\": \"hsl(43, 100%, 55%)\",\n \"silver\": \"hsl(0, 0%, 75%)\",\n \"bronze\": \"hsl(25, 60%, 50%)\",\n \"medal-foreground\": \"hsl(0, 0%, 15%)\",\n \"info\": \"hsl(213, 94%, 68%)\",\n \"info-foreground\": \"hsl(222, 47%, 11%)\"\n }\n },\n \"macaron\": {\n \"light\": {\n \"background\": \"hsl(0, 0%, 100%)\",\n \"foreground\": \"hsl(0, 0%, 15%)\",\n \"card\": \"hsl(0, 0%, 98%)\",\n \"card-foreground\": \"hsl(0, 0%, 15%)\",\n \"popover\": \"hsl(0, 0%, 98%)\",\n \"popover-foreground\": \"hsl(0, 0%, 15%)\",\n \"primary\": \"hsl(358, 100%, 67%)\",\n \"primary-foreground\": \"hsl(0, 0%, 100%)\",\n \"secondary\": \"hsl(0, 0%, 96%)\",\n \"secondary-foreground\": \"hsl(0, 0%, 15%)\",\n \"muted\": \"hsl(0, 0%, 42%)\",\n \"muted-foreground\": \"hsl(0, 0%, 42%)\",\n \"accent\": \"hsl(358, 100%, 67%)\",\n \"accent-foreground\": \"hsl(0, 0%, 100%)\",\n \"destructive\": \"hsl(0, 72%, 51%)\",\n \"destructive-foreground\": \"hsl(0, 0%, 100%)\",\n \"border\": \"hsl(0, 0%, 90%)\",\n \"input\": \"hsl(0, 0%, 90%)\",\n \"ring\": \"hsl(358, 100%, 67%)\",\n \"gold\": \"hsl(43, 100%, 50%)\",\n \"gold-dark\": \"hsl(43, 100%, 45%)\",\n \"silver\": \"hsl(0, 0%, 75%)\",\n \"bronze\": \"hsl(25, 60%, 50%)\",\n \"medal-foreground\": \"hsl(0, 0%, 15%)\",\n \"info\": \"hsl(217, 91%, 48%)\",\n \"info-foreground\": \"hsl(0, 0%, 100%)\"\n },\n \"dark\": {\n \"background\": \"hsl(0, 0%, 7%)\",\n \"foreground\": \"hsl(0, 0%, 93%)\",\n \"card\": \"hsl(0, 0%, 11%)\",\n \"card-foreground\": \"hsl(0, 0%, 93%)\",\n \"popover\": \"hsl(0, 0%, 11%)\",\n \"popover-foreground\": \"hsl(0, 0%, 93%)\",\n \"primary\": \"hsl(358, 100%, 67%)\",\n \"primary-foreground\": \"hsl(0, 0%, 100%)\",\n \"secondary\": \"hsl(0, 0%, 15%)\",\n \"secondary-foreground\": \"hsl(0, 0%, 93%)\",\n \"muted\": \"hsl(0, 0%, 62%)\",\n \"muted-foreground\": \"hsl(0, 0%, 62%)\",\n \"accent\": \"hsl(358, 100%, 67%)\",\n \"accent-foreground\": \"hsl(0, 0%, 100%)\",\n \"destructive\": \"hsl(0, 84%, 60%)\",\n \"destructive-foreground\": \"hsl(0, 0%, 100%)\",\n \"border\": \"hsl(0, 0%, 20%)\",\n \"input\": \"hsl(0, 0%, 24%)\",\n \"ring\": \"hsl(358, 100%, 67%)\",\n \"gold\": \"hsl(43, 100%, 50%)\",\n \"gold-dark\": \"hsl(43, 100%, 45%)\",\n \"silver\": \"hsl(0, 0%, 75%)\",\n \"bronze\": \"hsl(25, 60%, 50%)\",\n \"medal-foreground\": \"hsl(0, 0%, 15%)\",\n \"info\": \"hsl(213, 94%, 68%)\",\n \"info-foreground\": \"hsl(222, 47%, 11%)\"\n }\n }\n};\n","import { View } from \"react-native\";\nimport { useSafeAreaInsetsOnce } from \"../../atoms/safe-area/SafeArea\";\nimport { Button } from \"../../atoms/button/Button\";\n\n/** Fill of an ActionBar button: primary (default) or destructive, e.g. for delete. */\nexport type ActionBarTone = \"default\" | \"destructive\";\n\nexport interface ActionBarAction {\n label: string;\n onPress: () => void;\n /** Shows a spinner and blocks presses, e.g. while saving. */\n loading?: boolean;\n disabled?: boolean;\n tone?: ActionBarTone;\n testID?: string;\n}\n\nexport interface ActionBarProps {\n /** Filled button on the right; full width alone, half width beside `secondary`. */\n primary: ActionBarAction;\n /** Outlined button left of the primary one, e.g. cancel or edit; same width. */\n secondary?: ActionBarAction;\n /**\n * Renders only the buttons, without the bar's border, padding and inset. Use it inside\n * a DetailTemplate `footer`, which already draws them.\n */\n embedded?: boolean;\n /** Pads the bottom safe-area inset (default). Ignored when `embedded`. */\n safeAreaBottom?: boolean;\n /** Accessible name of the spinners. Defaults to \"Loading\". */\n loadingLabel?: string;\n testID?: string;\n /**\n * Up to two outlined, equal-width buttons in a second row under the primary one, e.g.\n * share and duplicate. Only the first two are drawn.\n */\n extraActions?: ActionBarAction[];\n}\n\nfunction ActionButton({\n action,\n filled,\n loadingLabel,\n}: {\n action: ActionBarAction;\n filled: boolean;\n loadingLabel: string;\n}) {\n return (\n <Button\n testID={action.testID}\n label={action.label}\n onPress={action.onPress}\n loading={action.loading}\n loadingLabel={loadingLabel}\n disabled={action.disabled}\n variant={filled ? \"primary\" : \"outline\"}\n tone={action.tone === \"destructive\" ? \"destructive\" : \"default\"}\n layout=\"fill\"\n />\n );\n}\n\n/**\n * Bottom action bar: an optional outlined secondary button and a filled primary one, each\n * with loading, disabled and destructive states. Pads the bottom safe-area inset.\n */\nexport function ActionBar({\n primary,\n secondary,\n embedded = false,\n safeAreaBottom = true,\n loadingLabel = \"Loading\",\n testID,\n extraActions,\n}: ActionBarProps) {\n const insets = useSafeAreaInsetsOnce();\n const extras = extraActions?.slice(0, 2) ?? [];\n const buttons = (\n <View className=\"w-full flex-row gap-3\">\n {secondary ? (\n <ActionButton\n action={secondary}\n filled={false}\n loadingLabel={loadingLabel}\n />\n ) : null}\n <ActionButton action={primary} filled loadingLabel={loadingLabel} />\n </View>\n );\n const row = (\n <View\n testID={embedded ? testID : undefined}\n className=\"w-full max-w-[720px] gap-3 self-center\"\n >\n {buttons}\n {extras.length > 0 ? (\n <View className=\"w-full flex-row gap-3\">\n {extras.map((action, i) => (\n <ActionButton\n key={i}\n action={action}\n filled={false}\n loadingLabel={loadingLabel}\n />\n ))}\n </View>\n ) : null}\n </View>\n );\n if (embedded) return row;\n const bottom = safeAreaBottom ? insets.bottom : 0;\n return (\n <View\n testID={testID}\n style={{ paddingBottom: 12 + bottom }}\n className=\"border-t border-[hsl(var(--border))] bg-[hsl(var(--background))] px-4 pt-3\"\n >\n {row}\n </View>\n );\n}\n","import { createContext, useContext, useMemo, type ReactNode } from \"react\";\nimport { Platform, View, type ViewProps } from \"react-native\";\nimport { SafeAreaInsetsContext } from \"react-native-safe-area-context\";\n\n/**\n * Internal: pad each safe-area edge once (D66).\n *\n * `react-native-safe-area-context` reports the provider's full insets to every nested\n * `SafeAreaView` and inset hook, on iOS, Android and web alike, so a template inside an\n * AppShell padded the status bar twice. Every design-system component that pads an inset\n * goes through this atom instead: `SafeAreaBox` pads the edges no ancestor padded yet and\n * marks them padded for its children, and `useSafeAreaInsetsOnce` gives a bar the insets\n * still left to pad. Full-screen surfaces start over: AppShell and LockTemplate\n * (`SafeAreaBox root`) and the Sheet's modal content (`SafeAreaPadded reset`), since a\n * Modal covers the screen whatever padded the screen under it.\n *\n * Marks are scoped to the `SafeAreaProvider` they were made under (D67): under a different\n * provider (a different insets object) nothing is padded yet. On iOS a natively presented\n * screen (native-stack `modal`, `formSheet`, `pageSheet`) is drawn outside the shell's\n * padded view but inherits its React context; a `SafeAreaProvider` around that screen\n * measures the sheet's own insets and starts the marks over. On Android a nested provider\n * sits inside the padded view and measures about 0. Web providers all report the window's\n * insets and web never presents a screen outside the shell, so web keeps the marks.\n */\nexport type SafeAreaEdge = \"top\" | \"right\" | \"bottom\" | \"left\";\n\nexport interface SafeAreaInsets {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\ninterface PaddedEdges extends Record<SafeAreaEdge, boolean> {\n /** The provider's insets object the marks were made under (D67). */\n scope: SafeAreaInsets | null;\n}\n\nconst NONE: PaddedEdges = {\n top: false,\n right: false,\n bottom: false,\n left: false,\n scope: null,\n};\n\nconst PaddedEdgesContext = createContext<PaddedEdges>(NONE);\n\n/** The marks that hold under the nearest provider: none under a different one (D67). */\nfunction usePaddedEdges(): PaddedEdges {\n const insets = useContext(SafeAreaInsetsContext);\n const padded = useContext(PaddedEdgesContext);\n return Platform.OS === \"web\" || padded.scope === insets ? padded : NONE;\n}\n\n/** The safe-area insets an ancestor has not padded yet; 0 outside a provider. */\nexport function useSafeAreaInsetsOnce(): SafeAreaInsets {\n const insets = useContext(SafeAreaInsetsContext);\n const padded = usePaddedEdges();\n const remaining = (edge: SafeAreaEdge) =>\n padded[edge] ? 0 : (insets?.[edge] ?? 0);\n return {\n top: remaining(\"top\"),\n right: remaining(\"right\"),\n bottom: remaining(\"bottom\"),\n left: remaining(\"left\"),\n };\n}\n\n/**\n * Marks `edges` as padded for everything inside, so nothing below pads them again.\n * `reset` starts from no padded edges instead of the ancestors': for modal content, which\n * covers the whole screen whatever padded the screen under it.\n */\nexport function SafeAreaPadded({\n edges,\n reset = false,\n children,\n}: {\n edges: SafeAreaEdge[];\n reset?: boolean;\n children: ReactNode;\n}) {\n const insets = useContext(SafeAreaInsetsContext);\n const inherited = usePaddedEdges();\n const padded = reset ? NONE : inherited;\n const key = edges.join(\",\");\n const value = useMemo(() => {\n const next = { ...padded, scope: insets };\n for (const edge of key.split(\",\")) {\n if (edge) next[edge as SafeAreaEdge] = true;\n }\n return next;\n }, [padded, key, insets]);\n return (\n <PaddedEdgesContext.Provider value={value}>\n {children}\n </PaddedEdgesContext.Provider>\n );\n}\n\nconst PADDING: Record<SafeAreaEdge, string> = {\n top: \"paddingTop\",\n right: \"paddingRight\",\n bottom: \"paddingBottom\",\n left: \"paddingLeft\",\n};\n\nexport interface SafeAreaBoxProps extends ViewProps {\n /** Edges to pad. The className must not set padding on these edges. */\n edges: SafeAreaEdge[];\n /**\n * A full-screen surface (AppShell, LockTemplate): pads `edges` with the full insets\n * whatever is around it and starts over for its children. It may sit in a Modal that\n * covers a screen whose shell already padded those edges.\n */\n root?: boolean;\n className?: string;\n}\n\n/**\n * A View that pads `edges` with the insets no ancestor padded yet (a replacement for\n * `SafeAreaView`), then marks them padded for its children.\n */\nexport function SafeAreaBox({\n edges,\n root = false,\n style,\n children,\n ...rest\n}: SafeAreaBoxProps) {\n const remaining = useSafeAreaInsetsOnce();\n const raw = useContext(SafeAreaInsetsContext);\n const padding: Record<string, number> = {};\n for (const edge of edges) {\n padding[PADDING[edge]] = root ? (raw?.[edge] ?? 0) : remaining[edge];\n }\n return (\n <View {...rest} style={[style, padding]}>\n <SafeAreaPadded edges={edges} reset={root}>\n {children}\n </SafeAreaPadded>\n </View>\n );\n}\n","import type { ComponentProps } from \"react\";\nimport Ionicons from \"@expo/vector-icons/Ionicons\";\nimport { cssInterop } from \"nativewind\";\n\n/** Any Ionicons glyph name, e.g. \"settings-outline\". */\nexport type IconName = ComponentProps<typeof Ionicons>[\"name\"];\n\n// Lets a text-color class (text-[hsl(var(--x))]) drive the glyph color.\nconst ThemedIonicons = cssInterop(Ionicons, {\n className: { target: \"style\", nativeStyleToProp: { color: true } },\n});\n\nexport interface IconProps {\n name: IconName;\n /** Glyph size in px. Defaults to 20. */\n size?: number;\n /** Text-color class for the glyph, e.g. \"text-[hsl(var(--foreground))]\". */\n className?: string;\n}\n\n/** Internal atom: an Ionicons glyph colored by a token class (icon decision, D38). */\nexport function Icon({ name, size = 20, className }: IconProps) {\n return <ThemedIonicons name={name} size={size} className={className} />;\n}\n","import { ActivityIndicator } from \"react-native\";\n\n/** Token color of the spinner. */\nexport type SpinnerTone =\n | \"muted\"\n | \"default\"\n | \"destructive\"\n | \"on-primary\"\n | \"on-destructive\"\n | \"inverse\"\n | \"on-scrim\";\n\nexport interface SpinnerProps {\n /** Accessible name, e.g. \"Loading\". */\n label: string;\n /** Defaults to `muted`. */\n tone?: SpinnerTone;\n /** Defaults to `small`. */\n size?: \"small\" | \"large\";\n testID?: string;\n}\n\nconst TONE: Record<SpinnerTone, string> = {\n muted: \"text-[hsl(var(--muted-foreground))]\",\n default: \"text-[hsl(var(--foreground))]\",\n destructive: \"text-[hsl(var(--destructive))]\",\n \"on-primary\": \"text-[hsl(var(--primary-foreground))]\",\n \"on-destructive\": \"text-[hsl(var(--destructive-foreground))]\",\n inverse: \"text-[hsl(var(--background))]\",\n \"on-scrim\": \"text-white\",\n};\n\n/** Internal atom: an activity indicator colored by a token tone. */\nexport function Spinner({\n label,\n tone = \"muted\",\n size = \"small\",\n testID,\n}: SpinnerProps) {\n return (\n <ActivityIndicator\n testID={testID}\n size={size}\n accessibilityLabel={label}\n className={TONE[tone]}\n />\n );\n}\n","import { Pressable, type PressableProps } from \"react-native\";\n\n/** What a press looks like: `fill` tints the secondary color, `fade` dims, `none` shows nothing. */\nexport type PressFeedback = \"fill\" | \"fade\" | \"none\";\n\nexport interface PressableSurfaceProps extends Omit<\n PressableProps,\n \"className\"\n> {\n /** Defaults to `fill`. */\n feedback?: PressFeedback;\n /** Dims the surface to 50% while disabled. Defaults to true. */\n dimDisabled?: boolean;\n /** Box and layout classes of the surface (size, padding, border, fill). */\n className?: string;\n}\n\nconst FEEDBACK: Record<PressFeedback, string> = {\n fill: \"active:bg-[hsl(var(--secondary))]\",\n fade: \"active:opacity-70\",\n none: \"\",\n};\n\n/**\n * Internal atom: a pressable surface with token press feedback; disabled dims it to 50%.\n * Every pressable row, field and control renders through it.\n */\nexport function PressableSurface({\n feedback = \"fill\",\n dimDisabled = true,\n className,\n disabled,\n ...props\n}: PressableSurfaceProps) {\n const classes = [\n className,\n FEEDBACK[feedback],\n disabled && dimDisabled ? \"opacity-50\" : \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n return <Pressable {...props} disabled={disabled} className={classes} />;\n}\n","import { Text as RNText, type TextProps as RNTextProps } from \"react-native\";\n\n/** Type scale (family and size). */\nexport type TextVariant =\n | \"display\"\n | \"title\"\n | \"heading\"\n | \"subheading\"\n | \"body\"\n | \"label\"\n | \"small\"\n | \"caption\"\n | \"footnote\"\n | \"headline\"\n | \"display-sm\"\n | \"callout\"\n | \"numeral\"\n | \"micro\"\n | \"badge\";\n\n/** Overrides the variant's default weight. */\nexport type TextWeight = \"regular\" | \"medium\" | \"semibold\";\n\n/** Token color of the text. */\nexport type TextTone =\n | \"default\"\n | \"muted\"\n | \"primary\"\n | \"destructive\"\n | \"on-primary\"\n | \"on-secondary\"\n | \"on-destructive\"\n | \"on-card\"\n | \"inverse\"\n | \"on-scrim\"\n | \"on-medal\"\n | \"info\";\n\nexport interface TextProps extends Omit<RNTextProps, \"className\"> {\n /** Defaults to `body`. */\n variant?: TextVariant;\n weight?: TextWeight;\n /** Defaults to `default` (foreground). */\n tone?: TextTone;\n /** Layout classes only (flex, alignment, spacing); never color or type. */\n className?: string;\n}\n\nconst SIZE: Record<TextVariant, string> = {\n display: \"text-[30px]\",\n title: \"text-xl\",\n heading: \"text-lg\",\n subheading: \"text-base\",\n body: \"text-base\",\n label: \"text-sm\",\n small: \"text-sm\",\n caption: \"text-[13px]\",\n footnote: \"text-xs\",\n headline: \"text-2xl\",\n // 24px display face: screen titles in a top bar.\n \"display-sm\": \"text-2xl\",\n // 15px with a 21px line: chat message bodies.\n callout: \"text-[15px] leading-[21px]\",\n // 28px: keypad digits.\n numeral: \"text-[28px]\",\n // 11px: labels under navigation icons.\n micro: \"text-[11px]\",\n // 10px, tight line: count badges.\n badge: \"text-[10px] leading-tight\",\n};\n\nconst DEFAULT_WEIGHT: Record<TextVariant, TextWeight | \"display\"> = {\n display: \"display\",\n title: \"semibold\",\n heading: \"semibold\",\n subheading: \"semibold\",\n body: \"regular\",\n label: \"medium\",\n small: \"regular\",\n caption: \"regular\",\n footnote: \"regular\",\n headline: \"semibold\",\n \"display-sm\": \"display\",\n callout: \"regular\",\n numeral: \"medium\",\n micro: \"semibold\",\n badge: \"semibold\",\n};\n\nconst FAMILY: Record<TextWeight | \"display\", string> = {\n display: \"font-[family-name:var(--font-display)]\",\n regular: \"font-[family-name:var(--font-sans)]\",\n medium: \"font-[family-name:var(--font-sans-medium)]\",\n semibold: \"font-[family-name:var(--font-sans-semibold)]\",\n};\n\nconst TONE: Record<TextTone, string> = {\n default: \"text-[hsl(var(--foreground))]\",\n muted: \"text-[hsl(var(--muted-foreground))]\",\n primary: \"text-[hsl(var(--primary))]\",\n destructive: \"text-[hsl(var(--destructive))]\",\n \"on-primary\": \"text-[hsl(var(--primary-foreground))]\",\n \"on-secondary\": \"text-[hsl(var(--secondary-foreground))]\",\n \"on-destructive\": \"text-[hsl(var(--destructive-foreground))]\",\n \"on-card\": \"text-[hsl(var(--card-foreground))]\",\n inverse: \"text-[hsl(var(--background))]\",\n \"on-scrim\": \"text-white\",\n // Dark text on the gold, silver and bronze rank discs in every mode.\n \"on-medal\": \"text-[hsl(var(--medal-foreground))]\",\n // Informational blue, e.g. Saturday day numbers (D63).\n info: \"text-[hsl(var(--info))]\",\n};\n\n/** The classes a Text with these props renders, for inputs that share the type scale. */\nexport function textClasses(\n variant: TextVariant = \"body\",\n tone: TextTone = \"default\",\n weight?: TextWeight,\n): string {\n return `${FAMILY[weight ?? DEFAULT_WEIGHT[variant]]} ${SIZE[variant]} ${TONE[tone]}`;\n}\n\n/** Internal atom: text on the type scale, colored by a token tone. */\nexport function Text({\n variant = \"body\",\n weight,\n tone = \"default\",\n className,\n ...props\n}: TextProps) {\n return (\n <RNText\n {...props}\n className={`${textClasses(variant, tone, weight)}${className ? ` ${className}` : \"\"}`}\n />\n );\n}\n","import { Icon, type IconName } from \"../icon/Icon\";\nimport { Spinner } from \"../spinner/Spinner\";\nimport { PressableSurface } from \"../pressable-surface/PressableSurface\";\nimport { Text } from \"../text/Text\";\n\n/** `primary`: filled; `outline`: bordered on the background; `ghost`: text only. */\nexport type ButtonVariant = \"primary\" | \"outline\" | \"ghost\";\n/** `destructive` swaps the primary color for the destructive one. */\nexport type ButtonTone = \"default\" | \"destructive\";\n/** Height: `lg` 44px, `md` 40px, `sm` 36px. */\nexport type ButtonSize = \"lg\" | \"md\" | \"sm\";\n/**\n * `full`: full width; `fill`: grows in a row; `hug`: fits its label, start-aligned;\n * `auto`: fits its label where the parent places it.\n */\nexport type ButtonLayout = \"full\" | \"fill\" | \"hug\" | \"auto\";\n\nexport interface ButtonProps {\n label: string;\n onPress: () => void;\n /** Defaults to `primary`. */\n variant?: ButtonVariant;\n /** Defaults to `default`. */\n tone?: ButtonTone;\n /** Defaults to `lg`. */\n size?: ButtonSize;\n /** Defaults to `full`. */\n layout?: ButtonLayout;\n /** `pill` rounds the ends fully. Defaults to `rounded` (the large radius). */\n shape?: \"rounded\" | \"pill\";\n /** Shows a spinner and blocks presses. */\n loading?: boolean;\n /** Accessible name of the spinner. Defaults to \"Loading\". */\n loadingLabel?: string;\n disabled?: boolean;\n testID?: string;\n /** Ionicons glyph before the label, in the label's color. */\n icon?: IconName;\n /** Announces the button as selected, e.g. a preset or shortcut chip that matches the value. */\n selected?: boolean;\n}\n\nconst SIZE: Record<ButtonSize, string> = {\n lg: \"h-11\",\n md: \"h-10\",\n sm: \"h-9\",\n};\n\nconst LAYOUT: Record<ButtonLayout, string> = {\n full: \"w-full\",\n fill: \"flex-1\",\n hug: \"self-start\",\n auto: \"\",\n};\n\nconst ICON_TONE = {\n default: \"text-[hsl(var(--foreground))]\",\n destructive: \"text-[hsl(var(--destructive))]\",\n \"on-primary\": \"text-[hsl(var(--primary-foreground))]\",\n \"on-destructive\": \"text-[hsl(var(--destructive-foreground))]\",\n} as const;\n\n/** Internal atom: a button with variants, sizes, a loading spinner and a disabled state. */\nexport function Button({\n label,\n onPress,\n variant = \"primary\",\n tone = \"default\",\n size = \"lg\",\n layout = \"full\",\n shape = \"rounded\",\n loading = false,\n loadingLabel = \"Loading\",\n disabled = false,\n testID,\n icon,\n selected,\n}: ButtonProps) {\n const inactive = loading || disabled;\n const destructive = tone === \"destructive\";\n const filled = variant === \"primary\";\n const box = filled\n ? destructive\n ? \"bg-[hsl(var(--destructive))]\"\n : \"bg-[hsl(var(--primary))]\"\n : variant === \"ghost\"\n ? \"\"\n : \"border border-[hsl(var(--border))] bg-[hsl(var(--background))]\";\n const textTone = filled\n ? destructive\n ? (\"on-destructive\" as const)\n : (\"on-primary\" as const)\n : destructive\n ? (\"destructive\" as const)\n : (\"default\" as const);\n return (\n <PressableSurface\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{\n disabled: inactive,\n busy: loading,\n ...(selected != null ? { selected } : {}),\n }}\n disabled={inactive}\n onPress={onPress}\n feedback={filled ? \"none\" : \"fill\"}\n dimDisabled={false}\n className={`${inactive ? \"opacity-70\" : \"\"} ${SIZE[size]} ${LAYOUT[layout]} flex-row items-center justify-center ${shape === \"pill\" ? \"rounded-full\" : \"rounded-[var(--radius-lg)]\"} px-4 ${box}`}\n >\n {loading ? (\n <Spinner label={loadingLabel} tone={textTone} />\n ) : (\n <>\n {icon ? (\n <Icon\n name={icon}\n size={size === \"sm\" ? 16 : 18}\n className={`mr-1.5 ${ICON_TONE[textTone]}`}\n />\n ) : null}\n <Text variant=\"label\" tone={textTone}>\n {label}\n </Text>\n </>\n )}\n </PressableSurface>\n );\n}\n","import { View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { RatingStars } from \"../rating-stars/RatingStars\";\n\n/** Small read-only star rating at the end of the card. */\nexport interface ActionCardRating {\n value: number;\n /** Number of stars. Defaults to 5. */\n max?: number;\n /** Accessible name of the rating, e.g. \"Rating\". */\n label: string;\n}\n\n/** `default`: bordered card; `accent`: primary border and tint, e.g. once the action is done. */\nexport type ActionCardTone = \"default\" | \"accent\";\n\nexport interface ActionCardProps {\n /** Ionicons name in the round tile at the start, e.g. \"location-outline\". */\n icon: IconName;\n title: string;\n /** Muted line under the title, e.g. what has been done so far. */\n summary?: string;\n rating?: ActionCardRating;\n /** Defaults to `default`. */\n tone?: ActionCardTone;\n /** Label of a filled pill at the end, e.g. \"Start\"; without it the card shows a chevron. */\n cta?: string;\n onPress: () => void;\n /** Accessible name of the card. Defaults to its visible text. */\n accessibilityLabel?: string;\n testID?: string;\n /** testID of the summary line, e.g. for an end-to-end test that reads it. */\n summaryTestID?: string;\n}\n\nconst TONE: Record<\n ActionCardTone,\n { card: string; tile: string; icon: string }\n> = {\n default: {\n card: \"border-[hsl(var(--border))] bg-[hsl(var(--card))]\",\n tile: \"border border-[hsl(var(--border))] bg-[hsl(var(--background))]\",\n icon: \"text-[hsl(var(--muted-foreground))]\",\n },\n accent: {\n card: \"border-[hsl(var(--primary))] bg-[hsl(var(--primary)/0.08)]\",\n tile: \"bg-[hsl(var(--primary))]\",\n icon: \"text-[hsl(var(--primary-foreground))]\",\n },\n};\n\n/**\n * One pressable status card that opens a flow: an icon tile, a title and summary, an\n * optional small rating, and a call-to-action pill or a chevron. The `accent` tone marks\n * a done or active state.\n */\nexport function ActionCard({\n icon,\n title,\n summary,\n rating,\n tone = \"default\",\n cta,\n onPress,\n accessibilityLabel,\n testID,\n summaryTestID,\n}: ActionCardProps) {\n const look = TONE[tone];\n return (\n <PressableSurface\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n onPress={onPress}\n feedback=\"fade\"\n className={`min-h-[64px] flex-row items-center gap-3 rounded-[var(--radius-xl)] border px-4 py-3 ${look.card}`}\n >\n <View\n className={`h-10 w-10 items-center justify-center rounded-full ${look.tile}`}\n >\n <Icon name={icon} className={look.icon} />\n </View>\n <View className=\"min-w-0 shrink grow gap-0.5\">\n <Text variant=\"subheading\" tone=\"on-card\">\n {title}\n </Text>\n {summary ? (\n <Text testID={summaryTestID} variant=\"small\" tone=\"muted\">\n {summary}\n </Text>\n ) : null}\n </View>\n {rating ? (\n <RatingStars\n value={rating.value}\n max={rating.max}\n label={rating.label}\n size=\"sm\"\n />\n ) : null}\n {cta ? (\n <View className=\"rounded-full bg-[hsl(var(--primary))] px-3 py-2\">\n <Text variant=\"label\" tone=\"on-primary\">\n {cta}\n </Text>\n </View>\n ) : (\n <Icon\n name=\"chevron-forward\"\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n )}\n </PressableSurface>\n );\n}\n","import { View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\n\n/** `sm`: 16px stars for lists and cards; `md`: 28px stars for detail screens and input. */\nexport type RatingStarsSize = \"sm\" | \"md\";\n\nexport interface RatingStarsProps {\n /** Rating from 0 to `max`. Display mode shows halves (3.5); input mode rounds. */\n value: number;\n /** Number of stars. Defaults to 5. */\n max?: number;\n /** Makes the stars an input: a radio group with one radio per star. */\n onChange?: (value: number) => void;\n /** Accessible name of the rating, e.g. \"Rating\". */\n label: string;\n size?: RatingStarsSize;\n testID?: string;\n}\n\nconst SIZE: Record<\n RatingStarsSize,\n { icon: number; gap: string; hit: string }\n> = {\n sm: { icon: 16, gap: \"gap-0.5\", hit: \"h-8 w-8\" },\n md: { icon: 28, gap: \"gap-1\", hit: \"h-11 w-11\" },\n};\n\nconst GOLD = \"text-[hsl(var(--gold))]\";\nconst EMPTY = \"text-[hsl(var(--muted-foreground))]\";\n\nfunction star(value: number, position: number): IconName {\n if (value >= position) return \"star\";\n if (value >= position - 0.5) return \"star-half-outline\";\n return \"star-outline\";\n}\n\n/**\n * Row of gold stars. Without `onChange` it is a read-only image named \"label: value/max\";\n * with `onChange` it is a radio group named by `label`, one radio per star.\n */\nexport function RatingStars({\n value,\n max = 5,\n onChange,\n label,\n size = \"md\",\n testID,\n}: RatingStarsProps) {\n const positions = Array.from({ length: max }, (_, i) => i + 1);\n const { icon, gap, hit } = SIZE[size];\n\n if (!onChange) {\n return (\n <View\n testID={testID}\n accessible\n accessibilityRole=\"image\"\n accessibilityLabel={`${label}: ${value}/${max}`}\n className={`flex-row items-center ${gap}`}\n >\n {positions.map((position) => {\n const name = star(value, position);\n return (\n <Icon\n key={position}\n name={name}\n size={icon}\n className={name === \"star-outline\" ? EMPTY : GOLD}\n />\n );\n })}\n </View>\n );\n }\n\n const selected = Math.round(value);\n return (\n <View\n testID={testID}\n accessibilityRole=\"radiogroup\"\n accessibilityLabel={label}\n className=\"flex-row items-center\"\n >\n {positions.map((position) => (\n <PressableSurface\n key={position}\n testID={testID ? `${testID}-${position}` : undefined}\n accessibilityRole=\"radio\"\n accessibilityLabel={`${position}/${max}`}\n accessibilityState={{ checked: position === selected }}\n aria-checked={position === selected}\n onPress={() => onChange(position)}\n hitSlop={size === \"sm\" ? 6 : 0}\n feedback=\"fade\"\n className={`${hit} items-center justify-center`}\n >\n <Icon\n name={position <= selected ? \"star\" : \"star-outline\"}\n size={icon}\n className={position <= selected ? GOLD : EMPTY}\n />\n </PressableSurface>\n ))}\n </View>\n );\n}\n","import { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\n\nexport type ActionToggleTone = \"default\" | \"destructive\";\n\nexport interface ActionToggleProps {\n /** Ionicons name shown while inactive (and always for a plain action). */\n icon: IconName;\n /** Ionicons name shown while active. Defaults to `icon`. */\n activeIcon?: IconName;\n /** Accessible name, e.g. \"Mute microphone\". */\n label: string;\n /** Toggle state: primary fill while true. */\n active?: boolean;\n /** Makes it a toggle (switch role); called with the next state. */\n onToggle?: (next: boolean) => void;\n /** Plain action when there is no state to toggle, e.g. ending a session. */\n onPress?: () => void;\n /** \"destructive\" fills it with the destructive color. Defaults to \"default\". */\n tone?: ActionToggleTone;\n testID?: string;\n}\n\n/** Round 56px icon button: a toggle with `onToggle`, or a plain action with `onPress`. */\nexport function ActionToggle({\n icon,\n activeIcon,\n label,\n active = false,\n onToggle,\n onPress,\n tone = \"default\",\n testID,\n}: ActionToggleProps) {\n const isToggle = onToggle != null;\n let surface =\n \"border border-[hsl(var(--border))] bg-[hsl(var(--background))]\";\n let iconColor = \"text-[hsl(var(--foreground))]\";\n if (tone === \"destructive\") {\n surface = \"bg-[hsl(var(--destructive))]\";\n iconColor = \"text-[hsl(var(--destructive-foreground))]\";\n } else if (active) {\n surface = \"bg-[hsl(var(--primary))]\";\n iconColor = \"text-[hsl(var(--primary-foreground))]\";\n }\n\n return (\n <PressableSurface\n testID={testID}\n accessibilityRole={isToggle ? \"switch\" : \"button\"}\n accessibilityLabel={label}\n aria-checked={isToggle ? active : undefined}\n onPress={() => (isToggle ? onToggle(!active) : onPress?.())}\n feedback=\"none\"\n className={`h-14 w-14 items-center justify-center rounded-full ${surface}`}\n >\n <Icon\n name={active && activeIcon ? activeIcon : icon}\n size={24}\n className={iconColor}\n />\n </PressableSurface>\n );\n}\n","import { Modal, View } from \"react-native\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { ThemeScope } from \"../../theme/ThemeScope\";\n\nexport interface AlertDialogProps {\n /** Shows the dialog. The app owns this state. */\n open: boolean;\n title: string;\n description?: string;\n confirmLabel: string;\n cancelLabel: string;\n /** Fills the confirm button with the destructive color, e.g. for sign out or delete. */\n destructive?: boolean;\n onConfirm: () => void;\n /** Called by the cancel button, the Android back button and Escape on web. */\n onCancel: () => void;\n testID?: string;\n /**\n * Shows a spinner in the confirm button while the app runs the action, disables both\n * buttons and ignores back and Escape until it is cleared.\n */\n confirmLoading?: boolean;\n /** Accessible name of the confirm spinner. Defaults to \"Loading\". */\n confirmLoadingLabel?: string;\n /** A destructive line above the buttons, e.g. when the action failed. Announced as an alert. */\n error?: string | null;\n}\n\n/** Controlled confirm dialog over a scrim, with cancel and confirm buttons. */\nexport function AlertDialog({\n open,\n title,\n description,\n confirmLabel,\n cancelLabel,\n destructive = false,\n onConfirm,\n onCancel,\n testID,\n confirmLoading = false,\n confirmLoadingLabel,\n error,\n}: AlertDialogProps) {\n return (\n <Modal\n visible={open}\n transparent\n animationType=\"fade\"\n statusBarTranslucent\n onRequestClose={confirmLoading ? () => {} : onCancel}\n aria-label={title}\n >\n <ThemeScope>\n <View className=\"flex-1 items-center justify-center bg-black/50 p-6\">\n <View\n testID={testID}\n accessibilityViewIsModal\n className=\"w-full max-w-[420px] gap-2 rounded-[var(--radius-lg)] border border-[hsl(var(--border))] bg-[hsl(var(--background))] p-6 shadow-lg\"\n >\n <Text role=\"heading\" variant=\"heading\">\n {title}\n </Text>\n {description ? (\n <Text variant=\"small\" tone=\"muted\">\n {description}\n </Text>\n ) : null}\n {error ? (\n <Text\n testID={testID ? `${testID}-error` : undefined}\n accessibilityRole=\"alert\"\n variant=\"small\"\n tone=\"destructive\"\n className=\"mt-2\"\n >\n {error}\n </Text>\n ) : null}\n <View className=\"mt-4 flex-row justify-end gap-3\">\n <Button\n testID={testID ? `${testID}-cancel` : undefined}\n label={cancelLabel}\n onPress={onCancel}\n variant=\"outline\"\n size=\"md\"\n layout=\"auto\"\n disabled={confirmLoading}\n />\n <Button\n testID={testID ? `${testID}-confirm` : undefined}\n label={confirmLabel}\n onPress={onConfirm}\n tone={destructive ? \"destructive\" : \"default\"}\n size=\"md\"\n layout=\"auto\"\n loading={confirmLoading}\n loadingLabel={confirmLoadingLabel}\n />\n </View>\n </View>\n </View>\n </ThemeScope>\n </Modal>\n );\n}\n","import { useContext, type ReactNode } from \"react\";\nimport { View } from \"react-native\";\nimport { ThemeVarsContext } from \"./ThemeProvider\";\n\n/**\n * Internal: sets the nearest ThemeProvider's token variables again on a full-size view.\n * Wrap the content of every React Native `Modal` in it: react-native-web portals modal\n * content to `document.body`, outside the provider's view, so CSS variables don't reach it\n * (`scripts/modal-theme.test.ts` enforces this). Outside a provider it renders a plain\n * full-size view.\n */\nexport function ThemeScope({ children }: { children: ReactNode }) {\n const style = useContext(ThemeVarsContext);\n return <View style={style ?? { flex: 1 }}>{children}</View>;\n}\n","import { View } from \"react-native\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { FieldFrame } from \"../../atoms/field-frame/FieldFrame\";\nimport { Input } from \"../../atoms/input/Input\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { Field } from \"../../molecules/field/Field\";\n\n/** A quick-pick chip under the field; pressing it replaces the amount with `value`. */\nexport interface AmountInputPreset {\n /** Text the field takes when pressed, formatted like the app's input. */\n value: string;\n /** Chip label, e.g. \"+10\" or \"50\". */\n label: string;\n testID?: string;\n}\n\n/** Where the unit sits: before the number (\"$ 12\") or after it (\"12 kg\"). */\nexport type AmountInputUnitPosition = \"prefix\" | \"suffix\";\n\nexport interface AmountInputProps {\n /** The text as typed; parsing and grouping are the app's job. */\n value: string;\n onChangeText: (text: string) => void;\n placeholder: string;\n /** Visible label above the field; also the input's accessible name. */\n label?: string;\n /** Currency or unit shown inside the field, e.g. \"$\" or \"kg\". */\n unit?: string;\n /** Defaults to `suffix`. */\n unitPosition?: AmountInputUnitPosition;\n /** Decimal keyboard instead of digits only. */\n allowDecimal?: boolean;\n /** Inline error under the field; also outlines it in destructive. */\n error?: string | null;\n /** False while the form is busy. Defaults to true. */\n editable?: boolean;\n testID?: string;\n /** Muted read-back line under the field, formatted by the app, e.g. the amount in words. */\n hint?: string;\n /** Quick-pick chips under the field; the one whose value equals the field is selected. */\n presets?: AmountInputPreset[];\n}\n\n/**\n * Numeric amount field with an optional currency or unit before or after the number, an\n * optional read-back hint and quick-pick preset chips.\n */\nexport function AmountInput({\n value,\n onChangeText,\n placeholder,\n label,\n unit,\n unitPosition = \"suffix\",\n allowDecimal = false,\n error,\n editable = true,\n testID,\n hint,\n presets,\n}: AmountInputProps) {\n const unitText = unit ? (\n <Text aria-hidden weight=\"medium\" tone=\"muted\">\n {unit}\n </Text>\n ) : null;\n const name = label ?? placeholder;\n return (\n <Field\n label={label}\n error={error}\n errorTestID={testID ? `${testID}-error` : undefined}\n >\n <FieldFrame invalid={!!error} disabled={!editable}>\n {unitPosition === \"prefix\" ? unitText : null}\n <Input\n variant=\"bare\"\n testID={testID}\n value={value}\n onChangeText={onChangeText}\n placeholder={placeholder}\n editable={editable}\n keyboardType={allowDecimal ? \"decimal-pad\" : \"number-pad\"}\n inputMode={allowDecimal ? \"decimal\" : \"numeric\"}\n accessibilityLabel={unit ? `${name} (${unit})` : name}\n />\n {unitPosition === \"suffix\" ? unitText : null}\n </FieldFrame>\n {hint ? (\n <Text\n testID={testID ? `${testID}-hint` : undefined}\n variant=\"caption\"\n tone=\"muted\"\n className=\"text-right\"\n >\n {hint}\n </Text>\n ) : null}\n {presets?.length ? (\n <View className=\"flex-row flex-wrap gap-2\">\n {presets.map((preset) => {\n const selected = preset.value === value;\n return (\n <Button\n key={preset.value}\n testID={preset.testID}\n label={preset.label}\n onPress={() => onChangeText(preset.value)}\n variant={selected ? \"primary\" : \"outline\"}\n size=\"sm\"\n layout=\"auto\"\n disabled={!editable}\n selected={selected}\n />\n );\n })}\n </View>\n ) : null}\n </Field>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { View } from \"react-native\";\nimport { PressableSurface } from \"../pressable-surface/PressableSurface\";\n\nexport interface FieldFrameProps {\n /** Outlines the frame in the destructive color. */\n invalid?: boolean;\n /** Dims the frame and, when pressable, blocks presses. */\n disabled?: boolean;\n /** Makes the frame a button, e.g. a select or date trigger. */\n onPress?: () => void;\n /** Accessible name when pressable. */\n accessibilityLabel?: string;\n testID?: string;\n children: ReactNode;\n /** When pressable, announces whether the picker it opens is shown. */\n expanded?: boolean;\n}\n\nconst FRAME =\n \"h-11 w-full flex-row items-center gap-2 rounded-[var(--radius-lg)] border bg-[hsl(var(--background))] px-3\";\n\n/** Internal atom: the 44px bordered box of a form control, static or pressable. */\nexport function FieldFrame({\n invalid = false,\n disabled = false,\n onPress,\n accessibilityLabel,\n testID,\n children,\n expanded,\n}: FieldFrameProps) {\n const border = invalid\n ? \"border-[hsl(var(--destructive))]\"\n : \"border-[hsl(var(--input))]\";\n if (!onPress) {\n return (\n <View className={`${FRAME} ${border} ${disabled ? \"opacity-50\" : \"\"}`}>\n {children}\n </View>\n );\n }\n return (\n <PressableSurface\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityState={{\n disabled,\n ...(expanded != null ? { expanded } : {}),\n }}\n disabled={disabled}\n onPress={onPress}\n className={`${FRAME} ${border}`}\n >\n {children}\n </PressableSurface>\n );\n}\n","import { TextInput, type TextInputProps } from \"react-native\";\n\nexport type InputProps = Pick<\n TextInputProps,\n | \"value\"\n | \"onChangeText\"\n | \"placeholder\"\n | \"secureTextEntry\"\n | \"keyboardType\"\n | \"inputMode\"\n | \"autoCapitalize\"\n | \"autoComplete\"\n | \"returnKeyType\"\n | \"onSubmitEditing\"\n | \"maxLength\"\n | \"autoFocus\"\n | \"accessibilityLabel\"\n | \"testID\"\n | \"autoCorrect\"\n | \"numberOfLines\"\n | \"onKeyPress\"\n> & {\n /** False while the form is busy; dims an `outline` or `multiline` input. */\n editable: boolean;\n /**\n * `outline`: a 44px bordered box on its own; `bare`: no box, fills a FieldFrame row;\n * `multiline`: a bordered box that grows from 40px to 128px with its text. Defaults to `outline`.\n */\n variant?: \"outline\" | \"bare\" | \"multiline\";\n /** Outlines an `outline` or `multiline` input in the destructive color. */\n invalid?: boolean;\n /**\n * Reports focus and blur. Set on a `bare` input whose frame draws the focus indicator:\n * the input then drops its own browser outline on web.\n */\n onFocusChange?: (focused: boolean) => void;\n};\n\nconst VARIANT = {\n outline:\n \"h-11 w-full rounded-[var(--radius-lg)] border bg-[hsl(var(--background))] px-3\",\n bare: \"h-full min-w-0 flex-1\",\n multiline:\n \"max-h-32 min-h-10 flex-1 rounded-[var(--radius-lg)] border bg-[hsl(var(--background))] px-3 py-2\",\n};\n\n/** Internal atom: a single-line text input on the body type scale. */\nexport function Input({\n editable,\n variant = \"outline\",\n invalid = false,\n onFocusChange,\n ...props\n}: InputProps) {\n const dim = variant !== \"bare\" && !editable ? \"opacity-50\" : \"\";\n const border =\n variant === \"bare\"\n ? \"\"\n : invalid\n ? \"border-[hsl(var(--destructive))]\"\n : \"border-[hsl(var(--input))]\";\n // The frame around a bare input shows focus, so the input's own outline would double it.\n const outline = onFocusChange ? \" web:outline-none\" : \"\";\n return (\n <TextInput\n {...props}\n {...(onFocusChange\n ? {\n onFocus: () => onFocusChange(true),\n onBlur: () => onFocusChange(false),\n }\n : {})}\n {...(variant === \"multiline\" ? { multiline: true } : {})}\n editable={editable}\n accessibilityLabel={props.accessibilityLabel ?? props.placeholder}\n className={`${VARIANT[variant]} ${border} font-[family-name:var(--font-sans)] text-base text-[hsl(var(--foreground))] placeholder:text-[hsl(var(--muted-foreground))] ${dim}${outline}`}\n placeholderClassName=\"text-[hsl(var(--muted-foreground))]\"\n />\n );\n}\n","import type { ReactNode } from \"react\";\nimport { View } from \"react-native\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport interface FieldProps {\n /** Visible label above the control. */\n label?: string;\n /** Inline error under the control, announced as an alert. */\n error?: string | null;\n errorTestID?: string;\n children: ReactNode;\n}\n\n/** Internal molecule: a form control with an optional label above and an inline error below. */\nexport function Field({ label, error, errorTestID, children }: FieldProps) {\n return (\n <View className=\"gap-2\">\n {label ? <Text variant=\"label\">{label}</Text> : null}\n {children}\n {error ? <FieldError testID={errorTestID}>{error}</FieldError> : null}\n </View>\n );\n}\n\n/** An inline form error in the destructive color, announced as an alert. */\nexport function FieldError({\n children,\n testID,\n}: {\n children: string;\n testID?: string;\n}) {\n return (\n <Text\n testID={testID}\n accessibilityRole=\"alert\"\n variant=\"caption\"\n tone=\"destructive\"\n >\n {children}\n </Text>\n );\n}\n","import { View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport interface AppBarAction {\n /** Visible text, or the accessibility label when `icon` is set. */\n label: string;\n onPress: () => void;\n /** Ionicons name. When set, the action shows only this icon. */\n icon?: IconName;\n /** Dims the action and blocks presses, e.g. refresh while a refresh runs. */\n disabled?: boolean;\n testID?: string;\n}\n\nexport interface AppBarProps {\n /** Screen title, shown bold on the left. */\n title: string;\n /** Shows a back arrow left of the title when set. */\n onBack?: () => void;\n /** Accessibility label of the back arrow. Defaults to \"Back\". */\n backLabel?: string;\n /** One action on the right, shown as text or as an icon. */\n action?: AppBarAction;\n testID?: string;\n /** Ionicons name drawn in the primary color before the title, e.g. a section's accent glyph. */\n icon?: IconName;\n}\n\n/**\n * Top bar of a screen: optional back arrow, optional accent icon, title, and one text or\n * icon action.\n */\nexport function AppBar({\n title,\n onBack,\n backLabel = \"Back\",\n action,\n testID,\n icon,\n}: AppBarProps) {\n return (\n <View\n testID={testID}\n className=\"flex-row items-center justify-between border-b border-[hsl(var(--border))] bg-[hsl(var(--background))] px-4 py-3\"\n >\n <View className=\"flex-1 flex-row items-center gap-2\">\n {onBack ? (\n <PressableSurface\n testID={testID ? `${testID}-back` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={backLabel}\n onPress={onBack}\n hitSlop={8}\n feedback=\"none\"\n className=\"-ml-1 p-1\"\n >\n <Icon name=\"arrow-back\" className=\"text-[hsl(var(--foreground))]\" />\n </PressableSurface>\n ) : null}\n {icon ? (\n <Icon name={icon} size={22} className=\"text-[hsl(var(--primary))]\" />\n ) : null}\n <Text\n accessibilityRole=\"header\"\n numberOfLines={1}\n variant=\"display-sm\"\n className=\"shrink\"\n >\n {title}\n </Text>\n </View>\n {action ? (\n <PressableSurface\n testID={action.testID}\n accessibilityRole=\"button\"\n accessibilityLabel={action.icon ? action.label : undefined}\n accessibilityState={{ disabled: !!action.disabled }}\n disabled={action.disabled}\n onPress={action.onPress}\n hitSlop={8}\n feedback=\"none\"\n dimDisabled={false}\n className={`${action.icon ? \"p-1\" : \"\"} ${\n action.disabled ? \"opacity-40\" : \"\"\n }`.trim()}\n >\n {action.icon ? (\n <Icon\n name={action.icon}\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n ) : (\n <Text variant=\"small\" tone=\"muted\">\n {action.label}\n </Text>\n )}\n </PressableSurface>\n ) : null}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport type BannerTone = \"neutral\" | \"destructive\";\n\nexport interface BannerProps {\n message: string;\n /** neutral: secondary fill; destructive: destructive fill, announced as an alert. Defaults to neutral. */\n tone?: BannerTone;\n /** Ionicons name shown before the message. */\n icon?: IconName;\n testID?: string;\n}\n\n/** Full-width notice strip, e.g. an offline notice or a send error above the composer. */\nexport function Banner({\n message,\n tone = \"neutral\",\n icon,\n testID,\n}: BannerProps) {\n const destructive = tone === \"destructive\";\n const text = destructive\n ? \"text-[hsl(var(--destructive-foreground))]\"\n : \"text-[hsl(var(--secondary-foreground))]\";\n return (\n <View\n testID={testID}\n accessibilityRole={destructive ? \"alert\" : undefined}\n className={`w-full flex-row items-center justify-center gap-2 px-4 py-2 ${\n destructive\n ? \"bg-[hsl(var(--destructive))]\"\n : \"bg-[hsl(var(--secondary))]\"\n }`}\n >\n {icon ? <Icon name={icon} size={16} className={text} /> : null}\n <Text\n variant=\"small\"\n tone={destructive ? \"on-destructive\" : \"on-secondary\"}\n className=\"shrink text-center\"\n >\n {message}\n </Text>\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Surface } from \"../../atoms/surface/Surface\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport interface BarChartCardBar {\n /** Identifies the bar. */\n key: string;\n /** Short label under the bar, e.g. \"Mon\". */\n label: string;\n /** Non-negative value; negative values draw as zero. */\n value: number;\n}\n\nexport interface BarChartCardProps {\n title: string;\n /** Muted line under the title, e.g. \"Last 7 days\". */\n caption?: string;\n bars: BarChartCardBar[];\n /** Value of a full-height bar. Defaults to the largest value. */\n max?: number;\n /** Formats each value for the screen reader summary. Defaults to `String`. */\n formatValue?: (value: number) => string;\n /** Shown instead of the bars when `bars` is empty. */\n emptyLabel?: string;\n testID?: string;\n}\n\n/** Height in px of a full bar. */\nconst BAR_AREA = 110;\n\n/**\n * Small bar chart card: a title, an optional caption and one bar per item with a label\n * below. Bar heights are relative to `max`. The chart is announced as one image whose\n * label lists every bar.\n */\nexport function BarChartCard({\n title,\n caption,\n bars,\n max,\n formatValue = String,\n emptyLabel = \"No data yet\",\n testID,\n}: BarChartCardProps) {\n const top = max ?? Math.max(0, ...bars.map((bar) => bar.value));\n const summary = bars\n .map((bar) => `${bar.label} ${formatValue(bar.value)}`)\n .join(\", \");\n\n return (\n <Surface testID={testID} variant=\"panel\" className=\"gap-4 p-4\">\n <View className=\"gap-0.5\">\n <Text accessibilityRole=\"header\" variant=\"subheading\" tone=\"on-card\">\n {title}\n </Text>\n {caption ? (\n <Text variant=\"footnote\" tone=\"muted\">\n {caption}\n </Text>\n ) : null}\n </View>\n {bars.length === 0 ? (\n <View className=\"h-[140px] items-center justify-center\">\n <Text variant=\"small\" tone=\"muted\">\n {emptyLabel}\n </Text>\n </View>\n ) : (\n <View\n accessible\n accessibilityRole=\"image\"\n accessibilityLabel={`${title}: ${summary}`}\n className=\"h-[140px] flex-row items-end gap-2\"\n >\n {bars.map((bar) => {\n const share =\n top > 0 ? Math.min(1, Math.max(0, bar.value) / top) : 0;\n return (\n <View key={bar.key} className=\"flex-1 items-center gap-1.5\">\n <View\n style={{ height: Math.round(share * BAR_AREA) }}\n className=\"w-full rounded-t bg-[hsl(var(--primary))]\"\n />\n <Text numberOfLines={1} variant=\"footnote\" tone=\"muted\">\n {bar.label}\n </Text>\n </View>\n );\n })}\n </View>\n )}\n </Surface>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { View, type ViewProps } from \"react-native\";\n\n/** `card`: large radius, small shadow; `panel`: extra-large radius, no shadow; `floating`: extra-large radius, large shadow. */\nexport type SurfaceVariant = \"card\" | \"panel\" | \"floating\";\n\nexport interface SurfaceProps extends Omit<ViewProps, \"className\"> {\n /** Defaults to `card`. */\n variant?: SurfaceVariant;\n /** Layout classes (padding, gap, width). */\n className?: string;\n children?: ReactNode;\n /** Border color: the border token, or destructive for a danger zone. Defaults to `default`. Ignored for the borderless `secondary` tone. */\n borderTone?: \"default\" | \"destructive\";\n /** `card`: card color with a border; `secondary`: the secondary color, borderless. Defaults to `card`. */\n tone?: SurfaceTone;\n}\n\nexport type SurfaceTone = \"card\" | \"secondary\";\n\nconst VARIANT: Record<SurfaceVariant, string> = {\n card: \"rounded-[var(--radius-lg)] shadow-sm\",\n panel: \"rounded-[var(--radius-xl)]\",\n floating: \"rounded-[var(--radius-xl)] shadow-lg\",\n};\n\n/** Internal atom: a bordered card-colored surface. */\nexport function Surface({\n variant = \"card\",\n className,\n borderTone = \"default\",\n tone = \"card\",\n ...props\n}: SurfaceProps) {\n const border =\n borderTone === \"destructive\"\n ? \"border-[hsl(var(--destructive))]\"\n : \"border-[hsl(var(--border))]\";\n const fill =\n tone === \"secondary\"\n ? \"bg-[hsl(var(--secondary))]\"\n : `border ${border} bg-[hsl(var(--card))]`;\n return (\n <View\n {...props}\n className={`${VARIANT[variant]} ${fill}${className ? ` ${className}` : \"\"}`}\n />\n );\n}\n","import { useContext, useEffect, useRef, useState, type ReactNode } from \"react\";\nimport {\n Animated,\n Easing,\n Modal,\n Platform,\n ScrollView,\n StyleSheet,\n View,\n useWindowDimensions,\n type GestureResponderEvent,\n} from \"react-native\";\nimport { SafeAreaInsetsContext } from \"react-native-safe-area-context\";\nimport { IconButton } from \"../../atoms/icon-button/IconButton\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { ThemeScope } from \"../../theme/ThemeScope\";\nimport { SafeAreaPadded } from \"../../atoms/safe-area/SafeArea\";\n\nexport interface SheetProps {\n open: boolean;\n /** Heading of the sheet, also the modal's accessible name. */\n title: string;\n /** Called by the scrim, the close button, a drag below the lowest snap, Android back and Escape. */\n onClose: () => void;\n /** Accessible name of the scrim (and the close button). */\n closeLabel: string;\n /**\n * Heights the sheet rests at, ascending fractions of the window (0.1 to 1). When set, the\n * sheet slides in, shows a drag handle and a large title, and scrolls its content; when\n * unset, it fades in, fits its content (up to 80%) and shows a close button.\n */\n snapPoints?: number[];\n /** Index into `snapPoints` the sheet opens at. Defaults to 0. */\n initialSnap?: number;\n /** Called with the new index when a drag settles on another snap height. */\n onSnapChange?: (index: number) => void;\n /** testID of the scrim. Defaults to `${testID}-scrim`. */\n scrimTestID?: string;\n children: ReactNode;\n testID?: string;\n /** Snap mode: a muted line under the title. */\n subtitle?: string;\n /** Snap mode: content at the end of the title row, e.g. Reset and Done buttons. */\n headerActions?: ReactNode;\n /**\n * Snap mode: `dialog` shows a centered card that fades in, sized to its content, when the\n * window is at least 768px wide; narrower windows keep the sheet. Defaults to `sheet`.\n */\n presentation?: \"sheet\" | \"dialog\";\n}\n\nconst OPEN_MS = 260;\nconst CLOSE_MS = 200;\nconst SETTLE_MS = 180;\n/** How far past the lowest snap height a drag must go to dismiss. */\nconst DISMISS_DRAG = 80;\n/** Window width from which `presentation: \"dialog\"` centers the card. */\nconst DIALOG_MIN_WIDTH = 768;\n\n/**\n * Index of the snap height nearest to `height`, or -1 when the drag went far enough\n * below the lowest one to dismiss. `points` are heights in px, ascending.\n */\nexport function resolveSnap(height: number, points: number[]): number {\n if (height < points[0] - DISMISS_DRAG) return -1;\n let best = 0;\n points.forEach((p, i) => {\n if (Math.abs(p - height) < Math.abs(points[best] - height)) best = i;\n });\n return best;\n}\n\nconst CARD =\n \"w-full max-w-[640px] self-center border border-b-0 border-[hsl(var(--border))] bg-[hsl(var(--background))]\";\n\n/**\n * Internal molecule: the one modal bottom sheet of the system, over a scrim. Fit mode backs\n * Select and SearchSelect; snap mode (with `snapPoints`) backs BottomSheet.\n */\nexport function Sheet(props: SheetProps) {\n const scrimTestID =\n props.scrimTestID ?? (props.testID ? `${props.testID}-scrim` : undefined);\n return props.snapPoints ? (\n <SnapSheet\n {...props}\n snapPoints={props.snapPoints}\n scrimTestID={scrimTestID}\n />\n ) : (\n <FitSheet {...props} scrimTestID={scrimTestID} />\n );\n}\n\nfunction Scrim({\n label,\n onPress,\n testID,\n}: {\n label: string;\n onPress: () => void;\n testID?: string;\n}) {\n return (\n <PressableSurface\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n onPress={onPress}\n feedback=\"none\"\n className=\"flex-1\"\n />\n );\n}\n\nfunction FitSheet({\n open,\n title,\n onClose,\n closeLabel,\n scrimTestID,\n children,\n testID,\n}: SheetProps) {\n const insets = useContext(SafeAreaInsetsContext);\n return (\n <Modal\n visible={open}\n transparent\n animationType=\"fade\"\n statusBarTranslucent\n onRequestClose={onClose}\n aria-label={title}\n >\n <ThemeScope>\n <View className=\"flex-1 justify-end bg-black/50\">\n <Scrim label={closeLabel} onPress={onClose} testID={scrimTestID} />\n <View\n testID={testID}\n accessibilityViewIsModal\n style={{ paddingBottom: 12 + (insets?.bottom ?? 0) }}\n className={`max-h-[80%] rounded-t-[var(--radius-lg)] ${CARD}`}\n >\n <View className=\"flex-row items-center justify-between gap-2 py-2 pl-5 pr-2\">\n <Text\n role=\"heading\"\n numberOfLines={1}\n variant=\"subheading\"\n className=\"shrink\"\n >\n {title}\n </Text>\n <IconButton\n testID={testID ? `${testID}-close` : undefined}\n icon=\"close\"\n accessibilityLabel={closeLabel}\n onPress={onClose}\n />\n </View>\n {/* Modal content: the screen under it padded nothing for it; the sheet pads the bottom. */}\n <SafeAreaPadded reset edges={[\"bottom\"]}>\n {children}\n </SafeAreaPadded>\n </View>\n </View>\n </ThemeScope>\n </Modal>\n );\n}\n\nfunction SnapSheet({\n open,\n title,\n onClose,\n closeLabel,\n snapPoints,\n initialSnap = 0,\n onSnapChange,\n scrimTestID,\n children,\n testID,\n subtitle,\n headerActions,\n presentation = \"sheet\",\n}: SheetProps & { snapPoints: number[] }) {\n const { height: windowHeight, width: windowWidth } = useWindowDimensions();\n const dialog = presentation === \"dialog\" && windowWidth >= DIALOG_MIN_WIDTH;\n const insets = useContext(SafeAreaInsetsContext);\n const points = [...snapPoints]\n .map((p) => Math.min(Math.max(p, 0.1), 1) * windowHeight)\n .sort((a, b) => a - b);\n const maxHeight = points[points.length - 1];\n const start = Math.min(Math.max(initialSnap, 0), points.length - 1);\n const useNativeDriver = Platform.OS !== \"web\";\n\n const [mounted, setMounted] = useState(open);\n // 0 = closed, 1 = open: slides the sheet and fades the scrim.\n const [progress] = useState(() => new Animated.Value(0));\n // The sheet's visible height; snaps and drags change it.\n const [sheetHeight] = useState(() => new Animated.Value(points[start]));\n const snap = useRef(start);\n const drag = useRef({ y: 0, height: 0 });\n\n if (open && !mounted) setMounted(true);\n\n useEffect(() => {\n if (open) {\n snap.current = start;\n sheetHeight.setValue(points[start]);\n Animated.timing(progress, {\n toValue: 1,\n duration: OPEN_MS,\n easing: Easing.out(Easing.cubic),\n useNativeDriver,\n }).start();\n } else {\n Animated.timing(progress, {\n toValue: 0,\n duration: CLOSE_MS,\n easing: Easing.in(Easing.cubic),\n useNativeDriver,\n }).start(({ finished }) => {\n if (finished) setMounted(false);\n });\n }\n // Only an open or close restarts the animation; snap data is read at that moment.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n if (!mounted) return null;\n\n function onGrant(e: GestureResponderEvent) {\n drag.current = { y: e.nativeEvent.pageY, height: points[snap.current] };\n }\n\n function dragged(e: GestureResponderEvent) {\n const next = drag.current.height - (e.nativeEvent.pageY - drag.current.y);\n return Math.min(Math.max(next, 0), maxHeight);\n }\n\n function onRelease(e: GestureResponderEvent) {\n const index = resolveSnap(dragged(e), points);\n if (index === -1) {\n onClose();\n return;\n }\n if (index !== snap.current) {\n snap.current = index;\n onSnapChange?.(index);\n }\n Animated.timing(sheetHeight, {\n toValue: points[index],\n duration: SETTLE_MS,\n easing: Easing.out(Easing.cubic),\n useNativeDriver: false,\n }).start();\n }\n\n const heading = (\n <View className=\"w-full flex-row items-center gap-2\">\n <View className=\"flex-1 gap-0.5\">\n <Text role=\"heading\" variant=\"heading\">\n {title}\n </Text>\n {subtitle ? (\n <Text variant=\"small\" tone=\"muted\">\n {subtitle}\n </Text>\n ) : null}\n </View>\n {headerActions ? (\n <View className=\"flex-row items-center gap-1\">{headerActions}</View>\n ) : null}\n </View>\n );\n const body = (\n <ScrollView\n className={dialog ? \"shrink grow-0\" : \"flex-1\"}\n contentContainerClassName=\"gap-4 px-4 pt-2\"\n contentContainerStyle={{\n paddingBottom: 16 + (dialog ? 0 : (insets?.bottom ?? 0)),\n }}\n keyboardShouldPersistTaps=\"handled\"\n >\n {/* Modal content: a sheet pads the bottom, a centered dialog sits clear of every edge. */}\n <SafeAreaPadded\n reset\n edges={dialog ? [\"top\", \"right\", \"bottom\", \"left\"] : [\"bottom\"]}\n >\n {children}\n </SafeAreaPadded>\n </ScrollView>\n );\n\n if (dialog) {\n return (\n <Modal\n visible\n transparent\n animationType=\"none\"\n statusBarTranslucent\n onRequestClose={onClose}\n aria-label={title}\n >\n <ThemeScope>\n <Animated.View\n style={[StyleSheet.absoluteFill, { opacity: progress }]}\n >\n <View className=\"flex-1 bg-black/50\">\n <Scrim\n label={closeLabel}\n onPress={onClose}\n testID={scrimTestID}\n />\n </View>\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={{\n flex: 1,\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: 24,\n opacity: progress,\n }}\n >\n <View\n testID={testID}\n accessibilityViewIsModal\n style={{ maxHeight: maxHeight * 0.9 }}\n className=\"w-full max-w-[560px] overflow-hidden rounded-[var(--radius-xl)] border border-[hsl(var(--border))] bg-[hsl(var(--background))] shadow-lg\"\n >\n <View className=\"px-4 pb-2 pt-4\">{heading}</View>\n {body}\n </View>\n </Animated.View>\n </ThemeScope>\n </Modal>\n );\n }\n\n return (\n <Modal\n visible\n transparent\n animationType=\"none\"\n statusBarTranslucent\n onRequestClose={onClose}\n aria-label={title}\n >\n <ThemeScope>\n <Animated.View style={[StyleSheet.absoluteFill, { opacity: progress }]}>\n <View className=\"flex-1 bg-black/50\">\n <Scrim label={closeLabel} onPress={onClose} testID={scrimTestID} />\n </View>\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={{\n flex: 1,\n justifyContent: \"flex-end\",\n transform: [\n {\n translateY: progress.interpolate({\n inputRange: [0, 1],\n outputRange: [maxHeight, 0],\n }),\n },\n ],\n }}\n >\n <Animated.View\n testID={testID}\n accessibilityViewIsModal\n style={{ height: sheetHeight }}\n >\n {/* Classes go on a plain View: NativeWind doesn't apply className to Animated.View in apps. */}\n <View\n className={`flex-1 overflow-hidden rounded-t-[var(--radius-xl)] shadow-lg ${CARD}`}\n >\n {/* The handle and title are the drag area; the content scrolls on its own. */}\n <View\n testID={testID ? `${testID}-handle` : undefined}\n onStartShouldSetResponder={() => true}\n onResponderGrant={onGrant}\n onResponderMove={(e) => sheetHeight.setValue(dragged(e))}\n onResponderRelease={onRelease}\n onResponderTerminate={onRelease}\n className=\"items-center gap-3 px-4 pb-2 pt-2\"\n >\n <View\n aria-hidden\n className=\"h-1 w-10 rounded-full bg-[hsl(var(--border))]\"\n />\n {heading}\n </View>\n {body}\n </View>\n </Animated.View>\n </Animated.View>\n </ThemeScope>\n </Modal>\n );\n}\n","import { Icon, type IconName } from \"../icon/Icon\";\nimport { PressableSurface } from \"../pressable-surface/PressableSurface\";\n\nexport interface IconButtonProps {\n icon: IconName;\n /** Accessible name; icon buttons have no visible text. */\n accessibilityLabel: string;\n onPress: () => void;\n disabled?: boolean;\n testID?: string;\n /**\n * `ghost`: no box, tints on press; `outline`: bordered on the background; `primary`:\n * filled with primary. Defaults to `ghost`.\n */\n variant?: IconButtonVariant;\n /** Announces the button as expanded or collapsed, e.g. a filter toggle. */\n expanded?: boolean;\n /** Fills an `outline` button and its border with primary, e.g. a filter toggle that is on. */\n active?: boolean;\n}\n\nexport type IconButtonVariant = \"ghost\" | \"outline\" | \"primary\";\n\nconst ACTIVE = {\n box: \"border border-[hsl(var(--primary))] bg-[hsl(var(--primary))]\",\n icon: \"text-[hsl(var(--primary-foreground))]\",\n};\n\nconst VARIANT: Record<IconButtonVariant, { box: string; icon: string }> = {\n ghost: { box: \"\", icon: \"text-[hsl(var(--foreground))]\" },\n outline: {\n box: \"border border-[hsl(var(--input))] bg-[hsl(var(--background))]\",\n icon: \"text-[hsl(var(--foreground))]\",\n },\n primary: {\n box: \"bg-[hsl(var(--primary))]\",\n icon: \"text-[hsl(var(--primary-foreground))]\",\n },\n};\n\n/** Internal atom: a 40px square icon button; the ghost variant tints while pressed. */\nexport function IconButton({\n icon,\n accessibilityLabel,\n onPress,\n disabled,\n testID,\n variant = \"ghost\",\n expanded,\n active = false,\n}: IconButtonProps) {\n const look = variant === \"outline\" && active ? ACTIVE : VARIANT[variant];\n const state =\n disabled || expanded != null\n ? {\n ...(disabled ? { disabled } : {}),\n ...(expanded != null ? { expanded } : {}),\n }\n : undefined;\n return (\n <PressableSurface\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityState={state}\n disabled={disabled}\n onPress={onPress}\n feedback={variant === \"ghost\" ? \"fill\" : \"none\"}\n className={`h-10 w-10 items-center justify-center rounded-[var(--radius-lg)]${look.box ? ` ${look.box}` : \"\"}`}\n >\n <Icon name={icon} className={look.icon} />\n </PressableSurface>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { Sheet } from \"../../molecules/sheet/Sheet\";\n\n/** A text button at the end of the sheet's title row, such as Reset or Done. */\nexport interface BottomSheetAction {\n label: string;\n onPress: () => void;\n /** `primary` fills the button; `ghost` is text only. Defaults to `ghost`. */\n variant?: \"primary\" | \"ghost\";\n disabled?: boolean;\n testID?: string;\n}\n\n/** `sheet`: always a bottom sheet; `dialog`: a centered card on windows 768px and wider. */\nexport type BottomSheetPresentation = \"sheet\" | \"dialog\";\n\nexport interface BottomSheetProps {\n /** Shows the sheet. The app owns this state. */\n open: boolean;\n /** Called by the backdrop, a drag below the lowest snap height, the Android back button and Escape on web. */\n onDismiss: () => void;\n /** Heading at the top of the sheet; also the dialog's accessible name. */\n title: string;\n /** Sheet content: design-system organisms such as ListSections or a FormSection. Scrolls inside the sheet. */\n children: ReactNode;\n /**\n * Heights the sheet rests at, ascending, as fractions of the window height (0.1 to 1),\n * e.g. [0.4, 0.9]. Dragging the handle moves between them; `initialSnap` and\n * `onSnapChange` index this ascending list. Defaults to [0.5].\n */\n snapPoints?: number[];\n /** Index into `snapPoints` the sheet opens at. Defaults to 0. */\n initialSnap?: number;\n /** Called with the new index when a drag settles on another snap height. */\n onSnapChange?: (index: number) => void;\n /** Accessible name of the backdrop button. Defaults to \"Close\". */\n dismissLabel?: string;\n testID?: string;\n /** Muted line under the title, e.g. the item the sheet is about. */\n subtitle?: string;\n /** Up to two text buttons at the end of the title row, e.g. Reset and Done. */\n actions?: BottomSheetAction[];\n /**\n * `dialog` shows a centered card sized to its content on wide windows (768px and up),\n * e.g. a form on wide web; narrower windows keep the sheet. Defaults to `sheet`.\n */\n presentation?: BottomSheetPresentation;\n}\n\n/**\n * Controlled modal sheet that slides up from the bottom over a fading scrim: a drag\n * handle, a title and a scrolling content slot, resting at one or more snap heights.\n * Optional subtitle and header actions; `presentation: \"dialog\"` centers it as a card on\n * wide windows. Content stays mounted until the closing animation ends.\n */\nexport function BottomSheet({\n open,\n onDismiss,\n title,\n children,\n snapPoints = [0.5],\n initialSnap = 0,\n onSnapChange,\n dismissLabel = \"Close\",\n testID,\n subtitle,\n actions,\n presentation = \"sheet\",\n}: BottomSheetProps) {\n return (\n <Sheet\n open={open}\n onClose={onDismiss}\n title={title}\n closeLabel={dismissLabel}\n snapPoints={snapPoints}\n initialSnap={initialSnap}\n onSnapChange={onSnapChange}\n scrimTestID={testID ? `${testID}-backdrop` : undefined}\n testID={testID}\n subtitle={subtitle}\n presentation={presentation}\n headerActions={\n actions?.length\n ? actions.map((action) => (\n <Button\n key={action.label}\n label={action.label}\n onPress={action.onPress}\n variant={action.variant ?? \"ghost\"}\n size=\"sm\"\n layout=\"auto\"\n disabled={action.disabled}\n testID={action.testID}\n />\n ))\n : undefined\n }\n >\n {children}\n </Sheet>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport interface BrandMarkProps {\n /** Product name, shown as the wordmark. */\n name: string;\n /** One short line under the name. */\n tagline?: string;\n testID?: string;\n /** Ionicons glyph on a 64px primary rounded tile above the name, for an app without logo artwork. */\n icon?: IconName;\n /**\n * Slot for the app's logo artwork only (its SVG component or image), drawn in a 64px box\n * above the name and hidden from screen readers (the name is the header). Wins over `icon`.\n */\n logo?: ReactNode;\n}\n\n/** Product wordmark with an optional logo or icon tile above it and a tagline, centered. */\nexport function BrandMark({\n name,\n tagline,\n testID,\n icon,\n logo,\n}: BrandMarkProps) {\n return (\n <View testID={testID} className=\"items-center gap-2\">\n {logo ? (\n <View\n testID={testID ? `${testID}-logo` : undefined}\n accessible={false}\n importantForAccessibility=\"no-hide-descendants\"\n aria-hidden\n className=\"mb-2 h-16 w-16 items-center justify-center overflow-hidden\"\n >\n {logo}\n </View>\n ) : icon ? (\n <View\n testID={testID ? `${testID}-icon` : undefined}\n aria-hidden\n className=\"mb-2 h-16 w-16 items-center justify-center rounded-[var(--radius-xl)] bg-[hsl(var(--primary))]\"\n >\n <Icon\n name={icon}\n size={32}\n className=\"text-[hsl(var(--primary-foreground))]\"\n />\n </View>\n ) : null}\n <Text accessibilityRole=\"header\" variant=\"display\">\n {name}\n </Text>\n {tagline ? (\n <Text variant=\"caption\" tone=\"muted\" className=\"text-center\">\n {tagline}\n </Text>\n ) : null}\n </View>\n );\n}\n","import {\n Platform,\n View,\n type NativeSyntheticEvent,\n type TextInputKeyPressEventData,\n} from \"react-native\";\nimport { useSafeAreaInsetsOnce } from \"../../atoms/safe-area/SafeArea\";\nimport type { IconName } from \"../../atoms/icon/Icon\";\nimport { IconButton } from \"../../atoms/icon-button/IconButton\";\nimport { Input } from \"../../atoms/input/Input\";\n\n/** An icon button shown between the input and Send, such as a voice-mode button. */\nexport interface ComposerAccessory {\n /** Ionicons name. */\n icon: IconName;\n /** Accessible name of the button. */\n label: string;\n onPress: () => void;\n testID?: string;\n}\n\nexport interface ComposerProps {\n /** Current text; the composer is controlled. */\n value: string;\n onChangeText: (text: string) => void;\n /** Called with the current text when Send is pressed (or Enter on web). The app clears `value`. */\n onSend: (text: string) => void;\n placeholder: string;\n /** Blocks typing and sending. */\n disabled?: boolean;\n /** Accessible name of the Send button. Defaults to \"Send\". */\n sendLabel?: string;\n /** Optional icon button between the input and Send. */\n accessory?: ComposerAccessory;\n /** Adds the bottom safe-area inset to the bottom padding. Set false when a parent already pads it. Defaults to true. */\n safeAreaBottom?: boolean;\n inputTestID?: string;\n sendTestID?: string;\n testID?: string;\n}\n\ntype WebKeyEvent = TextInputKeyPressEventData & {\n shiftKey?: boolean;\n isComposing?: boolean;\n keyCode?: number;\n};\n\n/** Message input bar: multiline input, optional accessory icon button and a Send icon button. */\nexport function Composer({\n value,\n onChangeText,\n onSend,\n placeholder,\n disabled = false,\n sendLabel = \"Send\",\n accessory,\n safeAreaBottom = true,\n inputTestID,\n sendTestID,\n testID,\n}: ComposerProps) {\n const insets = useSafeAreaInsetsOnce();\n const bottomInset = safeAreaBottom ? insets.bottom : 0;\n const canSend = !disabled && value.trim().length > 0;\n\n function submit() {\n if (canSend) onSend(value);\n }\n\n function handleKeyPress(e: NativeSyntheticEvent<TextInputKeyPressEventData>) {\n const event = e.nativeEvent as WebKeyEvent;\n // An Enter that commits an IME composition (Korean, Japanese, Chinese) must not\n // send: browsers report it with isComposing or keyCode 229.\n if (event.isComposing || event.keyCode === 229) return;\n if (Platform.OS === \"web\" && event.key === \"Enter\" && !event.shiftKey) {\n e.preventDefault();\n submit();\n }\n }\n\n return (\n <View\n testID={testID}\n style={{ paddingBottom: 8 + bottomInset }}\n className=\"flex-row items-end gap-2 border-t border-[hsl(var(--border))] bg-[hsl(var(--background))] px-3 pt-2\"\n >\n <Input\n variant=\"multiline\"\n testID={inputTestID}\n value={value}\n onChangeText={onChangeText}\n placeholder={placeholder}\n accessibilityLabel={placeholder}\n numberOfLines={1}\n editable={!disabled}\n returnKeyType=\"send\"\n onKeyPress={handleKeyPress}\n />\n {accessory ? (\n <IconButton\n variant=\"outline\"\n testID={accessory.testID}\n icon={accessory.icon}\n accessibilityLabel={accessory.label}\n onPress={accessory.onPress}\n />\n ) : null}\n <IconButton\n variant=\"primary\"\n testID={sendTestID}\n icon=\"send\"\n accessibilityLabel={sendLabel}\n disabled={!canSend}\n onPress={submit}\n />\n </View>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { View } from \"react-native\";\nimport { FieldFrame } from \"../../atoms/field-frame/FieldFrame\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { Field } from \"../field/Field\";\n\nexport interface SelectTriggerProps {\n /** Label of the chosen value; the placeholder shows while it is empty. */\n valueLabel?: string;\n placeholder: string;\n label?: string;\n error?: string | null;\n disabled: boolean;\n onPress: () => void;\n /** Icon before the value, e.g. a calendar. */\n leadingIcon?: IconName;\n /** Icon after the value. Defaults to a down chevron; `null` hides it. */\n trailingIcon?: IconName | null;\n testID?: string;\n /** Announces whether the picker the trigger opens is shown. */\n expanded?: boolean;\n /** Content in a row after the field box, e.g. shortcut buttons; wraps under it when space is short. */\n accessory?: ReactNode;\n /**\n * `field`: a labelled 44px field box; `chip`: a compact pill with the value and a\n * chevron, no visible label or error. Defaults to `field`.\n */\n variant?: \"field\" | \"chip\";\n /** Fills a `chip` with primary, e.g. while a non-default value is chosen. */\n active?: boolean;\n}\n\n/**\n * Internal molecule: a labelled, pressable field showing the chosen value (or a muted\n * placeholder) with optional leading and trailing icons. Opens a picker on press.\n */\nexport function SelectTrigger({\n valueLabel,\n placeholder,\n label,\n error,\n disabled,\n onPress,\n leadingIcon,\n trailingIcon = \"chevron-down\",\n testID,\n expanded,\n accessory,\n variant = \"field\",\n active = false,\n}: SelectTriggerProps) {\n const shown = valueLabel || placeholder;\n const name = label ? `${label}, ${shown}` : shown;\n if (variant === \"chip\") {\n const iconClass = active\n ? \"text-[hsl(var(--primary-foreground))]\"\n : \"text-[hsl(var(--muted-foreground))]\";\n const border = error\n ? \"border-[hsl(var(--destructive))]\"\n : \"border-[hsl(var(--border))]\";\n return (\n <PressableSurface\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={name}\n accessibilityState={{\n disabled,\n ...(expanded != null ? { expanded } : {}),\n }}\n disabled={disabled}\n onPress={onPress}\n feedback={active ? \"none\" : \"fill\"}\n className={`h-9 flex-row items-center gap-1 self-start rounded-full border pl-4 pr-3 ${\n active\n ? \"border-[hsl(var(--primary))] bg-[hsl(var(--primary))]\"\n : `${border} bg-[hsl(var(--background))]`\n }`}\n >\n {leadingIcon ? (\n <Icon name={leadingIcon} size={16} className={iconClass} />\n ) : null}\n <Text\n numberOfLines={1}\n variant=\"label\"\n tone={active ? \"on-primary\" : \"default\"}\n >\n {shown}\n </Text>\n {trailingIcon ? (\n <Icon name={trailingIcon} size={16} className={iconClass} />\n ) : null}\n </PressableSurface>\n );\n }\n const frame = (\n <FieldFrame\n testID={testID}\n accessibilityLabel={name}\n invalid={!!error}\n disabled={disabled}\n onPress={onPress}\n expanded={expanded}\n >\n {leadingIcon ? (\n <Icon\n name={leadingIcon}\n size={18}\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n ) : null}\n <Text\n numberOfLines={1}\n tone={valueLabel ? \"default\" : \"muted\"}\n className=\"flex-1\"\n >\n {shown}\n </Text>\n {trailingIcon ? (\n <Icon\n name={trailingIcon}\n size={18}\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n ) : null}\n </FieldFrame>\n );\n return (\n <Field\n label={label}\n error={error}\n errorTestID={testID ? `${testID}-error` : undefined}\n >\n {accessory ? (\n // The accessory wraps under the field when the row is too narrow for both.\n <View className=\"flex-row flex-wrap items-center gap-2\">\n <View className=\"min-w-[160px] flex-1\">{frame}</View>\n <View className=\"flex-row flex-wrap items-center gap-2\">\n {accessory}\n </View>\n </View>\n ) : (\n frame\n )}\n </Field>\n );\n}\n","import { Button } from \"../../atoms/button/Button\";\nimport { SelectTrigger } from \"../../molecules/select-trigger/SelectTrigger\";\n\n/** A quick-pick button beside the field, e.g. \"Today\". */\nexport interface DateFieldShortcut {\n label: string;\n /** Fills the button while the field holds this date. */\n selected?: boolean;\n onPress: () => void;\n testID?: string;\n}\n\nexport interface DateFieldProps {\n /** The chosen date, already formatted by the app, e.g. \"Nov 25, 2026\". */\n valueLabel?: string;\n /** Shown muted while there is no `valueLabel`, e.g. \"Choose a date\". */\n placeholder: string;\n /** Visible label above the field. */\n label?: string;\n /** Opens the app's date picker (the native picker stays in the app). */\n onPress: () => void;\n /** Inline error under the field; also outlines it in destructive. */\n error?: string | null;\n disabled?: boolean;\n testID?: string;\n /**\n * Quick-pick buttons beside the field, e.g. \"Today\", \"Yesterday\" and \"No date\". They\n * wrap under the field when the row is too narrow for both (the field keeps 160px).\n */\n shortcuts?: DateFieldShortcut[];\n /** Announces the field as expanded while the app shows a calendar under it. */\n expanded?: boolean;\n}\n\n/**\n * Read-only, pressable date field: a calendar icon and the formatted date (or a muted\n * placeholder), with optional quick-pick buttons beside it (or under it when narrow). The app opens its own date\n * picker (or an inline MonthCalendar, announced with `expanded`) on press.\n */\nexport function DateField({\n valueLabel,\n placeholder,\n label,\n onPress,\n error,\n disabled = false,\n testID,\n shortcuts,\n expanded,\n}: DateFieldProps) {\n return (\n <SelectTrigger\n testID={testID}\n valueLabel={valueLabel}\n placeholder={placeholder}\n label={label}\n error={error}\n disabled={disabled}\n onPress={onPress}\n leadingIcon=\"calendar-outline\"\n trailingIcon={null}\n expanded={expanded}\n accessory={\n shortcuts?.length\n ? shortcuts.map((shortcut) => (\n <Button\n key={shortcut.label}\n testID={shortcut.testID}\n label={shortcut.label}\n onPress={shortcut.onPress}\n variant={shortcut.selected ? \"primary\" : \"outline\"}\n layout=\"auto\"\n disabled={disabled}\n selected={shortcut.selected ?? false}\n />\n ))\n : undefined\n }\n />\n );\n}\n","import { View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { IconButton } from \"../../atoms/icon-button/IconButton\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { RatingStars } from \"../rating-stars/RatingStars\";\n\n/** Read-only star rating under the subtitle, with an optional muted caption beside it. */\nexport interface DetailHeaderRating {\n /** Rating from 0 to `max`; halves show as half stars. */\n value: number;\n /** Number of stars. Defaults to 5. */\n max?: number;\n /** Accessible name of the rating, e.g. \"Rating\". */\n label: string;\n /** Muted text after the stars, e.g. what the rating means. */\n caption?: string;\n}\n\n/** An on/off icon toggle beside the title, e.g. save or follow. */\nexport interface DetailHeaderAction {\n /** Ionicons name shown while off, e.g. \"bookmark-outline\". */\n icon: IconName;\n /** Ionicons name shown while on, e.g. \"bookmark\". Defaults to `icon`. */\n activeIcon?: IconName;\n /** Accessible name of the toggle. */\n label: string;\n active: boolean;\n /** Called with the next state when pressed. */\n onChange: (next: boolean) => void;\n testID?: string;\n}\n\n/** `lg`: 30px title for a full detail screen; `md`: 24px title for a card or panel. */\nexport type DetailHeaderSize = \"lg\" | \"md\";\n\nexport interface DetailHeaderProps {\n title: string;\n /** Muted line under the title, e.g. a place and a category. */\n subtitle?: string;\n rating?: DetailHeaderRating;\n /** Icon toggle at the end of the title row. */\n action?: DetailHeaderAction;\n /** Shows a close button at the end of the title row, e.g. in a floating panel. */\n onClose?: () => void;\n /** Accessible name of the close button. Defaults to \"Close\". */\n closeLabel?: string;\n /** Defaults to `lg`. */\n size?: DetailHeaderSize;\n testID?: string;\n}\n\n/**\n * Title block of a detail screen or panel: a display-face title, a muted subtitle, a\n * read-only star rating with a caption, and an icon toggle (and optional close button)\n * at the end of the title row.\n */\nexport function DetailHeader({\n title,\n subtitle,\n rating,\n action,\n onClose,\n closeLabel = \"Close\",\n size = \"lg\",\n testID,\n}: DetailHeaderProps) {\n return (\n <View testID={testID} className=\"flex-row items-start gap-3\">\n <View className=\"min-w-0 shrink grow gap-1\">\n <Text\n accessibilityRole=\"header\"\n variant={size === \"lg\" ? \"display\" : \"display-sm\"}\n >\n {title}\n </Text>\n {subtitle ? (\n <Text variant=\"small\" tone=\"muted\">\n {subtitle}\n </Text>\n ) : null}\n {rating ? (\n <View className=\"flex-row items-center gap-2\">\n <RatingStars\n value={rating.value}\n max={rating.max}\n label={rating.label}\n size=\"sm\"\n />\n {rating.caption ? (\n <Text variant=\"small\" tone=\"muted\">\n {rating.caption}\n </Text>\n ) : null}\n </View>\n ) : null}\n </View>\n {action || onClose ? (\n <View className=\"flex-row items-center gap-1\">\n {action ? (\n <PressableSurface\n testID={action.testID}\n accessibilityRole=\"switch\"\n accessibilityLabel={action.label}\n aria-checked={action.active}\n onPress={() => action.onChange(!action.active)}\n className=\"h-10 w-10 items-center justify-center rounded-[var(--radius-lg)]\"\n >\n <Icon\n name={\n action.active\n ? (action.activeIcon ?? action.icon)\n : action.icon\n }\n size={24}\n className=\"text-[hsl(var(--primary))]\"\n />\n </PressableSurface>\n ) : null}\n {onClose ? (\n <IconButton\n testID={testID ? `${testID}-close` : undefined}\n icon=\"close\"\n accessibilityLabel={closeLabel}\n onPress={onClose}\n />\n ) : null}\n </View>\n ) : null}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { Spinner } from \"../../atoms/spinner/Spinner\";\nimport { Surface } from \"../../atoms/surface/Surface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport {\n SuggestionChips,\n type SuggestionChipsItem,\n} from \"../suggestion-chips/SuggestionChips\";\n\n/** A call to action under the text, e.g. \"Add the first item\". */\nexport interface EmptyStateAction {\n label: string;\n onPress: () => void;\n testID?: string;\n}\n\n/**\n * `screen`: centered, large icon, fills an empty screen; `inline`: compact dashed card\n * inside a section, text only; `card`: a tinted card with an icon tile and small actions,\n * e.g. a first-run welcome inside a dashboard.\n */\nexport type EmptyStateVariant = \"screen\" | \"inline\" | \"card\";\n\nexport interface EmptyStateProps {\n /** Ionicons name: large and muted above the title (`screen`), or in the icon tile (`card`). */\n icon?: IconName;\n title: string;\n /** Muted line under the title. */\n description?: string;\n /** Tappable starter prompts shown as SuggestionChips (`screen` only). */\n suggestions?: SuggestionChipsItem[];\n /** Filled button under the text (`screen` and `card`). */\n primaryAction?: EmptyStateAction;\n /** Text button after the primary action (`screen` and `card`). */\n secondaryAction?: EmptyStateAction;\n /** Defaults to `screen`. */\n variant?: EmptyStateVariant;\n testID?: string;\n /** Shows a spinner in place of the icon while something is checked (`screen` and `card`). */\n loading?: boolean;\n /** Accessible name of the spinner. Defaults to \"Loading\". */\n loadingLabel?: string;\n}\n\n/**\n * Empty state: a centered screen with a large icon (or a spinner while loading), title,\n * optional description, suggestion chips and calls to action; a compact dashed card inside\n * a section; or a tinted card with an icon tile and small actions.\n */\nexport function EmptyState({\n icon,\n title,\n description,\n suggestions,\n primaryAction,\n secondaryAction,\n variant = \"screen\",\n testID,\n loading = false,\n loadingLabel = \"Loading\",\n}: EmptyStateProps) {\n if (variant === \"inline\") {\n return (\n <View\n testID={testID}\n className=\"items-center gap-1 rounded-[var(--radius-lg)] border border-dashed border-[hsl(var(--border))] px-4 py-6\"\n >\n <Text variant=\"small\" tone=\"muted\" className=\"text-center\">\n {title}\n </Text>\n {description ? (\n <Text variant=\"footnote\" tone=\"muted\" className=\"text-center\">\n {description}\n </Text>\n ) : null}\n </View>\n );\n }\n\n if (variant === \"card\") {\n return (\n <Surface\n testID={testID}\n variant=\"panel\"\n tone=\"secondary\"\n className=\"gap-3 p-4\"\n >\n <View className=\"flex-row items-center gap-3\">\n {loading || icon ? (\n <View className=\"h-10 w-10 items-center justify-center rounded-full bg-[hsl(var(--background))]\">\n {loading ? (\n <Spinner label={loadingLabel} />\n ) : (\n <Icon name={icon!} className=\"text-[hsl(var(--primary))]\" />\n )}\n </View>\n ) : null}\n <View className=\"flex-1 gap-0.5\">\n <Text accessibilityRole=\"header\" weight=\"semibold\">\n {title}\n </Text>\n {description ? (\n <Text variant=\"small\" tone=\"on-secondary\">\n {description}\n </Text>\n ) : null}\n </View>\n </View>\n {primaryAction || secondaryAction ? (\n <View className=\"flex-row flex-wrap items-center gap-2\">\n {primaryAction ? (\n <Button\n label={primaryAction.label}\n onPress={primaryAction.onPress}\n testID={primaryAction.testID}\n size=\"sm\"\n layout=\"auto\"\n />\n ) : null}\n {secondaryAction ? (\n <Button\n label={secondaryAction.label}\n onPress={secondaryAction.onPress}\n testID={secondaryAction.testID}\n variant=\"ghost\"\n size=\"sm\"\n layout=\"auto\"\n />\n ) : null}\n </View>\n ) : null}\n </Surface>\n );\n }\n\n return (\n <View\n testID={testID}\n accessibilityState={loading ? { busy: true } : undefined}\n className=\"items-center gap-6 px-6 py-16\"\n >\n {loading ? (\n <Spinner label={loadingLabel} size=\"large\" />\n ) : icon ? (\n <Icon\n name={icon}\n size={48}\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n ) : null}\n <View className=\"items-center gap-1.5\">\n <Text\n accessibilityRole=\"header\"\n weight=\"medium\"\n className=\"text-center\"\n >\n {title}\n </Text>\n {description ? (\n <Text variant=\"small\" tone=\"muted\" className=\"text-center\">\n {description}\n </Text>\n ) : null}\n </View>\n {suggestions && suggestions.length > 0 ? (\n <SuggestionChips items={suggestions} />\n ) : null}\n {primaryAction || secondaryAction ? (\n <View className=\"w-full gap-2\">\n {primaryAction ? (\n <Button\n label={primaryAction.label}\n onPress={primaryAction.onPress}\n testID={primaryAction.testID}\n />\n ) : null}\n {secondaryAction ? (\n <Button\n label={secondaryAction.label}\n onPress={secondaryAction.onPress}\n variant=\"ghost\"\n testID={secondaryAction.testID}\n />\n ) : null}\n </View>\n ) : null}\n </View>\n );\n}\n","import { ScrollView, View } from \"react-native\";\nimport { Icon } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport interface SuggestionChipsItem {\n label: string;\n /** Called when the chip is pressed. A chip without it (e.g. an active filter that can only be removed) is plain text. */\n onPress?: () => void;\n /** Adds a remove button at the chip's end, e.g. to clear an active filter. */\n onRemove?: () => void;\n /** Accessible name of the remove button. Defaults to \"Remove <label>\". */\n removeLabel?: string;\n testID?: string;\n}\n\n/** `wrap`: chips wrap and center; `scroll`: one start-aligned row that scrolls sideways. */\nexport type SuggestionChipsLayout = \"wrap\" | \"scroll\";\n\nexport interface SuggestionChipsProps {\n /** One chip per item, in order. */\n items: SuggestionChipsItem[];\n /** Defaults to `wrap`. */\n layout?: SuggestionChipsLayout;\n testID?: string;\n}\n\nconst CHIP = \"rounded-full bg-[hsl(var(--secondary))]\";\n\nfunction Chip({ item }: { item: SuggestionChipsItem }) {\n const label = (\n <Text variant=\"small\" tone=\"on-secondary\">\n {item.label}\n </Text>\n );\n if (!item.onRemove) {\n if (!item.onPress) {\n return (\n <View testID={item.testID} className={`${CHIP} px-4 py-2`}>\n {label}\n </View>\n );\n }\n return (\n <PressableSurface\n testID={item.testID}\n accessibilityRole=\"button\"\n onPress={item.onPress}\n feedback=\"none\"\n className={`${CHIP} px-4 py-2 active:opacity-80`}\n >\n {label}\n </PressableSurface>\n );\n }\n return (\n <View\n testID={item.testID}\n className={`${CHIP} flex-row items-center overflow-hidden`}\n >\n {item.onPress ? (\n <PressableSurface\n accessibilityRole=\"button\"\n onPress={item.onPress}\n feedback=\"none\"\n className=\"py-2 pl-4 pr-1 active:opacity-80\"\n >\n {label}\n </PressableSurface>\n ) : (\n <View className=\"py-2 pl-4 pr-1\">{label}</View>\n )}\n <PressableSurface\n testID={item.testID ? `${item.testID}-remove` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={item.removeLabel ?? `Remove ${item.label}`}\n onPress={item.onRemove}\n hitSlop={6}\n feedback=\"none\"\n className=\"h-full items-center justify-center pl-1 pr-3 active:opacity-60\"\n >\n <Icon\n name=\"close\"\n size={16}\n className=\"text-[hsl(var(--secondary-foreground))]\"\n />\n </PressableSurface>\n </View>\n );\n}\n\n/**\n * Fully rounded chips on the secondary color that wrap and center, or scroll in one row.\n * A chip can be pressed, removed with a trailing close button, or both.\n */\nexport function SuggestionChips({\n items,\n layout = \"wrap\",\n testID,\n}: SuggestionChipsProps) {\n const chips = items.map((item) => <Chip key={item.label} item={item} />);\n if (layout === \"scroll\") {\n return (\n <ScrollView\n testID={testID}\n horizontal\n showsHorizontalScrollIndicator={false}\n keyboardShouldPersistTaps=\"handled\"\n className=\"shrink-0 grow-0\"\n contentContainerClassName=\"gap-2\"\n >\n {chips}\n </ScrollView>\n );\n }\n return (\n <View testID={testID} className=\"flex-row flex-wrap justify-center gap-2\">\n {chips}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Surface } from \"../../atoms/surface/Surface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { ImageStrip } from \"../image-strip/ImageStrip\";\nimport { RatingStars } from \"../rating-stars/RatingStars\";\n\n/** Small read-only star rating at the end of the title line. */\nexport interface EntryCardRating {\n value: number;\n /** Number of stars. Defaults to 5. */\n max?: number;\n /** Accessible name of the rating, e.g. \"Rating\". */\n label: string;\n}\n\n/** A small text button under the card's content, e.g. \"Delete\". */\nexport interface EntryCardAction {\n label: string;\n onPress: () => void;\n /** `destructive` colors the label. Defaults to `default`. */\n tone?: \"default\" | \"destructive\";\n testID?: string;\n}\n\nexport interface EntryCardProps {\n /** First line, e.g. a date. */\n title: string;\n rating?: EntryCardRating;\n /** Muted text under the title, cut to two lines. */\n body?: string;\n /** Image URIs shown as a thumbnail strip under the text. */\n images?: string[];\n /** Called with the pressed thumbnail's index, e.g. to open an ImageViewer there. */\n onImagePress?: (index: number) => void;\n /** Thumbnail names are \"<imageLabel> <n>\". Defaults to \"Image\". */\n imageLabel?: string;\n /** Makes the title, rating and body pressable, e.g. to edit the entry. */\n onPress?: () => void;\n /** Accessible name of the pressable part. Defaults to its visible text. */\n pressLabel?: string;\n /** Small text buttons in a row under the content. */\n actions?: EntryCardAction[];\n testID?: string;\n /** Muted meta line under the title, cut to one line, e.g. a place and a date. */\n subtitle?: string;\n}\n\n/**\n * One logged entry in a bordered card: a title line with a small star rating, an optional\n * one-line meta subtitle, a two-line\n * muted body, a strip of image thumbnails and small text actions. The text part can be\n * pressable, e.g. to edit the entry.\n */\nexport function EntryCard({\n title,\n rating,\n body,\n images,\n onImagePress,\n imageLabel,\n onPress,\n pressLabel,\n actions,\n testID,\n subtitle,\n}: EntryCardProps) {\n const text = (\n <>\n <View className=\"flex-row items-center justify-between gap-3\">\n <Text variant=\"label\" tone=\"on-card\" className=\"shrink\">\n {title}\n </Text>\n {rating ? (\n <RatingStars\n value={rating.value}\n max={rating.max}\n label={rating.label}\n size=\"sm\"\n />\n ) : null}\n </View>\n {subtitle ? (\n <Text variant=\"footnote\" tone=\"muted\" numberOfLines={1}>\n {subtitle}\n </Text>\n ) : null}\n {body ? (\n <Text variant=\"small\" tone=\"muted\" numberOfLines={2}>\n {body}\n </Text>\n ) : null}\n </>\n );\n\n return (\n <Surface testID={testID} className=\"gap-2 p-3\">\n {onPress ? (\n <PressableSurface\n testID={testID ? `${testID}-open` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={pressLabel}\n onPress={onPress}\n feedback=\"fade\"\n className=\"gap-1\"\n >\n {text}\n </PressableSurface>\n ) : (\n <View className=\"gap-1\">{text}</View>\n )}\n {images?.length ? (\n <ImageStrip\n testID={testID ? `${testID}-images` : undefined}\n uris={images}\n onPress={onImagePress}\n imageLabel={imageLabel}\n />\n ) : null}\n {actions?.length ? (\n <View className=\"-mx-4 flex-row flex-wrap\">\n {actions.map((action) => (\n <Button\n key={action.label}\n testID={action.testID}\n label={action.label}\n onPress={action.onPress}\n variant=\"ghost\"\n tone={action.tone}\n size=\"sm\"\n layout=\"auto\"\n />\n ))}\n </View>\n ) : null}\n </Surface>\n );\n}\n","import { ScrollView, View } from \"react-native\";\nimport { Icon } from \"../../atoms/icon/Icon\";\nimport { Image } from \"../../atoms/image/Image\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { ImagePickerTile } from \"../image-picker-tile/ImagePickerTile\";\n\nexport interface ImageStripProps {\n /** Image URIs in order. */\n uris: string[];\n /** Called with the pressed image's index, e.g. to open an ImageViewer there. */\n onPress?: (index: number) => void;\n /**\n * Shows at most this many images; the last one shown gets a \"+N\" overlay for the rest\n * and reports its own index when pressed.\n */\n maxVisible?: number;\n /** Adds an add tile after the images that asks the app to pick more (D9). */\n onAdd?: () => void;\n /** Name of the add tile. Defaults to \"Add image\". */\n addLabel?: string;\n /** Image names are \"<imageLabel> <n>\". Defaults to \"Image\". */\n imageLabel?: string;\n testID?: string;\n /** Adds a remove button to each image's corner; called with that image's index. */\n onRemove?: (index: number) => void;\n /** Remove buttons are named \"<removeLabel> <imageLabel> <n>\". Defaults to \"Remove\". */\n removeLabel?: string;\n}\n\nconst TILE =\n \"h-[72px] w-[72px] overflow-hidden rounded-[var(--radius-lg)] bg-[hsl(var(--secondary))]\";\n\n/**\n * Horizontal row of 72px image thumbnails with an optional \"+N\" overflow tile, remove\n * buttons and an add tile. Scrolls sideways when the row is wider than the screen.\n */\nexport function ImageStrip({\n uris,\n onPress,\n maxVisible,\n onAdd,\n addLabel = \"Add image\",\n imageLabel = \"Image\",\n testID,\n onRemove,\n removeLabel = \"Remove\",\n}: ImageStripProps) {\n const shown =\n maxVisible != null && uris.length > maxVisible\n ? uris.slice(0, maxVisible)\n : uris;\n const hidden = uris.length - shown.length;\n\n return (\n <ScrollView\n testID={testID}\n horizontal\n showsHorizontalScrollIndicator={false}\n contentContainerClassName=\"gap-2\"\n >\n {shown.map((uri, index) => {\n const overflow = hidden > 0 && index === shown.length - 1;\n const name = `${imageLabel} ${index + 1}`;\n const tile = (\n <PressableSurface\n key={`${index}-${uri}`}\n testID={testID ? `${testID}-image-${index}` : undefined}\n accessibilityRole={onPress ? \"button\" : \"image\"}\n accessibilityLabel={overflow ? `${name}, +${hidden}` : name}\n disabled={!onPress}\n onPress={() => onPress?.(index)}\n feedback=\"fade\"\n dimDisabled={false}\n className={TILE}\n >\n <Image\n uri={uri}\n accessible={false}\n className=\"h-full w-full\"\n resizeMode=\"cover\"\n />\n {overflow ? (\n <View className=\"absolute inset-0 items-center justify-center bg-black/50\">\n <Text variant=\"subheading\" tone=\"on-scrim\">\n {`+${hidden}`}\n </Text>\n </View>\n ) : null}\n </PressableSurface>\n );\n if (!onRemove) return tile;\n return (\n <View key={`${index}-${uri}`}>\n {tile}\n <PressableSurface\n testID={testID ? `${testID}-remove-${index}` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={`${removeLabel} ${name}`}\n onPress={() => onRemove(index)}\n hitSlop={6}\n feedback=\"fade\"\n className=\"absolute right-1 top-1 h-6 w-6 items-center justify-center rounded-full bg-black/60\"\n >\n <Icon name=\"close\" size={14} className=\"text-white\" />\n </PressableSurface>\n </View>\n );\n })}\n {onAdd ? (\n <ImagePickerTile\n testID={testID ? `${testID}-add` : undefined}\n size=\"sm\"\n onPress={onAdd}\n addLabel={addLabel}\n />\n ) : null}\n </ScrollView>\n );\n}\n","import {\n Image as RNImage,\n type ImageProps as RNImageProps,\n} from \"react-native\";\n\nexport interface ImageProps extends Omit<RNImageProps, \"source\" | \"className\"> {\n /** Remote or local URI of the image. */\n uri: string;\n /** Box classes (size, radius, placeholder fill). */\n className?: string;\n}\n\n/**\n * Internal atom: an image loaded from a URI. Pass `accessible={false}` for a decorative\n * image, or a role and label to announce it.\n */\nexport function Image({ uri, ...props }: ImageProps) {\n return <RNImage {...props} source={{ uri }} />;\n}\n","import { View } from \"react-native\";\nimport { Icon } from \"../../atoms/icon/Icon\";\nimport { Image } from \"../../atoms/image/Image\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Spinner } from \"../../atoms/spinner/Spinner\";\nimport { Text } from \"../../atoms/text/Text\";\n\n/** `sm`: 72px square (strips, grids); `md`: 96px square with a visible add label. */\nexport type ImagePickerTileSize = \"sm\" | \"md\";\n\nexport interface ImagePickerTileProps {\n /** The selected image. Without it the tile is an empty add slot. */\n uri?: string;\n /**\n * Empty tile: asks the app to pick a image (the picker stays in the app). Selected tile:\n * e.g. opens the image in an ImageViewer.\n */\n onPress?: () => void;\n /** Selected tile only: shows a round remove button in the corner. */\n onRemove?: () => void;\n /** Shows a spinner over the tile and disables it, e.g. while a image uploads. */\n loading?: boolean;\n disabled?: boolean;\n size?: ImagePickerTileSize;\n /** Name of the empty tile; shown under the camera icon on `md`. Defaults to \"Add image\". */\n addLabel?: string;\n /** Name of the selected image. Defaults to \"Image\". */\n imageLabel?: string;\n /** Name of the remove button. Defaults to \"Remove image\". */\n removeLabel?: string;\n testID?: string;\n}\n\nconst BOX: Record<ImagePickerTileSize, string> = {\n sm: \"h-[72px] w-[72px]\",\n md: \"h-24 w-24\",\n};\n\nconst TILE = \"overflow-hidden rounded-[var(--radius-lg)]\";\n\n/**\n * Square image slot: an empty dashed tile with a camera icon that asks the app to pick a\n * image, or the selected image with an optional remove button. Image picking, cropping and\n * uploads stay in the app (D9).\n */\nexport function ImagePickerTile({\n uri,\n onPress,\n onRemove,\n loading = false,\n disabled = false,\n size = \"md\",\n addLabel = \"Add image\",\n imageLabel = \"Image\",\n removeLabel = \"Remove image\",\n testID,\n}: ImagePickerTileProps) {\n const inactive = disabled || loading;\n const spinner = loading ? (\n <View className=\"absolute inset-0 items-center justify-center bg-black/40\">\n <Spinner label=\"Loading\" tone=\"on-scrim\" />\n </View>\n ) : null;\n\n if (!uri) {\n return (\n <PressableSurface\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={size === \"sm\" ? addLabel : undefined}\n accessibilityState={{ disabled: inactive, busy: loading }}\n disabled={inactive || !onPress}\n onPress={onPress}\n feedback=\"fade\"\n dimDisabled={false}\n className={`${BOX[size]} ${TILE} items-center justify-center gap-1 border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--background))] ${\n disabled ? \"opacity-50\" : \"\"\n }`}\n >\n <Icon\n name=\"camera-outline\"\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n {size === \"md\" ? (\n <Text\n numberOfLines={1}\n variant=\"footnote\"\n tone=\"muted\"\n className=\"px-1\"\n >\n {addLabel}\n </Text>\n ) : null}\n {spinner}\n </PressableSurface>\n );\n }\n\n return (\n <View testID={testID} className={`${BOX[size]} relative`}>\n <PressableSurface\n testID={testID ? `${testID}-image` : undefined}\n accessibilityRole={onPress ? \"button\" : \"image\"}\n accessibilityLabel={imageLabel}\n accessibilityState={{ disabled: inactive, busy: loading }}\n disabled={inactive || !onPress}\n onPress={onPress}\n feedback=\"fade\"\n dimDisabled={false}\n className={`${BOX[size]} ${TILE} bg-[hsl(var(--secondary))]`}\n >\n <Image\n uri={uri}\n accessible={false}\n className=\"h-full w-full\"\n resizeMode=\"cover\"\n />\n {spinner}\n </PressableSurface>\n {onRemove ? (\n <PressableSurface\n testID={testID ? `${testID}-remove` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={removeLabel}\n disabled={inactive}\n onPress={onRemove}\n hitSlop={10}\n feedback=\"fade\"\n dimDisabled={false}\n className=\"absolute right-1 top-1 h-6 w-6 items-center justify-center rounded-full bg-[hsl(var(--foreground))]\"\n >\n <Icon\n name=\"close\"\n size={14}\n className=\"text-[hsl(var(--background))]\"\n />\n </PressableSurface>\n ) : null}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport interface ErrorStateAction {\n /** Button text, also its accessible name, e.g. \"Try again\". */\n label: string;\n onPress: () => void;\n /** testID of the button; defaults to \"<testID>-action\" or \"<testID>-secondary-action\". */\n testID?: string;\n}\n\nexport interface ErrorStateProps {\n /** Short headline, e.g. \"Microphone unavailable\". */\n title: string;\n /** Optional explanation under the title. */\n message?: string;\n /** Optional technical code, shown small; the app formats it (e.g. \"Code: not-allowed\"). */\n code?: string;\n /** Optional outlined button, such as retry. */\n action?: ErrorStateAction;\n testID?: string;\n /** Optional text button beside the action, such as going back. */\n secondaryAction?: ErrorStateAction;\n}\n\n/** Compact, centered error announced as an alert: title, optional message, code and up to two actions. */\nexport function ErrorState({\n title,\n message,\n code,\n action,\n testID,\n secondaryAction,\n}: ErrorStateProps) {\n return (\n <View\n testID={testID}\n accessibilityRole=\"alert\"\n accessibilityLiveRegion=\"assertive\"\n className=\"w-full items-center gap-1 px-4 py-2\"\n >\n <Text variant=\"subheading\" tone=\"destructive\" className=\"text-center\">\n {title}\n </Text>\n {message ? (\n <Text variant=\"small\" tone=\"muted\" className=\"text-center\">\n {message}\n </Text>\n ) : null}\n {code ? (\n <Text variant=\"footnote\" tone=\"muted\" className=\"text-center\">\n {code}\n </Text>\n ) : null}\n {action || secondaryAction ? (\n <View className=\"mt-2 flex-row flex-wrap items-center justify-center gap-2\">\n {action ? (\n <Button\n testID={\n action.testID ?? (testID ? `${testID}-action` : undefined)\n }\n label={action.label}\n onPress={action.onPress}\n variant=\"outline\"\n size=\"sm\"\n layout=\"auto\"\n shape=\"pill\"\n />\n ) : null}\n {secondaryAction ? (\n <Button\n testID={\n secondaryAction.testID ??\n (testID ? `${testID}-secondary-action` : undefined)\n }\n label={secondaryAction.label}\n onPress={secondaryAction.onPress}\n variant=\"ghost\"\n size=\"sm\"\n layout=\"auto\"\n shape=\"pill\"\n />\n ) : null}\n </View>\n ) : null}\n </View>\n );\n}\n","import { Fragment, type ReactNode } from \"react\";\nimport { ScrollView, View } from \"react-native\";\nimport { Divider } from \"../../atoms/divider/Divider\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { Field } from \"../../molecules/field/Field\";\n\nexport interface FilterChipGroupOption<T extends string = string> {\n value: T;\n label: string;\n /** Ionicons name shown before the label. */\n icon?: IconName;\n}\n\n/** A trailing ghost chip that asks the app to add an option, e.g. \"Add\". */\nexport interface FilterChipGroupAddAction {\n label: string;\n onPress: () => void;\n testID?: string;\n}\n\n/** `wrap`: chips wrap onto new lines; `scroll`: one row that scrolls sideways. */\nexport type FilterChipGroupLayout = \"wrap\" | \"scroll\";\n\n/** Props shared by the single- and multi-select forms. */\nexport interface FilterChipGroupBaseProps<T extends string = string> {\n /** Chips in display order. */\n options: FilterChipGroupOption<T>[];\n /** Accessible name of the group, e.g. \"Language\". */\n accessibilityLabel?: string;\n testID?: string;\n /** Defaults to `wrap`. */\n layout?: FilterChipGroupLayout;\n /** Optional ghost chip after the options, e.g. to add a category. */\n addAction?: FilterChipGroupAddAction;\n /**\n * More chip groups in the same row after this one, each after a thin vertical divider,\n * e.g. a multi-select group followed by a single-select group in one scroll row.\n */\n sections?: FilterChipGroupSection[];\n /** Visible label above the chips, as on a form field; also the group's name when `accessibilityLabel` is unset. */\n label?: string;\n /** Inline error under the chips, announced as an alert (testID \"<testID>-error\"). */\n error?: string | null;\n}\n\n/** Single select (default): one chip is always selected. Radio-group semantics. */\nexport interface FilterChipGroupSingleProps<\n T extends string = string,\n> extends FilterChipGroupBaseProps<T> {\n multiple?: false;\n /** Value of the selected chip. */\n value: T;\n onChange: (value: T) => void;\n}\n\n/** Multi select: any number of chips, including none. Checkbox semantics. */\nexport interface FilterChipGroupMultipleProps<\n T extends string = string,\n> extends FilterChipGroupBaseProps<T> {\n multiple: true;\n /** Values of the selected chips. */\n values: T[];\n /** Called with the new selection, in option order. */\n onChange: (values: T[]) => void;\n}\n\nexport type FilterChipGroupProps<T extends string = string> =\n | FilterChipGroupSingleProps<T>\n | FilterChipGroupMultipleProps<T>;\n\n/** A further group in the same row: its own options, selection mode, name and testID. */\nexport type FilterChipGroupSection =\n | Omit<\n FilterChipGroupSingleProps,\n \"layout\" | \"addAction\" | \"sections\" | \"label\" | \"error\"\n >\n | Omit<\n FilterChipGroupMultipleProps,\n \"layout\" | \"addAction\" | \"sections\" | \"label\" | \"error\"\n >;\n\ntype ChipsProps<T extends string> =\n | Omit<FilterChipGroupSingleProps<T>, \"layout\" | \"addAction\" | \"sections\">\n | Omit<FilterChipGroupMultipleProps<T>, \"layout\" | \"addAction\" | \"sections\">;\n\nconst CHIP =\n \"h-10 flex-row items-center justify-center gap-1.5 rounded-[var(--radius-lg)] border px-4\";\n\n/**\n * Chips that wrap or scroll in one row; selected chips fill with primary. Single select\n * by default (radio group); `multiple` toggles chips independently (checkboxes). More\n * groups can share the row through `sections`, split by vertical dividers.\n */\nexport function FilterChipGroup<T extends string = string>(\n props: FilterChipGroupProps<T>,\n) {\n const { label, error, testID } = props;\n if (label == null && !error) return <ChipRow {...props} />;\n return (\n <Field\n label={label}\n error={error}\n errorTestID={testID ? `${testID}-error` : undefined}\n >\n <ChipRow\n {...props}\n accessibilityLabel={props.accessibilityLabel ?? label}\n />\n </Field>\n );\n}\n\n/** The chip groups, divider and add chip in one wrap or scroll row. */\nfunction ChipRow<T extends string>(props: FilterChipGroupProps<T>) {\n const { layout = \"wrap\", addAction, sections } = props;\n const hasSections = sections != null && sections.length > 0;\n const wrap = layout === \"wrap\";\n\n const add = addAction ? (\n <PressableSurface\n testID={addAction.testID}\n accessibilityRole=\"button\"\n accessibilityLabel={addAction.label}\n onPress={addAction.onPress}\n className={`${CHIP} border-transparent`}\n >\n <Icon name=\"add\" size={16} className=\"text-[hsl(var(--primary))]\" />\n <Text variant=\"label\" tone=\"primary\">\n {addAction.label}\n </Text>\n </PressableSurface>\n ) : null;\n\n const groups = (\n <>\n <Chips {...props} wrap={wrap && !hasSections} />\n {hasSections\n ? sections.map((section, i) => (\n <Fragment key={section.testID ?? i}>\n <Divider orientation=\"vertical\" />\n <Chips {...section} wrap={false} />\n </Fragment>\n ))\n : null}\n </>\n );\n\n if (layout === \"scroll\") {\n return (\n <ChipScroll>\n {groups}\n {add}\n </ChipScroll>\n );\n }\n if (!add && !hasSections) return groups;\n return (\n <View className=\"flex-row flex-wrap gap-2\">\n {groups}\n {add}\n </View>\n );\n}\n\n/** One chip group: radio group or checkbox group. */\nfunction Chips<T extends string>(props: ChipsProps<T> & { wrap: boolean }) {\n const { options, accessibilityLabel, testID, wrap } = props;\n\n const isSelected = (value: T) =>\n props.multiple ? props.values.includes(value) : props.value === value;\n\n const press = (value: T) => {\n if (!props.multiple) {\n props.onChange(value);\n return;\n }\n const next = isSelected(value)\n ? props.values.filter((v) => v !== value)\n : [...props.values, value];\n props.onChange(options.map((o) => o.value).filter((v) => next.includes(v)));\n };\n\n return (\n <View\n testID={testID}\n role={props.multiple ? \"group\" : \"radiogroup\"}\n aria-label={accessibilityLabel}\n className={`flex-row gap-2${wrap ? \" shrink flex-wrap\" : \"\"}`}\n >\n {options.map((option) => {\n const selected = isSelected(option.value);\n return (\n <PressableSurface\n key={option.value}\n testID={testID ? `${testID}-${option.value}` : undefined}\n role={props.multiple ? \"checkbox\" : \"radio\"}\n aria-checked={selected}\n aria-label={option.label}\n onPress={() => press(option.value)}\n feedback={selected ? \"none\" : \"fill\"}\n className={`${CHIP} ${\n selected\n ? \"border-[hsl(var(--primary))] bg-[hsl(var(--primary))]\"\n : \"border-[hsl(var(--border))] bg-[hsl(var(--background))]\"\n }`}\n >\n {option.icon ? (\n <Icon\n name={option.icon}\n size={16}\n className={\n selected\n ? \"text-[hsl(var(--primary-foreground))]\"\n : \"text-[hsl(var(--foreground))]\"\n }\n />\n ) : null}\n <Text variant=\"label\" tone={selected ? \"on-primary\" : \"default\"}>\n {option.label}\n </Text>\n </PressableSurface>\n );\n })}\n </View>\n );\n}\n\n/** One sideways-scrolling row; grow-0 keeps it from collapsing in a column on web. */\nfunction ChipScroll({ children }: { children: ReactNode }) {\n return (\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n keyboardShouldPersistTaps=\"handled\"\n className=\"shrink-0 grow-0\"\n contentContainerClassName=\"gap-2\"\n >\n {children}\n </ScrollView>\n );\n}\n","import { View } from \"react-native\";\n\n/** Line color: `default` is the border token, `accent` the primary color. */\nexport type DividerTone = \"default\" | \"accent\";\n\nexport interface DividerProps {\n /** Defaults to `default`. */\n tone?: DividerTone;\n /** `full`: spans its row; `fill`: grows beside other content in a row. Defaults to `full`. */\n layout?: \"full\" | \"fill\";\n /** `vertical`: a 1px rule 24px tall, e.g. between groups in a row. Defaults to `horizontal`. */\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nconst TONE: Record<DividerTone, string> = {\n default: \"bg-[hsl(var(--border))]\",\n accent: \"bg-[hsl(var(--primary))]\",\n};\n\n/** Internal atom: a 1px horizontal (or vertical) rule. */\nexport function Divider({\n tone = \"default\",\n layout = \"full\",\n orientation = \"horizontal\",\n}: DividerProps) {\n if (orientation === \"vertical\") {\n return (\n <View aria-hidden className={`h-6 w-px self-center ${TONE[tone]}`} />\n );\n }\n return (\n <View\n aria-hidden\n className={`h-px ${layout === \"fill\" ? \"flex-1\" : \"w-full\"} ${TONE[tone]}`}\n />\n );\n}\n","import { View } from \"react-native\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { Icon } from \"../../atoms/icon/Icon\";\nimport { Image } from \"../../atoms/image/Image\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Surface } from \"../../atoms/surface/Surface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { ImageCarousel } from \"../image-carousel/ImageCarousel\";\nimport { RatingStars } from \"../rating-stars/RatingStars\";\n\n/** The card's full-width primary button, such as \"Directions\" or \"Open\". */\nexport interface FloatingCardAction {\n label: string;\n onPress: () => void;\n testID?: string;\n}\n\n/** Small read-only star rating under the text, with an optional muted caption. */\nexport interface FloatingCardRating {\n value: number;\n /** Number of stars. Defaults to 5. */\n max?: number;\n /** Accessible name of the rating, e.g. \"Rating\". */\n label: string;\n /** Muted text after the stars, e.g. what the rating means. */\n caption?: string;\n}\n\nexport interface FloatingCardProps {\n title: string;\n /** Muted line under the title, e.g. the item's category. */\n subtitle?: string;\n /** Small muted line under the subtitle, e.g. a distance, a rating or opening hours. */\n meta?: string;\n /** Image URI shown as a square thumbnail at the start of the card. */\n thumbnailUri?: string;\n /** Makes the title area pressable, e.g. to open the item's detail screen. */\n onPress?: () => void;\n /** Full-width primary button under the text. */\n action?: FloatingCardAction;\n /** Shows a close button in the top-right corner. */\n onClose?: () => void;\n /** Accessible name of the close button. Defaults to \"Close\". */\n closeLabel?: string;\n testID?: string;\n /** Star rating on its own line under the text. */\n rating?: FloatingCardRating;\n /** Small status pill after the rating, e.g. \"Saved\". */\n badge?: string;\n /** testID of the status pill. */\n badgeTestID?: string;\n /**\n * Image URIs shown as a swipeable, rounded hero across the top of the card (an\n * ImageCarousel) instead of the square thumbnail; `null` draws a placeholder for an\n * image that is still loading.\n */\n images?: (string | null)[];\n /** Called with the pressed hero image's index, e.g. to open an ImageViewer there. */\n onImagePress?: (index: number) => void;\n /** Hero image names are \"<imageLabel> <n> of <total>\". Defaults to \"Image\". */\n imageLabel?: string;\n /** Shown hero image, for a controlled hero (e.g. to load the next image lazily). */\n imageIndex?: number;\n /** Called with the new hero index after a swipe or a dot press. */\n onImageIndexChange?: (index: number) => void;\n}\n\n/**\n * Raised summary card that floats over a canvas or media, e.g. for a selected item:\n * an optional thumbnail or swipeable image hero, title, subtitle and meta line, a primary action and a close\n * button. Up to 420px wide; the parent (such as OverlayTemplate) positions it.\n */\nexport function FloatingCard({\n title,\n subtitle,\n meta,\n thumbnailUri,\n onPress,\n action,\n onClose,\n closeLabel = \"Close\",\n testID,\n rating,\n badge,\n badgeTestID,\n images,\n onImagePress,\n imageLabel,\n imageIndex,\n onImageIndexChange,\n}: FloatingCardProps) {\n const hero = !!images?.length;\n const body = (\n <>\n {thumbnailUri && !hero ? (\n <Image\n uri={thumbnailUri}\n accessible={false}\n className=\"h-16 w-16 rounded-[var(--radius-md)] bg-[hsl(var(--secondary))]\"\n />\n ) : null}\n <View className=\"shrink grow gap-0.5\">\n <Text numberOfLines={2} variant=\"subheading\" tone=\"on-card\">\n {title}\n </Text>\n {subtitle ? (\n <Text numberOfLines={1} variant=\"small\" tone=\"muted\">\n {subtitle}\n </Text>\n ) : null}\n {meta ? (\n <Text numberOfLines={1} variant=\"footnote\" tone=\"muted\">\n {meta}\n </Text>\n ) : null}\n {rating || badge ? (\n <View className=\"mt-0.5 flex-row flex-wrap items-center gap-2\">\n {rating ? (\n <RatingStars\n value={rating.value}\n max={rating.max}\n label={rating.label}\n size=\"sm\"\n />\n ) : null}\n {rating?.caption ? (\n <Text numberOfLines={1} variant=\"footnote\" tone=\"muted\">\n {rating.caption}\n </Text>\n ) : null}\n {badge ? (\n <View\n testID={badgeTestID}\n className=\"rounded-full bg-[hsl(var(--secondary))] px-2 py-0.5\"\n >\n <Text variant=\"footnote\" weight=\"semibold\" tone=\"primary\">\n {badge}\n </Text>\n </View>\n ) : null}\n </View>\n ) : null}\n </View>\n {onPress ? (\n <Icon\n name=\"chevron-forward\"\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n ) : null}\n </>\n );\n // Room for the close button so the title never runs under it (it sits over the hero\n // when there is one).\n const row = `flex-row items-center gap-3 ${onClose && !hero ? \"pr-8\" : \"\"}`;\n\n return (\n <Surface\n testID={testID}\n variant=\"floating\"\n className=\"w-full max-w-[420px] gap-3 p-3\"\n >\n {images?.length ? (\n <ImageCarousel\n testID={testID ? `${testID}-images` : undefined}\n uris={images}\n onPress={onImagePress}\n imageLabel={imageLabel}\n index={imageIndex}\n onIndexChange={onImageIndexChange}\n height={160}\n rounded\n />\n ) : null}\n {onPress ? (\n // The name comes from the visible text, so it matches what is shown (axe).\n <PressableSurface\n testID={testID ? `${testID}-open` : undefined}\n accessibilityRole=\"button\"\n onPress={onPress}\n feedback=\"none\"\n className={`${row} active:opacity-80`}\n >\n {body}\n </PressableSurface>\n ) : (\n <View className={row}>{body}</View>\n )}\n {action ? (\n <Button\n testID={action.testID}\n label={action.label}\n onPress={action.onPress}\n size=\"md\"\n />\n ) : null}\n {onClose ? (\n <PressableSurface\n testID={testID ? `${testID}-close` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={closeLabel}\n onPress={onClose}\n hitSlop={8}\n feedback=\"none\"\n className=\"absolute right-2 top-2 h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--secondary))] active:opacity-80\"\n >\n <Icon\n name=\"close\"\n size={18}\n className=\"text-[hsl(var(--secondary-foreground))]\"\n />\n </PressableSurface>\n ) : null}\n </Surface>\n );\n}\n","import { useEffect, useRef, useState } from \"react\";\nimport {\n FlatList,\n View,\n type LayoutChangeEvent,\n type NativeScrollEvent,\n type NativeSyntheticEvent,\n} from \"react-native\";\nimport { Icon } from \"../../atoms/icon/Icon\";\nimport { Image } from \"../../atoms/image/Image\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport interface ImageCarouselProps {\n /**\n * Image URIs in order; `null` draws a placeholder surface for an image that is not\n * ready yet (e.g. its URL is still loading). Renders nothing when empty.\n */\n uris: (string | null)[];\n /** Index of the image shown. Leave it out to let the carousel track it. */\n index?: number;\n /** Called with the new index after a swipe or a dot press. */\n onIndexChange?: (index: number) => void;\n /** Small credit line per image, shown over its bottom-left corner, e.g. the author. */\n credits?: (string | undefined)[];\n /** Height in px. Defaults to 280. */\n height?: number;\n /** Rounds the corners, for a carousel inside a card. Defaults to false (edge to edge). */\n rounded?: boolean;\n /** Called with the pressed image's index, e.g. to open an ImageViewer there. */\n onPress?: (index: number) => void;\n /** Image names are \"<imageLabel> <n> of <total>\". Defaults to \"Image\". */\n imageLabel?: string;\n /** Page dots are named \"<dotLabel> <image name>\". Defaults to \"Show\". */\n dotLabel?: string;\n testID?: string;\n /** Added to a placeholder's name: \"<image name>, <placeholderLabel>\". Defaults to \"loading\". */\n placeholderLabel?: string;\n}\n\nfunction clamp(value: number, count: number) {\n return Math.max(0, Math.min(value, count - 1));\n}\n\n/**\n * Swipeable, paged row of full-width images with page dots and a per-image credit line,\n * e.g. the hero of a detail screen. Controlled through `index` or self-tracking.\n */\nexport function ImageCarousel({\n uris,\n index,\n onIndexChange,\n credits,\n height = 280,\n rounded = false,\n onPress,\n imageLabel = \"Image\",\n dotLabel = \"Show\",\n testID,\n placeholderLabel = \"loading\",\n}: ImageCarouselProps) {\n const [width, setWidth] = useState(0);\n const [tracked, setTracked] = useState(0);\n const list = useRef<FlatList<string | null>>(null);\n // The page the list is scrolled to, so a controlled `index` that follows a swipe\n // doesn't scroll the list again.\n const scrolled = useRef(0);\n const count = uris.length;\n const current = clamp(index ?? tracked, count);\n\n useEffect(() => {\n if (width > 0 && current !== scrolled.current) {\n scrolled.current = current;\n list.current?.scrollToOffset({ offset: current * width, animated: true });\n }\n }, [current, width]);\n\n if (count === 0) return null;\n\n function change(next: number) {\n if (index == null) setTracked(next);\n onIndexChange?.(next);\n }\n\n function onScroll(e: NativeSyntheticEvent<NativeScrollEvent>) {\n const page = clamp(\n Math.round(e.nativeEvent.contentOffset.x / width),\n count,\n );\n if (page !== scrolled.current) {\n scrolled.current = page;\n change(page);\n }\n }\n\n const credit = credits?.[current];\n const name = (i: number) => `${imageLabel} ${i + 1} of ${count}`;\n\n return (\n <View\n testID={testID}\n onLayout={(e: LayoutChangeEvent) => setWidth(e.nativeEvent.layout.width)}\n style={{ height }}\n className={`w-full overflow-hidden bg-[hsl(var(--secondary))]${rounded ? \" rounded-[var(--radius-lg)]\" : \"\"}`}\n >\n {width > 0 ? (\n <FlatList\n ref={list}\n data={uris}\n keyExtractor={(uri, i) => `${i}-${uri}`}\n horizontal\n pagingEnabled\n showsHorizontalScrollIndicator={false}\n // Lets keyboard users reach the scrolling region on web.\n focusable\n scrollEventThrottle={16}\n onScroll={onScroll}\n getItemLayout={(_, i) => ({\n length: width,\n offset: width * i,\n index: i,\n })}\n initialScrollIndex={current}\n renderItem={({ item, index: i }) => {\n const label = item ? name(i) : `${name(i)}, ${placeholderLabel}`;\n const visual = item ? (\n <Image\n uri={item}\n accessible={false}\n resizeMode=\"cover\"\n className=\"h-full w-full\"\n />\n ) : (\n <View\n testID={testID ? `${testID}-placeholder-${i}` : undefined}\n className=\"h-full w-full items-center justify-center bg-[hsl(var(--secondary))]\"\n >\n <Icon\n name=\"image-outline\"\n size={32}\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n </View>\n );\n return onPress ? (\n <PressableSurface\n testID={testID ? `${testID}-image-${i}` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n onPress={() => onPress(i)}\n feedback=\"none\"\n style={{ width, height }}\n >\n {visual}\n </PressableSurface>\n ) : (\n <View\n testID={testID ? `${testID}-image-${i}` : undefined}\n accessible\n accessibilityRole=\"image\"\n accessibilityLabel={label}\n style={{ width, height }}\n >\n {visual}\n </View>\n );\n }}\n />\n ) : null}\n {credit ? (\n <View\n pointerEvents=\"none\"\n className=\"absolute bottom-2 left-2 max-w-[60%] rounded-[var(--radius-md)] bg-black/60 px-2 py-0.5\"\n >\n <Text variant=\"footnote\" tone=\"on-scrim\" numberOfLines={1}>\n {credit}\n </Text>\n </View>\n ) : null}\n {count > 1 ? (\n <View\n pointerEvents=\"box-none\"\n className=\"absolute bottom-2 right-2 flex-row\"\n >\n {uris.map((uri, i) => (\n <PressableSurface\n key={`${i}-${uri}`}\n testID={testID ? `${testID}-dot-${i}` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={`${dotLabel} ${name(i)}`}\n onPress={() => change(i)}\n feedback=\"none\"\n className=\"h-6 w-6 items-center justify-center\"\n >\n <View\n className={`h-2 w-2 rounded-full ${i === current ? \"bg-white\" : \"bg-white/50\"}`}\n />\n </PressableSurface>\n ))}\n </View>\n ) : null}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { Input, type InputProps } from \"../../atoms/input/Input\";\nimport { TextLink } from \"../../atoms/text-link/TextLink\";\nimport { FieldError } from \"../../molecules/field/Field\";\n\n/** One text field. `key` identifies it; the rest mirrors the input's props. */\nexport type FormSectionField = Omit<\n InputProps,\n \"editable\" | \"variant\" | \"inputMode\" | \"accessibilityLabel\"\n> & {\n key: string;\n};\n\nexport interface FormSectionAction {\n label: string;\n onPress: () => void;\n testID?: string;\n}\n\nexport interface FormSectionProps {\n fields: FormSectionField[];\n /** Inline error shown above the submit button. */\n error?: string | null;\n errorTestID?: string;\n /** Full-width primary button. */\n submit: FormSectionAction & { loading?: boolean; disabled?: boolean };\n /** Optional muted text link under the button, e.g. \"Forgot password?\". */\n secondaryAction?: FormSectionAction;\n}\n\n/** Text fields, an inline error, a submit button with a loading state and an optional text link. */\nexport function FormSection({\n fields,\n error,\n errorTestID,\n submit,\n secondaryAction,\n}: FormSectionProps) {\n return (\n <View className=\"gap-3.5\">\n {fields.map(({ key, ...field }) => (\n <Input key={key} editable={!submit.loading} {...field} />\n ))}\n {error ? <FieldError testID={errorTestID}>{error}</FieldError> : null}\n <Button\n label={submit.label}\n onPress={submit.onPress}\n loading={submit.loading}\n disabled={submit.disabled}\n testID={submit.testID}\n />\n {secondaryAction ? (\n <TextLink\n label={secondaryAction.label}\n onPress={secondaryAction.onPress}\n testID={secondaryAction.testID}\n />\n ) : null}\n </View>\n );\n}\n","import { PressableSurface } from \"../pressable-surface/PressableSurface\";\nimport { Text } from \"../text/Text\";\n\nexport interface TextLinkProps {\n label: string;\n onPress: () => void;\n testID?: string;\n /** Semibold foreground label instead of muted, e.g. the call to action after a prompt. */\n emphasis?: boolean;\n}\n\n/** Internal atom: a muted, link-styled pressable line of text. */\nexport function TextLink({\n label,\n onPress,\n testID,\n emphasis = false,\n}: TextLinkProps) {\n return (\n <PressableSurface\n testID={testID}\n accessibilityRole=\"link\"\n onPress={onPress}\n hitSlop={8}\n feedback=\"none\"\n className=\"self-center py-1\"\n >\n <Text\n variant=\"small\"\n tone={emphasis ? \"default\" : \"muted\"}\n weight={emphasis ? \"semibold\" : undefined}\n >\n {label}\n </Text>\n </PressableSurface>\n );\n}\n","import { useEffect, useRef } from \"react\";\nimport {\n FlatList,\n Modal,\n View,\n useWindowDimensions,\n type NativeScrollEvent,\n type NativeSyntheticEvent,\n} from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { Image } from \"../../atoms/image/Image\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { ThemeScope } from \"../../theme/ThemeScope\";\n\nexport interface ImageViewerProps {\n /** Shows the viewer. The app owns this state. */\n open: boolean;\n /** Image URIs in order. */\n uris: string[];\n /** Index of the image shown. The app owns this state. */\n index: number;\n /** Called when a swipe or the previous/next buttons move to another image. */\n onIndexChange: (index: number) => void;\n /** Called by the close button, the Android back button and Escape on web. */\n onClose: () => void;\n /** Text under the image, e.g. the current image's caption. */\n caption?: string;\n /** Name of the close button. Defaults to \"Close\". */\n closeLabel?: string;\n /** Name of the previous button. Defaults to \"Previous image\". */\n previousLabel?: string;\n /** Name of the next button. Defaults to \"Next image\". */\n nextLabel?: string;\n /** Image names are \"<imageLabel> <n>\". Defaults to \"Image\". */\n imageLabel?: string;\n /** Accessible name of the viewer dialog. Defaults to \"Images\". */\n label?: string;\n testID?: string;\n}\n\n/**\n * Full-screen image viewer over a near-black scrim: swipe between images (FlatList paging)\n * or use the previous/next buttons, with a counter, a close button and an optional caption.\n * The app controls `open` and `index`.\n */\nexport function ImageViewer({\n open,\n onClose,\n label = \"Images\",\n ...rest\n}: ImageViewerProps) {\n return (\n <Modal\n visible={open}\n transparent\n animationType=\"fade\"\n statusBarTranslucent\n onRequestClose={onClose}\n aria-label={label}\n >\n <ThemeScope>\n {open ? <Viewer onClose={onClose} {...rest} /> : null}\n </ThemeScope>\n </Modal>\n );\n}\n\nfunction RoundButton({\n icon,\n label,\n onPress,\n testID,\n}: {\n icon: IconName;\n label: string;\n onPress: () => void;\n testID?: string;\n}) {\n return (\n <PressableSurface\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n onPress={onPress}\n feedback=\"fade\"\n className=\"h-11 w-11 items-center justify-center rounded-full bg-black/40\"\n >\n <Icon name={icon} size={24} className=\"text-white\" />\n </PressableSurface>\n );\n}\n\nfunction Viewer({\n uris,\n index,\n onIndexChange,\n onClose,\n caption,\n closeLabel = \"Close\",\n previousLabel = \"Previous image\",\n nextLabel = \"Next image\",\n imageLabel = \"Image\",\n testID,\n}: Omit<ImageViewerProps, \"open\" | \"label\">) {\n const { width, height } = useWindowDimensions();\n const list = useRef<FlatList<string>>(null);\n // Last index this viewer reported or scrolled to, and a programmatic scroll in flight.\n const shown = useRef(index);\n const pending = useRef<number | null>(null);\n const count = uris.length;\n\n useEffect(() => {\n if (index === shown.current) return;\n shown.current = index;\n pending.current = index;\n list.current?.scrollToIndex({ index, animated: true });\n }, [index]);\n\n const onScroll = (e: NativeSyntheticEvent<NativeScrollEvent>) => {\n const at = Math.round(e.nativeEvent.contentOffset.x / width);\n if (pending.current !== null) {\n // Ignore the pages passed on the way to a button's target.\n if (at === pending.current) pending.current = null;\n return;\n }\n if (at !== shown.current && at >= 0 && at < count) {\n shown.current = at;\n onIndexChange(at);\n }\n };\n\n return (\n <View testID={testID} className=\"flex-1 bg-black/95\">\n <FlatList\n ref={list}\n testID={testID ? `${testID}-list` : undefined}\n data={uris}\n horizontal\n pagingEnabled\n showsHorizontalScrollIndicator={false}\n // Lets keyboard users reach the scrolling region on web.\n focusable\n keyExtractor={(uri, i) => `${i}-${uri}`}\n initialScrollIndex={index}\n getItemLayout={(_, i) => ({\n length: width,\n offset: width * i,\n index: i,\n })}\n onScroll={onScroll}\n scrollEventThrottle={32}\n renderItem={({ item, index: i }) => (\n <Image\n uri={item}\n accessibilityRole=\"image\"\n accessibilityLabel={`${imageLabel} ${i + 1}`}\n style={{ width, height }}\n resizeMode=\"contain\"\n />\n )}\n />\n <SafeAreaView\n pointerEvents=\"box-none\"\n edges={[\"top\", \"bottom\"]}\n className=\"absolute inset-0 justify-between\"\n >\n <View className=\"flex-row items-center justify-between px-4 py-2\">\n <Text variant=\"label\" tone=\"on-scrim\">\n {count > 1 ? `${index + 1} / ${count}` : \"\"}\n </Text>\n <RoundButton\n testID={testID ? `${testID}-close` : undefined}\n icon=\"close\"\n label={closeLabel}\n onPress={onClose}\n />\n </View>\n <View\n pointerEvents=\"box-none\"\n className=\"flex-row items-center justify-between px-2\"\n >\n {index > 0 ? (\n <RoundButton\n testID={testID ? `${testID}-previous` : undefined}\n icon=\"chevron-back\"\n label={previousLabel}\n onPress={() => onIndexChange(index - 1)}\n />\n ) : (\n <View />\n )}\n {index < count - 1 ? (\n <RoundButton\n testID={testID ? `${testID}-next` : undefined}\n icon=\"chevron-forward\"\n label={nextLabel}\n onPress={() => onIndexChange(index + 1)}\n />\n ) : null}\n </View>\n <View className=\"min-h-[44px] justify-center px-4 py-3\">\n {caption ? (\n <Text variant=\"small\" tone=\"on-scrim\" className=\"text-center\">\n {caption}\n </Text>\n ) : null}\n </View>\n </SafeAreaView>\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Divider } from \"../../atoms/divider/Divider\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport type LabeledDividerTone = \"neutral\" | \"accent\";\n\nexport interface LabeledDividerProps {\n /** Centered text, such as a date or \"New messages\". */\n label: string;\n /** neutral: border lines and muted text; accent: primary lines and medium primary text. Defaults to neutral. */\n tone?: LabeledDividerTone;\n testID?: string;\n}\n\n/** A horizontal rule with a centered label: line, label, line. */\nexport function LabeledDivider({\n label,\n tone = \"neutral\",\n testID,\n}: LabeledDividerProps) {\n const accent = tone === \"accent\";\n const line = <Divider layout=\"fill\" tone={accent ? \"accent\" : \"default\"} />;\n return (\n <View testID={testID} className=\"flex-row items-center gap-3 px-4 py-3\">\n {line}\n <Text\n variant=\"footnote\"\n weight={accent ? \"medium\" : undefined}\n tone={accent ? \"primary\" : \"muted\"}\n >\n {label}\n </Text>\n {line}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { StarCount } from \"../../atoms/star-count/StarCount\";\n\nexport interface LegendItem {\n /** What the marker means, e.g. \"3 points\". */\n label: string;\n /** Number of gold stars before the label, e.g. 3 for a three-star tier. */\n rating?: number;\n /** Ionicons name before the label, shown muted; drawn after the stars when both are set. */\n icon?: IconName;\n /** Spoken text when the stars or icon carry meaning, e.g. \"Three stars: 3 points\". */\n accessibilityLabel?: string;\n}\n\nexport interface LegendProps {\n /** Muted heading before the items, e.g. \"Points\". */\n title?: string;\n items: LegendItem[];\n testID?: string;\n}\n\n/**\n * Key that explains markers used elsewhere on the screen: an optional muted title, then\n * items (gold stars or an icon, and a label) that wrap onto more lines when needed.\n */\nexport function Legend({ title, items, testID }: LegendProps) {\n return (\n <View\n testID={testID}\n className=\"flex-row flex-wrap items-center gap-x-4 gap-y-1.5\"\n >\n {title ? (\n <Text variant=\"small\" weight=\"semibold\" tone=\"muted\">\n {title}\n </Text>\n ) : null}\n {items.map((item, i) => (\n <View\n key={i}\n accessible={item.accessibilityLabel ? true : undefined}\n accessibilityLabel={item.accessibilityLabel}\n className=\"flex-row items-center gap-1\"\n >\n {item.rating ? <StarCount count={item.rating} /> : null}\n {item.icon ? (\n <Icon\n name={item.icon}\n size={14}\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n ) : null}\n <Text variant=\"small\" tone=\"muted\">\n {item.label}\n </Text>\n </View>\n ))}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Icon } from \"../icon/Icon\";\n\nexport interface StarCountProps {\n /** Number of filled gold stars, e.g. 3 for a three-star tier. */\n count: number;\n /** `sm`: 14px stars (rows, legends); `md`: 20px stars. Defaults to `sm`. */\n size?: \"sm\" | \"md\";\n}\n\nconst GLYPH = { sm: 14, md: 20 };\n\n/**\n * Internal atom: a run of filled gold stars marking a tier, hidden from screen readers\n * (the caller names the tier in text). Shared by Legend and ProgressBar.\n */\nexport function StarCount({ count, size = \"sm\" }: StarCountProps) {\n return (\n <View\n accessible={false}\n importantForAccessibility=\"no-hide-descendants\"\n aria-hidden\n className=\"flex-row items-center\"\n >\n {Array.from({ length: count }, (_, i) => (\n <Icon\n key={i}\n name=\"star\"\n size={GLYPH[size]}\n className=\"text-[hsl(var(--gold))]\"\n />\n ))}\n </View>\n );\n}\n","import { useState } from \"react\";\nimport { View, type LayoutChangeEvent } from \"react-native\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Switch } from \"../../atoms/switch/Switch\";\nimport { Text, type TextTone } from \"../../atoms/text/Text\";\nimport { ListItem } from \"../../molecules/list-item/ListItem\";\nimport { RatingStars } from \"../rating-stars/RatingStars\";\n\n/** Label color and role of a pressable row. */\nexport type ListRowTone = \"default\" | \"link\" | \"destructive\";\n\n/** Color of the value: `primary` highlights it, e.g. an incoming amount; `muted` plays it down. */\nexport type ListRowValueTone = \"default\" | \"primary\" | \"muted\";\n\n/**\n * Color of the badge pill: `primary` (default) tinted, `muted` neutral, `destructive` an\n * alert, `gold` a highlight such as a top tier (dark text on gold).\n */\nexport type ListRowBadgeTone = \"primary\" | \"muted\" | \"destructive\" | \"gold\";\n\n/**\n * Where `actions` go: `end` (default) after the text on the same line; `below` on a second\n * line under the text; `auto` below while the row is narrower than 400px, so the label keeps\n * its room next to a badge and two buttons on phones.\n */\nexport type ListRowActionsPlacement = \"end\" | \"below\" | \"auto\";\n\n/** Read-only star rating at the end of the row. */\nexport interface ListRowRating {\n /** Rating from 0 to `max`; halves show as half stars. */\n value: number;\n /** Number of stars. Defaults to 5. */\n max?: number;\n /** Accessible name of the stars. Defaults to \"Rating\". */\n label?: string;\n}\n\n/** A small muted status icon, e.g. a saved marker. */\nexport interface ListRowIndicator {\n icon: IconName;\n /** Accessible name of the icon, e.g. \"Saved\". */\n label: string;\n}\n\n/** Round initials avatar at the start of the row, e.g. for a person. */\nexport interface ListRowAvatar {\n /** Name whose initials fill the circle. */\n name: string;\n}\n\n/** A small button at the end of the row, e.g. \"Done\". */\nexport interface ListRowAction {\n label: string;\n onPress: () => void;\n /** `primary`: filled; `outline`: bordered; `ghost`: text only. Defaults to `primary`. */\n variant?: \"primary\" | \"outline\" | \"ghost\";\n disabled?: boolean;\n testID?: string;\n /** Ionicons glyph before the label. */\n icon?: IconName;\n}\n\n/** An on/off switch at the end of the row; the row label is its accessible name. */\nexport interface ListRowToggle {\n value: boolean;\n onChange: (next: boolean) => void;\n disabled?: boolean;\n testID?: string;\n}\n\nexport interface ListRowProps {\n label: string;\n /** Muted second line under the label, e.g. a relation or a last date. */\n subtitle?: string;\n /** Initials avatar at the start of the row. */\n avatar?: ListRowAvatar;\n /** Text on the right, e.g. a version number or an amount. */\n value?: string;\n /** Color of `value`. Defaults to `default`. */\n valueTone?: ListRowValueTone;\n /** Muted footnote under `value`, e.g. what the amount means. */\n valueCaption?: string;\n valueTestID?: string;\n /** Small pill on the right, e.g. a countdown such as \"D-3\". */\n badge?: string;\n badgeTestID?: string;\n /** Up to two small buttons on the right. */\n actions?: ListRowAction[];\n /** On/off switch on the right, for settings. */\n toggle?: ListRowToggle;\n /** Color of `badge`. Defaults to `primary`. */\n badgeTone?: ListRowBadgeTone;\n /** Read-only star rating on the right, before the value. */\n rating?: ListRowRating;\n /** Small muted status icons on the right, before the badge. */\n indicators?: ListRowIndicator[];\n /** A total row: semibold label and a larger semibold value. */\n emphasis?: boolean;\n /** Makes the row (except its actions and toggle) pressable. */\n onPress?: () => void;\n /**\n * Pressable rows only. `default`: foreground label, and a chevron when nothing else is on\n * the right; `link`: primary label with the link role; `destructive`: destructive label.\n */\n tone?: ListRowTone;\n testID?: string;\n /** Lines the subtitle may take before it ends with an ellipsis. Unset: no limit. */\n subtitleLines?: number;\n /** Where `actions` go. Defaults to `end`. */\n actionsPlacement?: ListRowActionsPlacement;\n /** Dims the row and blocks its press, actions and switch, e.g. while it is busy. */\n disabled?: boolean;\n}\n\n/** Below this row width, `actionsPlacement=\"auto\"` moves the actions under the text. */\nconst AUTO_BELOW_WIDTH = 400;\n\nconst BADGE: Record<ListRowBadgeTone, { box: string; tone: TextTone }> = {\n primary: { box: \"bg-[hsl(var(--secondary))]\", tone: \"primary\" },\n muted: { box: \"bg-[hsl(var(--secondary))]\", tone: \"default\" },\n destructive: { box: \"bg-[hsl(var(--destructive))]\", tone: \"on-destructive\" },\n gold: { box: \"bg-[hsl(var(--gold))]\", tone: \"on-medal\" },\n};\n\nconst LABEL_TONE: Record<ListRowTone, TextTone> = {\n default: \"default\",\n link: \"primary\",\n destructive: \"destructive\",\n};\n\n/**\n * One list row: a label (optionally with an initials avatar and a subtitle) and trailing\n * content — status icons, a badge, a star rating, a value, small action buttons or a\n * switch — and an emphasized total style, or a pressable\n * navigation, link or destructive row.\n */\nexport function ListRow({\n label,\n subtitle,\n avatar,\n value,\n valueTone = \"default\",\n valueCaption,\n valueTestID,\n badge,\n badgeTestID,\n badgeTone = \"primary\",\n rating,\n indicators,\n emphasis = false,\n actions,\n toggle,\n onPress,\n tone = \"default\",\n testID,\n subtitleLines,\n actionsPlacement = \"end\",\n disabled = false,\n}: ListRowProps) {\n const [width, setWidth] = useState<number | null>(null);\n const row = `min-h-[44px] flex-row items-center justify-between gap-3 ${avatar ? \"py-2\" : \"\"}`;\n // A plain settings row reads as a muted key; with an avatar or subtitle the label is content.\n const labelTone: TextTone = onPress\n ? LABEL_TONE[tone]\n : avatar || subtitle || emphasis\n ? \"default\"\n : \"muted\";\n const hasActions = actions != null && actions.length > 0;\n const hasControls = hasActions || toggle != null;\n const actionsBelow =\n hasActions &&\n toggle == null &&\n (actionsPlacement === \"below\" ||\n (actionsPlacement === \"auto\" &&\n width != null &&\n width < AUTO_BELOW_WIDTH));\n\n const item = (\n <ListItem\n label={label}\n labelTone={labelTone}\n labelWeight={emphasis ? \"semibold\" : undefined}\n subtitle={subtitle}\n avatarName={avatar?.name}\n layout={hasControls ? \"fill\" : undefined}\n subtitleLines={subtitleLines}\n />\n );\n\n const hasIndicators = indicators != null && indicators.length > 0;\n const info =\n value != null || badge != null || rating != null || hasIndicators ? (\n <View className=\"flex-row items-center gap-2\">\n {hasIndicators\n ? indicators.map((indicator) => (\n <View\n key={indicator.icon}\n accessible\n accessibilityRole=\"image\"\n accessibilityLabel={indicator.label}\n >\n <Icon\n name={indicator.icon}\n size={16}\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n </View>\n ))\n : null}\n {badge != null ? (\n <View className={`rounded-full px-2.5 py-1 ${BADGE[badgeTone].box}`}>\n <Text\n testID={badgeTestID}\n variant=\"footnote\"\n weight=\"semibold\"\n tone={BADGE[badgeTone].tone}\n >\n {badge}\n </Text>\n </View>\n ) : null}\n {rating != null ? (\n <RatingStars\n value={rating.value}\n max={rating.max}\n label={rating.label ?? \"Rating\"}\n size=\"sm\"\n />\n ) : null}\n {value != null ? (\n <View className=\"items-end\">\n <Text\n testID={valueTestID}\n variant={valueCaption || emphasis ? \"body\" : \"small\"}\n weight={valueCaption || emphasis ? \"semibold\" : undefined}\n tone={valueTone}\n >\n {value}\n </Text>\n {valueCaption ? (\n <Text variant=\"footnote\" tone=\"muted\">\n {valueCaption}\n </Text>\n ) : null}\n </View>\n ) : null}\n </View>\n ) : null;\n\n const controls = toggle ? (\n <Switch\n value={toggle.value}\n onValueChange={toggle.onChange}\n accessibilityLabel={label}\n disabled={toggle.disabled || disabled}\n testID={toggle.testID}\n />\n ) : hasActions ? (\n <View\n className={`flex-row items-center gap-1${actionsBelow ? ` flex-wrap ${avatar ? \"pl-[52px]\" : \"\"}` : \"\"}`}\n >\n {actions!.slice(0, 2).map((action) => (\n <Button\n key={action.label}\n label={action.label}\n onPress={action.onPress}\n variant={action.variant ?? \"primary\"}\n size=\"sm\"\n layout=\"auto\"\n disabled={action.disabled || disabled}\n testID={action.testID}\n icon={action.icon}\n />\n ))}\n </View>\n ) : null;\n\n const onLayout =\n actionsPlacement === \"auto\" && hasActions\n ? (event: LayoutChangeEvent) => setWidth(event.nativeEvent.layout.width)\n : undefined;\n\n if (actionsBelow) {\n // The text and trailing info keep the full width; the buttons sit on a line under them.\n const top = onPress ? (\n <PressableSurface\n testID={testID}\n accessibilityRole={tone === \"link\" ? \"link\" : \"button\"}\n accessibilityLabel={subtitle || info ? undefined : label}\n onPress={onPress}\n disabled={disabled}\n accessibilityState={{ disabled }}\n feedback=\"fade\"\n className={row}\n >\n {item}\n {info}\n </PressableSurface>\n ) : (\n <View className={`${row}${disabled ? \" opacity-50\" : \"\"}`}>\n {item}\n {info}\n </View>\n );\n return (\n <View\n testID={onPress ? undefined : testID}\n onLayout={onLayout}\n className=\"gap-1 pb-2\"\n >\n {top}\n {controls}\n </View>\n );\n }\n\n if (!onPress) {\n return (\n <View\n testID={testID}\n onLayout={onLayout}\n aria-disabled={disabled || undefined}\n className={`${row}${disabled ? \" opacity-50\" : \"\"}`}\n >\n {item}\n {info}\n {controls}\n </View>\n );\n }\n\n const pressable = (\n <PressableSurface\n testID={testID}\n accessibilityRole={tone === \"link\" ? \"link\" : \"button\"}\n // With a subtitle or trailing info the name comes from the visible text, so it matches what is shown.\n accessibilityLabel={subtitle || info ? undefined : label}\n onPress={onPress}\n disabled={disabled}\n accessibilityState={{ disabled }}\n feedback=\"fade\"\n className={controls ? `${row} flex-1` : row}\n >\n {item}\n {info}\n {tone === \"default\" && info == null && controls == null ? (\n <Icon\n name=\"chevron-forward\"\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n ) : null}\n </PressableSurface>\n );\n\n if (!controls) return pressable;\n\n // Actions and the switch stay outside the pressable so they are separate targets.\n return (\n <View onLayout={onLayout} className=\"flex-row items-center gap-3\">\n {pressable}\n {controls}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { PressableSurface } from \"../pressable-surface/PressableSurface\";\n\nexport interface SwitchProps {\n value: boolean;\n onValueChange: (next: boolean) => void;\n /** Accessible name, usually the row label. */\n accessibilityLabel: string;\n disabled?: boolean;\n testID?: string;\n}\n\n/**\n * Internal atom: an on/off switch drawn with token classes (primary track when on,\n * input track when off), so it themes like every other control.\n */\nexport function Switch({\n value,\n onValueChange,\n accessibilityLabel,\n disabled = false,\n testID,\n}: SwitchProps) {\n return (\n <PressableSurface\n testID={testID}\n accessibilityRole=\"switch\"\n accessibilityLabel={accessibilityLabel}\n aria-checked={value}\n aria-disabled={disabled}\n disabled={disabled}\n onPress={() => onValueChange(!value)}\n feedback=\"none\"\n hitSlop={8}\n className={`h-7 w-12 justify-center rounded-full px-0.5 ${value ? \"items-end bg-[hsl(var(--primary))]\" : \"items-start bg-[hsl(var(--input))]\"}`}\n >\n <View className=\"size-6 rounded-full bg-[hsl(var(--background))] shadow-sm\" />\n </PressableSurface>\n );\n}\n","import { View } from \"react-native\";\nimport { Avatar } from \"../../atoms/avatar/Avatar\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { Text, type TextTone, type TextWeight } from \"../../atoms/text/Text\";\n\n/** `compact`: small label, footnote subtitle (settings rows); `comfortable`: body label, caption subtitle (option rows). */\nexport type ListItemDensity = \"compact\" | \"comfortable\";\n\nexport interface ListItemProps {\n label: string;\n /** Muted second line under the label. */\n subtitle?: string;\n /** Leading initials avatar (takes precedence over `icon`). */\n avatarName?: string;\n /** Leading muted icon. */\n icon?: IconName;\n /** Defaults to `compact`. */\n density?: ListItemDensity;\n /** Defaults to `default`. */\n labelTone?: TextTone;\n labelWeight?: TextWeight;\n /** `fill` grows to push trailing content to the end; `shrink` only shrinks. Defaults to `shrink`. */\n layout?: \"fill\" | \"shrink\";\n /** Lines the subtitle may take before it ends with an ellipsis. Unset: no limit. */\n subtitleLines?: number;\n}\n\n/**\n * Internal molecule: the leading part of a row — an optional avatar or icon, a label and\n * an optional subtitle. Rows put their own trailing content (value, chevron, check) after it.\n */\nexport function ListItem({\n label,\n subtitle,\n avatarName,\n icon,\n density = \"compact\",\n labelTone = \"default\",\n labelWeight,\n layout = \"shrink\",\n subtitleLines,\n}: ListItemProps) {\n const compact = density === \"compact\";\n return (\n <View\n className={`${layout === \"fill\" ? \"flex-1\" : \"shrink\"} flex-row items-center gap-3`}\n >\n {avatarName ? (\n <Avatar name={avatarName} />\n ) : icon ? (\n <Icon name={icon} className=\"text-[hsl(var(--muted-foreground))]\" />\n ) : null}\n <View className={`${layout === \"fill\" ? \"flex-1\" : \"shrink\"} gap-0.5`}>\n <Text\n variant={compact ? \"small\" : \"body\"}\n tone={labelTone}\n weight={labelWeight}\n >\n {label}\n </Text>\n {subtitle ? (\n <Text\n numberOfLines={subtitleLines}\n variant={compact ? \"footnote\" : \"caption\"}\n tone=\"muted\"\n >\n {subtitle}\n </Text>\n ) : null}\n </View>\n </View>\n );\n}\n","import { Image, View } from \"react-native\";\nimport { Text, type TextVariant } from \"../text/Text\";\n\nexport type AvatarSize = \"md\" | \"lg\";\n\nexport interface AvatarProps {\n /** Display name; its initials fill the circle. */\n name: string;\n /** `md`: 40px (list rows); `lg`: 56px (profile headers). Defaults to `md`. */\n size?: AvatarSize;\n /** Photo shown instead of the initials. */\n uri?: string;\n}\n\n/** Up to two initials: first and last word, or \"?\" for an empty name. */\nexport function avatarInitials(name: string): string {\n const parts = name.trim().split(/\\s+/).filter(Boolean);\n if (parts.length === 0) return \"?\";\n const first = Array.from(parts[0])[0];\n const last = parts.length > 1 ? Array.from(parts[parts.length - 1])[0] : \"\";\n return (first + last).toUpperCase();\n}\n\nconst SIZE: Record<AvatarSize, { circle: string; text: TextVariant }> = {\n md: { circle: \"h-10 w-10\", text: \"subheading\" },\n lg: { circle: \"h-14 w-14\", text: \"heading\" },\n};\n\n/**\n * Internal atom: a round avatar with a photo, or initials on the secondary fill, hidden from\n * screen readers.\n */\nexport function Avatar({ name, size = \"md\", uri }: AvatarProps) {\n return (\n <View\n accessible={false}\n importantForAccessibility=\"no-hide-descendants\"\n aria-hidden\n className={`${SIZE[size].circle} items-center justify-center rounded-full bg-[hsl(var(--secondary))]`}\n >\n {uri ? (\n <Image\n source={{ uri }}\n className={`${SIZE[size].circle} rounded-full`}\n />\n ) : (\n <Text variant={SIZE[size].text} tone=\"on-secondary\">\n {avatarInitials(name)}\n </Text>\n )}\n </View>\n );\n}\n","import { Children, Fragment, type ReactNode } from \"react\";\nimport { View } from \"react-native\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { Divider } from \"../../atoms/divider/Divider\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Surface } from \"../../atoms/surface/Surface\";\nimport { Text } from \"../../atoms/text/Text\";\n\n/** A text action on the right of the section heading, such as \"Show more\". */\nexport interface ListSectionAction {\n /** Visible text, also the accessible name. */\n label: string;\n onPress: () => void;\n testID?: string;\n}\n\n/** `plain`: rows sit on the background; `card`: rows sit in a bordered card, divided by hairlines. */\nexport type ListSectionVariant = \"plain\" | \"card\";\n\nexport interface ListSectionProps {\n /** Section heading, e.g. a month or a category. Without it (and without `icon` and `action`) no heading row is drawn. */\n title?: string;\n /** Number shown after the heading, e.g. how many rows the section has. */\n count?: number;\n /** Muted line under the heading that explains the section. */\n description?: string;\n /** Optional text action right of the heading. */\n action?: ListSectionAction;\n /** The section's rows: ListRow, EmptyState or SkeletonList. */\n children: ReactNode;\n /** Muted footnote under the rows. */\n footer?: string;\n footerTestID?: string;\n testID?: string;\n /** Ionicons glyph in a tinted circle before the heading. */\n icon?: IconName;\n /** Text button under the rows, e.g. \"Show more\". */\n moreAction?: ListSectionAction;\n /** Defaults to `plain`. */\n variant?: ListSectionVariant;\n}\n\n/**\n * Titled group in a list: a muted heading (optionally with an icon and a count) with an\n * optional text action, its rows (plain or in a divided card), an optional show-more button\n * and an optional footnote.\n */\nexport function ListSection({\n title,\n count,\n description,\n action,\n children,\n footer,\n footerTestID,\n testID,\n icon,\n moreAction,\n variant = \"plain\",\n}: ListSectionProps) {\n const rows = Children.toArray(children);\n return (\n <View testID={testID} className=\"gap-1\">\n {title != null || icon || action ? (\n <View className=\"min-h-[32px] flex-row items-center justify-between gap-3\">\n {icon ? (\n <View className=\"h-7 w-7 items-center justify-center rounded-full bg-[hsl(var(--secondary))]\">\n <Icon\n name={icon}\n size={15}\n className=\"text-[hsl(var(--primary))]\"\n />\n </View>\n ) : null}\n {title != null ? (\n <Text\n accessibilityRole=\"header\"\n numberOfLines={1}\n variant=\"small\"\n weight=\"semibold\"\n tone=\"muted\"\n className=\"shrink grow\"\n >\n {count != null ? `${title} ${count}` : title}\n </Text>\n ) : (\n <View className=\"grow\" />\n )}\n {action ? (\n <PressableSurface\n testID={action.testID}\n accessibilityRole=\"button\"\n onPress={action.onPress}\n hitSlop={8}\n feedback=\"fade\"\n >\n <Text variant=\"label\">{action.label}</Text>\n </PressableSurface>\n ) : null}\n </View>\n ) : null}\n {description ? (\n <Text variant=\"footnote\" tone=\"muted\" className=\"pb-1\">\n {description}\n </Text>\n ) : null}\n {variant === \"card\" ? (\n <Surface className=\"px-4\">\n {rows.map((row, i) => (\n <Fragment key={i}>\n {i > 0 ? <Divider /> : null}\n {row}\n </Fragment>\n ))}\n </Surface>\n ) : (\n <View>{children}</View>\n )}\n {moreAction ? (\n <Button\n label={moreAction.label}\n onPress={moreAction.onPress}\n testID={moreAction.testID}\n variant=\"ghost\"\n size=\"sm\"\n />\n ) : null}\n {footer ? (\n <Text\n testID={footerTestID}\n variant=\"footnote\"\n tone=\"muted\"\n className=\"pt-1\"\n >\n {footer}\n </Text>\n ) : null}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport interface LiveCaptionProps {\n /** What the user is saying, updated live; small muted text, up to 3 lines. */\n input?: string;\n /** The reply; body text clamped to 6 lines. */\n response?: string;\n testID?: string;\n}\n\n/** Stacked, centered live transcript: the user's words above the reply. Keeps a 120px minimum height. */\nexport function LiveCaption({ input, response, testID }: LiveCaptionProps) {\n return (\n <View testID={testID} className=\"min-h-[120px] w-full gap-3\">\n {input ? (\n <Text\n numberOfLines={3}\n variant=\"small\"\n tone=\"muted\"\n className=\"text-center\"\n >\n {input}\n </Text>\n ) : null}\n {response ? (\n <Text numberOfLines={6} className=\"text-center\">\n {response}\n </Text>\n ) : null}\n </View>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { View } from \"react-native\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { TypingIndicator } from \"../typing-indicator/TypingIndicator\";\n\nexport type MessageBubbleRole = \"user\" | \"assistant\";\n\nexport interface MessageBubbleProps {\n /** Who wrote the message: user messages sit right on primary, assistant messages left on secondary. */\n role: MessageBubbleRole;\n /** Body slot: the app renders its own content here, such as markdown (D9). */\n children?: ReactNode;\n /** Plain-text body with the bubble's text style, used when `children` is absent. */\n text?: string;\n /** Shows the typing indicator inside the bubble when there is no body yet. */\n typing?: boolean;\n /** Accessible name of the typing indicator. Defaults to \"Typing\". */\n typingLabel?: string;\n /** Line under the bubble, such as a timestamp or \"Sending…\". */\n meta?: string;\n /** testID of the meta line, e.g. to assert a \"Sending…\" status in e2e tests. */\n metaTestID?: string;\n /** Marks the message as failed: destructive border and a retry line. */\n failed?: boolean;\n /** Called from the retry line of a failed message. */\n onRetry?: () => void;\n /** Text of the retry line. Defaults to \"Failed — tap to retry\". */\n retryLabel?: string;\n /** Long press on the bubble, e.g. to copy the message. */\n onLongPress?: () => void;\n testID?: string;\n}\n\n/** One chat message: a role-colored bubble with an app-owned body, optional meta line and failed state. */\nexport function MessageBubble({\n role,\n children,\n text,\n typing = false,\n typingLabel,\n meta,\n metaTestID,\n failed = false,\n onRetry,\n retryLabel = \"Failed — tap to retry\",\n onLongPress,\n testID,\n}: MessageBubbleProps) {\n const isUser = role === \"user\";\n\n let body: ReactNode = null;\n if (children != null) {\n body = children;\n } else if (text != null) {\n body = (\n <Text\n selectable\n variant=\"callout\"\n tone={isUser ? \"on-primary\" : \"on-secondary\"}\n >\n {text}\n </Text>\n );\n } else if (typing) {\n body = <TypingIndicator accessibilityLabel={typingLabel} />;\n }\n\n return (\n <View\n testID={testID}\n className={`w-full px-4 py-1.5 ${isUser ? \"items-end\" : \"items-start\"}`}\n >\n <PressableSurface\n testID={testID ? `${testID}-bubble` : undefined}\n onLongPress={onLongPress}\n delayLongPress={400}\n disabled={!onLongPress}\n feedback=\"none\"\n dimDisabled={false}\n className=\"max-w-[85%]\"\n >\n <View\n className={`rounded-2xl px-3.5 py-2.5 ${\n isUser ? \"bg-[hsl(var(--primary))]\" : \"bg-[hsl(var(--secondary))]\"\n } ${failed ? \"border border-[hsl(var(--destructive))]\" : \"\"}`}\n >\n {body}\n </View>\n </PressableSurface>\n {meta ? (\n <Text\n testID={metaTestID}\n variant=\"footnote\"\n tone=\"muted\"\n className=\"px-1 pt-0.5\"\n >\n {meta}\n </Text>\n ) : null}\n {failed ? (\n <PressableSurface\n testID={testID ? `${testID}-retry` : undefined}\n accessibilityRole=\"button\"\n onPress={onRetry}\n disabled={!onRetry}\n feedback=\"none\"\n dimDisabled={false}\n className=\"px-1 pt-1\"\n >\n <Text variant=\"footnote\" tone=\"destructive\">\n {retryLabel}\n </Text>\n </PressableSurface>\n ) : null}\n </View>\n );\n}\n","import { useEffect, useState } from \"react\";\nimport { Animated, Easing, Platform, View } from \"react-native\";\n\nconst DOT_COUNT = 3;\nconst STEP_MS = 160;\nconst PULSE_MS = 350;\nconst MIN_OPACITY = 0.3;\n\nexport interface TypingIndicatorProps {\n /** Accessible name of the indicator. Defaults to \"Typing\". */\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** Three pulsing dots shown while a reply is being written. */\nexport function TypingIndicator({\n accessibilityLabel = \"Typing\",\n testID,\n}: TypingIndicatorProps) {\n const [values] = useState(() =>\n Array.from({ length: DOT_COUNT }, () => new Animated.Value(MIN_OPACITY)),\n );\n\n useEffect(() => {\n const useNativeDriver = Platform.OS !== \"web\";\n const pulse = (value: Animated.Value, toValue: number) =>\n Animated.timing(value, {\n toValue,\n duration: PULSE_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver,\n });\n const loops = values.map((value, i) =>\n Animated.loop(\n Animated.sequence([\n Animated.delay(i * STEP_MS),\n pulse(value, 1),\n pulse(value, MIN_OPACITY),\n Animated.delay((DOT_COUNT - 1 - i) * STEP_MS),\n ]),\n ),\n );\n loops.forEach((loop) => loop.start());\n return () => loops.forEach((loop) => loop.stop());\n }, [values]);\n\n return (\n <View\n testID={testID}\n accessible\n accessibilityRole=\"progressbar\"\n accessibilityLabel={accessibilityLabel}\n className=\"h-[21px] flex-row items-center gap-1.5 px-1\"\n >\n {values.map((opacity, i) => (\n <Animated.View key={i} style={{ opacity }}>\n <View className=\"h-2 w-2 rounded-full bg-[hsl(var(--secondary-foreground))]\" />\n </Animated.View>\n ))}\n </View>\n );\n}\n","import type { ReactNode, Ref } from \"react\";\nimport {\n FlatList,\n View,\n type ListRenderItem,\n type NativeScrollEvent,\n type NativeSyntheticEvent,\n} from \"react-native\";\nimport { Spinner } from \"../../atoms/spinner/Spinner\";\n\nexport interface MessageListProps<T> {\n /** Rows, newest first: the list is inverted so index 0 sits at the bottom. */\n data: readonly T[];\n keyExtractor: (item: T, index: number) => string;\n /** Renders one row, usually a MessageBubble or LabeledDivider. */\n renderItem: ListRenderItem<T>;\n /** Called near the top (the oldest row), e.g. to load older messages. */\n onEndReached?: () => void;\n /** Shows a spinner above the oldest row while older rows load. */\n loadingMore?: boolean;\n /** Accessible name of the loading spinner. Defaults to \"Loading more\". */\n loadingMoreLabel?: string;\n onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;\n /**\n * Shown instead of the list while `data` is empty, centered in the list's area,\n * usually an EmptyState. Rendered outside the inverted FlatList so it is never\n * flipped or pinned to the bottom; `listRef` is unset while it shows.\n */\n empty?: ReactNode;\n /** Ref to the underlying FlatList, e.g. for `scrollToOffset({ offset: 0 })` to jump to the newest row. */\n listRef?: Ref<FlatList<T>>;\n testID?: string;\n}\n\n/** Inverted message stream: newest row at the bottom, app-rendered rows, a loading-more spinner on top. */\nexport function MessageList<T>({\n data,\n keyExtractor,\n renderItem,\n onEndReached,\n loadingMore = false,\n loadingMoreLabel = \"Loading more\",\n onScroll,\n listRef,\n empty,\n testID,\n}: MessageListProps<T>) {\n if (data.length === 0 && empty != null) {\n return (\n <View\n testID={testID ? `${testID}-empty` : undefined}\n className=\"flex-1 justify-center p-4\"\n >\n {empty}\n </View>\n );\n }\n return (\n <FlatList\n ref={listRef}\n testID={testID}\n style={{ flex: 1 }}\n data={data}\n inverted\n keyExtractor={keyExtractor}\n renderItem={renderItem}\n onScroll={onScroll}\n scrollEventThrottle={16}\n onEndReached={onEndReached}\n onEndReachedThreshold={0.5}\n contentContainerStyle={{ paddingVertical: 12 }}\n keyboardShouldPersistTaps=\"handled\"\n maintainVisibleContentPosition={{ minIndexForVisible: 0 }}\n ListFooterComponent={\n loadingMore ? (\n <View className=\"items-center py-4\">\n <Spinner label={loadingMoreLabel} />\n </View>\n ) : null\n }\n />\n );\n}\n","import { View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { Surface } from \"../../atoms/surface/Surface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { ProgressBar } from \"../progress-bar/ProgressBar\";\nimport { progressShare } from \"../progress-bar/progressShare\";\n\nexport interface MeterCardMeter {\n /** Identifies the meter in the list. */\n key: string;\n /** What is measured, e.g. \"Weekly limit\". */\n label: string;\n /** Share used, from 0 to 1. Values outside the range are clamped. */\n value: number;\n /** Muted line under the bar, e.g. \"Resets in 2h\". */\n caption?: string;\n testID?: string;\n}\n\nexport interface MeterCardProps {\n title: string;\n /** Muted text on the right of the title, e.g. a plan name or \"Updated 3 min ago\". */\n caption?: string;\n /** Ionicons name shown before the title. */\n icon?: IconName;\n /** Notice under the title row, e.g. why the numbers may be out of date. */\n message?: string;\n messageTestID?: string;\n /** May be empty when `message` explains why there is nothing to show. */\n meters: MeterCardMeter[];\n testID?: string;\n}\n\n/** At or above this share a meter turns destructive. */\nconst METER_CARD_HIGH = 0.9;\n\n/**\n * Card of quota or limit meters: a title row, then one labeled bar per meter with its\n * percentage and an optional caption. A meter at 90% or more turns destructive.\n */\nexport function MeterCard({\n title,\n caption,\n icon,\n message,\n messageTestID,\n meters,\n testID,\n}: MeterCardProps) {\n return (\n <Surface testID={testID} variant=\"panel\" className=\"gap-4 p-4\">\n <View className=\"flex-row items-center gap-2\">\n {icon ? (\n <Icon name={icon} className=\"text-[hsl(var(--card-foreground))]\" />\n ) : null}\n <Text\n accessibilityRole=\"header\"\n numberOfLines={1}\n variant=\"subheading\"\n tone=\"on-card\"\n className=\"flex-1\"\n >\n {title}\n </Text>\n {caption ? (\n <Text\n numberOfLines={1}\n variant=\"footnote\"\n tone=\"muted\"\n className=\"shrink\"\n >\n {caption}\n </Text>\n ) : null}\n </View>\n {message ? (\n <View\n testID={messageTestID}\n className=\"rounded-lg bg-[hsl(var(--secondary))] px-3 py-2\"\n >\n <Text variant=\"small\" tone=\"on-secondary\">\n {message}\n </Text>\n </View>\n ) : null}\n {meters.map((meter) => (\n <ProgressBar\n key={meter.key}\n testID={meter.testID}\n label={meter.label}\n value={meter.value}\n caption={meter.caption}\n tone={\n progressShare(meter.value).share >= METER_CARD_HIGH\n ? \"destructive\"\n : \"default\"\n }\n />\n ))}\n </Surface>\n );\n}\n","import { View } from \"react-native\";\nimport { Text, type TextTone } from \"../../atoms/text/Text\";\nimport { StarCount } from \"../../atoms/star-count/StarCount\";\nimport { progressShare } from \"./progressShare\";\n\n/**\n * Fill color: `default` is primary, `destructive` flags a value near a limit, `gold` matches\n * gold star tiers (the value text stays foreground, since gold text is too light to read).\n */\nexport type ProgressBarTone = \"default\" | \"destructive\" | \"gold\";\n\nexport interface ProgressBarProps {\n /** Share done, from 0 to 1. Values outside the range are clamped. */\n value: number;\n /** What is measured, shown above the bar; also the progress bar's accessible name. */\n label: string;\n /** Text on the right instead of the percentage, e.g. \"3 / 10\". */\n valueLabel?: string;\n /** Muted line under the bar, e.g. \"Resets in 2h\". */\n caption?: string;\n tone?: ProgressBarTone;\n testID?: string;\n /** Number of gold stars before the label, e.g. 3 for a three-star tier. */\n rating?: number;\n}\n\nconst FILL: Record<ProgressBarTone, string> = {\n default: \"bg-[hsl(var(--primary))]\",\n destructive: \"bg-[hsl(var(--destructive))]\",\n gold: \"bg-[hsl(var(--gold))]\",\n};\n\nconst VALUE_TONE: Record<ProgressBarTone, TextTone> = {\n default: \"default\",\n destructive: \"destructive\",\n gold: \"default\",\n};\n\n/**\n * Labeled linear progress bar: the label and percentage (or a value label) over a rounded\n * track, with an optional caption. Announced as a progress bar named by the label.\n */\nexport function ProgressBar({\n value,\n label,\n valueLabel,\n caption,\n tone = \"default\",\n testID,\n rating,\n}: ProgressBarProps) {\n const { percent } = progressShare(value);\n return (\n <View\n testID={testID}\n accessible\n accessibilityRole=\"progressbar\"\n accessibilityLabel={label}\n accessibilityValue={{ min: 0, max: 100, now: percent, text: valueLabel }}\n className=\"gap-1.5\"\n >\n <View className=\"flex-row items-center gap-2\">\n {rating ? <StarCount count={rating} /> : null}\n <Text numberOfLines={1} variant=\"small\" className=\"flex-1\">\n {label}\n </Text>\n <Text variant=\"small\" weight=\"semibold\" tone={VALUE_TONE[tone]}>\n {valueLabel ?? `${percent}%`}\n </Text>\n </View>\n <View className=\"h-2 overflow-hidden rounded-full bg-[hsl(var(--secondary))]\">\n <View\n style={{ width: `${percent}%` }}\n className={`h-2 rounded-full ${FILL[tone]}`}\n />\n </View>\n {caption ? (\n <Text variant=\"footnote\" tone=\"muted\">\n {caption}\n </Text>\n ) : null}\n </View>\n );\n}\n","// Internal: shared by ProgressBar, ProgressRing and MeterCard; not exported from the package.\n/** Clamps a share to 0–1 and returns it with its rounded percentage. */\nexport function progressShare(value: number) {\n const share = Math.min(1, Math.max(0, value));\n return { share, percent: Math.round(share * 100) };\n}\n","import { View } from \"react-native\";\nimport { Icon } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text, type TextTone } from \"../../atoms/text/Text\";\nimport { monthGrid, parseMonth, shiftMonth } from \"./calendar\";\n\n/** Dot colors under a date: filled primary, hollow primary, muted or destructive. */\nexport type MonthCalendarDotTone =\n | \"primary\"\n | \"outline\"\n | \"muted\"\n | \"destructive\";\n\nexport interface MonthCalendarProps {\n /** Shown month as \"YYYY-MM\"; the calendar is controlled. */\n month: string;\n /** Called with the new \"YYYY-MM\" by the previous and next buttons. */\n onMonthChange: (month: string) => void;\n /** Selected date(s) as \"YYYY-MM-DD\". */\n selected?: string | string[] | null;\n /** Called with the pressed \"YYYY-MM-DD\". The app decides what selection becomes. */\n onSelectDate?: (date: string) => void;\n /** Dots under dates, keyed by \"YYYY-MM-DD\"; up to three are shown per date. */\n marks?: Record<string, MonthCalendarDotTone[]>;\n /** Today's \"YYYY-MM-DD\", ringed. The app passes it so the calendar stays pure. */\n today?: string;\n /** Earliest selectable \"YYYY-MM-DD\"; earlier days and months are disabled. */\n minDate?: string;\n /** Latest selectable \"YYYY-MM-DD\"; later days and months are disabled. */\n maxDate?: string;\n /** First column: 0 = Sunday (default), 1 = Monday. */\n weekStartsOn?: 0 | 1;\n /** Seven weekday headers starting with Sunday. Defaults to English initials. */\n weekdayLabels?: string[];\n /** Twelve month names, January first, for the title and day names. Defaults to English. */\n monthNames?: string[];\n /** Title for the shown month. Defaults to \"<Month> <year>\". */\n formatTitle?: (year: number, monthIndex: number) => string;\n /** Accessible name of a day. Defaults to \"<Month> <day>, <year>\". */\n formatDayLabel?: (date: string) => string;\n /** Accessible name of the previous button. Defaults to \"Previous month\". */\n previousLabel?: string;\n /** Accessible name of the next button. Defaults to \"Next month\". */\n nextLabel?: string;\n testID?: string;\n /** testID of the month title, e.g. to check which month is shown. */\n titleTestID?: string;\n /**\n * Colors weekend headers and day numbers: Sunday red (destructive) and Saturday blue (info), as\n * Korean and Japanese calendars do. Selected days keep their filled style.\n */\n weekendTones?: boolean;\n}\n\nconst WEEKDAYS = [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"];\nconst MONTHS = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nconst DOT: Record<MonthCalendarDotTone, string> = {\n primary: \"bg-[hsl(var(--primary))]\",\n outline: \"border border-[hsl(var(--primary))]\",\n muted: \"bg-[hsl(var(--muted-foreground))]\",\n destructive: \"bg-[hsl(var(--destructive))]\",\n};\nconst DOT_ON_SELECTED: Record<MonthCalendarDotTone, string> = {\n primary: \"bg-[hsl(var(--primary-foreground))]\",\n outline: \"border border-[hsl(var(--primary-foreground))]\",\n muted: \"bg-[hsl(var(--primary-foreground))] opacity-60\",\n destructive: \"bg-[hsl(var(--primary-foreground))]\",\n};\n\n/** Tone of a weekday (0 = Sunday) when `weekendTones` is on. */\nfunction weekdayTone(weekday: number): TextTone | undefined {\n if (weekday === 0) return \"destructive\";\n if (weekday === 6) return \"info\";\n return undefined;\n}\n\nconst NAV = \"h-10 w-10 items-center justify-center rounded-[var(--radius-lg)]\";\n\n/**\n * Month grid with previous and next buttons, selected dates filled with primary, an\n * optional today ring, up to three dots per date and min/max bounds. Dates are ISO strings.\n */\nexport function MonthCalendar({\n month,\n onMonthChange,\n selected,\n onSelectDate,\n marks,\n today,\n minDate,\n maxDate,\n weekStartsOn = 0,\n weekdayLabels = WEEKDAYS,\n monthNames = MONTHS,\n formatTitle,\n formatDayLabel,\n previousLabel = \"Previous month\",\n nextLabel = \"Next month\",\n testID,\n titleTestID,\n weekendTones = false,\n}: MonthCalendarProps) {\n const { year, month: monthIndex } = parseMonth(month);\n const title = formatTitle\n ? formatTitle(year, monthIndex)\n : `${monthNames[monthIndex]} ${year}`;\n const dayLabel =\n formatDayLabel ??\n ((date: string) => {\n const [y, m, d] = date.split(\"-\").map(Number);\n return `${monthNames[m - 1]} ${d}, ${y}`;\n });\n const picked = new Set(\n selected == null ? [] : Array.isArray(selected) ? selected : [selected],\n );\n const prevBlocked = !!minDate && shiftMonth(month, -1) < minDate.slice(0, 7);\n const nextBlocked = !!maxDate && shiftMonth(month, 1) > maxDate.slice(0, 7);\n const headers = Array.from(\n { length: 7 },\n (_, i) => weekdayLabels[(i + weekStartsOn) % 7],\n );\n const columnTone = (column: number) =>\n weekendTones ? weekdayTone((column + weekStartsOn) % 7) : undefined;\n\n return (\n <View testID={testID} className=\"gap-2\">\n <View className=\"flex-row items-center justify-between\">\n <PressableSurface\n testID={testID ? `${testID}-previous` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={previousLabel}\n accessibilityState={{ disabled: prevBlocked }}\n disabled={prevBlocked}\n onPress={() => onMonthChange(shiftMonth(month, -1))}\n dimDisabled={false}\n className={`${NAV} ${prevBlocked ? \"opacity-40\" : \"\"}`}\n >\n <Icon name=\"chevron-back\" className=\"text-[hsl(var(--foreground))]\" />\n </PressableSurface>\n <Text\n testID={titleTestID}\n variant=\"subheading\"\n role=\"heading\"\n aria-live=\"polite\"\n >\n {title}\n </Text>\n <PressableSurface\n testID={testID ? `${testID}-next` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={nextLabel}\n accessibilityState={{ disabled: nextBlocked }}\n disabled={nextBlocked}\n onPress={() => onMonthChange(shiftMonth(month, 1))}\n dimDisabled={false}\n className={`${NAV} ${nextBlocked ? \"opacity-40\" : \"\"}`}\n >\n <Icon\n name=\"chevron-forward\"\n className=\"text-[hsl(var(--foreground))]\"\n />\n </PressableSurface>\n </View>\n <View className=\"flex-row\" aria-hidden>\n {headers.map((name, i) => (\n <Text\n key={i}\n variant=\"footnote\"\n tone={columnTone(i) ?? \"muted\"}\n className=\"flex-1 text-center\"\n >\n {name}\n </Text>\n ))}\n </View>\n {monthGrid(month, weekStartsOn).map((week, w) => (\n <View key={w} className=\"flex-row\">\n {week.map((cell, d) => {\n if (!cell) {\n return <View key={`blank-${d}`} className=\"h-11 flex-1\" />;\n }\n const isSelected = picked.has(cell.date);\n const out =\n (!!minDate && cell.date < minDate) ||\n (!!maxDate && cell.date > maxDate);\n const dots = (marks?.[cell.date] ?? []).slice(0, 3);\n return (\n <PressableSurface\n key={cell.date}\n testID={testID ? `${testID}-${cell.date}` : undefined}\n role=\"button\"\n aria-label={dayLabel(cell.date)}\n aria-pressed={isSelected}\n aria-disabled={out || !onSelectDate}\n disabled={out || !onSelectDate}\n onPress={() => onSelectDate?.(cell.date)}\n feedback=\"none\"\n dimDisabled={false}\n className=\"h-11 flex-1 items-center justify-center\"\n >\n <View\n className={`h-10 w-10 items-center justify-center rounded-full ${\n isSelected\n ? \"bg-[hsl(var(--primary))]\"\n : cell.date === today\n ? \"border border-[hsl(var(--primary))]\"\n : \"\"\n } ${out ? \"opacity-40\" : \"\"}`}\n >\n <Text\n variant=\"small\"\n weight={isSelected ? \"semibold\" : undefined}\n tone={\n isSelected ? \"on-primary\" : (columnTone(d) ?? \"default\")\n }\n >\n {cell.day}\n </Text>\n <View className=\"h-1.5 flex-row gap-0.5\">\n {dots.map((tone, i) => (\n <View\n key={i}\n testID={\n testID\n ? `${testID}-${cell.date}-dot-${tone}`\n : undefined\n }\n className={`h-1.5 w-1.5 rounded-full ${\n isSelected ? DOT_ON_SELECTED[tone] : DOT[tone]\n }`}\n />\n ))}\n </View>\n </View>\n </PressableSurface>\n );\n })}\n </View>\n ))}\n </View>\n );\n}\n","// Internal date math for MonthCalendar on ISO strings, in UTC so the device time zone\n// never shifts a day. \"YYYY-MM\" is a month, \"YYYY-MM-DD\" a date.\n\nconst pad = (n: number) => String(n).padStart(2, \"0\");\n\nexport function parseMonth(month: string): { year: number; month: number } {\n const [y, m] = month.split(\"-\").map(Number);\n return { year: y, month: m - 1 };\n}\n\nexport function formatMonth(year: number, month: number): string {\n const d = new Date(Date.UTC(year, month, 1));\n return `${d.getUTCFullYear()}-${pad(d.getUTCMonth() + 1)}`;\n}\n\n/** The month `delta` months after `month`. */\nexport function shiftMonth(month: string, delta: number): string {\n const { year, month: m } = parseMonth(month);\n return formatMonth(year, m + delta);\n}\n\nexport interface DayCell {\n date: string;\n day: number;\n /** 0 = Sunday ... 6 = Saturday. */\n weekday: number;\n}\n\n/** Weeks of the month as 7 cells each; `null` pads days outside the month. */\nexport function monthGrid(\n month: string,\n weekStartsOn: 0 | 1,\n): (DayCell | null)[][] {\n const { year, month: m } = parseMonth(month);\n const first = new Date(Date.UTC(year, m, 1)).getUTCDay();\n const days = new Date(Date.UTC(year, m + 1, 0)).getUTCDate();\n const lead = (first - weekStartsOn + 7) % 7;\n const cells: (DayCell | null)[] = Array.from({ length: lead }, () => null);\n for (let day = 1; day <= days; day++) {\n cells.push({\n date: `${formatMonth(year, m)}-${pad(day)}`,\n day,\n weekday: (first + day - 1) % 7,\n });\n }\n while (cells.length % 7) cells.push(null);\n const weeks: (DayCell | null)[][] = [];\n for (let i = 0; i < cells.length; i += 7) weeks.push(cells.slice(i, i + 7));\n return weeks;\n}\n","import type { ReactNode } from \"react\";\nimport { View } from \"react-native\";\nimport { useSafeAreaInsetsOnce } from \"../../atoms/safe-area/SafeArea\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\n\n/** One destination: a route or section the rail switches to. Same shape as a TabBar item. */\nexport interface NavigationRailItem {\n /** Stable key passed to `onSelect`, e.g. the route name. */\n key: string;\n /** Visible label under the icon; also the item's accessible name. */\n label: string;\n /** Ionicons name shown while the item is not selected. */\n icon: IconName;\n /** Ionicons name shown while the item is selected. Defaults to `icon`. */\n activeIcon?: IconName;\n testID?: string;\n}\n\n/** An icon button pinned to the bottom of the rail, such as settings or sign out. */\nexport interface NavigationRailFooterAction {\n /** Ionicons name. */\n icon: IconName;\n /** Visible label under the icon; also the button's accessible name. */\n label: string;\n onPress: () => void;\n testID?: string;\n}\n\nexport interface NavigationRailProps {\n items: NavigationRailItem[];\n /** Key of the selected item. */\n activeKey: string;\n /** Called with an item's key when it is pressed. */\n onSelect: (key: string) => void;\n /** Top of the rail, above the items: the app's logo, or a design-system organism. */\n header?: ReactNode;\n /** Button pinned to the bottom of the rail. */\n footerAction?: NavigationRailFooterAction;\n /** Pads the top and bottom safe-area insets. Set false when a parent already pads them. Defaults to true. */\n safeArea?: boolean;\n testID?: string;\n}\n\nconst ITEM =\n \"w-14 items-center gap-1 rounded-[var(--radius-lg)] py-2 active:opacity-80\";\n\n/**\n * Vertical navigation for wide layouts (tablet, web): icon and label items in an 80px\n * column, the selected one on a secondary pill with its icon in primary, an optional\n * header on top and a footer action at the bottom.\n */\nexport function NavigationRail({\n items,\n activeKey,\n onSelect,\n header,\n footerAction,\n safeArea = true,\n testID,\n}: NavigationRailProps) {\n const insets = useSafeAreaInsetsOnce();\n const top = safeArea ? insets.top : 0;\n const bottom = safeArea ? insets.bottom : 0;\n\n return (\n <View\n testID={testID}\n style={{ paddingTop: 16 + top, paddingBottom: 16 + bottom }}\n className=\"w-20 items-center gap-2 border-r border-[hsl(var(--border))] bg-[hsl(var(--background))]\"\n >\n {header ? <View className=\"items-center pb-2\">{header}</View> : null}\n <View\n accessibilityRole=\"tablist\"\n aria-orientation=\"vertical\"\n className=\"flex-1 items-center gap-2\"\n >\n {items.map((item) => {\n const selected = item.key === activeKey;\n // Icon in primary; the label stays foreground, because primary text on the\n // background is under 4.5:1 (D27).\n return (\n <PressableSurface\n key={item.key}\n testID={item.testID}\n accessibilityRole=\"tab\"\n accessibilityLabel={item.label}\n accessibilityState={{ selected }}\n onPress={() => onSelect(item.key)}\n feedback=\"none\"\n className={`${ITEM} ${selected ? \"bg-[hsl(var(--secondary))]\" : \"\"}`}\n >\n <Icon\n name={selected ? (item.activeIcon ?? item.icon) : item.icon}\n size={22}\n className={\n selected\n ? \"text-[hsl(var(--primary))]\"\n : \"text-[hsl(var(--muted-foreground))]\"\n }\n />\n <Text\n numberOfLines={1}\n variant=\"micro\"\n tone={selected ? \"on-secondary\" : \"muted\"}\n className=\"text-center\"\n >\n {item.label}\n </Text>\n </PressableSurface>\n );\n })}\n </View>\n {footerAction ? (\n <PressableSurface\n testID={footerAction.testID}\n accessibilityRole=\"button\"\n accessibilityLabel={footerAction.label}\n onPress={footerAction.onPress}\n feedback=\"none\"\n className={ITEM}\n >\n <Icon\n name={footerAction.icon}\n size={22}\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n <Text\n numberOfLines={1}\n variant=\"micro\"\n tone=\"muted\"\n className=\"text-center\"\n >\n {footerAction.label}\n </Text>\n </PressableSurface>\n ) : null}\n </View>\n );\n}\n","import { useEffect, useState } from \"react\";\nimport { Animated, Easing, Platform, View } from \"react-native\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport type OrbState =\n | \"off\"\n | \"listening\"\n | \"waiting\"\n | \"speaking\"\n | \"muted\"\n | \"error\";\n\nexport interface OrbProps {\n /** Voice state; sets the pulse speed, size and opacity. */\n state: OrbState;\n /** Tap on the orb, e.g. to start, interrupt or retry. */\n onPress: () => void;\n /** Accessible name of the orb for the current state, e.g. \"Stop and listen\". */\n accessibilityLabel: string;\n /** Status line under the orb, e.g. \"Listening\". */\n label?: string;\n testID?: string;\n}\n\ninterface Pulse {\n /** Peak scale; 1 means the orb stays still. */\n scale: number;\n /** One half-cycle in ms. */\n duration: number;\n opacity: number;\n}\n\nconst STILL: Pulse = { scale: 1, duration: 800, opacity: 0.35 };\n\nconst PULSES: Record<OrbState, Pulse> = {\n off: STILL,\n muted: STILL,\n error: STILL,\n listening: { scale: 1.1, duration: 900, opacity: 0.95 },\n waiting: { scale: 1.08, duration: 1100, opacity: 0.85 },\n speaking: { scale: 1.2, duration: 380, opacity: 1 },\n};\n\n/** Animated voice orb whose pulse shows what a voice session is doing, with an optional status line. */\nexport function Orb({\n state,\n onPress,\n accessibilityLabel,\n label,\n testID,\n}: OrbProps) {\n const [scale] = useState(() => new Animated.Value(1));\n const pulse = PULSES[state];\n\n useEffect(() => {\n scale.setValue(1);\n if (pulse.scale === 1) return;\n const useNativeDriver = Platform.OS !== \"web\";\n const step = (toValue: number) =>\n Animated.timing(scale, {\n toValue,\n duration: pulse.duration,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver,\n });\n const loop = Animated.loop(Animated.sequence([step(pulse.scale), step(1)]));\n loop.start();\n return () => loop.stop();\n }, [scale, pulse.scale, pulse.duration]);\n\n return (\n <View testID={testID} className=\"items-center gap-6\">\n <PressableSurface\n testID={testID ? `${testID}-orb` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n onPress={onPress}\n feedback=\"none\"\n className=\"h-[236px] w-[236px] items-center justify-center\"\n >\n <Animated.View\n testID={testID ? `${testID}-circle` : undefined}\n style={{ opacity: pulse.opacity, transform: [{ scale }] }}\n >\n <View\n className={`h-[168px] w-[168px] rounded-full ${\n state === \"error\"\n ? \"bg-[hsl(var(--destructive))]\"\n : \"bg-[hsl(var(--primary))]\"\n }`}\n />\n </Animated.View>\n </PressableSurface>\n {label ? (\n <Text accessibilityLiveRegion=\"polite\" variant=\"title\">\n {label}\n </Text>\n ) : null}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Avatar } from \"../../atoms/avatar/Avatar\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport interface ProfileHeaderAction {\n label: string;\n onPress: () => void;\n disabled?: boolean;\n testID?: string;\n}\n\nexport interface ProfileHeaderProps {\n /** Display name: the title, and the source of the avatar initials. */\n name: string;\n /** Line under the name, e.g. an email address. */\n subtitle?: string;\n /** Outlined button under the profile, e.g. \"Edit name\". */\n action?: ProfileHeaderAction;\n /** testID of the name text. */\n nameTestID?: string;\n /** testID of the subtitle text. */\n subtitleTestID?: string;\n testID?: string;\n}\n\n/** Avatar with initials, a name, an optional subtitle and an optional outlined action. */\nexport function ProfileHeader({\n name,\n subtitle,\n action,\n nameTestID,\n subtitleTestID,\n testID,\n}: ProfileHeaderProps) {\n return (\n <View testID={testID} className=\"gap-4\">\n <View className=\"flex-row items-center gap-4\">\n <Avatar name={name} size=\"lg\" />\n <View className=\"flex-1 gap-0.5\">\n <Text testID={nameTestID} variant=\"subheading\">\n {name}\n </Text>\n {subtitle ? (\n <Text testID={subtitleTestID} variant=\"small\" tone=\"muted\">\n {subtitle}\n </Text>\n ) : null}\n </View>\n </View>\n {action ? (\n <Button\n testID={action.testID}\n label={action.label}\n onPress={action.onPress}\n disabled={action.disabled}\n variant=\"outline\"\n size=\"md\"\n layout=\"hug\"\n />\n ) : null}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Ring } from \"../../atoms/ring/Ring\";\nimport { Text, type TextVariant } from \"../../atoms/text/Text\";\nimport { progressShare } from \"../progress-bar/progressShare\";\n\n/** Arc color: `default` is primary, `destructive` flags a value near a limit. */\nexport type ProgressRingTone = \"default\" | \"destructive\";\n\n/** `sm`: 56px ring; `md`: 88px ring. */\nexport type ProgressRingSize = \"sm\" | \"md\";\n\nexport interface ProgressRingProps {\n /** Share done, from 0 to 1. Values outside the range are clamped. */\n value: number;\n /** Muted text under the ring; also the progress bar's accessible name. */\n label: string;\n /** Text in the middle instead of the percentage, e.g. \"3/10\". */\n valueLabel?: string;\n tone?: ProgressRingTone;\n size?: ProgressRingSize;\n testID?: string;\n}\n\nconst SIZE: Record<\n ProgressRingSize,\n { box: number; stroke: number; text: TextVariant }\n> = {\n sm: { box: 56, stroke: 6, text: \"label\" },\n md: { box: 88, stroke: 8, text: \"heading\" },\n};\n\n/**\n * Circular progress: a track with an arc from 12 o'clock, the percentage (or a value\n * label) in the middle and a muted label under it. Drawn with Views, no SVG dependency.\n * Announced as a progress bar named by the label.\n */\nexport function ProgressRing({\n value,\n label,\n valueLabel,\n tone = \"default\",\n size = \"md\",\n testID,\n}: ProgressRingProps) {\n const { share, percent } = progressShare(value);\n const { box, stroke, text } = SIZE[size];\n return (\n <View\n testID={testID}\n accessible\n accessibilityRole=\"progressbar\"\n accessibilityLabel={label}\n accessibilityValue={{ min: 0, max: 100, now: percent, text: valueLabel }}\n className=\"items-center gap-2\"\n >\n <Ring\n share={share}\n size={box}\n stroke={stroke}\n tone={tone}\n testID={testID}\n >\n <Text variant={text} weight=\"semibold\">\n {valueLabel ?? `${percent}%`}\n </Text>\n </Ring>\n <Text variant=\"footnote\" tone=\"muted\">\n {label}\n </Text>\n </View>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { View } from \"react-native\";\n\n/** Arc color: `default` is primary, `destructive` flags a value near a limit. */\nexport type RingTone = \"default\" | \"destructive\";\n\nexport interface RingProps {\n /** Share drawn, from 0 to 1 (already clamped by the caller). */\n share: number;\n /** Outer diameter in px. */\n size: number;\n /** Track and arc width in px. */\n stroke: number;\n /** Defaults to `default`. */\n tone?: RingTone;\n /** Centered inside the ring, e.g. the percentage. */\n children?: ReactNode;\n /** Prefix of the `-right` and `-left` arc half test IDs. */\n testID?: string;\n}\n\n// A circle whose top and right borders are colored covers half the ring; rotating it by\n// 45° shows the right half, by -135° the left half. Two clipped halves draw any arc.\nconst HALF: Record<RingTone, string> = {\n default:\n \"border-t-[hsl(var(--primary))] border-r-[hsl(var(--primary))] border-b-transparent border-l-transparent\",\n destructive:\n \"border-t-[hsl(var(--destructive))] border-r-[hsl(var(--destructive))] border-b-transparent border-l-transparent\",\n};\n\n/**\n * Internal atom: a circular track with an arc from 12 o'clock, drawn with Views (no SVG\n * dependency). Purely visual: the caller announces the value. Shared by ProgressRing and\n * StatTile.\n */\nexport function Ring({\n share,\n size,\n stroke,\n tone = \"default\",\n children,\n testID,\n}: RingProps) {\n const circle = {\n position: \"absolute\" as const,\n top: 0,\n width: size,\n height: size,\n borderRadius: size / 2,\n borderWidth: stroke,\n };\n const half = {\n position: \"absolute\" as const,\n top: 0,\n width: size / 2,\n height: size,\n };\n const rightDeg = share <= 0.5 ? -135 + share * 360 : 45;\n\n return (\n <View\n style={{ width: size, height: size }}\n className=\"items-center justify-center\"\n >\n <View\n style={{ ...circle, left: 0 }}\n className=\"border-[hsl(var(--secondary))]\"\n />\n {share > 0 ? (\n <View\n testID={testID ? `${testID}-right` : undefined}\n style={{ ...half, left: size / 2, overflow: \"hidden\" }}\n >\n <View\n style={{\n ...circle,\n left: -size / 2,\n transform: [{ rotate: `${rightDeg}deg` }],\n }}\n className={HALF[tone]}\n />\n </View>\n ) : null}\n {share > 0.5 ? (\n <View\n testID={testID ? `${testID}-left` : undefined}\n style={{ ...half, left: 0, overflow: \"hidden\" }}\n >\n <View\n style={{\n ...circle,\n left: 0,\n transform: [{ rotate: `${45 + (share - 0.5) * 360}deg` }],\n }}\n className={HALF[tone]}\n />\n </View>\n ) : null}\n {children}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Avatar } from \"../../atoms/avatar/Avatar\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { StarCount } from \"../../atoms/star-count/StarCount\";\nimport { Text } from \"../../atoms/text/Text\";\n\n/** One tier count under the name: `stars` gold stars and how many items reached that tier. */\nexport interface RankedRowTier {\n /** Number of gold stars drawn, e.g. 3. */\n stars: number;\n /** How many items have that tier, shown after the stars. */\n count: number;\n /** Spoken text, e.g. \"Three stars: 2\". Defaults to \"<stars> stars: <count>\". */\n accessibilityLabel?: string;\n}\n\nexport interface RankedRowProps {\n /** Position in the ranking, e.g. 1. */\n rank: number;\n /** Display name; also the source of the avatar initials. */\n name: string;\n /** Muted line under the name, e.g. a level or a streak. */\n subtitle?: string;\n /** Score on the right, already formatted by the app, e.g. \"1,250\". */\n score: string;\n /** Avatar image; without it the avatar shows the name's initials. */\n avatarUri?: string;\n /** Marks the current user's row with a card fill and a primary border. */\n highlighted?: boolean;\n /** Small label after the name, e.g. \"You\". */\n badge?: string;\n /** Makes the row a button, e.g. to open the person's profile. */\n onPress?: () => void;\n testID?: string;\n /** Draws ranks 1, 2 and 3 on a gold, silver or bronze disc; other ranks stay plain. */\n medal?: boolean;\n /** Ionicons name drawn gold before the score, e.g. \"star\". */\n scoreIcon?: IconName;\n /** Muted line under the score, e.g. \"12 entries\". */\n scoreCaption?: string;\n /** Tier counts drawn as gold stars and a number, under the name (after the subtitle). */\n tiers?: RankedRowTier[];\n}\n\nconst MEDAL: Record<number, string> = {\n 1: \"bg-[hsl(var(--gold))]\",\n 2: \"bg-[hsl(var(--silver))]\",\n 3: \"bg-[hsl(var(--bronze))]\",\n};\n\n/**\n * Ranked row: rank, avatar (image or initials), name with an optional badge, subtitle and\n * a score. The current user's row can be highlighted.\n */\nexport function RankedRow({\n rank,\n name,\n subtitle,\n score,\n avatarUri,\n highlighted = false,\n badge,\n onPress,\n testID,\n medal = false,\n scoreIcon,\n scoreCaption,\n tiers,\n}: RankedRowProps) {\n const disc = medal ? MEDAL[rank] : undefined;\n const body = (\n <>\n {disc ? (\n <View\n className={`h-7 w-7 items-center justify-center rounded-full ${disc}`}\n >\n <Text variant=\"label\" weight=\"semibold\" tone=\"on-medal\">\n {rank}\n </Text>\n </View>\n ) : (\n // Medal rows keep the disc's width so names line up down the ranking.\n <Text\n variant=\"label\"\n weight=\"semibold\"\n className={`${medal ? \"w-7\" : \"w-6\"} text-center`}\n >\n {rank}\n </Text>\n )}\n <Avatar name={name} uri={avatarUri} />\n <View className=\"min-w-0 flex-1 gap-0.5\">\n <View className=\"flex-row items-center gap-1.5\">\n <Text numberOfLines={1} variant=\"label\" className=\"shrink\">\n {name}\n </Text>\n {badge ? (\n <View className=\"overflow-hidden rounded-full bg-[hsl(var(--foreground))] px-1.5\">\n <Text variant=\"micro\" weight=\"regular\" tone=\"inverse\">\n {badge}\n </Text>\n </View>\n ) : null}\n </View>\n {subtitle ? (\n <Text numberOfLines={1} variant=\"footnote\" tone=\"muted\">\n {subtitle}\n </Text>\n ) : null}\n {tiers && tiers.length > 0 ? (\n <View className=\"flex-row flex-wrap items-center gap-x-2.5 gap-y-0.5\">\n {tiers.map((tier) => (\n <View\n key={tier.stars}\n accessible\n accessibilityLabel={\n tier.accessibilityLabel ??\n `${tier.stars} stars: ${tier.count}`\n }\n className=\"flex-row items-center gap-0.5\"\n >\n <StarCount count={tier.stars} size=\"sm\" />\n <Text variant=\"footnote\" tone=\"muted\">\n {tier.count}\n </Text>\n </View>\n ))}\n </View>\n ) : null}\n </View>\n <View className=\"items-end gap-0.5\">\n <View className=\"flex-row items-center gap-1\">\n {scoreIcon ? (\n <Icon\n name={scoreIcon}\n size={16}\n className=\"text-[hsl(var(--gold))]\"\n />\n ) : null}\n <Text variant=\"label\" weight=\"semibold\">\n {score}\n </Text>\n </View>\n {scoreCaption ? (\n <Text numberOfLines={1} variant=\"footnote\" tone=\"muted\">\n {scoreCaption}\n </Text>\n ) : null}\n </View>\n </>\n );\n const row = `min-h-[56px] flex-row items-center gap-3 rounded-[var(--radius-lg)] border px-3 py-2 ${\n highlighted\n ? \"border-[hsl(var(--primary))] bg-[hsl(var(--card))]\"\n : \"border-transparent\"\n }`;\n\n if (!onPress) {\n return (\n <View testID={testID} className={row}>\n {body}\n </View>\n );\n }\n // The name comes from the visible text, so it matches what is shown (D45).\n return (\n <PressableSurface\n testID={testID}\n accessibilityRole=\"button\"\n onPress={onPress}\n feedback=\"fade\"\n className={row}\n >\n {body}\n </PressableSurface>\n );\n}\n","import { useEffect, useState } from \"react\";\nimport { Animated, Platform, View } from \"react-native\";\nimport { Icon } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport interface ScrollToBottomFabProps {\n /** Shows the button; it renders nothing while false. */\n visible: boolean;\n /** Unread count shown as a badge when above 0; capped at \"99+\". */\n count?: number;\n onPress: () => void;\n /** Accessible name of the button; the badge count is appended, e.g. \"Scroll to latest (3)\". Defaults to \"Scroll to latest\". */\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** Round button, absolute at the bottom center of its parent, that jumps a list to the newest item. */\nexport function ScrollToBottomFab({\n visible,\n count = 0,\n onPress,\n accessibilityLabel = \"Scroll to latest\",\n testID,\n}: ScrollToBottomFabProps) {\n const [opacity] = useState(() => new Animated.Value(0));\n\n useEffect(() => {\n Animated.timing(opacity, {\n toValue: visible ? 1 : 0,\n duration: 200,\n useNativeDriver: Platform.OS !== \"web\",\n }).start();\n }, [visible, opacity]);\n\n if (!visible) return null;\n\n const badge = count > 99 ? \"99+\" : String(count);\n // The visible badge must be part of the accessible name (axe label-content-name-mismatch).\n const label =\n count > 0 ? `${accessibilityLabel} (${badge})` : accessibilityLabel;\n\n return (\n <Animated.View\n style={{\n opacity,\n position: \"absolute\",\n bottom: 12,\n left: 0,\n right: 0,\n alignItems: \"center\",\n }}\n pointerEvents=\"box-none\"\n >\n <View className=\"relative\">\n <PressableSurface\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n onPress={onPress}\n feedback=\"none\"\n className=\"h-9 w-9 items-center justify-center rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--background))]\"\n >\n <Icon\n name=\"chevron-down\"\n size={18}\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n </PressableSurface>\n {/* Outside the button so its digits do not merge with the icon glyph in the\n button's visible text (axe label-content-name-mismatch); the count is in the label. */}\n {count > 0 ? (\n <View\n aria-hidden\n pointerEvents=\"none\"\n className=\"absolute -right-1 -top-1 min-w-[18px] items-center rounded-full bg-[hsl(var(--primary))] px-1 py-0.5\"\n >\n <Text variant=\"badge\" tone=\"on-primary\">\n {badge}\n </Text>\n </View>\n ) : null}\n </View>\n </Animated.View>\n );\n}\n","import { useEffect, useRef, useState } from \"react\";\nimport { Platform, View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { IconButton } from \"../../atoms/icon-button/IconButton\";\nimport { Input } from \"../../atoms/input/Input\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Surface } from \"../../atoms/surface/Surface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { ListItem } from \"../../molecules/list-item/ListItem\";\n\n/** An icon button right of the input, such as a filter toggle. */\nexport interface SearchBarFilterAction {\n /** Ionicons name, e.g. \"options-outline\". */\n icon: IconName;\n /** Accessible name of the button. */\n label: string;\n onPress: () => void;\n /** Fills the button with primary, e.g. while filters are shown or applied. Announced as expanded. */\n active?: boolean;\n testID?: string;\n /** Shows a count badge on the button, e.g. the number of applied filters; 0 or unset hides it. */\n count?: number;\n}\n\n/** One result row in the list under the input. */\nexport interface SearchBarSuggestion {\n label: string;\n /** Muted second line, e.g. where the item is. */\n subtitle?: string;\n /** Ionicons name shown before the label. */\n icon?: IconName;\n onPress: () => void;\n testID?: string;\n}\n\nexport interface SearchBarProps {\n /** Current query; the search bar is controlled. */\n value: string;\n onChangeText: (text: string) => void;\n /** Placeholder, also the input's accessible name. */\n placeholder: string;\n /** Called with the current text when the keyboard's search key (or Enter on web) is pressed. */\n onSubmit?: (text: string) => void;\n /** Accessible name of the clear button. Defaults to \"Clear search\". */\n clearLabel?: string;\n /** Optional icon button right of the input. */\n filterAction?: SearchBarFilterAction;\n /** Maximum number of characters the input accepts. */\n maxLength?: number;\n /** Focuses the input on mount. */\n autoFocus?: boolean;\n inputTestID?: string;\n testID?: string;\n /** Result rows in a card under the input, e.g. matches while typing; hidden while empty. */\n suggestions?: SearchBarSuggestion[];\n /** Accessible name of the suggestion list. Defaults to \"Suggestions\". */\n suggestionsLabel?: string;\n}\n\nconst BOX =\n \"h-10 rounded-[var(--radius-lg)] border bg-[hsl(var(--background))]\";\n\n/**\n * Search input with a leading search icon, a clear button while it has text, an optional\n * filter button with a count badge and an optional list of suggestions under it.\n */\nexport function SearchBar({\n value,\n onChangeText,\n placeholder,\n onSubmit,\n clearLabel = \"Clear search\",\n filterAction,\n maxLength,\n autoFocus,\n inputTestID,\n testID,\n suggestions,\n suggestionsLabel = \"Suggestions\",\n}: SearchBarProps) {\n const [focused, setFocused] = useState(false);\n const active = filterAction?.active ?? false;\n const count = filterAction?.count ?? 0;\n const bar = (\n <View\n testID={suggestions ? undefined : testID}\n className=\"flex-row items-center gap-2\"\n >\n <View\n className={`${BOX} flex-1 flex-row items-center gap-2 pl-3 ${\n // The frame, not the input, shows focus: a ring-colored 2px outline.\n focused\n ? \"border-[hsl(var(--ring))] web:outline web:outline-1 web:outline-[hsl(var(--ring))]\"\n : \"border-[hsl(var(--input))]\"\n }`}\n >\n <Icon\n name=\"search\"\n size={18}\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n <Input\n variant=\"bare\"\n editable\n testID={inputTestID}\n value={value}\n onChangeText={onChangeText}\n placeholder={placeholder}\n accessibilityLabel={placeholder}\n maxLength={maxLength}\n autoFocus={autoFocus}\n returnKeyType=\"search\"\n autoCorrect={false}\n autoCapitalize=\"none\"\n onSubmitEditing={() => onSubmit?.(value)}\n onFocusChange={setFocused}\n />\n {value.length > 0 ? (\n <PressableSurface\n accessibilityRole=\"button\"\n accessibilityLabel={clearLabel}\n onPress={() => onChangeText(\"\")}\n hitSlop={8}\n feedback=\"none\"\n className=\"h-full items-center justify-center px-3\"\n >\n <Icon\n name=\"close-circle\"\n size={18}\n className=\"text-[hsl(var(--muted-foreground))]\"\n />\n </PressableSurface>\n ) : (\n <View className=\"w-3\" />\n )}\n </View>\n {filterAction ? (\n <View>\n <IconButton\n variant=\"outline\"\n active={active}\n testID={filterAction.testID}\n icon={filterAction.icon}\n accessibilityLabel={\n count > 0 ? `${filterAction.label}, ${count}` : filterAction.label\n }\n expanded={active}\n onPress={filterAction.onPress}\n />\n {count > 0 ? (\n <View\n aria-hidden\n pointerEvents=\"none\"\n className=\"absolute -right-1.5 -top-1.5 h-5 min-w-5 items-center justify-center rounded-full border-2 border-[hsl(var(--background))] bg-[hsl(var(--primary))] px-1\"\n >\n <Text variant=\"badge\" tone=\"on-primary\">\n {String(count)}\n </Text>\n </View>\n ) : null}\n </View>\n ) : null}\n </View>\n );\n if (!suggestions) return bar;\n return (\n <View testID={testID} className=\"gap-2\">\n {bar}\n {suggestions.length > 0 ? (\n <Surface\n role=\"list\"\n aria-label={suggestionsLabel}\n className=\"overflow-hidden py-1\"\n >\n {suggestions.map((item, index) => (\n <SuggestionRow key={`${index}-${item.label}`} item={item} />\n ))}\n </Surface>\n ) : null}\n </View>\n );\n}\n\n/**\n * One suggestion. On web, React Native's press handling drops the tap that follows typing\n * when an app-owned engine under the overlay (e.g. a map) takes pointer events, yet the DOM\n * click still arrives; a native click listener calls `onPress` then, once per click.\n */\nfunction SuggestionRow({ item }: { item: SearchBarSuggestion }) {\n const ref = useRef<View>(null);\n const handled = useRef<Event | null>(null);\n const onPress = useRef(item.onPress);\n onPress.current = item.onPress;\n useEffect(() => {\n const node = ref.current as unknown as HTMLElement | null;\n if (Platform.OS !== \"web\" || !node?.addEventListener) return;\n const onClick = (event: Event) => {\n handled.current = event;\n onPress.current();\n };\n node.addEventListener(\"click\", onClick);\n return () => node.removeEventListener(\"click\", onClick);\n }, []);\n return (\n // The list item holds the listener: the click bubbles to it before React sees it.\n <View ref={ref} role=\"listitem\">\n <PressableSurface\n testID={item.testID}\n accessibilityRole=\"button\"\n onPress={(event) => {\n // The native listener already ran for this click.\n const native = (event as { nativeEvent?: unknown } | undefined)\n ?.nativeEvent;\n if (handled.current && native === handled.current) return;\n item.onPress();\n }}\n className=\"min-h-11 flex-row items-center px-3 py-2\"\n >\n <ListItem\n label={item.label}\n subtitle={item.subtitle}\n icon={item.icon}\n layout=\"fill\"\n />\n </PressableSurface>\n </View>\n );\n}\n","import { useState } from \"react\";\nimport { ScrollView, View } from \"react-native\";\nimport { Icon } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Spinner } from \"../../atoms/spinner/Spinner\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { OPTION_ROW, OptionList } from \"../../molecules/option-list/OptionList\";\nimport { Sheet } from \"../../molecules/sheet/Sheet\";\nimport { SelectTrigger } from \"../../molecules/select-trigger/SelectTrigger\";\nimport { SearchBar } from \"../search-bar/SearchBar\";\nimport type { SelectOption } from \"../select/Select\";\n\n/** An option of a SearchSelect; same shape as a Select option. */\nexport type SearchSelectOption<T extends string = string> = SelectOption<T>;\n\n/** The \"create new\" row shown while the query matches no option exactly. */\nexport interface SearchSelectCreate {\n /** Row label for the typed query, e.g. (q) => `Add \"${q}\"`. */\n label: (query: string) => string;\n /** Called with the trimmed query; the sheet closes. The app creates the item and sets `value`. */\n onCreate: (query: string) => void;\n testID?: string;\n}\n\nexport interface SearchSelectProps<T extends string = string> {\n options: SearchSelectOption<T>[];\n /** Value of the chosen option; `null` or unset shows the placeholder. */\n value?: T | null;\n onChange: (value: T) => void;\n /**\n * Label of the chosen option when it is not in `options`, e.g. after an async search\n * replaced the list. Defaults to the matching option's label.\n */\n valueLabel?: string;\n /** Shown muted in the field while nothing is chosen. */\n placeholder: string;\n /** Placeholder of the search input, also its accessible name. */\n searchPlaceholder: string;\n /** Visible label above the field; also the sheet's heading. */\n label?: string;\n /** Sheet heading when it should differ from `label`. Defaults to `label`, then `placeholder`. */\n sheetTitle?: string;\n /**\n * Called as the query changes. When set, the app owns filtering (e.g. an async search)\n * and passes the results as `options`; otherwise options are filtered by label here.\n */\n onQueryChange?: (query: string) => void;\n /** Shows a spinner instead of the list, e.g. while the app's search runs. */\n loading?: boolean;\n /** Accessible name of the spinner. Defaults to \"Loading\". */\n loadingLabel?: string;\n /** Shown when no option matches. */\n emptyMessage?: string;\n /** Optional \"create new\" row for a query with no exact match. */\n create?: SearchSelectCreate;\n /** Accessible name of the sheet's close button. Defaults to \"Close\". */\n closeLabel?: string;\n /** Inline error under the field; also outlines it in destructive. */\n error?: string | null;\n disabled?: boolean;\n testID?: string;\n}\n\n/**\n * Select with a search input: the sheet filters options as the user types, can offer a\n * \"create new\" row for the query and shows a loading state for app-driven async search.\n */\nexport function SearchSelect<T extends string = string>({\n options,\n value,\n onChange,\n valueLabel,\n placeholder,\n searchPlaceholder,\n label,\n sheetTitle,\n onQueryChange,\n loading = false,\n loadingLabel = \"Loading\",\n emptyMessage,\n create,\n closeLabel = \"Close\",\n error,\n disabled = false,\n testID,\n}: SearchSelectProps<T>) {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n const title = sheetTitle ?? label ?? placeholder;\n const trimmed = query.trim();\n const needle = trimmed.toLowerCase();\n\n const shown = onQueryChange\n ? options\n : options.filter((o) => o.label.toLowerCase().includes(needle));\n const exact = options.some((o) => o.label.toLowerCase() === needle);\n const showCreate = !!create && trimmed.length > 0 && !exact && !loading;\n\n const changeQuery = (next: string) => {\n setQuery(next);\n onQueryChange?.(next);\n };\n const close = () => {\n setOpen(false);\n changeQuery(\"\");\n };\n\n return (\n <>\n <SelectTrigger\n testID={testID}\n valueLabel={valueLabel ?? options.find((o) => o.value === value)?.label}\n placeholder={placeholder}\n label={label}\n error={error}\n disabled={disabled}\n onPress={() => setOpen(true)}\n />\n <Sheet\n open={open}\n title={title}\n closeLabel={closeLabel}\n onClose={close}\n testID={testID ? `${testID}-sheet` : undefined}\n >\n <View className=\"px-5 pb-2\">\n <SearchBar\n value={query}\n onChangeText={changeQuery}\n placeholder={searchPlaceholder}\n inputTestID={testID ? `${testID}-search` : undefined}\n />\n </View>\n <ScrollView keyboardShouldPersistTaps=\"handled\">\n {loading ? (\n <View className=\"items-center py-6\">\n <Spinner label={loadingLabel} />\n </View>\n ) : (\n <OptionList\n options={shown}\n value={value}\n accessibilityLabel={title}\n testID={testID ? `${testID}-option` : undefined}\n onSelect={(next) => {\n onChange(next as T);\n close();\n }}\n />\n )}\n {showCreate ? (\n <PressableSurface\n testID={create.testID}\n accessibilityRole=\"button\"\n onPress={() => {\n create.onCreate(trimmed);\n close();\n }}\n className={OPTION_ROW}\n >\n <Icon name=\"add\" className=\"text-[hsl(var(--foreground))]\" />\n <Text weight=\"medium\" className=\"flex-1\">\n {create.label(trimmed)}\n </Text>\n </PressableSurface>\n ) : null}\n {!loading && shown.length === 0 && !showCreate && emptyMessage ? (\n <Text\n variant=\"small\"\n tone=\"muted\"\n className=\"px-5 py-6 text-center\"\n >\n {emptyMessage}\n </Text>\n ) : null}\n </ScrollView>\n </Sheet>\n </>\n );\n}\n","import { View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { ListItem } from \"../list-item/ListItem\";\n\nexport interface OptionItem {\n value: string;\n label: string;\n description?: string;\n icon?: IconName;\n}\n\nexport interface OptionListProps {\n options: OptionItem[];\n /** Value of the checked option, if any. */\n value?: string | null;\n onSelect: (value: string) => void;\n /** Accessible name of the radio group. */\n accessibilityLabel: string;\n testID?: string;\n}\n\n/** The 48px pressable row an option list draws; also used for extra rows such as \"create\". */\nexport const OPTION_ROW = \"min-h-12 flex-row items-center gap-3 px-5 py-2\";\n\n/** Internal molecule: a radio group of option rows with an optional icon, a description and a check. */\nexport function OptionList({\n options,\n value,\n onSelect,\n accessibilityLabel,\n testID,\n}: OptionListProps) {\n return (\n <View role=\"radiogroup\" aria-label={accessibilityLabel}>\n {options.map((option) => {\n const checked = option.value === value;\n return (\n <PressableSurface\n key={option.value}\n testID={testID ? `${testID}-${option.value}` : undefined}\n role=\"radio\"\n aria-checked={checked}\n onPress={() => onSelect(option.value)}\n className={OPTION_ROW}\n >\n <ListItem\n label={option.label}\n subtitle={option.description}\n icon={option.icon}\n density=\"comfortable\"\n layout=\"fill\"\n />\n {checked ? (\n <Icon name=\"checkmark\" className=\"text-[hsl(var(--primary))]\" />\n ) : null}\n </PressableSurface>\n );\n })}\n </View>\n );\n}\n","import type { ReactElement, ReactNode } from \"react\";\nimport { SectionList, View } from \"react-native\";\nimport { Divider } from \"../../atoms/divider/Divider\";\nimport { Spinner } from \"../../atoms/spinner/Spinner\";\nimport { Text } from \"../../atoms/text/Text\";\n\n/** One group of rows under a sticky heading. */\nexport interface SectionedListSection<T> {\n /** Stable key of the section, e.g. \"2026-11\". */\n key: string;\n /** Sticky heading; omit for a flat list with one untitled section. */\n title?: string;\n data: readonly T[];\n /** testID of the section heading, e.g. \"month-2026-11\". */\n testID?: string;\n}\n\n/** What `renderItem` receives for each row. */\nexport interface SectionedListItemInfo<T> {\n item: T;\n /** Index of the row inside its section. */\n index: number;\n section: SectionedListSection<T>;\n}\n\nexport interface SectionedListProps<T> {\n sections: readonly SectionedListSection<T>[];\n keyExtractor: (item: T, index: number) => string;\n /** Renders one row, usually a ListRow. */\n renderItem: (info: SectionedListItemInfo<T>) => ReactElement | null;\n /** Called near the end of the list, e.g. to load the next page. */\n onEndReached?: () => void;\n /** Shows a spinner after the last row while the next page loads. */\n loadingMore?: boolean;\n /** Accessible name of the loading spinner. Defaults to \"Loading more\". */\n loadingMoreLabel?: string;\n /** Scrolls above the first section, e.g. a SummaryCard. */\n header?: ReactNode;\n /** Shown under the header while every section is empty, usually an EmptyState. */\n empty?: ReactNode;\n testID?: string;\n /** Draws a hairline between rows inside a section. */\n separators?: boolean;\n}\n\n/**\n * Virtualized list of sections with sticky muted headings, an optional header above them,\n * an empty state and a loading-more spinner; it scrolls itself, so use it with\n * `ListTemplate scroll={false}`.\n */\nexport function SectionedList<T>({\n sections,\n keyExtractor,\n renderItem,\n onEndReached,\n loadingMore = false,\n loadingMoreLabel = \"Loading more\",\n header,\n empty,\n testID,\n separators = false,\n}: SectionedListProps<T>) {\n const isEmpty = sections.every((section) => section.data.length === 0);\n return (\n <SectionList<T, SectionedListSection<T>>\n testID={testID}\n style={{ flex: 1 }}\n sections={isEmpty ? [] : (sections as SectionedListSection<T>[])}\n keyExtractor={keyExtractor}\n renderItem={({ item, index, section }) =>\n renderItem({ item, index, section })\n }\n renderSectionHeader={({ section }) =>\n section.title ? (\n <View className=\"bg-[hsl(var(--background))] pb-1 pt-4\">\n <Text\n testID={section.testID}\n accessibilityRole=\"header\"\n variant=\"small\"\n weight=\"semibold\"\n tone=\"muted\"\n >\n {section.title}\n </Text>\n </View>\n ) : null\n }\n ItemSeparatorComponent={separators ? Separator : undefined}\n stickySectionHeadersEnabled\n onEndReached={onEndReached}\n onEndReachedThreshold={0.5}\n contentContainerStyle={{\n paddingHorizontal: 16,\n paddingTop: 16,\n paddingBottom: 24,\n }}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode=\"on-drag\"\n ListHeaderComponent={\n header ? <View className=\"pb-2\">{header}</View> : null\n }\n ListEmptyComponent={empty ? <View className=\"pt-4\">{empty}</View> : null}\n ListFooterComponent={\n loadingMore ? (\n <View className=\"items-center py-4\">\n <Spinner label={loadingMoreLabel} />\n </View>\n ) : null\n }\n />\n );\n}\n\n/** Hairline between two rows of a section. */\nfunction Separator() {\n return <Divider />;\n}\n","import { View } from \"react-native\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport interface SegmentedControlOption<T extends string = string> {\n value: T;\n label: string;\n}\n\nexport interface SegmentedControlProps<T extends string = string> {\n /** 2 to 4 mutually exclusive options. */\n options: SegmentedControlOption<T>[];\n /** Value of the selected option. */\n value: T;\n onChange: (value: T) => void;\n /** Accessible name of the group, e.g. \"Theme\". */\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** 2-4 exclusive options in one outlined row; the selected option fills with primary. */\nexport function SegmentedControl<T extends string = string>({\n options,\n value,\n onChange,\n accessibilityLabel,\n testID,\n}: SegmentedControlProps<T>) {\n return (\n <View\n testID={testID}\n role=\"radiogroup\"\n aria-label={accessibilityLabel}\n className=\"flex-row overflow-hidden rounded-[var(--radius-lg)] border border-[hsl(var(--border))]\"\n >\n {options.map((option) => {\n const selected = option.value === value;\n return (\n <PressableSurface\n key={option.value}\n testID={testID ? `${testID}-${option.value}` : undefined}\n role=\"radio\"\n aria-checked={selected}\n aria-label={option.label}\n onPress={() => onChange(option.value)}\n feedback={selected ? \"none\" : \"fill\"}\n className={`flex-1 items-center justify-center py-2.5 ${\n selected\n ? \"bg-[hsl(var(--primary))]\"\n : \"bg-[hsl(var(--background))]\"\n }`}\n >\n <Text variant=\"label\" tone={selected ? \"on-primary\" : \"default\"}>\n {option.label}\n </Text>\n </PressableSurface>\n );\n })}\n </View>\n );\n}\n","import { useState } from \"react\";\nimport { ScrollView } from \"react-native\";\nimport type { IconName } from \"../../atoms/icon/Icon\";\nimport { OptionList } from \"../../molecules/option-list/OptionList\";\nimport { Sheet } from \"../../molecules/sheet/Sheet\";\nimport { SelectTrigger } from \"../../molecules/select-trigger/SelectTrigger\";\n\nexport interface SelectOption<T extends string = string> {\n value: T;\n label: string;\n /** Muted second line under the label. */\n description?: string;\n /** Ionicons name shown before the label. */\n icon?: IconName;\n /**\n * The unfiltered choice, e.g. \"All\". It is checked in the sheet while chosen, but the\n * trigger keeps showing the placeholder (e.g. \"Category\") and a chip stays unfilled.\n */\n all?: boolean;\n}\n\nexport interface SelectProps<T extends string = string> {\n options: SelectOption<T>[];\n /** Value of the chosen option; `null` or unset shows the placeholder. */\n value?: T | null;\n onChange: (value: T) => void;\n /** Shown muted while nothing is chosen, e.g. \"Choose one\". */\n placeholder: string;\n /** Visible label above the field; also the sheet's heading. */\n label?: string;\n /** Sheet heading when it should differ from `label`. Defaults to `label`, then `placeholder`. */\n sheetTitle?: string;\n /** Accessible name of the sheet's close button. Defaults to \"Close\". */\n closeLabel?: string;\n /** Inline error under the field; also outlines it in destructive. */\n error?: string | null;\n disabled?: boolean;\n testID?: string;\n /**\n * `field`: a labelled field box; `chip`: a compact pill showing the current value with a\n * chevron, e.g. a filter in a row of filters. Defaults to `field`.\n */\n variant?: SelectVariant;\n /** `chip`: the value that counts as unfiltered; the chip fills with primary while another value is chosen. */\n defaultValue?: T | null;\n}\n\n/** `field`: a labelled field box; `chip`: a compact pill trigger. */\nexport type SelectVariant = \"field\" | \"chip\";\n\n/**\n * Labelled field, or a compact chip, that opens a bottom sheet of options (radio rows with\n * an optional icon and description). Choosing an option calls `onChange` and closes the sheet.\n */\nexport function Select<T extends string = string>({\n options,\n value,\n onChange,\n placeholder,\n label,\n sheetTitle,\n closeLabel = \"Close\",\n error,\n disabled = false,\n testID,\n variant = \"field\",\n defaultValue,\n}: SelectProps<T>) {\n const [open, setOpen] = useState(false);\n const title = sheetTitle ?? label ?? placeholder;\n const chosen = options.find((o) => o.value === value);\n // An \"all\" option reads as nothing filtered: the trigger shows the placeholder.\n const shown = chosen?.all ? undefined : chosen;\n return (\n <>\n <SelectTrigger\n testID={testID}\n valueLabel={shown?.label}\n placeholder={placeholder}\n label={label}\n error={error}\n disabled={disabled}\n onPress={() => setOpen(true)}\n variant={variant}\n active={\n variant === \"chip\" &&\n value != null &&\n !chosen?.all &&\n value !== (defaultValue ?? null)\n }\n expanded={variant === \"chip\" ? open : undefined}\n />\n <Sheet\n open={open}\n title={title}\n closeLabel={closeLabel}\n onClose={() => setOpen(false)}\n testID={testID ? `${testID}-sheet` : undefined}\n >\n <ScrollView>\n <OptionList\n options={options}\n value={value}\n accessibilityLabel={title}\n testID={testID ? `${testID}-option` : undefined}\n onSelect={(next) => {\n onChange(next as T);\n setOpen(false);\n }}\n />\n </ScrollView>\n </Sheet>\n </>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { Surface } from \"../../atoms/surface/Surface\";\nimport { Text } from \"../../atoms/text/Text\";\n\n/** `destructive` draws the card border, icon and heading in the destructive color, e.g. a danger zone. */\nexport type SettingsSectionTone = \"default\" | \"destructive\";\n\nexport interface SettingsSectionProps {\n /** Card heading, e.g. \"Appearance\". */\n title: string;\n /** Settings organisms: ListRow, ProfileHeader, SegmentedControl, FilterChipGroup, FormSection. */\n children: ReactNode;\n testID?: string;\n /** Ionicons name before the heading. */\n icon?: IconName;\n /** Muted hint under the heading. */\n description?: string;\n /** Defaults to `default`. */\n tone?: SettingsSectionTone;\n}\n\n/** Settings card: a heading (optional icon and hint) over a column of settings organisms. */\nexport function SettingsSection({\n title,\n children,\n testID,\n icon,\n description,\n tone = \"default\",\n}: SettingsSectionProps) {\n const destructive = tone === \"destructive\";\n return (\n <Surface testID={testID} borderTone={tone}>\n <View className=\"gap-1.5 px-6 pb-4 pt-6\">\n <View className=\"flex-row items-center gap-2\">\n {icon ? (\n <Icon\n name={icon}\n className={\n destructive\n ? \"text-[hsl(var(--destructive))]\"\n : \"text-[hsl(var(--muted-foreground))]\"\n }\n />\n ) : null}\n <Text\n accessibilityRole=\"header\"\n variant=\"heading\"\n tone={destructive ? \"destructive\" : \"on-card\"}\n className=\"shrink leading-none tracking-tight\"\n >\n {title}\n </Text>\n </View>\n {description ? (\n <Text variant=\"small\" tone=\"muted\">\n {description}\n </Text>\n ) : null}\n </View>\n <View className=\"gap-1 px-6 pb-6\">{children}</View>\n </Surface>\n );\n}\n","import { useEffect, useState, type ReactNode } from \"react\";\nimport { Animated, Easing, Platform, View } from \"react-native\";\n\nexport type SkeletonListVariant = \"chat\" | \"list\" | \"detail\" | \"ranked\";\n\nexport interface SkeletonListProps {\n /**\n * Placeholder shape. \"chat\": bubbles alternating right and left, bottom-aligned;\n * \"list\": list rows (title, subtitle, trailing value) separated by hairlines; \"detail\": a\n * detail screen (hero image, title, meta line, stars, `count` text lines); \"ranked\": ranked\n * rows (rank, avatar, name, score). Defaults to \"chat\".\n */\n variant?: SkeletonListVariant;\n /** Number of placeholder rows. Defaults to 4. */\n count?: number;\n /** Accessible name of the placeholder. Defaults to \"Loading\". */\n accessibilityLabel?: string;\n testID?: string;\n}\n\nconst MIN_OPACITY = 0.3;\nconst MAX_OPACITY = 0.7;\nconst PULSE_MS = 800;\n// Chat bubble sizes cycled through the rows: [width, height] in px.\nconst BUBBLES: ReadonlyArray<[number, number]> = [\n [200, 40],\n [260, 56],\n [160, 40],\n [220, 72],\n];\nconst BAR = \"rounded-[var(--radius-sm)] bg-[hsl(var(--muted))]\";\n\n/** Loading placeholder: pulsing chat bubbles, list rows, ranked rows or a detail screen. */\nexport function SkeletonList({\n variant = \"chat\",\n count = 4,\n accessibilityLabel = \"Loading\",\n testID,\n}: SkeletonListProps) {\n const [opacity] = useState(() => new Animated.Value(MIN_OPACITY));\n\n useEffect(() => {\n const useNativeDriver = Platform.OS !== \"web\";\n const pulse = (toValue: number) =>\n Animated.timing(opacity, {\n toValue,\n duration: PULSE_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver,\n });\n const loop = Animated.loop(\n Animated.sequence([pulse(MAX_OPACITY), pulse(MIN_OPACITY)]),\n );\n loop.start();\n return () => loop.stop();\n }, [opacity]);\n\n const rows = Array.from({ length: count }, (_, i) => i);\n\n const frame = (className: string, content: ReactNode) => (\n <View\n testID={testID}\n accessible\n accessibilityRole=\"progressbar\"\n accessibilityLabel={accessibilityLabel}\n className={className}\n >\n {content}\n </View>\n );\n\n if (variant === \"detail\") {\n return frame(\n \"\",\n <Animated.View style={{ opacity }}>\n <View className=\"gap-4\">\n <View\n style={{ height: 220 }}\n className=\"w-full bg-[hsl(var(--muted))]\"\n />\n <View className=\"gap-3 px-4\">\n <View style={{ width: \"70%\", height: 24 }} className={BAR} />\n <View style={{ width: \"45%\", height: 14 }} className={BAR} />\n <View style={{ width: 96, height: 16 }} className={BAR} />\n <View className=\"gap-2 pt-2\">\n {rows.map((i) => (\n <View\n key={i}\n style={{\n width: i === count - 1 ? \"60%\" : \"100%\",\n height: 12,\n }}\n className={BAR}\n />\n ))}\n </View>\n </View>\n </View>\n </Animated.View>,\n );\n }\n\n if (variant === \"ranked\") {\n return frame(\n \"px-4\",\n rows.map((i) => (\n <Animated.View key={i} style={{ opacity }}>\n <View className=\"min-h-[56px] flex-row items-center gap-3 py-2\">\n <View style={{ width: 20, height: 16 }} className={BAR} />\n <View\n style={{ width: 40, height: 40 }}\n className=\"rounded-full bg-[hsl(var(--muted))]\"\n />\n <View className=\"flex-1 gap-2\">\n <View style={{ width: \"50%\", height: 16 }} className={BAR} />\n <View style={{ width: \"30%\", height: 12 }} className={BAR} />\n </View>\n <View style={{ width: 36, height: 16 }} className={BAR} />\n </View>\n </Animated.View>\n )),\n );\n }\n\n if (variant === \"list\") {\n return (\n <View\n testID={testID}\n accessible\n accessibilityRole=\"progressbar\"\n accessibilityLabel={accessibilityLabel}\n className=\"px-4\"\n >\n {rows.map((i) => (\n <Animated.View key={i} style={{ opacity }}>\n <View className=\"flex-row items-center gap-3 border-b border-[hsl(var(--border))] py-4\">\n <View className=\"flex-1 gap-2\">\n <View style={{ width: \"60%\", height: 18 }} className={BAR} />\n <View style={{ width: \"40%\", height: 12 }} className={BAR} />\n </View>\n <View style={{ width: 44, height: 14 }} className={BAR} />\n </View>\n </Animated.View>\n ))}\n </View>\n );\n }\n\n return (\n <View\n testID={testID}\n accessible\n accessibilityRole=\"progressbar\"\n accessibilityLabel={accessibilityLabel}\n className=\"flex-1 justify-end gap-3 px-4 pb-4\"\n >\n {rows.map((i) => {\n const [width, height] = BUBBLES[i % BUBBLES.length];\n return (\n <Animated.View\n key={i}\n style={{\n opacity,\n alignSelf: i % 2 === 0 ? \"flex-end\" : \"flex-start\",\n }}\n >\n <View\n style={{ width, height }}\n className=\"rounded-2xl bg-[hsl(var(--muted))]\"\n />\n </Animated.View>\n );\n })}\n </View>\n );\n}\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\nimport { View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { useSafeAreaInsetsOnce } from \"../../atoms/safe-area/SafeArea\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { BottomBarInsetContext } from \"./bottomBarInset\";\n\nexport type SnackbarTone = \"default\" | \"success\" | \"error\";\n\n/**\n * `auto` sits above a `TabBar` mounted inside the same `SnackbarProvider` (its height,\n * safe-area padding and raised center action included), and at the bottom when there is none.\n * `bottom` always sits at the bottom edge, e.g. over a full-screen layer that covers the tabs.\n */\nexport type SnackbarPlacement = \"auto\" | \"bottom\";\n\nexport interface SnackbarProps {\n /** Shows the snackbar; the hide timer starts when it turns true. */\n visible: boolean;\n message: string;\n /** `success` and `error` add a colored outline and icon. Defaults to `default`. */\n tone?: SnackbarTone;\n /** Milliseconds before `onHide` is called. Defaults to 3000. */\n duration?: number;\n /** Called when the duration has passed; set `visible` to false here. */\n onHide?: () => void;\n /** Where it sits. Defaults to `auto`: above a mounted TabBar. */\n placement?: SnackbarPlacement;\n testID?: string;\n}\n\nconst TONES: Record<\n SnackbarTone,\n { border: string; icon?: { name: IconName; color: string } }\n> = {\n default: { border: \"border-[hsl(var(--border))]\" },\n success: {\n border: \"border-[hsl(var(--primary))]\",\n icon: { name: \"checkmark-circle\", color: \"text-[hsl(var(--primary))]\" },\n },\n error: {\n border: \"border-[hsl(var(--destructive))]\",\n icon: { name: \"alert-circle\", color: \"text-[hsl(var(--destructive))]\" },\n },\n};\n\n/**\n * Transient message pinned to the bottom of its parent, capped at 420px. Inside a\n * `SnackbarProvider` it sits above a mounted `TabBar` unless `placement` is `bottom`. Controlled: the\n * app sets `visible` and hides it from `onHide`. Most apps use `SnackbarProvider` and\n * `useSnackbar()` instead.\n */\nexport function Snackbar({\n visible,\n message,\n tone = \"default\",\n duration = 3000,\n onHide,\n placement = \"auto\",\n testID,\n}: SnackbarProps) {\n const bottomBar = useContext(BottomBarInsetContext);\n const insets = useSafeAreaInsetsOnce();\n const offset = placement === \"auto\" ? bottomBar.height : 0;\n // Keep the latest callback without restarting the timer on every render.\n const onHideRef = useRef(onHide);\n onHideRef.current = onHide;\n\n useEffect(() => {\n if (!visible) return;\n const timer = setTimeout(() => onHideRef.current?.(), duration);\n return () => clearTimeout(timer);\n }, [visible, duration]);\n\n if (!visible) return null;\n const { border, icon } = TONES[tone];\n\n return (\n // Above a bar, the bar's height already includes the bottom safe area.\n <View\n style={{\n bottom: offset,\n paddingBottom: 16 + (offset > 0 ? 0 : insets.bottom),\n }}\n className=\"pointer-events-box-none absolute left-0 right-0 z-50 items-center px-4\"\n >\n <View\n testID={testID}\n role=\"alert\"\n accessibilityLiveRegion=\"polite\"\n className={`w-full max-w-[420px] flex-row items-center gap-2.5 rounded-[var(--radius-lg)] border bg-[hsl(var(--card))] px-4 py-3 shadow-lg ${border}`}\n >\n {icon ? <Icon name={icon.name} className={icon.color} /> : null}\n <Text variant=\"label\" tone=\"on-card\" className=\"flex-1\">\n {message}\n </Text>\n </View>\n </View>\n );\n}\n\n/** What `useSnackbar().show` takes. */\nexport interface SnackbarOptions {\n message: string;\n tone?: SnackbarTone;\n /** Milliseconds on screen. Defaults to 3000. */\n duration?: number;\n /** Defaults to `auto`: above a mounted TabBar. */\n placement?: SnackbarPlacement;\n}\n\nexport interface SnackbarContextValue {\n /** Shows a snackbar, replacing the one on screen. */\n show: (options: SnackbarOptions) => void;\n /** Hides the snackbar on screen early. */\n hide: () => void;\n}\n\nconst SnackbarContext = createContext<SnackbarContextValue | null>(null);\n\nexport interface SnackbarProviderProps {\n /** The app. The snackbar shows over it, at the bottom. */\n children: ReactNode;\n testID?: string;\n}\n\n/**\n * Hosts one snackbar over the app; `useSnackbar()` inside it shows messages. A `TabBar`\n * rendered inside it lifts every snackbar above the bar (D61).\n */\nexport function SnackbarProvider({ children, testID }: SnackbarProviderProps) {\n const [current, setCurrent] = useState<\n (SnackbarOptions & { id: number }) | null\n >(null);\n const nextId = useRef(0);\n\n const show = useCallback((options: SnackbarOptions) => {\n nextId.current += 1;\n setCurrent({ ...options, id: nextId.current });\n }, []);\n const hide = useCallback(() => setCurrent(null), []);\n const value = useMemo(() => ({ show, hide }), [show, hide]);\n const [barHeight, setBarHeight] = useState(0);\n const inset = useMemo(\n () => ({ height: barHeight, setHeight: setBarHeight }),\n [barHeight],\n );\n\n return (\n <SnackbarContext.Provider value={value}>\n <BottomBarInsetContext.Provider value={inset}>\n <View className=\"flex-1\">\n {children}\n {current ? (\n <Snackbar\n key={current.id}\n visible\n message={current.message}\n tone={current.tone}\n duration={current.duration}\n placement={current.placement}\n onHide={hide}\n testID={testID}\n />\n ) : null}\n </View>\n </BottomBarInsetContext.Provider>\n </SnackbarContext.Provider>\n );\n}\n\n/** `show({ message, tone })` and `hide()` for the nearest `SnackbarProvider`. */\nexport function useSnackbar(): SnackbarContextValue {\n const value = useContext(SnackbarContext);\n if (!value) {\n throw new Error(\"useSnackbar must be used inside a SnackbarProvider\");\n }\n return value;\n}\n","import { createContext } from \"react\";\n\n/**\n * Internal (D61): the height a bottom bar takes from the bottom of the screen, so a\n * snackbar can sit above it. `SnackbarProvider` holds the value, `TabBar` reports its\n * measured height (0 on unmount) and `Snackbar` reads it. Not part of the public API.\n */\nexport interface BottomBarInset {\n /** Height in px, including the bar's safe-area padding and any raised center action. */\n height: number;\n setHeight: (height: number) => void;\n}\n\n// Outside a SnackbarProvider nothing listens, so reporting is a no-op.\nconst noop = () => {};\n\nexport const BottomBarInsetContext = createContext<BottomBarInset>({\n height: 0,\n setHeight: noop,\n});\n","import { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport {\n PressableSurface,\n type PressFeedback,\n} from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Spinner } from \"../../atoms/spinner/Spinner\";\nimport { Text } from \"../../atoms/text/Text\";\n\n/** Identity provider the button signs in with. */\nexport type SocialSignInButtonProvider = \"apple\" | \"google\";\n\nexport interface SocialSignInButtonProps {\n provider: SocialSignInButtonProvider;\n onPress: () => void;\n /** Visible text. Defaults to \"Continue with Apple\" / \"Continue with Google\". */\n label?: string;\n /** Shows a spinner in place of the logo and blocks presses. */\n loading?: boolean;\n disabled?: boolean;\n testID?: string;\n}\n\nconst PROVIDER: Record<\n SocialSignInButtonProvider,\n {\n label: string;\n icon: IconName;\n button: string;\n feedback: PressFeedback;\n tone: \"inverse\" | \"default\";\n text: string;\n }\n> = {\n // Apple: solid, inverted to the screen (black in light mode, white in dark mode).\n apple: {\n label: \"Continue with Apple\",\n icon: \"logo-apple\",\n button: \"bg-[hsl(var(--foreground))]\",\n feedback: \"none\",\n tone: \"inverse\",\n text: \"text-[hsl(var(--background))]\",\n },\n // Google: neutral surface with a border.\n google: {\n label: \"Continue with Google\",\n icon: \"logo-google\",\n button: \"border border-[hsl(var(--border))] bg-[hsl(var(--background))]\",\n feedback: \"fill\",\n tone: \"default\",\n text: \"text-[hsl(var(--foreground))]\",\n },\n};\n\n/** Full-width \"Continue with Apple/Google\" button in the provider's general look. */\nexport function SocialSignInButton({\n provider,\n onPress,\n label,\n loading = false,\n disabled = false,\n testID,\n}: SocialSignInButtonProps) {\n const style = PROVIDER[provider];\n const text = label ?? style.label;\n const inactive = loading || disabled;\n return (\n <PressableSurface\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={text}\n accessibilityState={{ disabled: inactive, busy: loading }}\n disabled={inactive}\n onPress={onPress}\n feedback={style.feedback}\n dimDisabled={false}\n className={`h-11 w-full flex-row items-center justify-center gap-2 rounded-[var(--radius-lg)] px-4 ${style.button} ${inactive ? \"opacity-70\" : \"\"}`}\n >\n {loading ? (\n <Spinner label=\"Loading\" tone={style.tone} />\n ) : (\n <Icon name={style.icon} className={style.text} />\n )}\n <Text variant=\"label\" tone={style.tone}>\n {text}\n </Text>\n </PressableSurface>\n );\n}\n","import { View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { Ring } from \"../../atoms/ring/Ring\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Surface } from \"../../atoms/surface/Surface\";\nimport { Text, type TextTone } from \"../../atoms/text/Text\";\nimport { progressShare } from \"../progress-bar/progressShare\";\n\n/** Color of the value: `positive` uses primary, `negative` uses destructive. */\nexport type StatTileTone = \"default\" | \"positive\" | \"negative\";\n\nexport interface StatTileProps {\n /** Muted line above the value, e.g. \"Total\". */\n label: string;\n /** The number, already formatted by the app, e.g. \"1,250\" or \"+30%\". */\n value: string;\n /** Muted line under the value, e.g. \"12 entries\". */\n caption?: string;\n /** Ionicons name shown in the top-right corner. */\n icon?: IconName;\n tone?: StatTileTone;\n /** Makes the tile a button, e.g. to open the list behind the number. */\n onPress?: () => void;\n testID?: string;\n /**\n * Draws a progress ring left of the text, turning the tile into a hero summary, e.g.\n * the share of a collection completed.\n */\n progress?: StatTileProgress;\n /** testID of the value text, e.g. for an end-to-end check of the number. */\n valueTestID?: string;\n}\n\nexport interface StatTileProgress {\n /** Share done, from 0 to 1. Values outside the range are clamped. */\n value: number;\n /** Text in the ring instead of the percentage, e.g. \"3/10\". */\n valueLabel?: string;\n /** Accessible name of the ring. Defaults to the tile's `label`. */\n label?: string;\n}\n\nconst VALUE_TONE: Record<StatTileTone, TextTone> = {\n default: \"on-card\",\n positive: \"primary\",\n negative: \"destructive\",\n};\n\nconst LAYOUT = \"min-w-0 flex-1 gap-1 p-4\";\n\nfunction ProgressDisc({\n progress,\n label,\n}: {\n progress: StatTileProgress;\n label: string;\n}) {\n const { share, percent } = progressShare(progress.value);\n return (\n <View\n accessible\n accessibilityRole=\"progressbar\"\n accessibilityLabel={progress.label ?? label}\n accessibilityValue={{\n min: 0,\n max: 100,\n now: percent,\n text: progress.valueLabel,\n }}\n >\n <Ring share={share} size={88} stroke={8}>\n <Text variant=\"heading\" weight=\"semibold\" tone=\"on-card\">\n {progress.valueLabel ?? `${percent}%`}\n </Text>\n </Ring>\n </View>\n );\n}\n\n/**\n * Summary stat card: a label, a large value and an optional caption and icon. Tiles\n * share a row equally (each takes `flex: 1`).\n */\nexport function StatTile({\n label,\n value,\n caption,\n icon,\n tone = \"default\",\n onPress,\n testID,\n progress,\n valueTestID,\n}: StatTileProps) {\n const text = (\n <>\n <View className=\"flex-row items-center justify-between gap-2\">\n <Text numberOfLines={1} variant=\"small\" tone=\"muted\" className=\"shrink\">\n {label}\n </Text>\n {icon ? (\n <Icon name={icon} className=\"text-[hsl(var(--muted-foreground))]\" />\n ) : null}\n </View>\n <Text\n testID={valueTestID}\n numberOfLines={1}\n adjustsFontSizeToFit\n variant={progress ? \"display\" : \"headline\"}\n tone={VALUE_TONE[tone]}\n >\n {value}\n </Text>\n {caption ? (\n <Text variant=\"footnote\" tone=\"muted\">\n {caption}\n </Text>\n ) : null}\n </>\n );\n const body = progress ? (\n <View className=\"flex-row items-center gap-5\">\n <ProgressDisc progress={progress} label={label} />\n <View className=\"min-w-0 flex-1 gap-1\">{text}</View>\n </View>\n ) : (\n text\n );\n\n if (!onPress) {\n return (\n <Surface testID={testID} variant=\"panel\" className={LAYOUT}>\n {body}\n </Surface>\n );\n }\n\n return (\n // Same box as the panel Surface, pressable.\n <PressableSurface\n testID={testID}\n accessibilityRole=\"button\"\n onPress={onPress}\n feedback=\"fade\"\n className={`${LAYOUT} rounded-[var(--radius-xl)] border border-[hsl(var(--border))] bg-[hsl(var(--card))]`}\n >\n {body}\n </PressableSurface>\n );\n}\n","import { View } from \"react-native\";\nimport { Divider } from \"../../atoms/divider/Divider\";\nimport { Surface } from \"../../atoms/surface/Surface\";\nimport { Text } from \"../../atoms/text/Text\";\n\n/** Color of a sub-stat value: `primary` highlights it, `muted` plays it down. */\nexport type SummaryCardTone = \"default\" | \"primary\" | \"muted\";\n\n/** One sub-stat in the row under the headline. */\nexport interface SummaryCardStat {\n label: string;\n /** Formatted by the app, e.g. \"1,200\". */\n value: string;\n /** Defaults to `default`. */\n tone?: SummaryCardTone;\n testID?: string;\n}\n\nexport interface SummaryCardProps {\n /** Muted label above the headline value, e.g. \"Total\". */\n label: string;\n /** Headline value, formatted by the app. */\n value: string;\n valueTestID?: string;\n /** Muted text on the right of the headline, e.g. a count. */\n caption?: string;\n captionTestID?: string;\n /** Up to three sub-stats in a divided row under the headline. */\n stats?: SummaryCardStat[];\n testID?: string;\n}\n\nconst STAT_TONE = {\n default: \"default\",\n primary: \"primary\",\n muted: \"on-secondary\",\n} as const;\n\n/**\n * Totals card on the secondary surface: a headline (label, large value, optional caption on\n * the right) over a divided row of up to three sub-stats.\n */\nexport function SummaryCard({\n label,\n value,\n valueTestID,\n caption,\n captionTestID,\n stats,\n testID,\n}: SummaryCardProps) {\n const shown = stats?.slice(0, 3) ?? [];\n return (\n <Surface\n testID={testID}\n variant=\"panel\"\n tone=\"secondary\"\n className=\"gap-3 p-4\"\n >\n <View className=\"flex-row items-end justify-between gap-3\">\n <View className=\"shrink gap-0.5\">\n <Text variant=\"small\" tone=\"on-secondary\">\n {label}\n </Text>\n <Text testID={valueTestID} variant=\"headline\">\n {value}\n </Text>\n </View>\n {caption ? (\n <Text testID={captionTestID} variant=\"small\" tone=\"on-secondary\">\n {caption}\n </Text>\n ) : null}\n </View>\n {shown.length > 0 ? (\n <>\n <Divider />\n <View className=\"flex-row\">\n {shown.map((stat, i) => (\n <View\n key={stat.label}\n className={`flex-1 gap-0.5 ${i > 0 ? \"border-l border-[hsl(var(--border))] pl-4\" : \"\"}`}\n >\n <Text variant=\"small\" tone=\"on-secondary\">\n {stat.label}\n </Text>\n <Text\n testID={stat.testID}\n numberOfLines={1}\n weight=\"semibold\"\n tone={STAT_TONE[stat.tone ?? \"default\"]}\n >\n {stat.value}\n </Text>\n </View>\n ))}\n </View>\n </>\n ) : null}\n </Surface>\n );\n}\n","import { useContext, useEffect, useRef } from \"react\";\nimport { View, type LayoutChangeEvent } from \"react-native\";\nimport { useSafeAreaInsetsOnce } from \"../../atoms/safe-area/SafeArea\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { BottomBarInsetContext } from \"../snackbar/bottomBarInset\";\n\n/** One tab: a route or screen the bar switches to. */\nexport interface TabBarItem {\n /** Stable key passed to `onSelect`, e.g. the route name. */\n key: string;\n /** Visible label under the icon; also the tab's accessible name. */\n label: string;\n /** Ionicons name shown while the tab is not selected. */\n icon: IconName;\n /** Ionicons name shown while the tab is selected. Defaults to `icon`. */\n activeIcon?: IconName;\n testID?: string;\n}\n\n/** A raised round primary button in the middle of the bar, such as a create button. */\nexport interface TabBarCenterAction {\n /** Ionicons name. */\n icon: IconName;\n /** Accessible name of the button. */\n label: string;\n onPress: () => void;\n testID?: string;\n}\n\nexport interface TabBarProps {\n items: TabBarItem[];\n /** Key of the selected tab. */\n activeKey: string;\n /** Called with a tab's key when it is pressed. */\n onSelect: (key: string) => void;\n /** Optional raised button in the middle; the tabs split evenly around it (the left side takes the extra one). */\n centerAction?: TabBarCenterAction;\n /** Adds the bottom safe-area inset to the bottom padding. Set false when a parent already pads it. Defaults to true. */\n safeAreaBottom?: boolean;\n testID?: string;\n}\n\nconst CENTER_SIZE = 56;\n/** How far the raised center action rises above the bar's top edge. */\nconst CENTER_RISE = CENTER_SIZE / 3;\n\n/**\n * Bottom tab bar: icon and label tabs, the selected one in primary, with an optional raised\n * center action. Inside a `SnackbarProvider`, snackbars sit above it automatically.\n */\nexport function TabBar({\n items,\n activeKey,\n onSelect,\n centerAction,\n safeAreaBottom = true,\n testID,\n}: TabBarProps) {\n const insets = useSafeAreaInsetsOnce();\n const bottomInset = safeAreaBottom ? insets.bottom : 0;\n\n // Tell a SnackbarProvider above how much room the bar takes, so snackbars sit above\n // it and its center action (D61). Unmounting (a screen without tabs) clears it.\n const { setHeight } = useContext(BottomBarInsetContext);\n useEffect(() => () => setHeight(0), [setHeight]);\n const rise = centerAction ? Math.ceil(CENTER_RISE) : 0;\n // The bar's own height comes from layout; the center action's rise can change without\n // a relayout (adding or removing it), so report again when the rise changes.\n const measured = useRef<number | null>(null);\n useEffect(() => {\n if (measured.current !== null) setHeight(measured.current + rise);\n }, [rise, setHeight]);\n function onLayout(e: LayoutChangeEvent) {\n measured.current = Math.ceil(e.nativeEvent.layout.height);\n setHeight(measured.current + rise);\n }\n\n function renderTab(item: TabBarItem) {\n const selected = item.key === activeKey;\n // The selected icon is primary; its label is foreground, because primary text\n // on the background is under 4.5:1 (D27).\n const iconColor = selected\n ? \"text-[hsl(var(--primary))]\"\n : \"text-[hsl(var(--muted-foreground))]\";\n return (\n <PressableSurface\n key={item.key}\n testID={item.testID}\n accessibilityRole=\"tab\"\n accessibilityLabel={item.label}\n accessibilityState={{ selected }}\n onPress={() => onSelect(item.key)}\n feedback=\"none\"\n className=\"min-h-[48px] flex-1 items-center justify-center gap-0.5 py-1.5\"\n >\n <Icon\n name={selected ? (item.activeIcon ?? item.icon) : item.icon}\n size={22}\n className={iconColor}\n />\n <Text\n numberOfLines={1}\n variant=\"micro\"\n tone={selected ? \"default\" : \"muted\"}\n >\n {item.label}\n </Text>\n </PressableSurface>\n );\n }\n\n // The tabs split into two halves of equal width around a fixed gap, so the\n // center action stays centered whatever the tab count.\n const split = centerAction ? Math.ceil(items.length / 2) : items.length;\n\n return (\n <View\n testID={testID}\n onLayout={onLayout}\n style={{ paddingBottom: bottomInset }}\n className=\"relative border-t border-[hsl(var(--border))] bg-[hsl(var(--background))]\"\n >\n <View\n accessibilityRole=\"tablist\"\n className=\"w-full max-w-[720px] flex-row self-center px-2\"\n >\n {centerAction ? (\n <>\n <View className=\"flex-1 flex-row\">\n {items.slice(0, split).map(renderTab)}\n </View>\n <View style={{ width: CENTER_SIZE + 16 }} />\n <View className=\"flex-1 flex-row\">\n {items.slice(split).map(renderTab)}\n </View>\n </>\n ) : (\n items.map(renderTab)\n )}\n </View>\n {centerAction ? (\n <PressableSurface\n testID={centerAction.testID}\n accessibilityRole=\"button\"\n accessibilityLabel={centerAction.label}\n onPress={centerAction.onPress}\n feedback=\"none\"\n style={{\n width: CENTER_SIZE,\n height: CENTER_SIZE,\n top: -CENTER_RISE,\n left: \"50%\",\n marginLeft: -CENTER_SIZE / 2,\n }}\n className=\"absolute items-center justify-center rounded-full bg-[hsl(var(--primary))] shadow-lg active:opacity-80\"\n >\n <Icon\n name={centerAction.icon}\n size={26}\n className=\"text-[hsl(var(--primary-foreground))]\"\n />\n </PressableSurface>\n ) : null}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\n\nexport interface TabStripOption<T extends string = string> {\n value: T;\n label: string;\n testID?: string;\n}\n\nexport interface TabStripProps<T extends string = string> {\n /** 2 to 5 tabs, each switching the view below the strip. */\n options: TabStripOption<T>[];\n /** Value of the selected tab. */\n value: T;\n onChange: (value: T) => void;\n /** Accessible name of the tab list, e.g. \"Sections\". */\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/**\n * Row of underlined tabs that switch the view below it. The selected tab has a semibold\n * label and a 2px primary underline; the strip sits on a hairline border. Tab-list\n * semantics; for picking a value use SegmentedControl instead.\n */\nexport function TabStrip<T extends string = string>({\n options,\n value,\n onChange,\n accessibilityLabel,\n testID,\n}: TabStripProps<T>) {\n return (\n <View\n testID={testID}\n accessibilityRole=\"tablist\"\n accessibilityLabel={accessibilityLabel}\n className=\"flex-row border-b border-[hsl(var(--border))] px-4\"\n >\n {options.map((option) => {\n const selected = option.value === value;\n return (\n <PressableSurface\n key={option.value}\n testID={option.testID}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected }}\n onPress={() => onChange(option.value)}\n feedback=\"fade\"\n // Grows from the label's width so a long label is not cut off on a narrow phone.\n className={`-mb-px min-h-[44px] grow items-center justify-center border-b-2 px-2 ${\n selected ? \"border-[hsl(var(--primary))]\" : \"border-transparent\"\n }`}\n >\n <Text\n numberOfLines={1}\n variant=\"small\"\n weight={selected ? \"semibold\" : \"regular\"}\n tone={selected ? \"default\" : \"muted\"}\n >\n {option.label}\n </Text>\n </PressableSurface>\n );\n })}\n </View>\n );\n}\n","import { View } from \"react-native\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { Input } from \"../../atoms/input/Input\";\nimport { Field } from \"../../molecules/field/Field\";\n\n/** A small button after the input, e.g. \"Add\" for an inline add field. */\nexport interface TextFieldAction {\n label: string;\n onPress: () => void;\n disabled?: boolean;\n testID?: string;\n}\n\nexport interface TextFieldProps {\n /** The text as typed; the field is controlled. */\n value: string;\n onChangeText: (text: string) => void;\n /** Visible label above the field; also the input's accessible name. */\n label?: string;\n /** Muted text while empty; the accessible name when there is no label. */\n placeholder?: string;\n /** A box that grows with its text (from three lines) instead of one 44px line. */\n multiline?: boolean;\n /** Maximum number of characters the input accepts. */\n maxLength?: number;\n /** Inline error under the field; also outlines it in destructive. */\n error?: string | null;\n /** False while the form is busy; dims the field. Defaults to true. */\n editable?: boolean;\n /** Optional small button after the input. */\n action?: TextFieldAction;\n /** Called with the current text when the keyboard's return key is pressed (single line only). */\n onSubmit?: (text: string) => void;\n /** Focuses the input on mount, e.g. an add field that just opened. */\n autoFocus?: boolean;\n testID?: string;\n}\n\n/**\n * One labelled text field outside a FormSection: a single line or a growing multiline box,\n * an inline error and an optional small button after the input.\n */\nexport function TextField({\n value,\n onChangeText,\n label,\n placeholder,\n multiline = false,\n maxLength,\n error,\n editable = true,\n action,\n onSubmit,\n autoFocus,\n testID,\n}: TextFieldProps) {\n return (\n <Field\n label={label}\n error={error}\n errorTestID={testID ? `${testID}-error` : undefined}\n >\n <View className=\"flex-row items-start gap-2\">\n <View className=\"flex-1 flex-row\">\n <Input\n variant={multiline ? \"multiline\" : \"outline\"}\n invalid={!!error}\n testID={testID}\n value={value}\n onChangeText={onChangeText}\n placeholder={placeholder}\n accessibilityLabel={label ?? placeholder}\n maxLength={maxLength}\n editable={editable}\n autoFocus={autoFocus}\n {...(multiline\n ? { numberOfLines: 3 }\n : {\n returnKeyType: action ? (\"done\" as const) : undefined,\n onSubmitEditing: () => onSubmit?.(value),\n })}\n />\n </View>\n {action ? (\n <View className=\"h-11 justify-center\">\n <Button\n label={action.label}\n onPress={action.onPress}\n disabled={action.disabled || !editable}\n size=\"sm\"\n layout=\"auto\"\n testID={action.testID}\n />\n </View>\n ) : null}\n </View>\n </Field>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { View, useWindowDimensions } from \"react-native\";\nimport { SafeAreaBox } from \"../../atoms/safe-area/SafeArea\";\n\n/**\n * `content` caps the column at 720px for reading on tablets and desktop. `phone` caps it\n * at 480px and frames it: on a window wider than that the column gets side borders and\n * the space around it takes the secondary token background, the way a mobile-first app\n * looks on desktop web.\n */\nexport type AppShellMaxWidth = \"content\" | \"phone\";\n\nexport interface AppShellProps {\n /** Header slot, usually an AppBar. Stays fixed above the content. */\n header?: ReactNode;\n /** Screen content. Fills the remaining height. */\n children: ReactNode;\n /** Width of the centered column on wide screens. Defaults to `content` (720px). */\n maxWidth?: AppShellMaxWidth;\n testID?: string;\n}\n\nconst PHONE_WIDTH = 480;\n\n/**\n * Screen frame: safe-area aware, themed background, and a content column centered on\n * wide screens: 720px by default, or a framed 480px phone column with `maxWidth=\"phone\"`.\n * It pads the top and bottom safe-area insets once: templates and bars inside skip them (D66).\n */\nexport function AppShell({\n header,\n children,\n maxWidth = \"content\",\n testID,\n}: AppShellProps) {\n const { width } = useWindowDimensions();\n const phone = maxWidth === \"phone\";\n // Only frame the column when there is room around it; on a phone it is the screen.\n const framed = phone && width > PHONE_WIDTH;\n\n return (\n <SafeAreaBox\n root\n testID={testID}\n edges={[\"top\", \"bottom\"]}\n className={`flex-1 ${framed ? \"bg-[hsl(var(--secondary))]\" : \"bg-[hsl(var(--background))]\"}`}\n >\n <View\n testID={testID ? `${testID}-column` : undefined}\n className={`w-full flex-1 self-center ${phone ? \"max-w-[480px]\" : \"max-w-[720px]\"} ${framed ? \"border-x border-[hsl(var(--border))] bg-[hsl(var(--background))]\" : \"\"}`}\n >\n {header}\n <View className=\"flex-1\">{children}</View>\n </View>\n </SafeAreaBox>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { KeyboardAvoidingView, ScrollView, View } from \"react-native\";\nimport { Text } from \"../../atoms/text/Text\";\nimport { TextLink } from \"../../atoms/text-link/TextLink\";\nimport { SafeAreaBox, type SafeAreaEdge } from \"../../atoms/safe-area/SafeArea\";\n\nexport interface AuthTemplateFooterLink {\n /** The link text, e.g. \"Create account\" or \"Privacy policy\". */\n label: string;\n onPress: () => void;\n /** Muted text before the link on the same line, e.g. \"New here?\". */\n prompt?: string;\n testID?: string;\n}\n\nexport interface AuthTemplateProps {\n /** Top of the column, usually a BrandMark. */\n header?: ReactNode;\n /** The form, usually a FormSection. */\n children: ReactNode;\n /**\n * Pads the screen above the keyboard on iOS and Android (edge-to-edge, D46).\n * Set false when the app wraps the screen in its own keyboard engine, such as\n * react-native-keyboard-controller (D9). Defaults to true.\n */\n keyboardAvoiding?: boolean;\n testID?: string;\n /**\n * Links centered under the form, one per line: a link with an optional muted prompt\n * before it (sign-up) or a plain muted link (policy).\n */\n footerLinks?: AuthTemplateFooterLink[];\n /**\n * Pads the top safe-area inset, so the background reaches under the status bar. Skipped\n * when an enclosing AppShell or template already pads it (D66). Set false when something else above\n * the screen pads it. Defaults to true.\n */\n safeAreaTop?: boolean;\n /**\n * Pads the bottom safe-area inset. Skipped when an enclosing AppShell or template already\n * pads it (D66). Set false when something below the screen pads it. Defaults to true.\n */\n safeAreaBottom?: boolean;\n}\n\n/**\n * Sign-in style screen: safe-area aware, keyboard-avoiding, vertically centered column\n * capped at 420px, scrollable when the keyboard leaves too little room.\n */\nexport function AuthTemplate({\n header,\n children,\n keyboardAvoiding = true,\n testID,\n footerLinks,\n safeAreaTop = true,\n safeAreaBottom = true,\n}: AuthTemplateProps) {\n const edges: SafeAreaEdge[] = [];\n if (safeAreaTop) edges.push(\"top\");\n if (safeAreaBottom) edges.push(\"bottom\");\n return (\n <SafeAreaBox\n testID={testID}\n edges={edges}\n className=\"flex-1 bg-[hsl(var(--background))]\"\n >\n <KeyboardAvoidingView\n style={{ flex: 1 }}\n behavior=\"padding\"\n enabled={keyboardAvoiding}\n >\n <ScrollView\n contentContainerStyle={{ flexGrow: 1, justifyContent: \"center\" }}\n contentContainerClassName=\"w-full max-w-[420px] gap-7 self-center px-5\"\n keyboardShouldPersistTaps=\"handled\"\n >\n {header}\n {children}\n {footerLinks && footerLinks.length > 0 ? (\n <View className=\"items-center gap-1\">\n {footerLinks.map((link, i) => (\n <View\n key={i}\n className=\"flex-row items-center justify-center gap-1\"\n >\n {link.prompt ? (\n <Text variant=\"small\" tone=\"muted\">\n {link.prompt}\n </Text>\n ) : null}\n <TextLink\n testID={link.testID}\n label={link.label}\n onPress={link.onPress}\n emphasis={!!link.prompt}\n />\n </View>\n ))}\n </View>\n ) : null}\n </ScrollView>\n </KeyboardAvoidingView>\n </SafeAreaBox>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { KeyboardAvoidingView, View } from \"react-native\";\nimport { SafeAreaBox } from \"../../atoms/safe-area/SafeArea\";\n\nexport interface ChatTemplateProps {\n /** Top bar, usually an AppBar. */\n header?: ReactNode;\n /** The stream: a MessageList, SkeletonList or EmptyState. Fills the remaining height. */\n list: ReactNode;\n /** Floats over the list, e.g. a ScrollToBottomFab (which positions itself). */\n overlay?: ReactNode;\n /** Strip between the list and the composer, e.g. an offline or error Banner. */\n banner?: ReactNode;\n /** Bottom input, usually a Composer. */\n composer: ReactNode;\n /**\n * Pads the screen above the keyboard on iOS and Android (edge-to-edge, D46).\n * Set false when the app wraps the screen in its own keyboard engine, such as\n * react-native-keyboard-controller (D9). Defaults to true.\n */\n keyboardAvoiding?: boolean;\n testID?: string;\n /**\n * Pads the top safe-area inset. Skipped when an enclosing AppShell already pads it\n * (D66). Set false when something else above the screen pads it. Defaults to true.\n * The bottom inset is the composer's (`Composer` pads it).\n */\n safeAreaTop?: boolean;\n}\n\n/**\n * Chat screen frame: safe-area aware (top), keyboard-avoiding, a column capped at 720px and centered,\n * with header, list (plus overlay), banner and composer stacked top to bottom.\n */\nexport function ChatTemplate({\n header,\n list,\n overlay,\n banner,\n composer,\n keyboardAvoiding = true,\n testID,\n safeAreaTop = true,\n}: ChatTemplateProps) {\n return (\n <SafeAreaBox\n testID={testID}\n edges={safeAreaTop ? [\"top\"] : []}\n className=\"flex-1 bg-[hsl(var(--background))]\"\n >\n <KeyboardAvoidingView\n style={{ flex: 1 }}\n behavior=\"padding\"\n enabled={keyboardAvoiding}\n >\n <View className=\"w-full max-w-[720px] flex-1 self-center\">\n {header}\n <View className=\"relative flex-1\">\n {list}\n {overlay}\n </View>\n {banner}\n {composer}\n </View>\n </KeyboardAvoidingView>\n </SafeAreaBox>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { ScrollView, View } from \"react-native\";\nimport { Icon } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport {\n SafeAreaBox,\n SafeAreaPadded,\n useSafeAreaInsetsOnce,\n} from \"../../atoms/safe-area/SafeArea\";\n\nexport interface DetailTemplateProps {\n /** Top bar, usually an AppBar with a back action. Stays fixed. */\n header?: ReactNode;\n /** Edge-to-edge top of the scroll, e.g. a photo strip or a ProfileHeader. */\n hero?: ReactNode;\n /** Sections under the hero, usually ListSections. Stacked with a 24px gap in a padded column. */\n children: ReactNode;\n /** Sticky bottom bar for the screen's actions; pads the bottom safe-area inset. */\n footer?: ReactNode;\n testID?: string;\n /**\n * Shows a round back button floating over the top-left of the hero, for screens\n * without a header. Without a hero the content leaves room under it.\n */\n onBack?: () => void;\n /** Accessible name of the back button. Defaults to \"Back\". */\n backLabel?: string;\n /**\n * Pads the bottom safe-area inset (under the content, or in the footer). Set false\n * inside tabs, where the TabBar pads it. Defaults to true.\n */\n safeAreaBottom?: boolean;\n /**\n * Pads the hero 16px on the sides and top, matching the sections, for a hero that is\n * not a full-bleed image (e.g. a ProfileHeader). Defaults to false (edge to edge).\n */\n heroPadded?: boolean;\n}\n\nconst COLUMN = \"w-full max-w-[720px] self-center\";\n\n/**\n * Detail screen frame: safe-area aware, a fixed header, a scrolling column (hero, then\n * sections) capped at 720px and centered, and an optional sticky footer.\n */\nexport function DetailTemplate({\n header,\n hero,\n children,\n footer,\n testID,\n onBack,\n backLabel = \"Back\",\n safeAreaBottom = true,\n heroPadded = false,\n}: DetailTemplateProps) {\n const insets = useSafeAreaInsetsOnce();\n const bottom = safeAreaBottom ? insets.bottom : 0;\n return (\n <SafeAreaBox\n testID={testID}\n edges={footer || !safeAreaBottom ? [\"top\"] : [\"top\", \"bottom\"]}\n className=\"flex-1 bg-[hsl(var(--background))]\"\n >\n <View className={COLUMN}>{header}</View>\n <View className=\"flex-1\">\n {onBack ? (\n // Card-colored circle so it stays readable over any image.\n <PressableSurface\n testID={testID ? `${testID}-back` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={backLabel}\n onPress={onBack}\n feedback=\"fade\"\n className=\"absolute left-4 top-4 z-10 h-10 w-10 items-center justify-center rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--card))] shadow-md\"\n >\n <Icon\n name=\"arrow-back\"\n className=\"text-[hsl(var(--card-foreground))]\"\n />\n </PressableSurface>\n ) : null}\n <ScrollView\n className=\"flex-1\"\n contentContainerClassName={`${COLUMN} pb-6`}\n keyboardShouldPersistTaps=\"handled\"\n >\n {hero && heroPadded ? (\n <View\n testID={testID ? `${testID}-hero` : undefined}\n className=\"px-4 pt-4\"\n >\n {hero}\n </View>\n ) : (\n hero\n )}\n <View className={`gap-6 px-4 ${onBack && !hero ? \"pt-16\" : \"pt-4\"}`}>\n {children}\n </View>\n </ScrollView>\n </View>\n {footer ? (\n <View\n testID={testID ? `${testID}-footer` : undefined}\n style={{ paddingBottom: 12 + bottom }}\n className=\"border-t border-[hsl(var(--border))] bg-[hsl(var(--background))] px-4 pt-3\"\n >\n <View className={`${COLUMN} gap-2`}>\n {/* The footer pads the bottom inset, so a bar inside it does not again. */}\n <SafeAreaPadded edges={safeAreaBottom ? [\"bottom\"] : []}>\n {footer}\n </SafeAreaPadded>\n </View>\n </View>\n ) : null}\n </SafeAreaBox>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { KeyboardAvoidingView, Platform, ScrollView, View } from \"react-native\";\nimport { SafeAreaBox } from \"../../atoms/safe-area/SafeArea\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { FieldError } from \"../../molecules/field/Field\";\n\n/** Full-width primary button pinned under the form. */\nexport interface FormTemplateSubmit {\n label: string;\n onPress: () => void;\n /** Shows a spinner and blocks presses, e.g. while saving. */\n loading?: boolean;\n disabled?: boolean;\n testID?: string;\n}\n\n/** Pinned bottom bar: a form-level error above the submit button. */\nexport interface FormTemplateFooter {\n submit: FormTemplateSubmit;\n /** Form-level error, e.g. \"Could not save.\" Field errors belong on the fields. */\n error?: string | null;\n errorTestID?: string;\n}\n\nexport interface FormTemplateProps {\n /** Fixed above the form, usually an AppBar with a back or close action. */\n header?: ReactNode;\n /** Field organisms (AmountInput, DateField, FilterChipGroup, ...), stacked with a 24px gap. */\n children: ReactNode;\n /** Submit bar pinned to the bottom so the action is reachable without scrolling. */\n footer?: FormTemplateFooter;\n testID?: string;\n}\n\nconst COLUMN = \"w-full max-w-[640px] self-center px-5\";\n\n/**\n * Form screen, often shown as a modal: safe-area aware and keyboard-avoiding, a fixed\n * header, a scrolling column of fields capped at 640px, and an optional pinned submit bar.\n */\nexport function FormTemplate({\n header,\n children,\n footer,\n testID,\n}: FormTemplateProps) {\n return (\n <SafeAreaBox\n testID={testID}\n edges={[\"top\", \"bottom\"]}\n className=\"flex-1 bg-[hsl(var(--background))]\"\n >\n <KeyboardAvoidingView\n style={{ flex: 1 }}\n behavior={Platform.OS === \"ios\" ? \"padding\" : undefined}\n >\n {header}\n <ScrollView\n className=\"flex-1\"\n contentContainerClassName={`${COLUMN} gap-6 pb-6 pt-4`}\n keyboardShouldPersistTaps=\"handled\"\n >\n {children}\n </ScrollView>\n {footer ? (\n <View className=\"border-t border-[hsl(var(--border))] py-3\">\n <View className={`${COLUMN} gap-2`}>\n {footer.error ? (\n <FieldError testID={footer.errorTestID}>\n {footer.error}\n </FieldError>\n ) : null}\n <Button\n label={footer.submit.label}\n onPress={footer.submit.onPress}\n loading={footer.submit.loading}\n disabled={footer.submit.disabled}\n testID={footer.submit.testID}\n />\n </View>\n </View>\n ) : null}\n </KeyboardAvoidingView>\n </SafeAreaBox>\n );\n}\n","import { useImperativeHandle, useRef, type ReactNode, type Ref } from \"react\";\nimport {\n ScrollView,\n View,\n type LayoutChangeEvent,\n type NativeScrollEvent,\n type NativeSyntheticEvent,\n} from \"react-native\";\nimport { SafeAreaBox } from \"../../atoms/safe-area/SafeArea\";\n\n/** Where the scrolled content sits, in content coordinates (px from the top of the content). */\nexport interface ListTemplateScrollEvent {\n /** How far the content is scrolled. */\n offsetY: number;\n /** Height of the visible part of the list, between the fixed rows and the footer. */\n viewportHeight: number;\n /** Full height of the scrolled content, padding included. */\n contentHeight: number;\n}\n\n/** Scroll control for the template's own scroll view (`scroll`, the default). */\nexport interface ListTemplateScrollHandle {\n /** Scrolls so that `y` (content coordinates, as in `onScroll`) is at the top of the viewport. Animated unless `animated` is false. */\n scrollTo: (options: { y: number; animated?: boolean }) => void;\n}\n\nexport interface ListTemplateProps {\n /** Top bar, usually an AppBar. Stays fixed. */\n header?: ReactNode;\n /** Fixed under the header, usually a SearchBar. */\n search?: ReactNode;\n /** Fixed under the search, usually a FilterChipGroup. */\n filters?: ReactNode;\n /**\n * The list content. With `scroll` (default) the template scrolls it in a padded column:\n * ListSections, EmptyState, SkeletonList. With `scroll={false}` it fills the remaining\n * height unpadded and must scroll itself, e.g. a virtualized list such as MessageList.\n */\n children: ReactNode;\n /** Scroll the content inside the template. Set false when the content is its own list. Defaults to true. */\n scroll?: boolean;\n /** Pad the bottom safe-area inset. Set false on a tab screen, where the TabBar pads it. Defaults to true. */\n safeAreaBottom?: boolean;\n testID?: string;\n /**\n * Pinned under the content above a hairline, e.g. the viewer's own ListRow or RankedRow\n * while it is scrolled out of view. The app decides when to pass it.\n */\n footer?: ReactNode;\n /**\n * Reports the scroll position with the viewport and content heights, whenever the list\n * scrolls or either height changes (so also once both are measured, before any scroll).\n * Use it to tell when a row is out of view, e.g. to show `footer`. Only with `scroll`.\n */\n onScroll?: (event: ListTemplateScrollEvent) => void;\n /** Receives a handle that scrolls the content, e.g. back to the row pinned in `footer`. Only with `scroll`. */\n scrollRef?: Ref<ListTemplateScrollHandle>;\n}\n\nconst COLUMN = \"w-full max-w-[720px] self-center\";\n\n/**\n * List screen frame: safe-area aware, a fixed header, optional search and filter rows,\n * then the list content in a column capped at 720px and centered on wide screens, and an\n * optional pinned footer row. With `onScroll` and `scrollRef` the app can tell what is in\n * view and scroll the content, e.g. to pin the viewer's own row while it is scrolled away.\n */\nexport function ListTemplate({\n header,\n search,\n filters,\n children,\n scroll = true,\n safeAreaBottom = true,\n testID,\n footer,\n onScroll,\n scrollRef,\n}: ListTemplateProps) {\n const view = useRef<ScrollView>(null);\n const position = useRef<ListTemplateScrollEvent>({\n offsetY: 0,\n viewportHeight: 0,\n contentHeight: 0,\n });\n useImperativeHandle(\n scrollRef,\n () => ({\n scrollTo: ({ y, animated = true }) =>\n view.current?.scrollTo({ y: Math.max(0, y), animated }),\n }),\n [],\n );\n const report = (next: Partial<ListTemplateScrollEvent>) => {\n position.current = { ...position.current, ...next };\n onScroll?.(position.current);\n };\n\n return (\n <SafeAreaBox\n testID={testID}\n edges={safeAreaBottom ? [\"top\", \"bottom\"] : [\"top\"]}\n className=\"flex-1 bg-[hsl(var(--background))]\"\n >\n <View className={COLUMN}>{header}</View>\n {search || filters ? (\n <View className={`${COLUMN} gap-3 px-4 pt-3`}>\n {search}\n {filters}\n </View>\n ) : null}\n {scroll ? (\n <ScrollView\n ref={view}\n className=\"flex-1\"\n contentContainerClassName={`${COLUMN} gap-6 px-4 pb-6 pt-4`}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode=\"on-drag\"\n scrollEventThrottle={onScroll ? 16 : undefined}\n onScroll={\n onScroll\n ? (e: NativeSyntheticEvent<NativeScrollEvent>) =>\n report({\n offsetY: e.nativeEvent.contentOffset.y,\n viewportHeight: e.nativeEvent.layoutMeasurement.height,\n contentHeight: e.nativeEvent.contentSize.height,\n })\n : undefined\n }\n onLayout={\n onScroll\n ? (e: LayoutChangeEvent) =>\n report({ viewportHeight: e.nativeEvent.layout.height })\n : undefined\n }\n onContentSizeChange={\n onScroll\n ? (_width: number, height: number) =>\n report({ contentHeight: height })\n : undefined\n }\n >\n {children}\n </ScrollView>\n ) : (\n <View className={`${COLUMN} flex-1`}>{children}</View>\n )}\n {footer ? (\n <View className=\"border-t border-[hsl(var(--border))] bg-[hsl(var(--background))]\">\n <View className={`${COLUMN} px-4 py-1`}>{footer}</View>\n </View>\n ) : null}\n </SafeAreaBox>\n );\n}\n","import { useEffect, useRef } from \"react\";\nimport { Animated, Platform, View } from \"react-native\";\nimport { SafeAreaBox } from \"../../atoms/safe-area/SafeArea\";\nimport { Button } from \"../../atoms/button/Button\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { Text } from \"../../atoms/text/Text\";\n\n/** PIN entry: dots for the digits typed so far and a numeric keypad. */\nexport interface LockTemplatePin {\n /** Number of digits, e.g. 4 or 6. */\n length: number;\n /** Digits typed so far; the PIN is controlled. */\n value: string;\n onChange: (value: string) => void;\n /** Called with the full PIN when the last digit is typed. The app verifies it. */\n onComplete?: (value: string) => void;\n}\n\n/** Button that starts the app's biometric prompt (the engine stays in the app, D9). */\nexport interface LockTemplateBiometric {\n /** Ionicons name, e.g. \"finger-print\" or \"scan-outline\". */\n icon: IconName;\n /** Accessible name; also the button text when there is no PIN, e.g. \"Unlock\". */\n label: string;\n onPress: () => void;\n /** Blocks presses, e.g. while the OS prompt is up. */\n disabled?: boolean;\n testID?: string;\n}\n\nexport interface LockTemplateProps {\n title: string;\n subtitle?: string;\n /** PIN dots and keypad. Without it the screen shows only the biometric button. */\n pin?: LockTemplatePin;\n /** Biometric unlock: a keypad key next to 0, or a full-width button without `pin`. */\n biometric?: LockTemplateBiometric;\n /** Shown under the dots, announced as an alert; the dots shake each time it changes. */\n error?: string | null;\n /** Accessible name of the delete key. Defaults to \"Delete\". */\n deleteLabel?: string;\n /** Accessible name of the dots. Defaults to \"<n> of <length> digits entered\". */\n formatProgress?: (entered: number, length: number) => string;\n testID?: string;\n}\n\n// Keys tint the secondary color while pressed (PressableSurface `fill` feedback).\nconst KEY = \"h-[72px] w-[72px] items-center justify-center rounded-full\";\nconst ROWS = [\n [\"1\", \"2\", \"3\"],\n [\"4\", \"5\", \"6\"],\n [\"7\", \"8\", \"9\"],\n];\n\n/**\n * App lock screen: title and subtitle, PIN dots, a numeric keypad with delete and an\n * optional biometric key. Wrong PINs show an error and shake the dots; the app verifies.\n * A full-screen cover: it pads its own safe-area insets even when shown in a Modal over a\n * screen whose AppShell already padded them (D66).\n */\nexport function LockTemplate({\n title,\n subtitle,\n pin,\n biometric,\n error,\n deleteLabel = \"Delete\",\n formatProgress = (n, length) => `${n} of ${length} digits entered`,\n testID,\n}: LockTemplateProps) {\n const shake = useRef(new Animated.Value(0)).current;\n\n useEffect(() => {\n if (!error) return;\n const useNativeDriver = Platform.OS !== \"web\";\n Animated.sequence(\n [10, -10, 6, -6, 0].map((toValue) =>\n Animated.timing(shake, { toValue, duration: 60, useNativeDriver }),\n ),\n ).start();\n }, [error, shake]);\n\n const press = (digit: string) => {\n if (!pin || pin.value.length >= pin.length) return;\n const next = pin.value + digit;\n pin.onChange(next);\n if (next.length === pin.length) pin.onComplete?.(next);\n };\n\n const digitKey = (digit: string) => (\n <PressableSurface\n key={digit}\n testID={testID ? `${testID}-key-${digit}` : undefined}\n accessibilityRole=\"button\"\n onPress={() => press(digit)}\n className={KEY}\n >\n <Text variant=\"numeral\">{digit}</Text>\n </PressableSurface>\n );\n\n return (\n <SafeAreaBox\n root\n testID={testID}\n edges={[\"top\", \"bottom\"]}\n className=\"flex-1 items-center justify-center bg-[hsl(var(--background))] px-6\"\n >\n <View className=\"w-full max-w-[360px] items-center gap-8\">\n <View className=\"items-center gap-2\">\n <Icon\n name=\"lock-closed-outline\"\n size={28}\n className=\"text-[hsl(var(--foreground))]\"\n />\n <Text role=\"heading\" variant=\"title\" className=\"text-center\">\n {title}\n </Text>\n {subtitle ? (\n <Text variant=\"small\" tone=\"muted\" className=\"text-center\">\n {subtitle}\n </Text>\n ) : null}\n </View>\n <View className=\"items-center gap-3\">\n {pin ? (\n <Animated.View\n testID={testID ? `${testID}-dots` : undefined}\n role=\"img\"\n aria-label={formatProgress(pin.value.length, pin.length)}\n style={{ transform: [{ translateX: shake }] }}\n >\n {/* The row lives on a plain View: on web, className on this Animated.View is not applied. */}\n <View className=\"flex-row gap-4\">\n {Array.from({ length: pin.length }, (_, i) => (\n <View\n key={i}\n className={`h-3.5 w-3.5 rounded-full border ${\n error\n ? \"border-[hsl(var(--destructive))]\"\n : \"border-[hsl(var(--foreground))]\"\n } ${\n i < pin.value.length\n ? error\n ? \"bg-[hsl(var(--destructive))]\"\n : \"bg-[hsl(var(--foreground))]\"\n : \"\"\n }`}\n />\n ))}\n </View>\n </Animated.View>\n ) : null}\n {error ? (\n <Text\n testID={testID ? `${testID}-error` : undefined}\n accessibilityRole=\"alert\"\n variant=\"caption\"\n tone=\"destructive\"\n className=\"text-center\"\n >\n {error}\n </Text>\n ) : null}\n </View>\n {pin ? (\n <View className=\"gap-3\">\n {ROWS.map((row) => (\n <View key={row[0]} className=\"flex-row gap-6\">\n {row.map(digitKey)}\n </View>\n ))}\n <View className=\"flex-row gap-6\">\n {biometric ? (\n <PressableSurface\n testID={biometric.testID}\n accessibilityRole=\"button\"\n accessibilityLabel={biometric.label}\n accessibilityState={{ disabled: !!biometric.disabled }}\n disabled={biometric.disabled}\n onPress={biometric.onPress}\n className={KEY}\n >\n <Icon\n name={biometric.icon}\n size={28}\n className=\"text-[hsl(var(--foreground))]\"\n />\n </PressableSurface>\n ) : (\n <View className=\"h-[72px] w-[72px]\" />\n )}\n {digitKey(\"0\")}\n <PressableSurface\n testID={testID ? `${testID}-delete` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel={deleteLabel}\n accessibilityState={{ disabled: pin.value.length === 0 }}\n disabled={pin.value.length === 0}\n onPress={() => pin.onChange(pin.value.slice(0, -1))}\n dimDisabled={false}\n className={KEY}\n >\n <Icon\n name=\"backspace-outline\"\n size={26}\n className=\"text-[hsl(var(--foreground))]\"\n />\n </PressableSurface>\n </View>\n </View>\n ) : biometric ? (\n <Button\n label={biometric.label}\n onPress={biometric.onPress}\n disabled={biometric.disabled}\n testID={biometric.testID}\n />\n ) : null}\n </View>\n </SafeAreaBox>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { ScrollView, StyleSheet, View } from \"react-native\";\nimport { Icon, type IconName } from \"../../atoms/icon/Icon\";\nimport { PressableSurface } from \"../../atoms/pressable-surface/PressableSurface\";\nimport { useSafeAreaInsetsOnce } from \"../../atoms/safe-area/SafeArea\";\nimport { Surface } from \"../../atoms/surface/Surface\";\n\n/** A round floating button over the canvas, such as \"Recenter\" or \"Layers\". */\nexport interface OverlayTemplateAction {\n /** Ionicons name, e.g. \"locate-outline\". */\n icon: IconName;\n /** Accessible name of the button. */\n label: string;\n onPress: () => void;\n testID?: string;\n}\n\nexport interface OverlayTemplateProps {\n /** The app's full-bleed engine (a map, a camera preview, a drawing surface), filling the screen edge to edge and keeping its gestures (D9). */\n canvas: ReactNode;\n /** Floats at the top under the status bar, usually a SearchBar. */\n search?: ReactNode;\n /** Round buttons stacked at the top right, under the search. */\n actions?: OverlayTemplateAction[];\n /** Floats at the bottom, usually a FloatingCard for the selected item. */\n card?: ReactNode;\n /** A BottomSheet for a list or filters; it opens as a modal over the screen. */\n sheet?: ReactNode;\n /** Adds the bottom safe-area inset under the card. Set false above a TabBar, which pads it. Defaults to true. */\n safeAreaBottom?: boolean;\n testID?: string;\n /**\n * A larger floating panel docked at the bottom left, up to 400px wide and as tall as\n * the space under the search allows (it scrolls), e.g. an item's full detail\n * (DetailHeader, ImageCarousel, ActionCard) on a wide screen. Use it instead of `card`.\n */\n panel?: ReactNode;\n /** Adds the top safe-area inset above the search. Set false under an AppBar, which pads it. Defaults to true. */\n safeAreaTop?: boolean;\n}\n\n/**\n * Full-screen canvas with floating overlays: the app's engine edge to edge, with a search bar and\n * round action buttons floating at the top, a card floating at the bottom and an\n * optional bottom sheet. Overlays respect the safe area and let touches through to\n * the canvas around them.\n */\nexport function OverlayTemplate({\n canvas,\n search,\n actions,\n card,\n sheet,\n safeAreaBottom = true,\n testID,\n panel,\n safeAreaTop = true,\n}: OverlayTemplateProps) {\n const insets = useSafeAreaInsetsOnce();\n const top = safeAreaTop ? insets.top : 0;\n const bottom = safeAreaBottom ? insets.bottom : 0;\n // 16px gutters plus the side insets (landscape notches).\n const side = {\n paddingLeft: 16 + insets.left,\n paddingRight: 16 + insets.right,\n };\n\n return (\n <View testID={testID} className=\"flex-1 bg-[hsl(var(--secondary))]\">\n <View style={StyleSheet.absoluteFill}>{canvas}</View>\n <View\n testID={testID ? `${testID}-top` : undefined}\n pointerEvents=\"box-none\"\n style={{ ...side, paddingTop: 12 + top }}\n className=\"absolute left-0 right-0 top-0 gap-3\"\n >\n {search ? (\n <View className=\"w-full max-w-[720px] self-center rounded-[var(--radius-lg)] bg-[hsl(var(--background))] shadow-md\">\n {search}\n </View>\n ) : null}\n {actions?.length ? (\n <View pointerEvents=\"box-none\" className=\"items-end gap-2\">\n {actions.map((action) => (\n <PressableSurface\n key={action.label}\n testID={action.testID}\n accessibilityRole=\"button\"\n accessibilityLabel={action.label}\n onPress={action.onPress}\n feedback=\"none\"\n className=\"h-11 w-11 items-center justify-center rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--background))] shadow-md active:opacity-80\"\n >\n <Icon\n name={action.icon}\n className=\"text-[hsl(var(--foreground))]\"\n />\n </PressableSurface>\n ))}\n </View>\n ) : null}\n </View>\n {card ? (\n <View\n testID={testID ? `${testID}-bottom` : undefined}\n pointerEvents=\"box-none\"\n style={{ ...side, paddingBottom: 16 + bottom }}\n className=\"absolute bottom-0 left-0 right-0 items-center\"\n >\n {card}\n </View>\n ) : null}\n {panel ? (\n <View\n testID={testID ? `${testID}-panel` : undefined}\n pointerEvents=\"box-none\"\n style={{\n ...side,\n // Under the search bar (about 48px plus the 12px gap) when there is one.\n paddingTop: 12 + top + (search ? 60 : 0),\n paddingBottom: 16 + bottom,\n }}\n className=\"absolute bottom-0 left-0 right-0 top-0 items-start justify-end\"\n >\n <Surface\n variant=\"floating\"\n className=\"max-h-full w-[400px] max-w-full overflow-hidden\"\n >\n <ScrollView contentContainerClassName=\"gap-4 p-4\">\n {panel}\n </ScrollView>\n </Surface>\n </View>\n ) : null}\n {sheet}\n </View>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { ScrollView } from \"react-native\";\nimport { SafeAreaBox } from \"../../atoms/safe-area/SafeArea\";\n\nexport interface SettingsTemplateProps {\n /** Header slot, usually an AppBar with a back action. Stays fixed above the scroll. */\n header?: ReactNode;\n /** SettingsSection cards, stacked with a 20px gap. */\n children: ReactNode;\n testID?: string;\n}\n\n/**\n * Settings screen frame: safe-area aware, a fixed header, then a scrolling column of\n * sections capped at 640px and centered on wide screens.\n */\nexport function SettingsTemplate({\n header,\n children,\n testID,\n}: SettingsTemplateProps) {\n return (\n <SafeAreaBox\n testID={testID}\n edges={[\"top\", \"bottom\"]}\n className=\"flex-1 bg-[hsl(var(--background))]\"\n >\n {header}\n <ScrollView\n className=\"flex-1\"\n contentContainerClassName=\"w-full max-w-[640px] gap-5 self-center px-5 pb-10 pt-6\"\n keyboardShouldPersistTaps=\"handled\"\n >\n {children}\n </ScrollView>\n </SafeAreaBox>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { useWindowDimensions, View } from \"react-native\";\nimport { SafeAreaBox } from \"../../atoms/safe-area/SafeArea\";\n\n/** Width of the list pane on wide screens: `sm` 320px, `md` 380px, `lg` 440px. */\nexport type SplitLayoutListSize = \"sm\" | \"md\" | \"lg\";\n\n/** Which pane a narrow screen shows. */\nexport type SplitLayoutPane = \"list\" | \"detail\";\n\nexport interface SplitLayoutProps {\n /** The list or sidebar pane, e.g. a ListTemplate's content or ListSections. */\n list: ReactNode;\n /** The selected item's pane, e.g. a DetailTemplate or a OverlayTemplate. */\n detail?: ReactNode;\n /** Shown in the detail pane on wide screens while `detail` is unset, usually an EmptyState. */\n emptyDetail?: ReactNode;\n /** Wide screens only: a NavigationRail at the start of the row. */\n rail?: ReactNode;\n /** Narrow screens only: a TabBar under the pane. */\n tabBar?: ReactNode;\n /** Which pane a narrow screen shows. Defaults to `detail` while `detail` is set, otherwise `list`. */\n narrowPane?: SplitLayoutPane;\n /** Forces the wide (true) or narrow (false) layout. Defaults to the window width against `breakpoint`. */\n wide?: boolean;\n /** Window width in px from which the layout is wide. Defaults to 768. */\n breakpoint?: number;\n /** Width of the list pane on wide screens. Defaults to `md`. */\n listSize?: SplitLayoutListSize;\n testID?: string;\n}\n\nconst LIST_WIDTH: Record<SplitLayoutListSize, string> = {\n sm: \"w-[320px]\",\n md: \"w-[380px]\",\n lg: \"w-[440px]\",\n};\n\n/** `wide` is true while the window is at least `breakpoint` px wide (768 by default). */\nexport function useSplitLayout(breakpoint = 768): { wide: boolean } {\n const { width } = useWindowDimensions();\n return { wide: width >= breakpoint };\n}\n\n/**\n * Master-detail frame: on wide screens (tablet, web) an optional NavigationRail, a\n * fixed-width list pane and a detail pane side by side; on narrow screens one pane at\n * a time above an optional TabBar. Safe-area aware; the rail and the tab bar pad\n * their own insets.\n */\nexport function SplitLayout({\n list,\n detail,\n emptyDetail,\n rail,\n tabBar,\n narrowPane,\n wide,\n breakpoint = 768,\n listSize = \"md\",\n testID,\n}: SplitLayoutProps) {\n const auto = useSplitLayout(breakpoint).wide;\n const isWide = wide ?? auto;\n\n if (isWide) {\n return (\n <View\n testID={testID}\n className=\"flex-1 flex-row bg-[hsl(var(--background))]\"\n >\n {rail}\n <SafeAreaBox\n edges={[\"top\", \"bottom\", \"right\"]}\n className=\"flex-1 flex-row\"\n >\n <View\n testID={testID ? `${testID}-list` : undefined}\n className={`${LIST_WIDTH[listSize]} border-r border-[hsl(var(--border))]`}\n >\n {list}\n </View>\n <View\n testID={testID ? `${testID}-detail` : undefined}\n className=\"flex-1\"\n >\n {detail ?? emptyDetail}\n </View>\n </SafeAreaBox>\n </View>\n );\n }\n\n const pane = narrowPane ?? (detail ? \"detail\" : \"list\");\n return (\n <View testID={testID} className=\"flex-1 bg-[hsl(var(--background))]\">\n <SafeAreaBox\n edges={\n tabBar ? [\"top\", \"left\", \"right\"] : [\"top\", \"bottom\", \"left\", \"right\"]\n }\n className=\"flex-1\"\n >\n {pane === \"detail\" ? detail : list}\n </SafeAreaBox>\n {tabBar}\n </View>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { View } from \"react-native\";\nimport { SafeAreaBox } from \"../../atoms/safe-area/SafeArea\";\n\nexport interface VoiceTemplateProps {\n /** Top bar, usually an AppBar. */\n header?: ReactNode;\n /** The centerpiece, usually an Orb. */\n orb: ReactNode;\n /** Shown under the orb, usually an ErrorState. */\n error?: ReactNode;\n /** Shown under the orb and error, usually a LiveCaption. */\n caption?: ReactNode;\n /** Bottom row of controls, usually ActionToggles. */\n controls: ReactNode;\n testID?: string;\n}\n\n/**\n * Voice screen: safe-area aware, themed background, a column capped at 640px\n * with the orb, error and caption centered and the controls row at the bottom.\n */\nexport function VoiceTemplate({\n header,\n orb,\n error,\n caption,\n controls,\n testID,\n}: VoiceTemplateProps) {\n return (\n <SafeAreaBox\n testID={testID}\n edges={[\"top\", \"bottom\"]}\n className=\"flex-1 bg-[hsl(var(--background))]\"\n >\n <View className=\"w-full max-w-[640px] flex-1 self-center\">\n {header}\n <View className=\"flex-1 px-6 pb-10 pt-6\">\n <View className=\"flex-1 items-center justify-center gap-6\">\n {orb}\n {error}\n {caption}\n </View>\n <View className=\"flex-row items-center justify-center gap-6\">\n {controls}\n </View>\n </View>\n </View>\n </SafeAreaBox>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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,cAChC,WAAU;AAAA,cAEV;AAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,QAAQ,SAAS,GAAG,MAAM,UAAU;AAAA,oBACpC,WAAW,GAAG,WAAW,QAAQ,CAAC;AAAA,oBAEjC;AAAA;AAAA,gBACH;AAAA,gBACA;AAAA,kBAAC;AAAA;AAAA,oBACC,QAAQ,SAAS,GAAG,MAAM,YAAY;AAAA,oBACtC,WAAU;AAAA,oBAET,oBAAU;AAAA;AAAA,gBACb;AAAA;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AAEA,QAAM,OAAO,eAAe,SAAS,WAAW;AAChD,SACE,+CAAC,8BAAK,QAAgB,WAAU,sCAC9B;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,OACE,SAAS,CAAC,OAAO,QAAQ,OAAO,IAAI,CAAC,OAAO,UAAU,QAAQ,OAAO;AAAA,QAEvE,WAAU;AAAA,QAET,mBAAS,WAAW,SAAS;AAAA;AAAA,IAChC;AAAA,IACC;AAAA,KACH;AAEJ;;;AC1GA,IAAAC,wBAAqB;AAsCX,IAAAC,uBAAA;AAjBH,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAuB;AACrB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,OAAO,CAAC,OAAO,QAAQ;AAAA,MACvB,WAAU;AAAA,MAEV,yDAAC,8BAAK,WAAU,2CACb;AAAA;AAAA,QACD,+CAAC,8BAAK,WAAU,0BACd;AAAA,yDAAC,8BAAK,WAAU,4CACb;AAAA;AAAA,YACA;AAAA,YACA;AAAA,aACH;AAAA,UACA,8CAAC,8BAAK,WAAU,8CACb,oBACH;AAAA,WACF;AAAA,SACF;AAAA;AAAA,EACF;AAEJ;","names":["import_react_native","import_react","import_react_native","import_jsx_runtime","import_nativewind","import_jsx_runtime","Ionicons","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","TONE","RNText","import_jsx_runtime","SIZE","import_jsx_runtime","import_react_native","import_react_native","import_jsx_runtime","SIZE","import_jsx_runtime","TONE","import_jsx_runtime","import_react_native","import_react","import_react_native","import_jsx_runtime","import_jsx_runtime","import_react_native","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_react_native","import_jsx_runtime","VARIANT","import_jsx_runtime","import_react","import_react_native","import_react_native_safe_area_context","import_jsx_runtime","VARIANT","import_jsx_runtime","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_react_native","import_jsx_runtime","import_jsx_runtime","import_react_native","import_react_native","import_react_native","import_jsx_runtime","RNImage","import_react_native","import_jsx_runtime","import_jsx_runtime","TILE","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react","import_react_native","import_react_native","import_jsx_runtime","TONE","import_jsx_runtime","CHIP","import_react_native","import_react","import_react_native","import_jsx_runtime","import_jsx_runtime","import_react_native","import_jsx_runtime","import_jsx_runtime","import_react","import_react_native","import_react_native_safe_area_context","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_react_native","import_jsx_runtime","import_jsx_runtime","import_react","import_react_native","import_react_native","import_jsx_runtime","import_react_native","import_react_native","import_jsx_runtime","SIZE","import_jsx_runtime","import_jsx_runtime","import_react","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_react","import_react_native","import_jsx_runtime","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_react_native","import_jsx_runtime","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_react_native","import_jsx_runtime","import_jsx_runtime","SIZE","import_react_native","import_jsx_runtime","import_react","import_react_native","import_jsx_runtime","import_react","import_react_native","import_jsx_runtime","BOX","import_react","import_react_native","import_react_native","import_jsx_runtime","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react","import_react_native","import_jsx_runtime","MIN_OPACITY","PULSE_MS","import_react","import_react_native","import_react","import_jsx_runtime","import_jsx_runtime","import_react_native","import_jsx_runtime","VALUE_TONE","LAYOUT","import_react_native","import_jsx_runtime","import_react","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","COLUMN","import_react","import_react_native","import_jsx_runtime","COLUMN","import_react","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime"]}
|