@levi-gemcommerce/analytics 0.0.1-dev.0
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/README.md +37 -0
- package/dist/esm/components/GMultipleMetricChartCard/GMultipleMetricChartCard.d.ts +14 -0
- package/dist/esm/components/GMultipleMetricChartCard/MetricCard.d.ts +10 -0
- package/dist/esm/components/GMultipleMetricChartCard/MetricChart.d.ts +12 -0
- package/dist/esm/components/GMultipleMetricChartCard/index.d.ts +2 -0
- package/dist/esm/components/GSelectableMetricChartCard/GSelectableMetricChartCard.d.ts +14 -0
- package/dist/esm/components/GSelectableMetricChartCard/MetricCard.d.ts +10 -0
- package/dist/esm/components/GSelectableMetricChartCard/MetricChart.d.ts +12 -0
- package/dist/esm/components/GSelectableMetricChartCard/MetricChartTab.d.ts +11 -0
- package/dist/esm/components/GSelectableMetricChartCard/MetricChartTabs.d.ts +11 -0
- package/dist/esm/components/GSelectableMetricChartCard/index.d.ts +2 -0
- package/dist/esm/components/GTooltipCard/GTooltipCard.d.ts +32 -0
- package/dist/esm/components/GTooltipCard/index.d.ts +2 -0
- package/dist/esm/components/PATrendBadge/PATrendBadge.d.ts +7 -0
- package/dist/esm/components/PATrendBadge/index.d.ts +1 -0
- package/dist/esm/components/SingleMetricChartCard/SingleMetricChartCard.d.ts +12 -0
- package/dist/esm/components/SingleMetricChartCard/index.d.ts +2 -0
- package/dist/esm/components/common/chart/ChartSkeleton.d.ts +1 -0
- package/dist/esm/components/common/chart/GChartSkeleton.d.ts +1 -0
- package/dist/esm/components/common/chart/MetricChart.d.ts +8 -0
- package/dist/esm/components/common/chart/MetricChartEmpty.d.ts +8 -0
- package/dist/esm/components/common/chart/MetricChartProvider.d.ts +6 -0
- package/dist/esm/components/common/chart/MetricChartTooltip.d.ts +6 -0
- package/dist/esm/components/common/chart/MetricInfoBlock.d.ts +13 -0
- package/dist/esm/components/common/chart/MetricInfoSkeleton.d.ts +4 -0
- package/dist/esm/components/common/chart/MetricTrend.d.ts +5 -0
- package/dist/esm/components/common/chart/MetricValueSummary.d.ts +8 -0
- package/dist/esm/components/common/chart/PAMetricInfoSkeleton.d.ts +4 -0
- package/dist/esm/components/common/chart/index.d.ts +7 -0
- package/dist/esm/components/common/icons/DownIcon8px.d.ts +1 -0
- package/dist/esm/components/common/icons/UpIcon8px.d.ts +1 -0
- package/dist/esm/components/common/icons/index.d.ts +2 -0
- package/dist/esm/components/common/percent/MetricPercentage.d.ts +4 -0
- package/dist/esm/components/common/percent/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts +2 -0
- package/dist/esm/constants/analytic-metric-tooltip.d.ts +5 -0
- package/dist/esm/constants/chart.d.ts +13 -0
- package/dist/esm/constants/g-multiple-metric-chart-card.d.ts +13 -0
- package/dist/esm/constants/g-selectable-metric-chart-card.d.ts +13 -0
- package/dist/esm/constants/index.d.ts +3 -0
- package/dist/esm/constants/pa-trend-badge.d.ts +9 -0
- package/dist/esm/constants/thumbnail.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +391 -0
- package/dist/esm/index.mjs +391 -0
- package/dist/esm/providers/MetricChartProvider.d.ts +6 -0
- package/dist/esm/providers/index.d.ts +1 -0
- package/dist/esm/shared/components/GBlockCenter/GBlockCenter.d.ts +15 -0
- package/dist/esm/shared/components/GBlockCenter/index.d.ts +1 -0
- package/dist/esm/shared/components/GSkeletonDisplayText/GSkeletonDisplayText.d.ts +4 -0
- package/dist/esm/shared/components/GSkeletonDisplayText/index.d.ts +1 -0
- package/dist/esm/shared/components/GThumbnail/GThumbnail.d.ts +20 -0
- package/dist/esm/shared/components/GThumbnail/index.d.ts +1 -0
- package/dist/esm/shared/components/GTooltipCard/GTooltipCard.d.ts +32 -0
- package/dist/esm/shared/components/GTooltipCard/index.d.ts +2 -0
- package/dist/esm/shared/components/index.d.ts +4 -0
- package/dist/esm/shared/index.d.ts +1 -0
- package/dist/esm/types/chart.d.ts +19 -0
- package/dist/esm/types/index.d.ts +2 -0
- package/dist/esm/types/metric.d.ts +27 -0
- package/dist/esm/utils/cls.d.ts +4 -0
- package/dist/esm/utils/index.d.ts +3 -0
- package/dist/esm/utils/number.d.ts +5 -0
- package/dist/esm/utils/percentage.d.ts +10 -0
- package/dist/style.css +1 -0
- package/dist/umd/esm/components/GMultipleMetricChartCard/GMultipleMetricChartCard.d.ts +14 -0
- package/dist/umd/esm/components/GMultipleMetricChartCard/MetricCard.d.ts +10 -0
- package/dist/umd/esm/components/GMultipleMetricChartCard/MetricChart.d.ts +12 -0
- package/dist/umd/esm/components/GMultipleMetricChartCard/index.d.ts +2 -0
- package/dist/umd/esm/components/GSelectableMetricChartCard/GSelectableMetricChartCard.d.ts +14 -0
- package/dist/umd/esm/components/GSelectableMetricChartCard/MetricCard.d.ts +10 -0
- package/dist/umd/esm/components/GSelectableMetricChartCard/MetricChart.d.ts +12 -0
- package/dist/umd/esm/components/GSelectableMetricChartCard/MetricChartTab.d.ts +11 -0
- package/dist/umd/esm/components/GSelectableMetricChartCard/index.d.ts +2 -0
- package/dist/umd/esm/components/GTooltipCard/GTooltipCard.d.ts +32 -0
- package/dist/umd/esm/components/GTooltipCard/index.d.ts +2 -0
- package/dist/umd/esm/components/PATrendBadge/PATrendBadge.d.ts +7 -0
- package/dist/umd/esm/components/PATrendBadge/index.d.ts +1 -0
- package/dist/umd/esm/components/SingleMetricChartCard/SingleMetricChartCard.d.ts +12 -0
- package/dist/umd/esm/components/SingleMetricChartCard/index.d.ts +2 -0
- package/dist/umd/esm/components/common/chart/GChartSkeleton.d.ts +1 -0
- package/dist/umd/esm/components/common/chart/MetricChart.d.ts +8 -0
- package/dist/umd/esm/components/common/chart/MetricChartEmpty.d.ts +8 -0
- package/dist/umd/esm/components/common/chart/MetricChartProvider.d.ts +6 -0
- package/dist/umd/esm/components/common/chart/MetricChartTooltip.d.ts +6 -0
- package/dist/umd/esm/components/common/chart/MetricInfoBlock.d.ts +13 -0
- package/dist/umd/esm/components/common/chart/MetricInfoSkeleton.d.ts +4 -0
- package/dist/umd/esm/components/common/chart/MetricTrend.d.ts +5 -0
- package/dist/umd/esm/components/common/chart/MetricValueSummary.d.ts +8 -0
- package/dist/umd/esm/components/common/chart/PAMetricInfoSkeleton.d.ts +4 -0
- package/dist/umd/esm/components/common/chart/index.d.ts +7 -0
- package/dist/umd/esm/components/common/icons/DownIcon8px.d.ts +1 -0
- package/dist/umd/esm/components/common/icons/UpIcon8px.d.ts +1 -0
- package/dist/umd/esm/components/common/icons/index.d.ts +2 -0
- package/dist/umd/esm/components/common/percent/MetricPercentage.d.ts +4 -0
- package/dist/umd/esm/components/common/percent/index.d.ts +1 -0
- package/dist/umd/esm/components/index.d.ts +2 -0
- package/dist/umd/esm/constants/analytic-metric-tooltip.d.ts +5 -0
- package/dist/umd/esm/constants/chart.d.ts +13 -0
- package/dist/umd/esm/constants/g-multiple-metric-chart-card.d.ts +13 -0
- package/dist/umd/esm/constants/g-selectable-metric-chart-card.d.ts +12 -0
- package/dist/umd/esm/constants/index.d.ts +3 -0
- package/dist/umd/esm/constants/pa-trend-badge.d.ts +9 -0
- package/dist/umd/esm/constants/thumbnail.d.ts +2 -0
- package/dist/umd/esm/index.d.ts +2 -0
- package/dist/umd/esm/providers/MetricChartProvider.d.ts +6 -0
- package/dist/umd/esm/providers/index.d.ts +1 -0
- package/dist/umd/esm/shared/components/GBlockCenter/GBlockCenter.d.ts +15 -0
- package/dist/umd/esm/shared/components/GBlockCenter/index.d.ts +1 -0
- package/dist/umd/esm/shared/components/GSkeletonDisplayText/GSkeletonDisplayText.d.ts +4 -0
- package/dist/umd/esm/shared/components/GSkeletonDisplayText/index.d.ts +1 -0
- package/dist/umd/esm/shared/components/GThumbnail/GThumbnail.d.ts +20 -0
- package/dist/umd/esm/shared/components/GThumbnail/index.d.ts +1 -0
- package/dist/umd/esm/shared/components/GTooltipCard/GTooltipCard.d.ts +32 -0
- package/dist/umd/esm/shared/components/GTooltipCard/index.d.ts +2 -0
- package/dist/umd/esm/shared/components/index.d.ts +4 -0
- package/dist/umd/esm/shared/index.d.ts +1 -0
- package/dist/umd/esm/types/chart.d.ts +19 -0
- package/dist/umd/esm/types/index.d.ts +2 -0
- package/dist/umd/esm/types/metric.d.ts +27 -0
- package/dist/umd/esm/utils/cls.d.ts +4 -0
- package/dist/umd/esm/utils/index.d.ts +3 -0
- package/dist/umd/esm/utils/number.d.ts +5 -0
- package/dist/umd/esm/utils/percentage.d.ts +10 -0
- package/dist/umd/index.js +1 -0
- package/package.json +86 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AllChartsDataMap, IMetricCardItem } from '../../types';
|
|
3
|
+
export interface IProps {
|
|
4
|
+
data: IMetricCardItem[];
|
|
5
|
+
dataChart: AllChartsDataMap;
|
|
6
|
+
defaultActiveTab?: string;
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
isEmptyMetricData?: boolean;
|
|
9
|
+
hideComparison?: boolean;
|
|
10
|
+
currentPeriodLabel?: string;
|
|
11
|
+
previousPeriodLabel?: string;
|
|
12
|
+
onclickMetric?: (key: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const GMultipleMetricChartCard: ({ data, dataChart, defaultActiveTab, isLoading, isEmptyMetricData, hideComparison, currentPeriodLabel, previousPeriodLabel, }: IProps) => ReactElement;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IMetricCardItem } from '../../types';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
export interface IProps {
|
|
4
|
+
item: IMetricCardItem;
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
hideComparison?: boolean;
|
|
8
|
+
onSelect: (key: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const MetricCard: ({ item, isActive, isLoading, hideComparison, onSelect }: IProps) => ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AllChartsDataMap } from '../../types';
|
|
3
|
+
export interface IProps {
|
|
4
|
+
activeTab?: string;
|
|
5
|
+
dataChart: AllChartsDataMap;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
isEmptyMetricData?: boolean;
|
|
8
|
+
hideComparison?: boolean;
|
|
9
|
+
currentPeriodLabel: string;
|
|
10
|
+
previousPeriodLabel: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const MetricChart: ({ activeTab, dataChart, isLoading, isEmptyMetricData, hideComparison, currentPeriodLabel, previousPeriodLabel, }: IProps) => ReactElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AllChartsDataMap, IMetricCardItem } from '../../types';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
export interface IProps {
|
|
4
|
+
metricInfo: IMetricCardItem[];
|
|
5
|
+
dataChart: AllChartsDataMap;
|
|
6
|
+
defaultActiveTab?: string;
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
isEmptyMetricData?: boolean;
|
|
9
|
+
hideComparison?: boolean;
|
|
10
|
+
currentPeriodLabel?: string;
|
|
11
|
+
previousPeriodLabel?: string;
|
|
12
|
+
onclickMetric?: (key: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const GSelectableMetricChartCard: ({ metricInfo, dataChart, defaultActiveTab, isLoading, isEmptyMetricData, hideComparison, currentPeriodLabel, previousPeriodLabel, }: IProps) => ReactElement;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IMetricCardItem } from '../../types';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
export interface IProps {
|
|
4
|
+
item: IMetricCardItem;
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
hideComparison?: boolean;
|
|
8
|
+
onSelect: (key: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const MetricCard: ({ item, isActive, isLoading, hideComparison, onSelect }: IProps) => ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { AllChartsDataMap } from '../../types';
|
|
3
|
+
export interface IProps {
|
|
4
|
+
activeTab?: string;
|
|
5
|
+
dataChart: AllChartsDataMap;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
isEmptyMetricData?: boolean;
|
|
8
|
+
hideComparison?: boolean;
|
|
9
|
+
currentPeriodLabel: string;
|
|
10
|
+
previousPeriodLabel: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const MetricChart: ({ activeTab, dataChart, isLoading, isEmptyMetricData, hideComparison, currentPeriodLabel, previousPeriodLabel, }: IProps) => ReactElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { IMetricCardItem } from '../../types';
|
|
3
|
+
export interface IProps {
|
|
4
|
+
item: IMetricCardItem;
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
hideComparison?: boolean;
|
|
8
|
+
onSelect: (key: string) => void;
|
|
9
|
+
onClickTitle?: (key: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const MetricChartTab: ({ item, isActive, isLoading, hideComparison, onSelect, onClickTitle, }: IProps) => ReactElement;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { BoxProps } from '@shopify/polaris';
|
|
2
|
+
type CloseTarget = 'activator' | 'next-node';
|
|
3
|
+
export interface PopoverPublicAPI {
|
|
4
|
+
forceUpdatePosition(): void;
|
|
5
|
+
close(target?: CloseTarget): void;
|
|
6
|
+
}
|
|
7
|
+
export interface GTooltipCardPublicAPI {
|
|
8
|
+
onClose(): void;
|
|
9
|
+
}
|
|
10
|
+
type Width = 'default' | 'wide' | 'large';
|
|
11
|
+
export interface GTooltipCardData {
|
|
12
|
+
title: string;
|
|
13
|
+
content: string | TrustedHTML;
|
|
14
|
+
formula?: React.ReactNode;
|
|
15
|
+
contentList?: string[];
|
|
16
|
+
width?: Width;
|
|
17
|
+
}
|
|
18
|
+
export interface IProps {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
delay?: number;
|
|
21
|
+
tooltip?: GTooltipCardData;
|
|
22
|
+
activatorProps?: BoxProps;
|
|
23
|
+
wrapper?: 'span' | 'div';
|
|
24
|
+
isHideBorder?: boolean;
|
|
25
|
+
alignment?: 'start' | 'center' | 'end';
|
|
26
|
+
textDecoration?: 'underline' | 'none';
|
|
27
|
+
preferredAlignment?: 'left' | 'center' | 'right';
|
|
28
|
+
popoverRef?: React.RefObject<PopoverPublicAPI>;
|
|
29
|
+
showArrow?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare const GTooltipCard: import("react").ForwardRefExoticComponent<IProps & import("react").RefAttributes<GTooltipCardPublicAPI>>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PATrendBadge';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DataSeries } from '@shopify/polaris-viz-core';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { IMetricCardItem } from '../../types';
|
|
4
|
+
export interface IProps {
|
|
5
|
+
metricInfo: IMetricCardItem;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
hideComparison?: boolean;
|
|
8
|
+
isEmptyMetricData?: boolean;
|
|
9
|
+
lineChartData: DataSeries[];
|
|
10
|
+
onClickTitle?: (key: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const SingleMetricChartCard: ({ metricInfo, lineChartData, isLoading, hideComparison, isEmptyMetricData, onClickTitle, }: IProps) => ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GChartSkeleton: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DataSeries } from '@shopify/polaris-viz';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
export interface IProps {
|
|
4
|
+
lineChartData: DataSeries[];
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
isEmptyMetricData?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const MetricChart: ({ lineChartData, isLoading, isEmptyMetricData }: IProps) => ReactElement;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RenderTooltipContentData } from '@shopify/polaris-viz';
|
|
2
|
+
export interface MetricChartTooltipProps {
|
|
3
|
+
data: RenderTooltipContentData;
|
|
4
|
+
formatValue: (value: number) => string;
|
|
5
|
+
}
|
|
6
|
+
export declare const MetricChartTooltip: React.FC<MetricChartTooltipProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TextProps } from '@shopify/polaris';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { IMetricCardItem } from '../../../types';
|
|
4
|
+
export interface IProps {
|
|
5
|
+
item: IMetricCardItem;
|
|
6
|
+
isHovered: boolean;
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
hideComparison?: boolean;
|
|
9
|
+
titleVariant?: TextProps['variant'];
|
|
10
|
+
titleFontWeight?: TextProps['fontWeight'];
|
|
11
|
+
onClickTitle?: (key: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const MetricInfoBlock: ({ item, isHovered, isLoading, hideComparison, titleVariant, titleFontWeight, onClickTitle, }: IProps) => ReactElement;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { IMetricControl } from '../../../types';
|
|
3
|
+
interface IProps {
|
|
4
|
+
totalValue: IMetricControl;
|
|
5
|
+
hideComparison?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const MetricValueSummary: ({ totalValue, hideComparison }: IProps) => ReactElement;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { GChartSkeleton } from './GChartSkeleton';
|
|
2
|
+
export { MetricChart } from './MetricChart';
|
|
3
|
+
export { MetricChartEmpty } from './MetricChartEmpty';
|
|
4
|
+
export { MetricChartTooltip } from './MetricChartTooltip';
|
|
5
|
+
export { MetricInfoBlock } from './MetricInfoBlock';
|
|
6
|
+
export { MetricInfoSkeleton } from './MetricInfoSkeleton';
|
|
7
|
+
export { MetricValueSummary } from './MetricValueSummary';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DownIcon8px: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const UpIcon8px: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MetricPercentage } from './MetricPercentage';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const DEFAULT_CURRENT_PERIOD_LABEL = "Current";
|
|
2
|
+
export declare const DEFAULT_PREVIOUS_PERIOD_LABEL = "Previous";
|
|
3
|
+
export declare const CHART_MIN_HEIGHT = 228;
|
|
4
|
+
export declare const SERIES_COLORS: {
|
|
5
|
+
readonly current: "rgba(64, 176, 230, 1)";
|
|
6
|
+
readonly comparison: "rgba(161, 202, 231, 1)";
|
|
7
|
+
readonly all: readonly ["#2C7DFF", "#F34A70"];
|
|
8
|
+
};
|
|
9
|
+
export declare const TREND_TONE: {
|
|
10
|
+
readonly POSITIVE: "#007F5F";
|
|
11
|
+
readonly NEUTRAL: "#4A4A4A";
|
|
12
|
+
};
|
|
13
|
+
export declare const PLACEHOLDER_VALUE = "-";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const DEFAULT_CURRENT_PERIOD_LABEL = "Current";
|
|
2
|
+
export declare const DEFAULT_PREVIOUS_PERIOD_LABEL = "Previous";
|
|
3
|
+
export declare const CHART_MIN_HEIGHT = 228;
|
|
4
|
+
export declare const SERIES_COLORS: {
|
|
5
|
+
readonly current: "rgba(64, 176, 230, 1)";
|
|
6
|
+
readonly comparison: "rgba(161, 202, 231, 1)";
|
|
7
|
+
readonly all: readonly ["#2C7DFF", "#F34A70"];
|
|
8
|
+
};
|
|
9
|
+
export declare const TREND_TONE: {
|
|
10
|
+
readonly POSITIVE: "#007F5F";
|
|
11
|
+
readonly NEUTRAL: "#4A4A4A";
|
|
12
|
+
};
|
|
13
|
+
export declare const GRID_GAP = "16px";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const DEFAULT_CURRENT_PERIOD_LABEL = "Current";
|
|
2
|
+
export declare const DEFAULT_PREVIOUS_PERIOD_LABEL = "Previous";
|
|
3
|
+
export declare const CHART_MIN_HEIGHT = 228;
|
|
4
|
+
export declare const SERIES_COLORS: {
|
|
5
|
+
readonly current: "rgba(64, 176, 230, 1)";
|
|
6
|
+
readonly comparison: "rgba(161, 202, 231, 1)";
|
|
7
|
+
readonly all: readonly ["#2C7DFF", "#F34A70"];
|
|
8
|
+
};
|
|
9
|
+
export declare const TREND_TONE: {
|
|
10
|
+
readonly POSITIVE: "#007F5F";
|
|
11
|
+
readonly NEUTRAL: "#4A4A4A";
|
|
12
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const TREND_DIRECTION: {
|
|
2
|
+
readonly UP: "up";
|
|
3
|
+
readonly DOWN: "down";
|
|
4
|
+
readonly NEUTRAL: "neutral";
|
|
5
|
+
};
|
|
6
|
+
export type ITrendDirection = (typeof TREND_DIRECTION)[keyof typeof TREND_DIRECTION];
|
|
7
|
+
export declare const TREND_COLOR: Record<ITrendDirection, string>;
|
|
8
|
+
export declare const TREND_SYMBOL: Record<ITrendDirection, string>;
|
|
9
|
+
export declare const PERCENT_DECIMALS = 2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MetricChartProvider } from './MetricChartProvider';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
import type { BoxProps } from '@shopify/polaris';
|
|
3
|
+
import './GBlockCenter.scss';
|
|
4
|
+
export type SpaceScale = '0' | '025' | '050' | '100' | '150' | '200' | '300' | '400' | '500' | '600' | '800' | '1000' | '1200' | '1600' | '2000' | '2400' | '2800' | '3200';
|
|
5
|
+
export interface GBlockCenterProps extends Omit<BoxProps, 'insetInlineStart' | 'insetInlineEnd' | 'insetBlockStart' | 'insetBlockEnd'> {
|
|
6
|
+
height?: string;
|
|
7
|
+
align?: 'center' | 'start' | 'end';
|
|
8
|
+
inlineAlign?: 'center' | 'start' | 'end';
|
|
9
|
+
display?: CSSProperties['display'];
|
|
10
|
+
insetInlineStart?: SpaceScale;
|
|
11
|
+
insetInlineEnd?: SpaceScale;
|
|
12
|
+
insetBlockStart?: SpaceScale;
|
|
13
|
+
insetBlockEnd?: SpaceScale;
|
|
14
|
+
}
|
|
15
|
+
export declare const GBlockCenter: ({ height, align, inlineAlign, display, ...props }: GBlockCenterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GBlockCenter';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GSkeletonDisplayText';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ThumbnailProps } from '@shopify/polaris';
|
|
2
|
+
export interface GThumbnailProps extends ThumbnailProps {
|
|
3
|
+
defaultSource?: string;
|
|
4
|
+
width?: string;
|
|
5
|
+
height?: string;
|
|
6
|
+
classRemoved?: boolean;
|
|
7
|
+
isInactive?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @description Filter to apply grayscale to the image
|
|
10
|
+
*/
|
|
11
|
+
grayscale?: `${number}%`;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Helper function to generate a variation class name.
|
|
15
|
+
* @param name - Base name of the class.
|
|
16
|
+
* @param value - Variation value to append.
|
|
17
|
+
* @returns Combined class name.
|
|
18
|
+
*/
|
|
19
|
+
export declare function variationName(name: string, value: string): string;
|
|
20
|
+
export declare const GThumbnail: ({ source, alt, size, grayscale, defaultSource, width, height, classRemoved, }: GThumbnailProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GThumbnail';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { BoxProps } from '@shopify/polaris';
|
|
2
|
+
type CloseTarget = 'activator' | 'next-node';
|
|
3
|
+
export interface PopoverPublicAPI {
|
|
4
|
+
forceUpdatePosition(): void;
|
|
5
|
+
close(target?: CloseTarget): void;
|
|
6
|
+
}
|
|
7
|
+
export interface GTooltipCardPublicAPI {
|
|
8
|
+
onClose(): void;
|
|
9
|
+
}
|
|
10
|
+
type Width = 'default' | 'wide' | 'large';
|
|
11
|
+
export interface GTooltipCardData {
|
|
12
|
+
title: string;
|
|
13
|
+
content: string | TrustedHTML;
|
|
14
|
+
formula?: React.ReactNode;
|
|
15
|
+
contentList?: string[];
|
|
16
|
+
width?: Width;
|
|
17
|
+
}
|
|
18
|
+
export interface IProps {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
delay?: number;
|
|
21
|
+
tooltip?: GTooltipCardData;
|
|
22
|
+
activatorProps?: BoxProps;
|
|
23
|
+
wrapper?: 'span' | 'div';
|
|
24
|
+
isHideBorder?: boolean;
|
|
25
|
+
alignment?: 'start' | 'center' | 'end';
|
|
26
|
+
textDecoration?: 'underline' | 'none';
|
|
27
|
+
preferredAlignment?: 'left' | 'center' | 'right';
|
|
28
|
+
popoverRef?: React.RefObject<PopoverPublicAPI>;
|
|
29
|
+
showArrow?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare const GTooltipCard: import("react").ForwardRefExoticComponent<IProps & import("react").RefAttributes<GTooltipCardPublicAPI>>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Trend } from '@shopify/polaris-viz-core';
|
|
2
|
+
export interface IPAChartLabel {
|
|
3
|
+
value: string;
|
|
4
|
+
tooltipValue: string;
|
|
5
|
+
}
|
|
6
|
+
export type IPAChartLabels = IPAChartLabel[];
|
|
7
|
+
export interface IPAChartDataPoint {
|
|
8
|
+
key: string;
|
|
9
|
+
tooltipKey: string;
|
|
10
|
+
value: number;
|
|
11
|
+
trend?: {
|
|
12
|
+
value: string | undefined;
|
|
13
|
+
trend: Trend;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export type AllChartsDataMap = Record<string, {
|
|
17
|
+
current: IPAChartDataPoint[];
|
|
18
|
+
previous: IPAChartDataPoint[];
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare enum EMetricKey {
|
|
2
|
+
SESSION = "sessions",
|
|
3
|
+
ORDERS = "orders",
|
|
4
|
+
PAGE_VIEWS = "pageviews",
|
|
5
|
+
VISITORS = "visitors",
|
|
6
|
+
BOUNCE_RATE = "bounce_rate",
|
|
7
|
+
CTR = "ctr",
|
|
8
|
+
CONVERSION_RATE = "conversion_rate",
|
|
9
|
+
AVG_TIME_ON_PAGE = "average_time_on_page",
|
|
10
|
+
ADDED_TO_CART = "added_to_cart",
|
|
11
|
+
ADD_TO_CART_RATE = "added_to_cart_rate",
|
|
12
|
+
REACHED_CHECKOUT = "sessions_that_reached_checkout",
|
|
13
|
+
COMPLETE_CHECKOUT = "sessions_that_completed_checkout",
|
|
14
|
+
CART_ADDITION = "sessions_with_cart_additions",
|
|
15
|
+
AOV = "aov",
|
|
16
|
+
REVENUE = "revenue",
|
|
17
|
+
RPV = "revenue_per_visitor"
|
|
18
|
+
}
|
|
19
|
+
export interface IMetricControl {
|
|
20
|
+
value: string | number | null;
|
|
21
|
+
change: string | number;
|
|
22
|
+
}
|
|
23
|
+
export interface IMetricCardItem {
|
|
24
|
+
key: EMetricKey;
|
|
25
|
+
title: string;
|
|
26
|
+
totalValue: IMetricControl;
|
|
27
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const TRIM_DECIMAL_ZEROS_REGEX: RegExp;
|
|
2
|
+
export declare const DEFAULT_DECIMALS = 2;
|
|
3
|
+
export declare const trimDecimalZeros: (number?: string) => string;
|
|
4
|
+
export declare const cleanDecimal: (number: number, decimals?: number) => string;
|
|
5
|
+
export declare const semverToNum: (v: string) => number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility function to calculate percentage and format it.
|
|
3
|
+
* @param part - The part value.
|
|
4
|
+
* @param total - The total value.
|
|
5
|
+
* @param decimals - The number of decimal places to format the percentage to.
|
|
6
|
+
* @returns The formatted percentage as a string.
|
|
7
|
+
*/
|
|
8
|
+
export declare const calcPercentage: (part?: number, total?: number, decimals?: number) => number | undefined;
|
|
9
|
+
export declare const calcPercentageString: (part: number | undefined, total: number, decimals?: number) => string | undefined;
|
|
10
|
+
export declare const formatPercentage: (percentage: number, decimals?: number) => string;
|