Package-level declarations
Types
The subset of DesignTokens that should breathe with the surface. Everything else — shapes, elevation, motion and the a11y-constant Size.minTouch — deliberately stays static in DesignTokens: a 48dp touch target is 48dp on every device, and corner radius is brand identity, not a function of viewport width.
Capture a composable subtree as an ImageBitmap, on every Compose Multiplatform target.
Design tokens — the single source of spacing / shape / size values. Consume these instead of hard-coded dp so the whole fleet shares one visual rhythm (4dp scale).
Viewing posture and input model. Not derivable from width — it comes from the platform, via rememberFormFactor.
Optional official Google Pay asset, supplied by :designsystem-wallet-gms.
Default seam: holds the choice for the process lifetime only.
What the user is pointing and typing with, and how the panel is folded — the axes FormFactor deliberately cannot express.
Material 3 motion tokens held as plain numbers, so the toolkit does not depend on the alpha MaterialTheme.motionScheme API. Values are copied from androidx MotionTokens.kt (v0_103) and StandardMotionTokens.kt; spec: https://m3.material.io/styles/motion/easing-and-duration/tokens-specs
One top-level destination in AdaptiveNavigationShell.
Which navigation affordance a surface should show.
How a single OTP cell is drawn.
Resolved visual state of one cell, in precedence order.
App-wide theme state holder (Doori ThemeController idiom). Dark-first: defaults to true when the user hasn't chosen. Reads the persisted choice from store at construction and writes every change back, so the Settings toggle survives process death once a persistent ThemeStore is bound. Wasm-safe. Bound as a Koin singleton so the shell and the Settings screen share one instance.
Persistence seam for the theme choice. The default is in-memory; core:data binds a DataStore-backed implementation in Koin (same interface → no shell/settings changes), which is how the dark-mode choice survives process death.
How much room there is, within a given FormFactor. The thresholds differ per form factor (see windowTypeFor) — Expanded means "a big TV" on FormFactor.Tv and "a tablet in landscape" on FormFactor.Handheld.
Properties
defaults to Compact handheld rather than error("no AdaptiveTheme"). A hard error is louder, but it also breaks every @Preview and Compose UI test that renders a leaf composable without the app shell around it. Compact is the safe wrong answer — phone metrics on a television look cramped, not broken. Switch to error() if a real screen ever ships un-wrapped by accident.
Whether haptics fire at all. Independent of any sound toggle on purpose: a user who mutes sound still wants the tap, and one who disables haptics still wants the sound. true by default.
Defaults to InputProfile.Touch rather than erroring, for the same reason LocalAdaptiveTokens defaults to CompactTokens: a leaf composable rendered in a @Preview or a Compose UI test has no app shell above it, and touch-phone affordances are the safe wrong answer.
Whether decorative motion should be suppressed. false unless a parent supplies it, so a consumer that never opts in sees exactly the behaviour it had before this local existed.
Screen-level enter transition: a fade with a barely-there scale-up. Deliberately plain EnterTransition values rather than the AnimatedContentTransitionScope<NavBackStackEntry>.() -> lambdas the idiom usually ships as — that signature drags in androidx.navigation, which this module does not depend on and which has no Compose Multiplatform equivalent on every target.
Screen-level exit transition. Mirror of screenEnter.
Functions
clickable with an explicit role and onClickLabel, on a minTouchTarget-sized box.
Adaptive top-level chrome: a bottom bar on a phone, a nav rail on a tablet or desktop, and a drawer where the window is wide enough to justify one. The layout decision belongs to the window size class, not to the platform, which is why this replaces per-platform branching rather than moving it somewhere tidier.
Provides AdaptiveTokens for the current surface. Wrap the app shell once, then read LocalAdaptiveTokens.current.screenPadding anywhere below.
Escape hatch for consumers that already resolve a window size class upstream (Android currentWindowAdaptiveInfo(), a desktop window listener) and don't want a second BoxWithConstraints subcomposition at the root.
byFormFactor against the ambient LocalFormFactor.
Picks a per-surface value, overriding only the surfaces that actually differ.
byWindow against the ambient LocalWindowType.
Picks a per-bucket value. This is the whole object FooDefaults { fun width(w: WindowType) } idiom compressed to one call — the source this came from wrote that when block out longhand thirty-one times across ten files (MovieCardDefaults, BannerDefaults, ButtonDefaults, CastCardDefaults, …), which is why none of those files were worth copying individually and this function is.
Routes this subtree's drawing through controller's layer, then draws the layer as normal, so the content renders exactly as it would have and is simultaneously available to capture.
The single deferred-feature affordance. Every web feature not in v1 opens this instead of a real screen (see the "95% later" policy). One component so the message/styling stays consistent.
Caps a layout column at max and centres it. Wider than readableWidth on purpose: a grid of cards or a row of stat tiles stays legible at widths where a paragraph would not.
The succeeded-but-nothing-here sibling of LoadingState. Distinct from ErrorState on purpose: "no search results" is a normal outcome and must not be painted in the error colour.
Turns on Compose's media-query integration. Must run before any content composes.
The failed sibling of LoadingState. Retry is optional — a permanently failed screen (404, revoked access) should not offer a button that will fail again.
Grows this element while it holds focus, by AdaptiveTokens.focusScale — the "which card am I on" affordance that a D-pad surface lives or dies by, since a television is read from three metres and a subtle border change is invisible at that distance.
accessibleClickable that also fires Haptics.tick on press.
Lightweight, hand-rolled Markdown renderer — headers (#/##/###), bold (x), inline code (x), links (u rendered as underlined brand text), bullet/numbered lists, blockquotes, --- rules, and GitHub-style pipe tables. Deliberately minimal (no new dependency) — enough to render the A–G evaluation reports faithfully. Not a full CommonMark parser; unknown syntax falls back to plain text.
The minimum touch target for the current pointing device.
Grows the layout box to at least DesignTokens.Size.minTouch in both axes (DESIGN.md's touch target rule). The visible content should be centred by the caller (contentAlignment = Center), so a small pill keeps its look while its tappable area reaches 48dp.
motionEffectsSpring that follows LocalReducedMotion.
M3 effects spring (colour, alpha); snap under reduced motion. Critically damped.
motionSpatialSpring that follows LocalReducedMotion.
M3 spatial spring (movement, size); snap under reduced motion. Defaults to the default preset.
motionTween that follows LocalReducedMotion.
A tween over duration ms with easing, or snap when reducedMotion is set. Defaults to the M3 medium2 duration and the emphasized curve. Non-composable form for use outside composition and in tests; see the composable overload to default from LocalReducedMotion.
Picks the navigation affordance for a surface.
Which cell the caret is on, and how each cell should be painted.
A one-time-code field: length cells backed by a single real text field.
Page header with eyebrow, title and optional subtitle + trailing actions.
Pill-style page indicator for a carousel, banner or onboarding pager: the active page's dot stretches into a pill, the rest stay round.
Provides LocalReducedMotion to content; reduced defaults to the OS setting.
Caps a prose column at a comfortable measure and centres it.
Animates onto an already-masked value (e.g. "9f••••3a") by scrambling the visible characters through a few random glyphs before settling — makes the redaction happen visibly instead of the masked string just appearing, which is the whole point of showing it at all.
Remembers a CaptureController bound to a graphics layer scoped to this composition.
Android is the one target where the surface genuinely varies at runtime — the same codebase runs on a phone, a Wear OS watch and an Android TV. uiMode's type bits are the platform's own answer, and reading them through LocalConfiguration means a fold, a display switch or a move to an external monitor recomposes with the right tokens.
The platform's own answer for which surface this is. Android is the only target that genuinely varies at runtime (the same APK runs on a phone, a watch and a television), so it reads the system UI mode; the other targets are known at compile time.
iOS and iPadOS are both arm's-length touch surfaces, so the width axis alone separates iPhone from iPad — no runtime probe needed.
Desktop, for the same reason the browser is: this is a posture, not a screen size. A Compose Desktop window dragged narrow is still a ~360dp viewport and resolves to WindowType.Compact, which is what actually drives the layout. Desktop and Handheld share a token ladder precisely so this call only has to be right about viewing distance.
The browser is treated as Desktop. That is the posture, not the screen size — a phone browser is still a ~360dp viewport and resolves to WindowType.Compact, which is what actually drives the layout. Desktop and Handheld share a token ladder precisely so this call doesn't have to be right about the device, only about the viewing distance.
Haptics through Compose's own LocalHapticFeedback, so it works on Android, iOS and desktop with no install step (unlike the :feedback module's FeedbackAndroid.install(context); that module stays the home of custom vibration patterns and sound). Gated by LocalHapticsEnabled only.
Reads the live InputProfile from Compose's media-query integration.
Digits only, capped at length. Applied to every edit, so pasting "OTP: 123 456" from a notification yields "123456" rather than being rejected — the single most common way a user actually enters a code.
Reduced-motion-aware screenEnter: no transition at all when reducedMotion is set. Composable so it can default from LocalReducedMotion; hoist the result above a non-composable NavHost { enterTransition = { ... } } lambda.
Reduced-motion-aware screenExit. See the screenEnter overload.
Insets the content by the surface's unsafe regions and then by its adaptive screenPadding, in one call. Use this instead of padding(tokens.screenPadding).
Bordered surface card — the fundamental container: optional leading icon in a tinted rounded container, title + subtitle, and a trailing action slot, with the body rendered below in a Column.
Section label — the "// SECTION" mono caption idiom above grouped content.
A placeholder block painted in surfaceVariant, shimmering unless reducedMotion is set, in which case it is a flat static block. Decorative: it hides itself from accessibility, so pair a group of skeletons with a LoadingState-style description on the container instead.
A list-row shaped skeleton: a round avatar and lines text bars (the last one shorter).
A vertical, connected timeline. Each step renders a coloured node joined by a rail to the next; ACTIVE pulses in the primary colour, DONE shows a check, ERROR shows a cross, PENDING is muted. Any step's payload key/value rows render inline beneath its title.
ANIMATOR_DURATION_SCALE == 0 ("Remove animations"), observed live. Android has no dedicated reduce-motion flag below the newest releases, and this scale is the switch TalkBack and Settings > Accessibility > "Remove animations" both write, so it is the portable proxy.
The platform's "reduce motion" preference. Android: ANIMATOR_DURATION_SCALE == 0 (the "remove animations" developer/accessibility switch; observed live). iOS: UIAccessibility.isReduceMotionEnabled (observed live). Web: prefers-reduced-motion: reduce (read once). Desktop: false.
UIAccessibility.isReduceMotionEnabled, re-read when the user flips the setting.
Desktop has no portable reduce-motion setting; wire a per-OS probe when a consumer asks.
prefers-reduced-motion: reduce, read once per composition entry (not observed live).
Resolves the token set for a surface. Total coverage: every FormFactor x WindowType pair.
Android actual: the framework Bitmap behind the ImageBitmap, compressed losslessly.
Encodes ImageBitmap as PNG bytes, or returns null when the platform cannot.
Skiko actual: Compose's backing Skia bitmap encoded straight to PNG.
Skiko actual: Compose's backing Skia bitmap encoded straight to PNG.
Skiko actual: Compose's backing Skia bitmap encoded straight to PNG.
The device-wallet pay button: Apple's PKPaymentButton on iOS, Google's PayButton on Android.
Resolves the width bucket, using breakpoints appropriate to formFactor.
A pinch/pan/double-tap zoomable image.