@ssa-ui-kit/widgets 2.30.0 → 2.32.0-canary-b64be64-20251219
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/AccountKeys/useAccountKeys.d.ts +3 -3
- package/dist/components/HeartRate/HeartRateLineChart.d.ts +5 -2
- package/dist/components/HeartRate/types.d.ts +2 -2
- package/dist/components/MarginInfo/MarginInfo.d.ts +1 -1
- package/dist/components/MarginInfo/styles.d.ts +0 -1
- package/dist/components/MarginInfo/types.d.ts +3 -0
- package/dist/components/MealNutrients/MealNutrientsLineChart.d.ts +5 -2
- package/dist/components/MealNutrients/chartDefaultConfig.d.ts +4 -1
- package/dist/components/MealNutrients/types.d.ts +8 -8
- package/dist/components/TradingInfoCard/types.d.ts +1 -1
- package/dist/index.js +20 -11
- package/dist/index.js.map +1 -1
- package/package.json +23 -23
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type UseAccountKeysOptions = {
|
|
2
|
-
title?: string | JSX.Element;
|
|
2
|
+
title?: string | React.JSX.Element;
|
|
3
3
|
apiKey: string;
|
|
4
4
|
secretKey: string;
|
|
5
|
-
placeholder?: string | JSX.Element;
|
|
5
|
+
placeholder?: string | React.JSX.Element;
|
|
6
6
|
visible?: boolean;
|
|
7
7
|
defaultVisible?: boolean;
|
|
8
8
|
onDelete?: () => void;
|
|
@@ -10,7 +10,7 @@ export type UseAccountKeysOptions = {
|
|
|
10
10
|
isDisabled?: boolean;
|
|
11
11
|
};
|
|
12
12
|
export declare const useAccountKeys: ({ title, apiKey, secretKey, placeholder: controlledPlaceholder, isDisabled, visible, defaultVisible, onDelete, onVisibilityChange, }: UseAccountKeysOptions) => {
|
|
13
|
-
title: string | JSX.Element | undefined;
|
|
13
|
+
title: string | import("react").JSX.Element | undefined;
|
|
14
14
|
apiKey: string;
|
|
15
15
|
secretKey: string;
|
|
16
16
|
placeholder: string | import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import { LineSvgProps } from '@nivo/line';
|
|
2
|
-
|
|
1
|
+
import { LineSvgProps, LineSeries } from '@nivo/line';
|
|
2
|
+
import { ResponsiveProps } from '@nivo/core';
|
|
3
|
+
type LineProps = ResponsiveProps<LineSvgProps<LineSeries>>;
|
|
4
|
+
export declare const HeartRateLineChart: ({ data, ...props }: LineProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MarginInfoProps } from './types';
|
|
2
|
-
export declare const MarginInfo: ({ title, base, quote, baseBorrowed, baseInterestRate, baseTotalInterest, quoteBorrowed, quoteInterestRate, quoteTotalInterest, showInterestRate, disableBorrow, disableRepay, onBorrow, onRepay, className, wrapperClassName, headerClassName, contentClassName, }: MarginInfoProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const MarginInfo: ({ title, base, quote, baseBorrowed, baseInterestRate, baseTotalInterest, quoteBorrowed, quoteInterestRate, quoteTotalInterest, borrowedLabel, interestRateLabel, totalInterestLabel, showInterestRate, disableBorrow, disableRepay, onBorrow, onRepay, className, wrapperClassName, headerClassName, contentClassName, }: MarginInfoProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -7,6 +7,9 @@ export interface MarginInfoProps {
|
|
|
7
7
|
quoteBorrowed: ReactNode;
|
|
8
8
|
baseTotalInterest: ReactNode;
|
|
9
9
|
quoteTotalInterest: ReactNode;
|
|
10
|
+
borrowedLabel?: string;
|
|
11
|
+
interestRateLabel?: string;
|
|
12
|
+
totalInterestLabel?: string;
|
|
10
13
|
showInterestRate?: boolean;
|
|
11
14
|
baseInterestRate?: ReactNode;
|
|
12
15
|
quoteInterestRate?: ReactNode;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import { LineSvgProps } from '@nivo/line';
|
|
2
|
-
|
|
1
|
+
import { LineSvgProps, LineSeries } from '@nivo/line';
|
|
2
|
+
import { ResponsiveProps } from '@nivo/core';
|
|
3
|
+
type LineProps = ResponsiveProps<LineSvgProps<LineSeries>>;
|
|
4
|
+
export declare const MealNutrientsLineChart: ({ data, ...props }: LineProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LineSeries, LineSvgProps } from '@nivo/line';
|
|
2
|
+
import { ResponsiveProps } from '@nivo/core';
|
|
3
|
+
type LineProps = ResponsiveProps<LineSvgProps<LineSeries>>;
|
|
2
4
|
export declare const defaults: Omit<LineProps, 'data'>;
|
|
5
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Point, LineSvgProps,
|
|
1
|
+
import { Point, LineSvgProps, LineCustomSvgLayerProps, LineSeries } from '@nivo/line';
|
|
2
2
|
import { ScaleTimeSpec } from '@nivo/scales';
|
|
3
3
|
import { MainColors, DropdownOptionProps } from '@ssa-ui-kit/core';
|
|
4
4
|
export interface OptionType extends DropdownOptionProps {
|
|
@@ -9,20 +9,20 @@ export interface OptionType extends DropdownOptionProps {
|
|
|
9
9
|
export interface MealNutrientsProps {
|
|
10
10
|
caption?: string;
|
|
11
11
|
options: OptionType[];
|
|
12
|
-
data: LineSvgProps['data'];
|
|
12
|
+
data: LineSvgProps<LineSeries>['data'];
|
|
13
13
|
onOptionChange?: (option: OptionType) => void;
|
|
14
14
|
}
|
|
15
15
|
export interface MealNutrientsTooltipProps {
|
|
16
16
|
colorName: keyof MainColors;
|
|
17
|
-
point: Exclude<Point
|
|
18
|
-
data: Point['data'] & {
|
|
17
|
+
point: Exclude<Point<LineSeries>, 'data'> & {
|
|
18
|
+
data: Point<LineSeries>['data'] & {
|
|
19
19
|
comp?: number;
|
|
20
20
|
unit?: string;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
export type UseChartConfig = (ref: React.RefObject<HTMLElement>, data: LineSvgProps['data'], precision: ScaleTimeSpec['precision'] | 'week') => Pick<LineSvgProps
|
|
25
|
-
export type ScaleSpec = LineSvgProps['xScale'];
|
|
26
|
-
export type CustomPointLayerProps =
|
|
27
|
-
currentPoint
|
|
24
|
+
export type UseChartConfig = (ref: React.RefObject<HTMLElement | null>, data: LineSvgProps<LineSeries>['data'], precision: ScaleTimeSpec['precision'] | 'week') => Pick<LineSvgProps<LineSeries>, 'xScale' | 'axisBottom'>;
|
|
25
|
+
export type ScaleSpec = LineSvgProps<LineSeries>['xScale'];
|
|
26
|
+
export type CustomPointLayerProps = LineCustomSvgLayerProps<LineSeries> & {
|
|
27
|
+
currentPoint: Point<LineSeries> | null;
|
|
28
28
|
};
|
|
@@ -12,6 +12,6 @@ export type TradingInfoCardWrapperProps = Pick<TradingInfoCardProps, 'onClick' |
|
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
};
|
|
14
14
|
export interface TradingInfoCardTooltipProps {
|
|
15
|
-
trigger: string | number | JSX.Element;
|
|
15
|
+
trigger: string | number | React.JSX.Element;
|
|
16
16
|
children: React.ReactNode;
|
|
17
17
|
}
|
package/dist/index.js
CHANGED
|
@@ -300,6 +300,8 @@ const getTime = (date, options) => date.toLocaleTimeString('en-US', options || {
|
|
|
300
300
|
|
|
301
301
|
|
|
302
302
|
|
|
303
|
+
const ResponsiveLine = (0,core_namespaceObject.wrapNivoResponsiveComponent)(line_namespaceObject.ResponsiveLine, 'ResponsiveLine');
|
|
304
|
+
|
|
303
305
|
// ScaleSpec is not exported from @nivo/line
|
|
304
306
|
|
|
305
307
|
const defaults = {
|
|
@@ -323,7 +325,7 @@ const defaults = {
|
|
|
323
325
|
from: 'serieColor'
|
|
324
326
|
},
|
|
325
327
|
legends: [],
|
|
326
|
-
xFormat: yVal => getTime(new Date(yVal)),
|
|
328
|
+
xFormat: yVal => getTime(new Date(String(yVal))),
|
|
327
329
|
yFormat: xVal => `${xVal} bpm`,
|
|
328
330
|
tooltip: args => (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.SimpleChartTooltip, {
|
|
329
331
|
...args
|
|
@@ -333,7 +335,7 @@ const HeartRateLineChart = ({
|
|
|
333
335
|
data,
|
|
334
336
|
...props
|
|
335
337
|
}) => {
|
|
336
|
-
return (0,jsx_runtime_namespaceObject.jsx)(
|
|
338
|
+
return (0,jsx_runtime_namespaceObject.jsx)(ResponsiveLine, {
|
|
337
339
|
data: data,
|
|
338
340
|
curve: "linear",
|
|
339
341
|
axisTop: null,
|
|
@@ -403,6 +405,7 @@ function HeartRate_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to
|
|
|
403
405
|
|
|
404
406
|
|
|
405
407
|
|
|
408
|
+
|
|
406
409
|
const gradientId = 'HeartRateGradient';
|
|
407
410
|
const chartFill = [{
|
|
408
411
|
match: '*',
|
|
@@ -431,7 +434,11 @@ const HeartRate = ({
|
|
|
431
434
|
color
|
|
432
435
|
}) => {
|
|
433
436
|
const [bpmValue, setBpmValue] = (0,external_react_namespaceObject.useState)(data?.data?.[0]?.y);
|
|
434
|
-
const [onBpmValueChange, cancelTimer] = (0,external_react_namespaceObject.useMemo)(() => (0,utils_namespaceObject.throttle)(point =>
|
|
437
|
+
const [onBpmValueChange, cancelTimer] = (0,external_react_namespaceObject.useMemo)(() => (0,utils_namespaceObject.throttle)(point => {
|
|
438
|
+
if ((0,line_namespaceObject.isPoint)(point)) {
|
|
439
|
+
setBpmValue(point?.data?.y);
|
|
440
|
+
}
|
|
441
|
+
}, 100), []);
|
|
435
442
|
const theme = (0,react_namespaceObject.useTheme)();
|
|
436
443
|
const chartColor = color || theme.colors.purpleDark;
|
|
437
444
|
(0,external_react_namespaceObject.useEffect)(() => () => cancelTimer(), []);
|
|
@@ -499,7 +506,6 @@ const CustomPointLayer = ({
|
|
|
499
506
|
pointBorderWidth,
|
|
500
507
|
...props
|
|
501
508
|
}) => {
|
|
502
|
-
const theme = (0,external_nivo_core_namespaceObject.useTheme)();
|
|
503
509
|
if (!currentPoint) {
|
|
504
510
|
return;
|
|
505
511
|
}
|
|
@@ -511,7 +517,6 @@ const CustomPointLayer = ({
|
|
|
511
517
|
color: point.color,
|
|
512
518
|
borderColor: point.borderColor,
|
|
513
519
|
datum: point.data,
|
|
514
|
-
theme: theme,
|
|
515
520
|
size: pointSize || 0,
|
|
516
521
|
borderWidth: pointBorderWidth || 0,
|
|
517
522
|
...props
|
|
@@ -575,7 +580,7 @@ const MealNutrientsTooltip = ({
|
|
|
575
580
|
colorName,
|
|
576
581
|
point
|
|
577
582
|
}) => {
|
|
578
|
-
const caption = capitalize(String(point.
|
|
583
|
+
const caption = capitalize(String(point.seriesId));
|
|
579
584
|
const {
|
|
580
585
|
data: {
|
|
581
586
|
y,
|
|
@@ -601,6 +606,8 @@ const MealNutrientsTooltip = ({
|
|
|
601
606
|
|
|
602
607
|
|
|
603
608
|
|
|
609
|
+
|
|
610
|
+
const MealNutrientsLineChart_ResponsiveLine = (0,core_namespaceObject.wrapNivoResponsiveComponent)(line_namespaceObject.ResponsiveLine, 'ResponsiveLine');
|
|
604
611
|
const colorPalette = ['pink', 'purple', 'turquoise', 'yellow', 'green', 'blue'];
|
|
605
612
|
const MealNutrientsLineChart = ({
|
|
606
613
|
data,
|
|
@@ -645,7 +652,7 @@ const MealNutrientsLineChart = ({
|
|
|
645
652
|
}
|
|
646
653
|
}
|
|
647
654
|
}), [theme.colors, defaultColorMapping]);
|
|
648
|
-
return (0,jsx_runtime_namespaceObject.jsx)(
|
|
655
|
+
return (0,jsx_runtime_namespaceObject.jsx)(MealNutrientsLineChart_ResponsiveLine, {
|
|
649
656
|
data: data,
|
|
650
657
|
curve: "catmullRom",
|
|
651
658
|
axisTop: null,
|
|
@@ -1263,7 +1270,6 @@ const ListGoalsCard = ({
|
|
|
1263
1270
|
noShadow: true,
|
|
1264
1271
|
children: (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Wrapper, {
|
|
1265
1272
|
direction: "row",
|
|
1266
|
-
avatarSize: 42,
|
|
1267
1273
|
children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Avatar, {
|
|
1268
1274
|
size: 42,
|
|
1269
1275
|
image: image,
|
|
@@ -2730,6 +2736,9 @@ const MarginInfo = ({
|
|
|
2730
2736
|
quoteBorrowed,
|
|
2731
2737
|
quoteInterestRate,
|
|
2732
2738
|
quoteTotalInterest,
|
|
2739
|
+
borrowedLabel = 'Borrowed',
|
|
2740
|
+
interestRateLabel = 'Interest Rate',
|
|
2741
|
+
totalInterestLabel = 'Total Interest',
|
|
2733
2742
|
showInterestRate = true,
|
|
2734
2743
|
disableBorrow = false,
|
|
2735
2744
|
disableRepay = false,
|
|
@@ -2759,15 +2768,15 @@ const MarginInfo = ({
|
|
|
2759
2768
|
})
|
|
2760
2769
|
}), (0,jsx_runtime_namespaceObject.jsxs)(TableBody, {
|
|
2761
2770
|
children: [(0,jsx_runtime_namespaceObject.jsx)(MarginInfoTableRow, {
|
|
2762
|
-
label:
|
|
2771
|
+
label: borrowedLabel,
|
|
2763
2772
|
baseValue: baseBorrowed,
|
|
2764
2773
|
quoteValue: quoteBorrowed
|
|
2765
2774
|
}), showInterestRate && (0,jsx_runtime_namespaceObject.jsx)(MarginInfoTableRow, {
|
|
2766
|
-
label:
|
|
2775
|
+
label: interestRateLabel,
|
|
2767
2776
|
baseValue: baseInterestRate,
|
|
2768
2777
|
quoteValue: quoteInterestRate
|
|
2769
2778
|
}), (0,jsx_runtime_namespaceObject.jsx)(MarginInfoTableRow, {
|
|
2770
|
-
label:
|
|
2779
|
+
label: totalInterestLabel,
|
|
2771
2780
|
baseValue: baseTotalInterest,
|
|
2772
2781
|
quoteValue: quoteTotalInterest
|
|
2773
2782
|
})]
|