@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,95 +0,0 @@
|
|
|
1
|
-
import { MouseEventHandler, useState } from 'react';
|
|
2
|
-
import { useTheme } from '@emotion/react';
|
|
3
|
-
import {
|
|
4
|
-
Icon,
|
|
5
|
-
Popover,
|
|
6
|
-
PopoverContent,
|
|
7
|
-
PopoverDescription,
|
|
8
|
-
PopoverTrigger,
|
|
9
|
-
} from '@ssa-ui-kit/core';
|
|
10
|
-
import {
|
|
11
|
-
ActionItem,
|
|
12
|
-
ActionsWrapper,
|
|
13
|
-
ActionIcon,
|
|
14
|
-
} from '@components/BotsTable/stories/BotsTable';
|
|
15
|
-
import { NoControlOrdersItem } from '../types';
|
|
16
|
-
|
|
17
|
-
export const ActionMore = ({
|
|
18
|
-
row: { isDisabled },
|
|
19
|
-
}: {
|
|
20
|
-
row: NoControlOrdersItem;
|
|
21
|
-
}) => {
|
|
22
|
-
const theme = useTheme();
|
|
23
|
-
const [open, setOpen] = useState(false);
|
|
24
|
-
|
|
25
|
-
const actionMoreHandler: MouseEventHandler<HTMLElement> = (event) => {
|
|
26
|
-
event.stopPropagation();
|
|
27
|
-
};
|
|
28
|
-
const actionHandler =
|
|
29
|
-
(actionName: string): MouseEventHandler<HTMLElement> =>
|
|
30
|
-
(event) => {
|
|
31
|
-
event.stopPropagation();
|
|
32
|
-
alert(`action ${actionName}`);
|
|
33
|
-
setOpen(false);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<Popover
|
|
38
|
-
floatingOptions={{
|
|
39
|
-
onOpenChange: setOpen,
|
|
40
|
-
open,
|
|
41
|
-
}}
|
|
42
|
-
placement="top-start">
|
|
43
|
-
<PopoverTrigger
|
|
44
|
-
variant="custom"
|
|
45
|
-
isDisabled={isDisabled}
|
|
46
|
-
css={{
|
|
47
|
-
borderLeft: '1px solid #eaecf0',
|
|
48
|
-
height: '100%',
|
|
49
|
-
display: 'flex',
|
|
50
|
-
alignItems: 'center',
|
|
51
|
-
cursor: isDisabled ? 'default' : 'pointer',
|
|
52
|
-
background: 'unset',
|
|
53
|
-
borderRadius: '0',
|
|
54
|
-
}}
|
|
55
|
-
startIcon={
|
|
56
|
-
<Icon
|
|
57
|
-
name="more-vertical"
|
|
58
|
-
size={15}
|
|
59
|
-
color={theme.colors.greyDropdownFocused}
|
|
60
|
-
/>
|
|
61
|
-
}
|
|
62
|
-
onClick={actionMoreHandler}
|
|
63
|
-
/>
|
|
64
|
-
<PopoverContent>
|
|
65
|
-
<PopoverDescription>
|
|
66
|
-
<ActionsWrapper
|
|
67
|
-
css={{
|
|
68
|
-
width: 160,
|
|
69
|
-
}}>
|
|
70
|
-
<ActionItem
|
|
71
|
-
startIcon={<ActionIcon name="invisible" />}
|
|
72
|
-
onClick={actionHandler('liquidate')}>
|
|
73
|
-
Liquidate
|
|
74
|
-
</ActionItem>
|
|
75
|
-
<ActionItem
|
|
76
|
-
startIcon={<ActionIcon name="change" />}
|
|
77
|
-
onClick={actionHandler('changePrice')}>
|
|
78
|
-
Change Price
|
|
79
|
-
</ActionItem>
|
|
80
|
-
<ActionItem
|
|
81
|
-
startIcon={<ActionIcon name="cross" />}
|
|
82
|
-
onClick={actionHandler('cancel')}>
|
|
83
|
-
Cancel
|
|
84
|
-
</ActionItem>
|
|
85
|
-
<ActionItem
|
|
86
|
-
startIcon={<ActionIcon name="bin" />}
|
|
87
|
-
onClick={actionHandler('deleteFromList')}>
|
|
88
|
-
Delete from list
|
|
89
|
-
</ActionItem>
|
|
90
|
-
</ActionsWrapper>
|
|
91
|
-
</PopoverDescription>
|
|
92
|
-
</PopoverContent>
|
|
93
|
-
</Popover>
|
|
94
|
-
);
|
|
95
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { BotsTableProps } from '@components/BotsTable/types';
|
|
2
|
-
import { BotsTable } from '@components/BotsTable';
|
|
3
|
-
|
|
4
|
-
export const TableList = ({ children, ...rest }: BotsTableProps) => (
|
|
5
|
-
<BotsTable
|
|
6
|
-
css={{
|
|
7
|
-
'& thead tr': {
|
|
8
|
-
position: 'relative',
|
|
9
|
-
'& td:last-child': {
|
|
10
|
-
'&:before': {
|
|
11
|
-
content: '""',
|
|
12
|
-
display: 'block',
|
|
13
|
-
position: 'absolute',
|
|
14
|
-
top: 0,
|
|
15
|
-
right: 0,
|
|
16
|
-
width: 40,
|
|
17
|
-
height: 40,
|
|
18
|
-
borderRadius: 20,
|
|
19
|
-
background: '#fff',
|
|
20
|
-
clipPath: 'inset(0 0 50% 50%)',
|
|
21
|
-
},
|
|
22
|
-
'&:after': {
|
|
23
|
-
content: '""',
|
|
24
|
-
display: 'block',
|
|
25
|
-
position: 'absolute',
|
|
26
|
-
top: 0,
|
|
27
|
-
right: 0,
|
|
28
|
-
width: 20,
|
|
29
|
-
height: 20,
|
|
30
|
-
background: '#D0D1D6',
|
|
31
|
-
zIndex: -1,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
'& tr td:last-child': {
|
|
36
|
-
position: 'sticky',
|
|
37
|
-
height: 44,
|
|
38
|
-
right: 0,
|
|
39
|
-
padding: 0,
|
|
40
|
-
},
|
|
41
|
-
}}
|
|
42
|
-
{...rest}>
|
|
43
|
-
{children}
|
|
44
|
-
</BotsTable>
|
|
45
|
-
);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { BotsTableCell, BotsTableRow } from '@components/BotsTable';
|
|
2
|
-
import { Exchange, TableTag } from '@components/BotsTable/stories/BotsTable';
|
|
3
|
-
import { ActionMore } from './ActionMore';
|
|
4
|
-
import { Reason } from './Reason';
|
|
5
|
-
import { NoControlOrdersItem } from '../types';
|
|
6
|
-
|
|
7
|
-
export const TableRow = (item: NoControlOrdersItem) => (
|
|
8
|
-
<BotsTableRow aria-disabled={item.isDisabled} isDisabled={item.isDisabled}>
|
|
9
|
-
<BotsTableCell>
|
|
10
|
-
<Exchange exchangeType={item.exchange} showTitle={false} />
|
|
11
|
-
</BotsTableCell>
|
|
12
|
-
<BotsTableCell>{item.account}</BotsTableCell>
|
|
13
|
-
<BotsTableCell>{item.botName}</BotsTableCell>
|
|
14
|
-
<BotsTableCell>{item.botRun}</BotsTableCell>
|
|
15
|
-
<BotsTableCell>{item.orderId}</BotsTableCell>
|
|
16
|
-
<BotsTableCell>
|
|
17
|
-
<TableTag color={item.status ? 'green' : 'pink'}>
|
|
18
|
-
{item.status ? 'Active' : 'Inactive'}
|
|
19
|
-
</TableTag>
|
|
20
|
-
</BotsTableCell>
|
|
21
|
-
<BotsTableCell>
|
|
22
|
-
<Reason>{item.reason}</Reason>
|
|
23
|
-
</BotsTableCell>
|
|
24
|
-
<BotsTableCell>{item.pair}</BotsTableCell>
|
|
25
|
-
<BotsTableCell>{item.orderSize}</BotsTableCell>
|
|
26
|
-
<BotsTableCell>{item.orderType}</BotsTableCell>
|
|
27
|
-
<BotsTableCell>
|
|
28
|
-
<ActionMore row={item} />
|
|
29
|
-
</BotsTableCell>
|
|
30
|
-
</BotsTableRow>
|
|
31
|
-
);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { NoControlOrdersItem } from './types';
|
|
2
|
-
|
|
3
|
-
const commonStructure: NoControlOrdersItem = {
|
|
4
|
-
id: 1,
|
|
5
|
-
exchange: 'binance',
|
|
6
|
-
account: 'Yevgen 2',
|
|
7
|
-
botName: 'bot1',
|
|
8
|
-
botRun: 'New Run - 12/8/2023',
|
|
9
|
-
orderId: '1A2B3C',
|
|
10
|
-
status: true,
|
|
11
|
-
reason: 'Less than minute ago',
|
|
12
|
-
pair: 'BTC/TUSD',
|
|
13
|
-
orderSize: '0.003 BTC',
|
|
14
|
-
orderType: 'SELL',
|
|
15
|
-
isDisabled: false,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const noControlOrdersData = new Array(10)
|
|
19
|
-
.fill(null)
|
|
20
|
-
.map((value, index) => ({
|
|
21
|
-
...commonStructure,
|
|
22
|
-
id: index + 1,
|
|
23
|
-
}));
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ExchangeType } from '../BotsTable/components/Exchange/types';
|
|
2
|
-
|
|
3
|
-
export interface NoControlOrdersItem {
|
|
4
|
-
id: number;
|
|
5
|
-
exchange: ExchangeType;
|
|
6
|
-
account: string;
|
|
7
|
-
botName: string;
|
|
8
|
-
botRun: string;
|
|
9
|
-
orderId: string;
|
|
10
|
-
status: boolean;
|
|
11
|
-
reason: string;
|
|
12
|
-
pair: string;
|
|
13
|
-
orderSize: string;
|
|
14
|
-
orderType: 'SELL';
|
|
15
|
-
isDisabled: boolean;
|
|
16
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ExchangeType } from './stories/BotsTable/components/Exchange/types';
|
|
2
|
-
import { TradeType } from './stories/BotsTable/components/Trade/types';
|
|
3
|
-
|
|
4
|
-
export interface PNL {
|
|
5
|
-
amount: number;
|
|
6
|
-
currency: string;
|
|
7
|
-
isIncreasing: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface ROI {
|
|
11
|
-
amount: number;
|
|
12
|
-
isIncreasing: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface BotsTableItem {
|
|
16
|
-
id: number;
|
|
17
|
-
name: string;
|
|
18
|
-
creationDate: string;
|
|
19
|
-
exchange: ExchangeType;
|
|
20
|
-
status: TradeType;
|
|
21
|
-
pair: string;
|
|
22
|
-
pnl: PNL;
|
|
23
|
-
roi: ROI;
|
|
24
|
-
isDisabled: boolean;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface BotsTableProps {
|
|
28
|
-
children: React.ReactElement<React.PropsWithChildren<BotsTableItem>>[];
|
|
29
|
-
columns: string[];
|
|
30
|
-
className?: string;
|
|
31
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { screen } from '../../../customTest';
|
|
2
|
-
|
|
3
|
-
import Calories from './index';
|
|
4
|
-
|
|
5
|
-
describe('Calories', () => {
|
|
6
|
-
it('Render Calories', () => {
|
|
7
|
-
render(<Calories max={100} currentValue={70} />);
|
|
8
|
-
|
|
9
|
-
expect(screen.queryByText('70% done')).toBeInTheDocument();
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { Calories } from './Calories';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Fitness/Calories',
|
|
7
|
-
component: Calories,
|
|
8
|
-
argTypes: {
|
|
9
|
-
max: {
|
|
10
|
-
control: {
|
|
11
|
-
type: 'number',
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
currentValue: {
|
|
15
|
-
control: {
|
|
16
|
-
type: 'number',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
args: {
|
|
21
|
-
max: 100,
|
|
22
|
-
currentValue: 70,
|
|
23
|
-
},
|
|
24
|
-
} as Meta<typeof Calories>;
|
|
25
|
-
|
|
26
|
-
export const Default = {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { css, useTheme } from '@emotion/react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Card,
|
|
5
|
-
CardContent,
|
|
6
|
-
CardHeader,
|
|
7
|
-
ProgressCircle,
|
|
8
|
-
Typography,
|
|
9
|
-
ResponsiveImage,
|
|
10
|
-
} from '@ssa-ui-kit/core';
|
|
11
|
-
|
|
12
|
-
import { CaloriesProps } from './types';
|
|
13
|
-
import { InnerContent } from './innerContent';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* UI Component that shows how many calories the user has burned
|
|
18
|
-
*/
|
|
19
|
-
export const Calories = ({ max, currentValue }: CaloriesProps) => {
|
|
20
|
-
const theme = useTheme();
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<Card
|
|
24
|
-
css={css`
|
|
25
|
-
box-shadow: 0 10px 40px rgba(42, 48, 57, 0.08);
|
|
26
|
-
border-radius: 20px;
|
|
27
|
-
`}>
|
|
28
|
-
<CardHeader
|
|
29
|
-
icon={
|
|
30
|
-
<ResponsiveImage
|
|
31
|
-
css={{ filter: `drop-shadow(0px 5px 5px ${theme.colors.grey})` }}
|
|
32
|
-
srcSet="https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fcalories%2Fcalories_64.png?alt=media&token=6a57e3f5-0e15-4dcf-8871-f1bf94d887af 64w, https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fcalories%2Fcalories_48.png?alt=media&token=861ad7c8-1bcb-4f2d-a581-4b73b4821251 48w"
|
|
33
|
-
sizes="(min-width: 1440px) 64px, 48px"
|
|
34
|
-
src="https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fcalories%2Fcalories_48.png?alt=media&token=861ad7c8-1bcb-4f2d-a581-4b73b4821251"
|
|
35
|
-
alt="Calories burn"
|
|
36
|
-
/>
|
|
37
|
-
}>
|
|
38
|
-
<Typography variant="h6" weight="bold">
|
|
39
|
-
Calories
|
|
40
|
-
</Typography>
|
|
41
|
-
</CardHeader>
|
|
42
|
-
|
|
43
|
-
<CardContent>
|
|
44
|
-
<ProgressCircle
|
|
45
|
-
max={max}
|
|
46
|
-
currentValue={currentValue}
|
|
47
|
-
color="pink"
|
|
48
|
-
infoContent={<InnerContent max={max} currentValue={currentValue} />}
|
|
49
|
-
size={120}
|
|
50
|
-
/>
|
|
51
|
-
</CardContent>
|
|
52
|
-
</Card>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { useTheme } from '@emotion/react';
|
|
2
|
-
import { Typography, Wrapper } from '@ssa-ui-kit/core';
|
|
3
|
-
|
|
4
|
-
import { CaloriesProps } from './types';
|
|
5
|
-
|
|
6
|
-
export const InnerContent = ({ currentValue, max }: CaloriesProps) => {
|
|
7
|
-
const theme = useTheme();
|
|
8
|
-
return (
|
|
9
|
-
<div
|
|
10
|
-
style={{
|
|
11
|
-
display: 'grid',
|
|
12
|
-
textAlign: 'center',
|
|
13
|
-
}}>
|
|
14
|
-
<Wrapper alignItems="baseline" direction="row" css={{ gap: 5 }}>
|
|
15
|
-
<Typography variant="h5" weight="bold" color={theme.colors.greyDarker}>
|
|
16
|
-
{currentValue}
|
|
17
|
-
</Typography>
|
|
18
|
-
<Typography
|
|
19
|
-
variant="subtitle"
|
|
20
|
-
weight="bold"
|
|
21
|
-
color={theme.colors.greyDarker}>
|
|
22
|
-
kcal
|
|
23
|
-
</Typography>
|
|
24
|
-
</Wrapper>
|
|
25
|
-
<Typography variant="subtitle" color={theme.colors.greyDarker60}>
|
|
26
|
-
{(currentValue / max) * 100}% done
|
|
27
|
-
</Typography>
|
|
28
|
-
</div>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { MemoryRouter, Route, Routes } from 'react-router-dom';
|
|
2
|
-
import userEvent from '@testing-library/user-event';
|
|
3
|
-
import { ExchangeAccount } from './ExchangeAccount';
|
|
4
|
-
import { dataValues } from './helpers';
|
|
5
|
-
|
|
6
|
-
const commonProps = {
|
|
7
|
-
platform: dataValues[0].platform,
|
|
8
|
-
title: dataValues[0].title,
|
|
9
|
-
data: dataValues[0].data,
|
|
10
|
-
status: dataValues[0].status,
|
|
11
|
-
onDelete: jest.fn(),
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
describe('ExchangeAccount', () => {
|
|
15
|
-
it('Renders with platform', () => {
|
|
16
|
-
const { getByText } = render(<ExchangeAccount {...commonProps} />);
|
|
17
|
-
getByText(new RegExp('Binance', 'i'));
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('Renders with title', () => {
|
|
21
|
-
const { getByText } = render(<ExchangeAccount {...commonProps} />);
|
|
22
|
-
getByText(new RegExp('Account Name', 'i'));
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('Renders with active status label', () => {
|
|
26
|
-
const { getByText } = render(<ExchangeAccount {...commonProps} />);
|
|
27
|
-
getByText(new RegExp('Active', 'i'));
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('Renders with not available status label', () => {
|
|
31
|
-
const { getByText } = render(
|
|
32
|
-
<ExchangeAccount {...commonProps} status="NotAvailable" />,
|
|
33
|
-
);
|
|
34
|
-
getByText(new RegExp('Not available', 'i'));
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('Renders with BalancePieChart component', () => {
|
|
38
|
-
const { container } = render(<ExchangeAccount {...commonProps} />);
|
|
39
|
-
|
|
40
|
-
const pieChartWrapper = container.querySelector('.pie-chart-wrapper');
|
|
41
|
-
expect(pieChartWrapper).toBeInTheDocument();
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('Clicks on delete button', async () => {
|
|
45
|
-
const user = userEvent.setup();
|
|
46
|
-
const mockOnClick = jest.fn();
|
|
47
|
-
const { getByRole } = render(
|
|
48
|
-
<ExchangeAccount {...commonProps} onDelete={mockOnClick} />,
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
const deleteButton = getByRole('button');
|
|
52
|
-
|
|
53
|
-
await user.click(deleteButton);
|
|
54
|
-
expect(mockOnClick).toBeCalledTimes(1);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('Clicks on card', async () => {
|
|
58
|
-
const user = userEvent.setup();
|
|
59
|
-
const mockOnClick = jest.fn();
|
|
60
|
-
const mockOnDelete = jest.fn();
|
|
61
|
-
const { getByTestId } = render(
|
|
62
|
-
<ExchangeAccount
|
|
63
|
-
{...commonProps}
|
|
64
|
-
onClick={mockOnClick}
|
|
65
|
-
onDelete={mockOnDelete}
|
|
66
|
-
/>,
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
await user.click(getByTestId('card'));
|
|
70
|
-
|
|
71
|
-
expect(mockOnClick).toBeCalledTimes(1);
|
|
72
|
-
expect(mockOnDelete).toBeCalledTimes(0);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it('Renders with clickable card link', async () => {
|
|
76
|
-
const user = userEvent.setup();
|
|
77
|
-
const mockOnClick = jest.fn();
|
|
78
|
-
const mockOnDelete = jest.fn();
|
|
79
|
-
const { getByRole } = render(
|
|
80
|
-
<MemoryRouter>
|
|
81
|
-
<Routes>
|
|
82
|
-
<Route
|
|
83
|
-
path="/*"
|
|
84
|
-
element={
|
|
85
|
-
<ExchangeAccount
|
|
86
|
-
{...commonProps}
|
|
87
|
-
link="/link"
|
|
88
|
-
onClick={mockOnClick}
|
|
89
|
-
onDelete={mockOnDelete}
|
|
90
|
-
/>
|
|
91
|
-
}
|
|
92
|
-
/>
|
|
93
|
-
</Routes>
|
|
94
|
-
</MemoryRouter>,
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
const link = getByRole('link');
|
|
98
|
-
await user.click(link);
|
|
99
|
-
|
|
100
|
-
expect(link).toHaveAttribute('href', '/link');
|
|
101
|
-
expect(mockOnClick).toBeCalledTimes(1);
|
|
102
|
-
expect(mockOnDelete).toBeCalledTimes(0);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { MemoryRouter, Route, Routes } from 'react-router-dom';
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { css, useTheme } from '@emotion/react';
|
|
4
|
-
import { css as cssClassname } from '@emotion/css';
|
|
5
|
-
import { Icon, AddNewAccountCard } from '@ssa-ui-kit/core';
|
|
6
|
-
import { ExchangeAccount } from './ExchangeAccount';
|
|
7
|
-
import { dataValues } from './helpers';
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: 'Trading/ExchangeAccount',
|
|
11
|
-
component: ExchangeAccount,
|
|
12
|
-
} as Meta<typeof ExchangeAccount>;
|
|
13
|
-
|
|
14
|
-
export const Default: StoryObj<typeof ExchangeAccount> = () => {
|
|
15
|
-
return (
|
|
16
|
-
<ExchangeAccount
|
|
17
|
-
platform={dataValues[0].platform}
|
|
18
|
-
title={dataValues[0].title}
|
|
19
|
-
status={dataValues[0].status}
|
|
20
|
-
data={dataValues[0].data}
|
|
21
|
-
onClick={() => alert('Card is clicked!')}
|
|
22
|
-
onDelete={() => alert('Card is deleted!')}
|
|
23
|
-
pieChartProps={{
|
|
24
|
-
className: cssClassname`
|
|
25
|
-
align-self: center;
|
|
26
|
-
max-width: 300px;
|
|
27
|
-
`,
|
|
28
|
-
}}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
Default.args = {};
|
|
34
|
-
|
|
35
|
-
export const WithLink: StoryObj<typeof ExchangeAccount> = () => {
|
|
36
|
-
return (
|
|
37
|
-
<MemoryRouter>
|
|
38
|
-
<Routes>
|
|
39
|
-
<Route
|
|
40
|
-
path="/*"
|
|
41
|
-
element={
|
|
42
|
-
<ExchangeAccount
|
|
43
|
-
platform={dataValues[0].platform}
|
|
44
|
-
title={dataValues[0].title}
|
|
45
|
-
status={dataValues[0].status}
|
|
46
|
-
data={dataValues[0].data}
|
|
47
|
-
link="/link"
|
|
48
|
-
onClick={() => alert('Card is clicked!')}
|
|
49
|
-
onDelete={() => alert('Card is deleted!')}
|
|
50
|
-
pieChartProps={{
|
|
51
|
-
className: cssClassname`
|
|
52
|
-
align-self: center;
|
|
53
|
-
max-width: 300px;
|
|
54
|
-
`,
|
|
55
|
-
}}
|
|
56
|
-
/>
|
|
57
|
-
}
|
|
58
|
-
/>
|
|
59
|
-
</Routes>
|
|
60
|
-
</MemoryRouter>
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
WithLink.args = {};
|
|
65
|
-
|
|
66
|
-
export const List: StoryObj<typeof ExchangeAccount> = () => {
|
|
67
|
-
const theme = useTheme();
|
|
68
|
-
return (
|
|
69
|
-
<div
|
|
70
|
-
css={css`
|
|
71
|
-
display: grid;
|
|
72
|
-
grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
|
|
73
|
-
gap: 10px;
|
|
74
|
-
|
|
75
|
-
${theme.mediaQueries.md} {
|
|
76
|
-
max-width: 1542px;
|
|
77
|
-
grid-template-columns: repeat(3, minmax(270px, 1fr));
|
|
78
|
-
gap: 20px;
|
|
79
|
-
}
|
|
80
|
-
`}>
|
|
81
|
-
<AddNewAccountCard>
|
|
82
|
-
<Icon name="plus" size={12} color={theme.colors.blueRoyal} />
|
|
83
|
-
Add new account
|
|
84
|
-
</AddNewAccountCard>
|
|
85
|
-
{dataValues.map((item, index) => {
|
|
86
|
-
return (
|
|
87
|
-
<ExchangeAccount
|
|
88
|
-
key={index}
|
|
89
|
-
platform={item.platform}
|
|
90
|
-
title={item.title}
|
|
91
|
-
status={item.status}
|
|
92
|
-
data={item.data}
|
|
93
|
-
onClick={() => alert('Card is clicked!')}
|
|
94
|
-
onDelete={() => alert('Card is deleted!')}
|
|
95
|
-
pieChartProps={{
|
|
96
|
-
className: cssClassname`
|
|
97
|
-
align-self: center;
|
|
98
|
-
max-width: 300px;
|
|
99
|
-
`,
|
|
100
|
-
}}
|
|
101
|
-
/>
|
|
102
|
-
);
|
|
103
|
-
})}
|
|
104
|
-
</div>
|
|
105
|
-
);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
List.args = {};
|