@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,90 +0,0 @@
|
|
|
1
|
-
import { css } from '@emotion/css';
|
|
2
|
-
import { useTheme } from '@emotion/react';
|
|
3
|
-
import {
|
|
4
|
-
Button,
|
|
5
|
-
CardBase,
|
|
6
|
-
CardContent,
|
|
7
|
-
CardHeader,
|
|
8
|
-
Icon,
|
|
9
|
-
Typography,
|
|
10
|
-
WithLink,
|
|
11
|
-
} from '@ssa-ui-kit/core';
|
|
12
|
-
import { BalancePieChart } from '@components/AccountBalance';
|
|
13
|
-
import { ExchangeAccountProps } from './types';
|
|
14
|
-
import * as S from './styles';
|
|
15
|
-
|
|
16
|
-
export const ExchangeAccount = ({
|
|
17
|
-
platform,
|
|
18
|
-
title,
|
|
19
|
-
status,
|
|
20
|
-
link,
|
|
21
|
-
data,
|
|
22
|
-
pieChartProps,
|
|
23
|
-
onClick,
|
|
24
|
-
onDelete,
|
|
25
|
-
}: ExchangeAccountProps) => {
|
|
26
|
-
const theme = useTheme();
|
|
27
|
-
const isActive = status === 'Active';
|
|
28
|
-
const handleClickDelete = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
29
|
-
event.preventDefault();
|
|
30
|
-
event.stopPropagation();
|
|
31
|
-
onDelete();
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<WithLink link={link} onClick={onClick}>
|
|
36
|
-
<CardBase
|
|
37
|
-
noShadow
|
|
38
|
-
css={S.CardBase}
|
|
39
|
-
data-testid="card"
|
|
40
|
-
onClick={link ? undefined : onClick}>
|
|
41
|
-
<CardHeader css={S.CardHeader}>
|
|
42
|
-
<Typography
|
|
43
|
-
variant="subtitle"
|
|
44
|
-
weight="bold"
|
|
45
|
-
color={theme.colors.greyDarker}
|
|
46
|
-
css={S.Platform}>
|
|
47
|
-
{platform}
|
|
48
|
-
</Typography>
|
|
49
|
-
<Typography
|
|
50
|
-
color={theme.colors.greyDropdownFocused}
|
|
51
|
-
variant="subtitle"
|
|
52
|
-
weight="regular">
|
|
53
|
-
{title}
|
|
54
|
-
</Typography>
|
|
55
|
-
<Button css={S.RemoveButton} onClick={(e) => handleClickDelete(e)}>
|
|
56
|
-
<Icon
|
|
57
|
-
name="bin"
|
|
58
|
-
color={theme.colors.greyDropdownFocused}
|
|
59
|
-
size={20}
|
|
60
|
-
/>
|
|
61
|
-
</Button>
|
|
62
|
-
</CardHeader>
|
|
63
|
-
<Typography
|
|
64
|
-
css={S.Status}
|
|
65
|
-
className={isActive ? 'active' : 'not-available'}
|
|
66
|
-
variant="body1"
|
|
67
|
-
weight="regular">
|
|
68
|
-
{isActive ? status : 'Not available'}
|
|
69
|
-
</Typography>
|
|
70
|
-
<CardContent css={S.CardContent} direction="column">
|
|
71
|
-
<BalancePieChart
|
|
72
|
-
theme={theme}
|
|
73
|
-
pieChartProps={{
|
|
74
|
-
className: css`
|
|
75
|
-
${theme.mediaQueries.md} {
|
|
76
|
-
flex-direction: row;
|
|
77
|
-
}
|
|
78
|
-
${theme.mediaQueries.lg} {
|
|
79
|
-
flex-direction: column;
|
|
80
|
-
}
|
|
81
|
-
`,
|
|
82
|
-
...pieChartProps,
|
|
83
|
-
}}
|
|
84
|
-
{...data}
|
|
85
|
-
/>
|
|
86
|
-
</CardContent>
|
|
87
|
-
</CardBase>
|
|
88
|
-
</WithLink>
|
|
89
|
-
);
|
|
90
|
-
};
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Icon } from '@ssa-ui-kit/core';
|
|
3
|
-
import { ExchangeAccountProps } from './types';
|
|
4
|
-
|
|
5
|
-
export const dataValues: Array<
|
|
6
|
-
Omit<ExchangeAccountProps, 'onClick' | 'onDelete'>
|
|
7
|
-
> = [
|
|
8
|
-
{
|
|
9
|
-
platform: (
|
|
10
|
-
<React.Fragment>
|
|
11
|
-
<Icon name="stats" color="#EFC938" size={20} />
|
|
12
|
-
Binance
|
|
13
|
-
</React.Fragment>
|
|
14
|
-
),
|
|
15
|
-
title: 'Account Name',
|
|
16
|
-
status: 'Active',
|
|
17
|
-
data: {
|
|
18
|
-
total: 48000.53,
|
|
19
|
-
currency: 'USDT',
|
|
20
|
-
data: [
|
|
21
|
-
{
|
|
22
|
-
id: 'BTC',
|
|
23
|
-
label: 'BTC',
|
|
24
|
-
legendValue: 1,
|
|
25
|
-
value: 5371.23,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
id: 'LTC',
|
|
29
|
-
label: 'LTC',
|
|
30
|
-
legendValue: 7,
|
|
31
|
-
value: 5300.25,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
id: 'ETH',
|
|
35
|
-
label: 'ETH',
|
|
36
|
-
legendValue: 1,
|
|
37
|
-
value: 1815.31,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: 'Other',
|
|
41
|
-
label: 'Other',
|
|
42
|
-
legendValue: 943,
|
|
43
|
-
value: 1513.9956,
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
platform: 'Binance',
|
|
50
|
-
title: 'Name#2',
|
|
51
|
-
status: 'NotAvailable',
|
|
52
|
-
data: {
|
|
53
|
-
total: 4800.53,
|
|
54
|
-
currency: 'USDT',
|
|
55
|
-
data: [
|
|
56
|
-
{
|
|
57
|
-
id: 'BTC',
|
|
58
|
-
label: 'BTC',
|
|
59
|
-
legendValue: 100,
|
|
60
|
-
value: 2371.23,
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: 'LTC',
|
|
64
|
-
label: 'LTC',
|
|
65
|
-
legendValue: 52,
|
|
66
|
-
value: 5300.25,
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: 'ETH',
|
|
70
|
-
label: 'ETH',
|
|
71
|
-
legendValue: 86,
|
|
72
|
-
value: 3815.31,
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
id: 'Other',
|
|
76
|
-
label: 'Other',
|
|
77
|
-
legendValue: 943,
|
|
78
|
-
value: 1513.9956,
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
platform: 'Binance',
|
|
85
|
-
title: 'Name#3',
|
|
86
|
-
status: 'NotAvailable',
|
|
87
|
-
data: {
|
|
88
|
-
total: 10000.53,
|
|
89
|
-
currency: 'USDT',
|
|
90
|
-
data: [
|
|
91
|
-
{
|
|
92
|
-
id: 'BTC',
|
|
93
|
-
label: 'BTC',
|
|
94
|
-
legendValue: 95,
|
|
95
|
-
value: 1371.23,
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
id: 'LTC',
|
|
99
|
-
label: 'LTC',
|
|
100
|
-
legendValue: 7,
|
|
101
|
-
value: 8300.25,
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: 'ETH',
|
|
105
|
-
label: 'ETH',
|
|
106
|
-
legendValue: 6,
|
|
107
|
-
value: 4815.31,
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
id: 'Other',
|
|
111
|
-
label: 'Other',
|
|
112
|
-
legendValue: 943,
|
|
113
|
-
value: 3513.9956,
|
|
114
|
-
},
|
|
115
|
-
],
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
platform: 'Binance',
|
|
120
|
-
title: 'Name#4',
|
|
121
|
-
status: 'Active',
|
|
122
|
-
data: {
|
|
123
|
-
total: 9000.53,
|
|
124
|
-
currency: 'USDT',
|
|
125
|
-
data: [
|
|
126
|
-
{
|
|
127
|
-
id: 'BTC',
|
|
128
|
-
label: 'BTC',
|
|
129
|
-
legendValue: 10,
|
|
130
|
-
value: 5371.23,
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
id: 'LTC',
|
|
134
|
-
label: 'LTC',
|
|
135
|
-
legendValue: 7,
|
|
136
|
-
value: 5300.25,
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
id: 'ETH',
|
|
140
|
-
label: 'ETH',
|
|
141
|
-
legendValue: 1,
|
|
142
|
-
value: 7815.31,
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
id: 'Other',
|
|
146
|
-
label: 'Other',
|
|
147
|
-
legendValue: 943,
|
|
148
|
-
value: 5513.9956,
|
|
149
|
-
},
|
|
150
|
-
],
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
];
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { Theme, css } from '@emotion/react';
|
|
2
|
-
|
|
3
|
-
export const CardBase = (theme: Theme) => css`
|
|
4
|
-
padding: 0;
|
|
5
|
-
border-radius: 20px;
|
|
6
|
-
box-shadow: 0px 10px 40px 0px ${theme.colors.greyShadow};
|
|
7
|
-
transition: 0.3s;
|
|
8
|
-
|
|
9
|
-
&:hover {
|
|
10
|
-
box-shadow: 5px 5px 20px 0px ${theme.colors.black25};
|
|
11
|
-
}
|
|
12
|
-
`;
|
|
13
|
-
|
|
14
|
-
export const CardHeader = (theme: Theme) => css`
|
|
15
|
-
display: grid;
|
|
16
|
-
grid-template-columns: auto 1fr 20px;
|
|
17
|
-
align-items: center;
|
|
18
|
-
width: 100%;
|
|
19
|
-
padding: 10px;
|
|
20
|
-
border-radius: 20px 20px 0 0;
|
|
21
|
-
background: ${theme.colors.greyLighter};
|
|
22
|
-
margin-bottom: 0;
|
|
23
|
-
|
|
24
|
-
${theme.mediaQueries.md} {
|
|
25
|
-
h6 {
|
|
26
|
-
font-size: 16px;
|
|
27
|
-
line-height: 24px;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
${theme.mediaQueries.xs} {
|
|
32
|
-
padding: 6px 10px;
|
|
33
|
-
}
|
|
34
|
-
`;
|
|
35
|
-
|
|
36
|
-
export const RemoveButton = (theme: Theme) => css`
|
|
37
|
-
height: auto;
|
|
38
|
-
padding: 0;
|
|
39
|
-
background: none;
|
|
40
|
-
box-shadow: none;
|
|
41
|
-
|
|
42
|
-
&:hover,
|
|
43
|
-
&:focus {
|
|
44
|
-
background: none;
|
|
45
|
-
box-shadow: none;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&:hover {
|
|
49
|
-
svg path {
|
|
50
|
-
fill: ${theme.colors.greyDarker};
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
`;
|
|
54
|
-
|
|
55
|
-
export const Platform = css`
|
|
56
|
-
display: flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
gap: 9px;
|
|
59
|
-
margin-right: 13px;
|
|
60
|
-
`;
|
|
61
|
-
|
|
62
|
-
export const Status = (theme: Theme) => css`
|
|
63
|
-
width: 100%;
|
|
64
|
-
text-align: center;
|
|
65
|
-
padding: 4px;
|
|
66
|
-
|
|
67
|
-
&.active {
|
|
68
|
-
color: ${theme.colors.greenDark};
|
|
69
|
-
background: ${theme.colors.greenMint};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&.not-available {
|
|
73
|
-
color: ${theme.colors.red};
|
|
74
|
-
background: ${theme.colors.redLighter40};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
${theme.mediaQueries.md} {
|
|
78
|
-
font-size: 14px;
|
|
79
|
-
line-height: 17px;
|
|
80
|
-
}
|
|
81
|
-
`;
|
|
82
|
-
|
|
83
|
-
export const CardContent = (theme: Theme) => css`
|
|
84
|
-
width: 100%;
|
|
85
|
-
padding: 10px 20px;
|
|
86
|
-
& > div {
|
|
87
|
-
flex-direction: row;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
ul:last-child {
|
|
91
|
-
li {
|
|
92
|
-
justify-content: flex-end;
|
|
93
|
-
text-align: right;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
${theme.mediaQueries.sm} {
|
|
98
|
-
& > div {
|
|
99
|
-
justify-content: space-around;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
${theme.mediaQueries.md} {
|
|
104
|
-
justify-content: space-around;
|
|
105
|
-
& > div {
|
|
106
|
-
flex-direction: column;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
${theme.mediaQueries.lg} {
|
|
111
|
-
& > div {
|
|
112
|
-
flex-direction: row;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
`;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { To } from 'react-router-dom';
|
|
2
|
-
import { PieChartProps } from '@ssa-ui-kit/core';
|
|
3
|
-
import { AccountBalanceProps } from '@components/AccountBalance';
|
|
4
|
-
|
|
5
|
-
export interface ExchangeAccountProps {
|
|
6
|
-
platform: string | JSX.Element;
|
|
7
|
-
title: string;
|
|
8
|
-
status: 'Active' | 'NotAvailable';
|
|
9
|
-
onClick?: () => void;
|
|
10
|
-
onDelete: () => void;
|
|
11
|
-
link?: To;
|
|
12
|
-
data: Omit<AccountBalanceProps, 'title' | 'className' | 'onClick' | 'link'>;
|
|
13
|
-
pieChartProps?: Partial<PieChartProps>;
|
|
14
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
import { Theme, useTheme } from '@emotion/react';
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
import { BMPProps } from './types';
|
|
5
|
-
|
|
6
|
-
const BPMBase = styled.div`
|
|
7
|
-
text-align: center;
|
|
8
|
-
margin-top: 23px;
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
const BPMValueStyles = css`
|
|
12
|
-
font-weight: 700;
|
|
13
|
-
font-size: 1.728rem; /* 27.65px */
|
|
14
|
-
line-height: 2rem; /* 32px */
|
|
15
|
-
|
|
16
|
-
@media (max-width: 900px) {
|
|
17
|
-
font-size: 1.2rem; /* 19.2px */
|
|
18
|
-
line-height: 1.639; /* 26.23px */
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
const getBPMLabelStyles = (theme: Theme) => css`
|
|
23
|
-
color: ${theme.colors.greyDarker60};
|
|
24
|
-
font-weight: 600;
|
|
25
|
-
font-size: 1rem; /* 16px */
|
|
26
|
-
line-height: 1.5rem; /* 24px */
|
|
27
|
-
margin-left: 4px;
|
|
28
|
-
|
|
29
|
-
@media (max-width: 900px) {
|
|
30
|
-
font-size: 0.833rem; /* 13.33px */
|
|
31
|
-
line-height: 1.375; /* 22px */
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
export const BPM = ({ value }: BMPProps) => {
|
|
36
|
-
const theme = useTheme();
|
|
37
|
-
return (
|
|
38
|
-
<BPMBase>
|
|
39
|
-
<span css={BPMValueStyles}>{value}</span>
|
|
40
|
-
<span css={getBPMLabelStyles(theme)}>BPM</span>
|
|
41
|
-
</BPMBase>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
@@ -1,78 +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
|
-
const SCREENSHOT_PREFIX = `${WIDGETS_CUSTOM_SHOTS_PATH}widgets-heart-rate--hint-opened__`;
|
|
6
|
-
|
|
7
|
-
const MOUSE_POSITIONS = {
|
|
8
|
-
390: [
|
|
9
|
-
{ x: 97, y: 122 },
|
|
10
|
-
{ x: 97, y: 122 },
|
|
11
|
-
],
|
|
12
|
-
900: [
|
|
13
|
-
{ x: 215, y: 123 },
|
|
14
|
-
{ x: 212, y: 123 },
|
|
15
|
-
],
|
|
16
|
-
1440: [
|
|
17
|
-
{ x: 334, y: 123 },
|
|
18
|
-
{ x: 337, y: 123 },
|
|
19
|
-
],
|
|
20
|
-
1920: [
|
|
21
|
-
{ x: 453, y: 125 },
|
|
22
|
-
{ x: 450, y: 125 },
|
|
23
|
-
],
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const gotoPage = (page: Page) => {
|
|
27
|
-
return page.goto(
|
|
28
|
-
'http://localhost:6007/iframe.html?args=&id=fitness-heartrate--default&viewMode=story',
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const waitForImg = (page: Page) => {
|
|
33
|
-
return page.getByRole('img', { name: 'Heart' }).waitFor();
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* The BPM value is always different on screenshots.
|
|
38
|
-
* That's why we ignore it to avoid re-approving every time.
|
|
39
|
-
* */
|
|
40
|
-
const replaceBPMValue = (page: Page) => {
|
|
41
|
-
return page
|
|
42
|
-
.locator('span[class*="BPMValueStyles"]')
|
|
43
|
-
.evaluate((element: HTMLSpanElement) => (element.textContent = 'N'));
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
test.describe('Industry Specific Widgets - Fitness - HeartRate', () => {
|
|
47
|
-
test('Renders correctly', async ({ page }) => {
|
|
48
|
-
await gotoPage(page);
|
|
49
|
-
await expect(
|
|
50
|
-
page.getByRole('heading', { name: 'Heart Rate' }),
|
|
51
|
-
).toBeVisible();
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
for (const resolution of Object.keys(SCREEN_SIZES)) {
|
|
55
|
-
const viewportSize =
|
|
56
|
-
SCREEN_SIZES[resolution as unknown as keyof typeof SCREEN_SIZES];
|
|
57
|
-
const mouseMoves =
|
|
58
|
-
MOUSE_POSITIONS[resolution as unknown as keyof typeof SCREEN_SIZES];
|
|
59
|
-
|
|
60
|
-
if (mouseMoves == null) {
|
|
61
|
-
throw new Error(
|
|
62
|
-
`No mouse move for the specified resolution "${resolution}" found`,
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
test(`[${resolution}] Tooltip is shown`, async ({ page }) => {
|
|
67
|
-
await page.setViewportSize(viewportSize);
|
|
68
|
-
await gotoPage(page);
|
|
69
|
-
for (const { x, y } of mouseMoves) {
|
|
70
|
-
await page.mouse.move(x, y);
|
|
71
|
-
}
|
|
72
|
-
await Promise.all([replaceBPMValue(page), waitForImg(page)]);
|
|
73
|
-
await page.screenshot({
|
|
74
|
-
path: `${SCREENSHOT_PREFIX}[w${resolution}px].png`,
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
});
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import userEvent from '@testing-library/user-event';
|
|
2
|
-
import { waitFor } from '@testing-library/react';
|
|
3
|
-
|
|
4
|
-
import { heartRateData as data } from './mockHeartRateRequest';
|
|
5
|
-
|
|
6
|
-
import { HeartRate } from './index';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The Line charts have trouble rendering in the test suite (some issues with
|
|
10
|
-
* the ResizeObserver).
|
|
11
|
-
* As a temporal solution, we follow Kent's advice not to test charts
|
|
12
|
-
* with Jest:
|
|
13
|
-
* https://kentcdodds.com/calls/01/76/nivo-charts-issue
|
|
14
|
-
* */
|
|
15
|
-
const HeartRateLineChartMock = ({
|
|
16
|
-
onMouseMove,
|
|
17
|
-
colors,
|
|
18
|
-
}: {
|
|
19
|
-
onMouseMove: (p: { data: { y: number } }) => void;
|
|
20
|
-
colors?: string;
|
|
21
|
-
}) => (
|
|
22
|
-
<div
|
|
23
|
-
data-testid="chart-mock"
|
|
24
|
-
css={{ color: colors }}
|
|
25
|
-
onMouseMove={() => {
|
|
26
|
-
onMouseMove({ data: { y: 170 } });
|
|
27
|
-
}}></div>
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
jest.mock('./HeartRateLineChart', () => ({
|
|
31
|
-
HeartRateLineChart: HeartRateLineChartMock,
|
|
32
|
-
}));
|
|
33
|
-
|
|
34
|
-
function setup(component: React.ReactElement) {
|
|
35
|
-
return {
|
|
36
|
-
user: userEvent.setup(),
|
|
37
|
-
...render(component),
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
describe('HeartRate', () => {
|
|
42
|
-
it('Renders and reacts to mouse events', async () => {
|
|
43
|
-
const { getByText, getByTestId } = setup(<HeartRate data={data} />);
|
|
44
|
-
|
|
45
|
-
getByText('Heart Rate');
|
|
46
|
-
getByText(data.data[0].y);
|
|
47
|
-
getByText('BPM');
|
|
48
|
-
const chartEl = getByTestId('chart-mock');
|
|
49
|
-
|
|
50
|
-
await userEvent.hover(chartEl);
|
|
51
|
-
|
|
52
|
-
await waitFor(() => {
|
|
53
|
-
getByText(170);
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('Renders with a custom color', () => {
|
|
58
|
-
const chartColor = 'orange';
|
|
59
|
-
const { getByTestId } = setup(<HeartRate data={data} color={chartColor} />);
|
|
60
|
-
|
|
61
|
-
// Since we don't render the real <HeartRateLineChart /> component, we
|
|
62
|
-
// just check here that we pass the "colors" prop into its mock.
|
|
63
|
-
const chartEl = getByTestId('chart-mock');
|
|
64
|
-
expect(chartEl).toHaveStyle(`color: ${chartColor}`);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('Renders with a custom caption', () => {
|
|
68
|
-
const caption = 'A custom caption';
|
|
69
|
-
const { getByText, queryByText } = setup(
|
|
70
|
-
<HeartRate data={data} caption={caption} />,
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
expect(queryByText('Heart Rate')).not.toBeInTheDocument();
|
|
74
|
-
getByText(caption);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it('Handle empty data', () => {
|
|
78
|
-
const caption = 'A custom caption';
|
|
79
|
-
|
|
80
|
-
const { getByText, queryByText } = setup(
|
|
81
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
82
|
-
// @ts-ignore
|
|
83
|
-
<HeartRate data={null} caption={caption} />,
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
expect(queryByText('Heart Rate')).not.toBeInTheDocument();
|
|
87
|
-
expect(queryByText('BPM')).not.toBeInTheDocument();
|
|
88
|
-
|
|
89
|
-
getByText(caption);
|
|
90
|
-
});
|
|
91
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/react';
|
|
2
|
-
import '@storybook/types';
|
|
3
|
-
|
|
4
|
-
import { HeartRate } from './index';
|
|
5
|
-
import { heartRateData as data } from './mockHeartRateRequest';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Fitness/HeartRate',
|
|
9
|
-
component: HeartRate,
|
|
10
|
-
argTypes: {
|
|
11
|
-
color: {
|
|
12
|
-
table: {
|
|
13
|
-
type: {
|
|
14
|
-
summary: 'string',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
options: [
|
|
18
|
-
'pink',
|
|
19
|
-
'yellow',
|
|
20
|
-
'green',
|
|
21
|
-
'turquoise',
|
|
22
|
-
'purple',
|
|
23
|
-
'blueLight',
|
|
24
|
-
'blue',
|
|
25
|
-
],
|
|
26
|
-
control: {
|
|
27
|
-
type: 'select',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
args: {
|
|
32
|
-
data,
|
|
33
|
-
},
|
|
34
|
-
} as Meta<typeof HeartRate>;
|
|
35
|
-
|
|
36
|
-
export const Default = {};
|