@moneylion/react-native-offer-carousel 1.0.6 → 1.0.8
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/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Brand.js +45 -9
- package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -1
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/components.js +2 -2
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/components.js.map +1 -1
- package/lib/commonjs/components/Button/index.js +4 -21
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Common/BaseOfferCard/Stat/Stat.js +4 -4
- package/lib/commonjs/components/Common/BaseOfferCard/Stat/Stat.js.map +1 -1
- package/lib/commonjs/components/Common/BaseOfferCard/index.js +12 -11
- package/lib/commonjs/components/Common/BaseOfferCard/index.js.map +1 -1
- package/lib/commonjs/components/Common/DynamicOfferCard/CallToAction.js +2 -0
- package/lib/commonjs/components/Common/DynamicOfferCard/CallToAction.js.map +1 -1
- package/lib/commonjs/components/Common/DynamicOfferCard/SeeMore.js +1 -1
- package/lib/commonjs/components/Common/DynamicOfferCard/SeeMore.js.map +1 -1
- package/lib/commonjs/components/Common/DynamicOfferCard/index.js +1 -0
- package/lib/commonjs/components/Common/DynamicOfferCard/index.js.map +1 -1
- package/lib/commonjs/components/Layouts/CreditCardOfferCard/index.js +2 -1
- package/lib/commonjs/components/Layouts/CreditCardOfferCard/index.js.map +1 -1
- package/lib/commonjs/components/Modal/DescriptionPoints.js +2 -2
- package/lib/commonjs/components/Modal/DescriptionPoints.js.map +1 -1
- package/lib/commonjs/components/Modal/Disclaimer.js +2 -2
- package/lib/commonjs/components/Modal/Disclaimer.js.map +1 -1
- package/lib/commonjs/components/Modal/OfferDetailsModal.js +6 -2
- package/lib/commonjs/components/Modal/OfferDetailsModal.js.map +1 -1
- package/lib/commonjs/components/MoneyLionOfferCarousel.js +12 -14
- package/lib/commonjs/components/MoneyLionOfferCarousel.js.map +1 -1
- package/lib/commonjs/components/Text/index.js +18 -38
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/View/index.js +10 -94
- package/lib/commonjs/components/View/index.js.map +1 -1
- package/lib/commonjs/config/mocks/cnfContext.js +44 -8
- package/lib/commonjs/config/mocks/cnfContext.js.map +1 -1
- package/lib/commonjs/context/ThemeProvider.js +2 -2
- package/lib/commonjs/context/ThemeProvider.js.map +1 -1
- package/lib/commonjs/services/getDynamicOffers.js +7 -2
- package/lib/commonjs/services/getDynamicOffers.js.map +1 -1
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Brand.js +45 -9
- package/lib/module/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -1
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/components.js +2 -3
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/components.js.map +1 -1
- package/lib/module/components/Button/index.js +4 -21
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Common/BaseOfferCard/Stat/Stat.js +4 -4
- package/lib/module/components/Common/BaseOfferCard/Stat/Stat.js.map +1 -1
- package/lib/module/components/Common/BaseOfferCard/index.js +12 -11
- package/lib/module/components/Common/BaseOfferCard/index.js.map +1 -1
- package/lib/module/components/Common/DynamicOfferCard/CallToAction.js +2 -0
- package/lib/module/components/Common/DynamicOfferCard/CallToAction.js.map +1 -1
- package/lib/module/components/Common/DynamicOfferCard/SeeMore.js +1 -1
- package/lib/module/components/Common/DynamicOfferCard/SeeMore.js.map +1 -1
- package/lib/module/components/Common/DynamicOfferCard/index.js +1 -0
- package/lib/module/components/Common/DynamicOfferCard/index.js.map +1 -1
- package/lib/module/components/Layouts/CreditCardOfferCard/index.js +2 -1
- package/lib/module/components/Layouts/CreditCardOfferCard/index.js.map +1 -1
- package/lib/module/components/Modal/DescriptionPoints.js +2 -2
- package/lib/module/components/Modal/DescriptionPoints.js.map +1 -1
- package/lib/module/components/Modal/Disclaimer.js +2 -2
- package/lib/module/components/Modal/Disclaimer.js.map +1 -1
- package/lib/module/components/Modal/OfferDetailsModal.js +6 -2
- package/lib/module/components/Modal/OfferDetailsModal.js.map +1 -1
- package/lib/module/components/MoneyLionOfferCarousel.js +12 -14
- package/lib/module/components/MoneyLionOfferCarousel.js.map +1 -1
- package/lib/module/components/Text/index.js +17 -38
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/View/index.js +11 -95
- package/lib/module/components/View/index.js.map +1 -1
- package/lib/module/config/mocks/cnfContext.js +44 -8
- package/lib/module/config/mocks/cnfContext.js.map +1 -1
- package/lib/module/context/ThemeProvider.js +2 -2
- package/lib/module/context/ThemeProvider.js.map +1 -1
- package/lib/module/services/getDynamicOffers.js +7 -2
- package/lib/module/services/getDynamicOffers.js.map +1 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts +90 -18
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts.map +1 -1
- package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/components.d.ts +3 -2
- package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/components.d.ts.map +1 -1
- package/lib/typescript/src/components/Button/index.d.ts +3 -3
- package/lib/typescript/src/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts +2 -2
- package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/CallToAction.d.ts +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/CallToAction.d.ts.map +1 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Layouts/CreditCardOfferCard/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Modal/Disclaimer.d.ts.map +1 -1
- package/lib/typescript/src/components/Modal/OfferDetailsModal.d.ts.map +1 -1
- package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts +1 -0
- package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts.map +1 -1
- package/lib/typescript/src/components/Text/index.d.ts +2 -2
- package/lib/typescript/src/components/Text/index.d.ts.map +1 -1
- package/lib/typescript/src/components/View/index.d.ts +4 -2
- package/lib/typescript/src/components/View/index.d.ts.map +1 -1
- package/lib/typescript/src/config/mocks/cnfContext.d.ts.map +1 -1
- package/lib/typescript/src/context/ThemeProvider.d.ts +47 -11
- package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
- package/lib/typescript/src/services/getDynamicOffers.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/capabilities/core/src/system/cnfContext/schemas/Brand.ts +46 -10
- package/src/capabilities/ui/elements/src/components/MarkdownText/components.tsx +4 -4
- package/src/components/Button/index.tsx +7 -20
- package/src/components/Common/BaseOfferCard/Stat/Stat.tsx +4 -4
- package/src/components/Common/BaseOfferCard/index.tsx +32 -13
- package/src/components/Common/DynamicOfferCard/CallToAction.tsx +2 -0
- package/src/components/Common/DynamicOfferCard/SeeMore.tsx +1 -1
- package/src/components/Common/DynamicOfferCard/index.tsx +1 -0
- package/src/components/Layouts/CreditCardOfferCard/index.tsx +2 -1
- package/src/components/Modal/DescriptionPoints.tsx +2 -2
- package/src/components/Modal/Disclaimer.tsx +6 -2
- package/src/components/Modal/OfferDetailsModal.tsx +11 -6
- package/src/components/MoneyLionOfferCarousel.tsx +16 -11
- package/src/components/Text/index.tsx +10 -45
- package/src/components/View/index.tsx +13 -66
- package/src/config/mocks/cnfContext.ts +44 -8
- package/src/context/ThemeProvider.tsx +51 -14
- package/src/services/getDynamicOffers.ts +7 -2
- package/lib/commonjs/utils/getDefaultPaletteColor.js +0 -20
- package/lib/commonjs/utils/getDefaultPaletteColor.js.map +0 -1
- package/lib/module/utils/getDefaultPaletteColor.js +0 -13
- package/lib/module/utils/getDefaultPaletteColor.js.map +0 -1
- package/lib/typescript/src/utils/getDefaultPaletteColor.d.ts +0 -3
- package/lib/typescript/src/utils/getDefaultPaletteColor.d.ts.map +0 -1
- package/src/utils/getDefaultPaletteColor.ts +0 -15
|
@@ -7,15 +7,52 @@ import React, {
|
|
|
7
7
|
} from "react";
|
|
8
8
|
import { Platform } from "react-native";
|
|
9
9
|
|
|
10
|
-
export interface
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
export interface ThemeColors {
|
|
11
|
+
backgroundPrimary: string;
|
|
12
|
+
backgroundPrimaryFaded: string;
|
|
13
|
+
backgroundPrimaryHighlighted: string;
|
|
14
|
+
backgroundCritical: string;
|
|
15
|
+
backgroundCriticalFaded: string;
|
|
16
|
+
backgroundCriticalHighlighted: string;
|
|
17
|
+
backgroundWarning: string;
|
|
18
|
+
backgroundWarningFaded: string;
|
|
19
|
+
backgroundWarningHighlighted: string;
|
|
20
|
+
backgroundPositive: string;
|
|
21
|
+
backgroundPositiveFaded: string;
|
|
22
|
+
backgroundPositiveHighlighted: string;
|
|
23
|
+
backgroundNeutral: string;
|
|
24
|
+
backgroundNeutralFaded: string;
|
|
25
|
+
backgroundNeutralHighlighted: string;
|
|
26
|
+
backgroundDisabled: string;
|
|
27
|
+
backgroundDisabledFaded: string;
|
|
28
|
+
backgroundElevationBase: string;
|
|
29
|
+
backgroundElevationRaised: string;
|
|
30
|
+
backgroundElevationOverlay: string;
|
|
31
|
+
backgroundPage: string;
|
|
32
|
+
backgroundPageFaded: string;
|
|
33
|
+
borderPrimary: string;
|
|
34
|
+
borderPrimaryFaded: string;
|
|
35
|
+
borderCritical: string;
|
|
36
|
+
borderCriticalFaded: string;
|
|
37
|
+
borderWarning: string;
|
|
38
|
+
borderWarningFaded: string;
|
|
39
|
+
borderPositive: string;
|
|
40
|
+
borderPositiveFaded: string;
|
|
41
|
+
borderNeutral: string;
|
|
42
|
+
borderNeutralFaded: string;
|
|
43
|
+
borderDisabled: string;
|
|
44
|
+
foregroundPrimary: string;
|
|
45
|
+
foregroundCritical: string;
|
|
46
|
+
foregroundWarning: string;
|
|
47
|
+
foregroundPositive: string;
|
|
48
|
+
foregroundNeutral: string;
|
|
49
|
+
foregroundNeutralFaded: string;
|
|
50
|
+
foregroundDisabled: string;
|
|
51
|
+
brand: string;
|
|
52
|
+
white: string;
|
|
53
|
+
black: string;
|
|
18
54
|
}
|
|
55
|
+
|
|
19
56
|
export interface FontFamily {
|
|
20
57
|
normal?: string;
|
|
21
58
|
medium?: string;
|
|
@@ -29,9 +66,9 @@ const defaultFontFamily: FontFamily = {
|
|
|
29
66
|
};
|
|
30
67
|
|
|
31
68
|
interface ThemeContextType {
|
|
32
|
-
theme:
|
|
69
|
+
theme: ThemeColors;
|
|
33
70
|
fontFamily: FontFamily;
|
|
34
|
-
updateTheme: (newTheme: Partial<
|
|
71
|
+
updateTheme: (newTheme: Partial<ThemeColors>) => void;
|
|
35
72
|
updateFontFamily: (newFontFamily: Partial<FontFamily>) => void;
|
|
36
73
|
}
|
|
37
74
|
|
|
@@ -46,23 +83,23 @@ export const useTheme = () => {
|
|
|
46
83
|
};
|
|
47
84
|
|
|
48
85
|
interface ThemeProviderProps {
|
|
49
|
-
|
|
86
|
+
themeColors?: ThemeColors;
|
|
50
87
|
fontFamily?: Partial<FontFamily>;
|
|
51
88
|
children: ReactNode;
|
|
52
89
|
}
|
|
53
90
|
|
|
54
91
|
export const ThemeProvider: FC<ThemeProviderProps> = ({
|
|
55
|
-
|
|
92
|
+
themeColors = {} as ThemeColors, // should be safe to assert as ThemePalette since the fallback colors are already handled by the consumers of ThemeProvider
|
|
56
93
|
fontFamily = {},
|
|
57
94
|
children,
|
|
58
95
|
}) => {
|
|
59
|
-
const [theme, setTheme] = useState<
|
|
96
|
+
const [theme, setTheme] = useState<ThemeColors>(themeColors);
|
|
60
97
|
const [fonts, setFonts] = useState<FontFamily>({
|
|
61
98
|
...defaultFontFamily,
|
|
62
99
|
...fontFamily,
|
|
63
100
|
});
|
|
64
101
|
|
|
65
|
-
const updateTheme = (newTheme: Partial<
|
|
102
|
+
const updateTheme = (newTheme: Partial<ThemeColors>) => {
|
|
66
103
|
setTheme((prevTheme) => ({
|
|
67
104
|
...prevTheme,
|
|
68
105
|
...newTheme,
|
|
@@ -63,12 +63,17 @@ export const getDynamicOffers = async ({
|
|
|
63
63
|
context,
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
//
|
|
66
|
+
// if no offers are returned, we need to get the offers for the default product type
|
|
67
|
+
if (isEmpty(initialOffersData?.offers)) {
|
|
68
|
+
// Set the productTypes to be defaultProductType
|
|
69
|
+
productTypes = [defaultProductType];
|
|
70
|
+
}
|
|
71
|
+
|
|
67
72
|
// if initial offers are returned, return them
|
|
68
73
|
const offersData = isEmpty(initialOffersData?.offers)
|
|
69
74
|
? await getOffersByProductTypes({
|
|
70
75
|
enableUseCachedOffers,
|
|
71
|
-
productTypes
|
|
76
|
+
productTypes,
|
|
72
77
|
tags,
|
|
73
78
|
context,
|
|
74
79
|
})
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getDefaultPaletteColor = void 0;
|
|
7
|
-
const getDefaultPaletteColor = colorKey => {
|
|
8
|
-
const defaultColors = {
|
|
9
|
-
positive: "#00E5C4"
|
|
10
|
-
// promotional: "#FFD700",
|
|
11
|
-
// generation: "#4CAF50",
|
|
12
|
-
// colorScheme: "#9E9E9E",
|
|
13
|
-
// critical: "#FF0000",
|
|
14
|
-
// highlight: "#FFA500",
|
|
15
|
-
// neutral: "#808080",
|
|
16
|
-
};
|
|
17
|
-
return defaultColors[colorKey] ?? "#000000"; // subject to change
|
|
18
|
-
};
|
|
19
|
-
exports.getDefaultPaletteColor = getDefaultPaletteColor;
|
|
20
|
-
//# sourceMappingURL=getDefaultPaletteColor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getDefaultPaletteColor","colorKey","defaultColors","positive","exports"],"sourceRoot":"../../../src","sources":["utils/getDefaultPaletteColor.ts"],"mappings":";;;;;;AAEO,MAAMA,sBAAsB,GAAIC,QAAgB,IAAa;EACnE,MAAMC,aAA8C,GAAG;IACtDC,QAAQ,EAAE;IACV;IACA;IACA;IACA;IACA;IACA;EACD,CAAC;EAED,OAAOD,aAAa,CAACD,QAAQ,CAAC,IAAI,SAAS,CAAC,CAAC;AAC9C,CAAC;AAACG,OAAA,CAAAJ,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const getDefaultPaletteColor = colorKey => {
|
|
2
|
-
const defaultColors = {
|
|
3
|
-
positive: "#00E5C4"
|
|
4
|
-
// promotional: "#FFD700",
|
|
5
|
-
// generation: "#4CAF50",
|
|
6
|
-
// colorScheme: "#9E9E9E",
|
|
7
|
-
// critical: "#FF0000",
|
|
8
|
-
// highlight: "#FFA500",
|
|
9
|
-
// neutral: "#808080",
|
|
10
|
-
};
|
|
11
|
-
return defaultColors[colorKey] ?? "#000000"; // subject to change
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=getDefaultPaletteColor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getDefaultPaletteColor","colorKey","defaultColors","positive"],"sourceRoot":"../../../src","sources":["utils/getDefaultPaletteColor.ts"],"mappings":"AAEA,OAAO,MAAMA,sBAAsB,GAAIC,QAAgB,IAAa;EACnE,MAAMC,aAA8C,GAAG;IACtDC,QAAQ,EAAE;IACV;IACA;IACA;IACA;IACA;IACA;EACD,CAAC;EAED,OAAOD,aAAa,CAACD,QAAQ,CAAC,IAAI,SAAS,CAAC,CAAC;AAC9C,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultPaletteColor.d.ts","sourceRoot":"","sources":["../../../../src/utils/getDefaultPaletteColor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,eAAO,MAAM,sBAAsB,aAAc,MAAM,KAAG,MAYzD,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Colors } from "../components/Button";
|
|
2
|
-
|
|
3
|
-
export const getDefaultPaletteColor = (colorKey: Colors): string => {
|
|
4
|
-
const defaultColors: Partial<Record<Colors, string>> = {
|
|
5
|
-
positive: "#00E5C4",
|
|
6
|
-
// promotional: "#FFD700",
|
|
7
|
-
// generation: "#4CAF50",
|
|
8
|
-
// colorScheme: "#9E9E9E",
|
|
9
|
-
// critical: "#FF0000",
|
|
10
|
-
// highlight: "#FFA500",
|
|
11
|
-
// neutral: "#808080",
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
return defaultColors[colorKey] ?? "#000000"; // subject to change
|
|
15
|
-
};
|