@titan-design/react-ui 0.10.0 → 0.12.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.
- package/dist/bodymap.js +173 -343
- package/dist/bodymap.js.map +1 -1
- package/dist/bodymap.mjs +173 -343
- package/dist/bodymap.mjs.map +1 -1
- package/dist/index.d.mts +416 -18
- package/dist/index.d.ts +416 -18
- package/dist/index.js +2512 -1307
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2480 -1299
- package/dist/index.mjs.map +1 -1
- package/dist/{pages-DyEx-lBf.d.ts → pages-B1hqnGIC.d.ts} +149 -15
- package/dist/{pages-D7hOD4Vj.d.mts → pages-CvsFqNtx.d.mts} +149 -15
- package/dist/pages.d.mts +1 -1
- package/dist/pages.d.ts +1 -1
- package/dist/pages.js +1644 -1575
- package/dist/pages.js.map +1 -1
- package/dist/pages.mjs +1645 -1576
- package/dist/pages.mjs.map +1 -1
- package/dist/theme/index.d.mts +409 -415
- package/dist/theme/index.d.ts +409 -415
- package/dist/theme/index.js +234 -408
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +227 -399
- package/dist/theme/index.mjs.map +1 -1
- package/dist/theme/tokens-css.js +141 -140
- package/dist/theme/tokens-css.js.map +1 -1
- package/dist/theme/tokens-css.mjs +141 -140
- package/dist/theme/tokens-css.mjs.map +1 -1
- package/package.json +8 -3
- package/src/arch/Architecture.stories.tsx +9 -9
- package/src/components/custom/DateTime/DateTime.stories.tsx +1 -1
- package/src/components/custom/Fatigue/DualGhostSpark.stories.tsx +258 -0
- package/src/components/custom/Fatigue/DualGhostSpark.test.tsx +138 -0
- package/src/components/custom/Fatigue/DualGhostSpark.tsx +208 -0
- package/src/components/custom/Fatigue/FatigueLights.stories.tsx +74 -0
- package/src/components/custom/Fatigue/FatigueLights.test.tsx +33 -0
- package/src/components/custom/Fatigue/FatigueLights.tsx +83 -0
- package/src/components/custom/Fatigue/GhostBand.test.tsx +235 -0
- package/src/components/custom/Fatigue/GhostBand.tsx +246 -0
- package/src/components/custom/Fatigue/GhostBloom.tsx +132 -0
- package/src/components/custom/Fatigue/GhostSpark.stories.tsx +175 -0
- package/src/components/custom/Fatigue/GhostSpark.test.tsx +45 -0
- package/src/components/custom/Fatigue/GhostSpark.tsx +126 -0
- package/src/components/custom/Fatigue/LiveFatigueCard.stories.tsx +126 -0
- package/src/components/custom/Fatigue/LiveFatigueCard.test.tsx +28 -0
- package/src/components/custom/Fatigue/LiveFatigueCard.tsx +86 -0
- package/src/components/custom/Fatigue/LiveFatiguePanel.stories.tsx +95 -0
- package/src/components/custom/Fatigue/LiveFatiguePanel.tsx +151 -0
- package/src/components/custom/Fatigue/README.md +93 -0
- package/src/components/custom/Fatigue/RomProgressionChart.stories.tsx +94 -0
- package/src/components/custom/Fatigue/RomProgressionChart.test.tsx +31 -0
- package/src/components/custom/Fatigue/RomProgressionChart.tsx +132 -0
- package/src/components/custom/Fatigue/SilverRedPalette.stories.tsx +226 -0
- package/src/components/custom/Fatigue/VelocityHero.stories.tsx +70 -0
- package/src/components/custom/Fatigue/VelocityHero.test.tsx +26 -0
- package/src/components/custom/Fatigue/VelocityHero.tsx +46 -0
- package/src/components/custom/Fatigue/VerdictHero.stories.tsx +59 -0
- package/src/components/custom/Fatigue/VerdictHero.test.tsx +49 -0
- package/src/components/custom/Fatigue/VerdictHero.tsx +79 -0
- package/src/components/custom/Fatigue/fatigue-mock.test.ts +59 -0
- package/src/components/custom/Fatigue/fatigue-mock.ts +268 -0
- package/src/components/custom/Fatigue/fatigue-model.ts +129 -0
- package/src/components/custom/Fatigue/fatigue-tokens.test.ts +70 -0
- package/src/components/custom/Fatigue/fatigue-tokens.ts +180 -0
- package/src/components/custom/Fatigue/index.ts +41 -0
- package/src/components/custom/Fatigue/tempo-pacing.test.ts +176 -0
- package/src/components/custom/Fatigue/tempo-pacing.ts +112 -0
- package/src/components/custom/Sidebar/Sidebar.tsx +4 -4
- package/src/components/custom/Table/Table.tsx +2 -2
- package/src/components/custom/Workout/ActiveWorkoutPage.tsx +3 -3
- package/src/components/custom/Workout/BaseBadge.test.tsx +6 -1
- package/src/components/custom/Workout/BaseBadge.tsx +1 -1
- package/src/components/custom/Workout/BodyMap.tsx +2 -2
- package/src/components/custom/Workout/BodyMapDetailPanel.tsx +2 -2
- package/src/components/custom/Workout/DeviationBar.test.tsx +2 -1
- package/src/components/custom/Workout/DeviationBar.tsx +3 -2
- package/src/components/custom/Workout/DualVelocityStrip.test.tsx +685 -0
- package/src/components/custom/Workout/ExerciseCard.test.tsx +7 -7
- package/src/components/custom/Workout/ExerciseCard.tsx +5 -3
- package/src/components/custom/Workout/ExerciseDetailPage.tsx +11 -5
- package/src/components/custom/Workout/InputBar.tsx +2 -2
- package/src/components/custom/Workout/LiveAuraFrame.stories.tsx +1 -1
- package/src/components/custom/Workout/LiveAuraFrame.test.tsx +1 -1
- package/src/components/custom/Workout/LiveAuraFrame.tsx +3 -3
- package/src/components/custom/Workout/MesoCard.tsx +3 -1
- package/src/components/custom/Workout/MuscleGroupChip.tsx +4 -3
- package/src/components/custom/Workout/PrHistoryModal.tsx +2 -2
- package/src/components/custom/Workout/ProgramPlanningPage.tsx +1 -1
- package/src/components/custom/Workout/README.md +62 -16
- package/src/components/custom/Workout/ReadinessCheck.tsx +2 -2
- package/src/components/custom/Workout/RestTimer.tsx +2 -2
- package/src/components/custom/Workout/S3SetTypes.stories.tsx +3 -3
- package/src/components/custom/Workout/SegmentedBar.stories.tsx +3 -3
- package/src/components/custom/Workout/SessionHeader.stories.tsx +2 -2
- package/src/components/custom/Workout/SessionHeader.tsx +1 -1
- package/src/components/custom/Workout/SessionRail.stories.tsx +2 -2
- package/src/components/custom/Workout/SessionRail.test.tsx +43 -0
- package/src/components/custom/Workout/SessionRail.tsx +63 -18
- package/src/components/custom/Workout/SetBar.tsx +3 -3
- package/src/components/custom/Workout/SetRow.test.tsx +12 -9
- package/src/components/custom/Workout/SetRow.tsx +9 -2
- package/src/components/custom/Workout/StatusDot.tsx +5 -4
- package/src/components/custom/Workout/StrengthTrendChart.tsx +1 -1
- package/src/components/custom/Workout/TrainingStatusPage.tsx +2 -2
- package/src/components/custom/Workout/VelocityStrip.compact.stories.tsx +191 -0
- package/src/components/custom/Workout/VelocityStrip.dual.stories.tsx +186 -0
- package/src/components/custom/Workout/VelocityStrip.expanded.stories.tsx +296 -0
- package/src/components/custom/Workout/VelocityStrip.hero.stories.tsx +259 -0
- package/src/components/custom/Workout/VelocityStrip.stories.tsx +217 -250
- package/src/components/custom/Workout/VelocityStrip.test.tsx +199 -79
- package/src/components/custom/Workout/VelocityStrip.tsx +953 -609
- package/src/components/custom/Workout/VolumeLandmarkBar.tsx +3 -3
- package/src/components/custom/Workout/WeightBadge.test.tsx +6 -1
- package/src/components/custom/Workout/WeightBadge.tsx +2 -1
- package/src/components/custom/Workout/WorkoutCard.tsx +3 -1
- package/src/components/custom/Workout/WorkoutPill.tsx +5 -2
- package/src/components/custom/Workout/ZoneTrack.tsx +4 -4
- package/src/components/custom/Workout/index.ts +3 -0
- package/src/components/custom/Workout/setHeadingKit.tsx +14 -8
- package/src/components/custom/Workout/velocity-story-kit.tsx +438 -0
- package/src/components/custom/charts/SetBarChart.test.tsx +275 -0
- package/src/components/custom/charts/SetBarChart.tsx +651 -0
- package/src/components/custom/charts/live-rep-growth.ts +91 -0
- package/src/components/custom/index.ts +1 -0
- package/src/components/custom/stepper/Stepper.stories.tsx +1 -1
- package/src/components/custom/stepper/Stepper.tsx +3 -3
- package/src/components/shell/DeviceMenu.tsx +2 -2
- package/src/components/shell/SideNav.tsx +1 -1
- package/src/components/shell/TopBar.tsx +1 -1
- package/src/components/ui/autocomplete/Autocomplete.stories.tsx +1 -1
- package/src/components/ui/autocomplete/Autocomplete.tsx +1 -1
- package/src/components/ui/avatar/Avatar.tsx +2 -2
- package/src/components/ui/badge/Badge.tsx +2 -2
- package/src/components/ui/card/Card.tsx +3 -3
- package/src/components/ui/checkbox/Checkbox.tsx +1 -1
- package/src/components/ui/collapse/Collapse.tsx +1 -1
- package/src/components/ui/data-row/DataRow.stories.tsx +1 -1
- package/src/components/ui/drawer/Drawer.tsx +3 -3
- package/src/components/ui/form-field/FormField.tsx +1 -1
- package/src/components/ui/help-tip/HelpTip.tsx +1 -1
- package/src/components/ui/menu/Menu.tsx +2 -2
- package/src/components/ui/pill/Pill.tsx +2 -2
- package/src/components/ui/popover/Popover.stories.tsx +2 -2
- package/src/components/ui/popover/Popover.tsx +1 -1
- package/src/components/ui/progress/Progress.tsx +3 -3
- package/src/components/ui/radio/Radio.stories.tsx +1 -1
- package/src/components/ui/radio/Radio.tsx +4 -4
- package/src/components/ui/select/Select.tsx +3 -3
- package/src/components/ui/surface/Surface.stories.tsx +3 -3
- package/src/components/ui/surface/Surface.test.tsx +32 -19
- package/src/components/ui/surface/Surface.tsx +3 -3
- package/src/components/ui/surface/SurfaceContext.ts +19 -29
- package/src/components/ui/surface/surface.contract.test.ts +57 -44
- package/src/components/ui/switch/Switch.tsx +1 -1
- package/src/components/ui/tabs/Tabs.tsx +2 -2
- package/src/components/ui/toolbar-button/ToolbarButton.stories.tsx +5 -5
- package/src/components/ui/toolbar-button/ToolbarButton.test.tsx +1 -1
- package/src/components/ui/toolbar-button/ToolbarButton.tsx +36 -22
- package/src/stories/PresetShowcase.stories.tsx +21 -21
- package/src/test/raw-color-patterns.test.ts +71 -0
- package/src/theme/ColorPalettes.stories.tsx +874 -0
- package/src/theme/ColorPrimitives.stories.tsx +348 -0
- package/src/theme/Depth.stories.tsx +312 -0
- package/src/theme/DepthCalibration.stories.tsx +655 -0
- package/src/theme/ThemeProvider.tsx +1 -1
- package/src/theme/barrel.ts +7 -14
- package/src/theme/color-stories.coverage.test.ts +125 -0
- package/src/theme/color-story-kit.tsx +170 -0
- package/src/theme/color-utils.ts +197 -0
- package/src/theme/config.ts +0 -8
- package/src/theme/depth-calibration.test.tsx +97 -0
- package/src/theme/elevation.test.ts +62 -1
- package/src/theme/elevation.ts +34 -8
- package/src/theme/global.css +47 -53
- package/src/theme/grey-ramp.test.ts +166 -0
- package/src/theme/materials.test.ts +106 -0
- package/src/theme/materials.ts +211 -0
- package/src/theme/presets/audiobook.ts +4 -4
- package/src/theme/presets/types.ts +3 -3
- package/src/theme/semantic-contrast.test.ts +83 -0
- package/src/theme/tokens/primitives.ts +62 -115
- package/src/theme/tokens/semantic.ts +130 -82
- package/src/utils/colors.ts +1 -1
- package/tailwind.config.js +2 -5
- package/src/components/custom/Workout/VelocityStrip.modalities.stories.tsx +0 -254
- package/src/components/custom/Workout/VelocityStrip.responsive.stories.tsx +0 -145
- package/src/theme/ColorSystem.stories.tsx +0 -508
- package/src/theme/Colors.stories.tsx +0 -323
- package/src/theme/shadows.stories.tsx +0 -523
- package/src/theme/shadows.ts +0 -439
package/dist/theme/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/theme/tokens/primitives.ts","../../src/theme/tokens/semantic.ts","../../src/theme/config.ts","../../src/theme/shadows.ts","../../src/theme/elevation.ts","../../src/theme/manifest/css-property-manifest.validate.ts","../../src/theme/resolve-color.ts","../../src/theme/gradients.ts","../../src/theme/presets/apply.ts","../../src/theme/presets/default.ts","../../src/theme/presets/audiobook.ts","../../src/components/ui/surface/SurfaceContext.ts","../../src/web-jsx/jsx-runtime.ts","../../src/theme/ThemeProvider.tsx"],"names":["intensityConfig","Platform","reactJsx"],"mappings":";;;;;;AAOO,IAAM,eAAA,GAAkB;AAAA;AAAA,EAE7B,IAAA,EAAM;AAAA,IACJ,EAAA,EAAI,SAAA;AAAA,IACJ,GAAA,EAAK,SAAA;AAAA,IACL,GAAA,EAAK,SAAA;AAAA,IACL,GAAA,EAAK,SAAA;AAAA,IACL,GAAA,EAAK,SAAA;AAAA,IACL,GAAA,EAAK,SAAA;AAAA,IACL,GAAA,EAAK,SAAA;AAAA,IACL,GAAA,EAAK,SAAA;AAAA,IACL,GAAA,EAAK,SAAA;AAAA,IACL,GAAA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SAAA,GAAY;AAAA,EAChB,IAAA,EAAM,KAAK,gBAAgB,CAAA;AAAA,EAC3B,KAAA,EAAO,KAAK,iBAAiB;AAC/B,CAAA;AAgBO,SAAS,aAAA,CAAc;AAAA,EAC5B,IAAA,GAAO,MAAA;AAAA,EACP,KAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA0C;AAIxC,EAAA,MAAM,EAAE,WAAA,EAAY,GAAI,cAAA,EAAe;AACvC,EAAA,MAAM,QAAA,GAAW,IAAA,KAAS,QAAA,GAAY,WAAA,IAAe,MAAA,GAAU,IAAA;AAE/D,EAAA,uBACE,GAAA,CAAC,cAAA,CAAe,QAAA,EAAf,EAAwB,KAAA,EAAO,EAAE,IAAA,EAAM,QAAA,EAAU,KAAA,EAAO,MAAA,EAAO,EAC9D,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,KAAA,EAAO,CAAC,SAAA,CAAU,QAAQ,CAAA,EAAG,EAAE,IAAA,EAAM,CAAA,EAAE,EAAG,KAAK,CAAA,EAAI,GAAG,KAAA,EACzD,QAAA,EACH,CAAA,EACF,CAAA;AAEJ","file":"index.mjs","sourcesContent":["/**\n * Primitive Design Tokens\n *\n * Raw values with no semantic meaning. These are the foundation of the design system\n * and should rarely be used directly in components. Use semantic tokens instead.\n */\n\nexport const primitiveColors = {\n // Blue scale\n blue: {\n 50: '#EFF6FF',\n 100: '#DBEAFE',\n 200: '#BFDBFE',\n 300: '#93C5FD',\n 400: '#60A5FA',\n 500: '#3B82F6',\n 600: '#5048E5',\n 700: '#3832A0',\n 800: '#1E40AF',\n 900: '#1E3A8A',\n },\n\n // Red scale\n red: {\n 50: '#FEF2F2',\n 100: '#FEE2E2',\n 200: '#FECACA',\n 300: '#FCA5A5',\n 400: '#DA6868',\n 500: '#EF4444',\n 600: '#D14343',\n 700: '#922E2E',\n 800: '#991B1B',\n 900: '#7F1D1D',\n },\n\n // Vivid red scale\n redVivid: {\n 50: '#FFECEE',\n 100: '#FFD6DB',\n 200: '#FFB3BC',\n 300: '#FF8593',\n 400: '#FF6070',\n 500: '#FF4757',\n 600: '#E63548',\n 700: '#C42539',\n 800: '#9E1C2C',\n 900: '#7A1520',\n },\n\n // Neutral/Gray scale\n neutral: {\n 50: '#FAFAFA',\n 100: '#F3F4F6',\n 200: '#E5E7EB',\n 300: '#D1D5DB',\n 400: '#9CA3AF',\n 500: '#6B7280',\n 600: '#4B5563',\n 700: '#374151',\n 800: '#1F2937',\n 900: '#111827',\n 950: '#030712',\n },\n\n // Charcoal scale (dark backgrounds)\n charcoal: {\n 0: '#6E6E6E',\n 50: '#5D5D5D',\n 100: '#4C4C4C',\n 200: '#3C3C3C',\n 300: '#2C2C2C',\n 400: '#1F1F1F',\n 500: '#1C1C1C',\n 600: '#191919',\n 700: '#161616',\n 800: '#131313',\n 900: '#101010',\n },\n\n // Pure colors\n white: '#FFFFFF',\n black: '#000000',\n transparent: 'transparent',\n} as const\n\n/**\n * Surface ramp — dark mode (TD-surface-tokens, S-1, re-spaced S-3)\n *\n * Warm-tapered, DERIVED ramp — NOT hand-picked. Shipped verbatim as the output of\n * `deriveSurfaceRamp(shellL=9, steps=[4.5,3.5,3,2.5], rbShadow=6, rbHilite=1.5)`\n * (see `packages/ui/src/components/ui/surface/surface-lab-shared.tsx` on branch\n * `feat/TD-unified-lab`, story `Lab/Surface Exploration -> Surface Ramp System`\n * — that lab default is `[4.5,2.5,2,1.5]` as of this writing and should be\n * updated to match on that branch, follow-up, not done here).\n * Lightness is CIELAB L* off the shell, with DIMINISHING steps (4.5/3.5/3/2.5) —\n * the frame->content jump is biggest, each plane above adds less, but the top\n * three planes (elevated/raised/overlay) were re-spaced WIDER (S-3) than the\n * original 2.5/2/1.5 taper so they read as distinct planes without leaning on\n * the hairline alone. `background`/`base`/`inset` are unchanged by the re-space.\n * Warmth (R-B) tapers 6 -> 1.5 from frame to hero so bright content planes stay\n * near-neutral.\n * Kept separate from the `charcoal` scale above (which several existing\n * components reference directly for unrelated shadow/track tints) so this\n * change is additive and doesn't ripple into those consumers.\n * See coordination/design-explorations/surface-system-north-star.md.\n */\nexport const surfaceRampDark = {\n inset: '#13100D', // L*4.5 — sub-shell well / pressed\n background: '#1C1916', // L*9 — shell / frame\n base: '#252321', // L*13.5 — main content plane\n elevated: '#2C2A28', // L*17 — nav / rail\n raised: '#31302F', // L*20 — cards\n overlay: '#373635', // L*22.5 — hero / popover\n} as const\n\n/**\n * Frame/bezel primitive — dark mode (TD-surface-tokens, S-3)\n *\n * The chrome that \"exits the content ramp\" entirely: the top bar + side nav\n * shell. Sits ONE STEP BELOW `surfaceRampDark.background` (L*9), darker even\n * than `surfaceRampDark.inset` (L*4.5) — it isn't a plane IN the ramp, it's\n * the bezel the ramp sits inside. Literal, not `deriveSurfaceRamp()` output.\n */\nexport const backgroundFrameDark = '#100D0A' // L*3.79\n\n/**\n * Derived tonal ramps (TD-05.09 color foundations)\n *\n * Seven OKLCH-generated hue ramps, 11 perceptual lightness steps each (50 -> 950).\n * Built with hue-torsion + a chroma arc, anchored through existing brand/semantic\n * hexes. `pin` marks the step each ramp flows through its anchor.\n * This is the single source of truth for chromatic hexes — the categorical palette\n * below references these steps rather than duplicating values.\n * See coordination/design-explorations/foundations.\n */\nexport const primitiveRamps = {\n red: {\n 50: '#FFF4F4',\n 100: '#FFE3E5',\n 200: '#FFC2C5',\n 300: '#FF9A9D',\n 400: '#F77175',\n 500: '#E05254',\n 600: '#D14343', // pin\n 700: '#A4221C',\n 800: '#7E1002',\n 900: '#5A0900',\n 950: '#3D0400',\n },\n orange: {\n 50: '#FFF5ED',\n 100: '#FFE6D4',\n 200: '#FFC7A2',\n 300: '#FFA063',\n 400: '#FF7900', // pin\n 500: '#DA5F00',\n 600: '#B94A00',\n 700: '#983804',\n 800: '#6F290F',\n 900: '#4E1C0C',\n 950: '#331107',\n },\n amber: {\n 50: '#FFF7DD',\n 100: '#FFEAA9',\n 200: '#FFD352',\n 300: '#F9B415', // pin\n 400: '#E08C00',\n 500: '#C27400',\n 600: '#A45E00',\n 700: '#814D14',\n 800: '#5B3A1A',\n 900: '#442503',\n 950: '#301500',\n },\n green: {\n 50: '#E3FFEE',\n 100: '#B5FFD2',\n 200: '#58F69E',\n 300: '#2ED573', // pin\n 400: '#21C05D',\n 500: '#22A444',\n 600: '#298732',\n 700: '#2B6B25',\n 800: '#264D1C',\n 900: '#1B3515',\n 950: '#11220D',\n },\n cyan: {\n 50: '#E6FBFF',\n 100: '#C2F6FF',\n 200: '#62EAFF',\n 300: '#22D3EE', // pin\n 400: '#01B5D1',\n 500: '#2697B7',\n 600: '#307B9B',\n 700: '#2A617F',\n 800: '#22465F',\n 900: '#0B3149',\n 950: '#001F36',\n },\n blue: {\n 50: '#EFF8FF',\n 100: '#D9EFFF',\n 200: '#ACDBFF',\n 300: '#78C2FF',\n 400: '#3CA8FF',\n 500: '#2196F3', // pin\n 600: '#1072CB',\n 700: '#135AA8',\n 800: '#14407E',\n 900: '#112C5A',\n 950: '#091B3C',\n },\n magenta: {\n 50: '#FFF3F9',\n 100: '#FFE2F1',\n 200: '#FFBDE2',\n 300: '#FF8FD5',\n 400: '#ED69C3',\n 500: '#D548AF',\n 600: '#BA2996',\n 700: '#9C0D7A', // pin\n 800: '#77005A',\n 900: '#56003F',\n 950: '#3B0029',\n },\n} as const\n\n/**\n * Categorical (qualitative) palette — an ordered, CVD-safe series expressed as\n * references into {@link primitiveRamps} (one source of truth; the palette moves\n * with the ramps).\n *\n * Design: a single canonical hue order (blue, magenta, red, orange, green, cyan,\n * amber), with steps chosen vivid-midtone-first and fanned lighter/darker as the\n * series grows to preserve separation. The sequence is nested-stable — a chart\n * with N series uses the first N colors, and the series index is stable as N\n * changes. Colorblind-safe worst-case deuteranopia/protanopia floor 8 holds\n * through {@link CATEGORICAL_CVD_SAFE_MAX} colors; the 7th is an extended color\n * that should be paired with a legend or other secondary encoding.\n *\n * Two variants: `default` (vivid, sits on neutral/light surfaces, legible under\n * black text) and `dark` (deeper shades legible under white text on a fill). A\n * separate \"light\" variant was dropped — the vivid `default` picks already clear\n * black-text contrast, so it doubles as the light-context palette.\n */\nexport const categoricalPalette = {\n default: [\n primitiveRamps.blue[500],\n primitiveRamps.magenta[500],\n primitiveRamps.red[500],\n primitiveRamps.orange[400],\n primitiveRamps.green[300],\n primitiveRamps.cyan[300],\n primitiveRamps.amber[600], // extended (7th) — pair with a legend\n ],\n dark: [\n primitiveRamps.blue[600],\n primitiveRamps.magenta[600],\n primitiveRamps.red[500],\n primitiveRamps.orange[600],\n primitiveRamps.green[800],\n primitiveRamps.cyan[800],\n primitiveRamps.amber[500], // extended (7th) — pair with a legend\n ],\n} as const\n\n/** Largest series count that holds the CVD floor without a legend. */\nexport const CATEGORICAL_CVD_SAFE_MAX = 6\n\n/**\n * Categorical palette variant.\n * - `default` : vivid; neutral/light surfaces, legible under black text\n * - `dark` : deeper shades, legible under white text on a filled swatch\n */\nexport type CategoricalVariant = keyof typeof categoricalPalette\n\n/**\n * Get a color from the ordered categorical palette by series index.\n * The palette is nested-stable, so the color for a given index does not change\n * with the total series count; `index` simply wraps past the end.\n *\n * @param index - 0-based series index (wraps past the end)\n * @param variant - `default` (black-text / light surfaces) or `dark` (white text)\n * @returns The hex color string\n */\nexport function getCategoricalColor(index: number, variant: CategoricalVariant = 'default'): string {\n const palette = categoricalPalette[variant]\n index = Math.max(0, Math.floor(index))\n return palette[index % palette.length]\n}\n\n/**\n * Diverging status scale (BodyMap training-status: under → optimal → over) as\n * references into {@link primitiveRamps}. A true diverging shape — `optimal` is\n * the lightest center, the extremes go darker — so the signal reads in lightness\n * (colorblind-robust; worst-case deut/protanopia min ΔE ~10.9) and the direction\n * reads in the blue↔red axis (the CVD-safe hue pair).\n *\n * Tuned so every stop is dark enough for the fill yet light enough that BLACK\n * text clears 4.5:1 on all five — no per-cell white/black flipping. The value\n * valley is symmetric: the two mid-arms (maintenance / approaching) sit at equal\n * lightness (both ~0.53 relative luminance), the ends darker.\n */\nexport const divergingScale = [\n primitiveRamps.blue[500], // under\n primitiveRamps.cyan[300], // maintenance\n primitiveRamps.green[200], // optimal (light center)\n primitiveRamps.amber[300], // approaching\n primitiveRamps.red[600], // over\n] as const\n\n/**\n * Sequential \"effort\" scale (low → high intensity: green → yellow → orange → red)\n * as references into {@link primitiveRamps}. A 6-stop ordinal palette; the\n * velocity/RPE strip sub-samples it. Every adjacent pair clears the CVD floor\n * (min deut/protan ΔE ≥ 4.5), and within that the hue walk is kept smooth —\n * the amber-200 → amber-300 → orange-400 run steps the yellow→orange transition\n * gradually rather than lurching. Order encodes magnitude, so it tolerates the\n * green↔red CVD pair. Stops 0–3 take black text; the dark reds take white.\n */\nexport const sequentialEffort = [\n primitiveRamps.green[300],\n primitiveRamps.amber[200],\n primitiveRamps.amber[300],\n primitiveRamps.orange[400],\n primitiveRamps.red[600],\n primitiveRamps.red[700],\n] as const\n\n/**\n * Best-contrast text color (black or white) for a solid fill — for labels sitting\n * on categorical/diverging/effort swatches. Uses the WCAG relative-luminance ratio.\n */\nexport function bestTextColor(hex: string): '#000000' | '#FFFFFF' {\n const [r, g, b] = [0, 2, 4].map((i) => {\n const c = parseInt(hex.replace('#', '').slice(i, i + 2), 16) / 255\n return c >= 0.04045 ? ((c + 0.055) / 1.055) ** 2.4 : c / 12.92\n })\n const l = 0.2126 * r + 0.7152 * g + 0.0722 * b\n return (l + 0.05) / 0.05 >= 1.05 / (l + 0.05) ? '#000000' : '#FFFFFF'\n}\n\n/**\n * Discrete rainbow palette for data visualization\n * Based on Paul Tol's color schemes: https://personal.sron.nl/~pault/#fig:scheme_rainbow_discrete\n */\nexport const discreteRainbow = [\n '#E8ECFB',\n '#D9CCE3',\n '#D1BBD7',\n '#CAACCB',\n '#BA8DB4',\n '#AE76A3',\n '#AA6F9E',\n '#994F88',\n '#882E72',\n '#1965B0',\n '#437DBF',\n '#5289C7',\n '#6195CF',\n '#7BAFDE',\n '#4EB265',\n '#90C987',\n '#CAE0AB',\n '#F7F056',\n '#F7CB45',\n '#F6C141',\n '#F4A736',\n '#F1932D',\n '#EE8026',\n '#E8601C',\n '#E65518',\n '#DC050C',\n '#A5170E',\n '#72190E',\n '#42150A',\n] as const\n\n/**\n * Palette indices for discrete rainbow colors at different palette sizes.\n * For a given palette size (index + 1), returns the indices of colors to use.\n */\nconst discreteRainbowPalettes: number[][] = [\n [10],\n [10, 26],\n [10, 18, 26],\n [10, 15, 18, 26],\n [10, 14, 15, 18, 26],\n [10, 14, 15, 17, 18, 26],\n [9, 10, 14, 15, 17, 18, 26],\n [9, 10, 14, 15, 17, 18, 23, 26],\n [9, 10, 14, 15, 17, 18, 23, 26, 28],\n [9, 10, 14, 15, 17, 18, 21, 24, 26, 28],\n [9, 10, 12, 14, 15, 17, 18, 21, 24, 26, 28],\n [3, 6, 9, 10, 12, 14, 15, 17, 18, 21, 24, 26],\n [3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 21, 24, 26],\n [3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26],\n [3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],\n [3, 5, 7, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],\n [3, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],\n [3, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28, 29],\n [1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28, 29],\n]\n\n/**\n * Get a color from the discrete rainbow palette for a given index and palette size.\n * Colors are optimized for visual distinction at each palette size.\n *\n * @param index - The index of the color in the series (0-based)\n * @param size - The total number of colors needed (1-23)\n * @returns The hex color string\n */\nexport function getDiscreteRainbowColor(index: number, size: number): string {\n index = Math.max(0, index)\n size = Math.min(Math.max(1, size), discreteRainbowPalettes.length)\n\n const palette = discreteRainbowPalettes[size - 1]\n if (index >= palette.length) index = index % palette.length\n\n return discreteRainbow[palette[index] - 1]\n}\n\nexport const primitiveTypography = {\n fontFamilies: {\n sans: ['Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Helvetica', 'Arial', 'sans-serif'],\n body: ['Nunito Sans', 'sans-serif'],\n heading: ['Space Grotesk', 'sans-serif'],\n mono: ['SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', 'monospace'],\n },\n fontSizes: {\n xs: '0.75rem', // 12px\n sm: '0.875rem', // 14px\n base: '1rem', // 16px\n lg: '1.125rem', // 18px\n xl: '1.5rem', // 24px\n '2xl': '2rem', // 32px\n '3xl': '2.25rem', // 36px\n '4xl': '3rem', // 48px\n '5xl': '3.5rem', // 56px\n },\n fontWeights: {\n normal: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n },\n lineHeights: {\n none: 1,\n tight: 1.375,\n snug: 1.5,\n normal: 1.57,\n relaxed: 1.66,\n loose: 1.75,\n },\n letterSpacing: {\n tighter: '-0.05em',\n tight: '-0.025em',\n normal: '0em',\n wide: '0.025em',\n wider: '0.05em',\n widest: '0.5px',\n },\n} as const\n\nexport const primitiveSpacing = {\n 0: '0',\n px: '1px',\n 0.5: '0.125rem', // 2px\n 1: '0.25rem', // 4px\n 1.5: '0.375rem', // 6px\n 2: '0.5rem', // 8px\n 2.5: '0.625rem', // 10px\n 3: '0.75rem', // 12px\n 3.5: '0.875rem', // 14px\n 4: '1rem', // 16px\n 5: '1.25rem', // 20px\n 6: '1.5rem', // 24px\n 7: '1.75rem', // 28px\n 8: '2rem', // 32px\n 9: '2.25rem', // 36px\n 10: '2.5rem', // 40px\n 11: '2.75rem', // 44px\n 12: '3rem', // 48px\n 14: '3.5rem', // 56px\n 16: '4rem', // 64px\n 20: '5rem', // 80px\n 24: '6rem', // 96px\n 28: '7rem', // 112px\n 32: '8rem', // 128px\n} as const\n\nexport const primitiveBorderRadius = {\n none: '0',\n sm: '4px',\n DEFAULT: '8px',\n md: '8px',\n lg: '12px',\n xl: '16px',\n '2xl': '24px',\n full: '9999px',\n} as const\n\nexport const primitiveShadows = {\n none: 'none',\n sm: '0px 1px 2px rgba(100, 116, 139, 0.12)',\n DEFAULT: '0px 1px 3px rgba(100, 116, 139, 0.12), 0px 1px 2px rgba(100, 116, 139, 0.24)',\n md: '0px 4px 6px rgba(100, 116, 139, 0.12)',\n lg: '0px 10px 15px rgba(100, 116, 139, 0.12)',\n xl: '0px 20px 25px rgba(100, 116, 139, 0.12)',\n '2xl': '0px 25px 50px rgba(100, 116, 139, 0.25)',\n inner: 'inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)',\n} as const\n\nexport const primitiveBreakpoints = {\n xs: 0,\n sm: 600,\n md: 1000,\n lg: 1200,\n xl: 1920,\n} as const\n\nexport const primitiveZIndex = {\n hide: -1,\n auto: 'auto',\n base: 0,\n docked: 10,\n dropdown: 1000,\n sticky: 1100,\n drawer: 1100,\n banner: 1200,\n appBar: 1200,\n overlay: 1300,\n modal: 1400,\n popover: 1500,\n skipLink: 1600,\n toast: 1700,\n tooltip: 1800,\n} as const\n","/**\n * Semantic Design Tokens\n *\n * Meaningful tokens following DTCG (Design Tokens Community Group) naming conventions.\n * Pattern: {category}-{intent}-{variant?}-{state?}\n *\n * Categories:\n * - brand-* : Brand colors (primary, secondary, accent)\n * - status-* : Feedback colors (success, error, warning, info)\n * - result-* : Outcome indicators (improve, degrade, inconclusive, neutral)\n * - data-* : Data visualization colors (chart series)\n * - on-* : Text on colored backgrounds\n * - surface-* : Elevated containers (NOT \"paper\")\n * - background-* : Page backgrounds\n * - text-* : Text colors\n * - border-* : Border colors\n * - interactive-* : Hover/focus/active/disabled states\n */\n\nimport {\n primitiveColors as p,\n primitiveRamps as ramp,\n discreteRainbow,\n surfaceRampDark as surf,\n backgroundFrameDark,\n} from './primitives'\n\n// Light mode semantic colors (default)\nexport const semanticColorsLight = {\n // Brand colors (brand-*)\n 'brand-primary': ramp.orange[400],\n 'brand-primary-light': ramp.orange[300],\n 'brand-primary-dark': ramp.orange[500],\n 'brand-primary-subtle': 'rgba(255, 121, 0, 0.08)',\n 'brand-primary-hover': ramp.orange[500],\n 'brand-primary-active': ramp.orange[600],\n\n 'brand-secondary': ramp.cyan[600],\n 'brand-secondary-light': ramp.cyan[500],\n 'brand-secondary-dark': ramp.cyan[700],\n 'brand-secondary-subtle': 'rgba(48, 123, 155, 0.08)',\n 'brand-secondary-hover': ramp.cyan[700],\n 'brand-secondary-active': ramp.cyan[800],\n\n // Text on brand backgrounds (on-*)\n 'on-brand-primary': p.white,\n 'on-brand-secondary': p.white,\n\n // Status colors (status-*)\n 'status-success': ramp.green[300],\n 'status-success-light': ramp.green[200],\n 'status-success-dark': ramp.green[600],\n 'status-success-subtle': ramp.green[50],\n\n // Live-session accent — its OWN role, decoupled from success so the two can diverge\n 'status-live': ramp.green[300],\n 'status-live-muted': ramp.green[500],\n\n 'status-error': ramp.red[600],\n 'status-error-light': ramp.red[500],\n 'status-error-dark': ramp.red[700],\n 'status-error-subtle': ramp.red[50],\n\n 'status-error-vivid': p.redVivid[500], // vivid alert red\n 'status-error-vivid-light': p.redVivid[400],\n 'status-error-vivid-dark': p.redVivid[700],\n 'status-error-vivid-subtle': 'rgba(255, 71, 87, 0.12)',\n\n 'status-warning': ramp.amber[300],\n 'status-warning-light': ramp.amber[200],\n 'status-warning-dark': ramp.amber[500],\n 'status-warning-subtle': ramp.amber[50],\n\n 'status-info': ramp.blue[500],\n 'status-info-light': ramp.blue[300],\n 'status-info-dark': ramp.blue[600],\n 'status-info-subtle': ramp.blue[50],\n\n // Text on status backgrounds (on-status-*)\n 'on-status-success': p.white,\n 'on-status-error': p.white,\n 'on-status-warning': p.white,\n 'on-status-info': p.white,\n\n // Result/outcome indicators (result-*)\n 'result-improve': '#4caf50', // Green - positive outcome\n 'result-improve-light': 'rgba(76, 175, 80, 0.12)',\n 'result-improve-dark': '#248a24',\n 'result-degrade': '#ef5350', // Red - negative outcome\n 'result-degrade-light': 'rgba(239, 83, 80, 0.12)',\n 'result-degrade-dark': '#b30000',\n 'result-inconclusive': '#9E9A97', // Gray - no clear result\n 'result-inconclusive-light': 'rgba(158, 154, 151, 0.12)',\n 'result-neutral': p.neutral[500], // Neutral baseline\n\n // Text on result backgrounds (on-result-*)\n 'on-result-improve': p.white,\n 'on-result-degrade': p.white,\n 'on-result-inconclusive': p.white,\n\n // Data visualization colors (data-*)\n // First 10 colors from discrete rainbow optimized for charts\n 'data-1': discreteRainbow[9], // Blue\n 'data-2': discreteRainbow[14], // Green\n 'data-3': discreteRainbow[17], // Yellow\n 'data-4': discreteRainbow[25], // Red\n 'data-5': discreteRainbow[8], // Purple\n 'data-6': discreteRainbow[20], // Orange\n 'data-7': discreteRainbow[13], // Light Blue\n 'data-8': discreteRainbow[15], // Light Green\n 'data-9': discreteRainbow[3], // Lavender\n 'data-10': discreteRainbow[22], // Dark Orange\n\n // Text colors (text-*)\n 'text-primary': '#121828',\n 'text-secondary': '#65748B',\n 'text-tertiary': p.neutral[400],\n 'text-disabled': 'rgba(55, 65, 81, 0.48)',\n 'text-inverse': p.white,\n 'text-link': p.blue[600],\n 'text-link-hover': p.blue[700],\n\n // Surface colors (surface-*) - for elevated containers\n 'surface-base': p.white,\n 'surface-elevated': p.neutral[50], // slightly off-white for elevated cards\n 'surface-raised': p.neutral[100], // light gray for raised cards\n 'surface-overlay': p.white,\n 'surface-input': p.neutral[50], // Input field background (filled variant)\n // Deepest pressed pit (TD-surface-tokens, S-3) — light-mode counterpart of\n // the dark ramp's `inset` plane; a placeholder pairing, not part of the\n // dark-ramp investigation (surface.contract.test.ts is dark-mode only).\n 'surface-inset': p.neutral[300],\n\n // Background colors (background-*)\n 'background-base': '#EBEBEB',\n 'background-default': p.white,\n 'background-subtle': p.neutral[50],\n // Frame/bezel chrome (TD-surface-tokens, S-3) — top bar + side nav shell,\n // one step below `background-base` (darker still than `surface-inset`\n // above, mirroring the dark-mode ordering). Placeholder pairing for light\n // mode (see dark-mode note on `surface-inset` above).\n 'background-frame': p.neutral[400],\n\n // Border colors (border-*)\n 'border-default': '#E8E9EB',\n 'border-subtle': p.neutral[100],\n 'border-strong': p.neutral[300],\n 'border-prominent': p.neutral[400], // high-visibility divider\n 'border-focus': p.blue[600],\n 'border-input': p.neutral[300], // Input field border\n 'border-input-hover': p.neutral[400], // Input field border on hover\n 'border-input-focus': p.blue[600], // Input field border on focus\n 'border-input-error': p.red[600], // Input field border on error\n\n // Alpha hairline separators (surface-independent — composite toward black on\n // light surfaces, mirroring the dark-mode white-alpha family). See §4/S-2.\n 'hairline-subtle': 'rgba(0, 0, 0, 0.06)',\n 'hairline-default': 'rgba(0, 0, 0, 0.09)',\n 'hairline-strong': 'rgba(0, 0, 0, 0.14)',\n\n // Interactive states (interactive-*)\n 'interactive-hover': 'rgba(55, 65, 81, 0.04)',\n 'interactive-focus': 'rgba(55, 65, 81, 0.12)',\n 'interactive-active': 'rgba(55, 65, 81, 0.16)',\n 'interactive-selected': 'rgba(55, 65, 81, 0.08)',\n 'interactive-disabled': 'rgba(55, 65, 81, 0.12)',\n 'interactive-disabled-text': 'rgba(55, 65, 81, 0.26)',\n\n // Divider\n 'divider': '#E8E9EB',\n\n // Avatar default\n 'avatar-background': p.neutral[500],\n 'avatar-text': p.white,\n} as const\n\n// Dark mode semantic colors\nexport const semanticColorsDark = {\n // Brand colors stay the same in dark mode\n 'brand-primary': ramp.orange[400],\n 'brand-primary-light': ramp.orange[300],\n 'brand-primary-dark': ramp.orange[500],\n 'brand-primary-subtle': 'rgba(255, 121, 0, 0.12)',\n 'brand-primary-hover': ramp.orange[300],\n 'brand-primary-active': ramp.orange[200],\n\n 'brand-secondary': ramp.cyan[600],\n 'brand-secondary-light': ramp.cyan[500],\n 'brand-secondary-dark': ramp.cyan[700],\n 'brand-secondary-subtle': 'rgba(48, 123, 155, 0.12)',\n 'brand-secondary-hover': ramp.cyan[500],\n 'brand-secondary-active': ramp.cyan[400],\n\n // Text on brand backgrounds\n 'on-brand-primary': p.white,\n 'on-brand-secondary': p.white,\n\n // Status colors\n 'status-success': ramp.green[300],\n 'status-success-light': ramp.green[200],\n 'status-success-dark': ramp.green[600],\n 'status-success-subtle': 'rgba(46, 213, 115, 0.12)',\n\n // Live-session accent — its OWN role, decoupled from success so the two can diverge\n 'status-live': ramp.green[300],\n 'status-live-muted': ramp.green[500],\n\n 'status-error': ramp.red[600],\n 'status-error-light': ramp.red[500],\n 'status-error-dark': ramp.red[700],\n 'status-error-subtle': 'rgba(209, 67, 67, 0.12)',\n\n 'status-error-vivid': p.redVivid[500],\n 'status-error-vivid-light': p.redVivid[400],\n 'status-error-vivid-dark': p.redVivid[700],\n 'status-error-vivid-subtle': 'rgba(255, 71, 87, 0.12)',\n\n 'status-warning': ramp.amber[300],\n 'status-warning-light': ramp.amber[200],\n 'status-warning-dark': ramp.amber[500],\n 'status-warning-subtle': 'rgba(249, 180, 21, 0.12)',\n\n 'status-info': ramp.blue[500],\n 'status-info-light': ramp.blue[300],\n 'status-info-dark': ramp.blue[600],\n 'status-info-subtle': 'rgba(33, 150, 243, 0.12)',\n\n // Text on status backgrounds\n 'on-status-success': p.white,\n 'on-status-error': p.white,\n 'on-status-warning': p.white,\n 'on-status-info': p.white,\n\n // Result/outcome indicators (result-*)\n 'result-improve': '#4caf50',\n 'result-improve-light': 'rgba(76, 175, 80, 0.16)',\n 'result-improve-dark': '#248a24',\n 'result-degrade': '#ef5350',\n 'result-degrade-light': 'rgba(239, 83, 80, 0.16)',\n 'result-degrade-dark': '#b30000',\n 'result-inconclusive': '#9E9A97',\n 'result-inconclusive-light': 'rgba(158, 154, 151, 0.16)',\n 'result-neutral': p.neutral[400],\n\n // Text on result backgrounds\n 'on-result-improve': p.white,\n 'on-result-degrade': p.white,\n 'on-result-inconclusive': p.white,\n\n // Data visualization colors (same in dark mode for consistency)\n 'data-1': discreteRainbow[9],\n 'data-2': discreteRainbow[14],\n 'data-3': discreteRainbow[17],\n 'data-4': discreteRainbow[25],\n 'data-5': discreteRainbow[8],\n 'data-6': discreteRainbow[20],\n 'data-7': discreteRainbow[13],\n 'data-8': discreteRainbow[15],\n 'data-9': discreteRainbow[3],\n 'data-10': discreteRainbow[22],\n\n // Text colors - inverted for dark mode\n 'text-primary': p.neutral[100],\n 'text-secondary': p.neutral[400],\n 'text-tertiary': p.neutral[500],\n 'text-disabled': 'rgba(255, 255, 255, 0.38)',\n 'text-inverse': p.neutral[900],\n 'text-link': '#828DF8',\n 'text-link-hover': p.blue[400],\n\n // Surface colors - dark backgrounds — warm-tapered DERIVED ramp (TD-surface-tokens,\n // S-1, re-spaced S-3). Shipped verbatim from `deriveSurfaceRamp()` — see\n // `surfaceRampDark` in primitives.ts for the full derivation note. `surface-overlay`\n // and `surface-elevated` are distinct (were both #191919 pre-S-1); `surface-input`\n // tracks one plane above `surface-base`, same relative position as before the remap.\n // `background-base` backs `Surface level=\"background\"` (SurfaceContext.SURFACE_LEVEL_TOKEN),\n // so it takes the ramp's `background` (shell/frame) role, NOT `inset`. The ramp's\n // deepest `inset` plane is now promoted to `surface-inset` below (S-3) — still no\n // `SurfaceLevel` member for it (follow-up, alongside the elevation.ts -1/-2 pressed\n // levels — parallel workstream, not this branch).\n 'surface-base': surf.base, // main surface (#252321, L*13.5)\n 'surface-elevated': surf.elevated, // elevated surface (#2C2A28, L*17 — nav/rail)\n 'surface-raised': surf.raised, // raised surface (#31302F, L*20 — cards)\n 'surface-overlay': surf.overlay, // overlay surface (#373635, L*22.5 — hero/popover)\n 'surface-input': surf.elevated, // input surface (#2C2A28 — one plane above base)\n 'surface-inset': surf.inset, // deepest pressed pit (#13100D, L*4.5 — sub-shell well)\n\n // Background colors — same ramp, the frame/shell end of it.\n 'background-base': surf.background, // shell / frame (#1C1916, L*9 — Surface level=\"background\")\n 'background-default': surf.base, // main background (#252321, L*13.5 — matches surface-base)\n 'background-subtle': surf.elevated, // subtle background (#2C2A28, L*17 — matches surface-elevated)\n // Frame/bezel chrome (S-3) — the top bar + side nav shell; one step BELOW\n // `background-base`, darker even than `surface-inset` — it exits the content\n // ramp entirely rather than sitting in it. See `backgroundFrameDark` in\n // primitives.ts.\n 'background-frame': backgroundFrameDark, // frame / bezel (#100D0A, L*3.79)\n\n // Border colors — `border-subtle` (#1C1C1C) previously collided with\n // `surface-raised` (also #1C1C1C, an invisible border on raised cards). The\n // re-spaced ramp above moved `surface-raised` to #2D2C2B, so this value is now\n // distinct from every surface hex without needing to change it — see\n // `surface.contract.test.ts` R2/R4.\n 'border-default': p.charcoal[400], // default border\n 'border-subtle': p.charcoal[500], // subtle border\n 'border-strong': p.charcoal[300], // strong border\n 'border-prominent': p.charcoal[200], // high-visibility divider\n 'border-focus': '#828DF8',\n 'border-input': p.neutral[600],\n 'border-input-hover': p.neutral[500],\n 'border-input-focus': '#828DF8',\n 'border-input-error': p.red[500],\n\n // Alpha hairline separators — the primary separation cue (§4/S-2). Self-\n // normalizing: composites toward white by ~the same amount on ANY plane, so\n // one family works at every elevation instead of per-surface border tokens.\n // Shadows are demoted to floating-overlay use only (not shipped as a fill\n // separator here — see elevation.ts, follow-up S-4).\n 'hairline-subtle': 'rgba(255, 255, 255, 0.06)',\n 'hairline-default': 'rgba(255, 255, 255, 0.09)',\n 'hairline-strong': 'rgba(255, 255, 255, 0.14)',\n\n // Interactive states\n 'interactive-hover': 'rgba(255, 255, 255, 0.04)',\n 'interactive-focus': 'rgba(255, 255, 255, 0.12)',\n 'interactive-active': 'rgba(255, 255, 255, 0.16)',\n 'interactive-selected': 'rgba(255, 255, 255, 0.08)',\n 'interactive-disabled': 'rgba(255, 255, 255, 0.12)',\n 'interactive-disabled-text': 'rgba(255, 255, 255, 0.26)',\n\n // Divider\n 'divider': p.charcoal[400], // divider color\n\n // Avatar default\n 'avatar-background': p.neutral[600],\n 'avatar-text': p.white,\n} as const\n\n// Typography tokens matching existing app\nexport const semanticTypography = {\n // Headings (Space Grotesk)\n h1: {\n fontFamily: 'heading',\n fontSize: '3.5rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h2: {\n fontFamily: 'heading',\n fontSize: '3rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h3: {\n fontFamily: 'heading',\n fontSize: '2.25rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h4: {\n fontFamily: 'heading',\n fontSize: '2rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h5: {\n fontFamily: 'heading',\n fontSize: '1.5rem',\n fontWeight: 600,\n lineHeight: 1.375,\n },\n h6: {\n fontFamily: 'heading',\n fontSize: '1.125rem',\n fontWeight: 600,\n lineHeight: 1.375,\n },\n\n // Body text (Nunito Sans)\n body1: {\n fontFamily: 'body',\n fontSize: '1rem',\n fontWeight: 400,\n lineHeight: 1.5,\n },\n body2: {\n fontFamily: 'body',\n fontSize: '0.875rem',\n fontWeight: 400,\n lineHeight: 1.57,\n },\n subtitle1: {\n fontFamily: 'body',\n fontSize: '1rem',\n fontWeight: 500,\n lineHeight: 1.75,\n },\n subtitle2: {\n fontFamily: 'body',\n fontSize: '0.875rem',\n fontWeight: 500,\n lineHeight: 1.57,\n },\n caption: {\n fontFamily: 'body',\n fontSize: '0.75rem',\n fontWeight: 400,\n lineHeight: 1.66,\n },\n overline: {\n fontFamily: 'body',\n fontSize: '0.75rem',\n fontWeight: 600,\n lineHeight: 2.5,\n letterSpacing: '0.5px',\n textTransform: 'uppercase' as const,\n },\n button: {\n fontFamily: 'sans',\n fontSize: '0.875rem',\n fontWeight: 600,\n lineHeight: 1.75,\n },\n} as const\n\n// Button size tokens\nexport const buttonSizes = {\n sm: {\n paddingX: '16px',\n paddingY: '6px',\n fontSize: '0.875rem',\n },\n md: {\n paddingX: '20px',\n paddingY: '8px',\n fontSize: '0.875rem',\n },\n lg: {\n paddingX: '24px',\n paddingY: '11px',\n fontSize: '1rem',\n },\n} as const\n\n// Export type for theme mode\nexport type ThemeMode = 'light' | 'dark'\n\n// Helper to get semantic colors based on mode\nexport function getSemanticColors(mode: ThemeMode) {\n return mode === 'dark' ? semanticColorsDark : semanticColorsLight\n}\n","/**\n * Theme Configuration\n *\n * Maps semantic tokens to CSS custom properties for runtime theming.\n * Dark mode is the default theme.\n */\n\nimport { semanticColorsLight, semanticColorsDark, type ThemeMode } from './tokens/semantic'\n\n// Theme-independent custom properties: identical in light and dark in\n// global.css (RGB glow decompositions, font families, animation tokens). Kept\n// as literals since they are not part of the semantic COLOR maps, and spread\n// into both theme maps so codegen mirrors global.css exactly.\nconst themeIndependentCSSVars = {\n // RGB decomposed values for glow shadows\n '--color-brand-primary-rgb': '255, 121, 0',\n '--color-brand-secondary-rgb': '48, 123, 155',\n '--color-status-success-rgb': '46, 213, 115',\n '--color-status-error-rgb': '209, 67, 67',\n '--color-status-error-vivid-rgb': '255, 71, 87',\n '--color-status-warning-rgb': '249, 180, 21',\n '--color-status-info-rgb': '33, 150, 243',\n '--color-background-base-rgb': '16, 16, 16',\n\n // Font families\n '--font-family-sans': \"'Inter'\",\n '--font-family-body': \"'Nunito Sans'\",\n '--font-family-heading': \"'Space Grotesk'\",\n '--font-family-mono': \"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace\",\n\n // Animation tokens\n '--ease-out': 'cubic-bezier(0.22, 1, 0.36, 1)',\n '--ease-in-out': 'cubic-bezier(0.65, 0, 0.35, 1)',\n '--ease-spring': 'cubic-bezier(0.34, 1.56, 0.64, 1)',\n '--duration-fast': '150ms',\n '--duration-normal': '250ms',\n '--duration-slow': '400ms',\n} as const\n\n// CSS custom properties for light mode\nexport const lightThemeCSSVars = {\n '--color-brand-primary': semanticColorsLight['brand-primary'],\n '--color-brand-primary-light': semanticColorsLight['brand-primary-light'],\n '--color-brand-primary-dark': semanticColorsLight['brand-primary-dark'],\n '--color-brand-primary-subtle': semanticColorsLight['brand-primary-subtle'],\n '--color-brand-secondary': semanticColorsLight['brand-secondary'],\n '--color-brand-secondary-light': semanticColorsLight['brand-secondary-light'],\n '--color-brand-secondary-dark': semanticColorsLight['brand-secondary-dark'],\n '--color-brand-secondary-subtle': semanticColorsLight['brand-secondary-subtle'],\n\n '--color-on-brand-primary': semanticColorsLight['on-brand-primary'],\n '--color-on-brand-secondary': semanticColorsLight['on-brand-secondary'],\n\n '--color-status-success': semanticColorsLight['status-success'],\n '--color-status-success-subtle': semanticColorsLight['status-success-subtle'],\n '--color-status-live': semanticColorsLight['status-live'],\n '--color-status-live-muted': semanticColorsLight['status-live-muted'],\n '--color-status-error': semanticColorsLight['status-error'],\n '--color-status-error-subtle': semanticColorsLight['status-error-subtle'],\n '--color-status-warning': semanticColorsLight['status-warning'],\n '--color-status-warning-subtle': semanticColorsLight['status-warning-subtle'],\n '--color-status-info': semanticColorsLight['status-info'],\n '--color-status-info-subtle': semanticColorsLight['status-info-subtle'],\n\n '--color-status-error-vivid': semanticColorsLight['status-error-vivid'],\n '--color-status-error-vivid-light': semanticColorsLight['status-error-vivid-light'],\n '--color-status-error-vivid-dark': semanticColorsLight['status-error-vivid-dark'],\n '--color-status-error-vivid-subtle': semanticColorsLight['status-error-vivid-subtle'],\n\n '--color-text-primary': semanticColorsLight['text-primary'],\n '--color-text-secondary': semanticColorsLight['text-secondary'],\n '--color-text-tertiary': semanticColorsLight['text-tertiary'],\n '--color-text-disabled': semanticColorsLight['text-disabled'],\n '--color-text-inverse': semanticColorsLight['text-inverse'],\n '--color-text-link': semanticColorsLight['text-link'],\n\n '--color-surface-base': semanticColorsLight['surface-base'],\n '--color-surface-elevated': semanticColorsLight['surface-elevated'],\n '--color-surface-raised': semanticColorsLight['surface-raised'],\n '--color-surface-inset': semanticColorsLight['surface-inset'],\n\n '--color-background-base': semanticColorsLight['background-base'],\n '--color-background-default': semanticColorsLight['background-default'],\n '--color-background-subtle': semanticColorsLight['background-subtle'],\n '--color-background-frame': semanticColorsLight['background-frame'],\n\n '--color-border-default': semanticColorsLight['border-default'],\n '--color-border-subtle': semanticColorsLight['border-subtle'],\n '--color-border-strong': semanticColorsLight['border-strong'],\n '--color-border-prominent': semanticColorsLight['border-prominent'],\n '--color-border-focus': semanticColorsLight['border-focus'],\n\n '--color-interactive-hover': semanticColorsLight['interactive-hover'],\n '--color-interactive-focus': semanticColorsLight['interactive-focus'],\n '--color-interactive-active': semanticColorsLight['interactive-active'],\n '--color-interactive-selected': semanticColorsLight['interactive-selected'],\n '--color-interactive-disabled': semanticColorsLight['interactive-disabled'],\n\n '--color-divider': semanticColorsLight['divider'],\n\n '--color-brand-primary-hover': semanticColorsLight['brand-primary-hover'],\n '--color-brand-primary-active': semanticColorsLight['brand-primary-active'],\n '--color-brand-secondary-hover': semanticColorsLight['brand-secondary-hover'],\n '--color-brand-secondary-active': semanticColorsLight['brand-secondary-active'],\n\n '--color-status-success-light': semanticColorsLight['status-success-light'],\n '--color-status-success-dark': semanticColorsLight['status-success-dark'],\n '--color-status-error-light': semanticColorsLight['status-error-light'],\n '--color-status-error-dark': semanticColorsLight['status-error-dark'],\n '--color-status-warning-light': semanticColorsLight['status-warning-light'],\n '--color-status-warning-dark': semanticColorsLight['status-warning-dark'],\n '--color-status-info-light': semanticColorsLight['status-info-light'],\n '--color-status-info-dark': semanticColorsLight['status-info-dark'],\n\n '--color-on-status-success': semanticColorsLight['on-status-success'],\n '--color-on-status-error': semanticColorsLight['on-status-error'],\n '--color-on-status-warning': semanticColorsLight['on-status-warning'],\n '--color-on-status-info': semanticColorsLight['on-status-info'],\n\n '--color-result-improve': semanticColorsLight['result-improve'],\n '--color-result-improve-light': semanticColorsLight['result-improve-light'],\n '--color-result-improve-dark': semanticColorsLight['result-improve-dark'],\n '--color-result-degrade': semanticColorsLight['result-degrade'],\n '--color-result-degrade-light': semanticColorsLight['result-degrade-light'],\n '--color-result-degrade-dark': semanticColorsLight['result-degrade-dark'],\n '--color-result-inconclusive': semanticColorsLight['result-inconclusive'],\n '--color-result-inconclusive-light': semanticColorsLight['result-inconclusive-light'],\n '--color-result-neutral': semanticColorsLight['result-neutral'],\n\n '--color-on-result-improve': semanticColorsLight['on-result-improve'],\n '--color-on-result-degrade': semanticColorsLight['on-result-degrade'],\n '--color-on-result-inconclusive': semanticColorsLight['on-result-inconclusive'],\n\n '--color-data-1': semanticColorsLight['data-1'],\n '--color-data-2': semanticColorsLight['data-2'],\n '--color-data-3': semanticColorsLight['data-3'],\n '--color-data-4': semanticColorsLight['data-4'],\n '--color-data-5': semanticColorsLight['data-5'],\n '--color-data-6': semanticColorsLight['data-6'],\n '--color-data-7': semanticColorsLight['data-7'],\n '--color-data-8': semanticColorsLight['data-8'],\n '--color-data-9': semanticColorsLight['data-9'],\n '--color-data-10': semanticColorsLight['data-10'],\n\n '--color-text-link-hover': semanticColorsLight['text-link-hover'],\n\n '--color-surface-overlay': semanticColorsLight['surface-overlay'],\n '--color-surface-input': semanticColorsLight['surface-input'],\n\n '--color-border-input': semanticColorsLight['border-input'],\n '--color-border-input-hover': semanticColorsLight['border-input-hover'],\n '--color-border-input-focus': semanticColorsLight['border-input-focus'],\n '--color-border-input-error': semanticColorsLight['border-input-error'],\n\n '--color-hairline-subtle': semanticColorsLight['hairline-subtle'],\n '--color-hairline-default': semanticColorsLight['hairline-default'],\n '--color-hairline-strong': semanticColorsLight['hairline-strong'],\n\n '--color-interactive-disabled-text': semanticColorsLight['interactive-disabled-text'],\n\n '--color-avatar-background': semanticColorsLight['avatar-background'],\n '--color-avatar-text': semanticColorsLight['avatar-text'],\n\n ...themeIndependentCSSVars,\n} as const\n\n// CSS custom properties for dark mode (default)\nexport const darkThemeCSSVars = {\n '--color-brand-primary': semanticColorsDark['brand-primary'],\n '--color-brand-primary-light': semanticColorsDark['brand-primary-light'],\n '--color-brand-primary-dark': semanticColorsDark['brand-primary-dark'],\n '--color-brand-primary-subtle': semanticColorsDark['brand-primary-subtle'],\n '--color-brand-secondary': semanticColorsDark['brand-secondary'],\n '--color-brand-secondary-light': semanticColorsDark['brand-secondary-light'],\n '--color-brand-secondary-dark': semanticColorsDark['brand-secondary-dark'],\n '--color-brand-secondary-subtle': semanticColorsDark['brand-secondary-subtle'],\n\n '--color-on-brand-primary': semanticColorsDark['on-brand-primary'],\n '--color-on-brand-secondary': semanticColorsDark['on-brand-secondary'],\n\n '--color-status-success': semanticColorsDark['status-success'],\n '--color-status-success-subtle': semanticColorsDark['status-success-subtle'],\n '--color-status-live': semanticColorsDark['status-live'],\n '--color-status-live-muted': semanticColorsDark['status-live-muted'],\n '--color-status-error': semanticColorsDark['status-error'],\n '--color-status-error-subtle': semanticColorsDark['status-error-subtle'],\n '--color-status-warning': semanticColorsDark['status-warning'],\n '--color-status-warning-subtle': semanticColorsDark['status-warning-subtle'],\n '--color-status-info': semanticColorsDark['status-info'],\n '--color-status-info-subtle': semanticColorsDark['status-info-subtle'],\n\n '--color-status-error-vivid': semanticColorsDark['status-error-vivid'],\n '--color-status-error-vivid-light': semanticColorsDark['status-error-vivid-light'],\n '--color-status-error-vivid-dark': semanticColorsDark['status-error-vivid-dark'],\n '--color-status-error-vivid-subtle': semanticColorsDark['status-error-vivid-subtle'],\n\n '--color-text-primary': semanticColorsDark['text-primary'],\n '--color-text-secondary': semanticColorsDark['text-secondary'],\n '--color-text-tertiary': semanticColorsDark['text-tertiary'],\n '--color-text-disabled': semanticColorsDark['text-disabled'],\n '--color-text-inverse': semanticColorsDark['text-inverse'],\n '--color-text-link': semanticColorsDark['text-link'],\n\n '--color-surface-base': semanticColorsDark['surface-base'],\n '--color-surface-elevated': semanticColorsDark['surface-elevated'],\n '--color-surface-raised': semanticColorsDark['surface-raised'],\n '--color-surface-inset': semanticColorsDark['surface-inset'],\n\n '--color-background-base': semanticColorsDark['background-base'],\n '--color-background-default': semanticColorsDark['background-default'],\n '--color-background-subtle': semanticColorsDark['background-subtle'],\n '--color-background-frame': semanticColorsDark['background-frame'],\n\n '--color-border-default': semanticColorsDark['border-default'],\n '--color-border-subtle': semanticColorsDark['border-subtle'],\n '--color-border-strong': semanticColorsDark['border-strong'],\n '--color-border-prominent': semanticColorsDark['border-prominent'],\n '--color-border-focus': semanticColorsDark['border-focus'],\n\n '--color-interactive-hover': semanticColorsDark['interactive-hover'],\n '--color-interactive-focus': semanticColorsDark['interactive-focus'],\n '--color-interactive-active': semanticColorsDark['interactive-active'],\n '--color-interactive-selected': semanticColorsDark['interactive-selected'],\n '--color-interactive-disabled': semanticColorsDark['interactive-disabled'],\n\n '--color-divider': semanticColorsDark['divider'],\n\n '--color-brand-primary-hover': semanticColorsDark['brand-primary-hover'],\n '--color-brand-primary-active': semanticColorsDark['brand-primary-active'],\n '--color-brand-secondary-hover': semanticColorsDark['brand-secondary-hover'],\n '--color-brand-secondary-active': semanticColorsDark['brand-secondary-active'],\n\n '--color-status-success-light': semanticColorsDark['status-success-light'],\n '--color-status-success-dark': semanticColorsDark['status-success-dark'],\n '--color-status-error-light': semanticColorsDark['status-error-light'],\n '--color-status-error-dark': semanticColorsDark['status-error-dark'],\n '--color-status-warning-light': semanticColorsDark['status-warning-light'],\n '--color-status-warning-dark': semanticColorsDark['status-warning-dark'],\n '--color-status-info-light': semanticColorsDark['status-info-light'],\n '--color-status-info-dark': semanticColorsDark['status-info-dark'],\n\n '--color-on-status-success': semanticColorsDark['on-status-success'],\n '--color-on-status-error': semanticColorsDark['on-status-error'],\n '--color-on-status-warning': semanticColorsDark['on-status-warning'],\n '--color-on-status-info': semanticColorsDark['on-status-info'],\n\n '--color-result-improve': semanticColorsDark['result-improve'],\n '--color-result-improve-light': semanticColorsDark['result-improve-light'],\n '--color-result-improve-dark': semanticColorsDark['result-improve-dark'],\n '--color-result-degrade': semanticColorsDark['result-degrade'],\n '--color-result-degrade-light': semanticColorsDark['result-degrade-light'],\n '--color-result-degrade-dark': semanticColorsDark['result-degrade-dark'],\n '--color-result-inconclusive': semanticColorsDark['result-inconclusive'],\n '--color-result-inconclusive-light': semanticColorsDark['result-inconclusive-light'],\n '--color-result-neutral': semanticColorsDark['result-neutral'],\n\n '--color-on-result-improve': semanticColorsDark['on-result-improve'],\n '--color-on-result-degrade': semanticColorsDark['on-result-degrade'],\n '--color-on-result-inconclusive': semanticColorsDark['on-result-inconclusive'],\n\n '--color-data-1': semanticColorsDark['data-1'],\n '--color-data-2': semanticColorsDark['data-2'],\n '--color-data-3': semanticColorsDark['data-3'],\n '--color-data-4': semanticColorsDark['data-4'],\n '--color-data-5': semanticColorsDark['data-5'],\n '--color-data-6': semanticColorsDark['data-6'],\n '--color-data-7': semanticColorsDark['data-7'],\n '--color-data-8': semanticColorsDark['data-8'],\n '--color-data-9': semanticColorsDark['data-9'],\n '--color-data-10': semanticColorsDark['data-10'],\n\n '--color-text-link-hover': semanticColorsDark['text-link-hover'],\n\n '--color-surface-overlay': semanticColorsDark['surface-overlay'],\n '--color-surface-input': semanticColorsDark['surface-input'],\n\n '--color-border-input': semanticColorsDark['border-input'],\n '--color-border-input-hover': semanticColorsDark['border-input-hover'],\n '--color-border-input-focus': semanticColorsDark['border-input-focus'],\n '--color-border-input-error': semanticColorsDark['border-input-error'],\n\n '--color-hairline-subtle': semanticColorsDark['hairline-subtle'],\n '--color-hairline-default': semanticColorsDark['hairline-default'],\n '--color-hairline-strong': semanticColorsDark['hairline-strong'],\n\n '--color-interactive-disabled-text': semanticColorsDark['interactive-disabled-text'],\n\n '--color-avatar-background': semanticColorsDark['avatar-background'],\n '--color-avatar-text': semanticColorsDark['avatar-text'],\n\n ...themeIndependentCSSVars,\n} as const\n\n// Helper to get CSS vars for a theme mode\nexport function getThemeCSSVars(mode: ThemeMode) {\n return mode === 'dark' ? darkThemeCSSVars : lightThemeCSSVars\n}\n\n// Gluestack UI theme configuration\nexport const gluestackConfig = {\n tokens: {\n colors: {\n // Map to our semantic colors via CSS vars\n primary500: 'var(--color-brand-primary)',\n primary600: 'var(--color-brand-primary-dark)',\n primary400: 'var(--color-brand-primary-light)',\n\n secondary500: 'var(--color-brand-secondary)',\n secondary600: 'var(--color-brand-secondary-dark)',\n secondary400: 'var(--color-brand-secondary-light)',\n\n success500: 'var(--color-status-success)',\n error500: 'var(--color-status-error)',\n warning500: 'var(--color-status-warning)',\n info500: 'var(--color-status-info)',\n\n textLight: 'var(--color-text-primary)',\n textDark: 'var(--color-text-inverse)',\n\n backgroundLight: 'var(--color-background-default)',\n backgroundDark: 'var(--color-surface-base)',\n },\n space: {\n '0': 0,\n '1': 4,\n '2': 8,\n '3': 12,\n '4': 16,\n '5': 20,\n '6': 24,\n '8': 32,\n '10': 40,\n '12': 48,\n '16': 64,\n '20': 80,\n '24': 96,\n },\n radii: {\n none: 0,\n sm: 4,\n md: 8,\n lg: 12,\n xl: 16,\n '2xl': 24,\n full: 9999,\n },\n fontSizes: {\n xs: 12,\n sm: 14,\n md: 16,\n lg: 18,\n xl: 20,\n '2xl': 24,\n '3xl': 30,\n '4xl': 36,\n '5xl': 48,\n },\n },\n aliases: {\n bg: 'backgroundColor',\n p: 'padding',\n px: 'paddingHorizontal',\n py: 'paddingVertical',\n m: 'margin',\n mx: 'marginHorizontal',\n my: 'marginVertical',\n h: 'height',\n w: 'width',\n rounded: 'borderRadius',\n },\n} as const\n\nexport type ThemeConfig = typeof gluestackConfig\n","/**\n * Neumorphic Shadow Utilities\n * \n * Neumorphism creates soft, extruded UI using dual opposing shadows.\n * - Light source assumed from top-left\n * - Raised elements: dark shadow bottom-right, light highlight top-left\n * - Pressed elements: inverted with `inset` shadows\n */\n\nimport { Platform, type ViewStyle } from 'react-native'\n\n// ============================================================================\n// Color Math Utilities\n// ============================================================================\n\n/**\n * Parse a hex color to RGB values (0-255).\n * Supports both #RGB and #RRGGBB formats.\n */\nexport function hexToRgb(hex: string): { r: number; g: number; b: number } | null {\n const cleaned = hex.replace('#', '')\n \n let r: number, g: number, b: number\n \n if (cleaned.length === 3) {\n r = parseInt(cleaned[0] + cleaned[0], 16)\n g = parseInt(cleaned[1] + cleaned[1], 16)\n b = parseInt(cleaned[2] + cleaned[2], 16)\n } else if (cleaned.length === 6) {\n r = parseInt(cleaned.slice(0, 2), 16)\n g = parseInt(cleaned.slice(2, 4), 16)\n b = parseInt(cleaned.slice(4, 6), 16)\n } else {\n return null\n }\n \n return { r, g, b }\n}\n\n/**\n * Convert RGB (0-255) to HSV (h: 0-360, s: 0-1, v: 0-1).\n */\nexport function rgbToHsv(r: number, g: number, b: number): { h: number; s: number; v: number } {\n const rNorm = r / 255\n const gNorm = g / 255\n const bNorm = b / 255\n \n const max = Math.max(rNorm, gNorm, bNorm)\n const min = Math.min(rNorm, gNorm, bNorm)\n const delta = max - min\n \n // Value\n const v = max\n \n // Saturation\n const s = max === 0 ? 0 : delta / max\n \n // Hue\n let h = 0\n if (delta !== 0) {\n if (max === rNorm) {\n h = 60 * (((gNorm - bNorm) / delta) % 6)\n } else if (max === gNorm) {\n h = 60 * ((bNorm - rNorm) / delta + 2)\n } else {\n h = 60 * ((rNorm - gNorm) / delta + 4)\n }\n }\n if (h < 0) h += 360\n \n return { h, s, v }\n}\n\n/**\n * Convert HSV (h: 0-360, s: 0-1, v: 0-1) to RGB (0-255).\n */\nexport function hsvToRgb(h: number, s: number, v: number): { r: number; g: number; b: number } {\n const c = v * s\n const x = c * (1 - Math.abs((h / 60) % 2 - 1))\n const m = v - c\n \n let rPrime: number, gPrime: number, bPrime: number\n\n if (h >= 0 && h < 60) {\n rPrime = c; gPrime = x; bPrime = 0\n } else if (h >= 60 && h < 120) {\n rPrime = x; gPrime = c; bPrime = 0\n } else if (h >= 120 && h < 180) {\n rPrime = 0; gPrime = c; bPrime = x\n } else if (h >= 180 && h < 240) {\n rPrime = 0; gPrime = x; bPrime = c\n } else if (h >= 240 && h < 300) {\n rPrime = x; gPrime = 0; bPrime = c\n } else {\n rPrime = c; gPrime = 0; bPrime = x\n }\n \n return {\n r: Math.round((rPrime + m) * 255),\n g: Math.round((gPrime + m) * 255),\n b: Math.round((bPrime + m) * 255),\n }\n}\n\n/**\n * Convert RGB values to hex string.\n */\nexport function rgbToHex(r: number, g: number, b: number): string {\n const toHex = (n: number) => {\n const clamped = Math.max(0, Math.min(255, Math.round(n)))\n return clamped.toString(16).padStart(2, '0')\n }\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`\n}\n\n/**\n * Lighten a color by increasing its HSV Value component.\n * \n * @param hex - The hex color to lighten\n * @param amount - Amount to increase V by (0-1)\n */\nexport function lighten(hex: string, amount: number = 0.1): string {\n const rgb = hexToRgb(hex)\n if (!rgb) return hex\n \n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const newV = Math.min(1, hsv.v + amount)\n \n const newRgb = hsvToRgb(hsv.h, hsv.s, newV)\n return rgbToHex(newRgb.r, newRgb.g, newRgb.b)\n}\n\n/**\n * Darken a color by decreasing its HSV Value component.\n * \n * @param hex - The hex color to darken\n * @param amount - Amount to decrease V by (0-1)\n */\nexport function darken(hex: string, amount: number = 0.1): string {\n const rgb = hexToRgb(hex)\n if (!rgb) return hex\n \n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const newV = Math.max(0, hsv.v - amount)\n \n const newRgb = hsvToRgb(hsv.h, hsv.s, newV)\n return rgbToHex(newRgb.r, newRgb.g, newRgb.b)\n}\n\n/**\n * Get hover colors for a button based on its background color.\n * Automatically adapts intensity based on the color's luminance.\n * \n * @param bgColor - The button's background color (hex)\n * @param intensity - How strong the hover effect should be ('subtle' | 'medium' | 'strong')\n */\nexport function getHoverColors(\n bgColor: string, \n intensity: 'subtle' | 'medium' | 'strong' = 'medium'\n): { raised: string; pressed: string } {\n const amounts = {\n subtle: 0.01,\n medium: 0.02,\n strong: 0.03,\n }\n \n const amount = amounts[intensity]\n \n return {\n raised: lighten(bgColor, amount), // Raised hover: lighten (lifting up)\n pressed: darken(bgColor, amount), // Pressed hover: darken (pressing down)\n }\n}\n\n/**\n * Check if a color is considered \"dark\" (for choosing text color).\n * Uses HSV Value component for simplicity.\n */\nexport function isDark(hex: string): boolean {\n const rgb = hexToRgb(hex)\n if (!rgb) return true\n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n return hsv.v < 0.6\n}\n\n/**\n * Shadow configuration for different surface colors.\n * Each surface needs calibrated light/dark shadow colors.\n * \n * - dark: soft shadow for depth (bottom-right)\n * - light: sharp rim highlight (top-left) - higher opacity for crisp edge\n * - darker: deeper shadow for pressed/inset states\n */\nexport const shadowColors = {\n // For charcoal surfaces (~#2C2C2C to #3C3C3C)\n charcoal: {\n dark: 'rgba(0, 0, 0, 0.5)',\n light: 'rgba(255, 255, 255, 0.12)', // brighter for crisp rim light\n darker: 'rgba(0, 0, 0, 0.6)',\n },\n // For neutral dark surfaces (~#1F2937)\n neutralDark: {\n dark: 'rgba(0, 0, 0, 0.4)',\n light: 'rgba(255, 255, 255, 0.08)',\n darker: 'rgba(0, 0, 0, 0.5)',\n },\n // For light surfaces (white/light gray backgrounds)\n neutralLight: {\n dark: 'rgba(0, 0, 0, 0.15)', // Visible dark shadow for depth on light backgrounds\n light: 'rgba(255, 255, 255, 1)', // Bright highlight for raised effect (visible on light gray)\n darker: 'rgba(0, 0, 0, 0.2)', // Deeper shadow for pressed states\n },\n}\n\nexport type ShadowIntensity = 'subtle' | 'medium' | 'strong'\nexport type ShadowSurface = keyof typeof shadowColors\n\ninterface ShadowConfig {\n offset: number\n blur: number\n}\n\nconst intensityConfig: Record<ShadowIntensity, ShadowConfig> = {\n subtle: { offset: 1, blur: 2 }, // very light, barely visible\n medium: { offset: 2, blur: 4 }, // noticeable but restrained\n strong: { offset: 2, blur: 5 }, // slightly deeper blur, same offset as medium\n}\n\n/**\n * Creates a raised (elevated) neumorphic shadow.\n * Element appears to float above the surface.\n * \n * Uses a soft dark shadow (bottom-right) and a sharp rim light (top-left).\n */\nexport function createRaisedShadow(\n surface: ShadowSurface = 'charcoal',\n intensity: ShadowIntensity = 'medium'\n): ViewStyle {\n const colors = shadowColors[surface]\n const { offset, blur } = intensityConfig[intensity]\n \n // Rim light is sharper: same offset as shadow, but minimal blur for crisp edge\n const rimBlur = 1 // Very tight blur for crisp rim\n \n return Platform.select({\n web: {\n boxShadow: `${offset}px ${offset}px ${blur}px ${colors.dark}, -${offset}px -${offset}px ${rimBlur}px ${colors.light}`,\n } as any,\n default: {\n // React Native shadow approximation (limited compared to web)\n shadowColor: '#000',\n shadowOffset: { width: offset, height: offset },\n shadowOpacity: 0.3,\n shadowRadius: blur / 2,\n elevation: offset,\n },\n }) as ViewStyle\n}\n\n/**\n * Creates a pressed (inset) neumorphic shadow.\n * Element appears pushed into the surface.\n * \n * Uses a soft dark inset shadow (top-left) and a thin sharp rim light (bottom-right).\n */\nexport function createPressedShadow(\n surface: ShadowSurface = 'charcoal',\n intensity: ShadowIntensity = 'medium'\n): ViewStyle {\n const colors = shadowColors[surface]\n const { offset, blur } = intensityConfig[intensity]\n \n // Rim light is always thin and subtle for pressed states\n const rimOffset = 1 // Fixed thin rim\n const rimBlur = 1 // Very tight blur for crisp edge\n \n return Platform.select({\n web: {\n boxShadow: `inset ${offset}px ${offset}px ${blur}px ${colors.darker}, inset -${rimOffset}px -${rimOffset}px ${rimBlur}px ${colors.light}`,\n } as any,\n default: {\n // React Native doesn't support inset shadows, approximate with darker bg\n shadowOpacity: 0,\n elevation: 0,\n },\n }) as ViewStyle\n}\n\n/**\n * Creates a flat (no shadow) style for hover states.\n */\nexport function createFlatShadow(): ViewStyle {\n return Platform.select({\n web: {\n boxShadow: 'none',\n } as any,\n default: {\n shadowOpacity: 0,\n elevation: 0,\n },\n }) as ViewStyle\n}\n\n/**\n * Creates a hover shadow for raised elements.\n * Reduces shadow depth but keeps a subtle rim light to maintain visual boundary.\n */\nexport function createRaisedHoverShadow(\n surface: ShadowSurface = 'charcoal',\n intensity: ShadowIntensity = 'medium'\n): ViewStyle {\n const colors = shadowColors[surface]\n const { offset, blur } = intensityConfig[intensity]\n \n // Reduce shadow depth by half for hover, keep minimal rim light\n const hoverOffset = Math.max(1, Math.round(offset / 2))\n const hoverBlur = Math.max(1, Math.round(blur / 2))\n const rimBlur = 1\n \n return Platform.select({\n web: {\n // Keep same offsets as normal state for rim to prevent \"shrinking\" effect\n boxShadow: `${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${colors.dark}, -${offset}px -${offset}px ${rimBlur}px ${colors.light}`,\n } as any,\n default: {\n shadowColor: '#000',\n shadowOffset: { width: hoverOffset, height: hoverOffset },\n shadowOpacity: 0.2,\n shadowRadius: hoverBlur / 2,\n elevation: hoverOffset,\n },\n }) as ViewStyle\n}\n\n/**\n * Creates a hover shadow for pressed elements.\n * Reduces shadow depth but keeps a subtle rim light to maintain visual boundary.\n */\nexport function createPressedHoverShadow(\n surface: ShadowSurface = 'charcoal',\n intensity: ShadowIntensity = 'medium'\n): ViewStyle {\n const colors = shadowColors[surface]\n const { offset, blur } = intensityConfig[intensity]\n \n // Reduce shadow depth by half for hover, keep minimal rim light\n const hoverOffset = Math.max(1, Math.round(offset / 2))\n const hoverBlur = Math.max(1, Math.round(blur / 2))\n const rimBlur = 1\n \n return Platform.select({\n web: {\n // Keep rim offset at 1px (same as pressed normal) to prevent \"shrinking\" effect\n boxShadow: `inset ${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${colors.darker}, inset -1px -1px ${rimBlur}px ${colors.light}`,\n } as any,\n default: {\n shadowOpacity: 0,\n elevation: 0,\n },\n }) as ViewStyle\n}\n\n/**\n * Pre-built shadow presets for common use cases.\n */\nexport const neumorphicShadows = {\n // Charcoal surface shadows (for dark toolbars, cards)\n charcoal: {\n raised: {\n subtle: createRaisedShadow('charcoal', 'subtle'),\n medium: createRaisedShadow('charcoal', 'medium'),\n strong: createRaisedShadow('charcoal', 'strong'),\n },\n raisedHover: {\n subtle: createRaisedHoverShadow('charcoal', 'subtle'),\n medium: createRaisedHoverShadow('charcoal', 'medium'),\n strong: createRaisedHoverShadow('charcoal', 'strong'),\n },\n pressed: {\n subtle: createPressedShadow('charcoal', 'subtle'),\n medium: createPressedShadow('charcoal', 'medium'),\n strong: createPressedShadow('charcoal', 'strong'),\n },\n pressedHover: {\n subtle: createPressedHoverShadow('charcoal', 'subtle'),\n medium: createPressedHoverShadow('charcoal', 'medium'),\n strong: createPressedHoverShadow('charcoal', 'strong'),\n },\n flat: createFlatShadow(),\n },\n // Neutral dark surface shadows\n neutralDark: {\n raised: {\n subtle: createRaisedShadow('neutralDark', 'subtle'),\n medium: createRaisedShadow('neutralDark', 'medium'),\n strong: createRaisedShadow('neutralDark', 'strong'),\n },\n raisedHover: {\n subtle: createRaisedHoverShadow('neutralDark', 'subtle'),\n medium: createRaisedHoverShadow('neutralDark', 'medium'),\n strong: createRaisedHoverShadow('neutralDark', 'strong'),\n },\n pressed: {\n subtle: createPressedShadow('neutralDark', 'subtle'),\n medium: createPressedShadow('neutralDark', 'medium'),\n strong: createPressedShadow('neutralDark', 'strong'),\n },\n pressedHover: {\n subtle: createPressedHoverShadow('neutralDark', 'subtle'),\n medium: createPressedHoverShadow('neutralDark', 'medium'),\n strong: createPressedHoverShadow('neutralDark', 'strong'),\n },\n flat: createFlatShadow(),\n },\n // Neutral light surface shadows\n neutralLight: {\n raised: {\n subtle: createRaisedShadow('neutralLight', 'subtle'),\n medium: createRaisedShadow('neutralLight', 'medium'),\n strong: createRaisedShadow('neutralLight', 'strong'),\n },\n raisedHover: {\n subtle: createRaisedHoverShadow('neutralLight', 'subtle'),\n medium: createRaisedHoverShadow('neutralLight', 'medium'),\n strong: createRaisedHoverShadow('neutralLight', 'strong'),\n },\n pressed: {\n subtle: createPressedShadow('neutralLight', 'subtle'),\n medium: createPressedShadow('neutralLight', 'medium'),\n strong: createPressedShadow('neutralLight', 'strong'),\n },\n pressedHover: {\n subtle: createPressedHoverShadow('neutralLight', 'subtle'),\n medium: createPressedHoverShadow('neutralLight', 'medium'),\n strong: createPressedHoverShadow('neutralLight', 'strong'),\n },\n flat: createFlatShadow(),\n },\n}\n","/**\n * Elevation System\n *\n * A unified depth system where each elevation level corresponds to:\n * - Calculated surface color (derived from base using lighten)\n * - Shadow intensity and style (raised/pressed)\n * - Dynamically calculated shadow colors (derived from surface color)\n * - Semantic name for reference\n *\n * Elevation range: -2 (deep inset) to +5 (floating overlay)\n *\n * Negative elevations: Inset/pressed elements (sunken into surface)\n * Zero elevation: Base surface (background/page level)\n * Positive elevations: Raised elements (floating above surface)\n *\n * All colors are calculated dynamically from a base surface color,\n * allowing for custom surfaces and consistent color relationships.\n *\n * Lighting Model: Light source from upper-right corner\n * - Raised elements are always lighter than base (consistent across themes)\n * - Base colors must allow sufficient lightening in both themes\n */\n\nimport { Platform, type ViewStyle } from 'react-native'\nimport { lighten, darken, hexToRgb, rgbToHsv, hsvToRgb, rgbToHex } from './shadows'\nimport { semanticColorsLight, semanticColorsDark } from './tokens/semantic'\n\nexport type ElevationLevel = -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5\n\nexport interface ElevationConfig {\n /** Semantic name for this elevation level */\n name: string\n /** Amount to lighten base color (0-1) */\n colorAdjustment: number\n /** Shadow intensity */\n shadowIntensity: 'subtle' | 'medium' | 'strong'\n /** Shadow style: raised (floating) or pressed (inset) */\n shadowStyle: 'raised' | 'pressed'\n /** Description of use case */\n description: string\n}\n\nexport const elevationSystem: Record<ElevationLevel, ElevationConfig> = {\n // Deep inset (recessed input fields, deeply pressed buttons)\n [-2]: {\n name: 'deep-inset',\n colorAdjustment: 0,\n shadowIntensity: 'strong',\n shadowStyle: 'pressed',\n description: 'Deeply recessed elements (e.g., input fields, deeply pressed buttons)',\n },\n\n // Shallow inset (pressed buttons, sunken panels)\n [-1]: {\n name: 'inset',\n colorAdjustment: 0,\n shadowIntensity: 'medium',\n shadowStyle: 'pressed',\n description: 'Shallow inset elements (e.g., pressed buttons, sunken panels within cards)',\n },\n\n // Base level (page background, default surface)\n [0]: {\n name: 'base',\n colorAdjustment: 0,\n shadowIntensity: 'subtle',\n shadowStyle: 'raised',\n description: 'Base surface level (page background, default containers)',\n },\n\n // Level 1: Subtle elevation (outline cards, subtle containers)\n [1]: {\n name: 'subtle',\n colorAdjustment: 0.01,\n shadowIntensity: 'subtle',\n shadowStyle: 'raised',\n description: 'Subtle elevation (outline cards, subtle containers)',\n },\n\n // Level 2: Standard elevation (default cards, buttons)\n [2]: {\n name: 'standard',\n colorAdjustment: 0.02,\n shadowIntensity: 'medium',\n shadowStyle: 'raised',\n description: 'Standard elevation (default cards, raised buttons)',\n },\n\n // Level 3: Prominent elevation (important cards, modals)\n [3]: {\n name: 'prominent',\n colorAdjustment: 0.04,\n shadowIntensity: 'strong',\n shadowStyle: 'raised',\n description: 'Prominent elevation (important cards, modals, dropdowns)',\n },\n\n // Level 4: High elevation (overlays, popovers)\n [4]: {\n name: 'high',\n colorAdjustment: 0.06,\n shadowIntensity: 'strong',\n shadowStyle: 'raised',\n description: 'High elevation (overlays, popovers, tooltips)',\n },\n\n // Level 5: Floating (toasts, floating action buttons)\n [5]: {\n name: 'floating',\n colorAdjustment: 0.08,\n shadowIntensity: 'strong',\n shadowStyle: 'raised',\n description: 'Floating elevation (toasts, floating action buttons, highest z-index)',\n },\n}\n\n/**\n * Calculate rim light color from the BASE color.\n * Creates a consistent bright highlight with opacity that scales with elevation.\n *\n * The rim light represents light hitting the edge of raised elements from a\n * consistent light source. Uses ABSOLUTE HSV value (not relative lightening)\n * for consistent intensity across all surface colors.\n *\n * For colored surfaces: preserves hue/saturation, sets value to fixed bright level\n * For gray surfaces: uses white with appropriate opacity\n *\n * @param baseColor - The base surface color (hex)\n * @param level - Elevation level (used to scale opacity)\n */\nfunction calculateRimLightColor(baseColor: string, level: ElevationLevel): string {\n const rgb = hexToRgb(baseColor)\n if (!rgb) {\n return 'rgba(255, 255, 255, 0.5)'\n }\n\n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const isLight = hsv.v > 0.6\n const isSaturated = hsv.s > 0.3 // Colored (not gray)\n\n // Opacity scales with elevation to compensate for lighter surfaces at higher levels\n // Range: +0% at level 1 to +20% at level 5\n const absLevel = Math.abs(level)\n const opacityBoost = Math.max(0, (absLevel - 1) * 0.05) // +5% per level above 1 (0% to 20%)\n\n if (isSaturated) {\n // For colored surfaces, preserve hue and saturation but set value to fixed bright level\n // This ensures consistent rim light intensity across all colored surfaces\n const rimLightValue = 0.95 // Fixed bright value for rim light\n const rimLightRgb = hsvToRgb(hsv.h, hsv.s * 0.3, rimLightValue) // Reduce saturation for brighter appearance\n\n // Base opacity + elevation boost, capped at 1.0\n const baseOpacity = isLight ? 0.9 : 0.5\n const finalOpacity = Math.min(1, baseOpacity + opacityBoost)\n return `rgba(${rimLightRgb.r}, ${rimLightRgb.g}, ${rimLightRgb.b}, ${finalOpacity.toFixed(2)})`\n } else {\n // For gray/neutral surfaces, use white with appropriate opacity\n const baseOpacity = isLight ? 0.9 : 0.12\n const finalOpacity = Math.min(1, baseOpacity + opacityBoost)\n return `rgba(255, 255, 255, ${finalOpacity.toFixed(2)})`\n }\n}\n\n/**\n * Calculate dark shadow colors from the surface color.\n * The dark shadow is cast BY the element, so it should match the surface color.\n *\n * Uses ABSOLUTE HSV value (not relative darkening) for consistent shadow intensity\n * across all surface colors - simulating a consistent light source.\n *\n * For colored surfaces: preserves hue/saturation, sets value to fixed dark level\n * For gray surfaces: uses black with appropriate opacity\n */\nfunction calculateDarkShadowColors(surfaceColor: string): {\n dark: string\n darker: string\n} {\n const rgb = hexToRgb(surfaceColor)\n if (!rgb) {\n return {\n dark: 'rgba(0, 0, 0, 0.3)',\n darker: 'rgba(0, 0, 0, 0.4)',\n }\n }\n\n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const isLight = hsv.v > 0.6\n const isSaturated = hsv.s > 0.3\n\n if (isSaturated) {\n // For colored surfaces, preserve hue and saturation but set value to fixed dark level\n // This ensures consistent shadow intensity across all colored surfaces\n const darkShadowValue = 0.15 // Fixed dark value for shadows\n const darkShadowRgb = hsvToRgb(hsv.h, hsv.s, darkShadowValue)\n\n if (isLight) {\n return {\n dark: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.3)`,\n darker: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.4)`,\n }\n } else {\n return {\n dark: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.5)`,\n darker: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.6)`,\n }\n }\n } else {\n // For gray surfaces, use standard black shadows\n if (isLight) {\n return {\n dark: 'rgba(0, 0, 0, 0.2)',\n darker: 'rgba(0, 0, 0, 0.3)',\n }\n } else {\n return {\n dark: 'rgba(0, 0, 0, 0.5)',\n darker: 'rgba(0, 0, 0, 0.6)',\n }\n }\n }\n}\n\n/**\n * Get rim light size config.\n * Fixed 1px offset and blur for a consistent, crisp rim highlight.\n * Opacity scaling (in calculateRimLightColor) handles elevation differences.\n */\nfunction getRimLightConfig(): { offset: number; blur: number } {\n return {\n offset: 1, // Fixed 1px for crisp rim\n blur: 1, // Tight blur for crisp edge\n }\n}\n\n/**\n * Get elevation configuration for a given level\n */\nexport function getElevationConfig(level: ElevationLevel): ElevationConfig {\n return elevationSystem[level]\n}\n\n// Simple cache for elevation surface colors\nconst elevationSurfaceCache = new Map<string, string>()\nconst MAX_CACHE_SIZE = 100\n\nfunction getCacheKey(baseColor: string, level: ElevationLevel, theme: 'light' | 'dark'): string {\n return `${baseColor}-${level}-${theme}`\n}\n\nfunction calculateElevationSurface(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark'\n): string {\n const config = elevationSystem[level]\n\n if (config.colorAdjustment === 0) {\n return baseColor\n }\n\n // For raised elevations (positive), always lighten (consistent lighting model)\n // Light source is from upper-right, so raised elements are always lighter\n // For inset elevations (negative), we keep base color (shadow creates depth)\n if (level < 0) {\n return baseColor // Inset elements use base color\n }\n\n // Always lighten for raised elements (consistent across themes)\n // Base colors must be chosen to allow sufficient lightening in dark mode\n return lighten(baseColor, config.colorAdjustment)\n}\n\n/**\n * Calculate surface color for an elevation level from a base color.\n * Results are cached to avoid redundant calculations.\n *\n * @param baseColor - Base surface color (hex)\n * @param level - Elevation level\n * @param theme - Current theme ('light' or 'dark')\n * @returns Calculated surface color (hex)\n */\nexport function getElevationSurface(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark'\n): string {\n const cacheKey = getCacheKey(baseColor, level, theme)\n\n // Check cache\n if (elevationSurfaceCache.has(cacheKey)) {\n return elevationSurfaceCache.get(cacheKey)!\n }\n\n // Calculate\n const result = calculateElevationSurface(baseColor, level, theme)\n\n // Cache result (with size limit to prevent memory leaks)\n if (elevationSurfaceCache.size >= MAX_CACHE_SIZE) {\n // Remove oldest entry (simple FIFO)\n const firstKey = elevationSurfaceCache.keys().next().value!\n elevationSurfaceCache.delete(firstKey)\n }\n elevationSurfaceCache.set(cacheKey, result)\n\n return result\n}\n\n// Cache for shadow styles (less frequently used, smaller cache)\nconst elevationShadowCache = new Map<string, ViewStyle>()\nconst MAX_SHADOW_CACHE_SIZE = 50\n\nfunction getShadowCacheKey(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark',\n isHovered: boolean\n): string {\n return `${baseColor}-${level}-${theme}-${isHovered}`\n}\n\nfunction calculateElevationShadow(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark',\n isHovered: boolean = false\n): ViewStyle {\n const config = elevationSystem[level]\n\n // Base level has no shadow\n if (level === 0) {\n return {}\n }\n\n // Calculate the actual elevated surface color\n const elevatedSurfaceColor = calculateElevationSurface(baseColor, level, theme)\n\n // Rim light: calculated from BASE color (consistent across all elevations)\n // This represents a consistent light source - only size changes with elevation\n const rimLightColor = calculateRimLightColor(baseColor, level)\n\n // Dark shadow: calculated from ELEVATED surface color\n // The shadow is cast by the element, so it should match the surface\n const darkShadowColors = calculateDarkShadowColors(elevatedSurfaceColor)\n\n // Get shadow intensity config (for dark shadow)\n const intensityConfig = {\n subtle: { offset: 1, blur: 2 },\n medium: { offset: 2, blur: 4 },\n strong: { offset: 2, blur: 5 },\n }\n\n const { offset, blur } = intensityConfig[config.shadowIntensity]\n\n // Get rim light config (scales with elevation level)\n const rimConfig = getRimLightConfig()\n\n if (config.shadowStyle === 'pressed') {\n // Inset shadow (pressed elements)\n if (isHovered) {\n // Reduce shadow depth for hover\n const hoverOffset = Math.max(1, Math.round(offset / 2))\n const hoverBlur = Math.max(1, Math.round(blur / 2))\n return Platform.select({\n web: {\n boxShadow: `inset ${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${darkShadowColors.darker}, inset -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`,\n } as any,\n default: {\n shadowOpacity: 0,\n elevation: 0,\n },\n }) as ViewStyle\n }\n\n return Platform.select({\n web: {\n boxShadow: `inset ${offset}px ${offset}px ${blur}px ${darkShadowColors.darker}, inset -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`,\n } as any,\n default: {\n shadowOpacity: 0,\n elevation: 0,\n },\n }) as ViewStyle\n } else {\n // Raised shadow (floating elements)\n if (isHovered) {\n // Reduce shadow depth for hover\n const hoverOffset = Math.max(1, Math.round(offset / 2))\n const hoverBlur = Math.max(1, Math.round(blur / 2))\n return Platform.select({\n web: {\n boxShadow: `${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${darkShadowColors.dark}, -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`,\n } as any,\n default: {\n shadowColor: '#000',\n shadowOffset: { width: hoverOffset, height: hoverOffset },\n shadowOpacity: 0.2,\n shadowRadius: hoverBlur / 2,\n elevation: hoverOffset,\n },\n }) as ViewStyle\n }\n\n return Platform.select({\n web: {\n boxShadow: `${offset}px ${offset}px ${blur}px ${darkShadowColors.dark}, -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`,\n } as any,\n default: {\n shadowColor: '#000',\n shadowOffset: { width: offset, height: offset },\n shadowOpacity: 0.3,\n shadowRadius: blur / 2,\n elevation: offset,\n },\n }) as ViewStyle\n }\n}\n\n/**\n * Get shadow style for an elevation level, calculated dynamically from surface color.\n * Results are cached to avoid redundant calculations.\n *\n * @param baseColor - Base surface color (hex)\n * @param level - Elevation level\n * @param theme - Current theme ('light' or 'dark')\n * @param isHovered - Whether element is hovered\n * @returns ViewStyle with shadow properties\n */\nexport function getElevationShadow(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark',\n isHovered: boolean = false\n): ViewStyle {\n const cacheKey = getShadowCacheKey(baseColor, level, theme, isHovered)\n\n // Check cache\n if (elevationShadowCache.has(cacheKey)) {\n return elevationShadowCache.get(cacheKey)!\n }\n\n // Calculate shadow\n const result = calculateElevationShadow(baseColor, level, theme, isHovered)\n\n // Cache result\n if (elevationShadowCache.size >= MAX_SHADOW_CACHE_SIZE) {\n const firstKey = elevationShadowCache.keys().next().value!\n elevationShadowCache.delete(firstKey)\n }\n elevationShadowCache.set(cacheKey, result)\n\n return result\n}\n\n/**\n * Elevation level backing a `<Surface pressed>` recess: the shallow `inset`\n * (-1) step. Pressed exposes ONE level of depth — pressed-2 is intentionally\n * not surfaced (the deeper `-2` deep-inset stays available to `elevation`).\n */\nexport const PRESSED_ELEVATION_LEVEL: ElevationLevel = -1\n\n/**\n * Inner-shadow recess for a pressed (sunken) surface, tuned to the well's own\n * fill colour so the rim/shadow tints track the darker fill. Composes WITH the\n * darker pressed fill: on web it adds an inset boxShadow; on the native path\n * (no inset-shadow support) it's a no-op and the recess reads via the fill\n * alone — so a pressed surface stays legibly sunken with or without the shadow.\n *\n * @param fillColor - The pressed surface's own fill (one ramp step down).\n * @param theme - Current theme ('light' or 'dark').\n */\nexport function getPressedRecessShadow(fillColor: string, theme: 'light' | 'dark'): ViewStyle {\n return getElevationShadow(fillColor, PRESSED_ELEVATION_LEVEL, theme)\n}\n\n/**\n * Get base surface color from theme.\n * This is the foundation color that all elevations are calculated from.\n *\n * IMPORTANT: Base colors must be chosen to allow sufficient lightening.\n *\n * **Light Mode**: Cannot use `#FFFFFF` (white) - cannot lighten white!\n * - Use `#F3F4F6` (neutral[100]) - can lighten to `#FAFAFA` → `#FFFFFF`\n * - This allows raised elevations to be lighter (closer to white)\n *\n * **Dark Mode**: Need lighter base to allow sufficient lightening\n * - Use `surface-elevated` (#2A2827, TD-surface-tokens ramp) - allows further lightening\n *\n * Can be overridden to use custom base colors for special cases.\n */\nexport function getBaseSurfaceColor(theme: 'light' | 'dark'): string {\n // Use semantic token values so elevation colors stay in sync with the token pipeline.\n // Light mode: surface-raised (#F3F4F6 / neutral[100]) - NOT white, so we can lighten it\n // Dark mode: surface-elevated (#2A2827, TD-surface-tokens ramp) - allows sufficient lightening\n\n return theme === 'light'\n ? semanticColorsLight['surface-raised']\n : semanticColorsDark['surface-elevated']\n}\n\n/**\n * Component-specific elevation ranges\n * Defines which elevation levels each component type can use\n */\nexport const componentElevationRanges = {\n button: {\n allowed: [2] as const,\n default: 2 as const,\n hover: 3 as const,\n },\n card: {\n allowed: [1, 2, 3] as const,\n default: 2 as const,\n hover: 3 as const,\n },\n input: {\n allowed: [-2, -1, 0] as const,\n default: -1 as const,\n },\n overlay: {\n allowed: [4, 5] as const,\n default: 4 as const,\n },\n} as const\n\nexport type ComponentType = keyof typeof componentElevationRanges\n\n/**\n * Validate and clamp elevation to component's allowed range\n */\nexport function getValidatedElevation(\n component: ComponentType,\n requested: ElevationLevel\n): ElevationLevel {\n const range = componentElevationRanges[component]\n if ((range.allowed as readonly ElevationLevel[]).includes(requested)) {\n return requested\n }\n // Clamp to nearest allowed elevation\n const sorted = [...range.allowed].sort((a, b) => a - b)\n if (requested < sorted[0]) return sorted[0]\n if (requested > sorted[sorted.length - 1]) return sorted[sorted.length - 1]\n // Find closest\n return sorted.reduce((prev, curr) =>\n Math.abs(curr - requested) < Math.abs(prev - requested) ? curr : prev\n ) as ElevationLevel\n}\n\n// =============================================================================\n// Glow Shadow Support\n// =============================================================================\n\nexport type GlowIntensity = 'subtle' | 'medium' | 'strong'\n\nconst glowConfig: Record<GlowIntensity, { blur: number; spread: number; opacity: number }> = {\n subtle: { blur: 12, spread: 0, opacity: 0.25 },\n medium: { blur: 20, spread: 2, opacity: 0.4 },\n strong: { blur: 30, spread: 4, opacity: 0.55 },\n}\n\n/**\n * Get a glow shadow style for emphasis/active states.\n *\n * Creates a colored radial glow around an element, useful for:\n * - Active recording indicators (orange glow)\n * - Success states (green glow)\n * - Error/danger indicators (red glow)\n * - Focus rings and attention-drawing elements\n *\n * @param color - Glow color (hex string, e.g. '#FF7900')\n * @param intensity - Glow intensity level\n * @returns ViewStyle with platform-specific shadow properties\n */\nexport function getGlowShadow(color: string, intensity: GlowIntensity = 'medium'): ViewStyle {\n const config = glowConfig[intensity]\n const rgb = hexToRgb(color)\n if (!rgb) return {}\n\n return Platform.select({\n web: {\n boxShadow: `0 0 ${config.blur}px ${config.spread}px rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${config.opacity})`,\n } as any,\n default: {\n shadowColor: color,\n shadowOffset: { width: 0, height: 0 },\n shadowOpacity: config.opacity,\n shadowRadius: config.blur / 2,\n elevation: 0,\n },\n }) as ViewStyle\n}\n","import type { CssPropertyManifest, VariantAxes } from './css-property-manifest.types'\n\n/** Result of validating a candidate manifest: valid iff errors is empty. */\nexport interface ManifestValidationResult {\n valid: boolean\n errors: string[]\n}\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value)\n\nconst isVariantAxes = (value: unknown): value is VariantAxes =>\n isPlainObject(value) &&\n Object.keys(value).length > 0 &&\n Object.values(value).every((axisValue) => typeof axisValue === 'string')\n\nfunction collectVariantOverrideErrors(override: unknown, path: string): string[] {\n if (!isPlainObject(override)) return [`${path} must be an object`]\n const errors: string[] = []\n if (!isVariantAxes(override.variant))\n errors.push(`${path}.variant must be a non-empty string-keyed object`)\n if (\n override.token !== undefined &&\n override.token !== null &&\n typeof override.token !== 'string'\n ) {\n errors.push(`${path}.token must be a string or null`)\n }\n if (typeof override.resolvedValue !== 'string' || override.resolvedValue.length === 0) {\n errors.push(`${path}.resolvedValue must be a non-empty string`)\n }\n return errors\n}\n\nfunction collectPropertyErrors(entry: unknown, path: string): string[] {\n if (!isPlainObject(entry)) return [`${path} must be an object`]\n const errors: string[] = []\n if (typeof entry.property !== 'string' || entry.property.length === 0) {\n errors.push(`${path}.property must be a non-empty string`)\n }\n if (entry.token !== null && typeof entry.token !== 'string') {\n errors.push(`${path}.token must be a string or null`)\n }\n if (typeof entry.resolvedValue !== 'string' || entry.resolvedValue.length === 0) {\n errors.push(`${path}.resolvedValue must be a non-empty string`)\n }\n if (entry.variantOverrides !== undefined) {\n if (!Array.isArray(entry.variantOverrides)) {\n errors.push(`${path}.variantOverrides must be an array`)\n } else {\n entry.variantOverrides.forEach((override, i) =>\n errors.push(...collectVariantOverrideErrors(override, `${path}.variantOverrides[${i}]`))\n )\n }\n }\n return errors\n}\n\n/** Structurally validates a candidate value against the CssPropertyManifest shape. */\nexport function validateCssPropertyManifest(candidate: unknown): ManifestValidationResult {\n if (!isPlainObject(candidate)) return { valid: false, errors: ['manifest must be an object'] }\n\n const errors: string[] = []\n if (typeof candidate.component !== 'string' || candidate.component.length === 0) {\n errors.push('component must be a non-empty string')\n }\n if (candidate.baseVariant !== undefined && !isVariantAxes(candidate.baseVariant)) {\n errors.push('baseVariant must be a non-empty string-keyed object')\n }\n if (!Array.isArray(candidate.properties) || candidate.properties.length === 0) {\n errors.push('properties must be a non-empty array')\n } else {\n candidate.properties.forEach((entry, i) =>\n errors.push(...collectPropertyErrors(entry, `properties[${i}]`))\n )\n }\n\n return { valid: errors.length === 0, errors }\n}\n\n/** Type guard variant of validateCssPropertyManifest for use in narrowing contexts. */\nexport function isCssPropertyManifest(candidate: unknown): candidate is CssPropertyManifest {\n return validateCssPropertyManifest(candidate).valid\n}\n","import { Platform } from 'react-native'\nimport { getSemanticColors, type ThemeMode } from './tokens/semantic'\n\ntype ColorToken = keyof ReturnType<typeof getSemanticColors>\n\n/**\n * Resolve a semantic color token for an inline style where a nativewind\n * className can't apply — gradients (`backgroundImage`), per-edge borders\n * (`borderTopColor`, …), SVG attributes, and conditional hex/token mixes.\n *\n * The companion to className color tokens: on **web** it returns the CSS\n * variable (`var(--color-…)`), so the dashboard's light/dark switching keeps\n * working exactly as `global.css` intends; on **native** it returns the\n * resolved hex from `getSemanticColors` (mobile is dark-only). This is why\n * these spots stay theme-correct on web while also rendering on-device.\n */\nexport function resolveColor(token: ColorToken, mode: ThemeMode = 'dark'): string {\n return Platform.OS === 'web' ? `var(--color-${token})` : getSemanticColors(mode)[token]\n}\n","import { resolveColor } from './resolve-color'\nimport { getSemanticColors, type ThemeMode } from './tokens/semantic'\n\ntype ColorToken = keyof ReturnType<typeof getSemanticColors>\n\n/** A `backgroundImage` style — web-only (RN ignores it); type it loosely for RN style arrays. */\nexport type GradientStyle = { backgroundImage: string }\n\n/**\n * A linear-gradient `backgroundImage` built from two semantic color tokens.\n *\n * Themeable + native-safe via {@link resolveColor}: on web the stops are CSS\n * variables (light/dark switching keeps working); on native it resolves to hex.\n * `backgroundImage` is a **web-only** paint, so pair this with a solid\n * `bg-*` className fallback for native (see the shell TopBar).\n */\nexport function linearGradient(\n from: ColorToken,\n to: ColorToken,\n angle = 180,\n mode: ThemeMode = 'dark'\n): GradientStyle {\n return {\n backgroundImage: `linear-gradient(${angle}deg, ${resolveColor(from, mode)}, ${resolveColor(to, mode)})`,\n }\n}\n\n/**\n * Named surface gradients — the shared substrate for gradient fills. Replaces\n * per-component inline `linear-gradient` strings.\n */\nexport const surfaceGradient = {\n /** Chrome bands (top bar, headers): elevated → base, a subtle dark wash. */\n chrome: (mode: ThemeMode = 'dark'): GradientStyle =>\n linearGradient('surface-elevated', 'background-base', 180, mode),\n}\n","import type { ThemePreset } from './types'\n\nfunction colorKeyToVar(key: string): string {\n return `--color-${key}`\n}\n\nfunction applyColorOverrides(colors: Record<string, string | undefined>, root: HTMLElement) {\n for (const [key, value] of Object.entries(colors)) {\n if (value !== undefined) {\n root.style.setProperty(colorKeyToVar(key), value)\n }\n }\n}\n\nfunction applyFontOverrides(fonts: Record<string, string | undefined>, root: HTMLElement) {\n const fontVarMap: Record<string, string> = {\n sans: '--font-family-sans',\n body: '--font-family-body',\n heading: '--font-family-heading',\n mono: '--font-family-mono',\n }\n for (const [key, value] of Object.entries(fonts)) {\n if (value !== undefined && fontVarMap[key]) {\n root.style.setProperty(fontVarMap[key], value)\n }\n }\n}\n\nfunction injectFontImport(url: string) {\n if (typeof document === 'undefined') return\n const existing = document.querySelector(`link[href=\"${url}\"]`)\n if (existing) return\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = url\n document.head.appendChild(link)\n}\n\nexport function applyThemePreset(preset: ThemePreset): () => void {\n if (typeof document === 'undefined') {\n return () => {}\n }\n\n const root = document.documentElement\n const removals: (() => void)[] = []\n\n // Inject font import if specified\n if (preset.fontImport) {\n injectFontImport(preset.fontImport)\n }\n\n // Determine current theme mode\n const isLight = root.classList.contains('light')\n const modeColors = isLight ? preset.colors?.light : preset.colors?.dark\n\n // Apply color overrides\n if (modeColors) {\n const previousValues: Record<string, string | null> = {}\n for (const key of Object.keys(modeColors)) {\n previousValues[colorKeyToVar(key)] = root.style.getPropertyValue(colorKeyToVar(key)) || null\n }\n applyColorOverrides(modeColors, root)\n removals.push(() => {\n for (const [varName, prev] of Object.entries(previousValues)) {\n if (prev === null) {\n root.style.removeProperty(varName)\n } else {\n root.style.setProperty(varName, prev)\n }\n }\n })\n }\n\n // Apply font overrides\n if (preset.fonts) {\n applyFontOverrides(preset.fonts as Record<string, string | undefined>, root)\n }\n\n // Apply root classes\n if (preset.rootClasses) {\n for (const cls of preset.rootClasses) {\n root.classList.add(cls)\n }\n removals.push(() => {\n for (const cls of preset.rootClasses!) {\n root.classList.remove(cls)\n }\n })\n }\n\n // Return cleanup function\n return () => {\n for (const remove of removals) {\n remove()\n }\n }\n}\n","import type { ThemePreset } from './types'\n\nexport const defaultPreset: ThemePreset = {\n name: 'default',\n description: 'Titan Design System default theme — orange accent, steel secondary',\n}\n","import type { ThemePreset } from './types'\n\n/**\n * Audiobook Studio preset.\n *\n * Warm copper/patina aesthetic inspired by vintage audio equipment\n * and reading lounges. Dark-mode only design with editorial typography.\n */\nexport const audiobookPreset: ThemePreset = {\n name: 'audiobook',\n description: 'Warm copper/patina theme with editorial typography',\n fontImport:\n \"https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,600;0,700;1,400&family=Outfit:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap\",\n fonts: {\n sans: \"'Outfit', 'Avenir', 'Avenir Next', system-ui, sans-serif\",\n body: \"'Outfit', 'Avenir', 'Avenir Next', system-ui, sans-serif\",\n heading: \"'Newsreader', 'Libre Baskerville', Georgia, serif\",\n mono: \"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace\",\n },\n colors: {\n dark: {\n // Brand: Copper accent\n 'brand-primary': '#d4782a',\n 'brand-primary-light': '#e8944a',\n 'brand-primary-dark': '#9a4a15',\n 'brand-primary-subtle': 'rgba(212, 120, 42, 0.12)',\n 'brand-primary-hover': '#e8944a',\n 'brand-primary-active': '#f5b070',\n\n // Brand secondary: Patina/verdigris\n 'brand-secondary': '#3a9b8a',\n 'brand-secondary-light': '#55baa7',\n 'brand-secondary-dark': '#1f5c52',\n 'brand-secondary-subtle': 'rgba(58, 155, 138, 0.12)',\n 'brand-secondary-hover': '#55baa7',\n 'brand-secondary-active': '#7ed4c4',\n\n 'on-brand-primary': '#FFFFFF',\n 'on-brand-secondary': '#FFFFFF',\n\n // Status colors (audiobook's warmer status palette)\n 'status-success': '#5fb870',\n 'status-error': '#d85c4a',\n 'status-warning': '#d4a43a',\n 'status-info': '#5a8fd4',\n\n // Text: warm off-whites\n 'text-primary': '#f4f3f1',\n 'text-secondary': '#b5b3af',\n 'text-tertiary': '#7a7875',\n\n // Surfaces: warm charcoals (not pure gray)\n 'surface-base': '#101114',\n 'surface-elevated': '#15171c',\n 'surface-raised': '#1a1d24',\n 'surface-overlay': '#15171c',\n 'surface-input': '#15171c',\n\n // Backgrounds\n 'background-base': '#0a0b0d',\n 'background-default': '#101114',\n 'background-subtle': '#1a1d24',\n\n // Borders\n 'border-default': 'rgba(255, 255, 255, 0.06)',\n 'border-subtle': 'rgba(255, 255, 255, 0.03)',\n 'border-strong': '#2d323d',\n 'border-focus': '#d4782a',\n 'border-input': '#2d323d',\n 'border-input-hover': '#454c5c',\n 'border-input-focus': '#d4782a',\n 'border-input-error': '#d85c4a',\n\n // Interactive\n 'interactive-hover': 'rgba(255, 255, 255, 0.04)',\n 'interactive-focus': 'rgba(255, 255, 255, 0.12)',\n 'interactive-active': 'rgba(255, 255, 255, 0.16)',\n 'interactive-selected': 'rgba(255, 255, 255, 0.08)',\n\n 'divider': 'rgba(255, 255, 255, 0.06)',\n\n // Glow RGB values for shadow utilities\n 'brand-primary-rgb': '212, 120, 42',\n 'brand-secondary-rgb': '58, 155, 138',\n 'status-success-rgb': '95, 184, 112',\n 'status-error-rgb': '216, 92, 74',\n 'status-warning-rgb': '212, 164, 58',\n 'status-info-rgb': '90, 143, 212',\n 'background-base-rgb': '10, 11, 13',\n },\n },\n rootClasses: ['atmosphere-warm', 'grain'],\n}\n","// On-surface colour context (TD-05.12).\n//\n// A <Surface> owns a background from a small elevation scale AND publishes the\n// current theme mode so descendant text/icons resolve their colour from \"what\n// surface am I on\" instead of a `text-*` className. Those classNames silently\n// fail to black when the tree renders as raw RN in the standalone wall SPA\n// (no global.css, no nativewind) — the bug class this primitive retires.\nimport { createContext, useContext } from 'react'\nimport { getSemanticColors, type ThemeMode } from '../../../theme/tokens/semantic'\nimport { surfaceRampDark } from '../../../theme/tokens/primitives'\n\ntype ColorToken = keyof ReturnType<typeof getSemanticColors>\n\n/**\n * A Surface's depth on the dark surface ramp. Each addressable level maps to an\n * EXISTING semantic surface/background token (already grounded in the derived\n * surface ramp — TD-surface-tokens S-1 — and theme-aware) — Surface introduces\n * no new hexes. Darkest → lightest:\n * inset (#13100D) < background (#1C1916) < base (#252321) < elevated (#2A2827) < raised (#2D2C2B) < overlay (#302F2E)\n *\n * `inset` is the ramp's deepest pit — the sub-shell well. It's the floor a\n * `<Surface pressed>` clamps at (see {@link pressedLevel}); it has no shipped\n * semantic token yet, so {@link surfaceBackground} resolves it from the\n * `surface-inset` token when present, else the `surfaceRampDark.inset` primitive.\n */\nexport type SurfaceLevel = 'inset' | 'background' | 'base' | 'elevated' | 'raised' | 'overlay'\n\n/** On-surface neutral text roles, resolved for the current surface + theme. */\nexport type OnSurfaceRole = 'primary' | 'secondary' | 'tertiary'\n\n// Which semantic token backs each ADDRESSABLE level. Values live in `semantic.ts`\n// and stay in sync with the charcoal ramp — this map never carries literal hexes.\n// `inset` is intentionally absent: it has no shipped semantic token yet, so it's\n// resolved separately (token-or-primitive) in `surfaceBackground`.\nexport const SURFACE_LEVEL_TOKEN = {\n background: 'background-base',\n base: 'surface-base',\n elevated: 'surface-elevated',\n raised: 'surface-raised',\n overlay: 'surface-overlay',\n} as const satisfies Record<Exclude<SurfaceLevel, 'inset'>, ColorToken>\n\n// Darkest → lightest, INCLUDING the inset floor. A `<Surface pressed>` renders\n// one index DOWN from its parent's level and clamps at `inset` (index 0). Kept\n// in lockstep with the derived ramp and the surface.contract.test PLANE_ORDER.\nconst PRESSED_RAMP = ['inset', 'background', 'base', 'elevated', 'raised', 'overlay'] as const\n\nconst ON_SURFACE_TOKEN = {\n primary: 'text-primary',\n secondary: 'text-secondary',\n tertiary: 'text-tertiary',\n} as const satisfies Record<OnSurfaceRole, ColorToken>\n\nexport interface SurfaceContextValue {\n /** Active theme mode. Defaults to dark (the wall). */\n mode: ThemeMode\n /** Depth of the nearest enclosing Surface. */\n level: SurfaceLevel\n}\n\n// Default context: dark 'base' plane, so descendants OUTSIDE any Surface still\n// resolve to real dark colours (never black) on the dark-only wall.\nconst DEFAULT_CONTEXT: SurfaceContextValue = { mode: 'dark', level: 'base' }\n\nexport const SurfaceContext = createContext<SurfaceContextValue>(DEFAULT_CONTEXT)\n\n/** The nearest surface context ({ mode, level }); default dark 'base'. */\nexport function useSurface(): SurfaceContextValue {\n return useContext(SurfaceContext)\n}\n\n/** The active theme mode from the nearest Surface/provider (default dark). */\nexport function useSurfaceMode(): ThemeMode {\n return useContext(SurfaceContext).mode\n}\n\n/**\n * Literal-hex on-surface neutral text colours for a theme mode. Uses\n * `getSemanticColors` (literal hex — the TempoBar pattern), never `resolveColor`\n * (which returns `var()` under the RNW vitest alias), so values stay real in\n * tested component code and on raw-RN surfaces alike.\n */\nexport function onSurfaceColors(mode: ThemeMode): Record<OnSurfaceRole, string> {\n const c = getSemanticColors(mode)\n return {\n primary: c[ON_SURFACE_TOKEN.primary],\n secondary: c[ON_SURFACE_TOKEN.secondary],\n tertiary: c[ON_SURFACE_TOKEN.tertiary],\n }\n}\n\n/** Resolve one on-surface text colour for descendants of a Surface. */\nexport function useOnSurfaceColor(role: OnSurfaceRole = 'primary'): string {\n return getSemanticColors(useSurfaceMode())[ON_SURFACE_TOKEN[role]]\n}\n\n/**\n * The inset floor hex — the ramp's deepest pit that a pressed surface clamps at.\n * Prefers the `surface-inset` semantic token (theme-aware; being promoted in a\n * parallel token change) and falls back to the `surfaceRampDark.inset` primitive\n * (#13100D, dark-ramp only) until that token ships.\n */\nfunction insetFloor(mode: ThemeMode): string {\n const colors = getSemanticColors(mode) as Record<string, string>\n return colors['surface-inset'] ?? surfaceRampDark.inset\n}\n\n/** The background hex for a surface level under a theme mode (literal hex). */\nexport function surfaceBackground(level: SurfaceLevel, mode: ThemeMode): string {\n if (level === 'inset') return insetFloor(mode)\n return getSemanticColors(mode)[SURFACE_LEVEL_TOKEN[level]]\n}\n\n/**\n * The level a `<Surface pressed>` resolves to: its parent's level stepped one\n * index DOWN the ramp — the symmetric twin of a raised surface stepping up —\n * clamped at the `inset` floor so a pressed surface never underflows the pit.\n * overlay→raised, raised→elevated, elevated→base, base→background,\n * background→inset, inset→inset (clamped).\n * Pressed exposes ONE level of depth only (no pressed-2).\n */\nexport function pressedLevel(parent: SurfaceLevel): SurfaceLevel {\n const index = PRESSED_RAMP.indexOf(parent)\n const down = Math.max(0, index - 1)\n return PRESSED_RAMP[down]\n}\n","/**\n * Custom JSX runtime for titan-design's web distribution.\n *\n * Converts className props to $$css style objects at build time,\n * eliminating the need for NativeWind's runtime interopComponents\n * Map lookup. RNW's styleq recognizes $$css objects and applies\n * their values as CSS class names on DOM elements.\n *\n * This file is NOT used by source builds (specimen, storybook,\n * native Metro). It is only inlined into the dist by tsup via\n * an esbuild onResolve plugin.\n */\nimport {\n jsx as reactJsx,\n jsxs as reactJsxs,\n Fragment,\n} from 'react/jsx-runtime'\nimport type { StyleProp } from 'react-native'\n\ntype JsxFn = typeof reactJsx\n\nfunction wrapJsx(fn: JsxFn): JsxFn {\n return function (type, props: Record<string, any>, ...rest) {\n if (props && typeof props.className === 'string' && props.className) {\n const cn = props.className\n const cssStyle = { $$css: true, [cn]: cn } as unknown as StyleProp<any>\n const existing = props.style\n props = {\n ...props,\n style: existing ? [cssStyle, existing] : cssStyle,\n }\n delete props.className\n }\n return fn(type, props, ...rest)\n } as JsxFn\n}\n\nconst jsx = wrapJsx(reactJsx)\nconst jsxs = wrapJsx(reactJsxs)\n\nexport { jsx, jsxs, Fragment }\n","// Cross-platform theme provider (TD native-theming).\n//\n// Registers titan's semantic color tokens as runtime CSS variables via\n// nativewind's `vars()` so that className color tokens (`text-text-secondary`,\n// `bg-surface-raised`, `border-border`, …) resolve on NATIVE React Native — the\n// native equivalent of the `:root {}` block `global.css` provides on web.\n//\n// Why this exists: titan's Workout organisms reference semantic colors as CSS\n// variables. On web (the dashboard, react-native-web) those come from\n// `global.css`. On native (the mobile app) nothing defined them, so any titan\n// component using a `--color-*` token rendered with an unresolved (black) color.\n// Wrap the mobile app root in `<ThemeProvider>` and the tokens resolve on-device.\n//\n// The var maps are the SAME canonical `darkThemeCSSVars` / `lightThemeCSSVars`\n// that generate `global.css`, so native and web resolve to identical values.\n//\n// It also seeds the on-surface colour context (`<Surface>`'s mode), so titan's\n// JS-resolved on-surface colours track the same theme as the className tokens.\nimport { vars, useColorScheme } from 'nativewind'\nimport { View, type ViewProps } from 'react-native'\nimport { SurfaceContext } from '../components/ui/surface/SurfaceContext'\nimport { darkThemeCSSVars, lightThemeCSSVars } from './config'\n\n/** `'system'` follows nativewind's `useColorScheme()` (mobile light/dark flip). */\nexport type ThemeProviderMode = 'dark' | 'light' | 'system'\n\n// Precomputed once — `vars()` is pure, so the same style object is reused across\n// renders. Native == web because these are the maps `tokens-css` emits.\nconst MODE_VARS = {\n dark: vars(darkThemeCSSVars),\n light: vars(lightThemeCSSVars),\n}\n\nexport interface ThemeProviderProps extends ViewProps {\n /**\n * Theme mode to register. `'system'` bridges nativewind's `useColorScheme()`\n * so mobile follows the OS light/dark flip; `'dark'`/`'light'` pin it. Mobile\n * is dark-only today, so this defaults to `dark`.\n */\n mode?: ThemeProviderMode\n}\n\n/**\n * Wrap the app root so descendant titan components' `--color-*` className tokens\n * resolve on native. Fills its parent (`flex: 1`) by default; pass `style` to\n * override. On web it is harmless (the dashboard already loads `global.css`).\n */\nexport function ThemeProvider({\n mode = 'dark',\n style,\n children,\n ...props\n}: ThemeProviderProps): React.JSX.Element {\n // `'system'` → follow nativewind's applied scheme, falling back to dark when\n // no scheme is set. `useColorScheme` runs unconditionally (rules of hooks);\n // its result is only used in the `'system'` branch.\n const { colorScheme } = useColorScheme()\n const resolved = mode === 'system' ? (colorScheme ?? 'dark') : mode\n\n return (\n <SurfaceContext.Provider value={{ mode: resolved, level: 'base' }}>\n <View style={[MODE_VARS[resolved], { flex: 1 }, style]} {...props}>\n {children}\n </View>\n </SurfaceContext.Provider>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/theme/tokens/primitives.ts","../../src/theme/tokens/semantic.ts","../../src/theme/config.ts","../../src/theme/materials.ts","../../src/theme/color-utils.ts","../../src/theme/elevation.ts","../../src/theme/manifest/css-property-manifest.validate.ts","../../src/theme/resolve-color.ts","../../src/theme/gradients.ts","../../src/theme/presets/apply.ts","../../src/theme/presets/default.ts","../../src/theme/presets/audiobook.ts","../../src/components/ui/surface/SurfaceContext.ts","../../src/web-jsx/jsx-runtime.ts","../../src/theme/ThemeProvider.tsx"],"names":["c","Platform","reactJsx"],"mappings":";;;;;;AAeO,IAAM,eAAA,GAAkB;AAAA,EAC7B,KAAA,EAAO,SAAA;AAAA,EACP,KAAA,EAAO,SAAA;AAAA,EACP,WAAA,EAAa;AACf;AAiCO,IAAM,QAAA,GAAW;AAAA,EACtB,EAAA,EAAI,SAAA;AAAA;AAAA,EACJ,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK,SAAA;AAAA;AAAA,EACL,GAAA,EAAK;AAAA;AACP;AAOO,IAAM,mBAAA,GAAsB;AAAA,EACjC,KAAA,EAAO,GAAA;AAAA,EACP,UAAA,EAAY,GAAA;AAAA,EACZ,IAAA,EAAM,GAAA;AAAA,EACN,QAAA,EAAU,GAAA;AAAA,EACV,MAAA,EAAQ,GAAA;AAAA,EACR,OA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,CAAA,EAAE,EAAG,KAAK,CAAA,EAAI,GAAG,KAAA,EACzD,QAAA,EACH,CAAA,EACF,CAAA;AAEJ","file":"index.mjs","sourcesContent":["/**\n * Primitive Design Tokens\n *\n * Raw values with no semantic meaning. These are the foundation of the design system\n * and should rarely be used directly in components. Use semantic tokens instead.\n */\n\n/**\n * Absolute colour keywords.\n *\n * This used to hold five scales — `blue`, `red`, `redVivid`, `neutral` and\n * `charcoal`. All five are gone (TD-07.14): the greys folded into `greyRamp`\n * below and the chromatics into the OKLCH `primitiveRamps`. What is left has no\n * scale because these three are not colours you tune, they are keywords.\n */\nexport const primitiveColors = {\n white: '#FFFFFF',\n black: '#000000',\n transparent: 'transparent',\n} as const\n\n/**\n * Unified warm-neutral grey ramp (TD-07.14)\n *\n * The ONE achromatic scale. Regenerate with `scripts/generate-grey-ramp.mjs` —\n * preserve the generator, not just the hexes.\n *\n * The surface planes ARE steps here rather than a parallel object: `850` is\n * overlay, `975` is the bezel. That is the whole point of the ramp. `grey`,\n * `neutral`, `surfaceRampDark` and `backgroundFrameDark` all resolve into it,\n * which is why every plane step below is byte-identical to the value that\n * shipped in v0.10.0 — the surfaces do not move, only their names.\n *\n * TWO THINGS ABOUT THE NUMBERING, both deliberate and both previously re-derived\n * from scratch more than once because they were never written down:\n *\n * 1. `975` sits BELOW the standard grid. `canonL` — the median L* of the seven\n * chromatic `primitiveRamps` at each step — ends at L*10.3, which is step\n * `950`. The bezel is L*3.8, darker than the grid's last rung, so there is\n * simply no step number left for it and `975` extends past the end.\n * 2. `850`/`875` are quarter-steps because overlay/raised/elevated are only\n * ~2.7 L* apart and all three collide on `900` at normal resolution. `800`\n * is a generated bridge between `700` (L*37.9) and overlay (L*22.7) so the\n * spacing stays even across the join.\n *\n * There is no `inset`. It was retired, not renamed: at ΔE 1.10 from `975` it was\n * an imperceptible duplicate of the frame, which is exactly why `<Surface pressed>`\n * (surface − 1) kept collapsing into it. `975` is the floor.\n *\n * Spec, generator and the rejected v1/v2 cuts:\n * coordination/design-explorations/foundations/warm-grey-ramp/\n */\nexport const greyRamp = {\n 50: '#F9F6F3', // L*97.0 W6\n 100: '#EDEAE7', // L*92.8 W6\n 200: '#D4D1CE', // L*84.0 W6 — warm silver\n 300: '#BDBAB7', // L*75.7 W6\n 400: '#A29F9D', // L*65.7 W5\n 500: '#888684', // L*56.0 W4\n 600: '#72716F', // L*47.7 W3\n 700: '#5A5958', // L*37.9 W2\n 800: '#424140', // L*27.6 W2 — generated bridge\n 850: '#373635', // L*22.7 W2 — surface overlay\n 875: '#31302F', // L*19.9 W2 — surface raised\n 900: '#2C2A28', // L*17.2 W4 — surface elevated\n 925: '#252321', // L*13.9 W4 — surface base\n 950: '#1C1916', // L*9.0 W6 — background base / shell\n 975: '#100D0A', // L*3.8 W6 — background frame / bezel\n} as const\n\n/**\n * The surface planes, as ramp steps — the mapping `<Surface level>` resolves through.\n *\n * Ordered darkest -> lightest, which is the order `pressedLevel()` walks.\n */\nexport const SURFACE_PLANE_STEPS = {\n frame: 975,\n background: 950,\n base: 925,\n elevated: 900,\n raised: 875,\n overlay: 850,\n} as const\n\n/**\n * Derived tonal ramps (TD-05.09 color foundations)\n *\n * Seven OKLCH-generated hue ramps, 11 perceptual lightness steps each (50 -> 950).\n * Built with hue-torsion + a chroma arc, anchored through existing brand/semantic\n * hexes. `pin` marks the step each ramp flows through its anchor.\n * This is the single source of truth for chromatic hexes — the categorical palette\n * below references these steps rather than duplicating values.\n * See coordination/design-explorations/foundations.\n */\nexport const primitiveRamps = {\n red: {\n 50: '#FFF4F4',\n 100: '#FFE3E5',\n 200: '#FFC2C5',\n 300: '#FF9A9D',\n 400: '#F77175',\n 500: '#E05254',\n 600: '#D14343', // pin\n 700: '#A4221C',\n 800: '#7E1002',\n 900: '#5A0900',\n 950: '#3D0400',\n },\n orange: {\n 50: '#FFF5ED',\n 100: '#FFE6D4',\n 200: '#FFC7A2',\n 300: '#FFA063',\n 400: '#FF7900', // pin\n 500: '#DA5F00',\n 600: '#B94A00',\n 700: '#983804',\n 800: '#6F290F',\n 900: '#4E1C0C',\n 950: '#331107',\n },\n amber: {\n 50: '#FFF7DD',\n 100: '#FFEAA9',\n 200: '#FFD352',\n 300: '#F9B415', // pin\n 400: '#E08C00',\n 500: '#C27400',\n 600: '#A45E00',\n 700: '#814D14',\n 800: '#5B3A1A',\n 900: '#442503',\n 950: '#301500',\n },\n green: {\n 50: '#E3FFEE',\n 100: '#B5FFD2',\n 200: '#58F69E',\n 300: '#2ED573', // pin\n 400: '#21C05D',\n 500: '#22A444',\n 600: '#298732',\n 700: '#2B6B25',\n 800: '#264D1C',\n 900: '#1B3515',\n 950: '#11220D',\n },\n cyan: {\n 50: '#E6FBFF',\n 100: '#C2F6FF',\n 200: '#62EAFF',\n 300: '#22D3EE', // pin\n 400: '#01B5D1',\n 500: '#2697B7',\n 600: '#307B9B',\n 700: '#2A617F',\n 800: '#22465F',\n 900: '#0B3149',\n 950: '#001F36',\n },\n blue: {\n 50: '#EFF8FF',\n 100: '#D9EFFF',\n 200: '#ACDBFF',\n 300: '#78C2FF',\n 400: '#3CA8FF',\n 500: '#2196F3', // pin\n 600: '#1072CB',\n 700: '#135AA8',\n 800: '#14407E',\n 900: '#112C5A',\n 950: '#091B3C',\n },\n magenta: {\n 50: '#FFF3F9',\n 100: '#FFE2F1',\n 200: '#FFBDE2',\n 300: '#FF8FD5',\n 400: '#ED69C3',\n 500: '#D548AF',\n 600: '#BA2996',\n 700: '#9C0D7A', // pin\n 800: '#77005A',\n 900: '#56003F',\n 950: '#3B0029',\n },\n} as const\n\n/**\n * Categorical (qualitative) palette — an ordered, CVD-safe series expressed as\n * references into {@link primitiveRamps} (one source of truth; the palette moves\n * with the ramps).\n *\n * Design: a single canonical hue order (blue, magenta, red, orange, green, cyan,\n * amber), with steps chosen vivid-midtone-first and fanned lighter/darker as the\n * series grows to preserve separation. The sequence is nested-stable — a chart\n * with N series uses the first N colors, and the series index is stable as N\n * changes. Colorblind-safe worst-case deuteranopia/protanopia floor 8 holds\n * through {@link CATEGORICAL_CVD_SAFE_MAX} colors; the 7th is an extended color\n * that should be paired with a legend or other secondary encoding.\n *\n * Two variants: `default` (vivid, sits on neutral/light surfaces, legible under\n * black text) and `dark` (deeper shades legible under white text on a fill). A\n * separate \"light\" variant was dropped — the vivid `default` picks already clear\n * black-text contrast, so it doubles as the light-context palette.\n */\nexport const categoricalPalette = {\n default: [\n primitiveRamps.blue[500],\n primitiveRamps.magenta[500],\n primitiveRamps.red[500],\n primitiveRamps.orange[400],\n primitiveRamps.green[300],\n primitiveRamps.cyan[300],\n primitiveRamps.amber[600], // extended (7th) — pair with a legend\n ],\n dark: [\n primitiveRamps.blue[600],\n primitiveRamps.magenta[600],\n primitiveRamps.red[500],\n primitiveRamps.orange[600],\n primitiveRamps.green[800],\n primitiveRamps.cyan[800],\n primitiveRamps.amber[500], // extended (7th) — pair with a legend\n ],\n} as const\n\n/** Largest series count that holds the CVD floor without a legend. */\nexport const CATEGORICAL_CVD_SAFE_MAX = 6\n\n/**\n * Categorical palette variant.\n * - `default` : vivid; neutral/light surfaces, legible under black text\n * - `dark` : deeper shades, legible under white text on a filled swatch\n */\nexport type CategoricalVariant = keyof typeof categoricalPalette\n\n/**\n * Get a color from the ordered categorical palette by series index.\n * The palette is nested-stable, so the color for a given index does not change\n * with the total series count; `index` simply wraps past the end.\n *\n * @param index - 0-based series index (wraps past the end)\n * @param variant - `default` (black-text / light surfaces) or `dark` (white text)\n * @returns The hex color string\n */\nexport function getCategoricalColor(index: number, variant: CategoricalVariant = 'default'): string {\n const palette = categoricalPalette[variant]\n index = Math.max(0, Math.floor(index))\n return palette[index % palette.length]\n}\n\n/**\n * Diverging status scale (BodyMap training-status: under → optimal → over) as\n * references into {@link primitiveRamps}. A true diverging shape — `optimal` is\n * the lightest center, the extremes go darker — so the signal reads in lightness\n * (colorblind-robust; worst-case deut/protanopia min ΔE ~10.9) and the direction\n * reads in the blue↔red axis (the CVD-safe hue pair).\n *\n * Tuned so every stop is dark enough for the fill yet light enough that BLACK\n * text clears 4.5:1 on all five — no per-cell white/black flipping. The value\n * valley is symmetric: the two mid-arms (maintenance / approaching) sit at equal\n * lightness (both ~0.53 relative luminance), the ends darker.\n */\nexport const divergingScale = [\n primitiveRamps.blue[500], // under\n primitiveRamps.cyan[300], // maintenance\n primitiveRamps.green[200], // optimal (light center)\n primitiveRamps.amber[300], // approaching\n primitiveRamps.red[600], // over\n] as const\n\n/**\n * Sequential \"effort\" scale (low → high intensity: green → yellow → orange → red)\n * as references into {@link primitiveRamps}. A 6-stop ordinal palette; the\n * velocity/RPE strip sub-samples it. Every adjacent pair clears the CVD floor\n * (min deut/protan ΔE ≥ 4.5), and within that the hue walk is kept smooth —\n * the amber-200 → amber-300 → orange-400 run steps the yellow→orange transition\n * gradually rather than lurching. Order encodes magnitude, so it tolerates the\n * green↔red CVD pair. Stops 0–3 take black text; the dark reds take white.\n */\nexport const sequentialEffort = [\n primitiveRamps.green[300],\n primitiveRamps.amber[200],\n primitiveRamps.amber[300],\n primitiveRamps.orange[400],\n primitiveRamps.red[600],\n primitiveRamps.red[700],\n] as const\n\n/**\n * Best-contrast text color (black or white) for a solid fill — for labels sitting\n * on categorical/diverging/effort swatches. Uses the WCAG relative-luminance ratio.\n */\nexport function bestTextColor(hex: string): '#000000' | '#FFFFFF' {\n const [r, g, b] = [0, 2, 4].map((i) => {\n const c = parseInt(hex.replace('#', '').slice(i, i + 2), 16) / 255\n return c >= 0.04045 ? ((c + 0.055) / 1.055) ** 2.4 : c / 12.92\n })\n const l = 0.2126 * r + 0.7152 * g + 0.0722 * b\n return (l + 0.05) / 0.05 >= 1.05 / (l + 0.05) ? '#000000' : '#FFFFFF'\n}\n\n/**\n * Discrete rainbow palette for data visualization\n * Based on Paul Tol's color schemes: https://personal.sron.nl/~pault/#fig:scheme_rainbow_discrete\n */\nexport const discreteRainbow = [\n '#E8ECFB',\n '#D9CCE3',\n '#D1BBD7',\n '#CAACCB',\n '#BA8DB4',\n '#AE76A3',\n '#AA6F9E',\n '#994F88',\n '#882E72',\n '#1965B0',\n '#437DBF',\n '#5289C7',\n '#6195CF',\n '#7BAFDE',\n '#4EB265',\n '#90C987',\n '#CAE0AB',\n '#F7F056',\n '#F7CB45',\n '#F6C141',\n '#F4A736',\n '#F1932D',\n '#EE8026',\n '#E8601C',\n '#E65518',\n '#DC050C',\n '#A5170E',\n '#72190E',\n '#42150A',\n] as const\n\n/**\n * Palette indices for discrete rainbow colors at different palette sizes.\n * For a given palette size (index + 1), returns the indices of colors to use.\n */\nconst discreteRainbowPalettes: number[][] = [\n [10],\n [10, 26],\n [10, 18, 26],\n [10, 15, 18, 26],\n [10, 14, 15, 18, 26],\n [10, 14, 15, 17, 18, 26],\n [9, 10, 14, 15, 17, 18, 26],\n [9, 10, 14, 15, 17, 18, 23, 26],\n [9, 10, 14, 15, 17, 18, 23, 26, 28],\n [9, 10, 14, 15, 17, 18, 21, 24, 26, 28],\n [9, 10, 12, 14, 15, 17, 18, 21, 24, 26, 28],\n [3, 6, 9, 10, 12, 14, 15, 17, 18, 21, 24, 26],\n [3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 21, 24, 26],\n [3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26],\n [3, 6, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],\n [3, 5, 7, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],\n [3, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28],\n [3, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28],\n [2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28, 29],\n [1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 26, 27, 28, 29],\n]\n\n/**\n * Get a color from the discrete rainbow palette for a given index and palette size.\n * Colors are optimized for visual distinction at each palette size.\n *\n * @param index - The index of the color in the series (0-based)\n * @param size - The total number of colors needed (1-23)\n * @returns The hex color string\n */\nexport function getDiscreteRainbowColor(index: number, size: number): string {\n index = Math.max(0, index)\n size = Math.min(Math.max(1, size), discreteRainbowPalettes.length)\n\n const palette = discreteRainbowPalettes[size - 1]\n if (index >= palette.length) index = index % palette.length\n\n return discreteRainbow[palette[index] - 1]\n}\n\nexport const primitiveTypography = {\n fontFamilies: {\n sans: ['Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Helvetica', 'Arial', 'sans-serif'],\n body: ['Nunito Sans', 'sans-serif'],\n heading: ['Space Grotesk', 'sans-serif'],\n mono: ['SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', 'monospace'],\n },\n fontSizes: {\n xs: '0.75rem', // 12px\n sm: '0.875rem', // 14px\n base: '1rem', // 16px\n lg: '1.125rem', // 18px\n xl: '1.5rem', // 24px\n '2xl': '2rem', // 32px\n '3xl': '2.25rem', // 36px\n '4xl': '3rem', // 48px\n '5xl': '3.5rem', // 56px\n },\n fontWeights: {\n normal: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n },\n lineHeights: {\n none: 1,\n tight: 1.375,\n snug: 1.5,\n normal: 1.57,\n relaxed: 1.66,\n loose: 1.75,\n },\n letterSpacing: {\n tighter: '-0.05em',\n tight: '-0.025em',\n normal: '0em',\n wide: '0.025em',\n wider: '0.05em',\n widest: '0.5px',\n },\n} as const\n\nexport const primitiveSpacing = {\n 0: '0',\n px: '1px',\n 0.5: '0.125rem', // 2px\n 1: '0.25rem', // 4px\n 1.5: '0.375rem', // 6px\n 2: '0.5rem', // 8px\n 2.5: '0.625rem', // 10px\n 3: '0.75rem', // 12px\n 3.5: '0.875rem', // 14px\n 4: '1rem', // 16px\n 5: '1.25rem', // 20px\n 6: '1.5rem', // 24px\n 7: '1.75rem', // 28px\n 8: '2rem', // 32px\n 9: '2.25rem', // 36px\n 10: '2.5rem', // 40px\n 11: '2.75rem', // 44px\n 12: '3rem', // 48px\n 14: '3.5rem', // 56px\n 16: '4rem', // 64px\n 20: '5rem', // 80px\n 24: '6rem', // 96px\n 28: '7rem', // 112px\n 32: '8rem', // 128px\n} as const\n\nexport const primitiveBorderRadius = {\n none: '0',\n sm: '4px',\n DEFAULT: '8px',\n md: '8px',\n lg: '12px',\n xl: '16px',\n '2xl': '24px',\n full: '9999px',\n} as const\n\nexport const primitiveBreakpoints = {\n xs: 0,\n sm: 600,\n md: 1000,\n lg: 1200,\n xl: 1920,\n} as const\n\nexport const primitiveZIndex = {\n hide: -1,\n auto: 'auto',\n base: 0,\n docked: 10,\n dropdown: 1000,\n sticky: 1100,\n drawer: 1100,\n banner: 1200,\n appBar: 1200,\n overlay: 1300,\n modal: 1400,\n popover: 1500,\n skipLink: 1600,\n toast: 1700,\n tooltip: 1800,\n} as const\n","/**\n * Semantic Design Tokens\n *\n * Meaningful tokens following DTCG (Design Tokens Community Group) naming conventions.\n * Pattern: {category}-{intent}-{variant?}-{state?}\n *\n * Categories:\n * - brand-* : Brand colors (primary, secondary, accent)\n * - status-* : Feedback colors (success, error, warning, info)\n * - result-* : Outcome indicators (improve, degrade, inconclusive, neutral)\n * - data-* : Data visualization colors (chart series)\n * - on-* : Text on colored backgrounds\n * - surface-* : Elevated containers (NOT \"paper\")\n * - background-* : Page backgrounds\n * - text-* : Text colors\n * - border-* : Border colors\n * - interactive-* : Hover/focus/active/disabled states\n */\n\nimport { primitiveColors as p, primitiveRamps as ramp, greyRamp, discreteRainbow } from './primitives'\n\n/**\n * GREY MAPPING (TD-07.14) — how the old cool scales resolved onto `greyRamp`.\n *\n * Every grey below came off `grey` (pure R=G=B) or `neutral` (cool, R−B\n * down to −26). They were snapped by NEAREST L*, not by matching step numbers,\n * because the two old scales were numbered incompatibly: `grey` ran\n * INVERTED and compressed (0 = #6E6E6E lightest, 900 = #101010 darkest), so\n * `grey[400]` and `greyRamp[400]` have nothing to do with each other.\n *\n * grey 200→800 300→900 400→925 500→950\n * neutral 50→50 100→100 300→200 400→400 500→600 600→700 900→950\n *\n * Surfaces move ΔE 1.9–4.8 — at or near imperceptible. The TEXT roles move\n * further (8.6–12.8), and that is the intended part of the change: they are\n * picking up the warmth the surfaces already had.\n *\n * Light gets its own column because strict L*-nearest collapsed `neutral[50]`\n * and `[100]` onto one step, flattening surface-elevated into surface-raised.\n * Light is still deferred as a design question — there is no `surfaceRampLight`.\n *\n * `border-default`, `-subtle` and `-strong` are GONE, replaced by `hairline-*`.\n * Once the planes became ramp steps, every value dark enough to read as a\n * border was also a plane's fill. Alpha composites instead of colliding.\n *\n * `text-tertiary` on dark is the one role that ignores L*-nearest; see it.\n */\n\n// Light mode semantic colors (default)\nexport const semanticColorsLight = {\n // Brand colors (brand-*)\n 'brand-primary': ramp.orange[400],\n 'brand-primary-light': ramp.orange[300],\n 'brand-primary-dark': ramp.orange[500],\n 'brand-primary-subtle': 'rgba(255, 121, 0, 0.08)',\n 'brand-primary-hover': ramp.orange[500],\n 'brand-primary-active': ramp.orange[600],\n\n 'brand-secondary': ramp.cyan[600],\n 'brand-secondary-light': ramp.cyan[500],\n 'brand-secondary-dark': ramp.cyan[700],\n 'brand-secondary-subtle': 'rgba(48, 123, 155, 0.08)',\n 'brand-secondary-hover': ramp.cyan[700],\n 'brand-secondary-active': ramp.cyan[800],\n\n // Text on brand backgrounds (on-*)\n 'on-brand-primary': p.white,\n 'on-brand-secondary': p.white,\n\n // Status colors (status-*)\n 'status-success': ramp.green[300],\n 'status-success-light': ramp.green[200],\n 'status-success-dark': ramp.green[600],\n 'status-success-subtle': ramp.green[50],\n\n // Live-session accent — its OWN role, decoupled from success so the two can diverge\n 'status-live': ramp.green[300],\n 'status-live-muted': ramp.green[500],\n\n 'status-error': ramp.red[600],\n 'status-error-light': ramp.red[500],\n 'status-error-dark': ramp.red[700],\n 'status-error-subtle': ramp.red[50],\n\n 'status-error-vivid': ramp.red[600], // vivid alert red\n 'status-error-vivid-light': ramp.red[500],\n 'status-error-vivid-dark': ramp.red[700],\n 'status-error-vivid-subtle': 'rgba(255, 71, 87, 0.12)',\n\n 'status-warning': ramp.amber[300],\n 'status-warning-light': ramp.amber[200],\n 'status-warning-dark': ramp.amber[500],\n 'status-warning-subtle': ramp.amber[50],\n\n 'status-info': ramp.blue[500],\n 'status-info-light': ramp.blue[300],\n 'status-info-dark': ramp.blue[600],\n 'status-info-subtle': ramp.blue[50],\n\n // Text on status backgrounds (on-status-*)\n 'on-status-success': p.white,\n 'on-status-error': p.white,\n 'on-status-warning': p.white,\n 'on-status-info': p.white,\n\n // Result/outcome indicators (result-*)\n 'result-improve': '#4caf50', // Green - positive outcome\n 'result-improve-light': 'rgba(76, 175, 80, 0.12)',\n 'result-improve-dark': '#248a24',\n 'result-degrade': '#ef5350', // Red - negative outcome\n 'result-degrade-light': 'rgba(239, 83, 80, 0.12)',\n 'result-degrade-dark': '#b30000',\n 'result-inconclusive': '#9E9A97', // Gray - no clear result\n 'result-inconclusive-light': 'rgba(158, 154, 151, 0.12)',\n 'result-neutral': greyRamp[600], // Neutral baseline\n\n // Text on result backgrounds (on-result-*)\n 'on-result-improve': p.white,\n 'on-result-degrade': p.white,\n 'on-result-inconclusive': p.white,\n\n // Data visualization colors (data-*)\n // First 10 colors from discrete rainbow optimized for charts\n 'data-1': discreteRainbow[9], // Blue\n 'data-2': discreteRainbow[14], // Green\n 'data-3': discreteRainbow[17], // Yellow\n 'data-4': discreteRainbow[25], // Red\n 'data-5': discreteRainbow[8], // Purple\n 'data-6': discreteRainbow[20], // Orange\n 'data-7': discreteRainbow[13], // Light Blue\n 'data-8': discreteRainbow[15], // Light Green\n 'data-9': discreteRainbow[3], // Lavender\n 'data-10': discreteRainbow[22], // Dark Orange\n\n // Text colors (text-*)\n 'text-primary': '#121828',\n 'text-secondary': '#65748B',\n 'text-tertiary': greyRamp[400],\n 'text-disabled': 'rgba(55, 65, 81, 0.48)',\n 'text-inverse': p.white,\n 'text-link': ramp.blue[600],\n 'text-link-hover': ramp.blue[700],\n\n // Surface colors (surface-*) - for elevated containers\n 'surface-base': p.white,\n 'surface-elevated': greyRamp[50], // slightly off-white for elevated cards\n 'surface-raised': greyRamp[100], // light gray for raised cards\n 'surface-overlay': p.white,\n 'surface-input': greyRamp[50], // Input field background (filled variant)\n\n // Background colors (background-*)\n 'background-base': '#EBEBEB',\n 'background-default': p.white,\n 'background-subtle': greyRamp[50],\n // Frame/bezel chrome — top bar + side nav shell, one step below\n // `background-base`. Placeholder pairing for light mode, which is deferred.\n 'background-frame': greyRamp[400],\n\n // Border colors (border-*)\n 'border-prominent': greyRamp[400], // high-visibility divider\n 'border-focus': ramp.blue[600],\n 'border-input': greyRamp[200], // Input field border\n 'border-input-hover': greyRamp[400], // Input field border on hover\n 'border-input-focus': ramp.blue[600], // Input field border on focus\n 'border-input-error': ramp.red[600], // Input field border on error\n\n // Alpha hairline separators (surface-independent — composite toward black on\n // light surfaces, mirroring the dark-mode white-alpha family). See §4/S-2.\n 'hairline-subtle': 'rgba(0, 0, 0, 0.06)',\n 'hairline-default': 'rgba(0, 0, 0, 0.09)',\n 'hairline-strong': 'rgba(0, 0, 0, 0.14)',\n\n // Interactive states (interactive-*)\n 'interactive-hover': 'rgba(55, 65, 81, 0.04)',\n 'interactive-focus': 'rgba(55, 65, 81, 0.12)',\n 'interactive-active': 'rgba(55, 65, 81, 0.16)',\n 'interactive-selected': 'rgba(55, 65, 81, 0.08)',\n 'interactive-disabled': 'rgba(55, 65, 81, 0.12)',\n 'interactive-disabled-text': 'rgba(55, 65, 81, 0.26)',\n\n // Divider\n 'divider': '#E8E9EB',\n\n // Avatar default\n 'avatar-background': greyRamp[600],\n 'avatar-text': p.white,\n} as const\n\n// Dark mode semantic colors\nexport const semanticColorsDark = {\n // Brand colors stay the same in dark mode\n 'brand-primary': ramp.orange[400],\n 'brand-primary-light': ramp.orange[300],\n 'brand-primary-dark': ramp.orange[500],\n 'brand-primary-subtle': 'rgba(255, 121, 0, 0.12)',\n 'brand-primary-hover': ramp.orange[300],\n 'brand-primary-active': ramp.orange[200],\n\n 'brand-secondary': ramp.cyan[600],\n 'brand-secondary-light': ramp.cyan[500],\n 'brand-secondary-dark': ramp.cyan[700],\n 'brand-secondary-subtle': 'rgba(48, 123, 155, 0.12)',\n 'brand-secondary-hover': ramp.cyan[500],\n 'brand-secondary-active': ramp.cyan[400],\n\n // Text on brand backgrounds\n 'on-brand-primary': p.white,\n 'on-brand-secondary': p.white,\n\n // Status colors\n 'status-success': ramp.green[300],\n 'status-success-light': ramp.green[200],\n 'status-success-dark': ramp.green[600],\n 'status-success-subtle': 'rgba(46, 213, 115, 0.12)',\n\n // Live-session accent — its OWN role, decoupled from success so the two can diverge\n 'status-live': ramp.green[300],\n 'status-live-muted': ramp.green[500],\n\n 'status-error': ramp.red[600],\n 'status-error-light': ramp.red[500],\n 'status-error-dark': ramp.red[700],\n 'status-error-subtle': 'rgba(209, 67, 67, 0.12)',\n\n 'status-error-vivid': ramp.red[600],\n 'status-error-vivid-light': ramp.red[500],\n 'status-error-vivid-dark': ramp.red[700],\n 'status-error-vivid-subtle': 'rgba(255, 71, 87, 0.12)',\n\n 'status-warning': ramp.amber[300],\n 'status-warning-light': ramp.amber[200],\n 'status-warning-dark': ramp.amber[500],\n 'status-warning-subtle': 'rgba(249, 180, 21, 0.12)',\n\n 'status-info': ramp.blue[500],\n 'status-info-light': ramp.blue[300],\n 'status-info-dark': ramp.blue[600],\n 'status-info-subtle': 'rgba(33, 150, 243, 0.12)',\n\n // Text on status backgrounds\n 'on-status-success': p.white,\n 'on-status-error': p.white,\n 'on-status-warning': p.white,\n 'on-status-info': p.white,\n\n // Result/outcome indicators (result-*)\n 'result-improve': '#4caf50',\n 'result-improve-light': 'rgba(76, 175, 80, 0.16)',\n 'result-improve-dark': '#248a24',\n 'result-degrade': '#ef5350',\n 'result-degrade-light': 'rgba(239, 83, 80, 0.16)',\n 'result-degrade-dark': '#b30000',\n 'result-inconclusive': '#9E9A97',\n 'result-inconclusive-light': 'rgba(158, 154, 151, 0.16)',\n 'result-neutral': greyRamp[400],\n\n // Text on result backgrounds\n 'on-result-improve': p.white,\n 'on-result-degrade': p.white,\n 'on-result-inconclusive': p.white,\n\n // Data visualization colors (same in dark mode for consistency)\n 'data-1': discreteRainbow[9],\n 'data-2': discreteRainbow[14],\n 'data-3': discreteRainbow[17],\n 'data-4': discreteRainbow[25],\n 'data-5': discreteRainbow[8],\n 'data-6': discreteRainbow[20],\n 'data-7': discreteRainbow[13],\n 'data-8': discreteRainbow[15],\n 'data-9': discreteRainbow[3],\n 'data-10': discreteRainbow[22],\n\n // Text colors - inverted for dark mode\n 'text-primary': greyRamp[50],\n 'text-secondary': greyRamp[400],\n // Deliberately ONE step lighter than the L*-nearest match (`greyRamp[600]`).\n // The colour this replaced failed WCAG large-text outright on the three\n // lightest planes — 2.96 / 2.72 / 2.49 against elevated / raised / overlay —\n // and `600` carried that failure forward almost exactly (2.93 / 2.70 / 2.47).\n // `500` clears 3:1 everywhere (3.32–5.34). Contrast beats colour fidelity for\n // text roles; borders and surfaces still use strict L*-nearest. See\n // semantic-contrast.test.ts, which fails if this is moved back down.\n 'text-tertiary': greyRamp[500],\n 'text-disabled': 'rgba(255, 255, 255, 0.38)',\n 'text-inverse': greyRamp[950],\n 'text-link': '#828DF8',\n 'text-link-hover': ramp.blue[400],\n\n // Surface colors - dark backgrounds — warm-tapered DERIVED ramp (TD-surface-tokens,\n // S-1, re-spaced S-3). Shipped verbatim from `deriveSurfaceRamp()` — see\n // `surfaceRampDark` in primitives.ts for the full derivation note. `surface-overlay`\n // and `surface-elevated` are distinct (were both #191919 pre-S-1); `surface-input`\n // tracks one plane above `surface-base`, same relative position as before the remap.\n // `background-base` backs `Surface level=\"background\"` (SurfaceContext.SURFACE_LEVEL_TOKEN),\n // so it takes the ramp's shell role. The deepest plane is `background-frame`,\n // which is also the `SurfaceLevel` floor a pressed surface clamps at.\n 'surface-base': greyRamp[925], // main surface (#252321, L*13.9)\n 'surface-elevated': greyRamp[900], // elevated surface (#2C2A28, L*17.2 — nav/rail)\n 'surface-raised': greyRamp[875], // raised surface (#31302F, L*19.9 — cards)\n 'surface-overlay': greyRamp[850], // overlay surface (#373635, L*22.7 — hero/popover)\n 'surface-input': greyRamp[900], // input surface (#2C2A28 — one plane above base)\n\n // Background colors — same ramp, the frame/shell end of it.\n 'background-base': greyRamp[950], // shell (#1C1916, L*9 — Surface level=\"background\")\n 'background-default': greyRamp[925], // main background (#252321, L*13.9 — matches surface-base)\n 'background-subtle': greyRamp[900], // subtle background (#2C2A28, L*17.2 — matches surface-elevated)\n // Frame/bezel chrome — the top bar + side nav shell, one step BELOW\n // `background-base`. It used to be described as sitting OUTSIDE the ramp; it\n // is simply the ramp's last step now, and the floor `<Surface pressed>` clamps at.\n 'background-frame': greyRamp[975], // frame / bezel (#100D0A, L*3.8)\n\n // Border colors — solid dark borders are RETIRED (TD-07.14). Not a preference — a structural\n // consequence of one ramp. Every step from 850 to 975 is now a surface plane,\n // so a solid border dark enough to read as a border necessarily equals some\n // plane's fill, which is exactly the collision `surface.contract.test.ts` R2\n // forbids. The only non-plane steps left in that band are 800 and 700, and\n // borders there jump from L*~10-25 to L*~28-38 — a restyle, not a migration.\n //\n // So separation moves to the alpha hairlines, which dark mode already called\n // \"the primary separation cue\". Being alpha, they composite against whatever\n // plane they land on and cannot collide with any of them — the problem stops\n // existing rather than being re-solved per plane. The three solid tokens were\n // deleted outright; consumers point at the `hairline-*` family below.\n //\n // `border-prominent` stays SOLID: it is the one border meant to be seen\n // outright (4 call sites, high-visibility dividers), and grey-800 is not a\n // plane, so it keeps its job without collision.\n 'border-prominent': greyRamp[800], // high-visibility divider\n 'border-focus': '#828DF8',\n 'border-input': greyRamp[700],\n 'border-input-hover': greyRamp[600],\n 'border-input-focus': '#828DF8',\n 'border-input-error': ramp.red[500],\n\n // Alpha hairline separators — the primary separation cue (§4/S-2). Self-\n // normalizing: composites toward white by ~the same amount on ANY plane, so\n // one family works at every elevation instead of per-surface border tokens.\n // Shadows are demoted to floating-overlay use only (not shipped as a fill\n // separator here — see elevation.ts, follow-up S-4).\n //\n // RETUNED on the wall (VW-99, S-6). The original .06/.09/.14 were set at a\n // desk. On the panel at ~3 m `subtle` rendered but was indiscernible, and\n // `default` — the load-bearing one, with no solid-border fallback since\n // TD-07.14 — went weak on the lightest plane. `strong` read cleanly with room\n // to spare, which is what made raising the whole family viable.\n //\n // Each tier steps up onto the next MEASURED-GOOD rung rather than an\n // interpolated one: the new `subtle` is the old `default`, and the new\n // `default` is the old `strong` — a value just confirmed legible on all four\n // planes. Spacing goes 1 : 1.56 : 2.33, against the original 1 : 1.5 : 2.33.\n //\n // RUN 2 (VW-99): all three tiers were seen on all four planes — the retune\n // worked — but `subtle` was still \"a bit hard to read\", so the whole family\n // took a further +.01. That is a comfort margin on a passing row, not a fix\n // for a failing one, which is why it is a flat offset: the 1 : 1.56 : 2.33\n // spacing that the run validated is preserved rather than re-derived.\n //\n // Keep these to TWO decimals. react-native-web quantises alpha to 8 bits, so\n // a 3-decimal value silently rounds on the way to the DOM (.135 renders as\n // .13) — the token would say one thing and paint another.\n //\n // DARK ONLY. The light family above composites toward BLACK on light planes,\n // which this run says nothing about — do not mirror these numbers into it\n // without its own verification.\n 'hairline-subtle': 'rgba(255, 255, 255, 0.10)',\n 'hairline-default': 'rgba(255, 255, 255, 0.15)',\n 'hairline-strong': 'rgba(255, 255, 255, 0.22)',\n\n // Interactive states\n 'interactive-hover': 'rgba(255, 255, 255, 0.04)',\n 'interactive-focus': 'rgba(255, 255, 255, 0.12)',\n 'interactive-active': 'rgba(255, 255, 255, 0.16)',\n 'interactive-selected': 'rgba(255, 255, 255, 0.08)',\n 'interactive-disabled': 'rgba(255, 255, 255, 0.12)',\n 'interactive-disabled-text': 'rgba(255, 255, 255, 0.26)',\n\n // Divider\n 'divider': 'rgba(255, 255, 255, 0.09)',\n\n // Avatar default\n 'avatar-background': greyRamp[700],\n 'avatar-text': p.white,\n} as const\n\n// Typography tokens matching existing app\nexport const semanticTypography = {\n // Headings (Space Grotesk)\n h1: {\n fontFamily: 'heading',\n fontSize: '3.5rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h2: {\n fontFamily: 'heading',\n fontSize: '3rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h3: {\n fontFamily: 'heading',\n fontSize: '2.25rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h4: {\n fontFamily: 'heading',\n fontSize: '2rem',\n fontWeight: 700,\n lineHeight: 1.375,\n },\n h5: {\n fontFamily: 'heading',\n fontSize: '1.5rem',\n fontWeight: 600,\n lineHeight: 1.375,\n },\n h6: {\n fontFamily: 'heading',\n fontSize: '1.125rem',\n fontWeight: 600,\n lineHeight: 1.375,\n },\n\n // Body text (Nunito Sans)\n body1: {\n fontFamily: 'body',\n fontSize: '1rem',\n fontWeight: 400,\n lineHeight: 1.5,\n },\n body2: {\n fontFamily: 'body',\n fontSize: '0.875rem',\n fontWeight: 400,\n lineHeight: 1.57,\n },\n subtitle1: {\n fontFamily: 'body',\n fontSize: '1rem',\n fontWeight: 500,\n lineHeight: 1.75,\n },\n subtitle2: {\n fontFamily: 'body',\n fontSize: '0.875rem',\n fontWeight: 500,\n lineHeight: 1.57,\n },\n caption: {\n fontFamily: 'body',\n fontSize: '0.75rem',\n fontWeight: 400,\n lineHeight: 1.66,\n },\n overline: {\n fontFamily: 'body',\n fontSize: '0.75rem',\n fontWeight: 600,\n lineHeight: 2.5,\n letterSpacing: '0.5px',\n textTransform: 'uppercase' as const,\n },\n button: {\n fontFamily: 'sans',\n fontSize: '0.875rem',\n fontWeight: 600,\n lineHeight: 1.75,\n },\n} as const\n\n// Button size tokens\nexport const buttonSizes = {\n sm: {\n paddingX: '16px',\n paddingY: '6px',\n fontSize: '0.875rem',\n },\n md: {\n paddingX: '20px',\n paddingY: '8px',\n fontSize: '0.875rem',\n },\n lg: {\n paddingX: '24px',\n paddingY: '11px',\n fontSize: '1rem',\n },\n} as const\n\n// Export type for theme mode\nexport type ThemeMode = 'light' | 'dark'\n\n// Helper to get semantic colors based on mode\nexport function getSemanticColors(mode: ThemeMode) {\n return mode === 'dark' ? semanticColorsDark : semanticColorsLight\n}\n","/**\n * Theme Configuration\n *\n * Maps semantic tokens to CSS custom properties for runtime theming.\n * Dark mode is the default theme.\n */\n\nimport { semanticColorsLight, semanticColorsDark, type ThemeMode } from './tokens/semantic'\n\n// Theme-independent custom properties: identical in light and dark in\n// global.css (RGB glow decompositions, font families, animation tokens). Kept\n// as literals since they are not part of the semantic COLOR maps, and spread\n// into both theme maps so codegen mirrors global.css exactly.\nconst themeIndependentCSSVars = {\n // RGB decomposed values for glow shadows\n '--color-brand-primary-rgb': '255, 121, 0',\n '--color-brand-secondary-rgb': '48, 123, 155',\n '--color-status-success-rgb': '46, 213, 115',\n '--color-status-error-rgb': '209, 67, 67',\n '--color-status-error-vivid-rgb': '255, 71, 87',\n '--color-status-warning-rgb': '249, 180, 21',\n '--color-status-info-rgb': '33, 150, 243',\n '--color-background-base-rgb': '16, 16, 16',\n\n // Font families\n '--font-family-sans': \"'Inter'\",\n '--font-family-body': \"'Nunito Sans'\",\n '--font-family-heading': \"'Space Grotesk'\",\n '--font-family-mono': \"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace\",\n\n // Animation tokens\n '--ease-out': 'cubic-bezier(0.22, 1, 0.36, 1)',\n '--ease-in-out': 'cubic-bezier(0.65, 0, 0.35, 1)',\n '--ease-spring': 'cubic-bezier(0.34, 1.56, 0.64, 1)',\n '--duration-fast': '150ms',\n '--duration-normal': '250ms',\n '--duration-slow': '400ms',\n} as const\n\n// CSS custom properties for light mode\nexport const lightThemeCSSVars = {\n '--color-brand-primary': semanticColorsLight['brand-primary'],\n '--color-brand-primary-light': semanticColorsLight['brand-primary-light'],\n '--color-brand-primary-dark': semanticColorsLight['brand-primary-dark'],\n '--color-brand-primary-subtle': semanticColorsLight['brand-primary-subtle'],\n '--color-brand-secondary': semanticColorsLight['brand-secondary'],\n '--color-brand-secondary-light': semanticColorsLight['brand-secondary-light'],\n '--color-brand-secondary-dark': semanticColorsLight['brand-secondary-dark'],\n '--color-brand-secondary-subtle': semanticColorsLight['brand-secondary-subtle'],\n\n '--color-on-brand-primary': semanticColorsLight['on-brand-primary'],\n '--color-on-brand-secondary': semanticColorsLight['on-brand-secondary'],\n\n '--color-status-success': semanticColorsLight['status-success'],\n '--color-status-success-subtle': semanticColorsLight['status-success-subtle'],\n '--color-status-live': semanticColorsLight['status-live'],\n '--color-status-live-muted': semanticColorsLight['status-live-muted'],\n '--color-status-error': semanticColorsLight['status-error'],\n '--color-status-error-subtle': semanticColorsLight['status-error-subtle'],\n '--color-status-warning': semanticColorsLight['status-warning'],\n '--color-status-warning-subtle': semanticColorsLight['status-warning-subtle'],\n '--color-status-info': semanticColorsLight['status-info'],\n '--color-status-info-subtle': semanticColorsLight['status-info-subtle'],\n\n '--color-status-error-vivid': semanticColorsLight['status-error-vivid'],\n '--color-status-error-vivid-light': semanticColorsLight['status-error-vivid-light'],\n '--color-status-error-vivid-dark': semanticColorsLight['status-error-vivid-dark'],\n '--color-status-error-vivid-subtle': semanticColorsLight['status-error-vivid-subtle'],\n\n '--color-text-primary': semanticColorsLight['text-primary'],\n '--color-text-secondary': semanticColorsLight['text-secondary'],\n '--color-text-tertiary': semanticColorsLight['text-tertiary'],\n '--color-text-disabled': semanticColorsLight['text-disabled'],\n '--color-text-inverse': semanticColorsLight['text-inverse'],\n '--color-text-link': semanticColorsLight['text-link'],\n\n '--color-surface-base': semanticColorsLight['surface-base'],\n '--color-surface-elevated': semanticColorsLight['surface-elevated'],\n '--color-surface-raised': semanticColorsLight['surface-raised'],\n\n '--color-background-base': semanticColorsLight['background-base'],\n '--color-background-default': semanticColorsLight['background-default'],\n '--color-background-subtle': semanticColorsLight['background-subtle'],\n '--color-background-frame': semanticColorsLight['background-frame'],\n\n '--color-border-prominent': semanticColorsLight['border-prominent'],\n '--color-border-focus': semanticColorsLight['border-focus'],\n\n '--color-interactive-hover': semanticColorsLight['interactive-hover'],\n '--color-interactive-focus': semanticColorsLight['interactive-focus'],\n '--color-interactive-active': semanticColorsLight['interactive-active'],\n '--color-interactive-selected': semanticColorsLight['interactive-selected'],\n '--color-interactive-disabled': semanticColorsLight['interactive-disabled'],\n\n '--color-divider': semanticColorsLight['divider'],\n\n '--color-brand-primary-hover': semanticColorsLight['brand-primary-hover'],\n '--color-brand-primary-active': semanticColorsLight['brand-primary-active'],\n '--color-brand-secondary-hover': semanticColorsLight['brand-secondary-hover'],\n '--color-brand-secondary-active': semanticColorsLight['brand-secondary-active'],\n\n '--color-status-success-light': semanticColorsLight['status-success-light'],\n '--color-status-success-dark': semanticColorsLight['status-success-dark'],\n '--color-status-error-light': semanticColorsLight['status-error-light'],\n '--color-status-error-dark': semanticColorsLight['status-error-dark'],\n '--color-status-warning-light': semanticColorsLight['status-warning-light'],\n '--color-status-warning-dark': semanticColorsLight['status-warning-dark'],\n '--color-status-info-light': semanticColorsLight['status-info-light'],\n '--color-status-info-dark': semanticColorsLight['status-info-dark'],\n\n '--color-on-status-success': semanticColorsLight['on-status-success'],\n '--color-on-status-error': semanticColorsLight['on-status-error'],\n '--color-on-status-warning': semanticColorsLight['on-status-warning'],\n '--color-on-status-info': semanticColorsLight['on-status-info'],\n\n '--color-result-improve': semanticColorsLight['result-improve'],\n '--color-result-improve-light': semanticColorsLight['result-improve-light'],\n '--color-result-improve-dark': semanticColorsLight['result-improve-dark'],\n '--color-result-degrade': semanticColorsLight['result-degrade'],\n '--color-result-degrade-light': semanticColorsLight['result-degrade-light'],\n '--color-result-degrade-dark': semanticColorsLight['result-degrade-dark'],\n '--color-result-inconclusive': semanticColorsLight['result-inconclusive'],\n '--color-result-inconclusive-light': semanticColorsLight['result-inconclusive-light'],\n '--color-result-neutral': semanticColorsLight['result-neutral'],\n\n '--color-on-result-improve': semanticColorsLight['on-result-improve'],\n '--color-on-result-degrade': semanticColorsLight['on-result-degrade'],\n '--color-on-result-inconclusive': semanticColorsLight['on-result-inconclusive'],\n\n '--color-data-1': semanticColorsLight['data-1'],\n '--color-data-2': semanticColorsLight['data-2'],\n '--color-data-3': semanticColorsLight['data-3'],\n '--color-data-4': semanticColorsLight['data-4'],\n '--color-data-5': semanticColorsLight['data-5'],\n '--color-data-6': semanticColorsLight['data-6'],\n '--color-data-7': semanticColorsLight['data-7'],\n '--color-data-8': semanticColorsLight['data-8'],\n '--color-data-9': semanticColorsLight['data-9'],\n '--color-data-10': semanticColorsLight['data-10'],\n\n '--color-text-link-hover': semanticColorsLight['text-link-hover'],\n\n '--color-surface-overlay': semanticColorsLight['surface-overlay'],\n '--color-surface-input': semanticColorsLight['surface-input'],\n\n '--color-border-input': semanticColorsLight['border-input'],\n '--color-border-input-hover': semanticColorsLight['border-input-hover'],\n '--color-border-input-focus': semanticColorsLight['border-input-focus'],\n '--color-border-input-error': semanticColorsLight['border-input-error'],\n\n '--color-hairline-subtle': semanticColorsLight['hairline-subtle'],\n '--color-hairline-default': semanticColorsLight['hairline-default'],\n '--color-hairline-strong': semanticColorsLight['hairline-strong'],\n\n '--color-interactive-disabled-text': semanticColorsLight['interactive-disabled-text'],\n\n '--color-avatar-background': semanticColorsLight['avatar-background'],\n '--color-avatar-text': semanticColorsLight['avatar-text'],\n\n ...themeIndependentCSSVars,\n} as const\n\n// CSS custom properties for dark mode (default)\nexport const darkThemeCSSVars = {\n '--color-brand-primary': semanticColorsDark['brand-primary'],\n '--color-brand-primary-light': semanticColorsDark['brand-primary-light'],\n '--color-brand-primary-dark': semanticColorsDark['brand-primary-dark'],\n '--color-brand-primary-subtle': semanticColorsDark['brand-primary-subtle'],\n '--color-brand-secondary': semanticColorsDark['brand-secondary'],\n '--color-brand-secondary-light': semanticColorsDark['brand-secondary-light'],\n '--color-brand-secondary-dark': semanticColorsDark['brand-secondary-dark'],\n '--color-brand-secondary-subtle': semanticColorsDark['brand-secondary-subtle'],\n\n '--color-on-brand-primary': semanticColorsDark['on-brand-primary'],\n '--color-on-brand-secondary': semanticColorsDark['on-brand-secondary'],\n\n '--color-status-success': semanticColorsDark['status-success'],\n '--color-status-success-subtle': semanticColorsDark['status-success-subtle'],\n '--color-status-live': semanticColorsDark['status-live'],\n '--color-status-live-muted': semanticColorsDark['status-live-muted'],\n '--color-status-error': semanticColorsDark['status-error'],\n '--color-status-error-subtle': semanticColorsDark['status-error-subtle'],\n '--color-status-warning': semanticColorsDark['status-warning'],\n '--color-status-warning-subtle': semanticColorsDark['status-warning-subtle'],\n '--color-status-info': semanticColorsDark['status-info'],\n '--color-status-info-subtle': semanticColorsDark['status-info-subtle'],\n\n '--color-status-error-vivid': semanticColorsDark['status-error-vivid'],\n '--color-status-error-vivid-light': semanticColorsDark['status-error-vivid-light'],\n '--color-status-error-vivid-dark': semanticColorsDark['status-error-vivid-dark'],\n '--color-status-error-vivid-subtle': semanticColorsDark['status-error-vivid-subtle'],\n\n '--color-text-primary': semanticColorsDark['text-primary'],\n '--color-text-secondary': semanticColorsDark['text-secondary'],\n '--color-text-tertiary': semanticColorsDark['text-tertiary'],\n '--color-text-disabled': semanticColorsDark['text-disabled'],\n '--color-text-inverse': semanticColorsDark['text-inverse'],\n '--color-text-link': semanticColorsDark['text-link'],\n\n '--color-surface-base': semanticColorsDark['surface-base'],\n '--color-surface-elevated': semanticColorsDark['surface-elevated'],\n '--color-surface-raised': semanticColorsDark['surface-raised'],\n\n '--color-background-base': semanticColorsDark['background-base'],\n '--color-background-default': semanticColorsDark['background-default'],\n '--color-background-subtle': semanticColorsDark['background-subtle'],\n '--color-background-frame': semanticColorsDark['background-frame'],\n\n '--color-border-prominent': semanticColorsDark['border-prominent'],\n '--color-border-focus': semanticColorsDark['border-focus'],\n\n '--color-interactive-hover': semanticColorsDark['interactive-hover'],\n '--color-interactive-focus': semanticColorsDark['interactive-focus'],\n '--color-interactive-active': semanticColorsDark['interactive-active'],\n '--color-interactive-selected': semanticColorsDark['interactive-selected'],\n '--color-interactive-disabled': semanticColorsDark['interactive-disabled'],\n\n '--color-divider': semanticColorsDark['divider'],\n\n '--color-brand-primary-hover': semanticColorsDark['brand-primary-hover'],\n '--color-brand-primary-active': semanticColorsDark['brand-primary-active'],\n '--color-brand-secondary-hover': semanticColorsDark['brand-secondary-hover'],\n '--color-brand-secondary-active': semanticColorsDark['brand-secondary-active'],\n\n '--color-status-success-light': semanticColorsDark['status-success-light'],\n '--color-status-success-dark': semanticColorsDark['status-success-dark'],\n '--color-status-error-light': semanticColorsDark['status-error-light'],\n '--color-status-error-dark': semanticColorsDark['status-error-dark'],\n '--color-status-warning-light': semanticColorsDark['status-warning-light'],\n '--color-status-warning-dark': semanticColorsDark['status-warning-dark'],\n '--color-status-info-light': semanticColorsDark['status-info-light'],\n '--color-status-info-dark': semanticColorsDark['status-info-dark'],\n\n '--color-on-status-success': semanticColorsDark['on-status-success'],\n '--color-on-status-error': semanticColorsDark['on-status-error'],\n '--color-on-status-warning': semanticColorsDark['on-status-warning'],\n '--color-on-status-info': semanticColorsDark['on-status-info'],\n\n '--color-result-improve': semanticColorsDark['result-improve'],\n '--color-result-improve-light': semanticColorsDark['result-improve-light'],\n '--color-result-improve-dark': semanticColorsDark['result-improve-dark'],\n '--color-result-degrade': semanticColorsDark['result-degrade'],\n '--color-result-degrade-light': semanticColorsDark['result-degrade-light'],\n '--color-result-degrade-dark': semanticColorsDark['result-degrade-dark'],\n '--color-result-inconclusive': semanticColorsDark['result-inconclusive'],\n '--color-result-inconclusive-light': semanticColorsDark['result-inconclusive-light'],\n '--color-result-neutral': semanticColorsDark['result-neutral'],\n\n '--color-on-result-improve': semanticColorsDark['on-result-improve'],\n '--color-on-result-degrade': semanticColorsDark['on-result-degrade'],\n '--color-on-result-inconclusive': semanticColorsDark['on-result-inconclusive'],\n\n '--color-data-1': semanticColorsDark['data-1'],\n '--color-data-2': semanticColorsDark['data-2'],\n '--color-data-3': semanticColorsDark['data-3'],\n '--color-data-4': semanticColorsDark['data-4'],\n '--color-data-5': semanticColorsDark['data-5'],\n '--color-data-6': semanticColorsDark['data-6'],\n '--color-data-7': semanticColorsDark['data-7'],\n '--color-data-8': semanticColorsDark['data-8'],\n '--color-data-9': semanticColorsDark['data-9'],\n '--color-data-10': semanticColorsDark['data-10'],\n\n '--color-text-link-hover': semanticColorsDark['text-link-hover'],\n\n '--color-surface-overlay': semanticColorsDark['surface-overlay'],\n '--color-surface-input': semanticColorsDark['surface-input'],\n\n '--color-border-input': semanticColorsDark['border-input'],\n '--color-border-input-hover': semanticColorsDark['border-input-hover'],\n '--color-border-input-focus': semanticColorsDark['border-input-focus'],\n '--color-border-input-error': semanticColorsDark['border-input-error'],\n\n '--color-hairline-subtle': semanticColorsDark['hairline-subtle'],\n '--color-hairline-default': semanticColorsDark['hairline-default'],\n '--color-hairline-strong': semanticColorsDark['hairline-strong'],\n\n '--color-interactive-disabled-text': semanticColorsDark['interactive-disabled-text'],\n\n '--color-avatar-background': semanticColorsDark['avatar-background'],\n '--color-avatar-text': semanticColorsDark['avatar-text'],\n\n ...themeIndependentCSSVars,\n} as const\n\n// Helper to get CSS vars for a theme mode\nexport function getThemeCSSVars(mode: ThemeMode) {\n return mode === 'dark' ? darkThemeCSSVars : lightThemeCSSVars\n}\n\n// Gluestack UI theme configuration\nexport const gluestackConfig = {\n tokens: {\n colors: {\n // Map to our semantic colors via CSS vars\n primary500: 'var(--color-brand-primary)',\n primary600: 'var(--color-brand-primary-dark)',\n primary400: 'var(--color-brand-primary-light)',\n\n secondary500: 'var(--color-brand-secondary)',\n secondary600: 'var(--color-brand-secondary-dark)',\n secondary400: 'var(--color-brand-secondary-light)',\n\n success500: 'var(--color-status-success)',\n error500: 'var(--color-status-error)',\n warning500: 'var(--color-status-warning)',\n info500: 'var(--color-status-info)',\n\n textLight: 'var(--color-text-primary)',\n textDark: 'var(--color-text-inverse)',\n\n backgroundLight: 'var(--color-background-default)',\n backgroundDark: 'var(--color-surface-base)',\n },\n space: {\n '0': 0,\n '1': 4,\n '2': 8,\n '3': 12,\n '4': 16,\n '5': 20,\n '6': 24,\n '8': 32,\n '10': 40,\n '12': 48,\n '16': 64,\n '20': 80,\n '24': 96,\n },\n radii: {\n none: 0,\n sm: 4,\n md: 8,\n lg: 12,\n xl: 16,\n '2xl': 24,\n full: 9999,\n },\n fontSizes: {\n xs: 12,\n sm: 14,\n md: 16,\n lg: 18,\n xl: 20,\n '2xl': 24,\n '3xl': 30,\n '4xl': 36,\n '5xl': 48,\n },\n },\n aliases: {\n bg: 'backgroundColor',\n p: 'padding',\n px: 'paddingHorizontal',\n py: 'paddingVertical',\n m: 'margin',\n mx: 'marginHorizontal',\n my: 'marginVertical',\n h: 'height',\n w: 'width',\n rounded: 'borderRadius',\n },\n} as const\n\nexport type ThemeConfig = typeof gluestackConfig\n","/**\n * Surface MATERIALS — the treatments layered on top of the flat grey ramp.\n *\n * The ramp says how deep a plane sits. This says what it is made of. Two\n * materials, deliberately: a matte PAPER sheet for hero surfaces, and a recessed\n * INSET WELL for grouped or awaiting-data regions.\n *\n * SCOPE, and it is a hard rule rather than a preference: paper goes on hero\n * surfaces only — the live card, the LOAD/verdict chip, the rest hero. The\n * \"everything is a paper card\" look is explicitly NOT the model; it was an\n * over-application built to find the ceiling. There are no LEVELS of paper. One\n * treatment, used sparingly, or the texture stops meaning anything.\n *\n * Second hard rule: paper fills take DEEP/MUTED tones only (a ramp step, or a\n * categorical `dark` variant). Vivid and neon colours are ink ON paper — never\n * the paper itself.\n *\n * PLATFORM: `backgroundImage` and multi-layer `boxShadow` are web/RNW only. On\n * native these are ignored and the surface falls back to its flat fill, which is\n * why every material here keeps `backgroundColor` load-bearing on its own. A\n * material must never be the only thing carrying meaning.\n *\n * ── THE TONAL FILL IS GONE (VW-99, S-6 wall calibration) ───────────────────\n *\n * `paperSheet` used to carry a vertical ΔL* 3 gradient, sized \"just under seen\n * as a gradient\". On the wall panel at ~3 m it could not be told from a flat\n * sheet of the same tone, and the full material still read as — the operator's\n * words — \"a flat digital rectangle\". It failed its own stated purpose, which\n * was precisely to stop that.\n *\n * Raising it was not available. The design ceiling is ~ΔL* 4 (past that it reads\n * decorative, which the exploration rejected), and the same run showed why the\n * headroom would not have helped: the 0.025 ELEVATION step — a comparable ΔL*\n * — was called instantly, because it sits at a hard edge between two flat\n * fields. The fill spread the same amount smoothly over ~300 px, where vision is\n * genuinely poor. It is a spatial-frequency problem, not an amplitude one, so\n * the band between \"invisible\" and \"decorative\" may simply not exist here.\n *\n * ── AND THE DITHER WENT WITH IT (VW-99 run 2) ──────────────────────────────\n *\n * `ditherTile` was held back one run on the grounds that \"probably dead weight\"\n * is not a measurement. Run 1 could not measure it: with the fill invisible\n * there was no gradient to band, so the panel returned a guaranteed clean sheet.\n *\n * Run 2 settled it by adding a hand-quantised REFERENCE beside the smooth\n * control — the same tone span drawn as five hard-edged 1-level steps, which is\n * what the artefact looks like when it happens. The reference banded plainly and\n * the smooth gradient did not. So the panel can resolve banding; this render\n * path simply does not produce it. A mitigation for an artefact that does not\n * occur is cost with no benefit, and it is gone.\n *\n * That is a claim about THIS display, which is the one the product ships on and\n * the reason `paperSheet` is hero-surface-only. A phone is a separate question.\n *\n * Kept: grain, rim-light, contact shadow.\n *\n * See coordination/design-explorations/surface-system-north-star.md §4 and\n * coordination/validation-runbooks/VW-99-depth-wall-calibration.md.\n */\nimport type { ViewStyle } from 'react-native'\nimport { getSemanticColors } from './tokens/semantic'\n\nconst c = getSemanticColors('dark')\n\n// ── colour math ─────────────────────────────────────────────────────────────\n\nfunction parseHex(hex: string): [number, number, number] | null {\n const h = hex.replace('#', '')\n const full = h.length === 3 ? h.split('').map((ch) => ch + ch).join('') : h\n const rgb: [number, number, number] = [\n parseInt(full.slice(0, 2), 16),\n parseInt(full.slice(2, 4), 16),\n parseInt(full.slice(4, 6), 16),\n ]\n return rgb.some(Number.isNaN) ? null : rgb\n}\n\n/** sRGB perceived luminance (0 dark … 1 bright), Rec.601 weights. */\nfunction perceivedLuminance(hex: string): number {\n const rgb = parseHex(hex)\n if (!rgb) return 0.5\n const [r, g, b] = rgb\n return (0.299 * r + 0.587 * g + 0.114 * b) / 255\n}\n\n// The CIELAB conversion chain (srgb2lin/lin2srgb/fLab/fInv, hexToLab/labToHex,\n// shiftL) lived here so the tonal fill could be specified in ΔL*. It had no\n// other caller, so it went with the fill — see the module header.\n\n// ── grain ───────────────────────────────────────────────────────────────────\n\n/**\n * Grain opacity for a tone, scaled by perceived brightness.\n *\n * A fixed opacity reads hot on a dark plane and vanishes on a bright one, so\n * darker tones get a whisper and brighter tones keep full texture. Anchored so a\n * dark chip (lum ≈ 0.13) lands ≈ 0.06 and a bright bar (lum ≈ 0.58) lands ≈ 0.20.\n * Above roughly 0.05α on a mid tone it starts reading as \"dirty\" rather than\n * matte, which is what the clamp is protecting.\n *\n * This is the ONE curve all grain goes through — a card and a bar carry\n * proportional, not identical, texture. That is what makes them read as the same\n * material.\n */\nexport function grainOpacityForTone(baseColor: string): number {\n return Math.min(0.24, Math.max(0.04, 0.02 + 0.31 * perceivedLuminance(baseColor)))\n}\n\n/**\n * The matte grain tile as a `backgroundImage` url — one shared `feTurbulence`\n * fractal-noise tile, painted once, NEVER animated. Pair with\n * `backgroundColor: baseColor`.\n */\nexport function grainForTone(baseColor: string): string {\n const op = grainOpacityForTone(baseColor).toFixed(3)\n return (\n `url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E` +\n `%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E` +\n `%3Crect width='120' height='120' filter='url(%23n)' opacity='${op}'/%3E%3C/svg%3E\")`\n )\n}\n\n// `tonalFill` and `ditherTile` both lived here until VW-99 measured them on the\n// wall. Deleted rather than left exported-but-unused; the reasoning is in the\n// module header, which is the part worth keeping.\n\n// ── the materials ───────────────────────────────────────────────────────────\n\n/**\n * A matte PAPER hero sheet: brightness-scaled grain + a crisp top rim-light +\n * one soft contact shadow.\n *\n * The contact shadow is the ONE place a drop-shadow is still correct on a dark\n * surface: it is large, soft, and describes a sheet lying on a plane rather than\n * trying to encode hierarchy. Inline depth is the hairline's job.\n *\n * Defaults to `surface-raised` so a same-toned card laid inside reads as one\n * continuous sheet rather than a seam.\n *\n * THE RIM-LIGHT IS A HAIRLINE. Run 2 of VW-99 called it \"weak at distance\" on\n * both the card and the hero sheet, and the reason is visible in the number: it\n * was `rgba(255,255,255,0.10)`, a 1px white line on a dark plane — physically\n * the same cue as `hairline-*`, but set BELOW `hairline-default`, which the same\n * run had just had to raise twice. It is not a subtler species of edge, it was\n * simply mistuned. Raised to `0.20`, between `hairline-default` and\n * `hairline-strong`: this edge defines a hero surface, so it earns more than the\n * default separator, and unlike a separator there is no fallback behind it.\n *\n * Deliberately NOT wired to the token, though the values now agree in spirit: a\n * box-shadow rim and a border hairline are retuned by different evidence, and\n * coupling them means a hairline run silently restyles every hero sheet.\n *\n * HERO SURFACES ONLY, MUTED TONES ONLY — see the module header.\n */\nexport function paperSheet(tone: string = c['surface-raised']): ViewStyle {\n return {\n backgroundColor: tone,\n // Grain alone. The dither went with the gradient it protected — see header.\n backgroundImage: grainForTone(tone),\n boxShadow: 'inset 0 1px 0 rgba(255,255,255,0.20), 0 8px 22px rgba(0,0,0,0.50)',\n } as unknown as ViewStyle\n}\n\n/**\n * A recessed INSET WELL: a tone pressed BELOW the surrounding plane, cut in by an\n * inner top shadow with a faint light line on the floor.\n *\n * The bottom rim is the load-bearing half. A dark inset alone just reads as a\n * darker rectangle; it is the light catching the floor that says \"this is below\n * the surface\" — which is why the treatment survives at 16px where a full paper\n * treatment does not.\n *\n * The floor light was `0.04` and is now `0.12`, chosen on the wall in VW-99 run\n * 2 against a `.04`-vs-`.12`-vs-none forced choice. Worth recording that `.04`\n * was NOT invisible — the no-line decoy was correctly rejected and both real\n * values were seen, so this is a preference between two working values, not a\n * rescue. The rim-light next door was a genuine miss; this one was only thin.\n *\n * Note this is a MATERIAL, and independent of the surface LEVEL named `inset`\n * that was retired in TD-07.14. A well is something you apply; a level is\n * somewhere you sit.\n */\nexport function insetWell(tone: string = c['surface-input']): ViewStyle {\n return {\n backgroundColor: tone,\n boxShadow: 'inset 0 2px 6px rgba(0,0,0,0.55), inset 0 -1px 0 rgba(255,255,255,0.12)',\n } as unknown as ViewStyle\n}\n\n/**\n * Paper for a COLORED BAR — the same material as {@link paperSheet}, tuned for a\n * small saturated element: grain + top rim-light + a contact shadow cast past the\n * bar's leading edge, so a filled bar reads as a physical block that has travelled.\n *\n * No tonal fill or dither here: a bar is too narrow for a ΔL* 3 gradient to read,\n * and too narrow to band.\n *\n * `flip` = a vertically mirrored (`scaleY(-1)`) plot, i.e. the `down` wing of a\n * diverging chart. The contact shadow's y-offset is pre-inverted so the mirror\n * lands it pointing AWAY from the shared axis rather than up across it, and the\n * top rim-light is DROPPED — mirrored it would sit on the axis edge and read\n * wrong, so grain and shadow carry the material alone.\n */\nexport function barPaper(color: string, flip = false): ViewStyle {\n return {\n backgroundImage: grainForTone(color),\n boxShadow: flip\n ? '0 -6px 16px rgba(0,0,0,0.45)'\n : 'inset 0 1.5px 0 rgba(255,255,255,0.22), 0 6px 16px rgba(0,0,0,0.45)',\n } as unknown as ViewStyle\n}\n","/**\n * Colour math shared by the depth system.\n *\n * This file used to be `shadows.ts` and shipped a neumorphic shadow builder —\n * dual opposing shadows, dark bottom-right and light top-left. That was removed\n * in TD-07.16. Neumorphism needs a mid-tone background (roughly 75-90%\n * lightness) so BOTH shadows have somewhere to fall; our surfaces sit near 10%,\n * which leaves the dark half nothing to fall onto. It collapsed to a one-sided\n * rim light and read as noise on the wall.\n *\n * Inline depth is a hairline now (`hairline-*`, self-normalising alpha), texture\n * is `materials.ts`, and drop-shadow survives only for genuinely FLOATING\n * things — see `elevation.ts`.\n *\n * What is left here is the HSV/hex maths that `elevation.ts` still uses to\n * derive rim and shadow tints from whatever surface colour it is handed.\n */\n\n// ============================================================================\n// Color Math Utilities\n// ============================================================================\n\n/**\n * Parse a hex color to RGB values (0-255).\n * Supports both #RGB and #RRGGBB formats.\n */\nexport function hexToRgb(hex: string): { r: number; g: number; b: number } | null {\n const cleaned = hex.replace('#', '')\n \n let r: number, g: number, b: number\n \n if (cleaned.length === 3) {\n r = parseInt(cleaned[0] + cleaned[0], 16)\n g = parseInt(cleaned[1] + cleaned[1], 16)\n b = parseInt(cleaned[2] + cleaned[2], 16)\n } else if (cleaned.length === 6) {\n r = parseInt(cleaned.slice(0, 2), 16)\n g = parseInt(cleaned.slice(2, 4), 16)\n b = parseInt(cleaned.slice(4, 6), 16)\n } else {\n return null\n }\n \n return { r, g, b }\n}\n\n/**\n * Convert RGB (0-255) to HSV (h: 0-360, s: 0-1, v: 0-1).\n */\nexport function rgbToHsv(r: number, g: number, b: number): { h: number; s: number; v: number } {\n const rNorm = r / 255\n const gNorm = g / 255\n const bNorm = b / 255\n \n const max = Math.max(rNorm, gNorm, bNorm)\n const min = Math.min(rNorm, gNorm, bNorm)\n const delta = max - min\n \n // Value\n const v = max\n \n // Saturation\n const s = max === 0 ? 0 : delta / max\n \n // Hue\n let h = 0\n if (delta !== 0) {\n if (max === rNorm) {\n h = 60 * (((gNorm - bNorm) / delta) % 6)\n } else if (max === gNorm) {\n h = 60 * ((bNorm - rNorm) / delta + 2)\n } else {\n h = 60 * ((rNorm - gNorm) / delta + 4)\n }\n }\n if (h < 0) h += 360\n \n return { h, s, v }\n}\n\n/**\n * Convert HSV (h: 0-360, s: 0-1, v: 0-1) to RGB (0-255).\n */\nexport function hsvToRgb(h: number, s: number, v: number): { r: number; g: number; b: number } {\n const c = v * s\n const x = c * (1 - Math.abs((h / 60) % 2 - 1))\n const m = v - c\n \n let rPrime: number, gPrime: number, bPrime: number\n\n if (h >= 0 && h < 60) {\n rPrime = c; gPrime = x; bPrime = 0\n } else if (h >= 60 && h < 120) {\n rPrime = x; gPrime = c; bPrime = 0\n } else if (h >= 120 && h < 180) {\n rPrime = 0; gPrime = c; bPrime = x\n } else if (h >= 180 && h < 240) {\n rPrime = 0; gPrime = x; bPrime = c\n } else if (h >= 240 && h < 300) {\n rPrime = x; gPrime = 0; bPrime = c\n } else {\n rPrime = c; gPrime = 0; bPrime = x\n }\n \n return {\n r: Math.round((rPrime + m) * 255),\n g: Math.round((gPrime + m) * 255),\n b: Math.round((bPrime + m) * 255),\n }\n}\n\n/**\n * Convert RGB values to hex string.\n */\nexport function rgbToHex(r: number, g: number, b: number): string {\n const toHex = (n: number) => {\n const clamped = Math.max(0, Math.min(255, Math.round(n)))\n return clamped.toString(16).padStart(2, '0')\n }\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`\n}\n\n/**\n * Lighten a color by increasing its HSV Value component.\n * \n * @param hex - The hex color to lighten\n * @param amount - Amount to increase V by (0-1)\n */\nexport function lighten(hex: string, amount: number = 0.1): string {\n const rgb = hexToRgb(hex)\n if (!rgb) return hex\n \n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const newV = Math.min(1, hsv.v + amount)\n \n const newRgb = hsvToRgb(hsv.h, hsv.s, newV)\n return rgbToHex(newRgb.r, newRgb.g, newRgb.b)\n}\n\n/**\n * Darken a color by decreasing its HSV Value component.\n * \n * @param hex - The hex color to darken\n * @param amount - Amount to decrease V by (0-1)\n */\nexport function darken(hex: string, amount: number = 0.1): string {\n const rgb = hexToRgb(hex)\n if (!rgb) return hex\n \n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const newV = Math.max(0, hsv.v - amount)\n \n const newRgb = hsvToRgb(hsv.h, hsv.s, newV)\n return rgbToHex(newRgb.r, newRgb.g, newRgb.b)\n}\n\n/**\n * Get hover colors for a button based on its background color.\n * Automatically adapts intensity based on the color's luminance.\n * \n * @param bgColor - The button's background color (hex)\n * @param intensity - How strong the hover effect should be ('subtle' | 'medium' | 'strong')\n */\nexport function getHoverColors(\n bgColor: string, \n intensity: 'subtle' | 'medium' | 'strong' = 'medium'\n): { raised: string; pressed: string } {\n const amounts = {\n subtle: 0.01,\n medium: 0.02,\n strong: 0.03,\n }\n \n const amount = amounts[intensity]\n \n return {\n raised: lighten(bgColor, amount), // Raised hover: lighten (lifting up)\n pressed: darken(bgColor, amount), // Pressed hover: darken (pressing down)\n }\n}\n\n/**\n * Check if a color is considered \"dark\" (for choosing text color).\n * Uses HSV Value component for simplicity.\n */\nexport function isDark(hex: string): boolean {\n const rgb = hexToRgb(hex)\n if (!rgb) return true\n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n return hsv.v < 0.6\n}\n\n/**\n * Shadow strength tiers. Retained because `elevation.ts` keys its level table on\n * them; the neumorphic shadow BUILDERS that used to live here are gone.\n */\nexport type ShadowIntensity = 'subtle' | 'medium' | 'strong'\n","/**\n * Elevation System\n *\n * A unified depth system where each elevation level corresponds to:\n * - Calculated surface color (derived from base using lighten)\n * - Shadow intensity and style (raised/pressed)\n * - Dynamically calculated shadow colors (derived from surface color)\n * - Semantic name for reference\n *\n * Elevation range: -2 (deep inset) to +5 (floating overlay)\n *\n * Negative elevations: Inset/pressed elements (sunken into surface)\n * Zero elevation: Base surface (background/page level)\n * Positive elevations: Raised elements (floating above surface)\n *\n * All colors are calculated dynamically from a base surface color,\n * allowing for custom surfaces and consistent color relationships.\n *\n * Lighting Model: Light source from upper-right corner\n * - Raised elements are always lighter than base (consistent across themes)\n * - Base colors must allow sufficient lightening in both themes\n */\n\nimport { Platform, type ViewStyle } from 'react-native'\nimport { lighten, darken, hexToRgb, rgbToHsv, hsvToRgb, rgbToHex } from './color-utils'\nimport { semanticColorsLight, semanticColorsDark } from './tokens/semantic'\n\nexport type ElevationLevel = -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5\n\nexport interface ElevationConfig {\n /** Semantic name for this elevation level */\n name: string\n /** Amount to lighten base color (0-1) */\n colorAdjustment: number\n /** Shadow intensity */\n shadowIntensity: 'subtle' | 'medium' | 'strong'\n /** Shadow style: raised (floating) or pressed (inset) */\n shadowStyle: 'raised' | 'pressed'\n /** Description of use case */\n description: string\n}\n\nexport const elevationSystem: Record<ElevationLevel, ElevationConfig> = {\n // Deep inset (recessed input fields, deeply pressed buttons)\n [-2]: {\n name: 'deep-inset',\n colorAdjustment: 0,\n shadowIntensity: 'strong',\n shadowStyle: 'pressed',\n description: 'Deeply recessed elements (e.g., input fields, deeply pressed buttons)',\n },\n\n // Shallow inset (pressed buttons, sunken panels)\n [-1]: {\n name: 'inset',\n colorAdjustment: 0,\n shadowIntensity: 'medium',\n shadowStyle: 'pressed',\n description: 'Shallow inset elements (e.g., pressed buttons, sunken panels within cards)',\n },\n\n // Base level (page background, default surface)\n [0]: {\n name: 'base',\n colorAdjustment: 0,\n shadowIntensity: 'subtle',\n shadowStyle: 'raised',\n description: 'Base surface level (page background, default containers)',\n },\n\n // Level 1: Subtle elevation (outline cards, subtle containers)\n [1]: {\n name: 'subtle',\n // The whole ladder was re-spaced in TD-07.16. It used to run\n // 0.01/0.02/0.04/0.06/0.08, where the first step was ~2 RGB values — under\n // the perceptual floor, so level 1 existed in the type system and nowhere on\n // screen. With drop-shadow now gated off below FLOATING_ELEVATION_MIN, TONE\n // is the only thing separating 0-3, so every step has to actually land.\n // Even 0.025 spacing, verified in elevation.test.ts as ΔL* > 1 per step.\n colorAdjustment: 0.025,\n shadowIntensity: 'subtle',\n shadowStyle: 'raised',\n description: 'Subtle elevation (outline cards, subtle containers)',\n },\n\n // Level 2: Standard elevation (default cards, buttons)\n [2]: {\n name: 'standard',\n colorAdjustment: 0.05,\n shadowIntensity: 'medium',\n shadowStyle: 'raised',\n description: 'Standard elevation (default cards, raised buttons)',\n },\n\n // Level 3: Prominent elevation (important cards, modals)\n [3]: {\n name: 'prominent',\n colorAdjustment: 0.075,\n shadowIntensity: 'strong',\n shadowStyle: 'raised',\n description: 'Prominent elevation (important cards, modals, dropdowns)',\n },\n\n // Level 4: High elevation (overlays, popovers)\n [4]: {\n name: 'high',\n colorAdjustment: 0.10,\n shadowIntensity: 'strong',\n shadowStyle: 'raised',\n description: 'High elevation (overlays, popovers, tooltips)',\n },\n\n // Level 5: Floating (toasts, floating action buttons)\n [5]: {\n name: 'floating',\n colorAdjustment: 0.13,\n shadowIntensity: 'strong',\n shadowStyle: 'raised',\n description: 'Floating elevation (toasts, floating action buttons, highest z-index)',\n },\n}\n\n/**\n * Calculate rim light color from the BASE color.\n * Creates a consistent bright highlight with opacity that scales with elevation.\n *\n * The rim light represents light hitting the edge of raised elements from a\n * consistent light source. Uses ABSOLUTE HSV value (not relative lightening)\n * for consistent intensity across all surface colors.\n *\n * For colored surfaces: preserves hue/saturation, sets value to fixed bright level\n * For gray surfaces: uses white with appropriate opacity\n *\n * @param baseColor - The base surface color (hex)\n * @param level - Elevation level (used to scale opacity)\n */\nfunction calculateRimLightColor(baseColor: string, level: ElevationLevel): string {\n const rgb = hexToRgb(baseColor)\n if (!rgb) {\n return 'rgba(255, 255, 255, 0.5)'\n }\n\n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const isLight = hsv.v > 0.6\n const isSaturated = hsv.s > 0.3 // Colored (not gray)\n\n // Opacity scales with elevation to compensate for lighter surfaces at higher levels\n // Range: +0% at level 1 to +20% at level 5\n const absLevel = Math.abs(level)\n const opacityBoost = Math.max(0, (absLevel - 1) * 0.05) // +5% per level above 1 (0% to 20%)\n\n if (isSaturated) {\n // For colored surfaces, preserve hue and saturation but set value to fixed bright level\n // This ensures consistent rim light intensity across all colored surfaces\n const rimLightValue = 0.95 // Fixed bright value for rim light\n const rimLightRgb = hsvToRgb(hsv.h, hsv.s * 0.3, rimLightValue) // Reduce saturation for brighter appearance\n\n // Base opacity + elevation boost, capped at 1.0\n const baseOpacity = isLight ? 0.9 : 0.5\n const finalOpacity = Math.min(1, baseOpacity + opacityBoost)\n return `rgba(${rimLightRgb.r}, ${rimLightRgb.g}, ${rimLightRgb.b}, ${finalOpacity.toFixed(2)})`\n } else {\n // For gray/neutral surfaces, use white with appropriate opacity\n const baseOpacity = isLight ? 0.9 : 0.12\n const finalOpacity = Math.min(1, baseOpacity + opacityBoost)\n return `rgba(255, 255, 255, ${finalOpacity.toFixed(2)})`\n }\n}\n\n/**\n * Calculate dark shadow colors from the surface color.\n * The dark shadow is cast BY the element, so it should match the surface color.\n *\n * Uses ABSOLUTE HSV value (not relative darkening) for consistent shadow intensity\n * across all surface colors - simulating a consistent light source.\n *\n * For colored surfaces: preserves hue/saturation, sets value to fixed dark level\n * For gray surfaces: uses black with appropriate opacity\n */\nfunction calculateDarkShadowColors(surfaceColor: string): {\n dark: string\n darker: string\n} {\n const rgb = hexToRgb(surfaceColor)\n if (!rgb) {\n return {\n dark: 'rgba(0, 0, 0, 0.3)',\n darker: 'rgba(0, 0, 0, 0.4)',\n }\n }\n\n const hsv = rgbToHsv(rgb.r, rgb.g, rgb.b)\n const isLight = hsv.v > 0.6\n const isSaturated = hsv.s > 0.3\n\n if (isSaturated) {\n // For colored surfaces, preserve hue and saturation but set value to fixed dark level\n // This ensures consistent shadow intensity across all colored surfaces\n const darkShadowValue = 0.15 // Fixed dark value for shadows\n const darkShadowRgb = hsvToRgb(hsv.h, hsv.s, darkShadowValue)\n\n if (isLight) {\n return {\n dark: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.3)`,\n darker: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.4)`,\n }\n } else {\n return {\n dark: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.5)`,\n darker: `rgba(${darkShadowRgb.r}, ${darkShadowRgb.g}, ${darkShadowRgb.b}, 0.6)`,\n }\n }\n } else {\n // For gray surfaces, use standard black shadows\n if (isLight) {\n return {\n dark: 'rgba(0, 0, 0, 0.2)',\n darker: 'rgba(0, 0, 0, 0.3)',\n }\n } else {\n return {\n dark: 'rgba(0, 0, 0, 0.5)',\n darker: 'rgba(0, 0, 0, 0.6)',\n }\n }\n }\n}\n\n/**\n * Get rim light size config.\n * Fixed 1px offset and blur for a consistent, crisp rim highlight.\n * Opacity scaling (in calculateRimLightColor) handles elevation differences.\n */\nfunction getRimLightConfig(): { offset: number; blur: number } {\n return {\n offset: 1, // Fixed 1px for crisp rim\n blur: 1, // Tight blur for crisp edge\n }\n}\n\n/**\n * Get elevation configuration for a given level\n */\nexport function getElevationConfig(level: ElevationLevel): ElevationConfig {\n return elevationSystem[level]\n}\n\n// Simple cache for elevation surface colors\nconst elevationSurfaceCache = new Map<string, string>()\nconst MAX_CACHE_SIZE = 100\n\nfunction getCacheKey(baseColor: string, level: ElevationLevel, theme: 'light' | 'dark'): string {\n return `${baseColor}-${level}-${theme}`\n}\n\nfunction calculateElevationSurface(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark'\n): string {\n const config = elevationSystem[level]\n\n if (config.colorAdjustment === 0) {\n return baseColor\n }\n\n // For raised elevations (positive), always lighten (consistent lighting model)\n // Light source is from upper-right, so raised elements are always lighter\n // For inset elevations (negative), we keep base color (shadow creates depth)\n if (level < 0) {\n return baseColor // Inset elements use base color\n }\n\n // Always lighten for raised elements (consistent across themes)\n // Base colors must be chosen to allow sufficient lightening in dark mode\n return lighten(baseColor, config.colorAdjustment)\n}\n\n/**\n * Calculate surface color for an elevation level from a base color.\n * Results are cached to avoid redundant calculations.\n *\n * @param baseColor - Base surface color (hex)\n * @param level - Elevation level\n * @param theme - Current theme ('light' or 'dark')\n * @returns Calculated surface color (hex)\n */\nexport function getElevationSurface(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark'\n): string {\n const cacheKey = getCacheKey(baseColor, level, theme)\n\n // Check cache\n if (elevationSurfaceCache.has(cacheKey)) {\n return elevationSurfaceCache.get(cacheKey)!\n }\n\n // Calculate\n const result = calculateElevationSurface(baseColor, level, theme)\n\n // Cache result (with size limit to prevent memory leaks)\n if (elevationSurfaceCache.size >= MAX_CACHE_SIZE) {\n // Remove oldest entry (simple FIFO)\n const firstKey = elevationSurfaceCache.keys().next().value!\n elevationSurfaceCache.delete(firstKey)\n }\n elevationSurfaceCache.set(cacheKey, result)\n\n return result\n}\n\n// Cache for shadow styles (less frequently used, smaller cache)\nconst elevationShadowCache = new Map<string, ViewStyle>()\nconst MAX_SHADOW_CACHE_SIZE = 50\n\nfunction getShadowCacheKey(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark',\n isHovered: boolean\n): string {\n return `${baseColor}-${level}-${theme}-${isHovered}`\n}\n\nfunction calculateElevationShadow(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark',\n isHovered: boolean = false\n): ViewStyle {\n const config = elevationSystem[level]\n\n // Base level has no shadow\n if (level === 0) {\n return {}\n }\n\n // Calculate the actual elevated surface color\n const elevatedSurfaceColor = calculateElevationSurface(baseColor, level, theme)\n\n // Rim light: calculated from BASE color (consistent across all elevations)\n // This represents a consistent light source - only size changes with elevation\n const rimLightColor = calculateRimLightColor(baseColor, level)\n\n // Dark shadow: calculated from ELEVATED surface color\n // The shadow is cast by the element, so it should match the surface\n const darkShadowColors = calculateDarkShadowColors(elevatedSurfaceColor)\n\n // Get shadow intensity config (for dark shadow)\n const intensityConfig = {\n subtle: { offset: 1, blur: 2 },\n medium: { offset: 2, blur: 4 },\n strong: { offset: 2, blur: 5 },\n }\n\n const { offset, blur } = intensityConfig[config.shadowIntensity]\n\n // Get rim light config (scales with elevation level)\n const rimConfig = getRimLightConfig()\n\n if (config.shadowStyle === 'pressed') {\n // Inset shadow (pressed elements)\n if (isHovered) {\n // Reduce shadow depth for hover\n const hoverOffset = Math.max(1, Math.round(offset / 2))\n const hoverBlur = Math.max(1, Math.round(blur / 2))\n return Platform.select({\n web: {\n boxShadow: `inset ${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${darkShadowColors.darker}, inset -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`,\n } as any,\n default: {\n shadowOpacity: 0,\n elevation: 0,\n },\n }) as ViewStyle\n }\n\n return Platform.select({\n web: {\n boxShadow: `inset ${offset}px ${offset}px ${blur}px ${darkShadowColors.darker}, inset -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`,\n } as any,\n default: {\n shadowOpacity: 0,\n elevation: 0,\n },\n }) as ViewStyle\n } else {\n // Raised shadow (floating elements)\n if (isHovered) {\n // Reduce shadow depth for hover\n const hoverOffset = Math.max(1, Math.round(offset / 2))\n const hoverBlur = Math.max(1, Math.round(blur / 2))\n return Platform.select({\n web: {\n boxShadow: `${hoverOffset}px ${hoverOffset}px ${hoverBlur}px ${darkShadowColors.dark}, -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`,\n } as any,\n default: {\n shadowColor: '#000',\n shadowOffset: { width: hoverOffset, height: hoverOffset },\n shadowOpacity: 0.2,\n shadowRadius: hoverBlur / 2,\n elevation: hoverOffset,\n },\n }) as ViewStyle\n }\n\n return Platform.select({\n web: {\n boxShadow: `${offset}px ${offset}px ${blur}px ${darkShadowColors.dark}, -${rimConfig.offset}px -${rimConfig.offset}px ${rimConfig.blur}px ${rimLightColor}`,\n } as any,\n default: {\n shadowColor: '#000',\n shadowOffset: { width: offset, height: offset },\n shadowOpacity: 0.3,\n shadowRadius: blur / 2,\n elevation: offset,\n },\n }) as ViewStyle\n }\n}\n\n/**\n * Get shadow style for an elevation level, calculated dynamically from surface color.\n * Results are cached to avoid redundant calculations.\n *\n * @param baseColor - Base surface color (hex)\n * @param level - Elevation level\n * @param theme - Current theme ('light' or 'dark')\n * @param isHovered - Whether element is hovered\n * @returns ViewStyle with shadow properties\n */\n/**\n * The lowest elevation that still casts an outward shadow.\n *\n * On a near-black surface a drop-shadow is inert: at levels 1-3 the shadow is\n * dark-on-dark and contributes nothing a viewer can see, while still costing a\n * composite layer. Material dropped shadow-as-hierarchy for the same reason.\n * Inline hierarchy is the hairline's job (`hairline-*`), which composites by a\n * constant amount over any plane.\n *\n * At 4+ the element is genuinely FLOATING over a backdrop — menu, popover,\n * toast — where a large soft shadow describes separation from the page rather\n * than a rank in a stack. Those should also carry a hairline ring.\n */\nexport const FLOATING_ELEVATION_MIN: ElevationLevel = 4\n\nexport function getElevationShadow(\n baseColor: string,\n level: ElevationLevel,\n theme: 'light' | 'dark',\n isHovered: boolean = false\n): ViewStyle {\n const cacheKey = getShadowCacheKey(baseColor, level, theme, isHovered)\n\n // Check cache\n if (elevationShadowCache.has(cacheKey)) {\n return elevationShadowCache.get(cacheKey)!\n }\n\n // Calculate shadow. Outward drop-shadow is gated to FLOATING levels only —\n // see FLOATING_ELEVATION_MIN. Inset levels keep theirs; a recess reads from\n // the inner shadow, which is a different mechanism from a cast shadow.\n const result =\n level > 0 && level < FLOATING_ELEVATION_MIN\n ? {}\n : calculateElevationShadow(baseColor, level, theme, isHovered)\n\n // Cache result\n if (elevationShadowCache.size >= MAX_SHADOW_CACHE_SIZE) {\n const firstKey = elevationShadowCache.keys().next().value!\n elevationShadowCache.delete(firstKey)\n }\n elevationShadowCache.set(cacheKey, result)\n\n return result\n}\n\n/**\n * Elevation level backing a `<Surface pressed>` recess: the shallow `inset`\n * (-1) step. Pressed exposes ONE level of depth — pressed-2 is intentionally\n * not surfaced (the deeper `-2` deep-inset stays available to `elevation`).\n */\nexport const PRESSED_ELEVATION_LEVEL: ElevationLevel = -1\n\n/**\n * Inner-shadow recess for a pressed (sunken) surface, tuned to the well's own\n * fill colour so the rim/shadow tints track the darker fill. Composes WITH the\n * darker pressed fill: on web it adds an inset boxShadow; on the native path\n * (no inset-shadow support) it's a no-op and the recess reads via the fill\n * alone — so a pressed surface stays legibly sunken with or without the shadow.\n *\n * @param fillColor - The pressed surface's own fill (one ramp step down).\n * @param theme - Current theme ('light' or 'dark').\n */\nexport function getPressedRecessShadow(fillColor: string, theme: 'light' | 'dark'): ViewStyle {\n return getElevationShadow(fillColor, PRESSED_ELEVATION_LEVEL, theme)\n}\n\n/**\n * Get base surface color from theme.\n * This is the foundation color that all elevations are calculated from.\n *\n * IMPORTANT: Base colors must be chosen to allow sufficient lightening.\n *\n * **Light Mode**: Cannot use `#FFFFFF` (white) - cannot lighten white!\n * - Use `#F3F4F6` (neutral[100]) - can lighten to `#FAFAFA` → `#FFFFFF`\n * - This allows raised elevations to be lighter (closer to white)\n *\n * **Dark Mode**: Need lighter base to allow sufficient lightening\n * - Use `surface-elevated` (#2A2827, TD-surface-tokens ramp) - allows further lightening\n *\n * Can be overridden to use custom base colors for special cases.\n */\nexport function getBaseSurfaceColor(theme: 'light' | 'dark'): string {\n // Use semantic token values so elevation colors stay in sync with the token pipeline.\n // Light mode: surface-raised (#F3F4F6 / neutral[100]) - NOT white, so we can lighten it\n // Dark mode: surface-elevated (#2A2827, TD-surface-tokens ramp) - allows sufficient lightening\n\n return theme === 'light'\n ? semanticColorsLight['surface-raised']\n : semanticColorsDark['surface-elevated']\n}\n\n/**\n * Component-specific elevation ranges\n * Defines which elevation levels each component type can use\n */\nexport const componentElevationRanges = {\n button: {\n allowed: [2] as const,\n default: 2 as const,\n hover: 3 as const,\n },\n card: {\n allowed: [1, 2, 3] as const,\n default: 2 as const,\n hover: 3 as const,\n },\n input: {\n allowed: [-2, -1, 0] as const,\n default: -1 as const,\n },\n overlay: {\n allowed: [4, 5] as const,\n default: 4 as const,\n },\n} as const\n\nexport type ComponentType = keyof typeof componentElevationRanges\n\n/**\n * Validate and clamp elevation to component's allowed range\n */\nexport function getValidatedElevation(\n component: ComponentType,\n requested: ElevationLevel\n): ElevationLevel {\n const range = componentElevationRanges[component]\n if ((range.allowed as readonly ElevationLevel[]).includes(requested)) {\n return requested\n }\n // Clamp to nearest allowed elevation\n const sorted = [...range.allowed].sort((a, b) => a - b)\n if (requested < sorted[0]) return sorted[0]\n if (requested > sorted[sorted.length - 1]) return sorted[sorted.length - 1]\n // Find closest\n return sorted.reduce((prev, curr) =>\n Math.abs(curr - requested) < Math.abs(prev - requested) ? curr : prev\n ) as ElevationLevel\n}\n\n// =============================================================================\n// Glow Shadow Support\n// =============================================================================\n\nexport type GlowIntensity = 'subtle' | 'medium' | 'strong'\n\nconst glowConfig: Record<GlowIntensity, { blur: number; spread: number; opacity: number }> = {\n subtle: { blur: 12, spread: 0, opacity: 0.25 },\n medium: { blur: 20, spread: 2, opacity: 0.4 },\n strong: { blur: 30, spread: 4, opacity: 0.55 },\n}\n\n/**\n * Get a glow shadow style for emphasis/active states.\n *\n * Creates a colored radial glow around an element, useful for:\n * - Active recording indicators (orange glow)\n * - Success states (green glow)\n * - Error/danger indicators (red glow)\n * - Focus rings and attention-drawing elements\n *\n * @param color - Glow color (hex string, e.g. '#FF7900')\n * @param intensity - Glow intensity level\n * @returns ViewStyle with platform-specific shadow properties\n */\nexport function getGlowShadow(color: string, intensity: GlowIntensity = 'medium'): ViewStyle {\n const config = glowConfig[intensity]\n const rgb = hexToRgb(color)\n if (!rgb) return {}\n\n return Platform.select({\n web: {\n boxShadow: `0 0 ${config.blur}px ${config.spread}px rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${config.opacity})`,\n } as any,\n default: {\n shadowColor: color,\n shadowOffset: { width: 0, height: 0 },\n shadowOpacity: config.opacity,\n shadowRadius: config.blur / 2,\n elevation: 0,\n },\n }) as ViewStyle\n}\n","import type { CssPropertyManifest, VariantAxes } from './css-property-manifest.types'\n\n/** Result of validating a candidate manifest: valid iff errors is empty. */\nexport interface ManifestValidationResult {\n valid: boolean\n errors: string[]\n}\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value)\n\nconst isVariantAxes = (value: unknown): value is VariantAxes =>\n isPlainObject(value) &&\n Object.keys(value).length > 0 &&\n Object.values(value).every((axisValue) => typeof axisValue === 'string')\n\nfunction collectVariantOverrideErrors(override: unknown, path: string): string[] {\n if (!isPlainObject(override)) return [`${path} must be an object`]\n const errors: string[] = []\n if (!isVariantAxes(override.variant))\n errors.push(`${path}.variant must be a non-empty string-keyed object`)\n if (\n override.token !== undefined &&\n override.token !== null &&\n typeof override.token !== 'string'\n ) {\n errors.push(`${path}.token must be a string or null`)\n }\n if (typeof override.resolvedValue !== 'string' || override.resolvedValue.length === 0) {\n errors.push(`${path}.resolvedValue must be a non-empty string`)\n }\n return errors\n}\n\nfunction collectPropertyErrors(entry: unknown, path: string): string[] {\n if (!isPlainObject(entry)) return [`${path} must be an object`]\n const errors: string[] = []\n if (typeof entry.property !== 'string' || entry.property.length === 0) {\n errors.push(`${path}.property must be a non-empty string`)\n }\n if (entry.token !== null && typeof entry.token !== 'string') {\n errors.push(`${path}.token must be a string or null`)\n }\n if (typeof entry.resolvedValue !== 'string' || entry.resolvedValue.length === 0) {\n errors.push(`${path}.resolvedValue must be a non-empty string`)\n }\n if (entry.variantOverrides !== undefined) {\n if (!Array.isArray(entry.variantOverrides)) {\n errors.push(`${path}.variantOverrides must be an array`)\n } else {\n entry.variantOverrides.forEach((override, i) =>\n errors.push(...collectVariantOverrideErrors(override, `${path}.variantOverrides[${i}]`))\n )\n }\n }\n return errors\n}\n\n/** Structurally validates a candidate value against the CssPropertyManifest shape. */\nexport function validateCssPropertyManifest(candidate: unknown): ManifestValidationResult {\n if (!isPlainObject(candidate)) return { valid: false, errors: ['manifest must be an object'] }\n\n const errors: string[] = []\n if (typeof candidate.component !== 'string' || candidate.component.length === 0) {\n errors.push('component must be a non-empty string')\n }\n if (candidate.baseVariant !== undefined && !isVariantAxes(candidate.baseVariant)) {\n errors.push('baseVariant must be a non-empty string-keyed object')\n }\n if (!Array.isArray(candidate.properties) || candidate.properties.length === 0) {\n errors.push('properties must be a non-empty array')\n } else {\n candidate.properties.forEach((entry, i) =>\n errors.push(...collectPropertyErrors(entry, `properties[${i}]`))\n )\n }\n\n return { valid: errors.length === 0, errors }\n}\n\n/** Type guard variant of validateCssPropertyManifest for use in narrowing contexts. */\nexport function isCssPropertyManifest(candidate: unknown): candidate is CssPropertyManifest {\n return validateCssPropertyManifest(candidate).valid\n}\n","import { Platform } from 'react-native'\nimport { getSemanticColors, type ThemeMode } from './tokens/semantic'\n\ntype ColorToken = keyof ReturnType<typeof getSemanticColors>\n\n/**\n * Resolve a semantic color token for an inline style where a nativewind\n * className can't apply — gradients (`backgroundImage`), per-edge borders\n * (`borderTopColor`, …), SVG attributes, and conditional hex/token mixes.\n *\n * The companion to className color tokens: on **web** it returns the CSS\n * variable (`var(--color-…)`), so the dashboard's light/dark switching keeps\n * working exactly as `global.css` intends; on **native** it returns the\n * resolved hex from `getSemanticColors` (mobile is dark-only). This is why\n * these spots stay theme-correct on web while also rendering on-device.\n */\nexport function resolveColor(token: ColorToken, mode: ThemeMode = 'dark'): string {\n return Platform.OS === 'web' ? `var(--color-${token})` : getSemanticColors(mode)[token]\n}\n","import { resolveColor } from './resolve-color'\nimport { getSemanticColors, type ThemeMode } from './tokens/semantic'\n\ntype ColorToken = keyof ReturnType<typeof getSemanticColors>\n\n/** A `backgroundImage` style — web-only (RN ignores it); type it loosely for RN style arrays. */\nexport type GradientStyle = { backgroundImage: string }\n\n/**\n * A linear-gradient `backgroundImage` built from two semantic color tokens.\n *\n * Themeable + native-safe via {@link resolveColor}: on web the stops are CSS\n * variables (light/dark switching keeps working); on native it resolves to hex.\n * `backgroundImage` is a **web-only** paint, so pair this with a solid\n * `bg-*` className fallback for native (see the shell TopBar).\n */\nexport function linearGradient(\n from: ColorToken,\n to: ColorToken,\n angle = 180,\n mode: ThemeMode = 'dark'\n): GradientStyle {\n return {\n backgroundImage: `linear-gradient(${angle}deg, ${resolveColor(from, mode)}, ${resolveColor(to, mode)})`,\n }\n}\n\n/**\n * Named surface gradients — the shared substrate for gradient fills. Replaces\n * per-component inline `linear-gradient` strings.\n */\nexport const surfaceGradient = {\n /** Chrome bands (top bar, headers): elevated → base, a subtle dark wash. */\n chrome: (mode: ThemeMode = 'dark'): GradientStyle =>\n linearGradient('surface-elevated', 'background-base', 180, mode),\n}\n","import type { ThemePreset } from './types'\n\nfunction colorKeyToVar(key: string): string {\n return `--color-${key}`\n}\n\nfunction applyColorOverrides(colors: Record<string, string | undefined>, root: HTMLElement) {\n for (const [key, value] of Object.entries(colors)) {\n if (value !== undefined) {\n root.style.setProperty(colorKeyToVar(key), value)\n }\n }\n}\n\nfunction applyFontOverrides(fonts: Record<string, string | undefined>, root: HTMLElement) {\n const fontVarMap: Record<string, string> = {\n sans: '--font-family-sans',\n body: '--font-family-body',\n heading: '--font-family-heading',\n mono: '--font-family-mono',\n }\n for (const [key, value] of Object.entries(fonts)) {\n if (value !== undefined && fontVarMap[key]) {\n root.style.setProperty(fontVarMap[key], value)\n }\n }\n}\n\nfunction injectFontImport(url: string) {\n if (typeof document === 'undefined') return\n const existing = document.querySelector(`link[href=\"${url}\"]`)\n if (existing) return\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = url\n document.head.appendChild(link)\n}\n\nexport function applyThemePreset(preset: ThemePreset): () => void {\n if (typeof document === 'undefined') {\n return () => {}\n }\n\n const root = document.documentElement\n const removals: (() => void)[] = []\n\n // Inject font import if specified\n if (preset.fontImport) {\n injectFontImport(preset.fontImport)\n }\n\n // Determine current theme mode\n const isLight = root.classList.contains('light')\n const modeColors = isLight ? preset.colors?.light : preset.colors?.dark\n\n // Apply color overrides\n if (modeColors) {\n const previousValues: Record<string, string | null> = {}\n for (const key of Object.keys(modeColors)) {\n previousValues[colorKeyToVar(key)] = root.style.getPropertyValue(colorKeyToVar(key)) || null\n }\n applyColorOverrides(modeColors, root)\n removals.push(() => {\n for (const [varName, prev] of Object.entries(previousValues)) {\n if (prev === null) {\n root.style.removeProperty(varName)\n } else {\n root.style.setProperty(varName, prev)\n }\n }\n })\n }\n\n // Apply font overrides\n if (preset.fonts) {\n applyFontOverrides(preset.fonts as Record<string, string | undefined>, root)\n }\n\n // Apply root classes\n if (preset.rootClasses) {\n for (const cls of preset.rootClasses) {\n root.classList.add(cls)\n }\n removals.push(() => {\n for (const cls of preset.rootClasses!) {\n root.classList.remove(cls)\n }\n })\n }\n\n // Return cleanup function\n return () => {\n for (const remove of removals) {\n remove()\n }\n }\n}\n","import type { ThemePreset } from './types'\n\nexport const defaultPreset: ThemePreset = {\n name: 'default',\n description: 'Titan Design System default theme — orange accent, steel secondary',\n}\n","import type { ThemePreset } from './types'\n\n/**\n * Audiobook Studio preset.\n *\n * Warm copper/patina aesthetic inspired by vintage audio equipment\n * and reading lounges. Dark-mode only design with editorial typography.\n */\nexport const audiobookPreset: ThemePreset = {\n name: 'audiobook',\n description: 'Warm copper/patina theme with editorial typography',\n fontImport:\n \"https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,600;0,700;1,400&family=Outfit:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap\",\n fonts: {\n sans: \"'Outfit', 'Avenir', 'Avenir Next', system-ui, sans-serif\",\n body: \"'Outfit', 'Avenir', 'Avenir Next', system-ui, sans-serif\",\n heading: \"'Newsreader', 'Libre Baskerville', Georgia, serif\",\n mono: \"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace\",\n },\n colors: {\n dark: {\n // Brand: Copper accent\n 'brand-primary': '#d4782a',\n 'brand-primary-light': '#e8944a',\n 'brand-primary-dark': '#9a4a15',\n 'brand-primary-subtle': 'rgba(212, 120, 42, 0.12)',\n 'brand-primary-hover': '#e8944a',\n 'brand-primary-active': '#f5b070',\n\n // Brand secondary: Patina/verdigris\n 'brand-secondary': '#3a9b8a',\n 'brand-secondary-light': '#55baa7',\n 'brand-secondary-dark': '#1f5c52',\n 'brand-secondary-subtle': 'rgba(58, 155, 138, 0.12)',\n 'brand-secondary-hover': '#55baa7',\n 'brand-secondary-active': '#7ed4c4',\n\n 'on-brand-primary': '#FFFFFF',\n 'on-brand-secondary': '#FFFFFF',\n\n // Status colors (audiobook's warmer status palette)\n 'status-success': '#5fb870',\n 'status-error': '#d85c4a',\n 'status-warning': '#d4a43a',\n 'status-info': '#5a8fd4',\n\n // Text: warm off-whites\n 'text-primary': '#f4f3f1',\n 'text-secondary': '#b5b3af',\n 'text-tertiary': '#7a7875',\n\n // Surfaces: warm greys (not pure gray)\n 'surface-base': '#101114',\n 'surface-elevated': '#15171c',\n 'surface-raised': '#1a1d24',\n 'surface-overlay': '#15171c',\n 'surface-input': '#15171c',\n\n // Backgrounds\n 'background-base': '#0a0b0d',\n 'background-default': '#101114',\n 'background-subtle': '#1a1d24',\n\n // Borders\n 'hairline-default': 'rgba(255, 255, 255, 0.06)',\n 'hairline-subtle': 'rgba(255, 255, 255, 0.03)',\n 'hairline-strong': '#2d323d',\n 'border-focus': '#d4782a',\n 'border-input': '#2d323d',\n 'border-input-hover': '#454c5c',\n 'border-input-focus': '#d4782a',\n 'border-input-error': '#d85c4a',\n\n // Interactive\n 'interactive-hover': 'rgba(255, 255, 255, 0.04)',\n 'interactive-focus': 'rgba(255, 255, 255, 0.12)',\n 'interactive-active': 'rgba(255, 255, 255, 0.16)',\n 'interactive-selected': 'rgba(255, 255, 255, 0.08)',\n\n 'divider': 'rgba(255, 255, 255, 0.06)',\n\n // Glow RGB values for shadow utilities\n 'brand-primary-rgb': '212, 120, 42',\n 'brand-secondary-rgb': '58, 155, 138',\n 'status-success-rgb': '95, 184, 112',\n 'status-error-rgb': '216, 92, 74',\n 'status-warning-rgb': '212, 164, 58',\n 'status-info-rgb': '90, 143, 212',\n 'background-base-rgb': '10, 11, 13',\n },\n },\n rootClasses: ['atmosphere-warm', 'grain'],\n}\n","// On-surface colour context (TD-05.12).\n//\n// A <Surface> owns a background from a small elevation scale AND publishes the\n// current theme mode so descendant text/icons resolve their colour from \"what\n// surface am I on\" instead of a `text-*` className. Those classNames silently\n// fail to black when the tree renders as raw RN in the standalone wall SPA\n// (no global.css, no nativewind) — the bug class this primitive retires.\nimport { createContext, useContext } from 'react'\nimport { getSemanticColors, type ThemeMode } from '../../../theme/tokens/semantic'\n\ntype ColorToken = keyof ReturnType<typeof getSemanticColors>\n\n/**\n * A Surface's depth on the dark surface ramp. Each addressable level maps to an\n * EXISTING semantic surface/background token (already grounded in the derived\n * surface ramp — TD-surface-tokens S-1 — and theme-aware) — Surface introduces\n * no new hexes. Darkest → lightest:\n * inset (#13100D) < background (#1C1916) < base (#252321) < elevated (#2A2827) < raised (#2D2C2B) < overlay (#302F2E)\n *\n * `frame` is the bezel the ramp sits inside — the top bar / side nav chrome —\n * and the floor a `<Surface pressed>` clamps at (see {@link pressedLevel}).\n *\n * It replaced a separate `inset` level in TD-07.14. That level was RETIRED, not\n * renamed: at ΔE 1.10 from the frame it was an imperceptible duplicate, which is\n * exactly why pressed (surface − 1) kept collapsing into it.\n */\nexport type SurfaceLevel = 'frame' | 'background' | 'base' | 'elevated' | 'raised' | 'overlay'\n\n/** On-surface neutral text roles, resolved for the current surface + theme. */\nexport type OnSurfaceRole = 'primary' | 'secondary' | 'tertiary'\n\n// Which semantic token backs each level. Values live in `semantic.ts` and stay\n// in sync with the grey ramp — this map never carries literal hexes. Every level\n// is present now: swapping `inset` (which had no token) for `frame` (which does)\n// is what made this a total map and removed `surfaceBackground`'s special case.\nexport const SURFACE_LEVEL_TOKEN = {\n frame: 'background-frame',\n background: 'background-base',\n base: 'surface-base',\n elevated: 'surface-elevated',\n raised: 'surface-raised',\n overlay: 'surface-overlay',\n} as const satisfies Record<SurfaceLevel, ColorToken>\n\n// Darkest → lightest. A `<Surface pressed>` renders one index DOWN from its\n// parent's level and clamps at `frame` (index 0). Kept in lockstep with the grey\n// ramp and the surface.contract.test PLANE_ORDER.\nconst PRESSED_RAMP = ['frame', 'background', 'base', 'elevated', 'raised', 'overlay'] as const\n\nconst ON_SURFACE_TOKEN = {\n primary: 'text-primary',\n secondary: 'text-secondary',\n tertiary: 'text-tertiary',\n} as const satisfies Record<OnSurfaceRole, ColorToken>\n\nexport interface SurfaceContextValue {\n /** Active theme mode. Defaults to dark (the wall). */\n mode: ThemeMode\n /** Depth of the nearest enclosing Surface. */\n level: SurfaceLevel\n}\n\n// Default context: dark 'base' plane, so descendants OUTSIDE any Surface still\n// resolve to real dark colours (never black) on the dark-only wall.\nconst DEFAULT_CONTEXT: SurfaceContextValue = { mode: 'dark', level: 'base' }\n\nexport const SurfaceContext = createContext<SurfaceContextValue>(DEFAULT_CONTEXT)\n\n/** The nearest surface context ({ mode, level }); default dark 'base'. */\nexport function useSurface(): SurfaceContextValue {\n return useContext(SurfaceContext)\n}\n\n/** The active theme mode from the nearest Surface/provider (default dark). */\nexport function useSurfaceMode(): ThemeMode {\n return useContext(SurfaceContext).mode\n}\n\n/**\n * Literal-hex on-surface neutral text colours for a theme mode. Uses\n * `getSemanticColors` (literal hex — the TempoBar pattern), never `resolveColor`\n * (which returns `var()` under the RNW vitest alias), so values stay real in\n * tested component code and on raw-RN surfaces alike.\n */\nexport function onSurfaceColors(mode: ThemeMode): Record<OnSurfaceRole, string> {\n const c = getSemanticColors(mode)\n return {\n primary: c[ON_SURFACE_TOKEN.primary],\n secondary: c[ON_SURFACE_TOKEN.secondary],\n tertiary: c[ON_SURFACE_TOKEN.tertiary],\n }\n}\n\n/** Resolve one on-surface text colour for descendants of a Surface. */\nexport function useOnSurfaceColor(role: OnSurfaceRole = 'primary'): string {\n return getSemanticColors(useSurfaceMode())[ON_SURFACE_TOKEN[role]]\n}\n\n/** The background hex for a surface level under a theme mode (literal hex). */\nexport function surfaceBackground(level: SurfaceLevel, mode: ThemeMode): string {\n return getSemanticColors(mode)[SURFACE_LEVEL_TOKEN[level]]\n}\n\n/**\n * The level a `<Surface pressed>` resolves to: its parent's level stepped one\n * index DOWN the ramp — the symmetric twin of a raised surface stepping up —\n * clamped at the `frame` floor so a pressed surface never underflows the bezel.\n * overlay→raised, raised→elevated, elevated→base, base→background,\n * background→frame, frame→frame (clamped).\n * Pressed exposes ONE level of depth only (no pressed-2).\n */\nexport function pressedLevel(parent: SurfaceLevel): SurfaceLevel {\n const index = PRESSED_RAMP.indexOf(parent)\n const down = Math.max(0, index - 1)\n return PRESSED_RAMP[down]\n}\n","/**\n * Custom JSX runtime for titan-design's web distribution.\n *\n * Converts className props to $$css style objects at build time,\n * eliminating the need for NativeWind's runtime interopComponents\n * Map lookup. RNW's styleq recognizes $$css objects and applies\n * their values as CSS class names on DOM elements.\n *\n * This file is NOT used by source builds (specimen, storybook,\n * native Metro). It is only inlined into the dist by tsup via\n * an esbuild onResolve plugin.\n */\nimport {\n jsx as reactJsx,\n jsxs as reactJsxs,\n Fragment,\n} from 'react/jsx-runtime'\nimport type { StyleProp } from 'react-native'\n\ntype JsxFn = typeof reactJsx\n\nfunction wrapJsx(fn: JsxFn): JsxFn {\n return function (type, props: Record<string, any>, ...rest) {\n if (props && typeof props.className === 'string' && props.className) {\n const cn = props.className\n const cssStyle = { $$css: true, [cn]: cn } as unknown as StyleProp<any>\n const existing = props.style\n props = {\n ...props,\n style: existing ? [cssStyle, existing] : cssStyle,\n }\n delete props.className\n }\n return fn(type, props, ...rest)\n } as JsxFn\n}\n\nconst jsx = wrapJsx(reactJsx)\nconst jsxs = wrapJsx(reactJsxs)\n\nexport { jsx, jsxs, Fragment }\n","// Cross-platform theme provider (TD native-theming).\n//\n// Registers titan's semantic color tokens as runtime CSS variables via\n// nativewind's `vars()` so that className color tokens (`text-text-secondary`,\n// `bg-surface-raised`, `border-hairline`, …) resolve on NATIVE React Native — the\n// native equivalent of the `:root {}` block `global.css` provides on web.\n//\n// Why this exists: titan's Workout organisms reference semantic colors as CSS\n// variables. On web (the dashboard, react-native-web) those come from\n// `global.css`. On native (the mobile app) nothing defined them, so any titan\n// component using a `--color-*` token rendered with an unresolved (black) color.\n// Wrap the mobile app root in `<ThemeProvider>` and the tokens resolve on-device.\n//\n// The var maps are the SAME canonical `darkThemeCSSVars` / `lightThemeCSSVars`\n// that generate `global.css`, so native and web resolve to identical values.\n//\n// It also seeds the on-surface colour context (`<Surface>`'s mode), so titan's\n// JS-resolved on-surface colours track the same theme as the className tokens.\nimport { vars, useColorScheme } from 'nativewind'\nimport { View, type ViewProps } from 'react-native'\nimport { SurfaceContext } from '../components/ui/surface/SurfaceContext'\nimport { darkThemeCSSVars, lightThemeCSSVars } from './config'\n\n/** `'system'` follows nativewind's `useColorScheme()` (mobile light/dark flip). */\nexport type ThemeProviderMode = 'dark' | 'light' | 'system'\n\n// Precomputed once — `vars()` is pure, so the same style object is reused across\n// renders. Native == web because these are the maps `tokens-css` emits.\nconst MODE_VARS = {\n dark: vars(darkThemeCSSVars),\n light: vars(lightThemeCSSVars),\n}\n\nexport interface ThemeProviderProps extends ViewProps {\n /**\n * Theme mode to register. `'system'` bridges nativewind's `useColorScheme()`\n * so mobile follows the OS light/dark flip; `'dark'`/`'light'` pin it. Mobile\n * is dark-only today, so this defaults to `dark`.\n */\n mode?: ThemeProviderMode\n}\n\n/**\n * Wrap the app root so descendant titan components' `--color-*` className tokens\n * resolve on native. Fills its parent (`flex: 1`) by default; pass `style` to\n * override. On web it is harmless (the dashboard already loads `global.css`).\n */\nexport function ThemeProvider({\n mode = 'dark',\n style,\n children,\n ...props\n}: ThemeProviderProps): React.JSX.Element {\n // `'system'` → follow nativewind's applied scheme, falling back to dark when\n // no scheme is set. `useColorScheme` runs unconditionally (rules of hooks);\n // its result is only used in the `'system'` branch.\n const { colorScheme } = useColorScheme()\n const resolved = mode === 'system' ? (colorScheme ?? 'dark') : mode\n\n return (\n <SurfaceContext.Provider value={{ mode: resolved, level: 'base' }}>\n <View style={[MODE_VARS[resolved], { flex: 1 }, style]} {...props}>\n {children}\n </View>\n </SurfaceContext.Provider>\n )\n}\n"]}
|