@ssa-ui-kit/widgets 1.0.10 → 1.0.12

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 (29) hide show
  1. package/dist/components/AccountKeys/AccountKeys.d.ts +2 -0
  2. package/dist/components/AccountKeys/index.d.ts +2 -0
  3. package/dist/components/{ExchangeAccountKeys → AccountKeys}/types.d.ts +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/index.js.map +1 -1
  7. package/jest-setup.ts +3 -0
  8. package/package.json +4 -4
  9. package/src/components/AccountBalance/AccountBalance.stories.tsx +21 -8
  10. package/src/components/AccountBalance/BalancePieChartTitle.tsx +1 -1
  11. package/src/components/{ExchangeAccountKeys/ExchangeAccountKeys.specBackup.tsx → AccountKeys/AccountKeys.specBackup.tsx} +1 -1
  12. package/src/components/AccountKeys/AccountKeys.stories.tsx +14 -0
  13. package/src/components/{ExchangeAccountKeys/ExchangeAccountKeys.tsx → AccountKeys/AccountKeys.tsx} +3 -3
  14. package/src/components/AccountKeys/index.ts +2 -0
  15. package/src/components/{ExchangeAccountKeys → AccountKeys}/stories/StoryComponent.tsx +2 -2
  16. package/src/components/{ExchangeAccountKeys → AccountKeys}/types.ts +1 -1
  17. package/src/components/ExchangeAccount/helpers.tsx +2 -2
  18. package/src/components/TradingInfoCard/TradingInfoCardTooltip.tsx +1 -1
  19. package/src/index.ts +1 -1
  20. package/tsbuildcache +1 -1
  21. package/dist/components/ExchangeAccountKeys/ExchangeAccountKeys.d.ts +0 -2
  22. package/dist/components/ExchangeAccountKeys/index.d.ts +0 -2
  23. package/src/components/ExchangeAccountKeys/ExchangeAccountKeys.stories.tsx +0 -14
  24. package/src/components/ExchangeAccountKeys/index.ts +0 -2
  25. /package/dist/components/{ExchangeAccountKeys → AccountKeys}/helpers.d.ts +0 -0
  26. /package/dist/components/{ExchangeAccountKeys → AccountKeys}/stories/StoryComponent.d.ts +0 -0
  27. /package/dist/components/{ExchangeAccountKeys → AccountKeys}/styles.d.ts +0 -0
  28. /package/src/components/{ExchangeAccountKeys → AccountKeys}/helpers.ts +0 -0
  29. /package/src/components/{ExchangeAccountKeys → AccountKeys}/styles.ts +0 -0
package/jest-setup.ts CHANGED
@@ -15,3 +15,6 @@ global.render = customRender;
15
15
 
16
16
  expect.addSnapshotSerializer(createSerializer());
17
17
  expect.extend(matchers);
18
+
19
+ window.URL.createObjectURL = jest.fn();
20
+ window.HTMLCanvasElement.prototype.getContext = jest.fn();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssa-ui-kit/widgets",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "private": false,
@@ -29,9 +29,9 @@
29
29
  "js-tokens": "^4.0.0",
30
30
  "loose-envify": "^1.4.0",
31
31
  "scheduler": "^0.23.0",
32
- "@ssa-ui-kit/core": "^1.1.7",
33
- "@ssa-ui-kit/hooks": "^1.0.0",
34
- "@ssa-ui-kit/utils": "^1.0.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"
35
35
  },
36
36
  "browserslist": [
37
37
  ">0.1%",
@@ -1,6 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
2
  import { MemoryRouter, Route, Routes } from 'react-router-dom';
3
- import { css } from '@emotion/react';
3
+ import { css as cssReact } from '@emotion/react';
4
+ import { css } from '@emotion/css';
4
5
  import { mainTheme } from '@ssa-ui-kit/core';
5
6
 
6
7
  import { data } from './stories/fixtures';
@@ -14,9 +15,15 @@ export default {
14
15
 
15
16
  export const Default: StoryObj<typeof AccountBalance> = {};
16
17
  Default.args = {
17
- total: 48700.53569,
18
+ total: 48700.53,
18
19
  currency: 'USDT',
19
20
  onClick: () => alert('Clicked!'),
21
+ widgetMaxWidth: '290px',
22
+ className: css`
23
+ & .pie-chart-wrapper p {
24
+ font-size: 12px;
25
+ }
26
+ `,
20
27
  data,
21
28
  };
22
29
 
@@ -48,17 +55,20 @@ export const Custom: StoryObj<typeof AccountBalance> = (
48
55
  return (
49
56
  <AccountBalance
50
57
  {...args}
51
- css={css`
58
+ css={cssReact`
52
59
  ul li {
53
60
  height: auto;
54
61
  }
62
+ & .pie-chart-wrapper p {
63
+ font-size: 12px;
64
+ }
55
65
  `}
56
66
  />
57
67
  );
58
68
  };
59
69
 
60
70
  Custom.args = {
61
- total: 48700.53569,
71
+ total: 48700.53,
62
72
  currency: 'USDT',
63
73
  variant: 'withoutValueList',
64
74
  chartColorPalette: [
@@ -66,7 +76,7 @@ Custom.args = {
66
76
  mainTheme.colors.green as string,
67
77
  ],
68
78
  legendColorPalette: ['blue', 'green'],
69
- widgetMaxWidth: '230px',
79
+ widgetMaxWidth: '240px',
70
80
  data: [
71
81
  {
72
82
  id: 'BTC',
@@ -89,17 +99,20 @@ export const WithoutPaletteColors: StoryObj<typeof AccountBalance> = (
89
99
  return (
90
100
  <AccountBalance
91
101
  {...args}
92
- css={css`
102
+ css={cssReact`
93
103
  ul li {
94
104
  height: auto;
95
105
  }
106
+ & .pie-chart-wrapper p {
107
+ font-size: 12px;
108
+ }
96
109
  `}
97
110
  />
98
111
  );
99
112
  };
100
113
 
101
114
  WithoutPaletteColors.args = {
102
- total: 48700.53569,
115
+ total: 48700.53,
103
116
  currency: 'USDT',
104
117
  variant: 'withoutValueList',
105
118
  chartColorPalette: ['#F7931A', '#50AF95'],
@@ -107,7 +120,7 @@ WithoutPaletteColors.args = {
107
120
  'linear-gradient(243.84deg, rgb(235, 117, 86), rgb(242, 136, 142))',
108
121
  '#50AF95',
109
122
  ],
110
- widgetMaxWidth: '230px',
123
+ widgetMaxWidth: '240px',
111
124
  data: [
112
125
  {
113
126
  id: 'BTC',
@@ -17,7 +17,7 @@ export const BalancePieChartTitle = withTheme(
17
17
  font-weight: 500;
18
18
  `
19
19
  : css`
20
- font-size: 10px;
20
+ font-size: 12px;
21
21
  padding: 0 14px;
22
22
  line-height: 1;
23
23
  `
@@ -1,7 +1,7 @@
1
1
  import userEvent from '@testing-library/user-event';
2
2
  import { StoryComponent } from './stories/StoryComponent';
3
3
 
4
- describe('ExchangeAccountKeys', () => {
4
+ describe('AccountKeys', () => {
5
5
  it('Renders with title', () => {
6
6
  const { getByText } = render(<StoryComponent onDelete={jest.fn()} />);
7
7
 
@@ -0,0 +1,14 @@
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 = {};
@@ -8,17 +8,17 @@ import {
8
8
  Icon,
9
9
  Typography,
10
10
  } from '@ssa-ui-kit/core';
11
- import { ExchangeAccountKeysProps } from './types';
11
+ import { AccountKeysProps } from './types';
12
12
  import * as S from './styles';
13
13
 
14
- export const ExchangeAccountKeys = ({
14
+ export const AccountKeys = ({
15
15
  title,
16
16
  apiKey,
17
17
  secretKey,
18
18
  onDelete,
19
19
  onVisibilityChange,
20
20
  isDisabled,
21
- }: ExchangeAccountKeysProps) => {
21
+ }: AccountKeysProps) => {
22
22
  const [isVisible, setIsVisible] = useState(false);
23
23
  const theme = useTheme();
24
24
  const placeholder = <span>******</span>;
@@ -0,0 +1,2 @@
1
+ export { AccountKeys } from './AccountKeys';
2
+ export * from './types';
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react';
2
- import { ExchangeAccountKeys } from '../ExchangeAccountKeys';
2
+ import { AccountKeys } from '../AccountKeys';
3
3
  import { getMockData } from '../helpers';
4
4
 
5
5
  interface onDelete {
@@ -21,7 +21,7 @@ export const StoryComponent = ({ onDelete }: onDelete) => {
21
21
  };
22
22
 
23
23
  return (
24
- <ExchangeAccountKeys
24
+ <AccountKeys
25
25
  title="Account Name"
26
26
  apiKey="123456789012345678901234567890"
27
27
  secretKey={secretKey}
@@ -1,4 +1,4 @@
1
- export interface ExchangeAccountKeysProps {
1
+ export interface AccountKeysProps {
2
2
  title: string | JSX.Element;
3
3
  apiKey: string;
4
4
  secretKey: string;
@@ -15,7 +15,7 @@ export const dataValues: Array<
15
15
  title: 'Account Name',
16
16
  status: 'Active',
17
17
  data: {
18
- total: 48000.53032,
18
+ total: 48000.53,
19
19
  currency: 'USDT',
20
20
  data: [
21
21
  {
@@ -120,7 +120,7 @@ export const dataValues: Array<
120
120
  title: 'Name#4',
121
121
  status: 'Active',
122
122
  data: {
123
- total: 9000.53032,
123
+ total: 9000.53,
124
124
  currency: 'USDT',
125
125
  data: [
126
126
  {
@@ -15,7 +15,7 @@ const TradingInfoCardTooltip = ({
15
15
  const theme = useTheme();
16
16
  return (
17
17
  <Tooltip
18
- offsetPx={0}
18
+ offsetOptions={0}
19
19
  enableHover={true}
20
20
  enableClick={false}
21
21
  arrowProps={{
package/src/index.ts CHANGED
@@ -33,4 +33,4 @@ export * from './components/TradingScoreboard';
33
33
  export * from './components/BotsTable';
34
34
  export * from './components/AccountBalance';
35
35
  export * from './components/ExchangeAccount';
36
- export * from './components/ExchangeAccountKeys';
36
+ export * from './components/AccountKeys';