@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.
Files changed (257) hide show
  1. package/dist/components/AccountBalance/AccountBalance.d.ts +1 -1
  2. package/dist/components/AccountBalance/BalancePieChart.d.ts +1 -1
  3. package/dist/components/AccountBalance/BalancePieChartTitle.d.ts +1 -1
  4. package/dist/components/AccountKeys/AccountKeys.d.ts +1 -1
  5. package/dist/components/AccountKeys/stories/StoryComponent.d.ts +1 -1
  6. package/dist/components/Activity/Activity.d.ts +1 -1
  7. package/dist/components/Activity/ActivityItem.d.ts +1 -1
  8. package/dist/components/Bmi/Bmi.d.ts +1 -1
  9. package/dist/components/Bmi/BmiLabels.d.ts +1 -1
  10. package/dist/components/BotsTable/BotsTable.d.ts +1 -1
  11. package/dist/components/BotsTable/stories/BotsTable/StoryComponent.d.ts +1 -1
  12. package/dist/components/BotsTable/stories/BotsTable/components/Actions/ActionIcon.d.ts +1 -1
  13. package/dist/components/BotsTable/stories/BotsTable/components/Actions/ActionItem.d.ts +1 -1
  14. package/dist/components/BotsTable/stories/BotsTable/components/Actions/ActionMore.d.ts +1 -1
  15. package/dist/components/BotsTable/stories/BotsTable/components/Actions/ActionRun.d.ts +1 -1
  16. package/dist/components/BotsTable/stories/BotsTable/components/Actions/Actions.d.ts +1 -1
  17. package/dist/components/BotsTable/stories/BotsTable/components/Actions/ActionsWrapper.d.ts +1 -1
  18. package/dist/components/BotsTable/stories/BotsTable/components/Actions/consts.d.ts +3 -3
  19. package/dist/components/BotsTable/stories/BotsTable/components/Exchange/Exchange.d.ts +1 -1
  20. package/dist/components/BotsTable/stories/BotsTable/components/Exchange/consts.d.ts +3 -3
  21. package/dist/components/BotsTable/stories/BotsTable/components/PNL.d.ts +1 -1
  22. package/dist/components/BotsTable/stories/BotsTable/components/ROI.d.ts +1 -1
  23. package/dist/components/BotsTable/stories/BotsTable/components/TableTag.d.ts +1 -1
  24. package/dist/components/BotsTable/stories/BotsTable/components/Trade/Trade.d.ts +1 -1
  25. package/dist/components/BotsTable/stories/NoControlOrders/StoryComponent.d.ts +1 -1
  26. package/dist/components/BotsTable/stories/NoControlOrders/components/ActionMore.d.ts +1 -1
  27. package/dist/components/BotsTable/stories/NoControlOrders/components/Reason.d.ts +1 -1
  28. package/dist/components/BotsTable/stories/NoControlOrders/components/TableList.d.ts +1 -1
  29. package/dist/components/BotsTable/stories/NoControlOrders/components/TableRow.d.ts +1 -1
  30. package/dist/components/Calories/Calories.d.ts +1 -1
  31. package/dist/components/Calories/innerContent.d.ts +1 -1
  32. package/dist/components/ExchangeAccount/ExchangeAccount.d.ts +1 -1
  33. package/dist/components/HeartRate/BPM.d.ts +1 -1
  34. package/dist/components/HeartRate/HeartRate.d.ts +1 -1
  35. package/dist/components/HeartRate/HeartRateLineChart.d.ts +1 -1
  36. package/dist/components/ListGoals/ListGoals.d.ts +1 -1
  37. package/dist/components/ListGoals/ListGoalsCard.d.ts +1 -1
  38. package/dist/components/MealNutrients/MealNutrients.d.ts +1 -1
  39. package/dist/components/MealNutrients/MealNutrientsLineChart.d.ts +1 -1
  40. package/dist/components/MealNutrients/MealNutrientsTooltip.d.ts +1 -1
  41. package/dist/components/MealPlanner/MealPlanner.d.ts +1 -1
  42. package/dist/components/MealPlanner/MealPlannerCard.d.ts +1 -1
  43. package/dist/components/StepsCounter/StepsCounter.d.ts +1 -1
  44. package/dist/components/TradingInfoCard/TradingInfoCard.d.ts +1 -1
  45. package/dist/components/TradingInfoCard/TradingInfoCardContent.d.ts +1 -1
  46. package/dist/components/TradingInfoCard/TradingInfoCardTooltip.d.ts +1 -1
  47. package/dist/components/TradingInfoCard/TradingInfoCardWrapper.d.ts +1 -1
  48. package/dist/components/TradingScoreboard/TradingScoreboard.d.ts +1 -1
  49. package/dist/components/TradingScoreboard/helpers.d.ts +4 -4
  50. package/dist/components/UpcomingWorkouts/UpcomingWorkoutCard.d.ts +1 -1
  51. package/dist/components/UpcomingWorkouts/UpcomingWorkouts.d.ts +1 -1
  52. package/dist/components/UserCard/UserCard.d.ts +1 -1
  53. package/dist/components/UserCard/UserCardBMI.d.ts +1 -1
  54. package/dist/components/UserCard/UserCardCredentials.d.ts +1 -1
  55. package/dist/components/UserCard/UserCardItem.d.ts +1 -1
  56. package/dist/components/WaterConsume/WaterConsume.d.ts +1 -1
  57. package/dist/index.js +2439 -1
  58. package/dist/index.js.map +1 -1
  59. package/package.json +24 -27
  60. package/.babelrc.js +0 -4
  61. package/.env +0 -7
  62. package/.storybook/main.ts +0 -47
  63. package/.storybook/preview.tsx +0 -22
  64. package/.storybook/style.css +0 -40
  65. package/custom-shots/widgets-bots-table--no-control-orders--menu-opened_[w1920px].png +0 -0
  66. package/custom-shots/widgets-bots-table--no-control-orders--run-reason-modal_[w1920px].png +0 -0
  67. package/custom-shots/widgets-heart-rate--hint-opened__[w1440px].png +0 -0
  68. package/custom-shots/widgets-heart-rate--hint-opened__[w1920px].png +0 -0
  69. package/custom-shots/widgets-heart-rate--hint-opened__[w390px].png +0 -0
  70. package/custom-shots/widgets-heart-rate--hint-opened__[w900px].png +0 -0
  71. package/custom-shots/widgets-meal-nutrients--hint-opened__[w1440px].png +0 -0
  72. package/custom-shots/widgets-meal-nutrients--hint-opened__[w1920px].png +0 -0
  73. package/custom-shots/widgets-meal-nutrients--hint-opened__[w390px].png +0 -0
  74. package/custom-shots/widgets-meal-nutrients--hint-opened__[w900px].png +0 -0
  75. package/custom-shots/widgets-meal-nutrients--hint-opened__dropdown__[w1440px].png +0 -0
  76. package/custom-shots/widgets-meal-nutrients--hint-opened__dropdown__[w1920px].png +0 -0
  77. package/custom-shots/widgets-meal-nutrients--hint-opened__dropdown__[w390px].png +0 -0
  78. package/custom-shots/widgets-meal-nutrients--hint-opened__dropdown__[w900px].png +0 -0
  79. package/custom-shots/widgets-trading-info-card--hover__[w1920px].png +0 -0
  80. package/customTest.tsx +0 -35
  81. package/jest-setup.ts +0 -20
  82. package/lostpixel.config.ts +0 -29
  83. package/playwright.config.ts +0 -7
  84. package/src/components/AccountBalance/AccountBalance.specBackup.tsx +0 -105
  85. package/src/components/AccountBalance/AccountBalance.stories.tsx +0 -138
  86. package/src/components/AccountBalance/AccountBalance.tsx +0 -60
  87. package/src/components/AccountBalance/BalancePieChart.tsx +0 -127
  88. package/src/components/AccountBalance/BalancePieChartTitle.tsx +0 -54
  89. package/src/components/AccountBalance/index.ts +0 -4
  90. package/src/components/AccountBalance/stories/fixtures.ts +0 -26
  91. package/src/components/AccountBalance/types.ts +0 -41
  92. package/src/components/AccountKeys/AccountKeys.specBackup.tsx +0 -43
  93. package/src/components/AccountKeys/AccountKeys.stories.tsx +0 -14
  94. package/src/components/AccountKeys/AccountKeys.tsx +0 -73
  95. package/src/components/AccountKeys/helpers.ts +0 -7
  96. package/src/components/AccountKeys/index.ts +0 -2
  97. package/src/components/AccountKeys/stories/StoryComponent.tsx +0 -33
  98. package/src/components/AccountKeys/styles.ts +0 -87
  99. package/src/components/AccountKeys/types.ts +0 -8
  100. package/src/components/Activity/Activity.specBackup.tsx +0 -79
  101. package/src/components/Activity/Activity.stories.tsx +0 -15
  102. package/src/components/Activity/Activity.tsx +0 -83
  103. package/src/components/Activity/ActivityItem.tsx +0 -38
  104. package/src/components/Activity/index.tsx +0 -2
  105. package/src/components/Activity/mockActivityRequest.ts +0 -106
  106. package/src/components/Activity/styles.ts +0 -12
  107. package/src/components/Activity/types.ts +0 -10
  108. package/src/components/Bmi/Bmi.spec.Backup.tsx +0 -68
  109. package/src/components/Bmi/Bmi.stories.tsx +0 -10
  110. package/src/components/Bmi/Bmi.tsx +0 -96
  111. package/src/components/Bmi/BmiHeatbar.tsx +0 -18
  112. package/src/components/Bmi/BmiInfo.tsx +0 -11
  113. package/src/components/Bmi/BmiLabel.tsx +0 -9
  114. package/src/components/Bmi/BmiLabels.tsx +0 -33
  115. package/src/components/Bmi/BmiPointer.tsx +0 -15
  116. package/src/components/Bmi/index.tsx +0 -2
  117. package/src/components/Bmi/styles.ts +0 -18
  118. package/src/components/Bmi/types.ts +0 -4
  119. package/src/components/BotsTable/BotsTable.e2e.ts +0 -77
  120. package/src/components/BotsTable/BotsTable.specBackup.tsx +0 -125
  121. package/src/components/BotsTable/BotsTable.tsx +0 -32
  122. package/src/components/BotsTable/BotsTableCell.tsx +0 -13
  123. package/src/components/BotsTable/BotsTableHead.tsx +0 -13
  124. package/src/components/BotsTable/BotsTableRow.tsx +0 -17
  125. package/src/components/BotsTable/BotsTableWrapper.tsx +0 -23
  126. package/src/components/BotsTable/index.ts +0 -5
  127. package/src/components/BotsTable/stories/BotsTable/StoryComponent.tsx +0 -59
  128. package/src/components/BotsTable/stories/BotsTable/components/Actions/ActionIcon.tsx +0 -11
  129. package/src/components/BotsTable/stories/BotsTable/components/Actions/ActionItem.tsx +0 -40
  130. package/src/components/BotsTable/stories/BotsTable/components/Actions/ActionMore.tsx +0 -89
  131. package/src/components/BotsTable/stories/BotsTable/components/Actions/ActionRun.tsx +0 -133
  132. package/src/components/BotsTable/stories/BotsTable/components/Actions/Actions.tsx +0 -13
  133. package/src/components/BotsTable/stories/BotsTable/components/Actions/ActionsWrapper.tsx +0 -21
  134. package/src/components/BotsTable/stories/BotsTable/components/Actions/consts.tsx +0 -118
  135. package/src/components/BotsTable/stories/BotsTable/components/Actions/index.ts +0 -6
  136. package/src/components/BotsTable/stories/BotsTable/components/Exchange/Exchange.tsx +0 -26
  137. package/src/components/BotsTable/stories/BotsTable/components/Exchange/consts.tsx +0 -157
  138. package/src/components/BotsTable/stories/BotsTable/components/Exchange/index.ts +0 -1
  139. package/src/components/BotsTable/stories/BotsTable/components/Exchange/types.ts +0 -6
  140. package/src/components/BotsTable/stories/BotsTable/components/PNL.tsx +0 -27
  141. package/src/components/BotsTable/stories/BotsTable/components/ROI.tsx +0 -25
  142. package/src/components/BotsTable/stories/BotsTable/components/TableTag.tsx +0 -22
  143. package/src/components/BotsTable/stories/BotsTable/components/Trade/Trade.tsx +0 -8
  144. package/src/components/BotsTable/stories/BotsTable/components/Trade/consts.ts +0 -14
  145. package/src/components/BotsTable/stories/BotsTable/components/Trade/index.ts +0 -1
  146. package/src/components/BotsTable/stories/BotsTable/components/Trade/types.ts +0 -5
  147. package/src/components/BotsTable/stories/BotsTable/components/index.ts +0 -6
  148. package/src/components/BotsTable/stories/BotsTable/index.ts +0 -1
  149. package/src/components/BotsTable/stories/BotsTable/mockData.ts +0 -84
  150. package/src/components/BotsTable/stories/BotsTable.stories.tsx +0 -39
  151. package/src/components/BotsTable/stories/NoControlOrders/StoryComponent.tsx +0 -35
  152. package/src/components/BotsTable/stories/NoControlOrders/components/ActionMore.tsx +0 -95
  153. package/src/components/BotsTable/stories/NoControlOrders/components/Reason.tsx +0 -11
  154. package/src/components/BotsTable/stories/NoControlOrders/components/TableList.tsx +0 -45
  155. package/src/components/BotsTable/stories/NoControlOrders/components/TableRow.tsx +0 -31
  156. package/src/components/BotsTable/stories/NoControlOrders/components/index.ts +0 -4
  157. package/src/components/BotsTable/stories/NoControlOrders/mockData.ts +0 -23
  158. package/src/components/BotsTable/stories/NoControlOrders/types.ts +0 -16
  159. package/src/components/BotsTable/types.ts +0 -31
  160. package/src/components/Calories/Calories.specBackup.tsx +0 -11
  161. package/src/components/Calories/Calories.stories.tsx +0 -26
  162. package/src/components/Calories/Calories.tsx +0 -54
  163. package/src/components/Calories/index.tsx +0 -2
  164. package/src/components/Calories/innerContent.tsx +0 -30
  165. package/src/components/Calories/types.ts +0 -4
  166. package/src/components/ExchangeAccount/ExchangeAccount.specBackup.tsx +0 -104
  167. package/src/components/ExchangeAccount/ExchangeAccount.stories.tsx +0 -108
  168. package/src/components/ExchangeAccount/ExchangeAccount.tsx +0 -90
  169. package/src/components/ExchangeAccount/helpers.tsx +0 -153
  170. package/src/components/ExchangeAccount/index.ts +0 -2
  171. package/src/components/ExchangeAccount/styles.ts +0 -115
  172. package/src/components/ExchangeAccount/types.ts +0 -14
  173. package/src/components/HeartRate/BPM.tsx +0 -43
  174. package/src/components/HeartRate/HeartRate.e2e.ts +0 -78
  175. package/src/components/HeartRate/HeartRate.specBackup.tsx +0 -91
  176. package/src/components/HeartRate/HeartRate.stories.tsx +0 -36
  177. package/src/components/HeartRate/HeartRate.tsx +0 -105
  178. package/src/components/HeartRate/HeartRateLineChart.tsx +0 -53
  179. package/src/components/HeartRate/index.ts +0 -2
  180. package/src/components/HeartRate/mockHeartRateRequest.ts +0 -15
  181. package/src/components/HeartRate/types.ts +0 -15
  182. package/src/components/HeartRate/utils.tsx +0 -8
  183. package/src/components/ListGoals/ListGoals.specBackup.tsx +0 -82
  184. package/src/components/ListGoals/ListGoals.stories.tsx +0 -58
  185. package/src/components/ListGoals/ListGoals.tsx +0 -29
  186. package/src/components/ListGoals/ListGoalsCard.tsx +0 -61
  187. package/src/components/ListGoals/index.ts +0 -2
  188. package/src/components/ListGoals/styles.tsx +0 -11
  189. package/src/components/ListGoals/types.ts +0 -25
  190. package/src/components/MealNutrients/MealNutrients.e2e.ts +0 -68
  191. package/src/components/MealNutrients/MealNutrients.specBackup.tsx +0 -134
  192. package/src/components/MealNutrients/MealNutrients.stories.tsx +0 -37
  193. package/src/components/MealNutrients/MealNutrients.tsx +0 -84
  194. package/src/components/MealNutrients/MealNutrientsLineChart.tsx +0 -89
  195. package/src/components/MealNutrients/MealNutrientsTooltip.tsx +0 -30
  196. package/src/components/MealNutrients/chartDefaultConfig.tsx +0 -87
  197. package/src/components/MealNutrients/index.tsx +0 -2
  198. package/src/components/MealNutrients/mockMealNutrientsRequest.ts +0 -1246
  199. package/src/components/MealNutrients/types.ts +0 -37
  200. package/src/components/MealNutrients/useChartConfig.ts +0 -69
  201. package/src/components/MealPlanner/MealPlanner.specBackup.tsx +0 -77
  202. package/src/components/MealPlanner/MealPlanner.stories.tsx +0 -15
  203. package/src/components/MealPlanner/MealPlanner.tsx +0 -100
  204. package/src/components/MealPlanner/MealPlannerBadge.tsx +0 -15
  205. package/src/components/MealPlanner/MealPlannerBars.tsx +0 -19
  206. package/src/components/MealPlanner/MealPlannerCard.tsx +0 -73
  207. package/src/components/MealPlanner/MealPlannerLegends.tsx +0 -22
  208. package/src/components/MealPlanner/index.ts +0 -2
  209. package/src/components/MealPlanner/mockMealPlannerRequest.ts +0 -70
  210. package/src/components/MealPlanner/types.ts +0 -21
  211. package/src/components/StepsCounter/StepsCounter.specBackup.tsx +0 -14
  212. package/src/components/StepsCounter/StepsCounter.stories.tsx +0 -16
  213. package/src/components/StepsCounter/StepsCounter.tsx +0 -74
  214. package/src/components/StepsCounter/index.ts +0 -2
  215. package/src/components/StepsCounter/types.ts +0 -4
  216. package/src/components/TradingInfoCard/TradingInfoCard.e2e.ts +0 -18
  217. package/src/components/TradingInfoCard/TradingInfoCard.specBackup.tsx +0 -116
  218. package/src/components/TradingInfoCard/TradingInfoCard.stories.tsx +0 -118
  219. package/src/components/TradingInfoCard/TradingInfoCard.tsx +0 -49
  220. package/src/components/TradingInfoCard/TradingInfoCardContent.tsx +0 -32
  221. package/src/components/TradingInfoCard/TradingInfoCardTooltip.tsx +0 -47
  222. package/src/components/TradingInfoCard/TradingInfoCardWrapper.tsx +0 -72
  223. package/src/components/TradingInfoCard/index.ts +0 -3
  224. package/src/components/TradingInfoCard/types.ts +0 -27
  225. package/src/components/TradingScoreboard/TradingScoreboard.specBackup.tsx +0 -119
  226. package/src/components/TradingScoreboard/TradingScoreboard.stories.tsx +0 -119
  227. package/src/components/TradingScoreboard/TradingScoreboard.tsx +0 -41
  228. package/src/components/TradingScoreboard/TradingScoreboardBase.tsx +0 -17
  229. package/src/components/TradingScoreboard/helpers.tsx +0 -134
  230. package/src/components/TradingScoreboard/index.ts +0 -2
  231. package/src/components/TradingScoreboard/types.ts +0 -18
  232. package/src/components/UpcomingWorkouts/UpcomingWorkoutCard.tsx +0 -64
  233. package/src/components/UpcomingWorkouts/UpcomingWorkouts.specBackup.tsx +0 -56
  234. package/src/components/UpcomingWorkouts/UpcomingWorkouts.stories.tsx +0 -32
  235. package/src/components/UpcomingWorkouts/UpcomingWorkouts.tsx +0 -27
  236. package/src/components/UpcomingWorkouts/index.ts +0 -2
  237. package/src/components/UpcomingWorkouts/style.ts +0 -12
  238. package/src/components/UpcomingWorkouts/types.ts +0 -23
  239. package/src/components/UserCard/UserCard.tsx +0 -46
  240. package/src/components/UserCard/UserCardBMI.tsx +0 -37
  241. package/src/components/UserCard/UserCardCredentials.tsx +0 -56
  242. package/src/components/UserCard/UserCardItem.tsx +0 -42
  243. package/src/components/UserCard/index.tsx +0 -2
  244. package/src/components/UserCard/types.ts +0 -8
  245. package/src/components/WaterConsume/WaterConsume.specBackup.tsx +0 -62
  246. package/src/components/WaterConsume/WaterConsume.stories.tsx +0 -36
  247. package/src/components/WaterConsume/WaterConsume.tsx +0 -188
  248. package/src/components/WaterConsume/index.ts +0 -2
  249. package/src/components/WaterConsume/types.ts +0 -11
  250. package/src/consts.ts +0 -18
  251. package/src/index.ts +0 -36
  252. package/src/injectGlobal.ts +0 -41
  253. package/test-results/.last-run.json +0 -21
  254. package/tsbuildcache +0 -1
  255. package/tsconfig.build.json +0 -44
  256. package/tsconfig.json +0 -17
  257. package/webpack.config.js +0 -28
@@ -1,127 +0,0 @@
1
- import { useState } from 'react';
2
- import { withTheme, css } from '@emotion/react';
3
- import {
4
- PieChart,
5
- PieChartFeatures,
6
- PieChartLegend,
7
- pieChartPalettes,
8
- } from '@ssa-ui-kit/core';
9
- import { BalancePieChartTitle } from './BalancePieChartTitle';
10
-
11
- import { BalancePieChartProps } from './types';
12
-
13
- export const BalancePieChart = withTheme(
14
- ({
15
- total,
16
- currency,
17
- data,
18
- theme,
19
- chartColorPalette,
20
- legendColorPalette,
21
- variant = 'valueList',
22
- pieChartProps = {},
23
- fullscreenModeFeature = false,
24
- activeHighlight = false,
25
- onFullscreenModeChange,
26
- }: BalancePieChartProps) => {
27
- const [isFullscreenMode, setFullscreenMode] = useState(false);
28
- const { legendColorNames, pieChartColors } =
29
- pieChartPalettes.getBalancePalette(theme);
30
- const featuresList = new Set<PieChartFeatures>();
31
-
32
- if (Object.keys(pieChartProps.cardProps || {}).length) {
33
- featuresList.add('header');
34
- }
35
- if (fullscreenModeFeature) {
36
- featuresList.add('header');
37
- featuresList.add('fullscreenMode');
38
- }
39
-
40
- const handleFullscreenModeChange = (pieChartFullscreenMode: boolean) => {
41
- setFullscreenMode(pieChartFullscreenMode);
42
- onFullscreenModeChange?.(pieChartFullscreenMode);
43
- };
44
- return (
45
- <PieChart
46
- data={data}
47
- features={Array.from(featuresList)}
48
- colors={chartColorPalette || pieChartColors}
49
- onFullscreenModeChange={handleFullscreenModeChange}
50
- animate={false}
51
- title={
52
- <BalancePieChartTitle
53
- theme={theme}
54
- total={total}
55
- currency={currency}
56
- />
57
- }
58
- css={
59
- !isFullscreenMode &&
60
- css`
61
- div:nth-of-type(1) {
62
- width: 100px;
63
- height: 100px;
64
- }
65
-
66
- ${theme.mediaQueries.lg} {
67
- div:nth-of-type(1) {
68
- width: 120px;
69
- height: 120px;
70
- }
71
- }
72
- `
73
- }
74
- width={'100%'}
75
- {...pieChartProps}>
76
- <PieChartLegend
77
- data={data}
78
- colors={legendColorPalette || legendColorNames}
79
- variant={variant}
80
- currency={currency}
81
- activeHighlight={activeHighlight}
82
- markerStyles={css`
83
- width: 10px;
84
- height: 10px;
85
- margin-right: 5px;
86
- `}
87
- labelListStyles={css`
88
- gap: 0;
89
- li {
90
- height: 22.5px;
91
- }
92
- h6 {
93
- font-weight: 700;
94
- line-height: 22.5px;
95
- font-size: ${!isFullscreenMode && '12px'};
96
- ${theme.mediaQueries.md} {
97
- font-size: ${!isFullscreenMode && '13px'};
98
- }
99
- ${theme.mediaQueries.lg} {
100
- font-size: ${!isFullscreenMode && '14px'};
101
- }
102
- }
103
- `}
104
- valueListStyles={css`
105
- gap: 0;
106
- li {
107
- height: 22.5px;
108
- }
109
- h6 {
110
- line-height: 22.5px;
111
- color: ${theme.colors.greyDarker80};
112
- font-size: ${isFullscreenMode ? '12px' : '11px'};
113
- ${theme.mediaQueries.lg} {
114
- font-size: 12px;
115
- }
116
- }
117
- `}
118
- renderValue={({ id, legendValue }) =>
119
- id === 'Other'
120
- ? legendValue + ' ' + currency
121
- : legendValue + ' ' + id
122
- }
123
- />
124
- </PieChart>
125
- );
126
- },
127
- );
@@ -1,54 +0,0 @@
1
- import { withTheme, css } from '@emotion/react';
2
- import { Typography, useFullscreenMode } from '@ssa-ui-kit/core';
3
- import { BalancePieChartTitleProps } from './types';
4
-
5
- export const BalancePieChartTitle = withTheme(
6
- ({ total, currency, theme }: BalancePieChartTitleProps) => {
7
- const { isFullscreenMode } = useFullscreenMode();
8
- return (
9
- <Typography
10
- variant="body2"
11
- weight="bold"
12
- color={theme.colors.greyDarker}
13
- css={
14
- isFullscreenMode
15
- ? css`
16
- font-size: 24px !important;
17
- font-weight: 500;
18
- `
19
- : css`
20
- font-size: 12px;
21
- padding: 0 14px;
22
- line-height: 1;
23
- `
24
- }>
25
- {total}
26
- <Typography
27
- variant="body2"
28
- weight="regular"
29
- as="span"
30
- color={theme.colors.greyDarker80}
31
- css={
32
- isFullscreenMode
33
- ? css`
34
- font-size: 18px;
35
- margin-left: 10px;
36
- `
37
- : css`
38
- display: block;
39
- font-size: 12px;
40
- ${theme.mediaQueries.md} {
41
- font-size: 13px;
42
- }
43
- ${theme.mediaQueries.lg} {
44
- font-size: 14px;
45
- }
46
- line-height: 25px;
47
- `
48
- }>
49
- {currency}
50
- </Typography>
51
- </Typography>
52
- );
53
- },
54
- );
@@ -1,4 +0,0 @@
1
- export { AccountBalance } from './AccountBalance';
2
- export { BalancePieChart } from './BalancePieChart';
3
- export { BalancePieChartTitle } from './BalancePieChartTitle';
4
- export * from './types';
@@ -1,26 +0,0 @@
1
- export const data = [
2
- {
3
- id: 'BTC',
4
- label: 'BTC',
5
- legendValue: 1,
6
- value: 35371.23,
7
- },
8
- {
9
- id: 'LTC',
10
- label: 'LTC',
11
- legendValue: 7,
12
- value: 530.25,
13
- },
14
- {
15
- id: 'ETH',
16
- label: 'ETH',
17
- legendValue: 1,
18
- value: 1815.31,
19
- },
20
- {
21
- id: 'Other',
22
- label: 'Other',
23
- legendValue: 943,
24
- value: 1513.9956,
25
- },
26
- ];
@@ -1,41 +0,0 @@
1
- import type { To } from 'react-router-dom';
2
- import { MainColors, PieChartProps, Theme } from '@ssa-ui-kit/core';
3
-
4
- interface WithTheme {
5
- theme: Theme;
6
- }
7
-
8
- type BalanceBase = {
9
- total: number | string;
10
- currency: string;
11
- legendColorPalette?: Array<keyof MainColors | string>;
12
- chartColorPalette?: string[];
13
- variant?: 'valueList' | 'withoutValueList';
14
- fullscreenModeFeature?: boolean;
15
- data: Array<{
16
- id: string | number;
17
- value: number;
18
- label: string;
19
- [key: string | number | symbol]: unknown;
20
- }>;
21
- };
22
-
23
- export interface BalancePieChartProps extends WithTheme, BalanceBase {
24
- pieChartProps?: Partial<PieChartProps>;
25
- activeHighlight?: boolean;
26
- onFullscreenModeChange?: (isFullscreenMode: boolean) => void;
27
- }
28
-
29
- export interface AccountBalanceProps extends BalanceBase {
30
- title?: string;
31
- className?: string;
32
- onClick?: () => void;
33
- link?: To;
34
- activeHighlight?: boolean;
35
- widgetMaxWidth?: string;
36
- }
37
-
38
- export type BalancePieChartTitleProps = Pick<
39
- BalancePieChartProps,
40
- 'total' | 'currency' | 'theme'
41
- >;
@@ -1,43 +0,0 @@
1
- import userEvent from '@testing-library/user-event';
2
- import { StoryComponent } from './stories/StoryComponent';
3
-
4
- describe('AccountKeys', () => {
5
- it('Renders with title', () => {
6
- const { getByText } = render(<StoryComponent onDelete={jest.fn()} />);
7
-
8
- getByText('Account Name');
9
- });
10
-
11
- it('Renders with delete button', async () => {
12
- const user = userEvent.setup();
13
- const mockOnClick = jest.fn();
14
- const { getByRole } = render(<StoryComponent onDelete={mockOnClick} />);
15
-
16
- const deleteButton = getByRole('button', { name: 'Bin' });
17
- await user.click(deleteButton);
18
- expect(mockOnClick).toBeCalledTimes(1);
19
- });
20
-
21
- it('Renders with API key and hidden Secret key', () => {
22
- const { getByText } = render(<StoryComponent onDelete={jest.fn()} />);
23
-
24
- getByText('123456789012345678901234567890');
25
- getByText('******');
26
- });
27
-
28
- it('Clicks on hidden/unhidden secret key', async () => {
29
- const user = userEvent.setup();
30
- const mockOnClick = jest.fn();
31
- const { getByRole, getByText } = render(
32
- <StoryComponent onDelete={mockOnClick} />,
33
- );
34
-
35
- const invisibleIcon = getByRole('button', { name: 'Invisible' });
36
- await user.click(invisibleIcon);
37
- getByText('1234567890');
38
-
39
- const visibleIcon = getByRole('button', { name: 'Visible' });
40
- await user.click(visibleIcon);
41
- getByText('******');
42
- });
43
- });
@@ -1,14 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { AccountKeys } from './AccountKeys';
3
- import { StoryComponent } from './stories/StoryComponent';
4
-
5
- export default {
6
- title: 'Trading/AccountKeys',
7
- component: AccountKeys,
8
- } as Meta<typeof AccountKeys>;
9
-
10
- export const Default: StoryObj<typeof AccountKeys> = () => (
11
- <StoryComponent onDelete={() => alert('Account Deleted!')} />
12
- );
13
-
14
- Default.args = {};
@@ -1,73 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import { useTheme } from '@emotion/react';
3
- import {
4
- Button,
5
- Card,
6
- CardContent,
7
- CardHeader,
8
- Icon,
9
- Typography,
10
- } from '@ssa-ui-kit/core';
11
- import { AccountKeysProps } from './types';
12
- import * as S from './styles';
13
-
14
- export const AccountKeys = ({
15
- title,
16
- apiKey,
17
- secretKey,
18
- onDelete,
19
- onVisibilityChange,
20
- isDisabled,
21
- }: AccountKeysProps) => {
22
- const [isVisible, setIsVisible] = useState(false);
23
- const theme = useTheme();
24
- const placeholder = <span>******</span>;
25
-
26
- const handleClickVisible = () => {
27
- setIsVisible((prev) => !prev);
28
- };
29
-
30
- useEffect(() => {
31
- onVisibilityChange(isVisible);
32
- }, [isVisible]);
33
-
34
- return (
35
- <Card noShadow css={S.Card} className={isDisabled ? 'disabled' : ''}>
36
- <CardHeader css={S.CardHeader}>
37
- <Typography variant="h5" weight="bold">
38
- {title}
39
- </Typography>
40
- <Button css={S.DeleteButton} onClick={onDelete}>
41
- <Icon name="bin" size={15} color={theme.colors.greyDropdownFocused} />
42
- </Button>
43
- </CardHeader>
44
- <CardContent css={S.CardContent} direction="column">
45
- <div css={S.KeyItem}>
46
- <Typography variant="h6" color={theme.colors.greyDropdownFocused}>
47
- API Key
48
- </Typography>
49
- <Typography variant="h5" weight="bold" css={S.LetterWrap}>
50
- {apiKey}
51
- </Typography>
52
- </div>
53
- <div css={S.KeyItem}>
54
- <Typography variant="h6" color={theme.colors.greyDropdownFocused}>
55
- Secret Key
56
- </Typography>
57
- <Typography variant="h5" weight="bold" css={S.SecretKey}>
58
- <span css={S.LetterWrap}>
59
- {isVisible ? secretKey || placeholder : placeholder}
60
- </span>
61
- <Button css={S.VisibleButton} onClick={handleClickVisible}>
62
- <Icon
63
- name={isVisible ? 'visible' : 'invisible'}
64
- size={20}
65
- color={theme.colors.greyDropdownFocused}
66
- />
67
- </Button>
68
- </Typography>
69
- </div>
70
- </CardContent>
71
- </Card>
72
- );
73
- };
@@ -1,7 +0,0 @@
1
- const secretKey = '1234567890';
2
-
3
- export const getMockData = () => {
4
- return new Promise<string>((resolve) => {
5
- resolve(secretKey);
6
- });
7
- };
@@ -1,2 +0,0 @@
1
- export { AccountKeys } from './AccountKeys';
2
- export * from './types';
@@ -1,33 +0,0 @@
1
- import { useState } from 'react';
2
- import { AccountKeys } from '../AccountKeys';
3
- import { getMockData } from '../helpers';
4
-
5
- interface onDelete {
6
- onDelete: () => void;
7
- }
8
-
9
- export const StoryComponent = ({ onDelete }: onDelete) => {
10
- const [isDisabled, setIsDisabled] = useState(false);
11
- const [secretKey, setSecretKey] = useState('');
12
-
13
- const handleClickVisible = (isVisible: boolean) => {
14
- if (isVisible) {
15
- setIsDisabled(true);
16
- getMockData().then((data) => {
17
- setSecretKey(data);
18
- setIsDisabled(false);
19
- });
20
- }
21
- };
22
-
23
- return (
24
- <AccountKeys
25
- title="Account Name"
26
- apiKey="123456789012345678901234567890"
27
- secretKey={secretKey}
28
- onDelete={onDelete}
29
- onVisibilityChange={handleClickVisible}
30
- isDisabled={isDisabled}
31
- />
32
- );
33
- };
@@ -1,87 +0,0 @@
1
- import { Theme, css } from '@emotion/react';
2
-
3
- export const Card = (theme: Theme) => css`
4
- box-shadow: 0 10px 40px 0 ${theme.colors.greyShadow};
5
- padding: 0;
6
- border-radius: 20px;
7
-
8
- &.disabled {
9
- pointer-events: none;
10
- }
11
- `;
12
-
13
- export const CardHeader = (theme: Theme) => css`
14
- align-items: center;
15
- background: ${theme.colors.greyLighter};
16
- padding: 10px;
17
- border-radius: 20px 20px 0 0;
18
- margin-bottom: 0;
19
-
20
- ${theme.mediaQueries.md} {
21
- padding: 15px 10px 15px 30px;
22
- }
23
- `;
24
-
25
- export const DeleteButton = (theme: Theme) => css`
26
- height: auto;
27
- background: none;
28
- box-shadow: none;
29
-
30
- &:hover,
31
- &:focus {
32
- background: none;
33
- box-shadow: none;
34
- }
35
-
36
- &:hover {
37
- svg path {
38
- fill: ${theme.colors.greyDarker};
39
- }
40
- }
41
-
42
- ${theme.mediaQueries.md} {
43
- padding: 12px;
44
- }
45
- `;
46
-
47
- export const CardContent = (theme: Theme) => css`
48
- width: 100%;
49
- padding: 10px;
50
-
51
- ${theme.mediaQueries.md} {
52
- padding: 13px 30px 20px;
53
- }
54
- `;
55
-
56
- export const KeyItem = css`
57
- display: flex;
58
- flex-direction: column;
59
- gap: 5px;
60
-
61
- &:not(:last-child) {
62
- margin-bottom: 20px;
63
- }
64
- `;
65
-
66
- export const VisibleButton = css`
67
- height: auto;
68
- padding: 0;
69
- background: none;
70
- box-shadow: none;
71
-
72
- &:hover,
73
- &:focus {
74
- background: none;
75
- box-shadow: none;
76
- }
77
- `;
78
-
79
- export const SecretKey = css`
80
- display: flex;
81
- align-items: center;
82
- gap: 7px;
83
- `;
84
-
85
- export const LetterWrap = css`
86
- overflow-wrap: anywhere;
87
- `;
@@ -1,8 +0,0 @@
1
- export interface AccountKeysProps {
2
- title: string | JSX.Element;
3
- apiKey: string;
4
- secretKey: string;
5
- onDelete: () => void;
6
- onVisibilityChange: (e: boolean) => void;
7
- isDisabled?: boolean;
8
- }
@@ -1,79 +0,0 @@
1
- import { screen, waitFor } from '../../../customTest';
2
-
3
- import Activity from './index';
4
- import { ActivityResp } from './types';
5
-
6
- const data = {
7
- walking: [
8
- {
9
- activity: 'walking',
10
- date: '2023-04-16T23:00:00.000Z',
11
- day: 'Sun',
12
- max: 100,
13
- currentValue: 50,
14
- },
15
- {
16
- activity: 'walking',
17
- date: '2023-04-16T23:00:00.000Z',
18
- day: 'Mon',
19
- max: 100,
20
- currentValue: 50,
21
- },
22
- {
23
- activity: 'walking',
24
- date: '2023-04-16T23:00:00.000Z',
25
- day: 'Tue',
26
- max: 100,
27
- currentValue: 50,
28
- },
29
- {
30
- activity: 'walking',
31
- date: '2023-04-16T23:00:00.000Z',
32
- day: 'Wed',
33
- max: 100,
34
- currentValue: 50,
35
- },
36
- {
37
- activity: 'walking',
38
- date: '2023-04-16T23:00:00.000Z',
39
- day: 'Thu',
40
- max: 100,
41
- currentValue: 50,
42
- },
43
- {
44
- activity: 'walking',
45
- date: '2023-04-16T23:00:00.000Z',
46
- day: 'Fri',
47
- max: 100,
48
- currentValue: 50,
49
- },
50
- {
51
- activity: 'walking',
52
- date: '2023-04-16T23:00:00.000Z',
53
- day: 'Sat',
54
- max: 100,
55
- currentValue: 50,
56
- },
57
- ],
58
- } as ActivityResp;
59
-
60
- describe('Activity', () => {
61
- it('Render Activity', async () => {
62
- render(<Activity data={data} />);
63
-
64
- await waitFor(async () => {
65
- const progressBar = await screen.findAllByRole('progressbar');
66
- expect(progressBar).toHaveLength(7);
67
- });
68
- });
69
-
70
- it("don't render if not data or wrong typeof data", async () => {
71
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
72
- // @ts-ignore
73
- render(<Activity data={'data'} />);
74
-
75
- await waitFor(() => {
76
- expect(screen.queryAllByRole('progressbar')).toHaveLength(0);
77
- });
78
- });
79
- });
@@ -1,15 +0,0 @@
1
- import type { Meta } from '@storybook/react';
2
-
3
- import { mealActivityData as data } from './mockActivityRequest';
4
-
5
- import { Activity } from './Activity';
6
-
7
- export default {
8
- title: 'Fitness/Activity',
9
- component: Activity,
10
- args: {
11
- data,
12
- },
13
- } as Meta<typeof Activity>;
14
-
15
- export const Default = {};