@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.
Files changed (126) hide show
  1. package/README.md +37 -0
  2. package/dist/esm/components/GMultipleMetricChartCard/GMultipleMetricChartCard.d.ts +14 -0
  3. package/dist/esm/components/GMultipleMetricChartCard/MetricCard.d.ts +10 -0
  4. package/dist/esm/components/GMultipleMetricChartCard/MetricChart.d.ts +12 -0
  5. package/dist/esm/components/GMultipleMetricChartCard/index.d.ts +2 -0
  6. package/dist/esm/components/GSelectableMetricChartCard/GSelectableMetricChartCard.d.ts +14 -0
  7. package/dist/esm/components/GSelectableMetricChartCard/MetricCard.d.ts +10 -0
  8. package/dist/esm/components/GSelectableMetricChartCard/MetricChart.d.ts +12 -0
  9. package/dist/esm/components/GSelectableMetricChartCard/MetricChartTab.d.ts +11 -0
  10. package/dist/esm/components/GSelectableMetricChartCard/MetricChartTabs.d.ts +11 -0
  11. package/dist/esm/components/GSelectableMetricChartCard/index.d.ts +2 -0
  12. package/dist/esm/components/GTooltipCard/GTooltipCard.d.ts +32 -0
  13. package/dist/esm/components/GTooltipCard/index.d.ts +2 -0
  14. package/dist/esm/components/PATrendBadge/PATrendBadge.d.ts +7 -0
  15. package/dist/esm/components/PATrendBadge/index.d.ts +1 -0
  16. package/dist/esm/components/SingleMetricChartCard/SingleMetricChartCard.d.ts +12 -0
  17. package/dist/esm/components/SingleMetricChartCard/index.d.ts +2 -0
  18. package/dist/esm/components/common/chart/ChartSkeleton.d.ts +1 -0
  19. package/dist/esm/components/common/chart/GChartSkeleton.d.ts +1 -0
  20. package/dist/esm/components/common/chart/MetricChart.d.ts +8 -0
  21. package/dist/esm/components/common/chart/MetricChartEmpty.d.ts +8 -0
  22. package/dist/esm/components/common/chart/MetricChartProvider.d.ts +6 -0
  23. package/dist/esm/components/common/chart/MetricChartTooltip.d.ts +6 -0
  24. package/dist/esm/components/common/chart/MetricInfoBlock.d.ts +13 -0
  25. package/dist/esm/components/common/chart/MetricInfoSkeleton.d.ts +4 -0
  26. package/dist/esm/components/common/chart/MetricTrend.d.ts +5 -0
  27. package/dist/esm/components/common/chart/MetricValueSummary.d.ts +8 -0
  28. package/dist/esm/components/common/chart/PAMetricInfoSkeleton.d.ts +4 -0
  29. package/dist/esm/components/common/chart/index.d.ts +7 -0
  30. package/dist/esm/components/common/icons/DownIcon8px.d.ts +1 -0
  31. package/dist/esm/components/common/icons/UpIcon8px.d.ts +1 -0
  32. package/dist/esm/components/common/icons/index.d.ts +2 -0
  33. package/dist/esm/components/common/percent/MetricPercentage.d.ts +4 -0
  34. package/dist/esm/components/common/percent/index.d.ts +1 -0
  35. package/dist/esm/components/index.d.ts +2 -0
  36. package/dist/esm/constants/analytic-metric-tooltip.d.ts +5 -0
  37. package/dist/esm/constants/chart.d.ts +13 -0
  38. package/dist/esm/constants/g-multiple-metric-chart-card.d.ts +13 -0
  39. package/dist/esm/constants/g-selectable-metric-chart-card.d.ts +13 -0
  40. package/dist/esm/constants/index.d.ts +3 -0
  41. package/dist/esm/constants/pa-trend-badge.d.ts +9 -0
  42. package/dist/esm/constants/thumbnail.d.ts +2 -0
  43. package/dist/esm/index.d.ts +2 -0
  44. package/dist/esm/index.js +391 -0
  45. package/dist/esm/index.mjs +391 -0
  46. package/dist/esm/providers/MetricChartProvider.d.ts +6 -0
  47. package/dist/esm/providers/index.d.ts +1 -0
  48. package/dist/esm/shared/components/GBlockCenter/GBlockCenter.d.ts +15 -0
  49. package/dist/esm/shared/components/GBlockCenter/index.d.ts +1 -0
  50. package/dist/esm/shared/components/GSkeletonDisplayText/GSkeletonDisplayText.d.ts +4 -0
  51. package/dist/esm/shared/components/GSkeletonDisplayText/index.d.ts +1 -0
  52. package/dist/esm/shared/components/GThumbnail/GThumbnail.d.ts +20 -0
  53. package/dist/esm/shared/components/GThumbnail/index.d.ts +1 -0
  54. package/dist/esm/shared/components/GTooltipCard/GTooltipCard.d.ts +32 -0
  55. package/dist/esm/shared/components/GTooltipCard/index.d.ts +2 -0
  56. package/dist/esm/shared/components/index.d.ts +4 -0
  57. package/dist/esm/shared/index.d.ts +1 -0
  58. package/dist/esm/types/chart.d.ts +19 -0
  59. package/dist/esm/types/index.d.ts +2 -0
  60. package/dist/esm/types/metric.d.ts +27 -0
  61. package/dist/esm/utils/cls.d.ts +4 -0
  62. package/dist/esm/utils/index.d.ts +3 -0
  63. package/dist/esm/utils/number.d.ts +5 -0
  64. package/dist/esm/utils/percentage.d.ts +10 -0
  65. package/dist/style.css +1 -0
  66. package/dist/umd/esm/components/GMultipleMetricChartCard/GMultipleMetricChartCard.d.ts +14 -0
  67. package/dist/umd/esm/components/GMultipleMetricChartCard/MetricCard.d.ts +10 -0
  68. package/dist/umd/esm/components/GMultipleMetricChartCard/MetricChart.d.ts +12 -0
  69. package/dist/umd/esm/components/GMultipleMetricChartCard/index.d.ts +2 -0
  70. package/dist/umd/esm/components/GSelectableMetricChartCard/GSelectableMetricChartCard.d.ts +14 -0
  71. package/dist/umd/esm/components/GSelectableMetricChartCard/MetricCard.d.ts +10 -0
  72. package/dist/umd/esm/components/GSelectableMetricChartCard/MetricChart.d.ts +12 -0
  73. package/dist/umd/esm/components/GSelectableMetricChartCard/MetricChartTab.d.ts +11 -0
  74. package/dist/umd/esm/components/GSelectableMetricChartCard/index.d.ts +2 -0
  75. package/dist/umd/esm/components/GTooltipCard/GTooltipCard.d.ts +32 -0
  76. package/dist/umd/esm/components/GTooltipCard/index.d.ts +2 -0
  77. package/dist/umd/esm/components/PATrendBadge/PATrendBadge.d.ts +7 -0
  78. package/dist/umd/esm/components/PATrendBadge/index.d.ts +1 -0
  79. package/dist/umd/esm/components/SingleMetricChartCard/SingleMetricChartCard.d.ts +12 -0
  80. package/dist/umd/esm/components/SingleMetricChartCard/index.d.ts +2 -0
  81. package/dist/umd/esm/components/common/chart/GChartSkeleton.d.ts +1 -0
  82. package/dist/umd/esm/components/common/chart/MetricChart.d.ts +8 -0
  83. package/dist/umd/esm/components/common/chart/MetricChartEmpty.d.ts +8 -0
  84. package/dist/umd/esm/components/common/chart/MetricChartProvider.d.ts +6 -0
  85. package/dist/umd/esm/components/common/chart/MetricChartTooltip.d.ts +6 -0
  86. package/dist/umd/esm/components/common/chart/MetricInfoBlock.d.ts +13 -0
  87. package/dist/umd/esm/components/common/chart/MetricInfoSkeleton.d.ts +4 -0
  88. package/dist/umd/esm/components/common/chart/MetricTrend.d.ts +5 -0
  89. package/dist/umd/esm/components/common/chart/MetricValueSummary.d.ts +8 -0
  90. package/dist/umd/esm/components/common/chart/PAMetricInfoSkeleton.d.ts +4 -0
  91. package/dist/umd/esm/components/common/chart/index.d.ts +7 -0
  92. package/dist/umd/esm/components/common/icons/DownIcon8px.d.ts +1 -0
  93. package/dist/umd/esm/components/common/icons/UpIcon8px.d.ts +1 -0
  94. package/dist/umd/esm/components/common/icons/index.d.ts +2 -0
  95. package/dist/umd/esm/components/common/percent/MetricPercentage.d.ts +4 -0
  96. package/dist/umd/esm/components/common/percent/index.d.ts +1 -0
  97. package/dist/umd/esm/components/index.d.ts +2 -0
  98. package/dist/umd/esm/constants/analytic-metric-tooltip.d.ts +5 -0
  99. package/dist/umd/esm/constants/chart.d.ts +13 -0
  100. package/dist/umd/esm/constants/g-multiple-metric-chart-card.d.ts +13 -0
  101. package/dist/umd/esm/constants/g-selectable-metric-chart-card.d.ts +12 -0
  102. package/dist/umd/esm/constants/index.d.ts +3 -0
  103. package/dist/umd/esm/constants/pa-trend-badge.d.ts +9 -0
  104. package/dist/umd/esm/constants/thumbnail.d.ts +2 -0
  105. package/dist/umd/esm/index.d.ts +2 -0
  106. package/dist/umd/esm/providers/MetricChartProvider.d.ts +6 -0
  107. package/dist/umd/esm/providers/index.d.ts +1 -0
  108. package/dist/umd/esm/shared/components/GBlockCenter/GBlockCenter.d.ts +15 -0
  109. package/dist/umd/esm/shared/components/GBlockCenter/index.d.ts +1 -0
  110. package/dist/umd/esm/shared/components/GSkeletonDisplayText/GSkeletonDisplayText.d.ts +4 -0
  111. package/dist/umd/esm/shared/components/GSkeletonDisplayText/index.d.ts +1 -0
  112. package/dist/umd/esm/shared/components/GThumbnail/GThumbnail.d.ts +20 -0
  113. package/dist/umd/esm/shared/components/GThumbnail/index.d.ts +1 -0
  114. package/dist/umd/esm/shared/components/GTooltipCard/GTooltipCard.d.ts +32 -0
  115. package/dist/umd/esm/shared/components/GTooltipCard/index.d.ts +2 -0
  116. package/dist/umd/esm/shared/components/index.d.ts +4 -0
  117. package/dist/umd/esm/shared/index.d.ts +1 -0
  118. package/dist/umd/esm/types/chart.d.ts +19 -0
  119. package/dist/umd/esm/types/index.d.ts +2 -0
  120. package/dist/umd/esm/types/metric.d.ts +27 -0
  121. package/dist/umd/esm/utils/cls.d.ts +4 -0
  122. package/dist/umd/esm/utils/index.d.ts +3 -0
  123. package/dist/umd/esm/utils/number.d.ts +5 -0
  124. package/dist/umd/esm/utils/percentage.d.ts +10 -0
  125. package/dist/umd/index.js +1 -0
  126. 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,2 @@
1
+ export { GMultipleMetricChartCard } from './GMultipleMetricChartCard';
2
+ export type { IProps as IGMultipleMetricChartCardProps } from './GMultipleMetricChartCard';
@@ -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,2 @@
1
+ export { GSelectableMetricChartCard } from './GSelectableMetricChartCard';
2
+ export type { IProps as IGSelectableMetricChartCardProps } from './GSelectableMetricChartCard';
@@ -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,2 @@
1
+ export { GTooltipCard } from './GTooltipCard';
2
+ export type { GTooltipCardData, GTooltipCardPublicAPI, IProps as IGTooltipCardProps, PopoverPublicAPI, } from './GTooltipCard';
@@ -0,0 +1,7 @@
1
+ import { type ReactElement } from 'react';
2
+ export interface IProps {
3
+ label: string;
4
+ value: string;
5
+ changePercent?: number;
6
+ }
7
+ export declare const PATrendBadge: ({ label, value, changePercent }: IProps) => ReactElement;
@@ -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,2 @@
1
+ export { SingleMetricChartCard } from './SingleMetricChartCard';
2
+ export type { IProps as ISingleMetricChartCardProps } from './SingleMetricChartCard';
@@ -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,8 @@
1
+ import type { BoxProps } from '@shopify/polaris';
2
+ export interface MetricChartEmptyProps {
3
+ boxProps?: BoxProps;
4
+ minHeight?: string;
5
+ description?: string;
6
+ title: string;
7
+ }
8
+ export declare const MetricChartEmpty: React.FC<MetricChartEmptyProps>;
@@ -0,0 +1,6 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ export interface IProps {
3
+ children: ReactNode;
4
+ minHeight?: number;
5
+ }
6
+ export declare const MetricChartProvider: ({ children, minHeight }: 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,4 @@
1
+ export interface MetricInfoSkeletonProps {
2
+ isShowOneLine?: boolean;
3
+ }
4
+ export declare const MetricInfoSkeleton: React.FC<MetricInfoSkeletonProps>;
@@ -0,0 +1,5 @@
1
+ import type { ReactElement } from 'react';
2
+ export interface IProps {
3
+ change: number | string;
4
+ }
5
+ export declare const MetricTrend: ({ change }: 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,4 @@
1
+ export interface PAMetricInfoSkeletonProps {
2
+ isShowOneLine?: boolean;
3
+ }
4
+ export declare const PAMetricInfoSkeleton: React.FC<PAMetricInfoSkeletonProps>;
@@ -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,2 @@
1
+ export { DownIcon8px } from './DownIcon8px';
2
+ export { UpIcon8px } from './UpIcon8px';
@@ -0,0 +1,4 @@
1
+ export interface MetricPercentageProps {
2
+ change: number | string;
3
+ }
4
+ export declare const MetricPercentage: React.FC<MetricPercentageProps>;
@@ -0,0 +1 @@
1
+ export { MetricPercentage } from './MetricPercentage';
@@ -0,0 +1,2 @@
1
+ export * from './GSelectableMetricChartCard';
2
+ export * from './SingleMetricChartCard';
@@ -0,0 +1,5 @@
1
+ import type { GTooltipCardData } from '../shared';
2
+ import { EMetricKey } from '../types/metric';
3
+ type IMetricKeyValue = Record<EMetricKey, GTooltipCardData>;
4
+ export declare const ANALYTICS_METRIC_TOOLTIP: IMetricKeyValue;
5
+ export {};
@@ -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,3 @@
1
+ export * from './analytic-metric-tooltip';
2
+ export * from './chart';
3
+ export * from './thumbnail';
@@ -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,2 @@
1
+ import THUMB_PRODUCT_DEFAULT from '../assets/svg/product.svg';
2
+ export { THUMB_PRODUCT_DEFAULT };
@@ -0,0 +1,2 @@
1
+ export * from './components';
2
+ export * from './types';
@@ -0,0 +1,6 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ export interface IProps {
3
+ children: ReactNode;
4
+ minHeight?: number;
5
+ }
6
+ export declare const MetricChartProvider: ({ children, minHeight }: IProps) => ReactElement;
@@ -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,4 @@
1
+ export interface GSkeletonDisplayTextProps {
2
+ height?: `${number}ch` | `${number}%` | `${number}px`;
3
+ }
4
+ export declare const GSkeletonDisplayText: React.FC<GSkeletonDisplayTextProps>;
@@ -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,2 @@
1
+ export { GTooltipCard } from './GTooltipCard';
2
+ export type { GTooltipCardData, GTooltipCardPublicAPI, IProps as IGTooltipCardProps, PopoverPublicAPI, } from './GTooltipCard';
@@ -0,0 +1,4 @@
1
+ export * from './GSkeletonDisplayText';
2
+ export * from './GBlockCenter';
3
+ export * from './GThumbnail';
4
+ export * from './GTooltipCard';
@@ -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,2 @@
1
+ export * from './chart';
2
+ export * from './metric';
@@ -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,4 @@
1
+ type ClassDictionary = Record<string, boolean | undefined | null>;
2
+ type ClassValue = ClassDictionary | string | null | undefined;
3
+ export declare function cls(...classes: ClassValue[]): string;
4
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './number';
2
+ export * from './percentage';
3
+ export * from './cls';
@@ -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;