vireuikit 0.7.0 → 0.8.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/kit/a11y.ts","../src/kit/geometry.ts","../src/kit/adaptive/context.ts","../src/kit/morph.ts","../src/kit/sizes.ts","../src/kit/adaptive/input.ts","../src/kit/atom.ts","../src/kit/behavior/focus.ts","../src/kit/behavior/hover.ts","../src/kit/behavior/press.ts","../src/kit/behavior/control.ts","../src/kit/behavior/visual.ts","../src/kit/menu.ts","../src/kit/response.ts"],"names":["clamp","mix","enabled"],"mappings":";;;AAMO,IAAM,SAAA,GAAsB;AAAA,EACjC,kBAAA,EAAoB,KAAA;AAAA,EACpB,gBAAA,EAAkB,KAAA;AAAA,EAClB,YAAA,EAAc;AAChB;AAKO,SAAS,WAAA,CAAY,MAAA,EAAkB,QAAA,GAAyB,EAAC,EAAa;AACnF,EAAA,OAAO;AAAA,IACL,kBAAA,EAAoB,QAAA,CAAS,kBAAA,IAAsB,MAAA,CAAO,kBAAA;AAAA,IAC1D,gBAAA,EAAkB,QAAA,CAAS,gBAAA,IAAoB,MAAA,CAAO,gBAAA;AAAA,IACtD,YAAA,EAAc,QAAA,CAAS,YAAA,IAAgB,MAAA,CAAO;AAAA,GAChD;AACF;AAeO,SAAS,eAAA,CAAgB,MAAgB,UAAA,EAAmC;AACjF,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,UAAA;AAAA,IACP,KAAA,EAAO,cAAc,IAAA,CAAK,kBAAA;AAAA,IAC1B,OAAA,EAAS,aAAa,OAAA,GAAU,OAAA;AAAA,IAChC,gBAAgB,IAAA,CAAK,gBAAA;AAAA,IACrB,gBAAgB,IAAA,CAAK;AAAA,GACvB;AACF;AAEO,SAAS,QAAA,CAAS,GAAa,CAAA,EAAsB;AAC1D,EAAA,OACE,CAAA,CAAE,kBAAA,KAAuB,CAAA,CAAE,kBAAA,IAC3B,CAAA,C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AA,EAAE;AAEjD,SAAS,cAAc,IAAA,EAAwC;AACpE,EAAA,OAAO,QAAA,CAAS,IAAI,CAAA,KAAM,CAAA,GAAI,OAAA,GAAU,OAAA;AAC1C","file":"chunk-VY5MD3CX.js","sourcesContent":["export type A11yMode = {\n reduceTransparency: boolean;\n increaseContrast: boolean;\n reduceMotion: boolean;\n};\n\nexport const A11Y_NONE: A11yMode = {\n reduceTransparency: false,\n increaseContrast: false,\n reduceMotion: false,\n};\n\n/** `undefined` follows the system; a boolean overrides it. */\nexport type A11yOverride = { [K in keyof A11yMode]?: boolean | undefined };\n\nexport function resolveA11y(system: A11yMode, override: A11yOverride = {}): A11yMode {\n return {\n reduceTransparency: override.reduceTransparency ?? system.reduceTransparency,\n increaseContrast: override.increaseContrast ?? system.increaseContrast,\n reduceMotion: override.reduceMotion ?? system.reduceMotion,\n };\n}\n\n/** `plain`: no glass was asked for. `frosted`: the stand-in when glass under reduced transparency cannot attach. */\nexport type Surface = 'plain' | 'frosted' | 'glass';\n\nexport type Presentation = {\n glass: boolean;\n /** Reduced transparency: the glass stays and frosts. */\n frost: boolean;\n surface: Surface;\n contrastBorder: boolean;\n instantSprings: boolean;\n};\n\n// Reduced motion stops the springs, not the press response itself.\nexport function presentationFor(mode: A11yMode, wantsGlass: boolean): Presentation {\n return {\n glass: wantsGlass,\n frost: wantsGlass && mode.reduceTransparency,\n surface: wantsGlass ? 'glass' : 'plain',\n contrastBorder: mode.increaseContrast,\n instantSprings: mode.reduceMotion,\n };\n}\n\nexport function sameA11y(a: A11yMode, b: A11yMode): boolean {\n return (\n a.reduceTransparency === b.reduceTransparency &&\n a.increaseContrast === b.increaseContrast &&\n a.reduceMotion === b.reduceMotion\n );\n}\n","export type Rect = { x: number; y: number; width: number; height: number };\nexport type Size = { width: number; height: number };\n\nexport function intersectRect(a: Rect, b: Rect): Rect | null {\n const x = Math.max(a.x, b.x);\n const y = Math.max(a.y, b.y);\n const right = Math.min(a.x + a.width, b.x + b.width);\n const bottom = Math.min(a.y + a.height, b.y + b.height);\n return right > x && bottom > y ? { x, y, width: right - x, height: bottom - y } : null;\n}\n\nexport function rectContains(outer: Rect, inner: Rect, tolerance = 0): boolean {\n return (\n inner.x >= outer.x - tolerance &&\n inner.y >= outer.y - tolerance &&\n inner.x + inner.width <= outer.x + outer.width + tolerance &&\n inner.y + inner.height <= outer.y + outer.height + tolerance\n );\n}\n","// What every adaptive decision reads: the window in dp, the input in three layers, the posture and reduced motion.\n// Targets collect it (the web from ResizeObserver, media queries and viewport segments; Android from its window\n// size class and FoldingFeature) and the pure functions here turn it into forms.\nimport { intersectRect, type Rect, type Size } from '../geometry';\n\nexport type InputLayers = {\n /** The primary pointer: layout density for the whole window. */\n primary: 'fine' | 'coarse';\n /** Any coarse input present: hit areas reach the touch floor without changing layout. */\n anyCoarse: boolean;\n /** Some pointer can hover. Whether one does is decided per event, never by this flag. */\n hover: boolean;\n /** A hardware keyboard is present. The web cannot query it and learns it from a key press. */\n keyboard: boolean;\n};\n\nexport const INPUT_TOUCH: InputLayers = { primary: 'coarse', anyCoarse: true, hover: false, keyboard: false };\nexport const INPUT_POINTER: InputLayers = { primary: 'fine', anyCoarse: false, hover: true, keyboard: true };\n/** A laptop with a touch screen: the pointer is primary and touch is present. */\nexport const INPUT_MIXED: InputLayers = { primary: 'fine', anyCoarse: true, hover: true, keyboard: true };\n/** A tablet with a keyboard and a trackpad attached stays touch first. */\nexport const INPUT_TABLET_KEYBOARD: InputLayers = { primary: 'coarse', anyCoarse: true, hover: true, keyboard: true };\n\n/** The hinge in window coordinates (dp). A seamless fold may be a line of zero width. */\nexport type Fold = {\n bounds: Rect;\n /** Nothing can be drawn inside the bounds. */\n occluding: boolean;\n};\n\n/** Half-open: tabletop folds horizontally (top and bottom), book vertically (left and right). Physical, not mirrored in RTL. */\nexport type Posture = { kind: 'flat' } | { kind: 'tabletop'; fold: Fold } | { kind: 'book'; fold: Fold };\n\nexport const POSTURE_FLAT: Posture = { kind: 'flat' };\n\nexport type AdaptiveContext = {\n window: Size;\n input: InputLayers;\n posture: Posture;\n reduceMotion: boolean;\n};\n\nexport function adaptiveContext(partial: Partial<AdaptiveContext> & { window: Size }): AdaptiveContext {\n return {\n window: partial.window,\n input: partial.input ?? INPUT_POINTER,\n posture: partial.posture ?? POSTURE_FLAT,\n reduceMotion: partial.reduceMotion ?? false,\n };\n}\n\nexport type HalfOpenOptions = {\n /** Where the fold's centre line sits along its axis, dp; the middle by default. */\n at?: number;\n /** The band's width across the fold, dp. */\n band?: number;\n /** By default a band of any width occludes and a line does not. */\n occluding?: boolean;\n};\n\nexport function halfOpen(kind: 'tabletop' | 'book', window: Size, options: HalfOpenOptions = {}): Posture {\n const band = Math.max(options.band ?? 0, 0);\n const span = kind === 'tabletop' ? window.height : window.width;\n const at = options.at ?? span / 2;\n const start = at - band / 2;\n const bounds =\n kind === 'tabletop'\n ? { x: 0, y: start, width: window.width, height: band }\n : { x: start, y: 0, width: band, height: window.height };\n return { kind, fold: { bounds, occluding: options.occluding ?? band > 0 } };\n}\n\n/**\n * The window's segments: one when flat, two on either side of the fold when half-open. An occluding fold's band\n * belongs to neither; a fold that does not occlude splits the window at its centre line.\n */\nexport function windowSegments(ctx: Pick<AdaptiveContext, 'window' | 'posture'>): Rect[] {\n const { width, height } = ctx.window;\n const whole = { x: 0, y: 0, width, height };\n if (ctx.posture.kind === 'flat') return [whole];\n const { bounds, occluding } = ctx.posture.fold;\n const tabletop = ctx.posture.kind === 'tabletop';\n const span = tabletop ? height : width;\n const lo = Math.min(Math.max(tabletop ? bounds.y : bounds.x, 0), span);\n const hi = Math.min(Math.max(lo + (tabletop ? bounds.height : bounds.width), lo), span);\n const end = occluding ? lo : (lo + hi) / 2;\n const start = occluding ? hi : (lo + hi) / 2;\n const parts: Rect[] = tabletop\n ? [\n { x: 0, y: 0, width, height: end },\n { x: 0, y: start, width, height: height - start },\n ]\n : [\n { x: 0, y: 0, width: end, height },\n { x: start, y: 0, width: width - start, height },\n ];\n const kept = parts.filter((r) => r.width > 0 && r.height > 0);\n return kept.length ? kept : [whole];\n}\n\n/**\n * The posture two viewport segments describe. The web has no hinge angle, so two segments count as half-open;\n * anything but two is flat.\n */\nexport function postureFromSegments(window: Size, segments: readonly Rect[]): Posture {\n if (segments.length !== 2) return POSTURE_FLAT;\n const [a, b] = [...segments].sort((p, q) => p.x - q.x || p.y - q.y) as [Rect, Rect];\n const gapX = b.x - (a.x + a.width);\n if (gapX >= 0 && a.y < b.y + b.height && b.y < a.y + a.height) {\n return { kind: 'book', fold: { bounds: { x: a.x + a.width, y: 0, width: gapX, height: window.height }, occluding: gapX > 0 } };\n }\n const [top, bottom] = [...segments].sort((p, q) => p.y - q.y) as [Rect, Rect];\n const gapY = bottom.y - (top.y + top.height);\n if (gapY >= 0) {\n return { kind: 'tabletop', fold: { bounds: { x: 0, y: top.y + top.height, width: window.width, height: gapY }, occluding: gapY > 0 } };\n }\n return POSTURE_FLAT;\n}\n\nconst area = (r: Rect | null) => (r ? r.width * r.height : 0);\n\n/** The segment a box belongs to: the one holding its centre, else the one it overlaps most. */\nexport function segmentOf(box: Rect, segments: readonly Rect[]): Rect | undefined {\n const cx = box.x + box.width / 2;\n const cy = box.y + box.height / 2;\n const holding = segments.find((s) => cx >= s.x && cx < s.x + s.width && cy >= s.y && cy < s.y + s.height);\n if (holding) return holding;\n let best: Rect | undefined;\n let most = 0;\n for (const s of segments) {\n const overlap = area(intersectRect(s, box));\n if (overlap > most) {\n most = overlap;\n best = s;\n }\n }\n if (best) return best;\n let nearest: Rect | undefined;\n let distance = Number.POSITIVE_INFINITY;\n for (const s of segments) {\n const d = Math.hypot(s.x + s.width / 2 - cx, s.y + s.height / 2 - cy);\n if (d < distance) {\n distance = d;\n nearest = s;\n }\n }\n return nearest;\n}\n\n/** Where a surface may live: its source's segment, or the largest one when nothing anchors it. It never crosses the fold. */\nexport function surfaceRegion(ctx: Pick<AdaptiveContext, 'window' | 'posture'>, source?: Rect): Rect {\n const segments = windowSegments(ctx);\n if (source) return segmentOf(source, segments) ?? segments[0]!;\n return segments.reduce((best, s) => (area(s) > area(best) ? s : best), segments[0]!);\n}\n","// Two-phase \"capsule → drop → target\" growth: atom behavior, not layout. The body contracts into\n// a drop, a neck grows from its side toward the target, the drop grows into the target with a\n// slight overshoot; closing retraces the same path in reverse, because the model holds no\n// direction, only the current phase. Source and target sizes are layout, supplied as parameters.\nimport { halfMinDp, type VireGlassGeometry, type VireGlassMorph } from 'vireglass';\n\n/** A spring with `response`-second settle time; `damping` < 1 overshoots. `instant` skips\n * integration entirely, for reduced motion. */\nexport type Spring = { x: number; v: number; target: number };\n\nexport function stepSpring(\n s: Spring,\n dt: number,\n response: number,\n damping: number,\n instant = false,\n): boolean {\n if (instant) {\n const moved = s.x !== s.target || s.v !== 0;\n s.x = s.target;\n s.v = 0;\n return moved;\n }\n const stiffness = ((2 * Math.PI) / response) ** 2;\n const friction = (4 * Math.PI * damping) / response;\n const h = 1 / 240;\n // Fixed step, but not a fixed frame budget: without this, a rare slow frame hands the spring a\n // huge dt and it diverges.\n for (let left = Math.min(dt, 0.05); left > 0; left -= h) {\n const step = Math.min(left, h);\n s.v += (stiffness * (s.target - s.x) - friction * s.v) * step;\n s.x += s.v * step;\n }\n if (Math.abs(s.target - s.x) < 1e-3 && Math.abs(s.v) < 1e-2) {\n s.x = s.target;\n s.v = 0;\n return false;\n }\n return true;\n}\n\nexport const smoothstep = (e0: number, e1: number, x: number): number => {\n const t = Math.min(Math.max((x - e0) / (e1 - e0), 0), 1);\n return t * t * (3 - 2 * t);\n};\n\nconst mix = (a: number, b: number, t: number) => a + (b - a) * t;\n\nexport type GrowthPoint = { x: number; y: number };\n\n/** A shape and its position — it has no role of its own; `growthFrame` assigns the role (body, or\n * what the body is merging into). */\nexport type GrowthShape = { geometry: VireGlassGeometry; center: GrowthPoint };\n\n/** `shrink` — capsule → drop, no overshoot. `grow` — drop → target; may exceed 1 for the\n * overshoot. Both are read as-is; `stepGrowth` owns the bounds and the handoff between them. */\nexport type GrowthPhase = { shrink: number; grow: number };\n\nexport type GrowthInk = {\n /** 0…1: how much of the source's ink is still visible (1) vs. already defocused into the drop (0). */\n outgoing: number;\n /** 0…1: how much of the target's ink has come into focus (0 = not yet, 1 = fully). */\n incoming: number;\n};\n\nexport type GrowthFrame = {\n /** The shape worth drawing as glass right now: the larger of the two, which supplies the\n * thickness and the bevel. */\n body: GrowthShape;\n /** The target shape as-is, regardless of role — it drives the response to finger/light while\n * the glass hasn't become it yet (while `body` is still the drop). */\n grown: GrowthShape;\n /** The second merge shape, ready for `toLensProps`/`toSurfaceUniforms`; `undefined` while the\n * neck hasn't grown yet or has already retracted. */\n merge: VireGlassMorph | undefined;\n ink: GrowthInk;\n};\n\n/** The drop's size — a fraction of the source's diameter, with headroom for the neck. */\nconst DROP_DIAMETER = 1.1;\n/** How far the drop travels from the source toward the target, as a fraction of the source's diameter. */\nconst DROP_LIFT = 0.5;\nconst NECK_GAIN = 0.3;\nconst NECK_RAMP = 4;\nconst CORNER_EASE_START = 0.55;\nconst INK_OUT_END = 0.4;\n// M 5:11: nothing of the menu shows until it is at 95 % of its height, and it is sharp by the overshoot.\nconst INK_IN_START = 0.9;\nconst INK_IN_END = 1;\n\nexport function growthInk(phase: GrowthPhase): GrowthInk {\n const a = Math.min(Math.max(phase.shrink, 0), 1);\n const b = Math.max(phase.grow, 0);\n // Ink leaves and arrives by going out of focus, not by plain transparency — the blur amount is\n // the drawer's job, this only reports the fraction of focus.\n return {\n outgoing: 1 - smoothstep(0, INK_OUT_END, a),\n incoming: smoothstep(INK_IN_START, INK_IN_END, b),\n };\n}\n\n/** The main shape is the larger one by half-size: it supplies the thickness and the bevel, so the\n * roles swap exactly at equal half-sizes, which is invisible on screen. */\nfunction largerOf(a: GrowthShape, b: GrowthShape): { main: GrowthShape; other: GrowthShape } {\n return halfMinDp(a.geometry) >= halfMinDp(b.geometry) ? { main: a, other: b } : { main: b, other: a };\n}\n\n/** `anchor` is the corner shared by source and target: the body pins to it, otherwise the target\n * would grow out of the drop's center instead of the button's corner. */\nexport function growthFrame(\n source: GrowthShape,\n target: GrowthShape,\n anchor: GrowthPoint,\n phase: GrowthPhase,\n): GrowthFrame {\n const dx = target.center.x - source.center.x;\n const dy = target.center.y - source.center.y;\n const len = Math.hypot(dx, dy) || 1;\n const sourceSize = halfMinDp(source.geometry) * 2;\n const lift = DROP_LIFT * sourceSize;\n const drop: GrowthPoint = {\n x: source.center.x + (dx / len) * lift,\n y: source.center.y + (dy / len) * lift,\n };\n\n const a = Math.min(Math.max(phase.shrink, 0), 1);\n const b = Math.max(phase.grow, 0);\n const keep = Math.max(1 - b, 0);\n const d = DROP_DIAMETER * sourceSize;\n\n const shrunkGeometry: VireGlassGeometry = {\n width: mix(source.geometry.width, 0.6 * d, a) * keep,\n height: mix(source.geometry.height, 0.6 * d, a) * keep,\n cornerRadius: 0,\n };\n // The source's radius EASES into the drop's rather than being replaced by it outright —\n // otherwise a field with a partial corner radius at rest would render as a full pill.\n shrunkGeometry.cornerRadius = Math.min(\n mix(source.geometry.cornerRadius, halfMinDp(shrunkGeometry), a),\n halfMinDp(shrunkGeometry),\n );\n const shrunk: GrowthShape = {\n geometry: shrunkGeometry,\n center: { x: mix(source.center.x, drop.x, a), y: mix(source.center.y, drop.y, a) },\n };\n\n const seed = d * Math.sqrt(a);\n // The sign of the corner the body pins to. Zero means the anchor sits on the same axis as the\n // source's center, so growth along that axis centers instead of hugging an edge.\n const cornerX = Math.sign(anchor.x - source.center.x);\n const cornerY = Math.sign(anchor.y - source.center.y);\n const edgeX = mix(drop.x + cornerX * (seed / 2), anchor.x, Math.min(b, 1));\n const edgeY = mix(drop.y + cornerY * (seed / 2), anchor.y, Math.min(b, 1));\n const width = mix(seed, target.geometry.width, b);\n const height = mix(seed, target.geometry.height, b);\n const grownGeometry: VireGlassGeometry = { width, height, cornerRadius: 0 };\n grownGeometry.cornerRadius = Math.min(\n mix(halfMinDp(grownGeometry), target.geometry.cornerRadius, smoothstep(CORNER_EASE_START, 1, b)),\n halfMinDp(grownGeometry),\n );\n const grown: GrowthShape = {\n geometry: grownGeometry,\n center: { x: edgeX - cornerX * (width / 2), y: edgeY - cornerY * (height / 2) },\n };\n\n const { main, other } = largerOf(grown, shrunk);\n const neck = NECK_GAIN * sourceSize * Math.min(a * NECK_RAMP, 1) * keep;\n const united = neck > 0.01 && other.geometry.width > 0.5 && other.geometry.height > 0.5;\n\n return {\n body: main,\n grown,\n merge: united\n ? {\n offsetX: other.center.x - main.center.x,\n offsetY: other.center.y - main.center.y,\n width: other.geometry.width,\n height: other.geometry.height,\n cornerRadius: other.geometry.cornerRadius,\n smoothing: neck,\n }\n : undefined,\n ink: growthInk(phase),\n };\n}\n\nexport type GrowthState = { shrink: Spring; grow: Spring };\n\nexport const createGrowthState = (): GrowthState => ({\n shrink: { x: 0, v: 0, target: 0 },\n grow: { x: 0, v: 0, target: 0 },\n});\n\nexport const growthPhase = (state: GrowthState): GrowthPhase => ({\n shrink: state.shrink.x,\n grow: state.grow.x,\n});\n\n/** Durations are client-specific: the default is fitted to the menu growing out of its toolbar at\n * M 5:11 (docs/acceptance.md, N9), and an atom at a different scale (an icon opening into a sheet)\n * isn't obligated to match it. The shape of the transition is shared regardless. */\nexport type GrowthTiming = {\n shrinkOpen: number;\n shrinkClose: number;\n growOpen: number;\n growClose: number;\n /** < 1 gives the target a slight overshoot on open; closing never overshoots. */\n growDampingOpen: number;\n};\n\nexport const DEFAULT_GROWTH_TIMING: GrowthTiming = {\n shrinkOpen: 0.21,\n shrinkClose: 0.14,\n growOpen: 0.38,\n growClose: 0.4,\n growDampingOpen: 0.72,\n};\n\nconst GROW_DAMPING_CLOSE = 1;\nconst SHRINK_DAMPING = 1;\nconst GROW_STARTS_AT = 0.8;\nconst SHRINK_RETURNS_AT = 0.12;\n\n/** Growth starts once the drop has gathered, and the reverse on close. `reduceMotion` turns off\n * the spring entirely: both phases jump straight to their target in one step, with no overshoot\n * and no defocus phase. */\nexport function stepGrowth(\n state: GrowthState,\n dt: number,\n open: boolean,\n reduceMotion = false,\n timing: GrowthTiming = DEFAULT_GROWTH_TIMING,\n): boolean {\n const { shrink, grow } = state;\n if (reduceMotion) {\n shrink.target = open ? 1 : 0;\n grow.target = open ? 1 : 0;\n } else if (open) {\n shrink.target = 1;\n if (shrink.x > GROW_STARTS_AT) grow.target = 1;\n } else {\n grow.target = 0;\n if (grow.x < SHRINK_RETURNS_AT) shrink.target = 0;\n }\n const movedShrink = stepSpring(\n shrink,\n dt,\n open ? timing.shrinkOpen : timing.shrinkClose,\n SHRINK_DAMPING,\n reduceMotion,\n );\n const movedGrow = stepSpring(\n grow,\n dt,\n open ? timing.growOpen : timing.growClose,\n open ? timing.growDampingOpen : GROW_DAMPING_CLOSE,\n reduceMotion,\n );\n return movedShrink || movedGrow;\n}\n","import { concentricRadius } from 'vireglass';\n\nexport type ControlSize = 'touch' | 'small' | 'medium' | 'large' | 'xlarge';\n\nexport const CONTROL_SIZES: readonly ControlSize[] = ['touch', 'small', 'medium', 'large', 'xlarge'];\n\nexport type SizeSpec = {\n /** Body height; an icon button is a square of this side. */\n height: number;\n paddingX: number;\n icon: number;\n radius: number;\n shape: 'capsule' | 'rounded';\n};\n\nexport const MIN_TOUCH_TARGET_DP = 44;\nexport const MIN_POINTER_TARGET_DP = 24;\n\nconst capsule = (height: number, paddingX: number): SizeSpec => ({\n height,\n paddingX,\n icon: Math.round(height / 2),\n radius: height / 2,\n shape: 'capsule',\n});\n\nconst rounded = (height: number, paddingX: number): SizeSpec => ({\n height,\n paddingX,\n icon: Math.round(height / 2),\n radius: height / 4,\n shape: 'rounded',\n});\n\n// Where each number comes from: docs/acceptance.md.\nexport const BUTTON_SIZES: Readonly<Record<ControlSize, SizeSpec>> = {\n touch: capsule(44, 20),\n small: rounded(24, 10),\n medium: rounded(32, 14),\n large: capsule(40, 18),\n xlarge: capsule(48, 22),\n};\n\nexport function iconButtonSize(size: ControlSize): SizeSpec & { width: number } {\n const spec = BUTTON_SIZES[size];\n return { ...spec, width: spec.height, paddingX: 0 };\n}\n\nexport type MenuSizeSpec = {\n /** Row height; the glyph sits centred in a square of it. */\n row: number;\n padding: number;\n /** The active item's highlight. */\n itemRadius: number;\n /** Concentric with the highlight: its radius plus the padding. */\n radius: number;\n icon: number;\n /** The label's inset in an item without a glyph. */\n labelPad: number;\n};\n\nconst MENU_PADDING = 0.3;\n\nexport function menuSize(size: ControlSize): MenuSizeSpec {\n const spec = BUTTON_SIZES[size];\n const padding = Math.round(spec.height * MENU_PADDING);\n return {\n row: spec.height,\n padding,\n itemRadius: spec.radius,\n radius: spec.radius + padding,\n icon: spec.icon,\n labelPad: spec.paddingX,\n };\n}\n\nexport function nestedRadius(outerRadius: number, inset: number, minimum = 0): number {\n return concentricRadius(outerRadius, inset, minimum);\n}\n\nexport function defaultSize(input: { touch: boolean }): ControlSize {\n return input.touch ? 'touch' : 'medium';\n}\n\nexport function hitSlop(bodyDp: number, minTargetDp: number): number {\n return bodyDp >= minTargetDp ? 0 : (minTargetDp - bodyDp) / 2;\n}\n\nexport function minTarget(input: { touch: boolean }): number {\n return input.touch ? MIN_TOUCH_TARGET_DP : MIN_POINTER_TARGET_DP;\n}\n","// The three input layers turned into what an atom needs. One flag cannot do it: a laptop with a touch screen needs\n// the pointer's density and the finger's hit area at once, and a tablet with a trackpad stays touch first but hovers.\nimport { defaultSize, minTarget, type ControlSize } from '../sizes';\nimport type { InputLayers } from './context';\n\n/** Layout density, for the whole window: the primary pointer. */\nexport function sizeTier(input: Pick<InputLayers, 'primary'>): ControlSize {\n return defaultSize({ touch: input.primary === 'coarse' });\n}\n\n/** The hit area's floor in dp: any coarse input present. The body keeps its size. */\nexport function hitTarget(input: Pick<InputLayers, 'anyCoarse'>): number {\n return minTarget({ touch: input.anyCoarse });\n}\n\n/** Hover is the event's: a mouse or a pen over the control hovers, a finger never does. */\nexport function hoversWith(pointerType: string): boolean {\n return pointerType !== 'touch';\n}\n","// Atom states — shared across every client: the set of states, what they mean, and what they do\n// to the material. Sizes, layout and per-input idioms are client-specific and live elsewhere.\nimport { activeMaterial, applyAccessibility, resolveOptics, type VireGlassMaterial } from 'vireglass';\n\nexport type VireUIKitAtomKind =\n | 'button'\n | 'iconButton'\n | 'switch'\n | 'slider'\n | 'segment'\n | 'chip'\n | 'field'\n | 'menu';\n\n/** Hover and focus don't exist everywhere: touch has neither. The atom accepts them, but has to\n * look complete at zero too — otherwise a touch client gets an unfinished look. */\nexport type VireUIKitAtomState = {\n pressed: number;\n hovered: number;\n selected: number;\n disabled: boolean;\n};\n\nexport const ATOM_AT_REST: VireUIKitAtomState = {\n pressed: 0,\n hovered: 0,\n selected: 0,\n disabled: false,\n};\n\n/**\n * Whether the piece lifts INTO the glass under press (1) or sinks into the backing (0).\n *\n * Lift isn't decoration: a small target has the finger covering it entirely, and an enlarged\n * transparent lens underneath is the only sign of a hit. A large target stays visible past the\n * finger, so it reads more naturally sinking toward the backing instead.\n */\nexport function atomLift(kind: VireUIKitAtomKind): number {\n switch (kind) {\n case 'iconButton':\n case 'switch':\n case 'slider':\n return 1;\n default:\n return 0;\n }\n}\n\n/** A disabled piece stays glass but stops asserting itself: the legibility requirement is lifted\n * and tint turns off. Hiding it via transparency won't do — the material is already transparent. */\nconst DISABLED_PRESENCE = 0.25;\n/** Hover is halfway to a press: the cursor is already on the target, but nothing is chosen yet. */\nconst HOVER_GAIN = 0.35;\n\n/** How far a state is from rest toward the pressed end, 0..1. */\nfunction activation(state: VireUIKitAtomState): number {\n if (state.disabled) return 0;\n const clamp = (v: number) => (v < 0 ? 0 : v > 1 ? 1 : v);\n return Math.max(clamp(state.selected), clamp(state.pressed), clamp(state.hovered) * HOVER_GAIN);\n}\n\n/**\n * The atom's material for a given state. Press and selection go through `activeMaterial` — for\n * glass, state is a change in the MEDIUM itself (denser, thicker, clearer), not a highlight\n * drawn over it.\n */\nexport function atomMaterial(\n base: VireGlassMaterial,\n kind: VireUIKitAtomKind,\n state: VireUIKitAtomState = ATOM_AT_REST,\n): VireGlassMaterial {\n const out = activeMaterial(base, activation(state));\n if (!state.disabled) return out;\n return { ...out, presence: out.presence * DISABLED_PRESENCE };\n}\n\n/** Whether every field on the atom matches rest — lets a client skip redraws for states its own\n * input can never produce (hover on touch, focus on Android). */\nexport function atomAtRest(state: VireUIKitAtomState): boolean {\n return (\n state.pressed === 0 && state.hovered === 0 && state.selected === 0 && state.disabled === false\n );\n}\n\n/** The veil over the backdrop: the surroundings' colour, `white` of it swapped for white, lifted by `lift` in OKLab lightness. */\nexport type AtomBody = { alpha: number; white: number; lift: number };\n\nconst REST_BODY: AtomBody = { alpha: 0.25, white: 0.15, lift: 0.1 };\nconst PRESSED_BODY: AtomBody = { alpha: 0.34, white: 0.35, lift: 0 };\nconst FROST_LIFT = 0.26;\n\n/** The body for a state; reduced transparency raises it to the density `vireglass` asks of the glass in that mode. */\nexport function atomBody(\n base: VireGlassMaterial,\n state: VireUIKitAtomState = ATOM_AT_REST,\n frost = false,\n): AtomBody {\n const on = activation(state);\n const mix = (key: keyof AtomBody) => REST_BODY[key] + (PRESSED_BODY[key] - REST_BODY[key]) * on;\n let alpha = mix('alpha');\n let white = mix('white');\n let lift = mix('lift');\n if (state.disabled) alpha *= DISABLED_PRESENCE;\n if (frost) {\n const density = applyAccessibility(resolveOptics(base), {\n reduceTransparency: true,\n increaseContrast: false,\n reduceMotion: false,\n }).bodyDensity;\n alpha = Math.max(alpha, density);\n white = 0;\n lift = FROST_LIFT;\n }\n return { alpha, white, lift };\n}\n","export type FocusChange = { type: 'focus'; visible: boolean } | { type: 'blur' };\n\n// `visible` is the browser's keyboard-modality verdict, so a ring follows a key on any device, and a\n// click, which also focuses a button, shows none.\nexport function stepFocus(event: FocusChange): boolean {\n return event.type === 'focus' && event.visible;\n}\n","export type HoverChange = { type: 'enter' } | { type: 'leave' };\n\nexport function stepHover(event: HoverChange, canHover: boolean): boolean {\n return canHover && event.type === 'enter';\n}\n","export type PressSource = 'pointer' | 'keyboard';\n\nexport type PressState = { by: PressSource | null };\n\nexport type PressEvent =\n | { type: 'down'; source: PressSource }\n | { type: 'up'; source: PressSource }\n | { type: 'cancel' }\n | { type: 'leave' };\n\nexport const PRESS_IDLE: PressState = { by: null };\n\nexport type PressStep = {\n state: PressState;\n activated: boolean;\n};\n\nexport function stepPress(state: PressState, event: PressEvent, enabled: boolean): PressStep {\n switch (event.type) {\n case 'down':\n if (!enabled || state.by !== null) return { state, activated: false };\n return { state: { by: event.source }, activated: false };\n case 'up':\n // A key lifted mid-touch is not a tap.\n if (state.by !== event.source) return { state, activated: false };\n return { state: PRESS_IDLE, activated: enabled };\n case 'cancel':\n return { state: PRESS_IDLE, activated: false };\n case 'leave':\n // A key press has no position, so the pointer leaving cannot cancel it.\n return state.by === 'pointer' ? { state: PRESS_IDLE, activated: false } : { state, activated: false };\n }\n}\n","import { stepFocus, type FocusChange } from './focus';\nimport { stepHover, type HoverChange } from './hover';\nimport { PRESS_IDLE, stepPress, type PressEvent, type PressState } from './press';\n\nexport type InputCaps = { hover: boolean };\n\nexport const TOUCH_INPUT: InputCaps = { hover: false };\nexport const POINTER_INPUT: InputCaps = { hover: true };\n\nexport type ControlState = {\n press: PressState;\n hovered: boolean;\n focused: boolean;\n disabled: boolean;\n};\n\nexport const CONTROL_IDLE: ControlState = {\n press: PRESS_IDLE,\n hovered: false,\n focused: false,\n disabled: false,\n};\n\nexport type ControlEvent = PressEvent | HoverChange | FocusChange | { type: 'disable'; disabled: boolean };\n\nexport type ControlStep = { state: ControlState; activated: boolean };\n\nexport function stepControl(state: ControlState, event: ControlEvent, caps: InputCaps): ControlStep {\n switch (event.type) {\n case 'down':\n case 'up':\n case 'cancel': {\n const next = stepPress(state.press, event, !state.disabled);\n return { state: { ...state, press: next.state }, activated: next.activated };\n }\n case 'leave': {\n const next = stepPress(state.press, event, !state.disabled);\n return { state: { ...state, press: next.state, hovered: false }, activated: false };\n }\n case 'enter':\n return {\n state: { ...state, hovered: !state.disabled && stepHover(event, caps.hover) },\n activated: false,\n };\n case 'focus':\n case 'blur': {\n // Focus moving away takes the key-up with it, so a held key press must not outlive it.\n const press = event.type === 'blur' && state.press.by === 'keyboard' ? PRESS_IDLE : state.press;\n return {\n state: { ...state, press, focused: !state.disabled && stepFocus(event) },\n activated: false,\n };\n }\n case 'disable':\n return {\n state: event.disabled\n ? { press: PRESS_IDLE, hovered: false, focused: false, disabled: true }\n : { ...state, disabled: false },\n activated: false,\n };\n }\n}\n\nexport type ControlTargets = {\n pressed: number;\n hovered: number;\n focus: number;\n disabled: boolean;\n};\n\nexport function controlTargets(state: ControlState): ControlTargets {\n return {\n pressed: state.press.by !== null ? 1 : 0,\n hovered: state.hovered ? 1 : 0,\n focus: state.focused ? 1 : 0,\n disabled: state.disabled,\n };\n}\n","import type { VireUIKitAtomState } from '../atom';\nimport { stepSpring, type Spring } from '../morph';\nimport { controlTargets, type ControlState } from './control';\n\nexport type ControlVisual = {\n pressed: Spring;\n hovered: Spring;\n focus: Spring;\n};\n\nexport const createControlVisual = (): ControlVisual => ({\n pressed: { x: 0, v: 0, target: 0 },\n hovered: { x: 0, v: 0, target: 0 },\n focus: { x: 0, v: 0, target: 0 },\n});\n\n// Press attacks fast and settles with a little give; hover and focus just ease.\nconst PRESS = { response: 0.18, damping: 0.78 };\nconst HOVER = { response: 0.22, damping: 1 };\nconst FOCUS = { response: 0.16, damping: 1 };\n\nexport function stepControlVisual(\n visual: ControlVisual,\n dt: number,\n state: ControlState,\n instant = false,\n): boolean {\n const t = controlTargets(state);\n visual.pressed.target = t.pressed;\n visual.hovered.target = t.hovered;\n visual.focus.target = t.focus;\n const a = stepSpring(visual.pressed, dt, PRESS.response, PRESS.damping, instant);\n const b = stepSpring(visual.hovered, dt, HOVER.response, HOVER.damping, instant);\n const c = stepSpring(visual.focus, dt, FOCUS.response, FOCUS.damping, instant);\n return a || b || c;\n}\n\n// The press may overshoot 1; `atomMaterial` clamps, so the raw value is passed through.\nexport function visualAtomState(visual: ControlVisual, state: ControlState): VireUIKitAtomState {\n return {\n pressed: visual.pressed.x,\n hovered: visual.hovered.x,\n selected: 0,\n disabled: state.disabled,\n };\n}\n\nexport function settleControlVisual(visual: ControlVisual, state: ControlState): void {\n stepControlVisual(visual, 0, state, true);\n}\n","// The menu: the menu-button keyboard as a pure state machine, where the menu sits relative to its\n// trigger, and what its glass surface is on each frame of the growth. Boxes are in dp.\nimport { VIREGLASS_SHEET_MATERIAL, type VireGlassMaterial, type VireGlassMorph } from 'vireglass';\nimport { ATOM_AT_REST, atomBody, atomMaterial, type AtomBody } from './atom';\nimport { intersectRect, type Rect, type Size } from './geometry';\nimport { growthFrame, type GrowthInk, type GrowthPhase, type GrowthPoint } from './morph';\n\n/**\n * `disabled`: cannot be chosen. `focusable` (default: not disabled): whether focus can land on it. A native\n * disabled button cannot take focus, so the keyboard passes over it; an aria-disabled one can (WAI-ARIA APG).\n */\nexport type MenuItem = { label: string; disabled: boolean; focusable?: boolean };\n\nexport type MenuState = {\n open: boolean;\n /** The active item, or -1 while the menu itself holds focus. */\n active: number;\n typed: string;\n /** Seconds, on whatever clock the events carry. */\n typedAt: number;\n};\n\nexport const MENU_CLOSED: MenuState = { open: false, active: -1, typed: '', typedAt: Number.NEGATIVE_INFINITY };\n\nexport type MenuDismissal = 'escape' | 'outside' | 'tab' | 'trigger';\n\nexport type MenuEvent =\n | { type: 'open'; focus: 'menu' | 'first' | 'last' }\n | { type: 'move'; to: 'next' | 'previous' | 'first' | 'last' }\n | { type: 'point'; index: number }\n | { type: 'type'; key: string; at: number }\n | { type: 'choose'; index: number }\n | { type: 'dismiss'; reason: MenuDismissal };\n\n/** Where focus goes after a step. `none` leaves it where the person put it (a press outside). */\nexport type MenuFocus =\n | { to: 'item'; index: number }\n | { to: 'menu' }\n | { to: 'trigger' }\n | { to: 'none' }\n | { to: 'stay' };\n\nexport type MenuStep = { state: MenuState; focus: MenuFocus; chosen: number | null };\n\nexport const TYPEAHEAD_SECONDS = 0.5;\n\nconst exists = (items: readonly MenuItem[], i: number) => i >= 0 && i < items.length;\nconst enabled = (items: readonly MenuItem[], i: number) => exists(items, i) && !items[i]!.disabled;\nconst reachable = (items: readonly MenuItem[], i: number) => exists(items, i) && (items[i]!.focusable ?? !items[i]!.disabled);\n\nfunction seek(items: readonly MenuItem[], from: number, step: 1 | -1): number {\n const n = items.length;\n for (let k = 1; k <= n; k += 1) {\n const i = (((from + step * k) % n) + n) % n;\n if (reachable(items, i)) return i;\n }\n return -1;\n}\n\nconst first = (items: readonly MenuItem[]) => seek(items, -1, 1);\nconst last = (items: readonly MenuItem[]) => seek(items, items.length, -1);\n\nconst toItem = (index: number): MenuFocus => (index < 0 ? { to: 'menu' } : { to: 'item', index });\n\nfunction typeahead(state: MenuState, items: readonly MenuItem[], key: string, at: number): MenuStep {\n const fresh = at - state.typedAt > TYPEAHEAD_SECONDS;\n const typed = (fresh ? '' : state.typed) + key.toLowerCase();\n // Repeating one letter cycles through the items that start with it instead of asking for \"aa\".\n const repeated = typed.length > 1 && [...typed].every((c) => c === typed[0]);\n const needle = repeated ? typed[0]! : typed;\n const start = needle.length > 1 ? state.active - 1 : state.active;\n const n = items.length;\n for (let k = 1; k <= n; k += 1) {\n const i = (((start + k) % n) + n) % n;\n if (reachable(items, i) && items[i]!.label.trim().toLowerCase().startsWith(needle)) {\n return { state: { ...state, active: i, typed, typedAt: at }, focus: { to: 'item', index: i }, chosen: null };\n }\n }\n return { state: { ...state, typed, typedAt: at }, focus: { to: 'stay' }, chosen: null };\n}\n\nexport function stepMenu(state: MenuState, event: MenuEvent, items: readonly MenuItem[]): MenuStep {\n const stay: MenuStep = { state, focus: { to: 'stay' }, chosen: null };\n if (event.type === 'open') {\n const active = event.focus === 'first' ? first(items) : event.focus === 'last' ? last(items) : -1;\n return { state: { ...MENU_CLOSED, open: true, active }, focus: toItem(active), chosen: null };\n }\n if (!state.open) return stay;\n switch (event.type) {\n case 'move': {\n const active =\n event.to === 'first'\n ? first(items)\n : event.to === 'last'\n ? last(items)\n : seek(items, state.active < 0 && event.to === 'previous' ? items.length : state.active, event.to === 'next' ? 1 : -1);\n if (active < 0) return stay;\n // Moving by other means ends a typed word: the next letter starts a new one.\n return { state: { ...state, active, typed: '' }, focus: { to: 'item', index: active }, chosen: null };\n }\n case 'point':\n if (!reachable(items, event.index) || event.index === state.active) return stay;\n return { state: { ...state, active: event.index, typed: '' }, focus: { to: 'item', index: event.index }, chosen: null };\n case 'type':\n return typeahead(state, items, event.key, event.at);\n case 'choose':\n if (!enabled(items, event.index)) return stay;\n return { state: MENU_CLOSED, focus: { to: 'trigger' }, chosen: event.index };\n case 'dismiss':\n return { state: MENU_CLOSED, focus: event.reason === 'outside' ? { to: 'none' } : { to: 'trigger' }, chosen: null };\n }\n}\n\n/** -1 is left or top, 1 is right or bottom. */\nexport type MenuCorner = { x: -1 | 1; y: -1 | 1 };\n\nexport const MENU_CORNERS = {\n 'top-left': { x: -1, y: -1 },\n 'top-right': { x: 1, y: -1 },\n 'bottom-left': { x: -1, y: 1 },\n 'bottom-right': { x: 1, y: 1 },\n} as const satisfies Record<string, MenuCorner>;\n\nexport type MenuPlacement = {\n rect: Rect;\n corner: MenuCorner;\n /** The menu's corner on the pinned side: where its growth ends. */\n anchor: GrowthPoint;\n};\n\n/** Where a menu must stay: its trigger's segment of the window, the whole viewport when nothing folds it. A size\n * alone is a region at the origin. */\nexport type MenuRegion = Size & { x?: number; y?: number };\n\n/** The trigger's corner nearest the corner of its region it sits in: the open space lies away from it. */\nexport function menuCorner(trigger: Rect, region: MenuRegion): MenuCorner {\n const x0 = region.x ?? 0;\n const y0 = region.y ?? 0;\n return {\n x: trigger.x + trigger.width / 2 <= x0 + region.width / 2 ? -1 : 1,\n y: trigger.y + trigger.height / 2 <= y0 + region.height / 2 ? -1 : 1,\n };\n}\n\nfunction along(start: number, length: number, size: number, side: -1 | 1): number {\n return side < 0 ? start : start + length - size;\n}\n\nfunction fits(at: number, size: number, lo: number, hi: number, margin: number): boolean {\n return at >= lo + margin && at + size <= hi - margin;\n}\n\nconst clamp = (v: number, lo: number, hi: number) => Math.min(Math.max(v, lo), Math.max(lo, hi));\n\n/**\n * The menu shares a corner with its trigger and covers it. An automatic corner flips on an axis where the menu would\n * leave its region and the other side fits; then it slides in. The region is the trigger's segment, so a menu never\n * crosses a fold.\n */\nexport function menuPlacement(\n trigger: Rect,\n menu: Size,\n region: MenuRegion,\n options: { corner?: MenuCorner | undefined; margin?: number } = {},\n): MenuPlacement {\n const margin = options.margin ?? 8;\n const x0 = region.x ?? 0;\n const y0 = region.y ?? 0;\n const x1 = x0 + region.width;\n const y1 = y0 + region.height;\n const width = Math.max(0, Math.min(menu.width, region.width - 2 * margin));\n const height = Math.max(0, Math.min(menu.height, region.height - 2 * margin));\n const corner: { x: -1 | 1; y: -1 | 1 } = { ...(options.corner ?? menuCorner(trigger, region)) };\n let x = along(trigger.x, trigger.width, width, corner.x);\n let y = along(trigger.y, trigger.height, height, corner.y);\n if (!options.corner) {\n const fx = along(trigger.x, trigger.width, width, corner.x === -1 ? 1 : -1);\n if (!fits(x, width, x0, x1, margin) && fits(fx, width, x0, x1, margin)) {\n corner.x = corner.x === -1 ? 1 : -1;\n x = fx;\n }\n const fy = along(trigger.y, trigger.height, height, corner.y === -1 ? 1 : -1);\n if (!fits(y, height, y0, y1, margin) && fits(fy, height, y0, y1, margin)) {\n corner.y = corner.y === -1 ? 1 : -1;\n y = fy;\n }\n }\n x = clamp(x, x0 + margin, x1 - margin - width);\n y = clamp(y, y0 + margin, y1 - margin - height);\n const rect = { x, y, width, height };\n return {\n rect,\n corner,\n anchor: { x: corner.x < 0 ? x : x + width, y: corner.y < 0 ? y : y + height },\n };\n}\n\nexport type RoundedRect = Rect & { radius: number };\n\nexport type MenuSurfaceFrame = {\n /** The surface's box this frame: the growth frame's body. */\n box: RoundedRect;\n /** The second shape for the lens's `setMorph`, offset from the box's centre; undefined once there is one body. */\n morph: VireGlassMorph | undefined;\n /** Where the content's origin sits relative to the box's: it keeps its final place while the box moves. */\n content: { x: number; y: number };\n ink: GrowthInk;\n /** How much of a drop the surface is: 0 as the trigger and as the menu, highest in between. */\n activity: number;\n};\n\nconst center = (r: Rect): GrowthPoint => ({ x: r.x + r.width / 2, y: r.y + r.height / 2 });\n\nexport function menuActivity(phase: GrowthPhase): number {\n const shrink = Math.min(Math.max(phase.shrink, 0), 1);\n const grow = Math.min(Math.max(phase.grow, 0), 1);\n return shrink * (1 - grow);\n}\n\n/** `bounds`, the menu's region, holds every frame inside it: the overshoot runs away from the anchor and could\n * otherwise reach over a fold for a few frames. */\nexport function menuSurfaceFrame(\n trigger: RoundedRect,\n menu: RoundedRect,\n anchor: GrowthPoint,\n phase: GrowthPhase,\n bounds?: Rect,\n): MenuSurfaceFrame {\n const frame = growthFrame(\n { geometry: { width: trigger.width, height: trigger.height, cornerRadius: trigger.radius }, center: center(trigger) },\n { geometry: { width: menu.width, height: menu.height, cornerRadius: menu.radius }, center: center(menu) },\n anchor,\n phase,\n );\n const { geometry, center: c } = frame.body;\n let box = {\n x: c.x - geometry.width / 2,\n y: c.y - geometry.height / 2,\n width: geometry.width,\n height: geometry.height,\n radius: geometry.cornerRadius,\n };\n let morph = frame.merge;\n const held = bounds ? intersectRect(box, bounds) : null;\n if (held && (held.width < box.width || held.height < box.height)) {\n const was = center(box);\n const now = center(held);\n box = { ...held, radius: Math.min(box.radius, held.width / 2, held.height / 2) };\n if (morph) morph = { ...morph, offsetX: morph.offsetX + was.x - now.x, offsetY: morph.offsetY + was.y - now.y };\n }\n return {\n box,\n morph,\n content: { x: menu.x - box.x, y: menu.y - box.y },\n ink: frame.ink,\n activity: menuActivity(phase),\n };\n}\n\n/** A menu is a larger piece of the same glass, and a larger piece scatters light more softly (M 7:19): it\n * takes the core's sheet scattering, which turns text under it into soft spots without turning it to mush. */\nexport function menuGlass(base: VireGlassMaterial): VireGlassMaterial {\n return { ...base, roughness: Math.max(base.roughness, VIREGLASS_SHEET_MATERIAL.roughness) };\n}\n\n/** The drop is the medium at its active end, the menu at rest is the resting glass. */\nexport function menuMaterial(base: VireGlassMaterial, activity: number): VireGlassMaterial {\n return atomMaterial(menuGlass(base), 'menu', { ...ATOM_AT_REST, pressed: activity });\n}\n\n/** The gathered medium lit by a concentrate of its surroundings: about 0.2 lighter than what it covers at\n * M 5:11, so white over a light backdrop, and only brighter over a dark one. */\nexport const MENU_DROP_BODY: AtomBody = { alpha: 0.9, white: 0.1, lift: 0.2 };\n\nexport function menuBody(base: VireGlassMaterial, activity: number, frost = false): AtomBody {\n const rest = atomBody(base, ATOM_AT_REST, frost);\n if (frost) return rest;\n const k = Math.min(Math.max(activity, 0), 1);\n const mix = (key: keyof AtomBody) => rest[key] + (MENU_DROP_BODY[key] - rest[key]) * k;\n return { alpha: mix('alpha'), white: mix('white'), lift: mix('lift') };\n}\n\nexport type MenuItemState = { active: boolean; pressed: boolean; disabled: boolean };\n\n/** Ink laid on the glass under an item, as a fraction of the ink colour. */\nexport const MENU_ITEM_FILL = { active: 0.1, pressed: 0.18 } as const;\n\nexport function menuItemFill(state: MenuItemState): number {\n if (state.disabled) return 0;\n if (state.pressed) return MENU_ITEM_FILL.pressed;\n return state.active ? MENU_ITEM_FILL.active : 0;\n}\n","import { atomLift, type VireUIKitAtomKind } from './atom';\n\nexport type PressResponse = {\n /** Fraction of its own size the body adds at full press. */\n grow: number;\n /** Glyph blur at full press, px. */\n defocus: number;\n};\n\n// A lifted piece grows more: the finger covers it, so the enlarged lens is the only sign of a hit.\nconst LIFTING: PressResponse = { grow: 0.18, defocus: 1.6 };\nconst SINKING: PressResponse = { grow: 0.06, defocus: 1 };\n\nexport function pressResponse(kind: VireUIKitAtomKind): PressResponse {\n return atomLift(kind) === 1 ? LIFTING : SINKING;\n}\n"]}
@@ -0,0 +1,104 @@
1
+ type A11yMode = {
2
+ reduceTransparency: boolean;
3
+ increaseContrast: boolean;
4
+ reduceMotion: boolean;
5
+ };
6
+ declare const A11Y_NONE: A11yMode;
7
+ /** `undefined` follows the system; a boolean overrides it. */
8
+ type A11yOverride = {
9
+ [K in keyof A11yMode]?: boolean | undefined;
10
+ };
11
+ declare function resolveA11y(system: A11yMode, override?: A11yOverride): A11yMode;
12
+ /** `plain`: no glass was asked for. `frosted`: the stand-in when glass under reduced transparency cannot attach. */
13
+ type Surface = 'plain' | 'frosted' | 'glass';
14
+ type Presentation = {
15
+ glass: boolean;
16
+ /** Reduced transparency: the glass stays and frosts. */
17
+ frost: boolean;
18
+ surface: Surface;
19
+ contrastBorder: boolean;
20
+ instantSprings: boolean;
21
+ };
22
+ declare function presentationFor(mode: A11yMode, wantsGlass: boolean): Presentation;
23
+ declare function sameA11y(a: A11yMode, b: A11yMode): boolean;
24
+
25
+ type Rect = {
26
+ x: number;
27
+ y: number;
28
+ width: number;
29
+ height: number;
30
+ };
31
+ type Size = {
32
+ width: number;
33
+ height: number;
34
+ };
35
+ declare function intersectRect(a: Rect, b: Rect): Rect | null;
36
+ declare function rectContains(outer: Rect, inner: Rect, tolerance?: number): boolean;
37
+
38
+ type InputLayers = {
39
+ /** The primary pointer: layout density for the whole window. */
40
+ primary: 'fine' | 'coarse';
41
+ /** Any coarse input present: hit areas reach the touch floor without changing layout. */
42
+ anyCoarse: boolean;
43
+ /** Some pointer can hover. Whether one does is decided per event, never by this flag. */
44
+ hover: boolean;
45
+ /** A hardware keyboard is present. The web cannot query it and learns it from a key press. */
46
+ keyboard: boolean;
47
+ };
48
+ declare const INPUT_TOUCH: InputLayers;
49
+ declare const INPUT_POINTER: InputLayers;
50
+ /** A laptop with a touch screen: the pointer is primary and touch is present. */
51
+ declare const INPUT_MIXED: InputLayers;
52
+ /** A tablet with a keyboard and a trackpad attached stays touch first. */
53
+ declare const INPUT_TABLET_KEYBOARD: InputLayers;
54
+ /** The hinge in window coordinates (dp). A seamless fold may be a line of zero width. */
55
+ type Fold = {
56
+ bounds: Rect;
57
+ /** Nothing can be drawn inside the bounds. */
58
+ occluding: boolean;
59
+ };
60
+ /** Half-open: tabletop folds horizontally (top and bottom), book vertically (left and right). Physical, not mirrored in RTL. */
61
+ type Posture = {
62
+ kind: 'flat';
63
+ } | {
64
+ kind: 'tabletop';
65
+ fold: Fold;
66
+ } | {
67
+ kind: 'book';
68
+ fold: Fold;
69
+ };
70
+ declare const POSTURE_FLAT: Posture;
71
+ type AdaptiveContext = {
72
+ window: Size;
73
+ input: InputLayers;
74
+ posture: Posture;
75
+ reduceMotion: boolean;
76
+ };
77
+ declare function adaptiveContext(partial: Partial<AdaptiveContext> & {
78
+ window: Size;
79
+ }): AdaptiveContext;
80
+ type HalfOpenOptions = {
81
+ /** Where the fold's centre line sits along its axis, dp; the middle by default. */
82
+ at?: number;
83
+ /** The band's width across the fold, dp. */
84
+ band?: number;
85
+ /** By default a band of any width occludes and a line does not. */
86
+ occluding?: boolean;
87
+ };
88
+ declare function halfOpen(kind: 'tabletop' | 'book', window: Size, options?: HalfOpenOptions): Posture;
89
+ /**
90
+ * The window's segments: one when flat, two on either side of the fold when half-open. An occluding fold's band
91
+ * belongs to neither; a fold that does not occlude splits the window at its centre line.
92
+ */
93
+ declare function windowSegments(ctx: Pick<AdaptiveContext, 'window' | 'posture'>): Rect[];
94
+ /**
95
+ * The posture two viewport segments describe. The web has no hinge angle, so two segments count as half-open;
96
+ * anything but two is flat.
97
+ */
98
+ declare function postureFromSegments(window: Size, segments: readonly Rect[]): Posture;
99
+ /** The segment a box belongs to: the one holding its centre, else the one it overlaps most. */
100
+ declare function segmentOf(box: Rect, segments: readonly Rect[]): Rect | undefined;
101
+ /** Where a surface may live: its source's segment, or the largest one when nothing anchors it. It never crosses the fold. */
102
+ declare function surfaceRegion(ctx: Pick<AdaptiveContext, 'window' | 'posture'>, source?: Rect): Rect;
103
+
104
+ export { type AdaptiveContext as A, type Fold as F, type HalfOpenOptions as H, type InputLayers as I, POSTURE_FLAT as P, type Rect as R, type Size as S, A11Y_NONE as a, type A11yMode as b, type A11yOverride as c, INPUT_MIXED as d, INPUT_POINTER as e, INPUT_TABLET_KEYBOARD as f, INPUT_TOUCH as g, type Posture as h, type Presentation as i, type Surface as j, adaptiveContext as k, halfOpen as l, intersectRect as m, presentationFor as n, resolveA11y as o, postureFromSegments as p, segmentOf as q, rectContains as r, sameA11y as s, surfaceRegion as t, windowSegments as w };
@@ -0,0 +1,104 @@
1
+ type A11yMode = {
2
+ reduceTransparency: boolean;
3
+ increaseContrast: boolean;
4
+ reduceMotion: boolean;
5
+ };
6
+ declare const A11Y_NONE: A11yMode;
7
+ /** `undefined` follows the system; a boolean overrides it. */
8
+ type A11yOverride = {
9
+ [K in keyof A11yMode]?: boolean | undefined;
10
+ };
11
+ declare function resolveA11y(system: A11yMode, override?: A11yOverride): A11yMode;
12
+ /** `plain`: no glass was asked for. `frosted`: the stand-in when glass under reduced transparency cannot attach. */
13
+ type Surface = 'plain' | 'frosted' | 'glass';
14
+ type Presentation = {
15
+ glass: boolean;
16
+ /** Reduced transparency: the glass stays and frosts. */
17
+ frost: boolean;
18
+ surface: Surface;
19
+ contrastBorder: boolean;
20
+ instantSprings: boolean;
21
+ };
22
+ declare function presentationFor(mode: A11yMode, wantsGlass: boolean): Presentation;
23
+ declare function sameA11y(a: A11yMode, b: A11yMode): boolean;
24
+
25
+ type Rect = {
26
+ x: number;
27
+ y: number;
28
+ width: number;
29
+ height: number;
30
+ };
31
+ type Size = {
32
+ width: number;
33
+ height: number;
34
+ };
35
+ declare function intersectRect(a: Rect, b: Rect): Rect | null;
36
+ declare function rectContains(outer: Rect, inner: Rect, tolerance?: number): boolean;
37
+
38
+ type InputLayers = {
39
+ /** The primary pointer: layout density for the whole window. */
40
+ primary: 'fine' | 'coarse';
41
+ /** Any coarse input present: hit areas reach the touch floor without changing layout. */
42
+ anyCoarse: boolean;
43
+ /** Some pointer can hover. Whether one does is decided per event, never by this flag. */
44
+ hover: boolean;
45
+ /** A hardware keyboard is present. The web cannot query it and learns it from a key press. */
46
+ keyboard: boolean;
47
+ };
48
+ declare const INPUT_TOUCH: InputLayers;
49
+ declare const INPUT_POINTER: InputLayers;
50
+ /** A laptop with a touch screen: the pointer is primary and touch is present. */
51
+ declare const INPUT_MIXED: InputLayers;
52
+ /** A tablet with a keyboard and a trackpad attached stays touch first. */
53
+ declare const INPUT_TABLET_KEYBOARD: InputLayers;
54
+ /** The hinge in window coordinates (dp). A seamless fold may be a line of zero width. */
55
+ type Fold = {
56
+ bounds: Rect;
57
+ /** Nothing can be drawn inside the bounds. */
58
+ occluding: boolean;
59
+ };
60
+ /** Half-open: tabletop folds horizontally (top and bottom), book vertically (left and right). Physical, not mirrored in RTL. */
61
+ type Posture = {
62
+ kind: 'flat';
63
+ } | {
64
+ kind: 'tabletop';
65
+ fold: Fold;
66
+ } | {
67
+ kind: 'book';
68
+ fold: Fold;
69
+ };
70
+ declare const POSTURE_FLAT: Posture;
71
+ type AdaptiveContext = {
72
+ window: Size;
73
+ input: InputLayers;
74
+ posture: Posture;
75
+ reduceMotion: boolean;
76
+ };
77
+ declare function adaptiveContext(partial: Partial<AdaptiveContext> & {
78
+ window: Size;
79
+ }): AdaptiveContext;
80
+ type HalfOpenOptions = {
81
+ /** Where the fold's centre line sits along its axis, dp; the middle by default. */
82
+ at?: number;
83
+ /** The band's width across the fold, dp. */
84
+ band?: number;
85
+ /** By default a band of any width occludes and a line does not. */
86
+ occluding?: boolean;
87
+ };
88
+ declare function halfOpen(kind: 'tabletop' | 'book', window: Size, options?: HalfOpenOptions): Posture;
89
+ /**
90
+ * The window's segments: one when flat, two on either side of the fold when half-open. An occluding fold's band
91
+ * belongs to neither; a fold that does not occlude splits the window at its centre line.
92
+ */
93
+ declare function windowSegments(ctx: Pick<AdaptiveContext, 'window' | 'posture'>): Rect[];
94
+ /**
95
+ * The posture two viewport segments describe. The web has no hinge angle, so two segments count as half-open;
96
+ * anything but two is flat.
97
+ */
98
+ declare function postureFromSegments(window: Size, segments: readonly Rect[]): Posture;
99
+ /** The segment a box belongs to: the one holding its centre, else the one it overlaps most. */
100
+ declare function segmentOf(box: Rect, segments: readonly Rect[]): Rect | undefined;
101
+ /** Where a surface may live: its source's segment, or the largest one when nothing anchors it. It never crosses the fold. */
102
+ declare function surfaceRegion(ctx: Pick<AdaptiveContext, 'window' | 'posture'>, source?: Rect): Rect;
103
+
104
+ export { type AdaptiveContext as A, type Fold as F, type HalfOpenOptions as H, type InputLayers as I, POSTURE_FLAT as P, type Rect as R, type Size as S, A11Y_NONE as a, type A11yMode as b, type A11yOverride as c, INPUT_MIXED as d, INPUT_POINTER as e, INPUT_TABLET_KEYBOARD as f, INPUT_TOUCH as g, type Posture as h, type Presentation as i, type Surface as j, adaptiveContext as k, halfOpen as l, intersectRect as m, presentationFor as n, resolveA11y as o, postureFromSegments as p, segmentOf as q, rectContains as r, sameA11y as s, surfaceRegion as t, windowSegments as w };