@ssa-ui-kit/widgets 1.0.12 → 1.1.55-canary-79b6b0d-20250224
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/components/AccountBalance/AccountBalance.d.ts +1 -1
- package/dist/components/AccountBalance/BalancePieChart.d.ts +1 -1
- package/dist/components/AccountBalance/BalancePieChartTitle.d.ts +1 -1
- package/dist/components/AccountKeys/AccountKeys.d.ts +1 -1
- package/dist/components/AccountKeys/stories/StoryComponent.d.ts +1 -1
- package/dist/components/Activity/Activity.d.ts +1 -1
- package/dist/components/Activity/ActivityItem.d.ts +1 -1
- package/dist/components/Bmi/Bmi.d.ts +1 -1
- package/dist/components/Bmi/BmiLabels.d.ts +1 -1
- package/dist/components/BotsTable/BotsTable.d.ts +1 -1
- package/dist/components/BotsTable/stories/BotsTable/StoryComponent.d.ts +1 -1
- package/dist/components/BotsTable/stories/BotsTable/components/Actions/ActionIcon.d.ts +1 -1
- package/dist/components/BotsTable/stories/BotsTable/components/Actions/ActionItem.d.ts +1 -1
- package/dist/components/BotsTable/stories/BotsTable/components/Actions/ActionMore.d.ts +1 -1
- package/dist/components/BotsTable/stories/BotsTable/components/Actions/ActionRun.d.ts +1 -1
- package/dist/components/BotsTable/stories/BotsTable/components/Actions/Actions.d.ts +1 -1
- package/dist/components/BotsTable/stories/BotsTable/components/Actions/ActionsWrapper.d.ts +1 -1
- package/dist/components/BotsTable/stories/BotsTable/components/Actions/consts.d.ts +3 -3
- package/dist/components/BotsTable/stories/BotsTable/components/Exchange/Exchange.d.ts +1 -1
- package/dist/components/BotsTable/stories/BotsTable/components/Exchange/consts.d.ts +3 -3
- package/dist/components/BotsTable/stories/BotsTable/components/PNL.d.ts +1 -1
- package/dist/components/BotsTable/stories/BotsTable/components/ROI.d.ts +1 -1
- package/dist/components/BotsTable/stories/BotsTable/components/TableTag.d.ts +1 -1
- package/dist/components/BotsTable/stories/BotsTable/components/Trade/Trade.d.ts +1 -1
- package/dist/components/BotsTable/stories/NoControlOrders/StoryComponent.d.ts +1 -1
- package/dist/components/BotsTable/stories/NoControlOrders/components/ActionMore.d.ts +1 -1
- package/dist/components/BotsTable/stories/NoControlOrders/components/Reason.d.ts +1 -1
- package/dist/components/BotsTable/stories/NoControlOrders/components/TableList.d.ts +1 -1
- package/dist/components/BotsTable/stories/NoControlOrders/components/TableRow.d.ts +1 -1
- package/dist/components/Calories/Calories.d.ts +1 -1
- package/dist/components/Calories/innerContent.d.ts +1 -1
- package/dist/components/ExchangeAccount/ExchangeAccount.d.ts +1 -1
- package/dist/components/HeartRate/BPM.d.ts +1 -1
- package/dist/components/HeartRate/HeartRate.d.ts +1 -1
- package/dist/components/HeartRate/HeartRateLineChart.d.ts +1 -1
- package/dist/components/ListGoals/ListGoals.d.ts +1 -1
- package/dist/components/ListGoals/ListGoalsCard.d.ts +1 -1
- package/dist/components/MealNutrients/MealNutrients.d.ts +1 -1
- package/dist/components/MealNutrients/MealNutrientsLineChart.d.ts +1 -1
- package/dist/components/MealNutrients/MealNutrientsTooltip.d.ts +1 -1
- package/dist/components/MealPlanner/MealPlanner.d.ts +1 -1
- package/dist/components/MealPlanner/MealPlannerCard.d.ts +1 -1
- package/dist/components/StepsCounter/StepsCounter.d.ts +1 -1
- package/dist/components/TradingInfoCard/TradingInfoCard.d.ts +1 -1
- package/dist/components/TradingInfoCard/TradingInfoCardContent.d.ts +1 -1
- package/dist/components/TradingInfoCard/TradingInfoCardTooltip.d.ts +1 -1
- package/dist/components/TradingInfoCard/TradingInfoCardWrapper.d.ts +1 -1
- package/dist/components/TradingScoreboard/TradingScoreboard.d.ts +1 -1
- package/dist/components/TradingScoreboard/helpers.d.ts +4 -4
- package/dist/components/UpcomingWorkouts/UpcomingWorkoutCard.d.ts +1 -1
- package/dist/components/UpcomingWorkouts/UpcomingWorkouts.d.ts +1 -1
- package/dist/components/UserCard/UserCard.d.ts +1 -1
- package/dist/components/UserCard/UserCardBMI.d.ts +1 -1
- package/dist/components/UserCard/UserCardCredentials.d.ts +1 -1
- package/dist/components/UserCard/UserCardItem.d.ts +1 -1
- package/dist/components/WaterConsume/WaterConsume.d.ts +1 -1
- package/dist/index.js +2439 -1
- package/dist/index.js.map +1 -1
- package/package.json +24 -27
- package/.babelrc.js +0 -4
- package/.env +0 -7
- package/.storybook/main.ts +0 -47
- package/.storybook/preview.tsx +0 -22
- package/.storybook/style.css +0 -40
- package/custom-shots/widgets-bots-table--no-control-orders--menu-opened_[w1920px].png +0 -0
- package/custom-shots/widgets-bots-table--no-control-orders--run-reason-modal_[w1920px].png +0 -0
- package/custom-shots/widgets-heart-rate--hint-opened__[w1440px].png +0 -0
- package/custom-shots/widgets-heart-rate--hint-opened__[w1920px].png +0 -0
- package/custom-shots/widgets-heart-rate--hint-opened__[w390px].png +0 -0
- package/custom-shots/widgets-heart-rate--hint-opened__[w900px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__[w1440px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__[w1920px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__[w390px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__[w900px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__dropdown__[w1440px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__dropdown__[w1920px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__dropdown__[w390px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__dropdown__[w900px].png +0 -0
- package/custom-shots/widgets-trading-info-card--hover__[w1920px].png +0 -0
- package/customTest.tsx +0 -35
- package/jest-setup.ts +0 -20
- package/lostpixel.config.ts +0 -29
- package/playwright.config.ts +0 -7
- package/src/components/AccountBalance/AccountBalance.specBackup.tsx +0 -105
- package/src/components/AccountBalance/AccountBalance.stories.tsx +0 -138
- package/src/components/AccountBalance/AccountBalance.tsx +0 -60
- package/src/components/AccountBalance/BalancePieChart.tsx +0 -127
- package/src/components/AccountBalance/BalancePieChartTitle.tsx +0 -54
- package/src/components/AccountBalance/index.ts +0 -4
- package/src/components/AccountBalance/stories/fixtures.ts +0 -26
- package/src/components/AccountBalance/types.ts +0 -41
- package/src/components/AccountKeys/AccountKeys.specBackup.tsx +0 -43
- package/src/components/AccountKeys/AccountKeys.stories.tsx +0 -14
- package/src/components/AccountKeys/AccountKeys.tsx +0 -73
- package/src/components/AccountKeys/helpers.ts +0 -7
- package/src/components/AccountKeys/index.ts +0 -2
- package/src/components/AccountKeys/stories/StoryComponent.tsx +0 -33
- package/src/components/AccountKeys/styles.ts +0 -87
- package/src/components/AccountKeys/types.ts +0 -8
- package/src/components/Activity/Activity.specBackup.tsx +0 -79
- package/src/components/Activity/Activity.stories.tsx +0 -15
- package/src/components/Activity/Activity.tsx +0 -83
- package/src/components/Activity/ActivityItem.tsx +0 -38
- package/src/components/Activity/index.tsx +0 -2
- package/src/components/Activity/mockActivityRequest.ts +0 -106
- package/src/components/Activity/styles.ts +0 -12
- package/src/components/Activity/types.ts +0 -10
- package/src/components/Bmi/Bmi.spec.Backup.tsx +0 -68
- package/src/components/Bmi/Bmi.stories.tsx +0 -10
- package/src/components/Bmi/Bmi.tsx +0 -96
- package/src/components/Bmi/BmiHeatbar.tsx +0 -18
- package/src/components/Bmi/BmiInfo.tsx +0 -11
- package/src/components/Bmi/BmiLabel.tsx +0 -9
- package/src/components/Bmi/BmiLabels.tsx +0 -33
- package/src/components/Bmi/BmiPointer.tsx +0 -15
- package/src/components/Bmi/index.tsx +0 -2
- package/src/components/Bmi/styles.ts +0 -18
- package/src/components/Bmi/types.ts +0 -4
- package/src/components/BotsTable/BotsTable.e2e.ts +0 -77
- package/src/components/BotsTable/BotsTable.specBackup.tsx +0 -125
- package/src/components/BotsTable/BotsTable.tsx +0 -32
- package/src/components/BotsTable/BotsTableCell.tsx +0 -13
- package/src/components/BotsTable/BotsTableHead.tsx +0 -13
- package/src/components/BotsTable/BotsTableRow.tsx +0 -17
- package/src/components/BotsTable/BotsTableWrapper.tsx +0 -23
- package/src/components/BotsTable/index.ts +0 -5
- package/src/components/BotsTable/stories/BotsTable/StoryComponent.tsx +0 -59
- package/src/components/BotsTable/stories/BotsTable/components/Actions/ActionIcon.tsx +0 -11
- package/src/components/BotsTable/stories/BotsTable/components/Actions/ActionItem.tsx +0 -40
- package/src/components/BotsTable/stories/BotsTable/components/Actions/ActionMore.tsx +0 -89
- package/src/components/BotsTable/stories/BotsTable/components/Actions/ActionRun.tsx +0 -133
- package/src/components/BotsTable/stories/BotsTable/components/Actions/Actions.tsx +0 -13
- package/src/components/BotsTable/stories/BotsTable/components/Actions/ActionsWrapper.tsx +0 -21
- package/src/components/BotsTable/stories/BotsTable/components/Actions/consts.tsx +0 -118
- package/src/components/BotsTable/stories/BotsTable/components/Actions/index.ts +0 -6
- package/src/components/BotsTable/stories/BotsTable/components/Exchange/Exchange.tsx +0 -26
- package/src/components/BotsTable/stories/BotsTable/components/Exchange/consts.tsx +0 -157
- package/src/components/BotsTable/stories/BotsTable/components/Exchange/index.ts +0 -1
- package/src/components/BotsTable/stories/BotsTable/components/Exchange/types.ts +0 -6
- package/src/components/BotsTable/stories/BotsTable/components/PNL.tsx +0 -27
- package/src/components/BotsTable/stories/BotsTable/components/ROI.tsx +0 -25
- package/src/components/BotsTable/stories/BotsTable/components/TableTag.tsx +0 -22
- package/src/components/BotsTable/stories/BotsTable/components/Trade/Trade.tsx +0 -8
- package/src/components/BotsTable/stories/BotsTable/components/Trade/consts.ts +0 -14
- package/src/components/BotsTable/stories/BotsTable/components/Trade/index.ts +0 -1
- package/src/components/BotsTable/stories/BotsTable/components/Trade/types.ts +0 -5
- package/src/components/BotsTable/stories/BotsTable/components/index.ts +0 -6
- package/src/components/BotsTable/stories/BotsTable/index.ts +0 -1
- package/src/components/BotsTable/stories/BotsTable/mockData.ts +0 -84
- package/src/components/BotsTable/stories/BotsTable.stories.tsx +0 -39
- package/src/components/BotsTable/stories/NoControlOrders/StoryComponent.tsx +0 -35
- package/src/components/BotsTable/stories/NoControlOrders/components/ActionMore.tsx +0 -95
- package/src/components/BotsTable/stories/NoControlOrders/components/Reason.tsx +0 -11
- package/src/components/BotsTable/stories/NoControlOrders/components/TableList.tsx +0 -45
- package/src/components/BotsTable/stories/NoControlOrders/components/TableRow.tsx +0 -31
- package/src/components/BotsTable/stories/NoControlOrders/components/index.ts +0 -4
- package/src/components/BotsTable/stories/NoControlOrders/mockData.ts +0 -23
- package/src/components/BotsTable/stories/NoControlOrders/types.ts +0 -16
- package/src/components/BotsTable/types.ts +0 -31
- package/src/components/Calories/Calories.specBackup.tsx +0 -11
- package/src/components/Calories/Calories.stories.tsx +0 -26
- package/src/components/Calories/Calories.tsx +0 -54
- package/src/components/Calories/index.tsx +0 -2
- package/src/components/Calories/innerContent.tsx +0 -30
- package/src/components/Calories/types.ts +0 -4
- package/src/components/ExchangeAccount/ExchangeAccount.specBackup.tsx +0 -104
- package/src/components/ExchangeAccount/ExchangeAccount.stories.tsx +0 -108
- package/src/components/ExchangeAccount/ExchangeAccount.tsx +0 -90
- package/src/components/ExchangeAccount/helpers.tsx +0 -153
- package/src/components/ExchangeAccount/index.ts +0 -2
- package/src/components/ExchangeAccount/styles.ts +0 -115
- package/src/components/ExchangeAccount/types.ts +0 -14
- package/src/components/HeartRate/BPM.tsx +0 -43
- package/src/components/HeartRate/HeartRate.e2e.ts +0 -78
- package/src/components/HeartRate/HeartRate.specBackup.tsx +0 -91
- package/src/components/HeartRate/HeartRate.stories.tsx +0 -36
- package/src/components/HeartRate/HeartRate.tsx +0 -105
- package/src/components/HeartRate/HeartRateLineChart.tsx +0 -53
- package/src/components/HeartRate/index.ts +0 -2
- package/src/components/HeartRate/mockHeartRateRequest.ts +0 -15
- package/src/components/HeartRate/types.ts +0 -15
- package/src/components/HeartRate/utils.tsx +0 -8
- package/src/components/ListGoals/ListGoals.specBackup.tsx +0 -82
- package/src/components/ListGoals/ListGoals.stories.tsx +0 -58
- package/src/components/ListGoals/ListGoals.tsx +0 -29
- package/src/components/ListGoals/ListGoalsCard.tsx +0 -61
- package/src/components/ListGoals/index.ts +0 -2
- package/src/components/ListGoals/styles.tsx +0 -11
- package/src/components/ListGoals/types.ts +0 -25
- package/src/components/MealNutrients/MealNutrients.e2e.ts +0 -68
- package/src/components/MealNutrients/MealNutrients.specBackup.tsx +0 -134
- package/src/components/MealNutrients/MealNutrients.stories.tsx +0 -37
- package/src/components/MealNutrients/MealNutrients.tsx +0 -84
- package/src/components/MealNutrients/MealNutrientsLineChart.tsx +0 -89
- package/src/components/MealNutrients/MealNutrientsTooltip.tsx +0 -30
- package/src/components/MealNutrients/chartDefaultConfig.tsx +0 -87
- package/src/components/MealNutrients/index.tsx +0 -2
- package/src/components/MealNutrients/mockMealNutrientsRequest.ts +0 -1246
- package/src/components/MealNutrients/types.ts +0 -37
- package/src/components/MealNutrients/useChartConfig.ts +0 -69
- package/src/components/MealPlanner/MealPlanner.specBackup.tsx +0 -77
- package/src/components/MealPlanner/MealPlanner.stories.tsx +0 -15
- package/src/components/MealPlanner/MealPlanner.tsx +0 -100
- package/src/components/MealPlanner/MealPlannerBadge.tsx +0 -15
- package/src/components/MealPlanner/MealPlannerBars.tsx +0 -19
- package/src/components/MealPlanner/MealPlannerCard.tsx +0 -73
- package/src/components/MealPlanner/MealPlannerLegends.tsx +0 -22
- package/src/components/MealPlanner/index.ts +0 -2
- package/src/components/MealPlanner/mockMealPlannerRequest.ts +0 -70
- package/src/components/MealPlanner/types.ts +0 -21
- package/src/components/StepsCounter/StepsCounter.specBackup.tsx +0 -14
- package/src/components/StepsCounter/StepsCounter.stories.tsx +0 -16
- package/src/components/StepsCounter/StepsCounter.tsx +0 -74
- package/src/components/StepsCounter/index.ts +0 -2
- package/src/components/StepsCounter/types.ts +0 -4
- package/src/components/TradingInfoCard/TradingInfoCard.e2e.ts +0 -18
- package/src/components/TradingInfoCard/TradingInfoCard.specBackup.tsx +0 -116
- package/src/components/TradingInfoCard/TradingInfoCard.stories.tsx +0 -118
- package/src/components/TradingInfoCard/TradingInfoCard.tsx +0 -49
- package/src/components/TradingInfoCard/TradingInfoCardContent.tsx +0 -32
- package/src/components/TradingInfoCard/TradingInfoCardTooltip.tsx +0 -47
- package/src/components/TradingInfoCard/TradingInfoCardWrapper.tsx +0 -72
- package/src/components/TradingInfoCard/index.ts +0 -3
- package/src/components/TradingInfoCard/types.ts +0 -27
- package/src/components/TradingScoreboard/TradingScoreboard.specBackup.tsx +0 -119
- package/src/components/TradingScoreboard/TradingScoreboard.stories.tsx +0 -119
- package/src/components/TradingScoreboard/TradingScoreboard.tsx +0 -41
- package/src/components/TradingScoreboard/TradingScoreboardBase.tsx +0 -17
- package/src/components/TradingScoreboard/helpers.tsx +0 -134
- package/src/components/TradingScoreboard/index.ts +0 -2
- package/src/components/TradingScoreboard/types.ts +0 -18
- package/src/components/UpcomingWorkouts/UpcomingWorkoutCard.tsx +0 -64
- package/src/components/UpcomingWorkouts/UpcomingWorkouts.specBackup.tsx +0 -56
- package/src/components/UpcomingWorkouts/UpcomingWorkouts.stories.tsx +0 -32
- package/src/components/UpcomingWorkouts/UpcomingWorkouts.tsx +0 -27
- package/src/components/UpcomingWorkouts/index.ts +0 -2
- package/src/components/UpcomingWorkouts/style.ts +0 -12
- package/src/components/UpcomingWorkouts/types.ts +0 -23
- package/src/components/UserCard/UserCard.tsx +0 -46
- package/src/components/UserCard/UserCardBMI.tsx +0 -37
- package/src/components/UserCard/UserCardCredentials.tsx +0 -56
- package/src/components/UserCard/UserCardItem.tsx +0 -42
- package/src/components/UserCard/index.tsx +0 -2
- package/src/components/UserCard/types.ts +0 -8
- package/src/components/WaterConsume/WaterConsume.specBackup.tsx +0 -62
- package/src/components/WaterConsume/WaterConsume.stories.tsx +0 -36
- package/src/components/WaterConsume/WaterConsume.tsx +0 -188
- package/src/components/WaterConsume/index.ts +0 -2
- package/src/components/WaterConsume/types.ts +0 -11
- package/src/consts.ts +0 -18
- package/src/index.ts +0 -36
- package/src/injectGlobal.ts +0 -41
- package/test-results/.last-run.json +0 -21
- package/tsbuildcache +0 -1
- package/tsconfig.build.json +0 -44
- package/tsconfig.json +0 -17
- package/webpack.config.js +0 -28
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
Card,
|
|
6
|
-
CardContent,
|
|
7
|
-
CardHeader,
|
|
8
|
-
Typography,
|
|
9
|
-
Wrapper,
|
|
10
|
-
DropdownOptionProps,
|
|
11
|
-
} from '@ssa-ui-kit/core';
|
|
12
|
-
|
|
13
|
-
import { ActivityResp } from './types';
|
|
14
|
-
import { contentWrapper } from './styles';
|
|
15
|
-
|
|
16
|
-
import ActivityItem from './ActivityItem';
|
|
17
|
-
import { DropdownOption } from '@ssa-ui-kit/core';
|
|
18
|
-
import { Dropdown } from '@ssa-ui-kit/core';
|
|
19
|
-
|
|
20
|
-
export const Activity = ({ data }: { data: ActivityResp }) => {
|
|
21
|
-
const [selected, setSelected] = useState<string>('');
|
|
22
|
-
const [options, setOptions] = useState<DropdownOptionProps[]>([]);
|
|
23
|
-
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (data == null || typeof data !== 'object') {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
setOptions(
|
|
30
|
-
Object.keys(data).map((item, index) => ({
|
|
31
|
-
id: index,
|
|
32
|
-
value: `${item.charAt(0).toUpperCase()}${item.slice(1)}`,
|
|
33
|
-
})),
|
|
34
|
-
);
|
|
35
|
-
}, [data]);
|
|
36
|
-
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
if (options?.length > 0 && !selected) {
|
|
39
|
-
handleChange(options[0]);
|
|
40
|
-
}
|
|
41
|
-
}, [options]);
|
|
42
|
-
|
|
43
|
-
const handleChange = (e: DropdownOptionProps) => {
|
|
44
|
-
const value = e.value.toString().toLowerCase();
|
|
45
|
-
|
|
46
|
-
setSelected(value);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<Card
|
|
51
|
-
css={css`
|
|
52
|
-
border-radius: 20px;
|
|
53
|
-
padding-inline: 24px;
|
|
54
|
-
padding-block: 24px;
|
|
55
|
-
`}>
|
|
56
|
-
<CardHeader>
|
|
57
|
-
<Typography variant="h3" weight="bold">
|
|
58
|
-
Activity
|
|
59
|
-
</Typography>
|
|
60
|
-
|
|
61
|
-
{options?.length > 0 && (
|
|
62
|
-
<Dropdown selectedItem={options[0]} onChange={handleChange}>
|
|
63
|
-
{options.map((item, index) => (
|
|
64
|
-
<DropdownOption key={index} value={item.value} />
|
|
65
|
-
))}
|
|
66
|
-
</Dropdown>
|
|
67
|
-
)}
|
|
68
|
-
</CardHeader>
|
|
69
|
-
<CardContent
|
|
70
|
-
css={css`
|
|
71
|
-
width: 100%;
|
|
72
|
-
flex-direction: column;
|
|
73
|
-
`}>
|
|
74
|
-
<Wrapper css={contentWrapper}>
|
|
75
|
-
{Array.isArray(data[selected]) &&
|
|
76
|
-
data[selected].map((item, index) => (
|
|
77
|
-
<ActivityItem key={index} {...item} />
|
|
78
|
-
))}
|
|
79
|
-
</Wrapper>
|
|
80
|
-
</CardContent>
|
|
81
|
-
</Card>
|
|
82
|
-
);
|
|
83
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { css } from '@emotion/react';
|
|
2
|
-
|
|
3
|
-
import { Typography, ProgressBar, ProgressVertical } from '@ssa-ui-kit/core';
|
|
4
|
-
|
|
5
|
-
import { dateFormatters } from '@ssa-ui-kit/utils';
|
|
6
|
-
|
|
7
|
-
import { ActivityItemProps } from './types';
|
|
8
|
-
|
|
9
|
-
const { printDayOfTheWeek } = dateFormatters;
|
|
10
|
-
|
|
11
|
-
const container = css`
|
|
12
|
-
display: flex;
|
|
13
|
-
|
|
14
|
-
align-items: center;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
justify-content: center;
|
|
17
|
-
|
|
18
|
-
height: 162px;
|
|
19
|
-
gap: 10px;
|
|
20
|
-
|
|
21
|
-
font-size: 11px;
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
const ActivityItem = ({ currentValue, date }: ActivityItemProps) => {
|
|
25
|
-
return (
|
|
26
|
-
<div css={container}>
|
|
27
|
-
<ProgressVertical>
|
|
28
|
-
<ProgressBar percentage={currentValue} color="yellow" />
|
|
29
|
-
</ProgressVertical>
|
|
30
|
-
|
|
31
|
-
<Typography variant="subtitle">
|
|
32
|
-
{printDayOfTheWeek(new Date(date).getDay())}
|
|
33
|
-
</Typography>
|
|
34
|
-
</div>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default ActivityItem;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { ActivityResp } from './types';
|
|
2
|
-
|
|
3
|
-
export const mealActivityData: ActivityResp = {
|
|
4
|
-
walking: [
|
|
5
|
-
{
|
|
6
|
-
activity: 'walking',
|
|
7
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
8
|
-
day: 'Sun',
|
|
9
|
-
max: 100,
|
|
10
|
-
currentValue: 83,
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
activity: 'walking',
|
|
14
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
15
|
-
day: 'Mon',
|
|
16
|
-
max: 100,
|
|
17
|
-
currentValue: 53,
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
activity: 'walking',
|
|
21
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
22
|
-
day: 'Tue',
|
|
23
|
-
max: 100,
|
|
24
|
-
currentValue: 54,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
activity: 'walking',
|
|
28
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
29
|
-
day: 'Wed',
|
|
30
|
-
max: 100,
|
|
31
|
-
currentValue: 49,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
activity: 'walking',
|
|
35
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
36
|
-
day: 'Thu',
|
|
37
|
-
max: 100,
|
|
38
|
-
currentValue: 70,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
activity: 'walking',
|
|
42
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
43
|
-
day: 'Fri',
|
|
44
|
-
max: 100,
|
|
45
|
-
currentValue: 8,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
activity: 'walking',
|
|
49
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
50
|
-
day: 'Sat',
|
|
51
|
-
max: 100,
|
|
52
|
-
currentValue: 90,
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
cycling: [
|
|
56
|
-
{
|
|
57
|
-
activity: 'cycling',
|
|
58
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
59
|
-
day: 'Sun',
|
|
60
|
-
max: 100,
|
|
61
|
-
currentValue: 38,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
activity: 'cycling',
|
|
65
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
66
|
-
day: 'Mon',
|
|
67
|
-
max: 100,
|
|
68
|
-
currentValue: 35,
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
activity: 'cycling',
|
|
72
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
73
|
-
day: 'Tue',
|
|
74
|
-
max: 100,
|
|
75
|
-
currentValue: 45,
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
activity: 'cycling',
|
|
79
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
80
|
-
day: 'Wed',
|
|
81
|
-
max: 100,
|
|
82
|
-
currentValue: 94,
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
activity: 'cycling',
|
|
86
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
87
|
-
day: 'Thu',
|
|
88
|
-
max: 100,
|
|
89
|
-
currentValue: 7,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
activity: 'cycling',
|
|
93
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
94
|
-
day: 'Fri',
|
|
95
|
-
max: 100,
|
|
96
|
-
currentValue: 30,
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
activity: 'cycling',
|
|
100
|
-
date: '2023-04-16T23:00:00.000Z',
|
|
101
|
-
day: 'Sat',
|
|
102
|
-
max: 100,
|
|
103
|
-
currentValue: 55,
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { screen } from '../../../customTest';
|
|
2
|
-
import Bmi from './index';
|
|
3
|
-
|
|
4
|
-
describe('BMI', () => {
|
|
5
|
-
it('Render BMI with default values', () => {
|
|
6
|
-
render(<Bmi />);
|
|
7
|
-
|
|
8
|
-
const calculation = screen.queryByRole('heading', { name: /21.6/i });
|
|
9
|
-
const info = screen.queryByRole('heading', { name: /you're healthy/i });
|
|
10
|
-
const pointer = screen.queryByTestId('bmi-pointer');
|
|
11
|
-
|
|
12
|
-
expect(calculation).toBeInTheDocument();
|
|
13
|
-
expect(info).toBeInTheDocument();
|
|
14
|
-
expect(pointer).toHaveStyle('left: 40%;');
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('BMI status healthy', () => {
|
|
18
|
-
render(<Bmi height={180} weight={66} />);
|
|
19
|
-
|
|
20
|
-
const calculation = screen.queryByRole('heading', { name: /20.4/i });
|
|
21
|
-
const info = screen.queryByRole('heading', { name: /you're healthy/i });
|
|
22
|
-
const pointer = screen.queryByTestId('bmi-pointer');
|
|
23
|
-
|
|
24
|
-
expect(calculation).toBeInTheDocument();
|
|
25
|
-
expect(info).toBeInTheDocument();
|
|
26
|
-
expect(pointer).toHaveStyle('left: 40%;');
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('BMI status under weight', () => {
|
|
30
|
-
render(<Bmi height={175} weight={46} />);
|
|
31
|
-
|
|
32
|
-
const calculation = screen.queryByRole('heading', { name: /18.5/ });
|
|
33
|
-
const info = screen.queryByRole('heading', {
|
|
34
|
-
name: /you're under weight/i,
|
|
35
|
-
});
|
|
36
|
-
const pointer = screen.queryByTestId('bmi-pointer');
|
|
37
|
-
|
|
38
|
-
expect(calculation).toBeInTheDocument();
|
|
39
|
-
expect(info).toBeInTheDocument();
|
|
40
|
-
expect(pointer).toHaveStyle('left: 10%;');
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('BMI status overweight', () => {
|
|
44
|
-
render(<Bmi height={175} weight={86} />);
|
|
45
|
-
|
|
46
|
-
const calculation = screen.queryByRole('heading', { name: /28.1/i });
|
|
47
|
-
const info = screen.queryByRole('heading', {
|
|
48
|
-
name: /you're overweight/i,
|
|
49
|
-
});
|
|
50
|
-
const pointer = screen.queryByTestId('bmi-pointer');
|
|
51
|
-
|
|
52
|
-
expect(calculation).toBeInTheDocument();
|
|
53
|
-
expect(info).toBeInTheDocument();
|
|
54
|
-
expect(pointer).toHaveStyle('left: 70%;');
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('BMI status obese', () => {
|
|
58
|
-
render(<Bmi height={175} weight={106} />);
|
|
59
|
-
|
|
60
|
-
const calculation = screen.queryByRole('heading', { name: /34.6/i });
|
|
61
|
-
const info = screen.queryByRole('heading', { name: /you're obese/i });
|
|
62
|
-
const pointer = screen.queryByTestId('bmi-pointer');
|
|
63
|
-
|
|
64
|
-
expect(calculation).toBeInTheDocument();
|
|
65
|
-
expect(info).toBeInTheDocument();
|
|
66
|
-
expect(pointer).toHaveStyle('left: 90%;');
|
|
67
|
-
});
|
|
68
|
-
});
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { Fragment, useEffect, useState } from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
-
|
|
4
|
-
import { Card, CardContent, CardHeader, Typography } from '@ssa-ui-kit/core';
|
|
5
|
-
|
|
6
|
-
import { BmiHeatbar } from './BmiHeatbar';
|
|
7
|
-
import { BmiPointer } from './BmiPointer';
|
|
8
|
-
import { BmiInfo } from './BmiInfo';
|
|
9
|
-
import { BmiLabels } from './BmiLabels';
|
|
10
|
-
|
|
11
|
-
import { ContentWrapper, TitleWrapper } from './styles';
|
|
12
|
-
import { BmiProps } from './types';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* UI Component that calculates the Body Mass Index of the user
|
|
17
|
-
*/
|
|
18
|
-
export const Bmi = ({ height = 175, weight = 66 }: BmiProps) => {
|
|
19
|
-
const [info, setInfo] = useState('');
|
|
20
|
-
const [pointer, setPointer] = useState(0);
|
|
21
|
-
|
|
22
|
-
const bmi = Number(((weight / (height * height)) * 10000).toFixed(1));
|
|
23
|
-
|
|
24
|
-
const setInfos = {
|
|
25
|
-
underWeight: () => {
|
|
26
|
-
setInfo('Under Weight');
|
|
27
|
-
setPointer(10);
|
|
28
|
-
},
|
|
29
|
-
healthy: () => {
|
|
30
|
-
setInfo('Healthy');
|
|
31
|
-
setPointer(40);
|
|
32
|
-
},
|
|
33
|
-
overweight: () => {
|
|
34
|
-
setInfo('Overweight');
|
|
35
|
-
setPointer(70);
|
|
36
|
-
},
|
|
37
|
-
obese: () => {
|
|
38
|
-
setInfo('Obese');
|
|
39
|
-
setPointer(90);
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
if (bmi < 18.5) {
|
|
45
|
-
setInfos.underWeight();
|
|
46
|
-
} else if (bmi > 18.5 && bmi <= 24.9) {
|
|
47
|
-
setInfos.healthy();
|
|
48
|
-
} else if (bmi > 24.9 && bmi < 30) {
|
|
49
|
-
setInfos.overweight();
|
|
50
|
-
} else {
|
|
51
|
-
setInfos.obese();
|
|
52
|
-
}
|
|
53
|
-
}, [bmi]);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<Fragment>
|
|
57
|
-
<CardHeader transparent>
|
|
58
|
-
<div css={TitleWrapper}>
|
|
59
|
-
<Typography variant="h5" weight="bold">
|
|
60
|
-
BMI{' '}
|
|
61
|
-
</Typography>
|
|
62
|
-
<Typography variant="h6">Body Mass Index</Typography>
|
|
63
|
-
</div>
|
|
64
|
-
</CardHeader>
|
|
65
|
-
|
|
66
|
-
<Card
|
|
67
|
-
css={css`
|
|
68
|
-
box-shadow: 0 10px 40px rgba(29, 22, 23, 0.07);
|
|
69
|
-
border-radius: 16px;
|
|
70
|
-
padding-bottom: 40px;
|
|
71
|
-
`}>
|
|
72
|
-
<CardHeader>
|
|
73
|
-
<Typography variant="h2" weight="medium">
|
|
74
|
-
{bmi}
|
|
75
|
-
</Typography>
|
|
76
|
-
<BmiInfo>
|
|
77
|
-
<Typography variant="subtitle" weight="lighter">
|
|
78
|
-
You're {info}
|
|
79
|
-
</Typography>
|
|
80
|
-
</BmiInfo>
|
|
81
|
-
</CardHeader>
|
|
82
|
-
|
|
83
|
-
<CardContent
|
|
84
|
-
css={css`
|
|
85
|
-
width: 100%;
|
|
86
|
-
`}>
|
|
87
|
-
<div css={ContentWrapper}>
|
|
88
|
-
<BmiPointer data-testid="bmi-pointer" percentage={pointer} />
|
|
89
|
-
<BmiHeatbar />
|
|
90
|
-
<BmiLabels />
|
|
91
|
-
</div>
|
|
92
|
-
</CardContent>
|
|
93
|
-
</Card>
|
|
94
|
-
</Fragment>
|
|
95
|
-
);
|
|
96
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
|
|
3
|
-
export const BmiHeatbar = styled.div`
|
|
4
|
-
width: 100%;
|
|
5
|
-
height: 14px;
|
|
6
|
-
|
|
7
|
-
background: linear-gradient(
|
|
8
|
-
90deg,
|
|
9
|
-
#8b60f4 0%,
|
|
10
|
-
#658fdf 16.67%,
|
|
11
|
-
#69cdd0 35.42%,
|
|
12
|
-
#88e4c3 51.04%,
|
|
13
|
-
#edba5d 68.23%,
|
|
14
|
-
#ed8f66 84.38%,
|
|
15
|
-
#f28689 100%
|
|
16
|
-
);
|
|
17
|
-
border-radius: 21px;
|
|
18
|
-
`;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { css } from '@emotion/react';
|
|
2
|
-
|
|
3
|
-
import { BmiLabel } from './BmiLabel';
|
|
4
|
-
|
|
5
|
-
export const BmiLabels = () => (
|
|
6
|
-
<div
|
|
7
|
-
css={css`
|
|
8
|
-
position: relative;
|
|
9
|
-
margin-top: 5px;
|
|
10
|
-
`}>
|
|
11
|
-
<BmiLabel
|
|
12
|
-
variant={'subtitle'}
|
|
13
|
-
css={css`
|
|
14
|
-
left: 20%;
|
|
15
|
-
`}>
|
|
16
|
-
18.5
|
|
17
|
-
</BmiLabel>
|
|
18
|
-
<BmiLabel
|
|
19
|
-
variant={'subtitle'}
|
|
20
|
-
css={css`
|
|
21
|
-
left: 60%;
|
|
22
|
-
`}>
|
|
23
|
-
25
|
|
24
|
-
</BmiLabel>
|
|
25
|
-
<BmiLabel
|
|
26
|
-
variant={'subtitle'}
|
|
27
|
-
css={css`
|
|
28
|
-
left: 80%;
|
|
29
|
-
`}>
|
|
30
|
-
30
|
|
31
|
-
</BmiLabel>
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
|
|
3
|
-
export const BmiPointer = styled.div<{ percentage: number }>`
|
|
4
|
-
position: absolute;
|
|
5
|
-
|
|
6
|
-
left: ${({ percentage }) => percentage}%;
|
|
7
|
-
top: 0;
|
|
8
|
-
|
|
9
|
-
width: 14px;
|
|
10
|
-
height: 14px;
|
|
11
|
-
|
|
12
|
-
background: #2b2d31;
|
|
13
|
-
box-shadow: -4px 4px 10px rgba(42, 48, 57, 0.2);
|
|
14
|
-
border-radius: 19px;
|
|
15
|
-
`;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { css, Theme } from '@emotion/react';
|
|
2
|
-
|
|
3
|
-
export const TitleWrapper = (theme: Theme) => css`
|
|
4
|
-
display: flex;
|
|
5
|
-
|
|
6
|
-
h6 {
|
|
7
|
-
line-height: 1.625rem;
|
|
8
|
-
margin-left: 10px;
|
|
9
|
-
|
|
10
|
-
color: ${theme.colors.greyDarker60};
|
|
11
|
-
}
|
|
12
|
-
`;
|
|
13
|
-
|
|
14
|
-
export const ContentWrapper = css`
|
|
15
|
-
position: relative;
|
|
16
|
-
width: 100%;
|
|
17
|
-
padding-top: 20px;
|
|
18
|
-
`;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { test, expect, Page } from '@playwright/test';
|
|
2
|
-
import { SCREEN_SIZES } from '../../consts';
|
|
3
|
-
|
|
4
|
-
const WIDGETS_CUSTOM_SHOTS_PATH = './custom-shots/';
|
|
5
|
-
let SCREENSHOT_PREFIX = `${WIDGETS_CUSTOM_SHOTS_PATH}widgets-bots-table--`;
|
|
6
|
-
|
|
7
|
-
const gotoPage = (page: Page) => {
|
|
8
|
-
return page.goto(
|
|
9
|
-
'http://localhost:6007/iframe.html?args=&id=trading-botstable--bots-table&viewMode=story',
|
|
10
|
-
);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
test.describe('Industry Specific Widgets - Training - BotsTable', () => {
|
|
14
|
-
test('Renders correctly', async ({ page }) => {
|
|
15
|
-
await page.setViewportSize(SCREEN_SIZES[1920]);
|
|
16
|
-
await gotoPage(page);
|
|
17
|
-
await expect(page.getByText('Bot name 1')).toBeVisible();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
test('Opens menu with copy/archive items', async ({ page }) => {
|
|
21
|
-
await page.setViewportSize(SCREEN_SIZES[1920]);
|
|
22
|
-
await gotoPage(page);
|
|
23
|
-
await page
|
|
24
|
-
.getByRole('row', {
|
|
25
|
-
name: 'Bot name 6 27.07.23 Kraken Pending ETH/USD -100 USD Arrow Down -15% Arrow Down More vertical',
|
|
26
|
-
})
|
|
27
|
-
.getByTestId('more-trigger-button')
|
|
28
|
-
.click();
|
|
29
|
-
|
|
30
|
-
await page.screenshot({
|
|
31
|
-
path: `${SCREENSHOT_PREFIX}menu-opened_[w1920px].png`,
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
test('"Run Reason" modal should be shown', async ({ page }) => {
|
|
36
|
-
await page.setViewportSize(SCREEN_SIZES[1920]);
|
|
37
|
-
await gotoPage(page);
|
|
38
|
-
await page
|
|
39
|
-
.getByRole('row', {
|
|
40
|
-
name: 'Bot name 6 27.07.23 Kraken Pending ETH/USD -100 USD Arrow Down -15% Arrow Down More vertical',
|
|
41
|
-
})
|
|
42
|
-
.getByTestId('run-reason-trigger-button')
|
|
43
|
-
.click();
|
|
44
|
-
|
|
45
|
-
await page.screenshot({
|
|
46
|
-
path: `${SCREENSHOT_PREFIX}run-reason-modal_[w1920px].png`,
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const gotoPageNoControlOrders = (page: Page) => {
|
|
52
|
-
return page.goto(
|
|
53
|
-
'http://localhost:6007/iframe.html?args=&id=trading-botstable--no-control-orders&viewMode=story',
|
|
54
|
-
);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
SCREENSHOT_PREFIX = `${WIDGETS_CUSTOM_SHOTS_PATH}widgets-bots-table--no-control-orders--`;
|
|
58
|
-
|
|
59
|
-
test.describe('Industry Specific Widgets - Training - BotsTable (NoControlOrders)', () => {
|
|
60
|
-
test('Renders correctly', async ({ page }) => {
|
|
61
|
-
await page.setViewportSize(SCREEN_SIZES[1920]);
|
|
62
|
-
await gotoPageNoControlOrders(page);
|
|
63
|
-
await expect(
|
|
64
|
-
page.locator('tr:nth-child(6)').getByText('Yevgen 2'),
|
|
65
|
-
).toBeVisible();
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
test('Opens menu with Liquidate/Change Price/... items', async ({ page }) => {
|
|
69
|
-
await page.setViewportSize(SCREEN_SIZES[1920]);
|
|
70
|
-
await gotoPageNoControlOrders(page);
|
|
71
|
-
await page.locator('tr:nth-child(6) > td:nth-child(11) > button').click();
|
|
72
|
-
|
|
73
|
-
await page.screenshot({
|
|
74
|
-
path: `${SCREENSHOT_PREFIX}menu-opened_[w1920px].png`,
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
});
|