@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.
- package/dist/bodymap.js +241 -189
- package/dist/bodymap.js.map +1 -1
- package/dist/bodymap.mjs +241 -189
- package/dist/bodymap.mjs.map +1 -1
- package/dist/index.d.mts +1017 -130
- package/dist/index.d.ts +1017 -130
- package/dist/index.js +3058 -1090
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2992 -1091
- package/dist/index.mjs.map +1 -1
- package/dist/{pages-MO0JCySL.d.mts → pages-8u_4WbL-.d.mts} +280 -57
- package/dist/{pages-D7Jlssvp.d.ts → pages-DaWiBOGa.d.ts} +280 -57
- package/dist/pages.d.mts +1 -1
- package/dist/pages.d.ts +1 -1
- package/dist/pages.js +1797 -1292
- package/dist/pages.js.map +1 -1
- package/dist/pages.mjs +1797 -1292
- package/dist/pages.mjs.map +1 -1
- package/dist/theme/index.d.mts +464 -268
- package/dist/theme/index.d.ts +464 -268
- package/dist/theme/index.js +303 -191
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +295 -192
- package/dist/theme/index.mjs.map +1 -1
- package/dist/theme/tokens-css.js +160 -143
- package/dist/theme/tokens-css.js.map +1 -1
- package/dist/theme/tokens-css.mjs +160 -143
- package/dist/theme/tokens-css.mjs.map +1 -1
- package/package.json +3 -1
- package/src/arch/Architecture.stories.tsx +870 -0
- package/src/arch/annotations.json +48 -0
- package/src/arch/arch-graph.json +4301 -0
- package/src/components/custom/DateTime/DateTime.stories.tsx +83 -7
- package/src/components/custom/DateTime/DateTime.test.tsx +29 -3
- package/src/components/custom/DateTime/DateTime.tsx +55 -15
- package/src/components/custom/EmptyState/EmptyState.stories.tsx +1 -1
- package/src/components/custom/Gauge/Gauge.stories.tsx +1 -1
- package/src/components/custom/Gauge/Gauge.test.tsx +2 -2
- package/src/components/custom/Gauge/Gauge.tsx +6 -3
- package/src/components/custom/Metric/Metric.stories.tsx +1 -1
- package/src/components/custom/Scatter/Scatter.stories.tsx +1 -1
- package/src/components/custom/Scatter/Scatter.tsx +3 -5
- package/src/components/custom/Sidebar/Sidebar.stories.tsx +1 -1
- package/src/components/custom/Table/Table.stories.tsx +1 -1
- package/src/components/custom/TimerReadout/TimerReadout.stories.tsx +62 -0
- package/src/components/custom/TimerReadout/TimerReadout.test.tsx +72 -0
- package/src/components/custom/TimerReadout/TimerReadout.tsx +75 -0
- package/src/components/custom/TimerReadout/index.ts +1 -0
- package/src/components/custom/Treemap/Treemap.stories.tsx +1 -1
- package/src/components/custom/Treemap/Treemap.tsx +3 -5
- package/src/components/custom/Typography/Typography.stories.tsx +46 -28
- package/src/components/custom/Typography/Typography.test.tsx +13 -3
- package/src/components/custom/Typography/Typography.tsx +5 -0
- package/src/components/custom/Workout/ActiveWorkoutPage.stories.tsx +21 -13
- package/src/components/custom/Workout/ActiveWorkoutPage.test.tsx +16 -13
- package/src/components/custom/Workout/ActiveWorkoutPage.tsx +11 -16
- package/src/components/custom/Workout/BaseBadge.stories.tsx +1 -1
- package/src/components/custom/Workout/BodyMap.stories.tsx +1 -1
- package/src/components/custom/Workout/BodyMap.tsx +6 -3
- package/src/components/custom/Workout/BodyMapDetailPanel.stories.tsx +1 -1
- package/src/components/custom/Workout/BodyMapDetailPanel.tsx +6 -3
- package/src/components/custom/Workout/CapacityBandChart.stories.tsx +1 -1
- package/src/components/custom/Workout/CapacityBandChart.test.tsx +2 -2
- package/src/components/custom/Workout/CapacityBandChart.tsx +9 -6
- package/src/components/custom/Workout/DeviationBar.stories.tsx +1 -1
- package/src/components/custom/Workout/DeviationBar.test.tsx +1 -1
- package/src/components/custom/Workout/DeviationBar.tsx +7 -4
- package/src/components/custom/Workout/ExerciseCard.stories.tsx +51 -66
- package/src/components/custom/Workout/ExerciseCard.test.tsx +146 -143
- package/src/components/custom/Workout/ExerciseCard.tsx +176 -198
- package/src/components/custom/Workout/ExerciseCardHeading.stories.tsx +99 -0
- package/src/components/custom/Workout/ExerciseCardHeading.test.tsx +72 -0
- package/src/components/custom/Workout/ExerciseCardHeading.tsx +43 -0
- package/src/components/custom/Workout/ExerciseCardUnified.stories.tsx +151 -0
- package/src/components/custom/Workout/ExerciseDetailPage.stories.tsx +5 -3
- package/src/components/custom/Workout/ExerciseDetailPage.test.tsx +4 -4
- package/src/components/custom/Workout/ExerciseDetailPage.tsx +6 -6
- package/src/components/custom/Workout/ExerciseHeading.stories.tsx +81 -0
- package/src/components/custom/Workout/ExerciseHeading.test.tsx +77 -0
- package/src/components/custom/Workout/ExerciseHeading.tsx +85 -0
- package/src/components/custom/Workout/ExerciseIndicator.stories.tsx +110 -0
- package/src/components/custom/Workout/ExerciseIndicator.test.tsx +93 -0
- package/src/components/custom/Workout/ExerciseIndicator.tsx +120 -0
- package/src/components/custom/Workout/FatigueMeter.stories.tsx +51 -0
- package/src/components/custom/Workout/FatigueMeter.test.tsx +73 -0
- package/src/components/custom/Workout/FatigueMeter.tsx +82 -0
- package/src/components/custom/Workout/InputBar.stories.tsx +1 -1
- package/src/components/custom/Workout/InputBar.tsx +2 -1
- package/src/components/custom/Workout/IntensityBar.stories.tsx +1 -1
- package/src/components/custom/Workout/IntensityBar.test.tsx +8 -8
- package/src/components/custom/Workout/IntensityBar.tsx +10 -6
- package/src/components/custom/Workout/LiveAuraFrame.stories.tsx +153 -0
- package/src/components/custom/Workout/LiveAuraFrame.test.tsx +74 -0
- package/src/components/custom/Workout/LiveAuraFrame.tsx +105 -0
- package/src/components/custom/Workout/MesoCard.stories.tsx +1 -1
- package/src/components/custom/Workout/MesoCard.tsx +8 -3
- package/src/components/custom/Workout/MesoProgressBar.stories.tsx +1 -1
- package/src/components/custom/Workout/MesoProgressBar.test.tsx +1 -1
- package/src/components/custom/Workout/MesoProgressBar.tsx +3 -2
- package/src/components/custom/Workout/MesoStatusCard.stories.tsx +1 -1
- package/src/components/custom/Workout/MesoStatusCard.tsx +20 -13
- package/src/components/custom/Workout/MetricTiles.stories.tsx +60 -0
- package/src/components/custom/Workout/MetricTiles.test.tsx +58 -0
- package/src/components/custom/Workout/MetricTiles.tsx +48 -0
- package/src/components/custom/Workout/MuscleGroupChip.stories.tsx +1 -1
- package/src/components/custom/Workout/MuscleGroupChip.tsx +7 -4
- package/src/components/custom/Workout/PlaceholderStrip.stories.tsx +1 -1
- package/src/components/custom/Workout/PrBadge.stories.tsx +1 -1
- package/src/components/custom/Workout/PrBadge.tsx +5 -2
- package/src/components/custom/Workout/PrHistoryModal.stories.tsx +1 -1
- package/src/components/custom/Workout/PrHistoryModal.tsx +4 -3
- package/src/components/custom/Workout/ProgramPlanningPage.stories.tsx +4 -16
- package/src/components/custom/Workout/ProgramPlanningPage.tsx +10 -7
- package/src/components/custom/Workout/README.md +146 -4
- package/src/components/custom/Workout/ReadinessCheck.stories.tsx +1 -1
- package/src/components/custom/Workout/ReadinessCheck.tsx +7 -4
- package/src/components/custom/Workout/RestTimer.stories.tsx +1 -1
- package/src/components/custom/Workout/RestTimer.tsx +17 -11
- package/src/components/custom/Workout/RowInventory.stories.tsx +405 -0
- package/src/components/custom/Workout/S3FullRail.stories.tsx +34 -0
- package/src/components/custom/Workout/S3SessionPace.stories.tsx +95 -0
- package/src/components/custom/Workout/S3SessionRailHeading.stories.tsx +61 -0
- package/src/components/custom/Workout/S3SetTypes.stories.tsx +176 -0
- package/src/components/custom/Workout/S3WorkoutExpansion.stories.tsx +240 -0
- package/src/components/custom/Workout/ScheduleTiles.stories.tsx +40 -0
- package/src/components/custom/Workout/ScheduleTiles.test.tsx +34 -0
- package/src/components/custom/Workout/ScheduleTiles.tsx +70 -0
- package/src/components/custom/Workout/SegmentedBar.stories.tsx +99 -0
- package/src/components/custom/Workout/SegmentedBar.test.tsx +77 -0
- package/src/components/custom/Workout/SegmentedBar.tsx +172 -0
- package/src/components/custom/Workout/SegmentedProgressBar.stories.tsx +50 -0
- package/src/components/custom/Workout/SegmentedProgressBar.test.tsx +80 -0
- package/src/components/custom/Workout/SegmentedProgressBar.tsx +67 -0
- package/src/components/custom/Workout/SessionHeader.stories.tsx +121 -0
- package/src/components/custom/Workout/SessionHeader.test.tsx +122 -0
- package/src/components/custom/Workout/SessionHeader.tsx +152 -0
- package/src/components/custom/Workout/SessionRail.stories.tsx +153 -0
- package/src/components/custom/Workout/SessionRail.test.tsx +86 -0
- package/src/components/custom/Workout/SessionRail.tsx +126 -0
- package/src/components/custom/Workout/SetBar.stories.tsx +124 -0
- package/src/components/custom/Workout/SetBar.test.tsx +123 -0
- package/src/components/custom/Workout/SetBar.tsx +171 -0
- package/src/components/custom/Workout/SetRow.stories.tsx +50 -100
- package/src/components/custom/Workout/SetRow.test.tsx +94 -166
- package/src/components/custom/Workout/SetRow.tsx +170 -232
- package/src/components/custom/Workout/SetStrip.stories.tsx +154 -0
- package/src/components/custom/Workout/SetStrip.test.tsx +109 -0
- package/src/components/custom/Workout/SetStrip.tsx +71 -0
- package/src/components/custom/Workout/SetTableHeader.stories.tsx +66 -0
- package/src/components/custom/Workout/SetTableHeader.test.tsx +47 -0
- package/src/components/custom/Workout/SetTableHeader.tsx +88 -0
- package/src/components/custom/Workout/SetsRepsLoad.stories.tsx +47 -0
- package/src/components/custom/Workout/SetsRepsLoad.test.tsx +44 -0
- package/src/components/custom/Workout/SetsRepsLoad.tsx +52 -0
- package/src/components/custom/Workout/Sparkline.stories.tsx +1 -1
- package/src/components/custom/Workout/Sparkline.tsx +2 -1
- package/src/components/custom/Workout/StatusDot.stories.tsx +1 -1
- package/src/components/custom/Workout/StatusDot.test.tsx +2 -2
- package/src/components/custom/Workout/StatusDot.tsx +12 -9
- package/src/components/custom/Workout/StatusPill.stories.tsx +59 -0
- package/src/components/custom/Workout/StatusPill.test.tsx +63 -0
- package/src/components/custom/Workout/StatusPill.tsx +88 -0
- package/src/components/custom/Workout/StrengthTrendChart.stories.tsx +1 -1
- package/src/components/custom/Workout/StrengthTrendChart.tsx +9 -6
- package/src/components/custom/Workout/SupersetWrapper.stories.tsx +1 -1
- package/src/components/custom/Workout/SupersetWrapper.tsx +2 -1
- package/src/components/custom/Workout/TempoBar.stories.tsx +1 -1
- package/src/components/custom/Workout/TempoDisplay.stories.tsx +12 -1
- package/src/components/custom/Workout/TempoDisplay.tsx +29 -36
- package/src/components/custom/Workout/TrainingStatusPage.stories.tsx +1 -1
- package/src/components/custom/Workout/VelocityStrip.modalities.stories.tsx +254 -0
- package/src/components/custom/Workout/VelocityStrip.responsive.stories.tsx +145 -0
- package/src/components/custom/Workout/VelocityStrip.stories.tsx +129 -66
- package/src/components/custom/Workout/VelocityStrip.test.tsx +379 -144
- package/src/components/custom/Workout/VelocityStrip.tsx +508 -120
- package/src/components/custom/Workout/VolumeLandmarkBar.stories.tsx +73 -0
- package/src/components/custom/Workout/VolumeLandmarkBar.test.tsx +119 -0
- package/src/components/custom/Workout/VolumeLandmarkBar.tsx +154 -0
- package/src/components/custom/Workout/WeekRow.stories.tsx +1 -1
- package/src/components/custom/Workout/WeekRow.tsx +3 -2
- package/src/components/custom/Workout/WeightBadge.stories.tsx +1 -1
- package/src/components/custom/Workout/WeightBadge.tsx +6 -2
- package/src/components/custom/Workout/WorkoutCard.stories.tsx +2 -6
- package/src/components/custom/Workout/WorkoutCard.test.tsx +13 -46
- package/src/components/custom/Workout/WorkoutCard.tsx +5 -2
- package/src/components/custom/Workout/WorkoutPill.stories.tsx +1 -1
- package/src/components/custom/Workout/WorkoutPill.tsx +12 -8
- package/src/components/custom/Workout/ZoneTrack.stories.tsx +140 -0
- package/src/components/custom/Workout/ZoneTrack.test.tsx +200 -0
- package/src/components/custom/Workout/ZoneTrack.tsx +315 -0
- package/src/components/custom/Workout/icons.tsx +6 -67
- package/src/components/custom/Workout/index.ts +55 -2
- package/src/components/custom/Workout/metricText.stories.tsx +69 -0
- package/src/components/custom/Workout/metricText.tsx +34 -0
- package/src/components/custom/Workout/paceTone.test.ts +29 -0
- package/src/components/custom/Workout/paceTone.ts +27 -0
- package/src/components/custom/Workout/setHeadingKit.tsx +177 -0
- package/src/components/custom/index.ts +1 -0
- package/src/components/custom/stepper/Stepper.stories.tsx +1 -1
- package/src/components/icons/SvgIcon.tsx +50 -0
- package/src/components/icons/icons.stories.tsx +122 -0
- package/src/components/icons/icons.test.tsx +73 -0
- package/src/components/icons/icons.tsx +153 -0
- package/src/components/icons/index.ts +4 -0
- package/src/components/index.ts +6 -0
- package/src/components/shell/BrandLockup.stories.tsx +27 -0
- package/src/components/shell/BrandLockup.test.tsx +23 -0
- package/src/components/shell/BrandLockup.tsx +47 -0
- package/src/components/shell/DashboardShell.stories.tsx +65 -0
- package/src/components/shell/DashboardShell.test.tsx +42 -0
- package/src/components/shell/DashboardShell.tsx +74 -0
- package/src/components/shell/DeviceIndicator.stories.tsx +28 -0
- package/src/components/shell/DeviceIndicator.test.tsx +26 -0
- package/src/components/shell/DeviceIndicator.tsx +52 -0
- package/src/components/shell/DeviceMenu.stories.tsx +47 -0
- package/src/components/shell/DeviceMenu.test.tsx +40 -0
- package/src/components/shell/DeviceMenu.tsx +65 -0
- package/src/components/shell/DeviceRow.stories.tsx +38 -0
- package/src/components/shell/DeviceRow.test.tsx +37 -0
- package/src/components/shell/DeviceRow.tsx +58 -0
- package/src/components/shell/NavItem.stories.tsx +52 -0
- package/src/components/shell/NavItem.test.tsx +35 -0
- package/src/components/shell/NavItem.tsx +75 -0
- package/src/components/shell/README.md +116 -0
- package/src/components/shell/SessionRailSpecimen.stories.tsx +753 -0
- package/src/components/shell/SessionStatePill.stories.tsx +27 -0
- package/src/components/shell/SessionStatePill.test.tsx +25 -0
- package/src/components/shell/SessionStatePill.tsx +46 -0
- package/src/components/shell/SideNav.stories.tsx +81 -0
- package/src/components/shell/SideNav.test.tsx +51 -0
- package/src/components/shell/SideNav.tsx +74 -0
- package/src/components/shell/TopBar.stories.tsx +49 -0
- package/src/components/shell/TopBar.test.tsx +36 -0
- package/src/components/shell/TopBar.tsx +89 -0
- package/src/components/shell/index.ts +13 -0
- package/src/components/ui/alert/Alert.stories.tsx +1 -1
- package/src/components/ui/autocomplete/Autocomplete.stories.tsx +1 -1
- package/src/components/ui/avatar/Avatar.stories.tsx +1 -1
- package/src/components/ui/badge/Badge.stories.tsx +1 -1
- package/src/components/ui/breadcrumbs/Breadcrumbs.stories.tsx +1 -1
- package/src/components/ui/button/Button.stories.tsx +1 -1
- package/src/components/ui/card/Card.stories.tsx +1 -1
- package/src/components/ui/checkbox/Checkbox.stories.tsx +1 -1
- package/src/components/ui/chip/Chip.stories.tsx +1 -1
- package/src/components/ui/collapse/Collapse.stories.tsx +1 -1
- package/src/components/ui/data-row/DataRow.stories.tsx +1 -1
- package/src/components/ui/divider/Divider.stories.tsx +1 -1
- package/src/components/ui/drawer/Drawer.stories.tsx +1 -1
- package/src/components/ui/form-field/FormField.stories.tsx +1 -1
- package/src/components/ui/help-tip/HelpTip.stories.tsx +1 -1
- package/src/components/ui/icon-box/IconBox.stories.tsx +1 -1
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/indicator/Indicator.stories.tsx +38 -2
- package/src/components/ui/indicator/Indicator.test.tsx +20 -1
- package/src/components/ui/indicator/Indicator.tsx +50 -6
- package/src/components/ui/indicator/index.ts +1 -1
- package/src/components/ui/input/Input.stories.tsx +1 -1
- package/src/components/ui/link/Link.stories.tsx +1 -1
- package/src/components/ui/list-item/ListItem.stories.tsx +1 -1
- package/src/components/ui/menu/Menu.stories.tsx +1 -1
- package/src/components/ui/modal/Modal.stories.tsx +1 -1
- package/src/components/ui/pill/Pill.stories.tsx +1 -1
- package/src/components/ui/popover/Popover.stories.tsx +1 -1
- package/src/components/ui/progress/Progress.stories.tsx +1 -1
- package/src/components/ui/radio/Radio.stories.tsx +1 -1
- package/src/components/ui/section/Section.stories.tsx +1 -1
- package/src/components/ui/select/Select.stories.tsx +1 -1
- package/src/components/ui/skeleton/Skeleton.stories.tsx +1 -1
- package/src/components/ui/spinner/Spinner.stories.tsx +1 -1
- package/src/components/ui/spinner/Spinner.tsx +3 -2
- package/src/components/ui/stack/Stack.stories.tsx +1 -1
- package/src/components/ui/surface/Surface.stories.tsx +1 -1
- package/src/components/ui/switch/Switch.stories.tsx +1 -1
- package/src/components/ui/tabs/Tabs.stories.tsx +1 -1
- package/src/components/ui/tile/Tile.stories.tsx +79 -0
- package/src/components/ui/tile/Tile.test.tsx +48 -0
- package/src/components/ui/tile/Tile.tsx +64 -0
- package/src/components/ui/tile/index.ts +2 -0
- package/src/components/ui/toast/Toast.stories.tsx +1 -1
- package/src/components/ui/toolbar-button/ToolbarButton.stories.tsx +1 -1
- package/src/components/ui/toolbar-button/ToolbarButton.tsx +2 -1
- package/src/components/ui/tooltip/Tooltip.stories.tsx +1 -1
- package/src/examples/react-hook-form/ReactHookForm.stories.tsx +1 -1
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useTimer.test.ts +150 -0
- package/src/hooks/useTimer.ts +77 -0
- package/src/index.ts +3 -0
- package/src/pages.ts +1 -1
- package/src/stories/PresetShowcase.stories.tsx +1 -1
- package/src/stories/ThemePresets.stories.tsx +1 -1
- package/src/theme/ColorSystem.stories.tsx +323 -0
- package/src/theme/Colors.stories.tsx +74 -9
- package/src/theme/barrel.ts +1 -0
- package/src/theme/config.ts +20 -3
- package/src/theme/elevation.stories.tsx +1 -1
- package/src/theme/extracted-colors-dataviz.ts +21 -0
- package/src/theme/extracted-colors-ui.ts +20 -0
- package/src/theme/global.css +69 -53
- package/src/theme/gradients.test.ts +25 -0
- package/src/theme/gradients.ts +36 -0
- package/src/theme/shadows.stories.tsx +1 -1
- package/src/theme/tokens/primitives.test.ts +232 -0
- package/src/theme/tokens/primitives.ts +238 -87
- package/src/theme/tokens/semantic.ts +101 -81
- package/src/theme/workout-tokens.ts +26 -21
- package/src/utils/avatar-color.ts +3 -3
- package/tailwind.config.js +15 -3
|
@@ -1,32 +1,45 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
2
|
import { View } from 'react-native'
|
|
3
|
-
import {
|
|
4
|
-
Typography,
|
|
5
|
-
Heading,
|
|
6
|
-
Paragraph,
|
|
7
|
-
Caption,
|
|
8
|
-
Label,
|
|
9
|
-
Overline,
|
|
10
|
-
} from './Typography'
|
|
3
|
+
import { Typography, Heading, Paragraph, Caption, Label, Overline } from './Typography'
|
|
11
4
|
|
|
12
5
|
const meta: Meta<typeof Typography> = {
|
|
13
|
-
title: '
|
|
6
|
+
title: 'Foundations/Typography',
|
|
14
7
|
component: Typography,
|
|
15
8
|
tags: ['autodocs'],
|
|
16
9
|
argTypes: {
|
|
17
10
|
variant: {
|
|
18
11
|
control: 'select',
|
|
19
12
|
options: [
|
|
20
|
-
'h1',
|
|
21
|
-
'
|
|
22
|
-
'
|
|
13
|
+
'h1',
|
|
14
|
+
'h2',
|
|
15
|
+
'h3',
|
|
16
|
+
'h4',
|
|
17
|
+
'h5',
|
|
18
|
+
'h6',
|
|
19
|
+
'body1',
|
|
20
|
+
'body2',
|
|
21
|
+
'subtitle1',
|
|
22
|
+
'subtitle2',
|
|
23
|
+
'caption',
|
|
24
|
+
'overline',
|
|
25
|
+
'button',
|
|
26
|
+
'mono',
|
|
27
|
+
'monoLabel',
|
|
23
28
|
],
|
|
24
29
|
},
|
|
25
30
|
color: {
|
|
26
31
|
control: 'select',
|
|
27
32
|
options: [
|
|
28
|
-
'primary',
|
|
29
|
-
'
|
|
33
|
+
'primary',
|
|
34
|
+
'secondary',
|
|
35
|
+
'tertiary',
|
|
36
|
+
'disabled',
|
|
37
|
+
'inverse',
|
|
38
|
+
'success',
|
|
39
|
+
'error',
|
|
40
|
+
'warning',
|
|
41
|
+
'info',
|
|
42
|
+
'inherit',
|
|
30
43
|
],
|
|
31
44
|
},
|
|
32
45
|
align: {
|
|
@@ -65,19 +78,15 @@ export const AllBody: Story = {
|
|
|
65
78
|
render: () => (
|
|
66
79
|
<View style={{ gap: 16, maxWidth: 400 }}>
|
|
67
80
|
<Typography variant="body1">
|
|
68
|
-
Body 1 - This is the default body text style. It's used for main content
|
|
69
|
-
|
|
81
|
+
Body 1 - This is the default body text style. It's used for main content and paragraphs
|
|
82
|
+
throughout the application.
|
|
70
83
|
</Typography>
|
|
71
84
|
<Typography variant="body2">
|
|
72
|
-
Body 2 - This is a smaller body text style. It's useful for secondary
|
|
73
|
-
|
|
74
|
-
</Typography>
|
|
75
|
-
<Typography variant="subtitle1">
|
|
76
|
-
Subtitle 1 - Semi-bold text for emphasis
|
|
77
|
-
</Typography>
|
|
78
|
-
<Typography variant="subtitle2">
|
|
79
|
-
Subtitle 2 - Smaller semi-bold text
|
|
85
|
+
Body 2 - This is a smaller body text style. It's useful for secondary content or when
|
|
86
|
+
you need more compact text.
|
|
80
87
|
</Typography>
|
|
88
|
+
<Typography variant="subtitle1">Subtitle 1 - Semi-bold text for emphasis</Typography>
|
|
89
|
+
<Typography variant="subtitle2">Subtitle 2 - Smaller semi-bold text</Typography>
|
|
81
90
|
</View>
|
|
82
91
|
),
|
|
83
92
|
}
|
|
@@ -92,6 +101,16 @@ export const AllUtility: Story = {
|
|
|
92
101
|
),
|
|
93
102
|
}
|
|
94
103
|
|
|
104
|
+
/** Monospace technical readouts (clocks, ids, metrics) and their all-caps label form. */
|
|
105
|
+
export const Mono: Story = {
|
|
106
|
+
render: () => (
|
|
107
|
+
<View style={{ gap: 16 }}>
|
|
108
|
+
<Typography variant="mono">mono — 16:12 · Voltra-A3F2 · 0.42 m/s</Typography>
|
|
109
|
+
<Typography variant="monoLabel">monoLabel — live status label</Typography>
|
|
110
|
+
</View>
|
|
111
|
+
),
|
|
112
|
+
}
|
|
113
|
+
|
|
95
114
|
export const AllColors: Story = {
|
|
96
115
|
render: () => (
|
|
97
116
|
<View style={{ gap: 8 }}>
|
|
@@ -121,12 +140,11 @@ export const ParagraphComponent: Story = {
|
|
|
121
140
|
render: () => (
|
|
122
141
|
<View style={{ gap: 16, maxWidth: 400 }}>
|
|
123
142
|
<Paragraph>
|
|
124
|
-
This is a regular paragraph using the default body1 variant.
|
|
125
|
-
|
|
143
|
+
This is a regular paragraph using the default body1 variant. It's great for main
|
|
144
|
+
content.
|
|
126
145
|
</Paragraph>
|
|
127
146
|
<Paragraph small>
|
|
128
|
-
This is a small paragraph using the body2 variant.
|
|
129
|
-
It's useful for secondary content.
|
|
147
|
+
This is a small paragraph using the body2 variant. It's useful for secondary content.
|
|
130
148
|
</Paragraph>
|
|
131
149
|
</View>
|
|
132
150
|
),
|
|
@@ -77,6 +77,18 @@ describe('Typography', () => {
|
|
|
77
77
|
})
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
+
describe('mono variants', () => {
|
|
81
|
+
it('renders the mono variant', () => {
|
|
82
|
+
render(<Typography variant="mono">16:12</Typography>)
|
|
83
|
+
expect(screen.getByText('16:12')).toBeInTheDocument()
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
it('renders the monoLabel variant', () => {
|
|
87
|
+
render(<Typography variant="monoLabel">live</Typography>)
|
|
88
|
+
expect(screen.getByText('live')).toBeInTheDocument()
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
|
|
80
92
|
describe('accessibility', () => {
|
|
81
93
|
it('headings have no accessibility violations', async () => {
|
|
82
94
|
const { container } = render(
|
|
@@ -91,9 +103,7 @@ describe('Typography', () => {
|
|
|
91
103
|
})
|
|
92
104
|
|
|
93
105
|
it('body text has no accessibility violations', async () => {
|
|
94
|
-
const { container } = render(
|
|
95
|
-
<Typography variant="body1">Body text content</Typography>
|
|
96
|
-
)
|
|
106
|
+
const { container } = render(<Typography variant="body1">Body text content</Typography>)
|
|
97
107
|
|
|
98
108
|
const results = await axe(container)
|
|
99
109
|
expect(results).toHaveNoViolations()
|
|
@@ -16,6 +16,8 @@ export type TypographyVariant =
|
|
|
16
16
|
| 'caption'
|
|
17
17
|
| 'overline'
|
|
18
18
|
| 'button'
|
|
19
|
+
| 'mono'
|
|
20
|
+
| 'monoLabel'
|
|
19
21
|
|
|
20
22
|
export type TypographyColor =
|
|
21
23
|
| 'primary'
|
|
@@ -70,6 +72,9 @@ const variantStyles: Record<TypographyVariant, string> = {
|
|
|
70
72
|
caption: 'font-body text-xs font-normal leading-loose',
|
|
71
73
|
overline: 'font-body text-xs font-semibold uppercase tracking-widest leading-relaxed',
|
|
72
74
|
button: 'font-sans text-sm font-semibold leading-relaxed',
|
|
75
|
+
// Monospace technical readouts (clocks, ids, metrics) and their all-caps label form.
|
|
76
|
+
mono: 'font-mono text-xs font-normal leading-normal',
|
|
77
|
+
monoLabel: 'font-mono text-xs font-bold uppercase tracking-wide leading-normal',
|
|
73
78
|
}
|
|
74
79
|
|
|
75
80
|
const colorStyles: Record<TypographyColor, string> = {
|
|
@@ -2,36 +2,45 @@ import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
|
2
2
|
import { ActiveWorkoutPage, type ActiveWorkoutExercise } from './ActiveWorkoutPage'
|
|
3
3
|
import type { SetRowProps } from './SetRow'
|
|
4
4
|
|
|
5
|
+
const velocities = (base: number): number[] =>
|
|
6
|
+
Array.from({ length: 8 }, (_, i) => Number((base - i * 0.03).toFixed(2)))
|
|
7
|
+
|
|
8
|
+
// logged sets are done; the next set is being performed (live, a couple reps in);
|
|
9
|
+
// the remainder are planned todo. Mirrors an active workout mid-set.
|
|
5
10
|
function activeSets(weight: number, logged: number, total: number): SetRowProps[] {
|
|
6
11
|
return Array.from({ length: total }, (_, i) => {
|
|
7
12
|
const setNumber = i + 1
|
|
8
13
|
if (setNumber <= logged) {
|
|
9
14
|
return {
|
|
10
|
-
|
|
15
|
+
state: 'done' as const,
|
|
11
16
|
setNumber,
|
|
12
|
-
previous: { reps: 8, weight: weight - 5 },
|
|
13
17
|
reps: 8,
|
|
14
18
|
weight,
|
|
15
19
|
rpe: 7.5 + setNumber * 0.5,
|
|
16
20
|
unit: 'lbs' as const,
|
|
21
|
+
velocities: velocities(0.74 - (setNumber - 1) * 0.03),
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (setNumber === logged + 1) {
|
|
25
|
+
return {
|
|
26
|
+
state: 'live' as const,
|
|
27
|
+
setNumber,
|
|
28
|
+
unit: 'lbs' as const,
|
|
29
|
+
target: { reps: 8, weight },
|
|
30
|
+
reps: 8,
|
|
31
|
+
weight,
|
|
32
|
+
velocities: velocities(0.7).slice(0, 3),
|
|
17
33
|
}
|
|
18
34
|
}
|
|
19
35
|
return {
|
|
20
|
-
|
|
36
|
+
state: 'todo' as const,
|
|
21
37
|
setNumber,
|
|
22
|
-
previous: { reps: 8, weight: weight - 5 },
|
|
23
|
-
reps: null,
|
|
24
|
-
weight: null,
|
|
25
38
|
unit: 'lbs' as const,
|
|
26
|
-
|
|
27
|
-
targets: { reps: 8, weight },
|
|
39
|
+
target: { reps: 8, weight },
|
|
28
40
|
}
|
|
29
41
|
})
|
|
30
42
|
}
|
|
31
43
|
|
|
32
|
-
const velocities = (base: number): number[] =>
|
|
33
|
-
Array.from({ length: 8 }, (_, i) => Number((base - i * 0.03).toFixed(2)))
|
|
34
|
-
|
|
35
44
|
const exercises: ActiveWorkoutExercise[] = [
|
|
36
45
|
{
|
|
37
46
|
id: 'warmup',
|
|
@@ -48,7 +57,6 @@ const exercises: ActiveWorkoutExercise[] = [
|
|
|
48
57
|
status: 'active',
|
|
49
58
|
unit: 'lbs',
|
|
50
59
|
totalPlannedSets: 4,
|
|
51
|
-
e1rm: { value: 248, unit: 'lbs' },
|
|
52
60
|
tempo: [3, 1, 1, 0],
|
|
53
61
|
setVelocities: [velocities(0.72), velocities(0.68)],
|
|
54
62
|
sets: activeSets(195, 2, 4),
|
|
@@ -85,7 +93,7 @@ const exercises: ActiveWorkoutExercise[] = [
|
|
|
85
93
|
]
|
|
86
94
|
|
|
87
95
|
const meta: Meta<typeof ActiveWorkoutPage> = {
|
|
88
|
-
title: '
|
|
96
|
+
title: 'Pages/Active Workout',
|
|
89
97
|
component: ActiveWorkoutPage,
|
|
90
98
|
parameters: { layout: 'fullscreen' },
|
|
91
99
|
tags: ['autodocs'],
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
countCompletedSets,
|
|
6
6
|
deriveWorkoutProgress,
|
|
7
7
|
findActiveExercise,
|
|
8
|
-
|
|
8
|
+
isUpcomingExercise,
|
|
9
9
|
groupExercises,
|
|
10
10
|
type ActiveWorkoutExercise,
|
|
11
11
|
type ActiveWorkoutPageProps,
|
|
@@ -29,8 +29,16 @@ const exercises: ActiveWorkoutExercise[] = [
|
|
|
29
29
|
totalPlannedSets: 4,
|
|
30
30
|
setVelocities: [[0.72], [0.68]],
|
|
31
31
|
sets: [
|
|
32
|
-
{
|
|
33
|
-
|
|
32
|
+
{
|
|
33
|
+
state: 'done',
|
|
34
|
+
setNumber: 1,
|
|
35
|
+
unit: 'lbs',
|
|
36
|
+
reps: 8,
|
|
37
|
+
weight: 195,
|
|
38
|
+
rpe: 8,
|
|
39
|
+
velocities: [0.72],
|
|
40
|
+
},
|
|
41
|
+
{ state: 'todo', setNumber: 3, unit: 'lbs', target: { reps: 8, weight: 195 } },
|
|
34
42
|
],
|
|
35
43
|
},
|
|
36
44
|
{
|
|
@@ -107,16 +115,11 @@ describe('findActiveExercise', () => {
|
|
|
107
115
|
})
|
|
108
116
|
})
|
|
109
117
|
|
|
110
|
-
describe('
|
|
111
|
-
it('
|
|
112
|
-
expect(
|
|
113
|
-
expect(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
it('expands only the focused active/completed exercise', () => {
|
|
117
|
-
expect(statusToCardState('active', true)).toBe('expanded')
|
|
118
|
-
expect(statusToCardState('active', false)).toBe('collapsed')
|
|
119
|
-
expect(statusToCardState('completed', true)).toBe('expanded')
|
|
118
|
+
describe('isUpcomingExercise', () => {
|
|
119
|
+
it('is true only for upcoming exercises', () => {
|
|
120
|
+
expect(isUpcomingExercise('upcoming')).toBe(true)
|
|
121
|
+
expect(isUpcomingExercise('active')).toBe(false)
|
|
122
|
+
expect(isUpcomingExercise('completed')).toBe(false)
|
|
120
123
|
})
|
|
121
124
|
})
|
|
122
125
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)
|
|
2
2
|
import { useMemo, useState } from 'react'
|
|
3
3
|
import { View, Text, type ViewProps } from 'react-native'
|
|
4
|
-
import { ExerciseCard, type ExerciseCardProps
|
|
4
|
+
import { ExerciseCard, type ExerciseCardProps } from './ExerciseCard'
|
|
5
5
|
import { InputBar } from './InputBar'
|
|
6
6
|
import { RestTimer } from './RestTimer'
|
|
7
7
|
import { SupersetWrapper } from './SupersetWrapper'
|
|
8
8
|
import { type SetRowProps } from './SetRow'
|
|
9
9
|
import { resolveColor } from '../../../theme/resolve-color'
|
|
10
|
+
import { getSemanticColors } from '../../../theme/tokens/semantic'
|
|
10
11
|
|
|
11
|
-
const BRAND_PRIMARY = '
|
|
12
|
+
const BRAND_PRIMARY = getSemanticColors('dark')['brand-primary']
|
|
12
13
|
|
|
13
14
|
/** Where an exercise sits in the during-workout flow. */
|
|
14
15
|
export type ActiveExerciseStatus = 'completed' | 'active' | 'upcoming'
|
|
@@ -31,8 +32,6 @@ export interface ActiveWorkoutExercise {
|
|
|
31
32
|
totalPlannedSets: number
|
|
32
33
|
/** Collapsed summary (sets × reps @ weight) for a completed exercise. */
|
|
33
34
|
summary?: ExerciseCardProps['summary']
|
|
34
|
-
/** Estimated one-rep max badge. */
|
|
35
|
-
e1rm?: ExerciseCardProps['e1rm']
|
|
36
35
|
/** Flags a personal-record exercise. */
|
|
37
36
|
isPR?: boolean
|
|
38
37
|
/** Prescribed tempo, revealed when expanded. */
|
|
@@ -147,13 +146,9 @@ export function findActiveExercise(
|
|
|
147
146
|
return exercises.find((exercise) => exercise.status === 'active') ?? null
|
|
148
147
|
}
|
|
149
148
|
|
|
150
|
-
/**
|
|
151
|
-
export function
|
|
152
|
-
status
|
|
153
|
-
focused: boolean
|
|
154
|
-
): ExerciseCardState {
|
|
155
|
-
if (status === 'upcoming') return 'upcoming'
|
|
156
|
-
return focused ? 'expanded' : 'collapsed'
|
|
149
|
+
/** Whether an exercise renders as the dimmed, not-yet-reached representation (pure). */
|
|
150
|
+
export function isUpcomingExercise(status: ActiveExerciseStatus): boolean {
|
|
151
|
+
return status === 'upcoming'
|
|
157
152
|
}
|
|
158
153
|
|
|
159
154
|
/** Project an exercise onto ExerciseCard props, wiring zoom focus (pure). */
|
|
@@ -164,18 +159,18 @@ export function toActiveCardProps(
|
|
|
164
159
|
supersetPosition: ExerciseCardProps['supersetPosition'] = null,
|
|
165
160
|
supersetColor?: string
|
|
166
161
|
): ExerciseCardProps {
|
|
167
|
-
const
|
|
162
|
+
const upcoming = isUpcomingExercise(exercise.status)
|
|
168
163
|
return {
|
|
169
164
|
name: exercise.name,
|
|
170
|
-
|
|
171
|
-
|
|
165
|
+
upcoming,
|
|
166
|
+
expanded: focused,
|
|
167
|
+
onExpandedChange: onToggle,
|
|
172
168
|
summary: exercise.summary,
|
|
173
|
-
e1rm: exercise.e1rm,
|
|
174
169
|
isPR: exercise.isPR,
|
|
175
170
|
tempo: exercise.tempo,
|
|
176
171
|
setVelocities: exercise.setVelocities,
|
|
177
172
|
totalPlannedSets: exercise.totalPlannedSets,
|
|
178
|
-
sets:
|
|
173
|
+
sets: focused ? exercise.sets : undefined,
|
|
179
174
|
prescription: exercise.prescription,
|
|
180
175
|
previousBest: exercise.previousBest,
|
|
181
176
|
supersetPosition,
|
|
@@ -4,6 +4,7 @@ import { View, Text, Pressable, Animated, Easing, type ViewProps } from 'react-n
|
|
|
4
4
|
import BodyHighlighter, { type ExtendedBodyPart, type Slug } from 'react-native-body-highlighter'
|
|
5
5
|
import { cn } from '../../../utils/cn'
|
|
6
6
|
import { resolveColor } from '../../../theme/resolve-color'
|
|
7
|
+
import { getSemanticColors } from '../../../theme/tokens/semantic'
|
|
7
8
|
import {
|
|
8
9
|
MuscleGroup,
|
|
9
10
|
SimpleMuscleGroup,
|
|
@@ -25,6 +26,8 @@ import {
|
|
|
25
26
|
const Body = ((BodyHighlighter as unknown as { default?: typeof BodyHighlighter }).default ??
|
|
26
27
|
BodyHighlighter) as typeof BodyHighlighter
|
|
27
28
|
|
|
29
|
+
const BRAND_PRIMARY = getSemanticColors('dark')['brand-primary']
|
|
30
|
+
|
|
28
31
|
const OUTLINE_FILL = 'rgba(255,255,255,0.08)'
|
|
29
32
|
const OUTLINE_BORDER = 'rgba(255,255,255,0.12)'
|
|
30
33
|
const BODY_SCALE = 0.8 // 200x400 intrinsic -> ~160x320 px
|
|
@@ -275,7 +278,7 @@ function ViewToggle({ view, onViewChange }: ViewToggleProps) {
|
|
|
275
278
|
borderRadius: 9999,
|
|
276
279
|
backgroundColor: active ? 'rgba(255,121,0,0.16)' : 'transparent',
|
|
277
280
|
borderWidth: 1,
|
|
278
|
-
borderColor: active ?
|
|
281
|
+
borderColor: active ? BRAND_PRIMARY : resolveColor('border-strong'),
|
|
279
282
|
}}
|
|
280
283
|
testID={`body-map-toggle-${side}`}
|
|
281
284
|
>
|
|
@@ -284,7 +287,7 @@ function ViewToggle({ view, onViewChange }: ViewToggleProps) {
|
|
|
284
287
|
fontSize: 12,
|
|
285
288
|
fontFamily: 'Inter, sans-serif',
|
|
286
289
|
fontWeight: active ? '700' : '500',
|
|
287
|
-
color: active ?
|
|
290
|
+
color: active ? BRAND_PRIMARY : resolveColor('text-secondary'),
|
|
288
291
|
textTransform: 'capitalize',
|
|
289
292
|
}}
|
|
290
293
|
>
|
|
@@ -321,7 +324,7 @@ function MuscleButton({ entry, highlighted, onMusclePress }: MuscleButtonProps)
|
|
|
321
324
|
paddingVertical: 3,
|
|
322
325
|
borderRadius: 9999,
|
|
323
326
|
borderWidth: 1,
|
|
324
|
-
borderColor: highlighted ?
|
|
327
|
+
borderColor: highlighted ? BRAND_PRIMARY : resolveColor('border-default'),
|
|
325
328
|
}}
|
|
326
329
|
testID={`body-map-muscle-${entry.key}`}
|
|
327
330
|
>
|
|
@@ -21,7 +21,7 @@ const upcoming: UpcomingExercise[] = [
|
|
|
21
21
|
]
|
|
22
22
|
|
|
23
23
|
const meta: Meta<typeof BodyMapDetailPanel> = {
|
|
24
|
-
title: '
|
|
24
|
+
title: 'Workout/DataViz/BodyMapDetailPanel',
|
|
25
25
|
component: BodyMapDetailPanel,
|
|
26
26
|
tags: ['autodocs'],
|
|
27
27
|
decorators: [
|
|
@@ -18,11 +18,14 @@ import {
|
|
|
18
18
|
type VolumeLandmarks,
|
|
19
19
|
type VolumeStatus,
|
|
20
20
|
} from './muscleTaxonomy'
|
|
21
|
+
import { getSemanticColors } from '../../../theme/tokens/semantic'
|
|
21
22
|
|
|
22
|
-
const
|
|
23
|
+
const t = getSemanticColors('dark')
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
const BRAND_PRIMARY = t['brand-primary']
|
|
26
|
+
|
|
27
|
+
/** Volume track gradient: status-info -> status-success -> status-error. */
|
|
28
|
+
const VOLUME_GRADIENT = `linear-gradient(90deg, ${t['status-info']} 0%, ${t['status-success']} 50%, ${t['status-error']} 100%)`
|
|
26
29
|
|
|
27
30
|
/** Sheet slides up from this offset (px) and the backdrop fades to this opacity. */
|
|
28
31
|
const SLIDE_OFFSET = 400
|
|
@@ -39,7 +39,7 @@ const projection: CapacityBandProjection = {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
const meta: Meta<typeof CapacityBandChart> = {
|
|
42
|
-
title: '
|
|
42
|
+
title: 'Workout/DataViz/CapacityBandChart',
|
|
43
43
|
component: CapacityBandChart,
|
|
44
44
|
tags: ['autodocs'],
|
|
45
45
|
argTypes: {
|
|
@@ -93,8 +93,8 @@ describe('CapacityBandChart', () => {
|
|
|
93
93
|
it('colors dots by status relative to the band', () => {
|
|
94
94
|
render(<CapacityBandChart {...baseProps} />)
|
|
95
95
|
const dots = screen.getAllByTestId('capacity-band-chart-dot')
|
|
96
|
-
expect(dots[0]).toHaveStyle({ backgroundColor: '#
|
|
97
|
-
expect(dots[1]).toHaveStyle({ backgroundColor: '#
|
|
96
|
+
expect(dots[0]).toHaveStyle({ backgroundColor: '#2ED573' }) // within
|
|
97
|
+
expect(dots[1]).toHaveStyle({ backgroundColor: '#F9B415' }) // above
|
|
98
98
|
expect(dots[2]).toHaveStyle({ backgroundColor: '#2196F3' }) // below
|
|
99
99
|
})
|
|
100
100
|
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)
|
|
2
2
|
import { useEffect, useState, useMemo } from 'react'
|
|
3
3
|
import { View, Text, Pressable, Animated, Easing, type ViewProps } from 'react-native'
|
|
4
|
+
import { getSemanticColors } from '../../../theme/tokens/semantic'
|
|
4
5
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const
|
|
6
|
+
const t = getSemanticColors('dark')
|
|
7
|
+
|
|
8
|
+
const STATUS_SUCCESS = t['status-success']
|
|
9
|
+
const STATUS_WARNING = t['status-warning']
|
|
10
|
+
const STATUS_INFO = t['status-info']
|
|
8
11
|
/** Dot outline: near-white ring so load dots read on the band fill and any
|
|
9
12
|
* surface (matches the MesoStatusCard gauge-marker convention). */
|
|
10
13
|
const DOT_BORDER = '#F3F4F6'
|
|
11
|
-
const BAND_FILL = 'rgba(
|
|
12
|
-
const BAND_EDGE = 'rgba(
|
|
13
|
-
const PROJECTION_FILL = 'rgba(
|
|
14
|
+
const BAND_FILL = 'rgba(46,213,115,0.1)'
|
|
15
|
+
const BAND_EDGE = 'rgba(46,213,115,0.45)'
|
|
16
|
+
const PROJECTION_FILL = 'rgba(46,213,115,0.05)'
|
|
14
17
|
|
|
15
18
|
const PADDING_LEFT = 28
|
|
16
19
|
const PADDING_RIGHT = 10
|
|
@@ -3,7 +3,7 @@ import { View } from 'react-native'
|
|
|
3
3
|
import { DeviationBar } from './DeviationBar'
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof DeviationBar> = {
|
|
6
|
-
title: '
|
|
6
|
+
title: 'Workout/DataViz/DeviationBar',
|
|
7
7
|
component: DeviationBar,
|
|
8
8
|
tags: ['autodocs'],
|
|
9
9
|
argTypes: {
|
|
@@ -72,7 +72,7 @@ describe('DeviationBar', () => {
|
|
|
72
72
|
const track = bar.firstElementChild as HTMLElement
|
|
73
73
|
expect(track).toHaveStyle({
|
|
74
74
|
backgroundImage:
|
|
75
|
-
'linear-gradient(90deg, rgba(
|
|
75
|
+
'linear-gradient(90deg, rgba(46,213,115,0.25) 0%, rgba(107,114,128,0.15) 50%, rgba(249,180,21,0.25) 100%)',
|
|
76
76
|
})
|
|
77
77
|
})
|
|
78
78
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
// Font mapping: font-heading=Space Grotesk, font-body=Nunito Sans (UI), font-sans=Inter (body)
|
|
2
2
|
import { View, type ViewProps, type ViewStyle } from 'react-native'
|
|
3
|
+
import { getSemanticColors } from '../../../theme/tokens/semantic'
|
|
4
|
+
|
|
5
|
+
const t = getSemanticColors('dark')
|
|
3
6
|
|
|
4
7
|
export interface DeviationBarProps extends ViewProps {
|
|
5
8
|
deviation: number
|
|
@@ -9,10 +12,10 @@ export interface DeviationBarProps extends ViewProps {
|
|
|
9
12
|
|
|
10
13
|
function getDotColor(deviation: number): string {
|
|
11
14
|
const abs = Math.abs(deviation)
|
|
12
|
-
if (deviation < -0.3) return '
|
|
15
|
+
if (deviation < -0.3) return t['status-success']
|
|
13
16
|
if (abs <= 0.3) return '#6B7280'
|
|
14
|
-
if (abs <= 0.7) return '
|
|
15
|
-
return '
|
|
17
|
+
if (abs <= 0.7) return t['status-warning']
|
|
18
|
+
return t['status-error']
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
function getDeviationDescription(deviation: number): string {
|
|
@@ -55,7 +58,7 @@ export function DeviationBar({
|
|
|
55
58
|
borderRadius: 3,
|
|
56
59
|
// react-native-web renders backgroundImage at runtime; not in RN ViewStyle types
|
|
57
60
|
backgroundImage:
|
|
58
|
-
'linear-gradient(90deg, rgba(
|
|
61
|
+
'linear-gradient(90deg, rgba(46,213,115,0.25) 0%, rgba(107,114,128,0.15) 50%, rgba(249,180,21,0.25) 100%)',
|
|
59
62
|
} as ViewStyle}
|
|
60
63
|
/>
|
|
61
64
|
<View
|