@titan-design/react-ui 0.12.1 → 0.14.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/README.md +60 -47
- package/dist/bodymap.js +856 -736
- package/dist/bodymap.js.map +1 -1
- package/dist/bodymap.mjs +858 -738
- package/dist/bodymap.mjs.map +1 -1
- package/dist/index.d.mts +1431 -237
- package/dist/index.d.ts +1431 -237
- package/dist/index.js +6506 -4781
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6280 -4642
- package/dist/index.mjs.map +1 -1
- package/dist/{pages-B1hqnGIC.d.ts → pages-CsjsUn0G.d.ts} +51 -16
- package/dist/{pages-CvsFqNtx.d.mts → pages-ZbT_pD_U.d.mts} +51 -16
- package/dist/pages.d.mts +1 -1
- package/dist/pages.d.ts +1 -1
- package/dist/pages.js +1919 -1937
- package/dist/pages.js.map +1 -1
- package/dist/pages.mjs +1927 -1945
- package/dist/pages.mjs.map +1 -1
- package/dist/theme/index.d.mts +225 -140
- package/dist/theme/index.d.ts +225 -140
- package/dist/theme/index.js +298 -319
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +283 -315
- package/dist/theme/index.mjs.map +1 -1
- package/dist/theme/tokens-css.js +145 -24
- package/dist/theme/tokens-css.js.map +1 -1
- package/dist/theme/tokens-css.mjs +145 -24
- package/dist/theme/tokens-css.mjs.map +1 -1
- package/dist/theme/tokens.d.mts +128 -11
- package/dist/theme/tokens.d.ts +128 -11
- package/dist/theme/tokens.js +126 -26
- package/dist/theme/tokens.js.map +1 -1
- package/dist/theme/tokens.mjs +124 -27
- package/dist/theme/tokens.mjs.map +1 -1
- package/docs/audits/2026-09-08-critique-addenda.md +51 -0
- package/docs/audits/2026-09-08-library-critique.md +212 -0
- package/docs/library-roadmap.md +99 -0
- package/docs/render-testing-pattern.md +130 -0
- package/package.json +1 -1
- package/src/arch/Architecture.stories.tsx +3 -1
- package/src/arch/arch-graph.freshness.test.ts +52 -0
- package/src/arch/arch-graph.json +4989 -1583
- package/src/components/custom/ActiveWork/CoChangeChip.stories.tsx +44 -0
- package/src/components/custom/ActiveWork/CoChangeChip.test.tsx +29 -0
- package/src/components/custom/ActiveWork/CoChangeChip.tsx +48 -0
- package/src/components/custom/ActiveWork/Eyebrow.stories.tsx +25 -0
- package/src/components/custom/ActiveWork/Eyebrow.test.tsx +16 -0
- package/src/components/custom/ActiveWork/Eyebrow.tsx +26 -0
- package/src/components/custom/ActiveWork/FileActivityDetail.stories.tsx +50 -0
- package/src/components/custom/ActiveWork/FileActivityDetail.test.tsx +66 -0
- package/src/components/custom/ActiveWork/FileActivityDetail.tsx +202 -0
- package/src/components/custom/ActiveWork/FileActivityRow.stories.tsx +70 -0
- package/src/components/custom/ActiveWork/FileActivityRow.test.tsx +67 -0
- package/src/components/custom/ActiveWork/FileActivityRow.tsx +130 -0
- package/src/components/custom/ActiveWork/FileHistoryExplorer.stories.tsx +84 -0
- package/src/components/custom/ActiveWork/FileHistoryExplorer.test.tsx +99 -0
- package/src/components/custom/ActiveWork/FileHistoryExplorer.tsx +138 -0
- package/src/components/custom/ActiveWork/FilePathLabel.stories.tsx +39 -0
- package/src/components/custom/ActiveWork/FilePathLabel.test.tsx +53 -0
- package/src/components/custom/ActiveWork/FilePathLabel.tsx +63 -0
- package/src/components/custom/ActiveWork/InitiativeBrief.stories.tsx +50 -0
- package/src/components/custom/ActiveWork/InitiativeBrief.test.tsx +62 -0
- package/src/components/custom/ActiveWork/InitiativeBrief.tsx +182 -0
- package/src/components/custom/ActiveWork/InitiativeCard.stories.tsx +73 -0
- package/src/components/custom/ActiveWork/InitiativeCard.test.tsx +68 -0
- package/src/components/custom/ActiveWork/InitiativeCard.tsx +136 -0
- package/src/components/custom/ActiveWork/InitiativeHeader.stories.tsx +59 -0
- package/src/components/custom/ActiveWork/InitiativeHeader.test.tsx +40 -0
- package/src/components/custom/ActiveWork/InitiativeHeader.tsx +73 -0
- package/src/components/custom/ActiveWork/InitiativeReader.stories.tsx +145 -0
- package/src/components/custom/ActiveWork/OpenLoops.stories.tsx +58 -0
- package/src/components/custom/ActiveWork/OpenLoops.test.tsx +61 -0
- package/src/components/custom/ActiveWork/OpenLoops.tsx +107 -0
- package/src/components/custom/ActiveWork/PortfolioOverview.stories.tsx +101 -0
- package/src/components/custom/ActiveWork/PortfolioOverview.test.tsx +81 -0
- package/src/components/custom/ActiveWork/PortfolioOverview.tsx +83 -0
- package/src/components/custom/ActiveWork/README.md +305 -0
- package/src/components/custom/ActiveWork/SessionDetail.stories.tsx +71 -0
- package/src/components/custom/ActiveWork/SessionDetail.test.tsx +84 -0
- package/src/components/custom/ActiveWork/SessionDetail.tsx +180 -0
- package/src/components/custom/ActiveWork/SessionList.stories.tsx +69 -0
- package/src/components/custom/ActiveWork/SessionList.test.tsx +78 -0
- package/src/components/custom/ActiveWork/SessionList.tsx +103 -0
- package/src/components/custom/ActiveWork/SessionListItem.stories.tsx +64 -0
- package/src/components/custom/ActiveWork/SessionListItem.test.tsx +62 -0
- package/src/components/custom/ActiveWork/SessionListItem.tsx +152 -0
- package/src/components/custom/ActiveWork/SessionReader.stories.tsx +113 -0
- package/src/components/custom/ActiveWork/SeverityLabel.stories.tsx +51 -0
- package/src/components/custom/ActiveWork/SeverityLabel.test.tsx +68 -0
- package/src/components/custom/ActiveWork/SeverityLabel.tsx +97 -0
- package/src/components/custom/ActiveWork/TaskRow.stories.tsx +63 -0
- package/src/components/custom/ActiveWork/TaskRow.test.tsx +112 -0
- package/src/components/custom/ActiveWork/TaskRow.tsx +176 -0
- package/src/components/custom/ActiveWork/TaskTable.stories.tsx +123 -0
- package/src/components/custom/ActiveWork/TaskTable.test.tsx +233 -0
- package/src/components/custom/ActiveWork/TaskTable.tsx +321 -0
- package/src/components/custom/ActiveWork/active-work-depth.test.tsx +102 -0
- package/src/components/custom/ActiveWork/file-history-fixture.ts +91 -0
- package/src/components/custom/ActiveWork/format-time.test.ts +23 -0
- package/src/components/custom/ActiveWork/format-time.ts +32 -0
- package/src/components/custom/ActiveWork/index.ts +19 -0
- package/src/components/custom/ActiveWork/initiative-fixture.ts +104 -0
- package/src/components/custom/ActiveWork/session-fixture.ts +267 -0
- package/src/components/custom/ActiveWork/session-linkers.ts +56 -0
- package/src/components/custom/ActiveWork/task-list-fixture.ts +97 -0
- package/src/components/custom/CircularTimer/CircularTimer.stories.tsx +12 -6
- package/src/components/custom/DateTime/DateTime.stories.tsx +2 -1
- package/src/components/custom/DateTime/DateTime.test.tsx +3 -1
- package/src/components/custom/EmptyState/EmptyState.stories.tsx +22 -9
- package/src/components/custom/EmptyState/EmptyState.test.tsx +7 -13
- package/src/components/custom/EmptyState/EmptyState.tsx +4 -18
- package/src/components/custom/Fatigue/DualGhostSpark.stories.tsx +4 -3
- package/src/components/custom/Fatigue/FatigueLights.stories.tsx +2 -2
- package/src/components/custom/Fatigue/GhostSpark.stories.tsx +4 -3
- package/src/components/custom/Fatigue/LiveFatigueCard.stories.tsx +2 -2
- package/src/components/custom/Fatigue/LiveFatigueCard.tsx +8 -4
- package/src/components/custom/Fatigue/LiveFatiguePanel.stories.tsx +116 -6
- package/src/components/custom/Fatigue/LiveFatiguePanel.test.tsx +134 -0
- package/src/components/custom/Fatigue/LiveFatiguePanel.tsx +54 -83
- package/src/components/custom/Fatigue/README.md +40 -3
- package/src/components/custom/Fatigue/RomProgressionChart.stories.tsx +2 -2
- package/src/components/custom/Fatigue/SilverRedPalette.stories.tsx +2 -1
- package/src/components/custom/Fatigue/VelocityHero.stories.tsx +4 -3
- package/src/components/custom/Fatigue/VerdictHero.stories.tsx +2 -2
- package/src/components/custom/Fatigue/fatigue-mock.test.ts +0 -5
- package/src/components/custom/Fatigue/fatigue-mock.ts +2 -10
- package/src/components/custom/Fatigue/fatigue-tokens.ts +12 -0
- package/src/components/custom/Fatigue/index.ts +17 -5
- package/src/components/custom/Fatigue/panel-layout.test.ts +149 -0
- package/src/components/custom/Fatigue/panel-layout.ts +185 -0
- package/src/components/custom/Gauge/Gauge.stories.tsx +6 -3
- package/src/components/custom/Gauge/Gauge.test.tsx +1 -1
- package/src/components/custom/Gauge/Gauge.tsx +7 -2
- package/src/components/custom/Metric/Metric.stories.tsx +10 -1
- package/src/components/custom/Metric/Metric.test.tsx +1 -3
- package/src/components/custom/Metric/Metric.tsx +5 -20
- package/src/components/custom/Prose/MarkdownProse.stories.tsx +88 -0
- package/src/components/custom/Prose/MarkdownProse.test.tsx +87 -0
- package/src/components/custom/Prose/MarkdownProse.tsx +201 -0
- package/src/components/custom/Prose/README.md +58 -0
- package/src/components/custom/Prose/index.ts +1 -0
- package/src/components/custom/Scatter/Scatter.stories.tsx +55 -14
- package/src/components/custom/Scatter/Scatter.test.tsx +2 -2
- package/src/components/custom/Scatter/Scatter.tsx +122 -18
- package/src/components/custom/Sidebar/Sidebar.stories.tsx +41 -8
- package/src/components/custom/Sidebar/Sidebar.test.tsx +5 -1
- package/src/components/custom/Sidebar/Sidebar.tsx +16 -33
- package/src/components/custom/Table/Table.stories.tsx +99 -16
- package/src/components/custom/Table/Table.test.tsx +273 -86
- package/src/components/custom/Table/Table.tsx +159 -67
- package/src/components/custom/Table/column-fit.test.ts +75 -0
- package/src/components/custom/Table/column-fit.ts +116 -0
- package/src/components/custom/Table/index.ts +9 -0
- package/src/components/custom/TimerReadout/TimerReadout.stories.tsx +8 -6
- package/src/components/custom/Treemap/Treemap.stories.tsx +15 -12
- package/src/components/custom/Treemap/Treemap.test.tsx +1 -1
- package/src/components/custom/Treemap/Treemap.tsx +11 -3
- package/src/components/custom/Typography/Typography.stories.tsx +28 -1
- package/src/components/custom/Typography/Typography.test.tsx +34 -0
- package/src/components/custom/Typography/Typography.tsx +6 -0
- package/src/components/custom/Typography/index.ts +1 -8
- package/src/components/custom/Workout/ActiveWorkoutPage.stories.tsx +11 -2
- package/src/components/custom/Workout/BaseBadge.stories.tsx +27 -11
- package/src/components/custom/Workout/BaseBadge.test.tsx +31 -11
- package/src/components/custom/Workout/BaseBadge.tsx +6 -2
- package/src/components/custom/Workout/BodyMap.stories.tsx +4 -1
- package/src/components/custom/Workout/BodyMap.tsx +8 -4
- package/src/components/custom/Workout/BodyMapDetailPanel.stories.tsx +28 -6
- package/src/components/custom/Workout/BodyMapDetailPanel.test.tsx +11 -15
- package/src/components/custom/Workout/BodyMapDetailPanel.tsx +50 -12
- package/src/components/custom/Workout/CapacityBandChart.stories.tsx +12 -9
- package/src/components/custom/Workout/CapacityBandChart.test.tsx +24 -51
- package/src/components/custom/Workout/CapacityBandChart.tsx +144 -111
- package/src/components/custom/Workout/DeviationBar.stories.tsx +1 -1
- package/src/components/custom/Workout/DeviationBar.test.tsx +10 -4
- package/src/components/custom/Workout/DeviationBar.tsx +24 -16
- package/src/components/custom/Workout/DualVelocityStrip.stories.tsx +183 -0
- package/src/components/custom/Workout/DualVelocityStrip.test.tsx +32 -18
- package/src/components/custom/Workout/ExerciseCard.stories.tsx +12 -11
- package/src/components/custom/Workout/ExerciseCard.test.tsx +52 -22
- package/src/components/custom/Workout/ExerciseCard.tsx +99 -183
- package/src/components/custom/Workout/ExerciseCardHeading.stories.tsx +95 -12
- package/src/components/custom/Workout/ExerciseCardHeading.test.tsx +189 -1
- package/src/components/custom/Workout/ExerciseCardHeading.tsx +167 -18
- package/src/components/custom/Workout/ExerciseDetailPage.stories.tsx +9 -1
- package/src/components/custom/Workout/ExerciseDetailPage.tsx +3 -2
- package/src/components/custom/Workout/ExerciseHeading.stories.tsx +8 -8
- package/src/components/custom/Workout/ExerciseHeading.tsx +194 -46
- package/src/components/custom/Workout/ExerciseIndicator.stories.tsx +12 -9
- package/src/components/custom/Workout/ExerciseIndicator.test.tsx +27 -11
- package/src/components/custom/Workout/ExerciseIndicator.tsx +14 -15
- package/src/components/custom/Workout/FatigueMeter.stories.tsx +5 -5
- package/src/components/custom/Workout/InputBar.stories.tsx +4 -5
- package/src/components/custom/Workout/InputBar.tsx +4 -2
- package/src/components/custom/Workout/IntensityBar.stories.tsx +1 -1
- package/src/components/custom/Workout/IntensityBar.test.tsx +5 -1
- package/src/components/custom/Workout/IntensityBar.tsx +8 -3
- package/src/components/custom/Workout/LiveAuraFrame.stories.tsx +5 -4
- package/src/components/custom/Workout/MesoCard.stories.tsx +4 -1
- package/src/components/custom/Workout/MesoCard.test.tsx +7 -18
- package/src/components/custom/Workout/MesoCard.tsx +14 -10
- package/src/components/custom/Workout/MesoProgressBar.stories.tsx +1 -1
- package/src/components/custom/Workout/MesoProgressBar.test.tsx +18 -11
- package/src/components/custom/Workout/MesoProgressBar.tsx +15 -13
- package/src/components/custom/Workout/MesoStatusCard.stories.tsx +2 -1
- package/src/components/custom/Workout/MesoStatusCard.test.tsx +14 -44
- package/src/components/custom/Workout/MesoStatusCard.tsx +20 -33
- package/src/components/custom/Workout/MetricTiles.stories.tsx +3 -2
- package/src/components/custom/Workout/MuscleGroupChip.stories.tsx +2 -8
- package/src/components/custom/Workout/MuscleGroupChip.test.tsx +23 -31
- package/src/components/custom/Workout/MuscleGroupChip.tsx +28 -67
- package/src/components/custom/Workout/PlaceholderStrip.stories.tsx +9 -4
- package/src/components/custom/Workout/PlaceholderStrip.test.tsx +17 -10
- package/src/components/custom/Workout/PlaceholderStrip.tsx +9 -8
- package/src/components/custom/Workout/PrBadge.stories.tsx +2 -1
- package/src/components/custom/Workout/PrBadge.test.tsx +3 -9
- package/src/components/custom/Workout/PrBadge.tsx +13 -17
- package/src/components/custom/Workout/PrHistoryModal.stories.tsx +16 -3
- package/src/components/custom/Workout/PrHistoryModal.test.tsx +13 -36
- package/src/components/custom/Workout/PrHistoryModal.tsx +8 -4
- package/src/components/custom/Workout/ProgramPlanningPage.stories.tsx +6 -1
- package/src/components/custom/Workout/README.md +68 -17
- package/src/components/custom/Workout/ReadinessCheck.stories.tsx +3 -2
- package/src/components/custom/Workout/ReadinessCheck.test.tsx +12 -18
- package/src/components/custom/Workout/ReadinessCheck.tsx +22 -4
- package/src/components/custom/Workout/RestTimer.stories.tsx +16 -4
- package/src/components/custom/Workout/RestTimer.tsx +4 -2
- package/src/components/custom/Workout/ScheduleTiles.stories.tsx +3 -2
- package/src/components/custom/Workout/ScheduleTiles.test.tsx +3 -4
- package/src/components/custom/Workout/ScheduleTiles.tsx +4 -7
- package/src/components/custom/Workout/SegmentedBar.stories.tsx +21 -17
- package/src/components/custom/Workout/SegmentedBar.tsx +10 -5
- package/src/components/custom/Workout/SegmentedProgressBar.stories.tsx +5 -5
- package/src/components/custom/Workout/SessionHeader.stories.tsx +6 -6
- package/src/components/custom/Workout/SessionHeader.tsx +12 -12
- package/src/components/custom/Workout/SessionRail.stories.tsx +12 -11
- package/src/components/custom/Workout/SessionRail.tsx +7 -9
- package/src/components/custom/Workout/SetBar.stories.tsx +10 -6
- package/src/components/custom/Workout/SetBar.test.tsx +49 -4
- package/src/components/custom/Workout/SetBar.tsx +38 -12
- package/src/components/custom/Workout/SetRow.stories.tsx +3 -2
- package/src/components/custom/Workout/SetRow.test.tsx +16 -2
- package/src/components/custom/Workout/SetRow.tsx +61 -23
- package/src/components/custom/Workout/SetStrip.stories.tsx +63 -7
- package/src/components/custom/Workout/SetStrip.test.tsx +25 -0
- package/src/components/custom/Workout/SetStrip.tsx +24 -4
- package/src/components/custom/Workout/SetTableHeader.stories.tsx +6 -6
- package/src/components/custom/Workout/SetTableHeader.tsx +9 -12
- package/src/components/custom/Workout/SetsRepsLoad.stories.tsx +7 -7
- package/src/components/custom/Workout/SetsRepsLoad.tsx +24 -12
- package/src/components/custom/Workout/Sparkline.stories.tsx +14 -11
- package/src/components/custom/Workout/Sparkline.test.tsx +37 -19
- package/src/components/custom/Workout/Sparkline.tsx +14 -18
- package/src/components/custom/Workout/StatusDot.stories.tsx +1 -1
- package/src/components/custom/Workout/StatusDot.test.tsx +44 -5
- package/src/components/custom/Workout/StatusDot.tsx +93 -63
- package/src/components/custom/Workout/StatusPill.stories.tsx +1 -1
- package/src/components/custom/Workout/StatusPill.test.tsx +6 -15
- package/src/components/custom/Workout/StatusPill.tsx +27 -38
- package/src/components/custom/Workout/StrengthTrendChart.stories.tsx +11 -4
- package/src/components/custom/Workout/StrengthTrendChart.test.tsx +15 -37
- package/src/components/custom/Workout/StrengthTrendChart.tsx +39 -36
- package/src/components/custom/Workout/SupersetWrapper.stories.tsx +27 -64
- package/src/components/custom/Workout/SupersetWrapper.test.tsx +16 -14
- package/src/components/custom/Workout/SupersetWrapper.tsx +17 -21
- package/src/components/custom/Workout/TempoDisplay.stories.tsx +26 -10
- package/src/components/custom/Workout/TempoDisplay.test.tsx +18 -4
- package/src/components/custom/Workout/TempoDisplay.tsx +2 -0
- package/src/components/custom/Workout/TrainingStatusPage.stories.tsx +9 -1
- package/src/components/custom/Workout/VelocityStrip.compact.stories.tsx +4 -1
- package/src/components/custom/Workout/VelocityStrip.dual.stories.tsx +10 -6
- package/src/components/custom/Workout/VelocityStrip.expanded.stories.tsx +5 -2
- package/src/components/custom/Workout/VelocityStrip.hero.stories.tsx +44 -1
- package/src/components/custom/Workout/VelocityStrip.stories.tsx +12 -6
- package/src/components/custom/Workout/VelocityStrip.test.tsx +48 -6
- package/src/components/custom/Workout/VelocityStrip.tsx +26 -14
- package/src/components/custom/Workout/VolumeLandmarkBar.stories.tsx +6 -7
- package/src/components/custom/Workout/VolumeLandmarkBar.tsx +15 -6
- package/src/components/custom/Workout/WeekRow.stories.tsx +4 -1
- package/src/components/custom/Workout/WeekRow.test.tsx +18 -15
- package/src/components/custom/Workout/WeekRow.tsx +23 -16
- package/src/components/custom/Workout/WeightBadge.stories.tsx +2 -1
- package/src/components/custom/Workout/WeightBadge.test.tsx +50 -19
- package/src/components/custom/Workout/WeightBadge.tsx +28 -27
- package/src/components/custom/Workout/WorkoutCard.stories.tsx +6 -1
- package/src/components/custom/Workout/WorkoutCard.test.tsx +18 -0
- package/src/components/custom/Workout/WorkoutCard.tsx +35 -57
- package/src/components/custom/Workout/WorkoutPill.stories.tsx +5 -2
- package/src/components/custom/Workout/WorkoutPill.test.tsx +39 -7
- package/src/components/custom/Workout/WorkoutPill.tsx +88 -57
- package/src/components/custom/Workout/ZoneTrack.stories.tsx +10 -7
- package/src/components/custom/Workout/ZoneTrack.tsx +10 -9
- package/src/components/custom/Workout/exerciseRowState.ts +29 -0
- package/src/components/custom/Workout/index.ts +17 -2
- package/src/components/custom/Workout/metricText.stories.tsx +15 -13
- package/src/components/custom/Workout/metricText.tsx +8 -2
- package/src/components/custom/Workout/setHeadingKit.tsx +219 -36
- package/src/components/custom/Workout/velocity-story-kit.tsx +2 -2
- package/src/components/custom/charts/README.md +66 -0
- package/src/components/custom/charts/SetBarChart.test.tsx +46 -1
- package/src/components/custom/charts/SetBarChart.tsx +56 -9
- package/src/components/custom/charts/SparkBars.stories.tsx +55 -0
- package/src/components/custom/charts/SparkBars.test.tsx +69 -0
- package/src/components/custom/charts/SparkBars.tsx +85 -0
- package/src/components/custom/charts/flatBarGeometry.test.ts +41 -0
- package/src/components/custom/charts/flatBarGeometry.ts +32 -0
- package/src/components/custom/charts/index.ts +3 -0
- package/src/components/custom/index.ts +3 -0
- package/src/components/custom/stepper/Stepper.stories.tsx +13 -10
- package/src/components/custom/stepper/Stepper.test.tsx +1 -7
- package/src/components/custom/stepper/Stepper.tsx +21 -34
- package/src/components/icons/icons.stories.tsx +1 -1
- package/src/components/icons/icons.tsx +51 -0
- package/src/components/shell/AppShell.stories.tsx +150 -0
- package/src/components/shell/AppShell.test.tsx +70 -0
- package/src/components/shell/AppShell.tsx +90 -0
- package/src/components/shell/BrandLockup.stories.tsx +66 -5
- package/src/components/shell/BrandLockup.test.tsx +34 -1
- package/src/components/shell/BrandLockup.tsx +27 -11
- package/src/components/shell/NavItem.stories.tsx +4 -4
- package/src/components/shell/NavItem.test.tsx +17 -0
- package/src/components/shell/NavItem.tsx +17 -5
- package/src/components/shell/README.md +89 -26
- package/src/components/shell/SideNav.stories.tsx +38 -7
- package/src/components/shell/SideNav.test.tsx +16 -8
- package/src/components/shell/SideNav.tsx +17 -17
- package/src/components/shell/TopBar.stories.tsx +44 -19
- package/src/components/shell/TopBar.test.tsx +34 -12
- package/src/components/shell/TopBar.tsx +61 -40
- package/src/components/shell/brands.tsx +66 -0
- package/src/components/shell/index.ts +9 -8
- package/src/components/shell/{DeviceIndicator.stories.tsx → workout/DeviceIndicator.stories.tsx} +2 -2
- package/src/components/shell/{DeviceIndicator.tsx → workout/DeviceIndicator.tsx} +2 -2
- package/src/components/shell/{DeviceMenu.stories.tsx → workout/DeviceMenu.stories.tsx} +2 -2
- package/src/components/shell/{DeviceMenu.tsx → workout/DeviceMenu.tsx} +3 -3
- package/src/components/shell/{DeviceRow.stories.tsx → workout/DeviceRow.stories.tsx} +2 -2
- package/src/components/shell/{DeviceRow.tsx → workout/DeviceRow.tsx} +3 -3
- package/src/components/shell/{SessionStatePill.stories.tsx → workout/SessionStatePill.stories.tsx} +2 -2
- package/src/components/shell/{SessionStatePill.tsx → workout/SessionStatePill.tsx} +5 -3
- package/src/components/shell/workout/WorkoutShell.stories.tsx +71 -0
- package/src/components/shell/{DashboardShell.test.tsx → workout/WorkoutShell.test.tsx} +19 -8
- package/src/components/shell/workout/WorkoutShell.tsx +77 -0
- package/src/components/shell/workout/WorkoutTopBar.stories.tsx +58 -0
- package/src/components/shell/workout/WorkoutTopBar.test.tsx +39 -0
- package/src/components/shell/workout/WorkoutTopBar.tsx +52 -0
- package/src/components/shell/workout/index.ts +9 -0
- package/src/components/shell/workout/workoutNavItems.tsx +16 -0
- package/src/components/ui/README.md +110 -0
- package/src/components/ui/alert/Alert.stories.tsx +15 -5
- package/src/components/ui/alert/Alert.tsx +24 -3
- package/src/components/ui/autocomplete/Autocomplete.stories.tsx +11 -13
- package/src/components/ui/autocomplete/Autocomplete.test.tsx +7 -25
- package/src/components/ui/autocomplete/Autocomplete.tsx +21 -28
- package/src/components/ui/avatar/Avatar.stories.tsx +1 -1
- package/src/components/ui/avatar/Avatar.tsx +2 -10
- package/src/components/ui/badge/Badge.stories.tsx +83 -28
- package/src/components/ui/badge/Badge.test.tsx +19 -3
- package/src/components/ui/badge/Badge.tsx +48 -55
- package/src/components/ui/breadcrumbs/Breadcrumbs.stories.tsx +1 -1
- package/src/components/ui/breadcrumbs/Breadcrumbs.tsx +4 -16
- package/src/components/ui/button/Button.stories.tsx +46 -12
- package/src/components/ui/button/Button.tsx +44 -37
- package/src/components/ui/card/Card.stories.tsx +90 -94
- package/src/components/ui/card/Card.test.tsx +80 -6
- package/src/components/ui/card/Card.tsx +150 -203
- package/src/components/ui/checkbox/Checkbox.stories.tsx +1 -1
- package/src/components/ui/checkbox/Checkbox.tsx +7 -27
- package/src/components/ui/chip/Chip.stories.tsx +37 -13
- package/src/components/ui/chip/Chip.test.tsx +10 -6
- package/src/components/ui/chip/Chip.tsx +76 -91
- package/src/components/ui/collapse/Collapse.stories.tsx +23 -23
- package/src/components/ui/collapse/Collapse.tsx +6 -11
- package/src/components/ui/data-row/DataRow.stories.tsx +14 -3
- package/src/components/ui/data-row/DataRow.test.tsx +5 -15
- package/src/components/ui/data-row/DataRow.tsx +18 -7
- package/src/components/ui/divider/Divider.stories.tsx +1 -1
- package/src/components/ui/divider/Divider.tsx +1 -5
- package/src/components/ui/drawer/Drawer.stories.tsx +5 -16
- package/src/components/ui/drawer/Drawer.tsx +13 -27
- package/src/components/ui/floating-overlay-depth.test.tsx +143 -0
- package/src/components/ui/form-field/FormField.stories.tsx +6 -20
- package/src/components/ui/form-field/FormField.test.tsx +1 -5
- package/src/components/ui/form-field/FormField.tsx +10 -46
- package/src/components/ui/help-tip/HelpTip.stories.tsx +8 -19
- package/src/components/ui/help-tip/HelpTip.test.tsx +1 -3
- package/src/components/ui/help-tip/HelpTip.tsx +21 -22
- package/src/components/ui/help-tip/index.ts +7 -1
- package/src/components/ui/icon-box/IconBox.stories.tsx +1 -1
- package/src/components/ui/icon-box/IconBox.test.tsx +1 -7
- package/src/components/ui/icon-box/IconBox.tsx +10 -18
- package/src/components/ui/indicator/Indicator.stories.tsx +5 -4
- package/src/components/ui/indicator/Indicator.tsx +20 -14
- package/src/components/ui/input/Input.stories.tsx +3 -11
- package/src/components/ui/input/Input.test.tsx +2 -10
- package/src/components/ui/input/Input.tsx +10 -25
- package/src/components/ui/input/index.ts +7 -1
- package/src/components/ui/link/Link.stories.tsx +19 -7
- package/src/components/ui/list-item/ListItem.stories.tsx +17 -5
- package/src/components/ui/list-item/ListItem.tsx +2 -9
- package/src/components/ui/menu/Menu.stories.tsx +21 -15
- package/src/components/ui/menu/Menu.test.tsx +2 -11
- package/src/components/ui/menu/Menu.tsx +12 -14
- package/src/components/ui/menu/index.ts +8 -1
- package/src/components/ui/modal/Modal.stories.tsx +2 -2
- package/src/components/ui/modal/Modal.tsx +31 -19
- package/src/components/ui/pill/Pill.stories.tsx +111 -23
- package/src/components/ui/pill/Pill.test.tsx +101 -3
- package/src/components/ui/pill/Pill.tsx +168 -49
- package/src/components/ui/pill/index.ts +1 -1
- package/src/components/ui/popover/Popover.stories.tsx +6 -8
- package/src/components/ui/popover/Popover.test.tsx +1 -6
- package/src/components/ui/popover/Popover.tsx +20 -15
- package/src/components/ui/popover/index.ts +7 -1
- package/src/components/ui/progress/Progress.stories.tsx +3 -12
- package/src/components/ui/progress/Progress.test.tsx +1 -5
- package/src/components/ui/progress/Progress.tsx +9 -6
- package/src/components/ui/radio/Radio.stories.tsx +42 -21
- package/src/components/ui/radio/Radio.test.tsx +6 -2
- package/src/components/ui/radio/Radio.tsx +23 -22
- package/src/components/ui/section/Section.stories.tsx +12 -21
- package/src/components/ui/section/Section.test.tsx +1 -6
- package/src/components/ui/section/Section.tsx +1 -3
- package/src/components/ui/section/index.ts +1 -5
- package/src/components/ui/select/Select.stories.tsx +3 -13
- package/src/components/ui/select/Select.test.tsx +2 -11
- package/src/components/ui/select/Select.tsx +16 -15
- package/src/components/ui/skeleton/Skeleton.stories.tsx +3 -11
- package/src/components/ui/skeleton/Skeleton.tsx +3 -14
- package/src/components/ui/skeleton/index.ts +1 -7
- package/src/components/ui/spinner/Spinner.stories.tsx +1 -1
- package/src/components/ui/spinner/Spinner.tsx +4 -5
- package/src/components/ui/stack/Stack.stories.tsx +8 -8
- package/src/components/ui/stack/Stack.tsx +1 -1
- package/src/components/ui/surface/Surface.stories.tsx +92 -33
- package/src/components/ui/surface/Surface.test.tsx +88 -28
- package/src/components/ui/surface/Surface.tsx +37 -87
- package/src/components/ui/surface/SurfaceContext.ts +22 -62
- package/src/components/ui/surface/index.ts +8 -0
- package/src/components/ui/surface/resolveSurface.ts +98 -0
- package/src/components/ui/surface/surface.contract.test.ts +6 -1
- package/src/components/ui/switch/Switch.stories.tsx +1 -1
- package/src/components/ui/switch/Switch.tsx +7 -6
- package/src/components/ui/tabs/Tabs.stories.tsx +1 -1
- package/src/components/ui/tabs/Tabs.tsx +8 -21
- package/src/components/ui/tabs/index.ts +1 -7
- package/src/components/ui/tile/Tile.stories.tsx +1 -1
- package/src/components/ui/tile/Tile.tsx +3 -0
- package/src/components/ui/toast/Toast.stories.tsx +1 -1
- package/src/components/ui/toast/Toast.test.tsx +2 -8
- package/src/components/ui/toast/Toast.tsx +49 -57
- package/src/components/ui/toast/index.ts +0 -1
- package/src/components/ui/toolbar-button/ToolbarButton.stories.tsx +92 -71
- package/src/components/ui/toolbar-button/ToolbarButton.test.tsx +3 -18
- package/src/components/ui/toolbar-button/ToolbarButton.tsx +38 -49
- package/src/components/ui/tooltip/Tooltip.stories.tsx +12 -3
- package/src/components/ui/tooltip/Tooltip.test.tsx +21 -3
- package/src/components/ui/tooltip/Tooltip.tsx +55 -36
- package/src/components/ui/tooltip/index.ts +1 -1
- package/src/components/ui/trigger/TriggerSurface.test.tsx +215 -0
- package/src/components/ui/trigger/TriggerSurface.tsx +81 -0
- package/src/components/ui/trigger/index.ts +2 -0
- package/src/stories/PresetShowcase.stories.tsx +101 -48
- package/src/test/no-device-internals.test.ts +3 -3
- package/src/test/no-raw-color.test.ts +39 -0
- package/src/theme/Alpha.stories.tsx +103 -0
- package/src/theme/ChoosingTokens.stories.tsx +48 -0
- package/src/theme/ColorPalettes.stories.tsx +62 -45
- package/src/theme/ColorPrimitives.stories.tsx +35 -35
- package/src/theme/Depth.stories.tsx +132 -65
- package/src/theme/DepthCalibration.stories.tsx +23 -21
- package/src/theme/ProposedTokensVW82.stories.tsx +414 -0
- package/src/theme/ThemeProvider.test.tsx +4 -4
- package/src/theme/barrel.ts +7 -6
- package/src/theme/color-stories.coverage.test.ts +1 -1
- package/src/theme/color-utils.ts +41 -29
- package/src/theme/config.completeness.test.ts +1 -1
- package/src/theme/config.ts +40 -0
- package/src/theme/elevation.test.ts +82 -56
- package/src/theme/elevation.ts +77 -561
- package/src/theme/global.css +45 -5
- package/src/theme/grey-ramp.test.ts +24 -8
- package/src/theme/lift.test.ts +39 -0
- package/src/theme/lift.ts +102 -0
- package/src/theme/materials.test.ts +5 -2
- package/src/theme/materials.ts +38 -4
- package/src/theme/native-theming-guard.test.ts +5 -5
- package/src/theme/presets/apply.ts +4 -0
- package/src/theme/presets/audiobook.ts +5 -2
- package/src/theme/presets/default.ts +4 -0
- package/src/theme/presets/index.ts +14 -1
- package/src/theme/presets/types.ts +1 -1
- package/src/theme/semantic-contrast.test.ts +13 -4
- package/src/theme/status-distinctness.test.ts +66 -0
- package/src/theme/subtle-tone-weight.test.ts +163 -0
- package/src/theme/surface-planes.test.ts +37 -0
- package/src/theme/surface-planes.ts +68 -0
- package/src/theme/tailwind-var-opacity.test.ts +163 -0
- package/src/theme/token-export-guard.test.ts +1 -3
- package/src/theme/tokens/primitives.test.ts +15 -7
- package/src/theme/tokens/primitives.ts +98 -33
- package/src/theme/tokens/semantic-hex-guard.test.ts +322 -0
- package/src/theme/tokens/semantic.ts +124 -54
- package/src/theme/wash-ladder.test.ts +58 -0
- package/src/theme/workout-tokens.ts +1 -7
- package/src/types/jest-axe.d.ts +2 -6
- package/src/types/raw-md.d.ts +5 -0
- package/src/utils/colors.alpha-adoption.test.ts +408 -0
- package/src/utils/colors.ts +4 -4
- package/src/utils/form.ts +1 -3
- package/src/utils/index.ts +2 -7
- package/src/utils/number-format.ts +17 -0
- package/src/utils/workout-format.ts +15 -6
- package/src/web-jsx/jsx-runtime.ts +1 -5
- package/tailwind.config.js +55 -9
- package/src/components/custom/Workout/ExerciseCardUnified.stories.tsx +0 -151
- package/src/components/custom/Workout/RowInventory.stories.tsx +0 -408
- package/src/components/custom/Workout/S3FullRail.stories.tsx +0 -46
- package/src/components/custom/Workout/S3SessionPace.stories.tsx +0 -95
- package/src/components/custom/Workout/S3SessionRailHeading.stories.tsx +0 -61
- package/src/components/custom/Workout/S3SetTypes.stories.tsx +0 -176
- package/src/components/custom/Workout/S3WorkoutExpansion.stories.tsx +0 -240
- package/src/components/shell/DashboardShell.stories.tsx +0 -65
- package/src/components/shell/DashboardShell.tsx +0 -75
- package/src/components/shell/SessionRailSpecimen.stories.tsx +0 -753
- package/src/theme/elevation.stories.tsx +0 -346
- package/src/utils/useTheme.ts +0 -72
- /package/src/components/shell/{DeviceIndicator.test.tsx → workout/DeviceIndicator.test.tsx} +0 -0
- /package/src/components/shell/{DeviceMenu.test.tsx → workout/DeviceMenu.test.tsx} +0 -0
- /package/src/components/shell/{DeviceRow.test.tsx → workout/DeviceRow.test.tsx} +0 -0
- /package/src/components/shell/{SessionStatePill.test.tsx → workout/SessionStatePill.test.tsx} +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from 'vitest'
|
|
2
|
-
import { render, screen, fireEvent } from '@testing-library/react'
|
|
2
|
+
import { render, screen, fireEvent, waitFor } from '@testing-library/react'
|
|
3
3
|
import { axe } from 'jest-axe'
|
|
4
4
|
import { ExerciseCardHeading } from './ExerciseCardHeading'
|
|
5
|
+
import { exerciseLiveColor, exerciseRowStateColor } from './exerciseRowState'
|
|
6
|
+
import { onSurfaceColors } from '../../ui/surface/SurfaceContext'
|
|
5
7
|
import type { SetStripSet } from './SetStrip'
|
|
6
8
|
|
|
7
9
|
const setStates: SetStripSet[] = [
|
|
@@ -62,11 +64,197 @@ describe('ExerciseCardHeading', () => {
|
|
|
62
64
|
expect(onPress).toHaveBeenCalledOnce()
|
|
63
65
|
})
|
|
64
66
|
|
|
67
|
+
// The three former call sites, each proven to render from the one component.
|
|
68
|
+
describe('density', () => {
|
|
69
|
+
it('rail: the prescription sits on its own line beside the tempo', () => {
|
|
70
|
+
render(<ExerciseCardHeading {...baseProps} />)
|
|
71
|
+
const header = screen.getByTestId('exercise-card-header')
|
|
72
|
+
expect(header).not.toContainElement(screen.getByTestId('exercise-card-summary'))
|
|
73
|
+
expect(screen.getByTestId('tempo-display')).toBeInTheDocument()
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
it('compact: name and prescription share the header row, and the tempo is dropped', () => {
|
|
77
|
+
render(<ExerciseCardHeading {...baseProps} density="compact" />)
|
|
78
|
+
const header = screen.getByTestId('exercise-card-header')
|
|
79
|
+
expect(header).toContainElement(screen.getByTestId('exercise-card-name'))
|
|
80
|
+
expect(header).toContainElement(screen.getByTestId('exercise-card-summary'))
|
|
81
|
+
expect(screen.queryByTestId('tempo-display')).not.toBeInTheDocument()
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
it('compact: the prescription reads "3×6 @ 185 lbs" with no spaces around the ×', () => {
|
|
85
|
+
render(
|
|
86
|
+
<ExerciseCardHeading
|
|
87
|
+
name="Bench Press"
|
|
88
|
+
density="compact"
|
|
89
|
+
sets={3}
|
|
90
|
+
reps={6}
|
|
91
|
+
load={185}
|
|
92
|
+
unit="lbs"
|
|
93
|
+
/>
|
|
94
|
+
)
|
|
95
|
+
expect(screen.getByTestId('sets-reps-load')).toHaveTextContent('3×6 @ 185 lbs')
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
it("compact: the prescription numbers carry the secondary tone and regular weight, not the rail's bright bold", () => {
|
|
99
|
+
render(
|
|
100
|
+
<ExerciseCardHeading
|
|
101
|
+
name="Bench Press"
|
|
102
|
+
density="compact"
|
|
103
|
+
sets={3}
|
|
104
|
+
reps={6}
|
|
105
|
+
load={185}
|
|
106
|
+
unit="lbs"
|
|
107
|
+
/>
|
|
108
|
+
)
|
|
109
|
+
const secondary = onSurfaceColors('dark').secondary
|
|
110
|
+
for (const text of ['3', '6', '185']) {
|
|
111
|
+
const el = screen.getByText(text)
|
|
112
|
+
expect(el).toHaveStyle({ color: secondary })
|
|
113
|
+
// jsdom's getComputedStyle doesn't resolve numeric font-weight, so read the
|
|
114
|
+
// inline style directly rather than through toHaveStyle.
|
|
115
|
+
expect(el.style.fontWeight).toBe('400')
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
it('rail: the prescription numbers keep the bright bold rail treatment', () => {
|
|
120
|
+
render(<ExerciseCardHeading {...baseProps} />)
|
|
121
|
+
const primary = onSurfaceColors('dark').primary
|
|
122
|
+
const el = screen.getByText('3')
|
|
123
|
+
expect(el).toHaveStyle({ color: primary })
|
|
124
|
+
expect(el.style.fontWeight).toBe('600')
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it('upcoming: dims itself and carries the free-text prescription + previous best', () => {
|
|
128
|
+
render(
|
|
129
|
+
<ExerciseCardHeading
|
|
130
|
+
name="Deadlift"
|
|
131
|
+
density="upcoming"
|
|
132
|
+
prescription="3×8-12 @ RPE 8"
|
|
133
|
+
previousBest="185 lbs × 10"
|
|
134
|
+
/>
|
|
135
|
+
)
|
|
136
|
+
expect(screen.getByTestId('exercise-card')).toHaveStyle({ opacity: 0.6 })
|
|
137
|
+
expect(screen.getByTestId('exercise-card-prescription')).toHaveTextContent('3×8-12 @ RPE 8')
|
|
138
|
+
expect(screen.getByTestId('exercise-card-previous-best')).toHaveTextContent('185 lbs × 10')
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
it('upcoming: an explicit dimmed=false overrides the density default', () => {
|
|
142
|
+
render(<ExerciseCardHeading name="Deadlift" density="upcoming" dimmed={false} />)
|
|
143
|
+
expect(screen.getByTestId('exercise-card')).toHaveStyle({ opacity: 1 })
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
// The fourth call site: voltras-mcp's SPA recap card, which takes a STRING load for
|
|
147
|
+
// a weightless mode rather than fabricating a 0 (VMCP-03.05).
|
|
148
|
+
it('rail: a string load and a testID override still render standalone', () => {
|
|
149
|
+
render(
|
|
150
|
+
<ExerciseCardHeading
|
|
151
|
+
name="Cable Row"
|
|
152
|
+
sets={3}
|
|
153
|
+
reps={10}
|
|
154
|
+
load="—"
|
|
155
|
+
unit="lbs"
|
|
156
|
+
indicator="velocity-loss"
|
|
157
|
+
setStates={[{ status: 'done', velocities: [0.8, 0.7] }]}
|
|
158
|
+
testID="recap-card-heading"
|
|
159
|
+
/>
|
|
160
|
+
)
|
|
161
|
+
expect(screen.getByTestId('recap-card-heading')).toBeInTheDocument()
|
|
162
|
+
expect(screen.getByTestId('exercise-card-summary')).toHaveTextContent('—')
|
|
163
|
+
})
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
describe('interaction states', () => {
|
|
167
|
+
it('has no wash at rest', () => {
|
|
168
|
+
render(<ExerciseCardHeading {...baseProps} />)
|
|
169
|
+
expect(screen.getByTestId('exercise-card')).not.toHaveStyle({
|
|
170
|
+
backgroundColor: exerciseRowStateColor('hovered'),
|
|
171
|
+
})
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
it('washes on hover of the heading row', () => {
|
|
175
|
+
render(<ExerciseCardHeading {...baseProps} />)
|
|
176
|
+
fireEvent.mouseEnter(screen.getByTestId('exercise-card-header'))
|
|
177
|
+
expect(screen.getByTestId('exercise-card')).toHaveStyle({
|
|
178
|
+
backgroundColor: exerciseRowStateColor('hovered'),
|
|
179
|
+
})
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
it('clears the hover wash when the pointer leaves', () => {
|
|
183
|
+
render(<ExerciseCardHeading {...baseProps} />)
|
|
184
|
+
const header = screen.getByTestId('exercise-card-header')
|
|
185
|
+
fireEvent.mouseEnter(header)
|
|
186
|
+
fireEvent.mouseLeave(header)
|
|
187
|
+
expect(screen.getByTestId('exercise-card')).not.toHaveStyle({
|
|
188
|
+
backgroundColor: exerciseRowStateColor('hovered'),
|
|
189
|
+
})
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
it('washes while selected, and the selection outranks a hover', () => {
|
|
193
|
+
render(<ExerciseCardHeading {...baseProps} isSelected />)
|
|
194
|
+
fireEvent.mouseEnter(screen.getByTestId('exercise-card-header'))
|
|
195
|
+
expect(screen.getByTestId('exercise-card')).toHaveStyle({
|
|
196
|
+
backgroundColor: exerciseRowStateColor('selected'),
|
|
197
|
+
})
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
// RNW's Pressability grants the responder before it schedules onPressIn, so the
|
|
201
|
+
// wash lands a tick after the mousedown.
|
|
202
|
+
it('a press outranks the selection wash', async () => {
|
|
203
|
+
render(<ExerciseCardHeading {...baseProps} isSelected onPress={vi.fn()} />)
|
|
204
|
+
fireEvent.mouseDown(screen.getByTestId('exercise-card-header'), { button: 0, detail: 1 })
|
|
205
|
+
await waitFor(() =>
|
|
206
|
+
expect(screen.getByTestId('exercise-card')).toHaveStyle({
|
|
207
|
+
backgroundColor: exerciseRowStateColor('pressed'),
|
|
208
|
+
})
|
|
209
|
+
)
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
it('tints the name with the live tone while the exercise is being performed', () => {
|
|
213
|
+
render(<ExerciseCardHeading {...baseProps} isLive />)
|
|
214
|
+
expect(screen.getByTestId('exercise-card-name')).toHaveStyle({
|
|
215
|
+
color: exerciseLiveColor(),
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
|
|
219
|
+
it('leaves the name on the primary tone when not live', () => {
|
|
220
|
+
render(<ExerciseCardHeading {...baseProps} />)
|
|
221
|
+
expect(screen.getByTestId('exercise-card-name')).not.toHaveStyle({
|
|
222
|
+
color: exerciseLiveColor(),
|
|
223
|
+
})
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
// The rail renders on the wall during a set; titan's "the grain is static" rule
|
|
227
|
+
// makes a live state a tone change, never motion.
|
|
228
|
+
it('the live state adds no animation or transition', () => {
|
|
229
|
+
const { container } = render(<ExerciseCardHeading {...baseProps} isLive />)
|
|
230
|
+
expect(container.innerHTML).not.toMatch(/animation|transition/i)
|
|
231
|
+
})
|
|
232
|
+
})
|
|
233
|
+
|
|
65
234
|
describe('accessibility', () => {
|
|
66
235
|
it('has no accessibility violations', async () => {
|
|
67
236
|
const { container } = render(<ExerciseCardHeading {...baseProps} onPress={vi.fn()} />)
|
|
68
237
|
const results = await axe(container)
|
|
69
238
|
expect(results).toHaveNoViolations()
|
|
70
239
|
})
|
|
240
|
+
|
|
241
|
+
it('has no accessibility violations in the upcoming density', async () => {
|
|
242
|
+
const { container } = render(
|
|
243
|
+
<ExerciseCardHeading
|
|
244
|
+
name="Deadlift"
|
|
245
|
+
density="upcoming"
|
|
246
|
+
prescription="3×8-12 @ RPE 8"
|
|
247
|
+
previousBest="185 lbs × 10"
|
|
248
|
+
onPress={vi.fn()}
|
|
249
|
+
/>
|
|
250
|
+
)
|
|
251
|
+
const results = await axe(container)
|
|
252
|
+
expect(results).toHaveNoViolations()
|
|
253
|
+
})
|
|
254
|
+
|
|
255
|
+
it('names the row from its prescription, structured or free-text', () => {
|
|
256
|
+
render(<ExerciseCardHeading {...baseProps} onPress={vi.fn()} />)
|
|
257
|
+
expect(screen.getByLabelText('Cable Chest Press, 3×10 @ 90 lbs')).toBeInTheDocument()
|
|
258
|
+
})
|
|
71
259
|
})
|
|
72
260
|
})
|
|
@@ -1,43 +1,192 @@
|
|
|
1
1
|
// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useState } from 'react'
|
|
3
|
+
import { Pressable, View, type StyleProp, type ViewStyle } from 'react-native'
|
|
4
|
+
import type { ThemeMode } from '../../../theme/tokens/semantic'
|
|
5
|
+
import { useSurfaceMode } from '../../ui/surface/SurfaceContext'
|
|
6
|
+
import { useHoverState } from '../../ui/tooltip'
|
|
7
|
+
import { ExerciseHeading, exerciseHeadingLabel, type ExerciseHeadingProps } from './ExerciseHeading'
|
|
4
8
|
import { SetStrip, type SetStripSet } from './SetStrip'
|
|
9
|
+
import { exerciseRowStateColor } from './exerciseRowState'
|
|
5
10
|
|
|
6
|
-
|
|
11
|
+
/**
|
|
12
|
+
* How much room the row gets, and therefore which shape it takes:
|
|
13
|
+
* - `rail` — the session-rail row: two lines (name, then prescription + tempo).
|
|
14
|
+
* - `compact` — the collapsed card row: one line, card padding.
|
|
15
|
+
* - `upcoming` — `compact`, dimmed, with the previous-best caption.
|
|
16
|
+
*/
|
|
17
|
+
export type ExerciseRowDensity = 'rail' | 'compact' | 'upcoming'
|
|
18
|
+
|
|
19
|
+
interface DensitySpec {
|
|
20
|
+
paddingVertical: number
|
|
21
|
+
paddingHorizontal: number
|
|
22
|
+
layout: 'stacked' | 'inline'
|
|
23
|
+
dimOpacity: number
|
|
24
|
+
dimByDefault: boolean
|
|
25
|
+
/** The structured prescription renders in one dimmer, regular tone, not the rail's bright/bold. */
|
|
26
|
+
mutedPrescription: boolean
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// The two dim depths are inherited from two different specimens (rail 0.55, card 0.60).
|
|
30
|
+
// Converging them needs an opacity token the set does not have — reported, not invented.
|
|
31
|
+
const DENSITY: Record<ExerciseRowDensity, DensitySpec> = {
|
|
32
|
+
rail: {
|
|
33
|
+
paddingVertical: 9,
|
|
34
|
+
paddingHorizontal: 12,
|
|
35
|
+
layout: 'stacked',
|
|
36
|
+
dimOpacity: 0.55,
|
|
37
|
+
dimByDefault: false,
|
|
38
|
+
mutedPrescription: false,
|
|
39
|
+
},
|
|
40
|
+
compact: {
|
|
41
|
+
paddingVertical: 12,
|
|
42
|
+
paddingHorizontal: 14,
|
|
43
|
+
layout: 'inline',
|
|
44
|
+
dimOpacity: 0.55,
|
|
45
|
+
dimByDefault: false,
|
|
46
|
+
mutedPrescription: true,
|
|
47
|
+
},
|
|
48
|
+
upcoming: {
|
|
49
|
+
paddingVertical: 12,
|
|
50
|
+
paddingHorizontal: 14,
|
|
51
|
+
layout: 'inline',
|
|
52
|
+
dimOpacity: 0.6,
|
|
53
|
+
dimByDefault: true,
|
|
54
|
+
mutedPrescription: true,
|
|
55
|
+
},
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type ExerciseCardHeadingProps = ExerciseHeadingProps & {
|
|
59
|
+
/** Row shape. Default `rail`. */
|
|
60
|
+
density?: ExerciseRowDensity
|
|
7
61
|
/** Per-set performance data driving the strip; an empty list renders no strip. */
|
|
8
|
-
setStates
|
|
62
|
+
setStates?: SetStripSet[]
|
|
9
63
|
/** Strip height in px. Default 8. */
|
|
10
64
|
stripHeight?: number
|
|
65
|
+
/** The row the user has chosen — a persistent wash, distinct from transient hover. */
|
|
66
|
+
isSelected?: boolean
|
|
67
|
+
/** Root style, for the chrome a card wraps the row in (superset radius, margins). */
|
|
68
|
+
style?: StyleProp<ViewStyle>
|
|
11
69
|
/** Root testID. Default "exercise-card"; override when nested inside another card. */
|
|
12
70
|
testID?: string
|
|
13
71
|
}
|
|
14
72
|
|
|
15
73
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
74
|
+
* Hover and press state for the whole row. RNW ends a wrapper's hover the moment a
|
|
75
|
+
* nested Pressable claims the pointer (see `useHoverState`), so the row listens on
|
|
76
|
+
* both itself and its heading and takes either.
|
|
77
|
+
*/
|
|
78
|
+
function useRowInteraction() {
|
|
79
|
+
const { hovered: rowHovered, hoverProps } = useHoverState()
|
|
80
|
+
const [headingHovered, setHeadingHovered] = useState(false)
|
|
81
|
+
const [pressed, setPressed] = useState(false)
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
hoverProps,
|
|
85
|
+
pressed,
|
|
86
|
+
hovered: rowHovered || headingHovered,
|
|
87
|
+
headingHandlers: {
|
|
88
|
+
onHoverIn: () => setHeadingHovered(true),
|
|
89
|
+
onHoverOut: () => setHeadingHovered(false),
|
|
90
|
+
onPressIn: () => setPressed(true),
|
|
91
|
+
onPressOut: () => setPressed(false),
|
|
92
|
+
},
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Precedence: a press beats a selection, a selection beats a hover. */
|
|
97
|
+
function rowWash(
|
|
98
|
+
mode: ThemeMode,
|
|
99
|
+
state: { pressed: boolean; isSelected: boolean; hovered: boolean }
|
|
100
|
+
): string | undefined {
|
|
101
|
+
if (state.pressed) return exerciseRowStateColor('pressed', mode)
|
|
102
|
+
if (state.isSelected) return exerciseRowStateColor('selected', mode)
|
|
103
|
+
if (state.hovered) return exerciseRowStateColor('hovered', mode)
|
|
104
|
+
return undefined
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Narrow the prescription union back to the exact member the caller supplied. */
|
|
108
|
+
function prescriptionProps(p: ExerciseCardHeadingProps): ExerciseHeadingProps {
|
|
109
|
+
const base = { name: p.name }
|
|
110
|
+
if (p.prescription !== undefined) return { ...base, prescription: p.prescription }
|
|
111
|
+
if (p.sets === undefined) return base
|
|
112
|
+
return { ...base, sets: p.sets, reps: p.reps, load: p.load }
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The exercise row — one component for all three densities the workout surfaces
|
|
117
|
+
* list an exercise in: the standalone session-rail heading (`rail`), the collapsed
|
|
118
|
+
* card row (`compact`) and the not-yet-reached row (`upcoming`). An
|
|
119
|
+
* {@link ExerciseHeading} info block over its per-set {@link SetStrip}.
|
|
120
|
+
*
|
|
121
|
+
* Interaction states are washes from the `interactive-*` tokens (press > selection >
|
|
122
|
+
* hover) plus a `isLive` name tone. All are static: this row renders on a wall display
|
|
123
|
+
* during a set, where titan's "the grain never animates" rule applies.
|
|
124
|
+
*
|
|
19
125
|
* e1RM is intentionally dropped (a planning / live-panel concern). Dimming lives on
|
|
20
126
|
* the outer wrapper so the strip dims with the heading.
|
|
21
127
|
*/
|
|
22
|
-
export function ExerciseCardHeading({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
128
|
+
export function ExerciseCardHeading(props: ExerciseCardHeadingProps) {
|
|
129
|
+
const {
|
|
130
|
+
density = 'rail',
|
|
131
|
+
setStates = [],
|
|
132
|
+
stripHeight = 8,
|
|
133
|
+
dimmed,
|
|
134
|
+
isSelected = false,
|
|
135
|
+
isLive = false,
|
|
136
|
+
testID = 'exercise-card',
|
|
137
|
+
style,
|
|
138
|
+
} = props
|
|
139
|
+
const spec = DENSITY[density]
|
|
140
|
+
const { hoverProps, pressed, hovered, headingHandlers } = useRowInteraction()
|
|
141
|
+
const wash = rowWash(useSurfaceMode(), { pressed, isSelected, hovered })
|
|
142
|
+
// The inline densities have no TempoDisplay sibling, so the whole padded row can be
|
|
143
|
+
// the press target — the touch target the collapsed card has always had. `rail` keeps
|
|
144
|
+
// the name row as the button because nesting TempoDisplay inside one is illegal.
|
|
145
|
+
const rowIsButton = spec.layout === 'inline'
|
|
146
|
+
|
|
147
|
+
const Root = rowIsButton ? Pressable : View
|
|
148
|
+
const rootPress = rowIsButton
|
|
149
|
+
? {
|
|
150
|
+
...headingHandlers,
|
|
151
|
+
onPress: props.onPress,
|
|
152
|
+
accessibilityRole: 'button' as const,
|
|
153
|
+
accessibilityLabel: exerciseHeadingLabel(props),
|
|
154
|
+
}
|
|
155
|
+
: {}
|
|
156
|
+
|
|
29
157
|
return (
|
|
30
|
-
<
|
|
31
|
-
|
|
158
|
+
<Root
|
|
159
|
+
{...hoverProps}
|
|
160
|
+
{...rootPress}
|
|
161
|
+
style={[
|
|
162
|
+
{
|
|
163
|
+
paddingVertical: spec.paddingVertical,
|
|
164
|
+
paddingHorizontal: spec.paddingHorizontal,
|
|
165
|
+
opacity: (dimmed ?? spec.dimByDefault) ? spec.dimOpacity : 1,
|
|
166
|
+
},
|
|
167
|
+
wash ? { backgroundColor: wash } : null,
|
|
168
|
+
style,
|
|
169
|
+
]}
|
|
32
170
|
testID={testID}
|
|
33
171
|
>
|
|
34
|
-
<ExerciseHeading
|
|
172
|
+
<ExerciseHeading
|
|
173
|
+
{...prescriptionProps(props)}
|
|
174
|
+
{...(rowIsButton ? { pressTarget: 'ancestor' as const } : headingHandlers)}
|
|
175
|
+
unit={props.unit}
|
|
176
|
+
tempo={props.tempo}
|
|
177
|
+
indicator={props.indicator}
|
|
178
|
+
previousBest={props.previousBest}
|
|
179
|
+
onPress={rowIsButton ? undefined : props.onPress}
|
|
180
|
+
layout={spec.layout}
|
|
181
|
+
mutedPrescription={spec.mutedPrescription}
|
|
182
|
+
isLive={isLive}
|
|
183
|
+
/>
|
|
35
184
|
|
|
36
185
|
{setStates.length > 0 && (
|
|
37
186
|
<View style={{ marginTop: 7 }} testID="exercise-card-strip">
|
|
38
187
|
<SetStrip sets={setStates} height={stripHeight} />
|
|
39
188
|
</View>
|
|
40
189
|
)}
|
|
41
|
-
</
|
|
190
|
+
</Root>
|
|
42
191
|
)
|
|
43
192
|
}
|
|
@@ -192,7 +192,15 @@ const vbt: ExerciseVbt = {
|
|
|
192
192
|
const meta: Meta<typeof ExerciseDetailPage> = {
|
|
193
193
|
title: 'Pages/Exercise Detail',
|
|
194
194
|
component: ExerciseDetailPage,
|
|
195
|
-
parameters: {
|
|
195
|
+
parameters: {
|
|
196
|
+
layout: 'fullscreen',
|
|
197
|
+
docs: {
|
|
198
|
+
description: {
|
|
199
|
+
component:
|
|
200
|
+
'Composes **MesoStatusCard** · **StrengthTrendChart** · **CapacityBandChart** · **ExerciseCard** · **VelocityStrip**.',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
},
|
|
196
204
|
tags: ['autodocs'],
|
|
197
205
|
args: {
|
|
198
206
|
exercise: {
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
import { resolveColor } from '../../../theme/resolve-color'
|
|
25
25
|
import { getSemanticColors } from '../../../theme/tokens/semantic'
|
|
26
26
|
import { cn } from '../../../utils/cn'
|
|
27
|
+
import { alpha } from '../../../utils/colors'
|
|
27
28
|
|
|
28
29
|
const BRAND_PRIMARY = getSemanticColors('dark')['brand-primary']
|
|
29
30
|
|
|
@@ -545,9 +546,9 @@ export function ExerciseDetailPage({
|
|
|
545
546
|
paddingVertical: 4,
|
|
546
547
|
paddingHorizontal: 10,
|
|
547
548
|
borderRadius: 6,
|
|
548
|
-
backgroundColor:
|
|
549
|
+
backgroundColor: alpha(BRAND_PRIMARY, 0.1),
|
|
549
550
|
borderWidth: 1,
|
|
550
|
-
borderColor:
|
|
551
|
+
borderColor: alpha(BRAND_PRIMARY, 0.25),
|
|
551
552
|
}}
|
|
552
553
|
testID="exercise-detail-page-e1rm"
|
|
553
554
|
>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
-
import { View } from 'react-native'
|
|
3
2
|
import { ExerciseHeading } from './ExerciseHeading'
|
|
3
|
+
import { Surface } from '../../ui/surface'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* `ExerciseHeading` — the exercise-heading info block (no strip): the name +
|
|
@@ -9,7 +9,7 @@ import { ExerciseHeading } from './ExerciseHeading'
|
|
|
9
9
|
* target; TempoDisplay is a sibling (it is itself a Pressable).
|
|
10
10
|
*/
|
|
11
11
|
const meta: Meta<typeof ExerciseHeading> = {
|
|
12
|
-
title: 'Workout/ExerciseHeading',
|
|
12
|
+
title: 'Custom/Workout/ExerciseHeading',
|
|
13
13
|
component: ExerciseHeading,
|
|
14
14
|
tags: ['autodocs'],
|
|
15
15
|
parameters: {
|
|
@@ -17,10 +17,10 @@ const meta: Meta<typeof ExerciseHeading> = {
|
|
|
17
17
|
description: {
|
|
18
18
|
component:
|
|
19
19
|
'**Molecule.** The exercise-heading info block (no strip). Composes ' +
|
|
20
|
-
'[ExerciseIndicator](?path=/docs/workout-exerciseindicator--docs) + ' +
|
|
21
|
-
'[SetsRepsLoad](?path=/docs/workout-setsrepsload--docs) + ' +
|
|
22
|
-
'[TempoDisplay](?path=/docs/workout-tempodisplay--docs). ' +
|
|
23
|
-
'Used-by ↑ [ExerciseCardHeading](?path=/docs/workout-exercisecardheading--docs).',
|
|
20
|
+
'[ExerciseIndicator](?path=/docs/custom-workout-exerciseindicator--docs) + ' +
|
|
21
|
+
'[SetsRepsLoad](?path=/docs/custom-workout-setsrepsload--docs) + ' +
|
|
22
|
+
'[TempoDisplay](?path=/docs/custom-workout-tempodisplay--docs). ' +
|
|
23
|
+
'Used-by ↑ [ExerciseCardHeading](?path=/docs/custom-workout-exercisecardheading--docs).',
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
},
|
|
@@ -35,9 +35,9 @@ const meta: Meta<typeof ExerciseHeading> = {
|
|
|
35
35
|
},
|
|
36
36
|
decorators: [
|
|
37
37
|
(Story) => (
|
|
38
|
-
<
|
|
38
|
+
<Surface level="base" style={{ width: 246, padding: 16 }}>
|
|
39
39
|
<Story />
|
|
40
|
-
</
|
|
40
|
+
</Surface>
|
|
41
41
|
),
|
|
42
42
|
],
|
|
43
43
|
}
|