@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssa-ui-kit/widgets",
3
- "version": "1.0.12",
3
+ "version": "1.1.55-canary-79b6b0d-20250224",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "private": false,
@@ -19,19 +19,16 @@
19
19
  "url": "https://github.com/ssagroup/ui-kit.git",
20
20
  "directory": "packages/widgets"
21
21
  },
22
+ "files": [
23
+ "dist"
24
+ ],
22
25
  "dependencies": {
23
- "@emotion/core": "^11.0.0",
24
- "@emotion/css": "^11.11.2",
25
- "@emotion/react": "^11.11.1",
26
- "@emotion/styled": "^11.11.0",
27
- "@floating-ui/react": "0.25.4",
26
+ "@floating-ui/react": "0.27.4",
28
27
  "dotenv": "^16.0.3",
29
- "js-tokens": "^4.0.0",
30
28
  "loose-envify": "^1.4.0",
31
- "scheduler": "^0.23.0",
32
- "@ssa-ui-kit/core": "^1.1.8",
33
- "@ssa-ui-kit/utils": "^1.0.0",
34
- "@ssa-ui-kit/hooks": "^1.0.0"
29
+ "@ssa-ui-kit/core": "^1.1.55-canary-79b6b0d-20250224",
30
+ "@ssa-ui-kit/utils": "^1.1.55-canary-79b6b0d-20250224",
31
+ "@ssa-ui-kit/hooks": "^1.1.55-canary-79b6b0d-20250224"
35
32
  },
36
33
  "browserslist": [
37
34
  ">0.1%",
@@ -39,26 +36,26 @@
39
36
  "not op_mini all"
40
37
  ],
41
38
  "devDependencies": {
42
- "@emotion/jest": "^11.11.0",
39
+ "@emotion/css": "^11.13.5",
40
+ "@emotion/jest": "^11.13.0",
41
+ "@emotion/react": "^11.14.0",
42
+ "@emotion/styled": "^11.14.0",
43
+ "@nivo/core": "^0.88.0",
44
+ "@nivo/line": "^0.88.0",
45
+ "@nivo/pie": "^0.88.0",
46
+ "@nivo/scales": "^0.88.0",
43
47
  "@playwright/test": "^1.48.0",
44
48
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
45
- "@testing-library/jest-dom": "^5.16.5",
46
- "@types/testing-library__jest-dom": "^5.14.6",
47
- "copy-webpack-plugin": "^11.0.0",
48
- "html-webpack-plugin": "^5.5.1",
49
- "resolve-tspaths": "^0.8.16",
50
- "terser-webpack-plugin": "^5.3.9",
51
- "webpack": "^5.85.0"
49
+ "html-webpack-plugin": "^5.5.1"
52
50
  },
53
51
  "peerDependencies": {
54
- "@emotion/core": "^11.0.0",
55
- "@emotion/css": "^11.11.0",
56
- "@emotion/react": "^11.10.5",
57
- "@emotion/styled": "^11.10.5",
58
- "@nivo/core": "^0.84.0",
59
- "@nivo/line": "^0.84.0",
60
- "@nivo/pie": "^0.84.0",
61
- "@nivo/scales": "^0.84.0",
52
+ "@emotion/css": "^11.13.5",
53
+ "@emotion/react": "^11.14.0",
54
+ "@emotion/styled": "^11.14.0",
55
+ "@nivo/core": "^0.88.0",
56
+ "@nivo/line": "^0.88.0",
57
+ "@nivo/pie": "^0.88.0",
58
+ "@nivo/scales": "^0.88.0",
62
59
  "react": "18.x",
63
60
  "react-dom": "18.x",
64
61
  "react-hook-form": "^7.46.1",
package/.babelrc.js DELETED
@@ -1,4 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- const rootBabelConfig = require('../../.babelrc.js');
3
-
4
- module.exports = rootBabelConfig;
package/.env DELETED
@@ -1,7 +0,0 @@
1
- # Firebase config
2
- FIREBASE_API_KEY="AIzaSyBpxjXhYb6nPzEzUypSNkcwAMrSKV54AX4" # cspell:disable-line
3
- FIREBASE_AUTH_DOMAIN="admin-themes.firebaseapp.com" # cspell:disable-line
4
- FIREBASE_PROJECT_ID="admin-themes"
5
- FIREBASE_STORAGE_BUCKET="admin-themes.appspot.com" # cspell:disable-line
6
- FIREBASE_MESSAGING_SENDERID="933790824158"
7
- FIREBASE_APP_ID="1:933790824158:web:53aa34d56f9b895182f44f"
@@ -1,47 +0,0 @@
1
- import type { StorybookConfig } from '@storybook/react-webpack5';
2
- import initWebpackConfig from '../webpack.config';
3
- const appWebpackConfig = initWebpackConfig();
4
-
5
- const config: StorybookConfig = {
6
- stories: ['../src/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
7
- addons: [
8
- '@storybook/addon-links',
9
- '@storybook/addon-essentials',
10
- '@storybook/addon-interactions',
11
- '@storybook/addon-mdx-gfm', // cspell:disable-line
12
- 'storybook-addon-pseudo-states',
13
- ],
14
- framework: {
15
- name: '@storybook/react-webpack5',
16
- options: {},
17
- },
18
- typescript: {
19
- check: false,
20
- checkOptions: {},
21
- reactDocgen: 'react-docgen-typescript', // cspell:disable-line
22
- // cspell:disable-next-line
23
- reactDocgenTypescriptOptions: {
24
- compilerOptions: {
25
- allowSyntheticDefaultImports: false,
26
- esModuleInterop: false,
27
- },
28
- },
29
- },
30
- webpackFinal: (config) => {
31
- config.resolve.alias = {
32
- ...config.resolve.alias,
33
- ...appWebpackConfig.resolve.alias,
34
- };
35
-
36
- return config;
37
- },
38
- docs: {
39
- autodocs: true, // cspell:disable-line
40
- },
41
- managerHead: (head) => `
42
- ${head}
43
- <meta name="description" content="SSA UI kit is an open-source React-based library that accelerates frontend development of dashboard and administrative panels" />
44
- `,
45
- };
46
-
47
- export default config;
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import '@storybook/react-webpack5';
3
-
4
- import { ThemeProvider } from '@emotion/react';
5
- import { mainTheme } from '@ssa-ui-kit/core';
6
-
7
- import './style.css';
8
-
9
- const preview = {
10
- parameters: {
11
- controls: { expanded: true, hideNoControlsWarning: true },
12
- },
13
- decorators: [
14
- (Story) => (
15
- <ThemeProvider theme={mainTheme}>
16
- <Story />
17
- </ThemeProvider>
18
- ),
19
- ],
20
- };
21
-
22
- export default preview;
@@ -1,40 +0,0 @@
1
- @import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');
2
-
3
- * {
4
- outline: none;
5
-
6
- box-sizing: border-box;
7
- font-family: 'Manrope', sans-serif;
8
-
9
- color: #2b2d31;
10
- }
11
-
12
- *::after,
13
- *::before {
14
- box-sizing: border-box;
15
- }
16
-
17
- h1,
18
- h2,
19
- h3,
20
- h4,
21
- h5,
22
- h6,
23
- p {
24
- margin: 0;
25
- padding: 0;
26
- }
27
-
28
- .token.plain-text,
29
- .language-jsx span {
30
- color: white;
31
- }
32
-
33
- #storybook-docs .sbdocs-preview,
34
- #storybook-docs .docs-story {
35
- overflow: visible;
36
- }
37
-
38
- #storybook-docs .docs-story > div:first-of-type {
39
- overflow: visible;
40
- }
package/customTest.tsx DELETED
@@ -1,35 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Theme } from '@ssa-ui-kit/core';
3
- import { ThemeProvider } from '@emotion/react';
4
- import '@testing-library/dom';
5
- import { render, RenderOptions } from '@testing-library/react';
6
-
7
- const AllTheProviders = ({
8
- children,
9
- theme,
10
- }: {
11
- children: React.ReactNode;
12
- theme: Theme;
13
- }) => {
14
- return <ThemeProvider theme={theme}>{children}</ThemeProvider>;
15
- };
16
-
17
- const customRender = (
18
- theme: Theme,
19
- ui: ReactElement,
20
- options?: Omit<RenderOptions, 'wrapper'>,
21
- ) =>
22
- render(ui, {
23
- wrapper: ({ children }) => (
24
- <AllTheProviders theme={theme}>{children}</AllTheProviders>
25
- ),
26
- ...options,
27
- });
28
-
29
- export const initRender = (theme: Theme) => {
30
- return customRender.bind(null, theme);
31
- };
32
-
33
- export * from '@testing-library/react';
34
-
35
- export { customRender as render };
package/jest-setup.ts DELETED
@@ -1,20 +0,0 @@
1
- import '@testing-library/jest-dom/extend-expect';
2
- import { createSerializer, matchers } from '@emotion/jest';
3
-
4
- import { mainTheme } from '@ssa-ui-kit/core';
5
- import { initRender } from './customTest';
6
-
7
- const customRender = initRender(mainTheme);
8
-
9
- declare global {
10
- // eslint-disable-next-line no-var
11
- var render: typeof customRender;
12
- }
13
-
14
- global.render = customRender;
15
-
16
- expect.addSnapshotSerializer(createSerializer());
17
- expect.extend(matchers);
18
-
19
- window.URL.createObjectURL = jest.fn();
20
- window.HTMLCanvasElement.prototype.getContext = jest.fn();
@@ -1,29 +0,0 @@
1
- import { baseConfig } from '../../lostpixel.base.config';
2
- import { SCREEN_SIZES } from './src/consts';
3
- import { CustomProjectConfig } from 'lost-pixel';
4
-
5
- const breakpoints = Object.keys(SCREEN_SIZES).map(Number);
6
-
7
- const widgetsConfig: Partial<CustomProjectConfig> & {
8
- storybookShots: {
9
- breakpoints: number[];
10
- };
11
- } = {
12
- storybookShots: {
13
- storybookUrl: './packages/widgets/storybook-static',
14
- breakpoints,
15
- // https://docs.lost-pixel.com/user-docs/api-reference/mask
16
- mask: [{ selector: '.lostpixel-ignore' }],
17
- },
18
- customShots: {
19
- currentShotsPath: './packages/widgets/custom-shots',
20
- },
21
- // @cspell:disable-next-line
22
- lostPixelProjectId: 'clldrvzro4dkcna0ez80h1y2h',
23
- };
24
-
25
- export const config: Partial<CustomProjectConfig> & {
26
- storybookShots: {
27
- breakpoints: number[];
28
- };
29
- } = Object.assign({}, baseConfig, widgetsConfig);
@@ -1,7 +0,0 @@
1
- import { defineConfig } from '@playwright/test';
2
- import { createConfig } from '../../playwright.base.config';
3
-
4
- /**
5
- * See https://playwright.dev/docs/test-configuration.
6
- */
7
- export default defineConfig(createConfig());
@@ -1,105 +0,0 @@
1
- import { fireEvent } from '@testing-library/dom';
2
- import { MemoryRouter, Route, Routes } from 'react-router-dom';
3
- import { data } from './stories/fixtures';
4
- import { AccountBalance } from './index';
5
-
6
- describe('AccountBalance', () => {
7
- it('Renders', () => {
8
- const { getByRole, getByText, container } = render(
9
- <AccountBalance total="798" currency="USDT" data={data} />,
10
- );
11
- const pieChartWrapper = container.querySelector('.pie-chart-wrapper');
12
- expect(pieChartWrapper).toBeInTheDocument();
13
-
14
- getByRole('heading', { name: 'Balance' });
15
- getByText('798');
16
- getByText('USDT');
17
-
18
- for (const { label, legendValue } of data) {
19
- getByRole('heading', { name: label });
20
- getByRole('heading', {
21
- name: `${legendValue} ${label === 'Other' ? 'USDT' : label}`,
22
- });
23
- }
24
- });
25
-
26
- it('Renders with a custom title', () => {
27
- const { getByRole } = render(
28
- <AccountBalance total="798" currency="USDT" data={data} title="PNL" />,
29
- );
30
-
31
- getByRole('heading', { name: 'PNL' });
32
- });
33
-
34
- it('Renders with a button', async () => {
35
- const onClick = jest.fn();
36
- const { getByRole } = render(
37
- <AccountBalance
38
- total="798"
39
- currency="USDT"
40
- data={data}
41
- onClick={onClick}
42
- />,
43
- );
44
-
45
- const btnEl = getByRole('button');
46
- await fireEvent.click(btnEl);
47
- expect(onClick).toHaveBeenCalledTimes(1);
48
- });
49
-
50
- it('Renders with a link', async () => {
51
- const onClick = jest.fn();
52
- const { getByRole } = render(
53
- <MemoryRouter>
54
- <Routes>
55
- <Route
56
- path="/*"
57
- element={
58
- <AccountBalance
59
- total="798"
60
- currency="USDT"
61
- data={data}
62
- onClick={onClick}
63
- link="/balance"
64
- />
65
- }
66
- />
67
- </Routes>
68
- </MemoryRouter>,
69
- );
70
-
71
- const linkEl = getByRole('link');
72
- expect(linkEl).toHaveAttribute('href', '/balance');
73
- await fireEvent.click(linkEl);
74
- expect(onClick).toHaveBeenCalledTimes(1);
75
- });
76
-
77
- it('Renders without value list', () => {
78
- const { getByText } = render(
79
- <AccountBalance
80
- total="798"
81
- currency="USDT"
82
- variant="withoutValueList"
83
- data={[
84
- {
85
- id: 'BTC',
86
- label: 'BTC',
87
- legendValue: 1,
88
- value: 871.23,
89
- },
90
- {
91
- id: 'LTC',
92
- label: 'LTC',
93
- legendValue: 7,
94
- value: 530.25,
95
- },
96
- ]}
97
- />,
98
- );
99
-
100
- getByText('1 BTC');
101
- getByText('871.23 USDT');
102
- getByText('7 LTC');
103
- getByText('530.25 USDT');
104
- });
105
- });
@@ -1,138 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { MemoryRouter, Route, Routes } from 'react-router-dom';
3
- import { css as cssReact } from '@emotion/react';
4
- import { css } from '@emotion/css';
5
- import { mainTheme } from '@ssa-ui-kit/core';
6
-
7
- import { data } from './stories/fixtures';
8
-
9
- import { AccountBalance, AccountBalanceProps } from './index';
10
-
11
- export default {
12
- title: 'Trading/AccountBalance',
13
- component: AccountBalance,
14
- } as Meta<typeof AccountBalance>;
15
-
16
- export const Default: StoryObj<typeof AccountBalance> = {};
17
- Default.args = {
18
- total: 48700.53,
19
- currency: 'USDT',
20
- onClick: () => alert('Clicked!'),
21
- widgetMaxWidth: '290px',
22
- className: css`
23
- & .pie-chart-wrapper p {
24
- font-size: 12px;
25
- }
26
- `,
27
- data,
28
- };
29
-
30
- export const WithFullscreenMode: StoryObj<typeof AccountBalance> = {};
31
- WithFullscreenMode.args = {
32
- ...Default.args,
33
- fullscreenModeFeature: true,
34
- };
35
-
36
- export const WithLink: StoryObj<typeof AccountBalance> = (
37
- args: AccountBalanceProps,
38
- ) => {
39
- return (
40
- <MemoryRouter>
41
- <Routes>
42
- <Route path="/*" element={<AccountBalance {...args} />} />
43
- </Routes>
44
- </MemoryRouter>
45
- );
46
- };
47
- WithLink.args = {
48
- ...Default.args,
49
- link: '/',
50
- };
51
-
52
- export const Custom: StoryObj<typeof AccountBalance> = (
53
- args: AccountBalanceProps,
54
- ) => {
55
- return (
56
- <AccountBalance
57
- {...args}
58
- css={cssReact`
59
- ul li {
60
- height: auto;
61
- }
62
- & .pie-chart-wrapper p {
63
- font-size: 12px;
64
- }
65
- `}
66
- />
67
- );
68
- };
69
-
70
- Custom.args = {
71
- total: 48700.53,
72
- currency: 'USDT',
73
- variant: 'withoutValueList',
74
- chartColorPalette: [
75
- mainTheme.colors.blue as string,
76
- mainTheme.colors.green as string,
77
- ],
78
- legendColorPalette: ['blue', 'green'],
79
- widgetMaxWidth: '240px',
80
- data: [
81
- {
82
- id: 'BTC',
83
- label: 'BTC',
84
- value: 571.23,
85
- legendValue: 12323,
86
- },
87
- {
88
- id: 'LTC',
89
- label: 'LTC',
90
- value: 530.25,
91
- legendValue: 12323,
92
- },
93
- ],
94
- };
95
-
96
- export const WithoutPaletteColors: StoryObj<typeof AccountBalance> = (
97
- args: AccountBalanceProps,
98
- ) => {
99
- return (
100
- <AccountBalance
101
- {...args}
102
- css={cssReact`
103
- ul li {
104
- height: auto;
105
- }
106
- & .pie-chart-wrapper p {
107
- font-size: 12px;
108
- }
109
- `}
110
- />
111
- );
112
- };
113
-
114
- WithoutPaletteColors.args = {
115
- total: 48700.53,
116
- currency: 'USDT',
117
- variant: 'withoutValueList',
118
- chartColorPalette: ['#F7931A', '#50AF95'],
119
- legendColorPalette: [
120
- 'linear-gradient(243.84deg, rgb(235, 117, 86), rgb(242, 136, 142))',
121
- '#50AF95',
122
- ],
123
- widgetMaxWidth: '240px',
124
- data: [
125
- {
126
- id: 'BTC',
127
- label: 'BTC',
128
- value: 571.23,
129
- legendValue: 12323,
130
- },
131
- {
132
- id: 'LTC',
133
- label: 'LTC',
134
- value: 530.25,
135
- legendValue: 12323,
136
- },
137
- ],
138
- };
@@ -1,60 +0,0 @@
1
- import { useState } from 'react';
2
- import { useTheme } from '@emotion/react';
3
- import { css } from '@emotion/css';
4
- import { WithLink } from '@ssa-ui-kit/core';
5
- import { BalancePieChart } from './BalancePieChart';
6
- import { AccountBalanceProps } from './types';
7
-
8
- export const AccountBalance = ({
9
- title = 'Balance',
10
- className,
11
- onClick,
12
- link,
13
- variant = 'valueList',
14
- fullscreenModeFeature = false,
15
- activeHighlight = true,
16
- widgetMaxWidth = '280px',
17
- ...props
18
- }: AccountBalanceProps) => {
19
- const theme = useTheme();
20
- const [isFullscreenMode, setIsFullscreenMode] = useState(false);
21
-
22
- return (
23
- <WithLink link={link} onClick={onClick}>
24
- <BalancePieChart
25
- theme={theme}
26
- variant={variant}
27
- fullscreenModeFeature={fullscreenModeFeature}
28
- activeHighlight={activeHighlight}
29
- onFullscreenModeChange={setIsFullscreenMode}
30
- pieChartProps={{
31
- width: '100%',
32
- cardProps: {
33
- title,
34
- className: [
35
- css`
36
- & > div:last-of-type {
37
- max-width: ${isFullscreenMode ? '100%' : widgetMaxWidth};
38
- }
39
- `,
40
- className,
41
- ].join(' '),
42
- headerClassName: css([
43
- {
44
- fontSize: 11,
45
- },
46
- ]),
47
- contentClassName: css([
48
- {
49
- [theme.mediaQueries.md]: {
50
- alignItems: 'center !important',
51
- },
52
- },
53
- ]),
54
- },
55
- }}
56
- {...props}
57
- />
58
- </WithLink>
59
- );
60
- };