@nuskin/react-mysite-elements 1.6.0-comx-2229.10 → 1.6.0-comx-2229.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.
- package/dist/common/shopping-dashboard/TranslationKeys/ProductOfferDashboardTranslationKeys.d.ts +4 -0
- package/dist/common/shopping-dashboard/TranslationKeys/ShoppingDashboardTranslationKeys.d.ts +4 -0
- package/dist/common/shopping-dashboard/index.d.ts +0 -2
- package/dist/common/shopping-dashboard/shared/FullViewComponents.styled.d.ts +1 -0
- package/dist/common/shopping-dashboard/shared/Signups/SignupsChart.styled.d.ts +1 -1
- package/dist/common/shopping-dashboard/shared/TopCategories/TopCategoriesPieChart.d.ts +1 -2
- package/dist/common/shopping-dashboard/shared/TopPerformingOffers/TopPerformingOffersPieChart.d.ts +1 -2
- package/dist/common/shopping-dashboard/shared/TopProducts/ProductsFullView.d.ts +1 -0
- package/dist/common/shopping-dashboard/utils/dataUtils.d.ts +13 -1
- package/dist/common/shopping-dashboard/utils/trendUtils.d.ts +28 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -5
- package/dist/common/Nav-Category-Navigation/NsCategoryNavigation.spec.d.ts +0 -1
- package/dist/common/card/fixtures/ImageData2.d.ts +0 -3
- package/dist/common/card/specs/NsProductCard.spec.d.ts +0 -1
- package/dist/common/carousel/specs/IconWrapper.spec.d.ts +0 -1
- package/dist/common/carousel/specs/NsProductCarousel.spec.d.ts +0 -1
- package/dist/common/carousel/specs/ProductCardEntries.spec.d.ts +0 -1
- package/dist/common/carousel/specs/ProductTabCarousel.spec.d.ts +0 -1
- package/dist/common/carousel/specs/settingSlick.spec.d.ts +0 -1
- package/dist/common/headers/specs/MysiteHero.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/hooks/useScrollToTopOnViewChange.test.d.ts +0 -1
- package/dist/common/shopping-dashboard/shared/ConversionRate/ConversionRateFullView.test.d.ts +0 -1
- package/dist/common/shopping-dashboard/shared/Signups/SignupsFullView.test.d.ts +0 -1
- package/dist/common/shopping-dashboard/shared/TopCategories/CategoriesFullView.test.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/CategoriesFullView.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/ConversionRateChart.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/ConversionRateFullView.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/DashboardHeader.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/DataTable.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/FilterBar.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/MysiteDashboardWithNavigation.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/Pagination.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/PoDashboardWithNavigation.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/ProductOfferDashboard.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/ProductsFullView.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/ShoppingDashboard.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/SignupsChart.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/SignupsFullView.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/TopCategoriesPieChart.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/TopPerformingOffersFullView.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/TopPerformingOffersPieChart.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/TopSellingProductsList.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/WidgetMenu.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/comparisonTextUtils.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/dataUtils.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/dateFormat.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/excelExport.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/marketOptions.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/productOfferExport.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/productOfferTranslation.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/translationResolver.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/trendUtils.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/specs/useProductOfferWidgetExports.spec.d.ts +0 -1
- package/dist/common/shopping-dashboard/utils/dateFormat.test.d.ts +0 -1
- package/dist/common/utils/gtmTracking.spec.d.ts +0 -1
package/dist/common/shopping-dashboard/TranslationKeys/ProductOfferDashboardTranslationKeys.d.ts
CHANGED
|
@@ -75,6 +75,10 @@ export declare const ProductOfferDashboardTranslationKeys: {
|
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
77
|
readonly offerSort: {
|
|
78
|
+
readonly label: {
|
|
79
|
+
readonly key: "productOfferDashboard.filter.offerSort.label";
|
|
80
|
+
readonly fallback: "Sort By";
|
|
81
|
+
};
|
|
78
82
|
readonly byRevenue: {
|
|
79
83
|
readonly key: "productOfferDashboard.filter.offerSort.byRevenue";
|
|
80
84
|
readonly fallback: "Revenue";
|
package/dist/common/shopping-dashboard/TranslationKeys/ShoppingDashboardTranslationKeys.d.ts
CHANGED
|
@@ -472,6 +472,10 @@ export declare const ShoppingDashboardTranslationKeys: {
|
|
|
472
472
|
readonly key: "shoppingDashboard.defaults.zeroTrend";
|
|
473
473
|
readonly fallback: "+0%";
|
|
474
474
|
};
|
|
475
|
+
readonly labelValueSeparator: {
|
|
476
|
+
readonly key: "shoppingDashboard.defaults.labelValueSeparator";
|
|
477
|
+
readonly fallback: ":";
|
|
478
|
+
};
|
|
475
479
|
readonly noValue: {
|
|
476
480
|
readonly key: "shoppingDashboard.defaults.noValue";
|
|
477
481
|
readonly fallback: "--";
|
|
@@ -33,8 +33,6 @@ export type { ColumnDef, DataTableProps } from './shared/DataTable';
|
|
|
33
33
|
export type { PaginationProps } from './shared/Pagination';
|
|
34
34
|
export type { PageHeaderProps } from './shared/PageHeader';
|
|
35
35
|
export type { FilterBarProps } from './shared/FilterBar';
|
|
36
|
-
export { mockStats, mockTopProducts, mockConversionData, mockSignupData, mockCategories, mockOrders, mockSignupDetails, } from './fixtures';
|
|
37
|
-
export { mockProductOfferStats, mockTopOffers } from './fixtures/mockProductOfferData';
|
|
38
36
|
export { getTrendIcon, getTrendColor } from './utils/trendUtils';
|
|
39
37
|
export { formatDateRangeLabel, formatShortDate, formatDisplayDate, formatDateRange, formatISODate, } from './utils/dateFormat';
|
|
40
38
|
export { DAYS_MAP, DATE_RANGE_LABELS, getDaysFromDateRange, getDateRangeLabel } from './utils/dateConstants';
|
|
@@ -22,6 +22,7 @@ export declare const ChartSection: import("@emotion/styled").StyledComponent<imp
|
|
|
22
22
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
23
23
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
24
24
|
export declare const ChartTitle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
25
|
+
export declare const ChartTitleButton: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
25
26
|
export declare const ChartContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
26
27
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
27
28
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -13,7 +13,7 @@ export declare const HeaderActionsContainer: import("@emotion/styled").StyledCom
|
|
|
13
13
|
export declare const ChartTitle: import("@emotion/styled").StyledComponent<{
|
|
14
14
|
theme?: import("@emotion/react").Theme;
|
|
15
15
|
as?: React.ElementType;
|
|
16
|
-
}, import("react").DetailedHTMLProps<import("react").
|
|
16
|
+
}, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
17
17
|
export declare const FilterDropdown: import("@emotion/styled").StyledComponent<{
|
|
18
18
|
theme?: import("@emotion/react").Theme;
|
|
19
19
|
as?: React.ElementType;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CategoryRevenue, CategorySortOption
|
|
2
|
+
import type { CategoryRevenue, CategorySortOption } from '../../types.d';
|
|
3
3
|
export interface TopCategoriesPieChartProps {
|
|
4
4
|
readonly categories: CategoryRevenue[];
|
|
5
5
|
readonly categorySort: CategorySortOption;
|
|
6
6
|
readonly isLoading?: boolean;
|
|
7
7
|
readonly title?: string;
|
|
8
|
-
readonly market?: MarketOption;
|
|
9
8
|
readonly summaryChangePct?: number | null;
|
|
10
9
|
readonly onSortChange?: (sort: CategorySortOption) => void;
|
|
11
10
|
readonly onTitleClick?: () => void;
|
package/dist/common/shopping-dashboard/shared/TopPerformingOffers/TopPerformingOffersPieChart.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { TopPerformingOffer, OfferSortOption
|
|
2
|
+
import type { TopPerformingOffer, OfferSortOption } from '../../types.d';
|
|
3
3
|
export interface TopPerformingOffersPieChartProps {
|
|
4
4
|
readonly offers: TopPerformingOffer[];
|
|
5
5
|
readonly offerSort: OfferSortOption;
|
|
6
6
|
readonly isLoading?: boolean;
|
|
7
7
|
readonly title?: string;
|
|
8
|
-
readonly market?: MarketOption;
|
|
9
8
|
readonly summaryChangePct?: number | null;
|
|
10
9
|
readonly onSortChange?: (sort: OfferSortOption) => void;
|
|
11
10
|
readonly onTitleClick?: () => void;
|
|
@@ -7,6 +7,7 @@ export interface ProductsFullViewProps {
|
|
|
7
7
|
readonly productSort: ProductSortOption;
|
|
8
8
|
readonly markets?: ReadonlyArray<MarketFilterOption>;
|
|
9
9
|
readonly isLoading?: boolean;
|
|
10
|
+
readonly currencyCode?: string;
|
|
10
11
|
readonly onBack?: () => void;
|
|
11
12
|
readonly onDateRangeChange?: (range: DateRangeOption) => void;
|
|
12
13
|
readonly onMarketChange?: (market: MarketOption) => void;
|
|
@@ -24,7 +24,19 @@ export declare function usePaginatedItems<T>(items: T[], currentPage: number, it
|
|
|
24
24
|
* @returns The locale string (e.g., 'en-US', 'en-IN', 'en-CA')
|
|
25
25
|
*/
|
|
26
26
|
export declare function getLocaleFromMarketCode(marketCode?: string): string;
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Formats a monetary amount with currency code displayed as text prefix.
|
|
29
|
+
* Examples:
|
|
30
|
+
* - formatMoney(6701.12, 'AUD') → "AUD 6,701.12"
|
|
31
|
+
* - formatMoney(6701.12, 'USD') → "USD 6,701.12"
|
|
32
|
+
* - formatMoney(6701.12, 'INR') → "INR 6,701.12"
|
|
33
|
+
*
|
|
34
|
+
* @param value - The monetary amount
|
|
35
|
+
* @param currencyCode - ISO 4217 currency code (e.g., 'USD', 'AUD', 'INR')
|
|
36
|
+
* @param minimumFractionDigits - Minimum decimal places (default: 2)
|
|
37
|
+
* @returns Formatted currency string with code as text prefix
|
|
38
|
+
*/
|
|
39
|
+
export declare function formatMoney(value: number, currencyCode?: string, minimumFractionDigits?: number): string;
|
|
28
40
|
export declare function capitalizeFirstLetter(text: string): string;
|
|
29
41
|
/**
|
|
30
42
|
* Gets the numeric value from a SignupDataPoint based on the selected signup view.
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TrendDirection } from '../shared/types';
|
|
3
|
+
/**
|
|
4
|
+
* Shared threshold below which a percentage change is treated as "no meaningful change"
|
|
5
|
+
* and rendered as a neutral trend rather than a misleading +/-0.0x% up/down arrow.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TREND_NEUTRAL_THRESHOLD = 0.1;
|
|
8
|
+
export interface ConversionTrendPoint {
|
|
9
|
+
readonly rate: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ConversionTrendResult {
|
|
12
|
+
readonly direction: TrendDirection;
|
|
13
|
+
readonly value: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Computes the conversion-rate trend shown in both the widget chart and its full-view
|
|
17
|
+
* counterpart. Prefers the API-supplied summaryChangePct when present; otherwise derives
|
|
18
|
+
* the change from the first and last points of the filtered series. The neutral threshold
|
|
19
|
+
* is applied consistently in every branch so backend-provided and locally-computed trends
|
|
20
|
+
* never diverge on what counts as "no change".
|
|
21
|
+
*/
|
|
22
|
+
export declare function computeConversionTrend(summaryChangePct: number | null | undefined, filteredData: readonly ConversionTrendPoint[], noChangeText: string, noDataText?: string): ConversionTrendResult;
|
|
3
23
|
export declare function parseTrendPercent(value?: string | number): number | null;
|
|
4
24
|
export declare function resolveTrendDirection(value?: string | number): TrendDirection;
|
|
5
25
|
export declare function calculateWeightedRevenueTrend<T>(items: readonly T[], getRevenue: (item: T) => number, getTrend: (item: T) => string | number | undefined): {
|
|
@@ -7,6 +27,14 @@ export declare function calculateWeightedRevenueTrend<T>(items: readonly T[], ge
|
|
|
7
27
|
formatted: string;
|
|
8
28
|
};
|
|
9
29
|
export declare function getTrendDirectionLabel(direction: TrendDirection): string;
|
|
30
|
+
/**
|
|
31
|
+
* Determines trend direction from string value.
|
|
32
|
+
* Treats +0% as neutral to avoid misleading indicators.
|
|
33
|
+
* This is a simplified version for direct string parsing.
|
|
34
|
+
* @param trendValue Percentage change (e.g., "+5.5", "-2.1", "+0")
|
|
35
|
+
* @returns 'up' | 'down' | 'neutral'
|
|
36
|
+
*/
|
|
37
|
+
export declare function getTrendDirection(trendValue?: string): TrendDirection;
|
|
10
38
|
export declare function getTrendIcon(direction: TrendDirection): React.ReactNode;
|
|
11
39
|
export declare function getTrendColor(direction: TrendDirection): string;
|
|
12
40
|
export interface PieChartLabelProps {
|