@titan-design/react-ui 0.5.0 → 0.7.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.
Files changed (307) hide show
  1. package/dist/bodymap.js +241 -189
  2. package/dist/bodymap.js.map +1 -1
  3. package/dist/bodymap.mjs +241 -189
  4. package/dist/bodymap.mjs.map +1 -1
  5. package/dist/index.d.mts +1017 -130
  6. package/dist/index.d.ts +1017 -130
  7. package/dist/index.js +3058 -1090
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +2992 -1091
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/{pages-MO0JCySL.d.mts → pages-8u_4WbL-.d.mts} +280 -57
  12. package/dist/{pages-D7Jlssvp.d.ts → pages-DaWiBOGa.d.ts} +280 -57
  13. package/dist/pages.d.mts +1 -1
  14. package/dist/pages.d.ts +1 -1
  15. package/dist/pages.js +1797 -1292
  16. package/dist/pages.js.map +1 -1
  17. package/dist/pages.mjs +1797 -1292
  18. package/dist/pages.mjs.map +1 -1
  19. package/dist/theme/index.d.mts +464 -268
  20. package/dist/theme/index.d.ts +464 -268
  21. package/dist/theme/index.js +303 -191
  22. package/dist/theme/index.js.map +1 -1
  23. package/dist/theme/index.mjs +295 -192
  24. package/dist/theme/index.mjs.map +1 -1
  25. package/dist/theme/tokens-css.js +160 -143
  26. package/dist/theme/tokens-css.js.map +1 -1
  27. package/dist/theme/tokens-css.mjs +160 -143
  28. package/dist/theme/tokens-css.mjs.map +1 -1
  29. package/package.json +3 -1
  30. package/src/arch/Architecture.stories.tsx +870 -0
  31. package/src/arch/annotations.json +48 -0
  32. package/src/arch/arch-graph.json +4301 -0
  33. package/src/components/custom/DateTime/DateTime.stories.tsx +83 -7
  34. package/src/components/custom/DateTime/DateTime.test.tsx +29 -3
  35. package/src/components/custom/DateTime/DateTime.tsx +55 -15
  36. package/src/components/custom/EmptyState/EmptyState.stories.tsx +1 -1
  37. package/src/components/custom/Gauge/Gauge.stories.tsx +1 -1
  38. package/src/components/custom/Gauge/Gauge.test.tsx +2 -2
  39. package/src/components/custom/Gauge/Gauge.tsx +6 -3
  40. package/src/components/custom/Metric/Metric.stories.tsx +1 -1
  41. package/src/components/custom/Scatter/Scatter.stories.tsx +1 -1
  42. package/src/components/custom/Scatter/Scatter.tsx +3 -5
  43. package/src/components/custom/Sidebar/Sidebar.stories.tsx +1 -1
  44. package/src/components/custom/Table/Table.stories.tsx +1 -1
  45. package/src/components/custom/TimerReadout/TimerReadout.stories.tsx +62 -0
  46. package/src/components/custom/TimerReadout/TimerReadout.test.tsx +72 -0
  47. package/src/components/custom/TimerReadout/TimerReadout.tsx +75 -0
  48. package/src/components/custom/TimerReadout/index.ts +1 -0
  49. package/src/components/custom/Treemap/Treemap.stories.tsx +1 -1
  50. package/src/components/custom/Treemap/Treemap.tsx +3 -5
  51. package/src/components/custom/Typography/Typography.stories.tsx +46 -28
  52. package/src/components/custom/Typography/Typography.test.tsx +13 -3
  53. package/src/components/custom/Typography/Typography.tsx +5 -0
  54. package/src/components/custom/Workout/ActiveWorkoutPage.stories.tsx +21 -13
  55. package/src/components/custom/Workout/ActiveWorkoutPage.test.tsx +16 -13
  56. package/src/components/custom/Workout/ActiveWorkoutPage.tsx +11 -16
  57. package/src/components/custom/Workout/BaseBadge.stories.tsx +1 -1
  58. package/src/components/custom/Workout/BodyMap.stories.tsx +1 -1
  59. package/src/components/custom/Workout/BodyMap.tsx +6 -3
  60. package/src/components/custom/Workout/BodyMapDetailPanel.stories.tsx +1 -1
  61. package/src/components/custom/Workout/BodyMapDetailPanel.tsx +6 -3
  62. package/src/components/custom/Workout/CapacityBandChart.stories.tsx +1 -1
  63. package/src/components/custom/Workout/CapacityBandChart.test.tsx +2 -2
  64. package/src/components/custom/Workout/CapacityBandChart.tsx +9 -6
  65. package/src/components/custom/Workout/DeviationBar.stories.tsx +1 -1
  66. package/src/components/custom/Workout/DeviationBar.test.tsx +1 -1
  67. package/src/components/custom/Workout/DeviationBar.tsx +7 -4
  68. package/src/components/custom/Workout/ExerciseCard.stories.tsx +51 -66
  69. package/src/components/custom/Workout/ExerciseCard.test.tsx +146 -143
  70. package/src/components/custom/Workout/ExerciseCard.tsx +176 -198
  71. package/src/components/custom/Workout/ExerciseCardHeading.stories.tsx +99 -0
  72. package/src/components/custom/Workout/ExerciseCardHeading.test.tsx +72 -0
  73. package/src/components/custom/Workout/ExerciseCardHeading.tsx +43 -0
  74. package/src/components/custom/Workout/ExerciseCardUnified.stories.tsx +151 -0
  75. package/src/components/custom/Workout/ExerciseDetailPage.stories.tsx +5 -3
  76. package/src/components/custom/Workout/ExerciseDetailPage.test.tsx +4 -4
  77. package/src/components/custom/Workout/ExerciseDetailPage.tsx +6 -6
  78. package/src/components/custom/Workout/ExerciseHeading.stories.tsx +81 -0
  79. package/src/components/custom/Workout/ExerciseHeading.test.tsx +77 -0
  80. package/src/components/custom/Workout/ExerciseHeading.tsx +85 -0
  81. package/src/components/custom/Workout/ExerciseIndicator.stories.tsx +110 -0
  82. package/src/components/custom/Workout/ExerciseIndicator.test.tsx +93 -0
  83. package/src/components/custom/Workout/ExerciseIndicator.tsx +120 -0
  84. package/src/components/custom/Workout/FatigueMeter.stories.tsx +51 -0
  85. package/src/components/custom/Workout/FatigueMeter.test.tsx +73 -0
  86. package/src/components/custom/Workout/FatigueMeter.tsx +82 -0
  87. package/src/components/custom/Workout/InputBar.stories.tsx +1 -1
  88. package/src/components/custom/Workout/InputBar.tsx +2 -1
  89. package/src/components/custom/Workout/IntensityBar.stories.tsx +1 -1
  90. package/src/components/custom/Workout/IntensityBar.test.tsx +8 -8
  91. package/src/components/custom/Workout/IntensityBar.tsx +10 -6
  92. package/src/components/custom/Workout/LiveAuraFrame.stories.tsx +153 -0
  93. package/src/components/custom/Workout/LiveAuraFrame.test.tsx +74 -0
  94. package/src/components/custom/Workout/LiveAuraFrame.tsx +105 -0
  95. package/src/components/custom/Workout/MesoCard.stories.tsx +1 -1
  96. package/src/components/custom/Workout/MesoCard.tsx +8 -3
  97. package/src/components/custom/Workout/MesoProgressBar.stories.tsx +1 -1
  98. package/src/components/custom/Workout/MesoProgressBar.test.tsx +1 -1
  99. package/src/components/custom/Workout/MesoProgressBar.tsx +3 -2
  100. package/src/components/custom/Workout/MesoStatusCard.stories.tsx +1 -1
  101. package/src/components/custom/Workout/MesoStatusCard.tsx +20 -13
  102. package/src/components/custom/Workout/MetricTiles.stories.tsx +60 -0
  103. package/src/components/custom/Workout/MetricTiles.test.tsx +58 -0
  104. package/src/components/custom/Workout/MetricTiles.tsx +48 -0
  105. package/src/components/custom/Workout/MuscleGroupChip.stories.tsx +1 -1
  106. package/src/components/custom/Workout/MuscleGroupChip.tsx +7 -4
  107. package/src/components/custom/Workout/PlaceholderStrip.stories.tsx +1 -1
  108. package/src/components/custom/Workout/PrBadge.stories.tsx +1 -1
  109. package/src/components/custom/Workout/PrBadge.tsx +5 -2
  110. package/src/components/custom/Workout/PrHistoryModal.stories.tsx +1 -1
  111. package/src/components/custom/Workout/PrHistoryModal.tsx +4 -3
  112. package/src/components/custom/Workout/ProgramPlanningPage.stories.tsx +4 -16
  113. package/src/components/custom/Workout/ProgramPlanningPage.tsx +10 -7
  114. package/src/components/custom/Workout/README.md +146 -4
  115. package/src/components/custom/Workout/ReadinessCheck.stories.tsx +1 -1
  116. package/src/components/custom/Workout/ReadinessCheck.tsx +7 -4
  117. package/src/components/custom/Workout/RestTimer.stories.tsx +1 -1
  118. package/src/components/custom/Workout/RestTimer.tsx +17 -11
  119. package/src/components/custom/Workout/RowInventory.stories.tsx +405 -0
  120. package/src/components/custom/Workout/S3FullRail.stories.tsx +34 -0
  121. package/src/components/custom/Workout/S3SessionPace.stories.tsx +95 -0
  122. package/src/components/custom/Workout/S3SessionRailHeading.stories.tsx +61 -0
  123. package/src/components/custom/Workout/S3SetTypes.stories.tsx +176 -0
  124. package/src/components/custom/Workout/S3WorkoutExpansion.stories.tsx +240 -0
  125. package/src/components/custom/Workout/ScheduleTiles.stories.tsx +40 -0
  126. package/src/components/custom/Workout/ScheduleTiles.test.tsx +34 -0
  127. package/src/components/custom/Workout/ScheduleTiles.tsx +70 -0
  128. package/src/components/custom/Workout/SegmentedBar.stories.tsx +99 -0
  129. package/src/components/custom/Workout/SegmentedBar.test.tsx +77 -0
  130. package/src/components/custom/Workout/SegmentedBar.tsx +172 -0
  131. package/src/components/custom/Workout/SegmentedProgressBar.stories.tsx +50 -0
  132. package/src/components/custom/Workout/SegmentedProgressBar.test.tsx +80 -0
  133. package/src/components/custom/Workout/SegmentedProgressBar.tsx +67 -0
  134. package/src/components/custom/Workout/SessionHeader.stories.tsx +121 -0
  135. package/src/components/custom/Workout/SessionHeader.test.tsx +122 -0
  136. package/src/components/custom/Workout/SessionHeader.tsx +152 -0
  137. package/src/components/custom/Workout/SessionRail.stories.tsx +153 -0
  138. package/src/components/custom/Workout/SessionRail.test.tsx +86 -0
  139. package/src/components/custom/Workout/SessionRail.tsx +126 -0
  140. package/src/components/custom/Workout/SetBar.stories.tsx +124 -0
  141. package/src/components/custom/Workout/SetBar.test.tsx +123 -0
  142. package/src/components/custom/Workout/SetBar.tsx +171 -0
  143. package/src/components/custom/Workout/SetRow.stories.tsx +50 -100
  144. package/src/components/custom/Workout/SetRow.test.tsx +94 -166
  145. package/src/components/custom/Workout/SetRow.tsx +170 -232
  146. package/src/components/custom/Workout/SetStrip.stories.tsx +154 -0
  147. package/src/components/custom/Workout/SetStrip.test.tsx +109 -0
  148. package/src/components/custom/Workout/SetStrip.tsx +71 -0
  149. package/src/components/custom/Workout/SetTableHeader.stories.tsx +66 -0
  150. package/src/components/custom/Workout/SetTableHeader.test.tsx +47 -0
  151. package/src/components/custom/Workout/SetTableHeader.tsx +88 -0
  152. package/src/components/custom/Workout/SetsRepsLoad.stories.tsx +47 -0
  153. package/src/components/custom/Workout/SetsRepsLoad.test.tsx +44 -0
  154. package/src/components/custom/Workout/SetsRepsLoad.tsx +52 -0
  155. package/src/components/custom/Workout/Sparkline.stories.tsx +1 -1
  156. package/src/components/custom/Workout/Sparkline.tsx +2 -1
  157. package/src/components/custom/Workout/StatusDot.stories.tsx +1 -1
  158. package/src/components/custom/Workout/StatusDot.test.tsx +2 -2
  159. package/src/components/custom/Workout/StatusDot.tsx +12 -9
  160. package/src/components/custom/Workout/StatusPill.stories.tsx +59 -0
  161. package/src/components/custom/Workout/StatusPill.test.tsx +63 -0
  162. package/src/components/custom/Workout/StatusPill.tsx +88 -0
  163. package/src/components/custom/Workout/StrengthTrendChart.stories.tsx +1 -1
  164. package/src/components/custom/Workout/StrengthTrendChart.tsx +9 -6
  165. package/src/components/custom/Workout/SupersetWrapper.stories.tsx +1 -1
  166. package/src/components/custom/Workout/SupersetWrapper.tsx +2 -1
  167. package/src/components/custom/Workout/TempoBar.stories.tsx +1 -1
  168. package/src/components/custom/Workout/TempoDisplay.stories.tsx +12 -1
  169. package/src/components/custom/Workout/TempoDisplay.tsx +29 -36
  170. package/src/components/custom/Workout/TrainingStatusPage.stories.tsx +1 -1
  171. package/src/components/custom/Workout/VelocityStrip.modalities.stories.tsx +254 -0
  172. package/src/components/custom/Workout/VelocityStrip.responsive.stories.tsx +145 -0
  173. package/src/components/custom/Workout/VelocityStrip.stories.tsx +129 -66
  174. package/src/components/custom/Workout/VelocityStrip.test.tsx +379 -144
  175. package/src/components/custom/Workout/VelocityStrip.tsx +508 -120
  176. package/src/components/custom/Workout/VolumeLandmarkBar.stories.tsx +73 -0
  177. package/src/components/custom/Workout/VolumeLandmarkBar.test.tsx +119 -0
  178. package/src/components/custom/Workout/VolumeLandmarkBar.tsx +154 -0
  179. package/src/components/custom/Workout/WeekRow.stories.tsx +1 -1
  180. package/src/components/custom/Workout/WeekRow.tsx +3 -2
  181. package/src/components/custom/Workout/WeightBadge.stories.tsx +1 -1
  182. package/src/components/custom/Workout/WeightBadge.tsx +6 -2
  183. package/src/components/custom/Workout/WorkoutCard.stories.tsx +2 -6
  184. package/src/components/custom/Workout/WorkoutCard.test.tsx +13 -46
  185. package/src/components/custom/Workout/WorkoutCard.tsx +5 -2
  186. package/src/components/custom/Workout/WorkoutPill.stories.tsx +1 -1
  187. package/src/components/custom/Workout/WorkoutPill.tsx +12 -8
  188. package/src/components/custom/Workout/ZoneTrack.stories.tsx +140 -0
  189. package/src/components/custom/Workout/ZoneTrack.test.tsx +200 -0
  190. package/src/components/custom/Workout/ZoneTrack.tsx +315 -0
  191. package/src/components/custom/Workout/icons.tsx +6 -67
  192. package/src/components/custom/Workout/index.ts +55 -2
  193. package/src/components/custom/Workout/metricText.stories.tsx +69 -0
  194. package/src/components/custom/Workout/metricText.tsx +34 -0
  195. package/src/components/custom/Workout/paceTone.test.ts +29 -0
  196. package/src/components/custom/Workout/paceTone.ts +27 -0
  197. package/src/components/custom/Workout/setHeadingKit.tsx +177 -0
  198. package/src/components/custom/index.ts +1 -0
  199. package/src/components/custom/stepper/Stepper.stories.tsx +1 -1
  200. package/src/components/icons/SvgIcon.tsx +50 -0
  201. package/src/components/icons/icons.stories.tsx +122 -0
  202. package/src/components/icons/icons.test.tsx +73 -0
  203. package/src/components/icons/icons.tsx +153 -0
  204. package/src/components/icons/index.ts +4 -0
  205. package/src/components/index.ts +6 -0
  206. package/src/components/shell/BrandLockup.stories.tsx +27 -0
  207. package/src/components/shell/BrandLockup.test.tsx +23 -0
  208. package/src/components/shell/BrandLockup.tsx +47 -0
  209. package/src/components/shell/DashboardShell.stories.tsx +65 -0
  210. package/src/components/shell/DashboardShell.test.tsx +42 -0
  211. package/src/components/shell/DashboardShell.tsx +74 -0
  212. package/src/components/shell/DeviceIndicator.stories.tsx +28 -0
  213. package/src/components/shell/DeviceIndicator.test.tsx +26 -0
  214. package/src/components/shell/DeviceIndicator.tsx +52 -0
  215. package/src/components/shell/DeviceMenu.stories.tsx +47 -0
  216. package/src/components/shell/DeviceMenu.test.tsx +40 -0
  217. package/src/components/shell/DeviceMenu.tsx +65 -0
  218. package/src/components/shell/DeviceRow.stories.tsx +38 -0
  219. package/src/components/shell/DeviceRow.test.tsx +37 -0
  220. package/src/components/shell/DeviceRow.tsx +58 -0
  221. package/src/components/shell/NavItem.stories.tsx +52 -0
  222. package/src/components/shell/NavItem.test.tsx +35 -0
  223. package/src/components/shell/NavItem.tsx +75 -0
  224. package/src/components/shell/README.md +116 -0
  225. package/src/components/shell/SessionRailSpecimen.stories.tsx +753 -0
  226. package/src/components/shell/SessionStatePill.stories.tsx +27 -0
  227. package/src/components/shell/SessionStatePill.test.tsx +25 -0
  228. package/src/components/shell/SessionStatePill.tsx +46 -0
  229. package/src/components/shell/SideNav.stories.tsx +81 -0
  230. package/src/components/shell/SideNav.test.tsx +51 -0
  231. package/src/components/shell/SideNav.tsx +74 -0
  232. package/src/components/shell/TopBar.stories.tsx +49 -0
  233. package/src/components/shell/TopBar.test.tsx +36 -0
  234. package/src/components/shell/TopBar.tsx +89 -0
  235. package/src/components/shell/index.ts +13 -0
  236. package/src/components/ui/alert/Alert.stories.tsx +1 -1
  237. package/src/components/ui/autocomplete/Autocomplete.stories.tsx +1 -1
  238. package/src/components/ui/avatar/Avatar.stories.tsx +1 -1
  239. package/src/components/ui/badge/Badge.stories.tsx +1 -1
  240. package/src/components/ui/breadcrumbs/Breadcrumbs.stories.tsx +1 -1
  241. package/src/components/ui/button/Button.stories.tsx +1 -1
  242. package/src/components/ui/card/Card.stories.tsx +1 -1
  243. package/src/components/ui/checkbox/Checkbox.stories.tsx +1 -1
  244. package/src/components/ui/chip/Chip.stories.tsx +1 -1
  245. package/src/components/ui/collapse/Collapse.stories.tsx +1 -1
  246. package/src/components/ui/data-row/DataRow.stories.tsx +1 -1
  247. package/src/components/ui/divider/Divider.stories.tsx +1 -1
  248. package/src/components/ui/drawer/Drawer.stories.tsx +1 -1
  249. package/src/components/ui/form-field/FormField.stories.tsx +1 -1
  250. package/src/components/ui/help-tip/HelpTip.stories.tsx +1 -1
  251. package/src/components/ui/icon-box/IconBox.stories.tsx +1 -1
  252. package/src/components/ui/index.ts +1 -0
  253. package/src/components/ui/indicator/Indicator.stories.tsx +38 -2
  254. package/src/components/ui/indicator/Indicator.test.tsx +20 -1
  255. package/src/components/ui/indicator/Indicator.tsx +50 -6
  256. package/src/components/ui/indicator/index.ts +1 -1
  257. package/src/components/ui/input/Input.stories.tsx +1 -1
  258. package/src/components/ui/link/Link.stories.tsx +1 -1
  259. package/src/components/ui/list-item/ListItem.stories.tsx +1 -1
  260. package/src/components/ui/menu/Menu.stories.tsx +1 -1
  261. package/src/components/ui/modal/Modal.stories.tsx +1 -1
  262. package/src/components/ui/pill/Pill.stories.tsx +1 -1
  263. package/src/components/ui/popover/Popover.stories.tsx +1 -1
  264. package/src/components/ui/progress/Progress.stories.tsx +1 -1
  265. package/src/components/ui/radio/Radio.stories.tsx +1 -1
  266. package/src/components/ui/section/Section.stories.tsx +1 -1
  267. package/src/components/ui/select/Select.stories.tsx +1 -1
  268. package/src/components/ui/skeleton/Skeleton.stories.tsx +1 -1
  269. package/src/components/ui/spinner/Spinner.stories.tsx +1 -1
  270. package/src/components/ui/spinner/Spinner.tsx +3 -2
  271. package/src/components/ui/stack/Stack.stories.tsx +1 -1
  272. package/src/components/ui/surface/Surface.stories.tsx +1 -1
  273. package/src/components/ui/switch/Switch.stories.tsx +1 -1
  274. package/src/components/ui/tabs/Tabs.stories.tsx +1 -1
  275. package/src/components/ui/tile/Tile.stories.tsx +79 -0
  276. package/src/components/ui/tile/Tile.test.tsx +48 -0
  277. package/src/components/ui/tile/Tile.tsx +64 -0
  278. package/src/components/ui/tile/index.ts +2 -0
  279. package/src/components/ui/toast/Toast.stories.tsx +1 -1
  280. package/src/components/ui/toolbar-button/ToolbarButton.stories.tsx +1 -1
  281. package/src/components/ui/toolbar-button/ToolbarButton.tsx +2 -1
  282. package/src/components/ui/tooltip/Tooltip.stories.tsx +1 -1
  283. package/src/examples/react-hook-form/ReactHookForm.stories.tsx +1 -1
  284. package/src/hooks/index.ts +2 -0
  285. package/src/hooks/useTimer.test.ts +150 -0
  286. package/src/hooks/useTimer.ts +77 -0
  287. package/src/index.ts +3 -0
  288. package/src/pages.ts +1 -1
  289. package/src/stories/PresetShowcase.stories.tsx +1 -1
  290. package/src/stories/ThemePresets.stories.tsx +1 -1
  291. package/src/theme/ColorSystem.stories.tsx +323 -0
  292. package/src/theme/Colors.stories.tsx +74 -9
  293. package/src/theme/barrel.ts +1 -0
  294. package/src/theme/config.ts +20 -3
  295. package/src/theme/elevation.stories.tsx +1 -1
  296. package/src/theme/extracted-colors-dataviz.ts +21 -0
  297. package/src/theme/extracted-colors-ui.ts +20 -0
  298. package/src/theme/global.css +69 -53
  299. package/src/theme/gradients.test.ts +25 -0
  300. package/src/theme/gradients.ts +36 -0
  301. package/src/theme/shadows.stories.tsx +1 -1
  302. package/src/theme/tokens/primitives.test.ts +232 -0
  303. package/src/theme/tokens/primitives.ts +238 -87
  304. package/src/theme/tokens/semantic.ts +101 -81
  305. package/src/theme/workout-tokens.ts +26 -21
  306. package/src/utils/avatar-color.ts +3 -3
  307. package/tailwind.config.js +15 -3
@@ -0,0 +1,254 @@
1
+ /**
2
+ * Set modalities — every per-rep strength set-type rendered by the REAL
3
+ * {@link VelocityStrip}. One strip model for every set type: it defaults to the
4
+ * target rep count as grey slots, overshoot grows the strip, and open-ended sets
5
+ * (AMRAP · the myo tail) carry a persistent cyan "continue" slot. Each card
6
+ * carries a `Collapse` accordion showing how to configure the `set` prop for that
7
+ * view. Promoted from the Lab/Explorations "Set Modalities" specimen once the
8
+ * vocabulary hardened into VelocityStrip's `set` descriptor.
9
+ */
10
+ import type { Meta, StoryObj } from '@storybook/react-vite'
11
+ import { View, Text } from 'react-native'
12
+ import { VelocityStrip, type VelocitySet } from './VelocityStrip'
13
+ import { Collapse, CollapseButton, CollapseContent } from '../../ui/collapse/Collapse'
14
+ import { SET_STRIP_VARIABLE_COLOR as CYAN } from './SetStrip'
15
+ import {
16
+ GREY,
17
+ velColor,
18
+ T_PRIMARY,
19
+ T_SECONDARY,
20
+ T_TERTIARY,
21
+ INSET,
22
+ BORDER_SUBTLE,
23
+ Page,
24
+ } from './setHeadingKit'
25
+
26
+ const INTER = 'Inter, sans-serif'
27
+ const VAR_EDGE = '#22465F' // cyan-800 — the continue-slot outline
28
+ const CYAN_TEXT = '#22D3EE'
29
+
30
+ /** Pretty-print a value as a compact TS literal (single-line arrays). */
31
+ function formatValue(value: unknown): string {
32
+ if (Array.isArray(value)) {
33
+ if (value.length > 0 && Array.isArray(value[0])) {
34
+ return `[${value.map((v) => formatValue(v)).join(', ')}]`
35
+ }
36
+ return `[${(value as number[]).join(', ')}]`
37
+ }
38
+ return typeof value === 'string' ? `'${value}'` : String(value)
39
+ }
40
+
41
+ /** The exact `set` prop, pretty-printed as a TS object for the accordion. */
42
+ function formatSet(set: VelocitySet): string {
43
+ const body = Object.entries(set)
44
+ .map(([key, value]) => ` ${key}: ${formatValue(value)},`)
45
+ .join('\n')
46
+ return `set={{\n${body}\n}}`
47
+ }
48
+
49
+ type Modality = {
50
+ name: string
51
+ alias: string
52
+ tags: string[]
53
+ def: string
54
+ useWhen: string
55
+ set: VelocitySet
56
+ }
57
+
58
+ // Representative velocities per colour bucket, matching the exploration's VEL map
59
+ // (g/a/o/r → the real velColor() ramp: fastest green → slowest red).
60
+ const G = 1.1
61
+ const A = 0.85
62
+ const O = 0.6
63
+ const R = 0.4
64
+
65
+ const MODS: Modality[] = [
66
+ {
67
+ name: 'Straight set',
68
+ alias: '3 × 10',
69
+ tags: ['fixed reps'],
70
+ def: 'A fixed number of reps at a fixed load — the baseline every other type varies from. Done reps colour; the remainder to the planned count sits grey.',
71
+ useWhen: 'A prescribed rep count at a fixed load — the default set.',
72
+ set: { type: 'straight', velocities: [G, A, A, O, O, R], planned: 10 },
73
+ },
74
+ {
75
+ name: 'Rep-range',
76
+ alias: '8–12',
77
+ tags: ['bounded reps'],
78
+ def: 'A floor and a ceiling — committed reps to the floor (grey todo), then a variable window (cyan) to the ceiling. A done variable rep is a real rep and colours normally.',
79
+ useWhen: 'A hypertrophy set prescribed as a range (e.g. 8–12) rather than a fixed count.',
80
+ set: { type: 'range', velocities: [G, A, A, O, O, O, R, R, A], floor: 8, max: 12 },
81
+ },
82
+ {
83
+ name: 'AMRAP',
84
+ alias: 'as many reps as possible',
85
+ tags: ['open-ended'],
86
+ def: 'One set, no cap — the target is a floor to beat. Velocity decay is the story; the trailing cyan slot never closes.',
87
+ useWhen: 'A final "leave nothing" set, or a rep-out test where the count is the outcome.',
88
+ set: { type: 'amrap', velocities: [G, G, A, A, O, O, O, R, R, R], target: 8 },
89
+ },
90
+ {
91
+ name: 'Drop set',
92
+ alias: 'strip / dropset',
93
+ tags: ['load drops', 'open-ended'],
94
+ def: 'Reps to failure at a load, then DROP the load (no rest) and continue — 1–3 drops. Sub-loads split by a WIDE notch gap.',
95
+ useWhen: 'Extending a set past failure by shedding load — the notch marks each weight drop.',
96
+ set: { type: 'drop', subloads: [[G, A, O, O, R], [A, O, R], [O, R]] },
97
+ },
98
+ {
99
+ name: 'Myo-reps',
100
+ alias: 'rest-pause',
101
+ tags: ['clusters', 'open-ended'],
102
+ def: 'Activation set to near-failure, then rest-pause mini-clusters at the SAME load until a cluster fails. Open tail → cyan continue.',
103
+ useWhen: 'High-density hypertrophy: one activation set milked for extra clusters.',
104
+ set: { type: 'myo', activation: [G, A, A, O, O, R], clusters: [[A, O, R], [O, R]], open: true },
105
+ },
106
+ {
107
+ name: 'Cluster set',
108
+ alias: 'intra-set rest',
109
+ tags: ['fixed reps', 'intra-rest'],
110
+ def: 'A fixed rep count at a HIGH load, broken by short intra-set rests so every rep stays fast — power, not failure. Fixed count → no cyan tail.',
111
+ useWhen: 'Strength/power work where each rep must stay fast; rests are planned, count is fixed.',
112
+ set: { type: 'cluster', velocities: [G, G, G, A, G, G, A, G], groupSize: 2, planned: 10 },
113
+ },
114
+ ]
115
+
116
+ function tagStyle(open: boolean) {
117
+ return {
118
+ fontFamily: INTER,
119
+ fontSize: 10,
120
+ fontWeight: '600' as const,
121
+ letterSpacing: 0.5,
122
+ textTransform: 'uppercase' as const,
123
+ color: open ? CYAN_TEXT : T_TERTIARY,
124
+ borderWidth: 1,
125
+ borderColor: open ? VAR_EDGE : '#2A2A2E',
126
+ borderRadius: 999,
127
+ paddingVertical: 3,
128
+ paddingHorizontal: 8,
129
+ overflow: 'hidden' as const,
130
+ }
131
+ }
132
+
133
+ function ConfigAccordion({ set, useWhen }: { set: VelocitySet; useWhen: string }) {
134
+ return (
135
+ <Collapse>
136
+ <CollapseButton className="px-0 py-2 rounded-none">
137
+ <Text style={{ fontFamily: INTER, fontSize: 11, fontWeight: '700', letterSpacing: 0.4, color: CYAN_TEXT }}>
138
+ How to configure this view
139
+ </Text>
140
+ </CollapseButton>
141
+ <CollapseContent className="px-0">
142
+ <View style={{ backgroundColor: '#0A0A0A', borderWidth: 1, borderColor: '#2A2A2E', borderRadius: 8, padding: 12, gap: 8 }}>
143
+ <Text style={{ fontFamily: 'monospace', fontSize: 11, lineHeight: 17, color: T_SECONDARY }}>
144
+ {`<VelocityStrip\n variant="mini"\n ${formatSet(set).replace(/\n/g, '\n ')}\n/>`}
145
+ </Text>
146
+ <Text style={{ fontFamily: INTER, fontSize: 12, color: T_TERTIARY, lineHeight: 17 }}>
147
+ Use when: {useWhen}
148
+ </Text>
149
+ </View>
150
+ </CollapseContent>
151
+ </Collapse>
152
+ )
153
+ }
154
+
155
+ function Card({ m }: { m: Modality }) {
156
+ return (
157
+ <View style={{ backgroundColor: INSET, borderWidth: 1, borderColor: '#2A2A2E', borderRadius: 12, padding: 18, gap: 12, width: 460 }}>
158
+ <View style={{ flexDirection: 'row', alignItems: 'baseline', justifyContent: 'space-between', flexWrap: 'wrap', gap: 8 }}>
159
+ <Text style={{ fontFamily: INTER, fontSize: 16, fontWeight: '700', color: T_PRIMARY }}>
160
+ {m.name} <Text style={{ fontSize: 12, fontWeight: '500', color: T_TERTIARY }}>{m.alias}</Text>
161
+ </Text>
162
+ <View style={{ flexDirection: 'row', gap: 6 }}>
163
+ {m.tags.map((t) => {
164
+ const open = /open-ended/.test(t)
165
+ return (
166
+ <Text key={t} style={tagStyle(open)}>
167
+ {t}
168
+ </Text>
169
+ )
170
+ })}
171
+ </View>
172
+ </View>
173
+ <Text style={{ fontFamily: INTER, fontSize: 13, color: T_SECONDARY, lineHeight: 19 }}>{m.def}</Text>
174
+ <View style={{ paddingVertical: 6 }}>
175
+ <VelocityStrip variant="mini" set={m.set} />
176
+ </View>
177
+ <View style={{ height: 1, backgroundColor: BORDER_SUBTLE }} />
178
+ <ConfigAccordion set={m.set} useWhen={m.useWhen} />
179
+ </View>
180
+ )
181
+ }
182
+
183
+ function Principle({ k, title, body }: { k: string; title: string; body: string }) {
184
+ return (
185
+ <View style={{ flex: 1, backgroundColor: INSET, borderWidth: 1, borderColor: '#2A2A2E', borderRadius: 10, padding: 16, gap: 7, minWidth: 220 }}>
186
+ <Text style={{ fontFamily: INTER, fontSize: 10, fontWeight: '600', letterSpacing: 1.2, textTransform: 'uppercase', color: CYAN_TEXT }}>{k}</Text>
187
+ <Text style={{ fontFamily: INTER, fontSize: 14, fontWeight: '600', color: T_PRIMARY }}>{title}</Text>
188
+ <Text style={{ fontFamily: INTER, fontSize: 12.5, color: T_SECONDARY, lineHeight: 18 }}>{body}</Text>
189
+ </View>
190
+ )
191
+ }
192
+
193
+ function Swatch({ color, label, outlined }: { color: string; label: string; outlined?: boolean }) {
194
+ return (
195
+ <View style={{ flexDirection: 'row', alignItems: 'center', gap: 7 }}>
196
+ <View style={{ width: 22, height: 10, borderRadius: 2, backgroundColor: color, ...(outlined ? { borderWidth: 1, borderColor: VAR_EDGE } : {}) }} />
197
+ <Text style={{ fontFamily: INTER, fontSize: 12, color: T_SECONDARY }}>{label}</Text>
198
+ </View>
199
+ )
200
+ }
201
+
202
+ const meta: Meta = {
203
+ title: 'Workout/DataViz/VelocityStrip/Set Modalities',
204
+ parameters: { layout: 'fullscreen' },
205
+ }
206
+ export default meta
207
+ type Story = StoryObj
208
+
209
+ export const StripVocabulary: Story = {
210
+ name: 'One strip vocabulary · every set type',
211
+ render: () => (
212
+ <Page
213
+ title="Set modalities — the VelocityStrip set-type vocabulary"
214
+ note="Every per-rep strength set-type, rendered by the real VelocityStrip via its `set` prop. One strip model: defaults to the target rep count (grey slots) · overshoot grows the strip · open-ended sets (AMRAP · the myo tail) carry a persistent cyan 'continue' slot. Real velocity colours + the cyan variable token. Open each card's accordion for the exact `set` configuration and a 'use when' note."
215
+ >
216
+ <View style={{ flexDirection: 'row', gap: 14, flexWrap: 'wrap', maxWidth: 940 }}>
217
+ <Principle k="default" title="Target reps as slots" body="A set opens as N grey placeholder slots — the prescribed count. Each done rep fills its slot with its velocity colour." />
218
+ <Principle k="overshoot" title="Extra reps grow it" body="Beat the prescription and the strip keeps adding slots. The plan is a floor to draw against, not a cap." />
219
+ <Principle k="open-ended" title="A cyan continue tail" body="AMRAP and the myo tail carry a persistent cyan slot; new reps insert before it — it argues 'there's more'." />
220
+ </View>
221
+
222
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 14, alignItems: 'center', marginTop: 4 }}>
223
+ <Swatch color={velColor(G)} label="fastest" />
224
+ <Swatch color={velColor(A)} label="fast" />
225
+ <Swatch color={velColor(O)} label="moderate" />
226
+ <Swatch color={velColor(R)} label="slow" />
227
+ <Swatch color={GREY} label="planned / to-do" />
228
+ <Swatch color={CYAN} label="variable · continue" outlined />
229
+ </View>
230
+
231
+ <View style={{ height: 1, backgroundColor: BORDER_SUBTLE, marginVertical: 4 }} />
232
+
233
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 16 }}>
234
+ {MODS.map((m) => (
235
+ <Card key={m.name} m={m} />
236
+ ))}
237
+ </View>
238
+ </Page>
239
+ ),
240
+ }
241
+
242
+ export const ActiveSetExpanded: Story = {
243
+ name: 'Straight set · expanded spotlight',
244
+ render: () => (
245
+ <Page
246
+ title="Straight set — the expanded active-set spotlight"
247
+ note="The expanded VelocityStrip for a live straight set: done reps as velocity-height bars, the planned remainder as short grey stubs, and the mean · loss summary derived from the done reps."
248
+ >
249
+ <View style={{ width: 520, gap: 10 }}>
250
+ <VelocityStrip set={{ type: 'straight', velocities: [1.12, 1.05, 0.98, 0.9, 0.82, 0.7], planned: 10 }} expanded />
251
+ </View>
252
+ </Page>
253
+ ),
254
+ }
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Notch across widths — the between-group notch (drop sub-loads / myo clusters /
3
+ * cluster intra-rests) is a fixed 8px gap, held constant at every strip width. This
4
+ * page renders the real {@link VelocityStrip} across a ladder of widths (session-rail
5
+ * → wall dashboard) and across rep / rep-grouping counts, so the notch can be judged
6
+ * at the size it will actually ship at. Same set, stacked and left-aligned across
7
+ * widths: the notch stays put while the bars grow, so it reads as a group break at
8
+ * rail scale without ballooning at wall scale.
9
+ */
10
+ import type { Meta, StoryObj } from '@storybook/react-vite'
11
+ import { View, Text } from 'react-native'
12
+ import { VelocityStrip, type VelocitySet } from './VelocityStrip'
13
+ import { T_PRIMARY, T_SECONDARY, T_TERTIARY, INSET, BORDER_SUBTLE, Page } from './setHeadingKit'
14
+
15
+ const INTER = 'Inter, sans-serif'
16
+ const MONO = 'monospace'
17
+
18
+ // The width ladder: a session-rail row, two mid app widths, a modality card, a wall
19
+ // dashboard. These bracket everywhere the strip renders.
20
+ const WIDTHS = [130, 200, 300, 440, 620] as const
21
+
22
+ // Preview height — the production mini strip is 3px tall; shown a touch taller here so
23
+ // the horizontal notch is legible on screen. Width (the axis under test) is untouched.
24
+ const PREVIEW_HEIGHT = 8
25
+
26
+ // Velocity colour buckets (match the modalities exploration: fastest green → slowest red).
27
+ const G = 1.1
28
+ const A = 0.85
29
+ const O = 0.6
30
+ const R = 0.4
31
+
32
+ /** A descending velocity ramp of length n (1.15 → 0.40), for realistic fatigue. */
33
+ function ramp(n: number): number[] {
34
+ if (n <= 1) return [G]
35
+ return Array.from({ length: n }, (_, i) => {
36
+ const t = i / (n - 1)
37
+ return Math.round((1.15 - t * 0.75) * 100) / 100
38
+ })
39
+ }
40
+
41
+ type Config = { name: string; detail: string; set: VelocitySet }
42
+
43
+ const CONFIGS: Config[] = [
44
+ {
45
+ name: 'Straight · 5',
46
+ detail: '5 reps · one group · no notch',
47
+ set: { type: 'straight', velocities: [G, A, A, O, R], planned: 5 },
48
+ },
49
+ {
50
+ name: 'Straight · 12',
51
+ detail: '12 reps · one group · no notch',
52
+ set: { type: 'straight', velocities: ramp(12), planned: 12 },
53
+ },
54
+ {
55
+ name: 'Drop · 3 loads',
56
+ detail: '3 groups (5 / 3 / 2) · 2 notches',
57
+ set: { type: 'drop', subloads: [[G, A, O, O, R], [A, O, R], [O, R]] },
58
+ },
59
+ {
60
+ name: 'Cluster · groups of 2',
61
+ detail: '10 reps · 5 groups · 4 notches',
62
+ set: { type: 'cluster', velocities: ramp(10), groupSize: 2, planned: 10 },
63
+ },
64
+ {
65
+ name: 'Cluster · groups of 3',
66
+ detail: '15 reps · 5 groups · 4 notches (dense)',
67
+ set: { type: 'cluster', velocities: ramp(15), groupSize: 3, planned: 15 },
68
+ },
69
+ {
70
+ name: 'Myo · open',
71
+ detail: 'activation + 2 clusters · 2 notches + cyan tail',
72
+ set: { type: 'myo', activation: [G, A, A, O, O, R], clusters: [[A, O, R], [O, R]], open: true },
73
+ },
74
+ ]
75
+
76
+ function WidthRow({ set, width }: { set: VelocitySet; width: number }) {
77
+ return (
78
+ <View style={{ flexDirection: 'row', alignItems: 'center', gap: 12 }}>
79
+ <Text style={{ fontFamily: MONO, fontSize: 10, color: T_TERTIARY, width: 44, textAlign: 'right' }}>
80
+ {width}px
81
+ </Text>
82
+ <View style={{ width }}>
83
+ <VelocityStrip variant="mini" set={set} style={{ height: PREVIEW_HEIGHT }} />
84
+ </View>
85
+ </View>
86
+ )
87
+ }
88
+
89
+ function ConfigPanel({ c }: { c: Config }) {
90
+ return (
91
+ <View
92
+ style={{
93
+ backgroundColor: INSET,
94
+ borderWidth: 1,
95
+ borderColor: '#2A2A2E',
96
+ borderRadius: 12,
97
+ padding: 18,
98
+ gap: 14,
99
+ width: 620 + 44 + 12 + 36, // widest strip + label col + gap + panel padding
100
+ }}
101
+ >
102
+ <View style={{ gap: 3 }}>
103
+ <Text style={{ fontFamily: INTER, fontSize: 15, fontWeight: '700', color: T_PRIMARY }}>{c.name}</Text>
104
+ <Text style={{ fontFamily: INTER, fontSize: 12, color: T_TERTIARY }}>{c.detail}</Text>
105
+ </View>
106
+ <View style={{ height: 1, backgroundColor: BORDER_SUBTLE }} />
107
+ <View style={{ gap: 12 }}>
108
+ {WIDTHS.map((w) => (
109
+ <WidthRow key={w} set={c.set} width={w} />
110
+ ))}
111
+ </View>
112
+ </View>
113
+ )
114
+ }
115
+
116
+ const meta: Meta = {
117
+ title: 'Workout/DataViz/VelocityStrip/Responsive Width',
118
+ parameters: { layout: 'fullscreen' },
119
+ }
120
+ export default meta
121
+ type Story = StoryObj
122
+
123
+ export const NotchAcrossWidths: Story = {
124
+ name: 'Between-group notch · across widths',
125
+ render: () => (
126
+ <Page
127
+ title="Notch across widths — a fixed 8px group break"
128
+ note="The notch that separates drop sub-loads, myo clusters and cluster intra-rests is a fixed 8px gap, held constant at every strip width — so it reads as a group break at session-rail scale AND at wall-dashboard scale without ballooning as the strip grows. Each panel is one set type, stacked and left-aligned across the width ladder (130px rail → 620px wall); both the 2px rep gap and the 8px notch hold fixed while only the bars grow. Straight sets carry no notch (baseline). Preview strips are shown at 8px tall for legibility; the production mini strip is 3px."
129
+ >
130
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 18 }}>
131
+ {CONFIGS.map((c) => (
132
+ <ConfigPanel key={c.name} c={c} />
133
+ ))}
134
+ </View>
135
+
136
+ <Text style={{ fontFamily: INTER, fontSize: 12.5, color: T_SECONDARY, lineHeight: 19, maxWidth: 760, marginTop: 4 }}>
137
+ Reading the ladder: the notch holds at 8px everywhere, so at rail scale it is a clear group break
138
+ (4× the rep gap) and at wall scale it stays a tidy break rather than a canyon. Watch the dense
139
+ cluster (groups of 3, 15 reps): even where the bars are thin, the 8px notch separates groups without
140
+ a proportional gap swallowing the strip at large sizes. The single knob is WIDE_GAP in
141
+ VelocityStrip.tsx.
142
+ </Text>
143
+ </Page>
144
+ ),
145
+ }
@@ -1,26 +1,61 @@
1
1
  import { useState } from 'react'
2
2
  import type { Meta, StoryObj } from '@storybook/react-vite'
3
- import { View } from 'react-native'
3
+ import { View, Text } from 'react-native'
4
4
  import { VelocityStrip } from './VelocityStrip'
5
5
 
6
6
  const meta: Meta<typeof VelocityStrip> = {
7
- title: 'Custom/Workout/VelocityStrip',
7
+ title: 'Workout/DataViz/VelocityStrip',
8
8
  component: VelocityStrip,
9
9
  tags: ['autodocs'],
10
- argTypes: {
11
- expanded: {
12
- control: 'boolean',
13
- description: 'Whether the strip is expanded into a bar chart',
10
+ parameters: {
11
+ docs: {
12
+ description: {
13
+ component:
14
+ 'Per-rep velocity strip. Two variants: `mini` (a flat 3px static strip) and `expanded` ' +
15
+ '(the velocity-HEIGHT bar chart, rounded tops). The `expanded` chrome is prop-driven — ' +
16
+ 'with `showNumbers`/`showInfo` on it is the framed chart (raised surface, per-bar m/s ' +
17
+ 'labels, mean/loss info row, interactive tap-to-expand); with both off it is a bare strip, ' +
18
+ 'the active-set spotlight. `height` sets the plot height; `scale` is `peak` (to the set max) ' +
19
+ 'or `fixed` (a fixed ceiling, cross-set-comparable). Feed either `velocities` or a `set` ' +
20
+ 'descriptor (set-type aware — see the ' +
21
+ '[modalities](?path=/docs/workout-dataviz-velocitystrip-modalities--docs) sheet).',
22
+ },
14
23
  },
24
+ },
25
+ argTypes: {
15
26
  variant: {
16
27
  control: 'select',
17
- options: ['full', 'mini'],
28
+ options: ['mini', 'expanded'],
18
29
  description: 'Display variant',
19
30
  },
31
+ expanded: {
32
+ control: 'boolean',
33
+ description: 'expanded (framed): whether the chart is open (toggle for tap-to-expand)',
34
+ },
35
+ showNumbers: {
36
+ control: 'boolean',
37
+ description: 'expanded framed chart: per-bar m/s labels (default true)',
38
+ },
20
39
  showInfo: {
21
40
  control: 'boolean',
22
- description: 'Whether to show the info row (zone name + loss %) in expanded mode',
41
+ description: 'expanded framed chart: the mean/loss info row (default true)',
42
+ },
43
+ height: {
44
+ control: { type: 'number', min: 12, max: 96, step: 2 },
45
+ description: 'expanded plot height in px (bars scale to this). Default 60.',
46
+ },
47
+ scale: {
48
+ control: 'inline-radio',
49
+ options: ['peak', 'fixed'],
50
+ description: 'expanded bar scaling: peak (set max) or fixed (cross-set ceiling)',
23
51
  },
52
+ liveRepIndex: {
53
+ control: 'number',
54
+ description:
55
+ 'expanded framed chart: index of the newest rep to animate (pop / new-peak bounce)',
56
+ },
57
+ set: { control: false, description: 'Structured set descriptor (supersedes `velocities`)' },
58
+ zones: { control: false, description: 'Velocity-zone bands (WA); default scale when absent' },
24
59
  },
25
60
  }
26
61
 
@@ -32,94 +67,122 @@ const slowSet = [0.65, 0.58, 0.52, 0.48, 0.42]
32
67
  const mixedSet = [1.1, 0.95, 0.82, 0.68, 0.55, 0.45]
33
68
  const moderateSet = [0.88, 0.85, 0.82, 0.78, 0.76]
34
69
 
35
- export const DefaultCollapsed: Story = {
36
- args: {
37
- velocities: moderateSet,
38
- onToggle: () => {},
39
- },
40
- }
41
-
42
- export const Expanded: Story = {
70
+ /** Controls-driven: flip `variant` / `showNumbers` / `showInfo` / `height` / `scale` in the panel. */
71
+ export const Playground: Story = {
43
72
  args: {
44
73
  velocities: moderateSet,
74
+ variant: 'expanded',
45
75
  expanded: true,
76
+ showNumbers: true,
77
+ showInfo: true,
78
+ height: 60,
79
+ scale: 'peak',
46
80
  onToggle: () => {},
47
81
  },
82
+ decorators: [
83
+ (Story) => (
84
+ <View style={{ width: 300, padding: 16 }}>
85
+ <Story />
86
+ </View>
87
+ ),
88
+ ],
48
89
  }
49
90
 
50
- export const ExpandedNoInfo: Story = {
51
- args: {
52
- velocities: moderateSet,
53
- expanded: true,
54
- showInfo: false,
55
- onToggle: () => {},
56
- },
57
- }
58
-
59
- export const FastEasySet: Story = {
60
- args: {
61
- velocities: fastSet,
62
- expanded: true,
63
- onToggle: () => {},
64
- },
91
+ /** The flat 3px static strip — the collapsed glance used in cards and rails. */
92
+ export const Mini: Story = {
93
+ args: { velocities: mixedSet, variant: 'mini' },
65
94
  }
66
95
 
67
- export const SlowGrindingSet: Story = {
68
- args: {
69
- velocities: slowSet,
70
- expanded: true,
71
- onToggle: () => {},
72
- },
96
+ /** Framed chart with per-bar m/s labels + info row (numbers ON) — the rich readout. */
97
+ export const ExpandedWithNumbers: Story = {
98
+ args: { velocities: mixedSet, variant: 'expanded', expanded: true },
99
+ decorators: [
100
+ (Story) => (
101
+ <View style={{ width: 300, padding: 16 }}>
102
+ <Story />
103
+ </View>
104
+ ),
105
+ ],
73
106
  }
74
107
 
75
- export const MixedVelocities: Story = {
108
+ /** Bare velocity-height strip (numbers OFF, info OFF, fixed 24px) — the active-set spotlight. */
109
+ export const ExpandedBareSpotlight: Story = {
76
110
  args: {
77
- velocities: mixedSet,
78
- expanded: true,
79
- onToggle: () => {},
111
+ variant: 'expanded',
112
+ showNumbers: false,
113
+ showInfo: false,
114
+ height: 24,
115
+ scale: 'fixed',
116
+ set: { type: 'straight', velocities: [0.95, 0.9, 0.86, 0.8, 0.72], planned: 10 },
80
117
  },
81
118
  }
82
119
 
83
- export const Mini: Story = {
120
+ /** A structured set descriptor (a drop set): the mini variant carries the set-type gap/color encoding. */
121
+ export const SetTypeMini: Story = {
84
122
  args: {
85
- velocities: mixedSet,
86
123
  variant: 'mini',
124
+ set: {
125
+ type: 'drop',
126
+ subloads: [
127
+ [1.0, 0.92],
128
+ [0.85, 0.78],
129
+ [0.7, 0.62],
130
+ ],
131
+ },
87
132
  },
88
133
  }
89
134
 
90
135
  function InteractiveVelocityStrip() {
91
- const [expanded, setExpanded] = useState(false)
136
+ const [open, setOpen] = useState(false)
137
+ // Tap-to-expand: `onToggle` + the controlled `expanded` boolean. Tapping the strip
138
+ // toggles both ways (collapsed 3px ↔ chart). No `onRepPress` here — per-bar rep
139
+ // presses would intercept bar taps and block collapse; that's a separate mode.
92
140
  return (
93
141
  <View style={{ width: 300, padding: 16 }}>
94
- <VelocityStrip
95
- velocities={moderateSet}
96
- expanded={expanded}
97
- onToggle={() => setExpanded(!expanded)}
98
- onRepPress={(index, velocity) =>
99
- console.log(`Rep ${index + 1}: ${velocity}`)
100
- }
101
- />
142
+ <VelocityStrip velocities={moderateSet} expanded={open} onToggle={() => setOpen((v) => !v)} />
102
143
  </View>
103
144
  )
104
145
  }
105
146
 
147
+ /** Tap to expand; tap again to collapse (3px ↔ chart, animated). */
106
148
  export const Interactive: Story = {
107
149
  render: () => <InteractiveVelocityStrip />,
108
150
  }
109
151
 
110
- export const AllProfiles: Story = {
111
- render: () => (
112
- <View style={{ gap: 24, padding: 16 }}>
113
- <View style={{ gap: 8 }}>
114
- <VelocityStrip velocities={fastSet} expanded onToggle={() => {}} />
115
- <VelocityStrip
116
- velocities={moderateSet}
117
- expanded
118
- onToggle={() => {}}
119
- />
120
- <VelocityStrip velocities={slowSet} expanded onToggle={() => {}} />
121
- <VelocityStrip velocities={mixedSet} expanded onToggle={() => {}} />
152
+ /** The four zone profiles across the treatments, so the color scale reads at a glance. */
153
+ export const Profiles: Story = {
154
+ render: () => {
155
+ const rows: [string, number[]][] = [
156
+ ['Speed', fastSet],
157
+ ['Power', moderateSet],
158
+ ['Strength', slowSet],
159
+ ['Mixed', mixedSet],
160
+ ]
161
+ return (
162
+ <View style={{ gap: 20, padding: 16, width: 320 }}>
163
+ {rows.map(([label, velocities]) => (
164
+ <View key={label} style={{ gap: 6 }}>
165
+ <Text style={{ fontFamily: 'Inter, sans-serif', fontSize: 11, color: '#9CA3AF' }}>
166
+ {label}
167
+ </Text>
168
+ <VelocityStrip
169
+ velocities={velocities}
170
+ variant="expanded"
171
+ showInfo={false}
172
+ onToggle={() => {}}
173
+ />
174
+ <VelocityStrip
175
+ variant="expanded"
176
+ showNumbers={false}
177
+ showInfo={false}
178
+ height={24}
179
+ scale="fixed"
180
+ set={{ type: 'straight', velocities, planned: velocities.length }}
181
+ />
182
+ <VelocityStrip velocities={velocities} variant="mini" />
183
+ </View>
184
+ ))}
122
185
  </View>
123
- </View>
124
- ),
186
+ )
187
+ },
125
188
  }