@nuskin/react-loyalty-elements 1.0.1 → 1.0.3

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 (50) hide show
  1. package/README.md +0 -1
  2. package/dist/CircularProgressBar/CircularProgressBar.styled.d.ts +41 -0
  3. package/dist/CircularProgressBar/RadialSeparator.d.ts +4 -0
  4. package/dist/CircularProgressBar/RewardProgressBar.d.ts +8 -0
  5. package/dist/CircularProgressBar/RewardSubscriptionMonthDescription.d.ts +8 -0
  6. package/dist/CircularProgressBar/RewardSubscriptionTotal.d.ts +8 -0
  7. package/dist/CircularProgressBar/SubscriptionReward.d.ts +4 -0
  8. package/dist/CircularProgressBar/SubscriptionRewardMobile.d.ts +4 -0
  9. package/dist/CircularProgressBar/index.d.ts +1 -0
  10. package/dist/CircularProgressBar/logic/calculateMonthCompletionValues.d.ts +5 -0
  11. package/dist/CircularProgressBar/specs/RadialSeparator.spec.d.ts +1 -0
  12. package/dist/CircularProgressBar/specs/RewardProgressBar.spec.d.ts +1 -0
  13. package/dist/CircularProgressBar/specs/RewardSubscriptionMonthDescription.spec.d.ts +1 -0
  14. package/dist/CircularProgressBar/specs/RewardSubscriptionTotal.spec.d.ts +1 -0
  15. package/dist/CircularProgressBar/specs/SubscriptionReward.spec.d.ts +1 -0
  16. package/dist/CircularProgressBar/specs/SubscriptionRewardMobile.spec.d.ts +1 -0
  17. package/dist/CircularProgressBar/specs/calculateMonthCompletionValues.spec.d.ts +1 -0
  18. package/dist/CircularProgressBar/types.d.ts +98 -0
  19. package/dist/Icons/Info.d.ts +2 -0
  20. package/dist/Icons/PromoLayoutIcon.d.ts +1 -0
  21. package/dist/Icons/SubscriptionVoucherIcon.d.ts +2 -0
  22. package/dist/Icons/SubscriptionVoucherIconGrey.d.ts +2 -0
  23. package/dist/Icons/index.d.ts +3 -0
  24. package/dist/SampleComponent/SampleComponent.d.ts +3 -0
  25. package/dist/SampleComponent/specs/SampleComponent.spec.d.ts +1 -0
  26. package/dist/SubscriptionRewardBanner/SubscriptionRewardBanner.d.ts +3 -0
  27. package/dist/SubscriptionRewardBanner/SubscriptionRewardBanner.styled.d.ts +29 -0
  28. package/dist/SubscriptionRewardBanner/index.d.ts +1 -0
  29. package/dist/SubscriptionRewardBanner/specs/SubscriptionRewardBanner.spec.d.ts +1 -0
  30. package/dist/SubscriptionRewardBanner/types.d.ts +20 -0
  31. package/dist/SubscriptionRewardModal/SubscriptionRewardModal.d.ts +2 -0
  32. package/dist/SubscriptionRewardModal/SubscriptionRewardModal.styled.d.ts +40 -0
  33. package/dist/SubscriptionRewardModal/index.d.ts +1 -0
  34. package/dist/SubscriptionRewardModal/specs/SubscriptionRewardModal.spec.d.ts +1 -0
  35. package/dist/SubscriptionRewardModal/types.d.ts +21 -0
  36. package/dist/Utils/application/application.d.ts +14 -0
  37. package/dist/Utils/application/index.d.ts +2 -0
  38. package/dist/Utils/application/specs/application.spec.d.ts +1 -0
  39. package/dist/Utils/helper.d.ts +4 -0
  40. package/dist/Utils/index.d.ts +0 -0
  41. package/dist/index.d.ts +1 -0
  42. package/dist/index.js +1 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/index.mjs +1 -0
  45. package/dist/index.mjs.map +1 -0
  46. package/package.json +32 -14
  47. package/src/SampleComponent/SampleComponent.spec.tsx +0 -27
  48. package/src/SampleComponent/SampleComponent.tsx +0 -16
  49. package/src/index.ts +0 -1
  50. /package/{src/SampleComponent/index.ts → dist/SampleComponent/index.d.ts} +0 -0
package/README.md CHANGED
@@ -1,4 +1,3 @@
1
1
  # Loyalty Components
2
2
 
3
3
  This is a repository for loyalty components to be used to integrate with other domains as well as providing reuseability
4
-
@@ -0,0 +1,41 @@
1
+ /// <reference types="react" />
2
+ export declare const RewardProgressBarContainer: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const LoyaltyProgressSubContainer: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const StyledCard: import("@emotion/styled").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
13
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
14
+ export declare const Learn3XLink: import("@emotion/styled").StyledComponent<{
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
17
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
18
+ export declare const ProgressBarCenter: import("@emotion/styled").StyledComponent<{
19
+ theme?: import("@emotion/react").Theme | undefined;
20
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
21
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
22
+ export declare const RewardProgressTotalContainer: import("@emotion/styled").StyledComponent<{
23
+ theme?: import("@emotion/react").Theme | undefined;
24
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
25
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
26
+ export declare const RewardProgressTotalButtonWithIcon: import("@emotion/styled").StyledComponent<{
27
+ theme?: import("@emotion/react").Theme | undefined;
28
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
29
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
30
+ export declare const IconContainer: import("@emotion/styled").StyledComponent<{
31
+ theme?: import("@emotion/react").Theme | undefined;
32
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
33
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
34
+ export declare const SeparatorCard: import("@emotion/styled").StyledComponent<{
35
+ theme?: import("@emotion/react").Theme | undefined;
36
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
37
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
38
+ export declare const SeparatorInnerCard: import("@emotion/styled").StyledComponent<{
39
+ theme?: import("@emotion/react").Theme | undefined;
40
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
41
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,4 @@
1
+ declare function RadialSeparators(props: {
2
+ count: number;
3
+ }): import("react/jsx-runtime").JSX.Element[];
4
+ export default RadialSeparators;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { RewardProgressBarProps } from './types';
3
+ declare class RewardProgressBar extends React.Component<RewardProgressBarProps> {
4
+ constructor(props: RewardProgressBarProps);
5
+ render(): import("react/jsx-runtime").JSX.Element;
6
+ }
7
+ export default RewardProgressBar;
8
+ export { RewardProgressBar };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { RewardSubscriptionMonthDescriptionProps } from './types';
3
+ declare class RewardSubscriptionMonthDescription extends React.Component<RewardSubscriptionMonthDescriptionProps> {
4
+ constructor(props: RewardSubscriptionMonthDescriptionProps);
5
+ render(): import("react/jsx-runtime").JSX.Element;
6
+ }
7
+ export default RewardSubscriptionMonthDescription;
8
+ export { RewardSubscriptionMonthDescription };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { RewardProgressBarProps } from './types';
3
+ declare class RewardSubscriptionTotal extends React.Component<RewardProgressBarProps> {
4
+ constructor(props: RewardProgressBarProps);
5
+ render(): import("react/jsx-runtime").JSX.Element;
6
+ }
7
+ export default RewardSubscriptionTotal;
8
+ export { RewardSubscriptionTotal };
@@ -0,0 +1,4 @@
1
+ import { RewardProgressBarProps } from './types';
2
+ declare const SubscriptionReward: (props: RewardProgressBarProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default SubscriptionReward;
4
+ export { SubscriptionReward };
@@ -0,0 +1,4 @@
1
+ import { RewardProgressBarProps } from './types';
2
+ declare const SubscriptionRewardMobile: (props: RewardProgressBarProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default SubscriptionRewardMobile;
4
+ export { SubscriptionRewardMobile };
@@ -0,0 +1 @@
1
+ export { default as SubscriptionReward } from './SubscriptionReward';
@@ -0,0 +1,5 @@
1
+ import { MonthlyData } from '../types';
2
+ export declare const calculateMonthCompletionValues: (data: MonthlyData | null | undefined, minAmount: number, maxAmount: number, minVoucher: number, maxVoucher: number, voucherValue: number, monthCompletionValue: number) => {
3
+ monthCompletionValue: number;
4
+ voucherValue: number;
5
+ };
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,98 @@
1
+ export type ApproximateMonthlyTotal = {
2
+ currentMonthTotal: number;
3
+ nextMonthTotal?: number;
4
+ };
5
+ export type StoreMonthlySubsOrder = {
6
+ accountId?: number;
7
+ userId?: number;
8
+ nuskinAccountId?: string;
9
+ year: number;
10
+ month: number;
11
+ storeId?: number;
12
+ totalAmount: number;
13
+ promocode: string | null;
14
+ createdTime?: string;
15
+ updatedTime?: string;
16
+ };
17
+ export type MonthlyData = {
18
+ approximateMonthlyTotalResponse?: {
19
+ currentMonthTotal?: number;
20
+ };
21
+ approximateMonthlyTotal?: ApproximateMonthlyTotal;
22
+ storeMonthlySubsOrderTotal?: StoreMonthlySubsOrder[];
23
+ };
24
+ export type TranslationConfig = {
25
+ header?: string | undefined;
26
+ voucherTargetAmount: string;
27
+ monthsComplete: string;
28
+ voucherEarned: string;
29
+ learnMore: string;
30
+ learn3xMore: string;
31
+ callToAction: string;
32
+ notQualify: string;
33
+ approximateMonthly: string;
34
+ approximateTotal: string;
35
+ currentlyTrack: string;
36
+ loyaltyLogoBlack: string;
37
+ estimateDisclaimer?: string | undefined;
38
+ };
39
+ export type LearnMoreConfig = {
40
+ tagLine: string;
41
+ cardOneDescription: string;
42
+ cardOneVoucherAmount: string;
43
+ cardTwoDescription: string;
44
+ cardTwoVoucherAmount: string;
45
+ header: string;
46
+ loyaltyLogoWhite: string;
47
+ loyaltyBanner: string;
48
+ learnMore: string;
49
+ };
50
+ export type RewardProgressBarProps = {
51
+ value: number;
52
+ title: string;
53
+ amountShow?: number | undefined;
54
+ voucherValue: number | null;
55
+ monthCompletionValue?: number;
56
+ minAmount?: number;
57
+ maxMonths: number;
58
+ approximateMonthlyTotalResponse?: object;
59
+ subscriptionData?: null | MonthlyData;
60
+ handleOpenSubscriptionRewardPopup: () => void;
61
+ notQualifyForRewardThisMonth: boolean;
62
+ translationConfig: TranslationConfig;
63
+ learnMoreConfig: LearnMoreConfig;
64
+ storeConfig: {
65
+ tiers?: [
66
+ {
67
+ consecutive_months: number;
68
+ min_spend: number;
69
+ max_spend: number;
70
+ promo_code: string;
71
+ },
72
+ {
73
+ consecutive_months: number;
74
+ min_spend: number;
75
+ promo_code: string;
76
+ }
77
+ ];
78
+ currencyAbbreviate?: boolean;
79
+ };
80
+ currencyAbbreviate?: boolean;
81
+ currencyFormat?: (price: number, currencyWithoutDecimal: boolean, currencyAbbreviate: boolean) => void;
82
+ };
83
+ export type RewardSubscriptionMonthDescriptionProps = {
84
+ value: number;
85
+ amountShow?: number;
86
+ voucherValue: number | null;
87
+ monthCompletionValue?: number;
88
+ minAmount?: number;
89
+ maxMonths: number;
90
+ approximateMonthlyTotalResponse?: object;
91
+ subscriptionData?: MonthlyData;
92
+ handleOpenSubscriptionRewardPopup: () => void;
93
+ notQualifyForRewardThisMonth: boolean;
94
+ translationConfig?: TranslationConfig;
95
+ learnMoreConfig?: LearnMoreConfig;
96
+ currencyAbbreviate?: boolean;
97
+ currencyFormat?: (price: number, currencyWithoutDecimal: boolean, currencyAbbreviate: boolean) => void;
98
+ };
@@ -0,0 +1,2 @@
1
+ declare function Info(): import("react/jsx-runtime").JSX.Element;
2
+ export default Info;
@@ -0,0 +1 @@
1
+ export default function PromoLayoutIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ declare function SubscriptionVoucherIcon(): import("react/jsx-runtime").JSX.Element;
2
+ export default SubscriptionVoucherIcon;
@@ -0,0 +1,2 @@
1
+ declare function SubscriptionVoucherIconGrey(): import("react/jsx-runtime").JSX.Element;
2
+ export default SubscriptionVoucherIconGrey;
@@ -0,0 +1,3 @@
1
+ export { default as PromoLayoutIcon } from './PromoLayoutIcon';
2
+ export * from './SubscriptionVoucherIcon';
3
+ export * from './Info';
@@ -0,0 +1,3 @@
1
+ import { ReactElement } from 'react';
2
+ declare const SampleComponent: () => ReactElement;
3
+ export default SampleComponent;
@@ -0,0 +1,3 @@
1
+ import { RewardBannerProps } from './types';
2
+ declare const SubscriptionRewardBanner: (props: RewardBannerProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default SubscriptionRewardBanner;
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ export declare const SubscriptionRewardContainer: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const CardImage: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
10
+ export declare const CardContent: import("@emotion/styled").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
13
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
14
+ export declare const CardHeader: import("@emotion/styled").StyledComponent<{
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
17
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
18
+ export declare const CardText: import("@emotion/styled").StyledComponent<{
19
+ theme?: import("@emotion/react").Theme | undefined;
20
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
21
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
22
+ export declare const CardButton: import("@emotion/styled").StyledComponent<{
23
+ theme?: import("@emotion/react").Theme | undefined;
24
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
25
+ }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
26
+ export declare const CardLogo: import("@emotion/styled").StyledComponent<{
27
+ theme?: import("@emotion/react").Theme | undefined;
28
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
29
+ }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
@@ -0,0 +1 @@
1
+ export { default as SubscriptionRewardBanner } from './SubscriptionRewardBanner';
@@ -0,0 +1,20 @@
1
+ export type RewardBannerProps = {
2
+ translationConfig: {
3
+ header: string;
4
+ body: string;
5
+ learnMore: string;
6
+ loyaltyLogoBlack: string;
7
+ loyaltyBanner: string;
8
+ };
9
+ learnMoreConfig: {
10
+ tagLine: string;
11
+ cardOneDescription: string;
12
+ cardOneVoucherAmount: string;
13
+ cardTwoDescription: string;
14
+ cardTwoVoucherAmount: string;
15
+ header: string;
16
+ loyaltyLogoWhite: string;
17
+ loyaltyBanner: string;
18
+ learnMore: string;
19
+ };
20
+ };
@@ -0,0 +1,2 @@
1
+ import { RewardModalProps } from './types';
2
+ export default function SubscriptionRewardModal(props: RewardModalProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,40 @@
1
+ /// <reference types="react" />
2
+ export declare const SubscriptionRewardPopup: import("@emotion/styled").StyledComponent<import("@nuskin/foundation-ui-components").NsModalProps & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ }, {}, {}>;
5
+ export declare const ModalBody: import("@emotion/styled").StyledComponent<{
6
+ theme?: import("@emotion/react").Theme | undefined;
7
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
8
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
9
+ export declare const SubscriptionRewardImg: import("@emotion/styled").StyledComponent<{
10
+ theme?: import("@emotion/react").Theme | undefined;
11
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
12
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
13
+ export declare const VoucherDiv: import("@emotion/styled").StyledComponent<{
14
+ theme?: import("@emotion/react").Theme | undefined;
15
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
16
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
17
+ export declare const VoucherHeading: import("@emotion/styled").StyledComponent<{
18
+ theme?: import("@emotion/react").Theme | undefined;
19
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
20
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
21
+ export declare const VoucherIcon: import("@emotion/styled").StyledComponent<{
22
+ theme?: import("@emotion/react").Theme | undefined;
23
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
24
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
25
+ export declare const VoucherDescription: import("@emotion/styled").StyledComponent<{
26
+ theme?: import("@emotion/react").Theme | undefined;
27
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
28
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
29
+ export declare const Footer: import("@emotion/styled").StyledComponent<{
30
+ theme?: import("@emotion/react").Theme | undefined;
31
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
32
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
33
+ export declare const HeaderDescription: import("@emotion/styled").StyledComponent<{
34
+ theme?: import("@emotion/react").Theme | undefined;
35
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
36
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
37
+ export declare const HeaderSection: import("@emotion/styled").StyledComponent<{
38
+ theme?: import("@emotion/react").Theme | undefined;
39
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
40
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1 @@
1
+ export { default as SubscriptionRewardModal } from './SubscriptionRewardModal';
@@ -0,0 +1,21 @@
1
+ export type RewardModalProps = {
2
+ amountShow?: number | string;
3
+ show: boolean;
4
+ close: () => void;
5
+ bannerImage?: string;
6
+ translationConfig: {
7
+ header?: string;
8
+ };
9
+ learnMoreConfig: {
10
+ header?: string;
11
+ learnMore: string;
12
+ learnMoreLink?: string | undefined;
13
+ cardTwoDescription: string;
14
+ cardTwoVoucherAmount: string;
15
+ cardOneDescription: string;
16
+ cardOneVoucherAmount: string;
17
+ tagLine: string;
18
+ loyaltyLogoWhite: string;
19
+ loyaltyBanner: string;
20
+ };
21
+ };
@@ -0,0 +1,14 @@
1
+ declare const IS_BROWSER: boolean;
2
+ declare class ApplicationStore {
3
+ width: number;
4
+ scroll: {
5
+ vertical: number;
6
+ horizontal: number;
7
+ direction: string;
8
+ };
9
+ get isMobile(): boolean;
10
+ get isPhone(): boolean;
11
+ }
12
+ declare const applicationContainer: ApplicationStore;
13
+ export { IS_BROWSER, ApplicationStore, applicationContainer, applicationContainer as application };
14
+ export default applicationContainer;
@@ -0,0 +1,2 @@
1
+ export * from './application';
2
+ export { default } from './application';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const replacePlaceholders: (template: string, values: {
2
+ [key: string]: string | number | null;
3
+ }) => string;
4
+ export declare const currencySymbol: () => string;
File without changes
@@ -0,0 +1 @@
1
+ export * from './SampleComponent';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(r){if(Array.isArray(r))return r}function t(r,e){var t=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t==null)return;var n=[];var o=true;var u=false;var i,a;try{for(t=t.call(r);!(o=(i=t.next()).done);o=true){n.push(i.value);if(e&&n.length===e)break}}catch(r){u=true;a=r}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(u)throw a}}return n}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(r,o){return e(r)||t(r,o)||i(r,o)||n()}function u(r){"@swc/helpers - typeof";return r&&typeof Symbol!=="undefined"&&r.constructor===Symbol?"symbol":typeof r}function i(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var s=function(r,e){for(var t in e)a(r,t,{get:e[t],enumerable:!0})},y=function(r,e,t,n){var o=true,i=false,s=undefined;if(e&&(typeof e==="undefined"?"undefined":u(e))=="object"||typeof e=="function")try{var y=function(){var o=d.value;!f.call(r,o)&&o!==t&&a(r,o,{get:function(){return e[o]},enumerable:!(n=l(e,o))||n.enumerable})};for(var p=c(e)[Symbol.iterator](),d;!(o=(d=p.next()).done);o=true)y()}catch(r){i=true;s=r}finally{try{if(!o&&p.return!=null){p.return()}}finally{if(i){throw s}}}return r};var p=function(r){return y(a({},"__esModule",{value:!0}),r)};var d={};s(d,{SampleComponent:function(){return j}});module.exports=p(d);var m=require("react"),v=require("@nuskin/foundation-ui-components"),b=require("react/jsx-runtime"),h=function(){var r=o((0,m.useState)(0),2),e=r[0],t=r[1];return(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{children:"Sample Component"}),(0,b.jsxs)("p",{children:["Count: ",e]}),(0,b.jsx)(v.NsButton,{onClick:function(){return t(e+1)},children:"Increment"}),(0,b.jsx)(v.NsButton,{onClick:function(){return t(e-1)},children:"Decrement"})]})},j=h;//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/gitlab-runner-data/builds/nextgen-development/loyalty/npm/react-loyalty-elements/dist/index.js","../src/index.ts","../src/SampleComponent/SampleComponent.tsx"],"names":["p","Object","defineProperty","l","getOwnPropertyDescriptor","s","getOwnPropertyNames","C","prototype","hasOwnProperty","f","e","t","m","get","enumerable","i","u","n","call","d","value","index_exports","__export","SampleComponent","SampleComponent_default","module","exports","__toCommonJS","import_react","require","import_foundation_ui_components","import_jsx_runtime","a","useState","count","setCount","o","jsxs","children","jsx","r","NsButton","onClick"],"mappings":"AAAA,moCAAa,IAAIA,EAAEC,OAAOC,cAAc,CAAC,IAAIC,EAAEF,OAAOG,wBAAwB,CAAC,IAAIC,EAAEJ,OAAOK,mBAAmB,CAAC,IAAIC,EAAEN,OAAOO,SAAS,CAACC,cAAc,CAAC,IAAIC,EAAE,SAACC,EAAEC,GAAK,IAAI,IAAIC,KAAKD,EAAEZ,EAAEW,EAAEE,EAAE,CAACC,IAAIF,CAAC,CAACC,EAAE,CAACE,WAAW,CAAC,CAAC,EAAE,EAAEC,EAAE,SAACL,EAAEC,EAAEC,EAAEI,OAAwD,OAAA,QAAA,YAAnD,GAAGL,GAAG,CAAA,OAAOA,4BAAP,EAAOA,EAAAA,GAAG,UAAU,OAAOA,GAAG,gCAAe,IAAIM,EAAJ,OAAc,EAACX,EAAEY,IAAI,CAACR,EAAEO,IAAIA,IAAIL,GAAGb,EAAEW,EAAEO,EAAE,CAACJ,IAAI,kBAAIF,CAAC,CAACM,EAAE,EAACH,WAAW,CAAEE,CAAAA,EAAEd,EAAES,EAAEM,EAAC,GAAID,EAAEF,UAAU,IAA/F,QAAI,EAASV,EAAEO,sBAAX,IAAA,GAAA,EAAA,gBAAA,oBAAA,OAAA,oBAAA,GAAA,gBAAA,uBAAA,SAAA,IAA8F,OAAOD,CAAC,EAAE,IAAIS,EAAET,SAAAA,UAAGK,EAAEhB,EAAE,CAAC,EAAE,aAAa,CAACqB,MAAM,CAAC,CAAC,GAAGV,ICAta,IAAAW,EAAA,CAAA,EAAAC,EAAAD,EAAA,CAAAE,gBAAA,kBAAAC,EAAAA,EAAAC,CAAAA,OAAAC,OAAA,CAAAC,EAAAN,GCAA,IAAAO,EAA8CC,QAAA,SAC9CC,EAAyBD,QAAA,oCAMbE,EAAAF,QAAA,qBAJNN,EAAkB,WACpB,IAAsB,IAAA,CAAA,EAAIS,EAAAC,QAAA,EAAiB,MAApCC,EAAe,KAARC,EAAQ,KACtB,MAAA,CAAA,EACIC,EAAAC,IAAA,EAAC,MAAA,CACGC,SAAA,CAAA,CAAA,EAAAF,EAAAG,GAAA,EAAC,KAAA,CAAGD,SAAA,kBAAA,GAAgB,CAAA,EACpBF,EAAAC,IAAA,EAAC,IAAA,CAAEC,SAAA,CAAA,UAAQJ,EAAAA,GAAM,CAAA,EACjBE,EAAAG,GAAA,EAACC,EAAAC,QAAA,CAAA,CAASC,QAAS,kBAAMP,EAASD,EAAQ,IAAII,SAAA,WAAA,GAAS,CAAA,EACvDF,EAAAG,GAAA,EAACC,EAAAC,QAAA,CAAA,CAASC,QAAS,kBAAMP,EAASD,EAAQ,IAAII,SAAA,WAAA,GAAS,EAGnE,EACOd,EAAQD","sourcesContent":["\"use strict\";var p=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var m in t)p(e,m,{get:t[m],enumerable:!0})},i=(e,t,m,u)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let n of s(t))!C.call(e,n)&&n!==m&&p(e,n,{get:()=>t[n],enumerable:!(u=l(t,n))||u.enumerable});return e};var d=e=>i(p({},\"__esModule\",{value:!0}),e);var B={};f(B,{SampleComponent:()=>c});module.exports=d(B);var a=require(\"react\"),r=require(\"@nuskin/foundation-ui-components\"),o=require(\"react/jsx-runtime\"),S=()=>{let[e,t]=(0,a.useState)(0);return(0,o.jsxs)(\"div\",{children:[(0,o.jsx)(\"h1\",{children:\"Sample Component\"}),(0,o.jsxs)(\"p\",{children:[\"Count: \",e]}),(0,o.jsx)(r.NsButton,{onClick:()=>t(e+1),children:\"Increment\"}),(0,o.jsx)(r.NsButton,{onClick:()=>t(e-1),children:\"Decrement\"})]})},c=S;\n","export * from './SampleComponent';\n","import React, { ReactElement, useState } from 'react';\nimport { NsButton } from '@nuskin/foundation-ui-components';\n\nconst SampleComponent = (): ReactElement => {\n const [count, setCount] = useState<number>(0);\n return (\n <div>\n <h1>Sample Component</h1>\n <p>Count: {count}</p>\n <NsButton onClick={() => setCount(count + 1)}>Increment</NsButton>\n <NsButton onClick={() => setCount(count - 1)}>Decrement</NsButton>\n </div>\n );\n};\nexport default SampleComponent;\n"]}
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ function r(r,t){if(t==null||t>r.length)t=r.length;for(var n=0,e=new Array(t);n<t;n++)e[n]=r[n];return e}function t(r){if(Array.isArray(r))return r}function n(r,t){var n=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(n==null)return;var e=[];var o=true;var i=false;var a,u;try{for(n=n.call(r);!(o=(a=n.next()).done);o=true){e.push(a.value);if(t&&e.length===t)break}}catch(r){i=true;u=r}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(i)throw u}}return e}function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(r,o){return t(r)||n(r,o)||i(r,o)||e()}function i(t,n){if(!t)return;if(typeof t==="string")return r(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor)e=t.constructor.name;if(e==="Map"||e==="Set")return Array.from(e);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return r(t,n)}import{useState as a}from"react";import{NsButton as u}from"@nuskin/foundation-ui-components";import{jsx as l,jsxs as c}from"react/jsx-runtime";var f=function(){var r=o(a(0),2),t=r[0],n=r[1];return c("div",{children:[l("h1",{children:"Sample Component"}),c("p",{children:["Count: ",t]}),l(u,{onClick:function(){return n(t+1)},children:"Increment"}),l(u,{onClick:function(){return n(t-1)},children:"Decrement"})]})},s=f;export{s as SampleComponent};//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/SampleComponent/SampleComponent.tsx"],"names":["useState","NsButton","jsx","jsxs","SampleComponent","count","setCount","children","onClick","SampleComponent_default"],"mappings":"ggCAAA,OAA8BA,YAAAA,CAAAA,KAAgB,OAC9C,QAASC,YAAAA,CAAAA,KAAgB,kCAMb,QAAAC,OAAAA,CAAAA,CACAC,QAAAA,CAAAA,KADA,mBAJZ,CAAA,IAAMC,EAAkB,WACpB,IAA0BJ,IAAAA,EAAiB,MAApCK,EAAmBL,KAAZM,EAAYN,KAC1B,OACIG,EAAC,MAAA,CACGI,SAAA,CAAAL,EAAC,KAAA,CAAGK,SAAA,kBAAA,GACJJ,EAAC,IAAA,CAAEI,SAAA,CAAA,UAAQF,EAAAA,GACXH,EAACD,EAAA,CAASO,QAAS,kBAAMF,EAASD,EAAQ,IAAIE,SAAA,WAAA,GAC9CL,EAACD,EAAA,CAASO,QAAS,kBAAMF,EAASD,EAAQ,IAAIE,SAAA,WAAA,GAAS,EAGnE,EACOE,EAAQL,SAAAA,KAAAA,eAAAA","sourcesContent":["import React, { ReactElement, useState } from 'react';\nimport { NsButton } from '@nuskin/foundation-ui-components';\n\nconst SampleComponent = (): ReactElement => {\n const [count, setCount] = useState<number>(0);\n return (\n <div>\n <h1>Sample Component</h1>\n <p>Count: {count}</p>\n <NsButton onClick={() => setCount(count + 1)}>Increment</NsButton>\n <NsButton onClick={() => setCount(count - 1)}>Decrement</NsButton>\n </div>\n );\n};\nexport default SampleComponent;\n"]}
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@nuskin/react-loyalty-elements",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A React based component library for reusable Nextgen Loyalty component",
5
- "main": "src/common/index.ts",
5
+ "types": "dist/index.d.ts",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.esm.js",
6
8
  "repository": {
7
9
  "type": "git",
8
10
  "url": "git@code.tls.nuskin.io:nextgen-development/loyalty/npm/react-loyalty-elements.git"
@@ -19,18 +21,21 @@
19
21
  ],
20
22
  "license": "MIT",
21
23
  "scripts": {
22
- "lint": "eslint",
24
+ "build:package": "tsup",
25
+ "lint": "eslint src",
23
26
  "test": "jest --coverage",
24
27
  "test:watch": "jest --watch",
25
28
  "test:update-snapshot": "jest -u",
26
29
  "test:failed": "npx jest --onlyFailures",
27
30
  "test:coverage": "jest --coverage",
28
- "types:check": "tsc --pretty --noEmit"
31
+ "types:check": "tsc --pretty"
29
32
  },
30
33
  "dependencies": {
31
34
  "@types/react": "^18.2.0",
32
35
  "@types/react-dom": "^18.2.0",
33
- "react-dom": "^18.2.0"
36
+ "react-circular-progressbar": "^2.1.0",
37
+ "react-dom": "^18.2.0",
38
+ "react-icons": "^4.0.0"
34
39
  },
35
40
  "devDependencies": {
36
41
  "@babel/core": "^7.23.2",
@@ -38,36 +43,49 @@
38
43
  "@babel/preset-react": "^7.22.15",
39
44
  "@babel/preset-typescript": "^7.23.2",
40
45
  "@nuskin/eslint-config": "^1.0.0-setup.1",
41
- "@nuskin/foundation-ui-components": "1.32.1-cdb-1.2",
42
- "@testing-library/dom": "^9.3.3",
43
- "@testing-library/jest-dom": "^6.1.4",
44
- "@testing-library/react": "^14.0.0",
46
+ "@nuskin/foundation-ui-components": "2.0.0",
47
+ "@swc/core": "1.10.15",
48
+ "@testing-library/dom": "10.4.0",
49
+ "@testing-library/jest-dom": "^6.6.3",
50
+ "@testing-library/react": "16.2.0",
45
51
  "@types/jest": "^29.5.7",
46
52
  "@types/lodash": "^4.14.200",
47
53
  "@types/node": "^20.8.7",
48
54
  "@types/react-test-renderer": "^18.0.5",
55
+ "@typescript-eslint/eslint-plugin": "^8.28.0",
56
+ "@typescript-eslint/parser": "^8.28.0",
49
57
  "babel-jest": "^29.7.0",
50
58
  "babel-loader": "^9.1.3",
51
59
  "babel-plugin-emotion": "^11.0.0",
52
60
  "eslint": "^8.51.0",
53
- "eslint-config-prettier": "^9.0.0",
61
+ "eslint-config-prettier": "^10.1.1",
54
62
  "eslint-plugin-json": "^3.1.0",
55
- "eslint-plugin-prettier": "^5.0.1",
63
+ "eslint-plugin-prettier": "^5.2.4",
64
+ "eslint-plugin-react": "^7.37.4",
65
+ "eslint-plugin-spellcheck": "^0.0.20",
66
+ "eslint-plugin-unused-imports": "^4.1.4",
56
67
  "jest": "^29.7.0",
57
68
  "jest-environment-jsdom": "^29.7.0",
69
+ "prettier": "^3.5.3",
58
70
  "react": "^18.2.0",
71
+ "tsup": "8.3.6",
59
72
  "typescript": "^5.4.2"
60
73
  },
61
74
  "peerDependencies": {
62
- "@nuskin/foundation-ui-components": "1.32.1-cdb-1.2",
75
+ "@nuskin/foundation-ui-components": "2.0.0",
63
76
  "react": "^18.2.0",
64
77
  "typescript": "^5.4.2"
65
78
  },
66
79
  "resolutions": {
67
- "@nuskin/foundation-theme": "1.6.1-cdb-1.1"
80
+ "@nuskin/foundation-theme": "1.7.0",
81
+ "esbuild": "0.25.0",
82
+ "@babel/runtime": "7.26.10",
83
+ "@babel/helpers": "7.26.10"
68
84
  },
69
85
  "files": [
70
- "src"
86
+ "dist",
87
+ "README.md",
88
+ "package.json"
71
89
  ],
72
90
  "readme": "./README.md"
73
91
  }
@@ -1,27 +0,0 @@
1
- import React from 'react';
2
- import { render, screen, fireEvent } from '@testing-library/react';
3
- import SampleComponent from './SampleComponent';
4
-
5
- describe('NsInputField', () => {
6
- it('should render component', () => {
7
- render(<SampleComponent />);
8
- const sampleComponent = screen.getByText('Sample Component');
9
- expect(sampleComponent).toBeTruthy();
10
- });
11
-
12
- it('should increment count', () => {
13
- render(<SampleComponent />);
14
- const incrementButton = screen.getByText('Increment');
15
- fireEvent.click(incrementButton);
16
- const count = screen.getByText('Count: 1');
17
- expect(count).toBeTruthy();
18
- });
19
-
20
- it('should decrement count', () => {
21
- render(<SampleComponent />);
22
- const decrementButton = screen.getByText('Decrement');
23
- fireEvent.click(decrementButton);
24
- const count = screen.getByText('Count: -1');
25
- expect(count).toBeTruthy();
26
- });
27
- });
@@ -1,16 +0,0 @@
1
- import React, { ReactElement, useState } from 'react';
2
- import { NsButton } from '@nuskin/foundation-ui-components';
3
-
4
- const SampleComponent = (): ReactElement => {
5
- const [count, setCount] = useState<number>(0);
6
-
7
- return (
8
- <div>
9
- <h1>Sample Component</h1>
10
- <p>Count: {count}</p>
11
- <NsButton onClick={() => setCount(count + 1)}>Increment</NsButton>
12
- <NsButton onClick={() => setCount(count - 1)}>Decrement</NsButton>
13
- </div>
14
- );
15
- };
16
- export default SampleComponent;
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './SampleComponent';