@moneylion/react-native-offer-carousel 1.0.5 → 1.0.7

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 (244) hide show
  1. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Brand.js +45 -9
  2. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -1
  3. package/lib/commonjs/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -1
  4. package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/components.js +2 -2
  5. package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/components.js.map +1 -1
  6. package/lib/commonjs/components/Button/index.js +4 -21
  7. package/lib/commonjs/components/Button/index.js.map +1 -1
  8. package/lib/commonjs/components/Cards/VideosCard/VideosCard.js +3 -3
  9. package/lib/commonjs/components/Common/BaseOfferCard/Stat/Stat.js +4 -4
  10. package/lib/commonjs/components/Common/BaseOfferCard/Stat/Stat.js.map +1 -1
  11. package/lib/commonjs/components/Common/BaseOfferCard/index.js +16 -15
  12. package/lib/commonjs/components/Common/BaseOfferCard/index.js.map +1 -1
  13. package/lib/commonjs/components/Common/DynamicOfferCard/CallToAction.js +2 -0
  14. package/lib/commonjs/components/Common/DynamicOfferCard/CallToAction.js.map +1 -1
  15. package/lib/commonjs/components/Common/DynamicOfferCard/SeeMore.js +1 -1
  16. package/lib/commonjs/components/Common/DynamicOfferCard/SeeMore.js.map +1 -1
  17. package/lib/commonjs/components/Common/DynamicOfferCard/index.js +3 -2
  18. package/lib/commonjs/components/Common/DynamicOfferCard/index.js.map +1 -1
  19. package/lib/commonjs/components/DynamicOffers/DynamicOffers.js +2 -2
  20. package/lib/commonjs/components/DynamicOffers/DynamicOffers.js.map +1 -1
  21. package/lib/commonjs/components/DynamicOffers/DynamicOffersContainer.js +1 -1
  22. package/lib/commonjs/components/DynamicOffers/DynamicOffersContainer.js.map +1 -1
  23. package/lib/commonjs/components/DynamicOffers/Render/DynamicOffersRender.js +5 -5
  24. package/lib/commonjs/components/DynamicOffers/Render/DynamicOffersRender.js.map +1 -1
  25. package/lib/commonjs/components/DynamicOffers/Render/FallbackOfferTemplate.js +2 -2
  26. package/lib/commonjs/components/DynamicOffers/Render/FallbackOfferTemplate.js.map +1 -1
  27. package/lib/commonjs/components/DynamicOffers/Render/Offer.js +5 -4
  28. package/lib/commonjs/components/DynamicOffers/Render/Offer.js.map +1 -1
  29. package/lib/commonjs/components/Layouts/CreditCardOfferCard/index.js +4 -3
  30. package/lib/commonjs/components/Layouts/CreditCardOfferCard/index.js.map +1 -1
  31. package/lib/commonjs/components/Layouts/CreditCardOfferCard/statsBuilder.js +1 -1
  32. package/lib/commonjs/components/Layouts/DefaultOfferCard/index.js +2 -2
  33. package/lib/commonjs/components/Layouts/DefaultOfferCard/index.js.map +1 -1
  34. package/lib/commonjs/components/Layouts/DefaultOfferCard/statsBuilder.js +1 -1
  35. package/lib/commonjs/components/Layouts/HeadlineWithDescriptionCard/index.js +2 -2
  36. package/lib/commonjs/components/Layouts/HeadlineWithDescriptionCard/index.js.map +1 -1
  37. package/lib/commonjs/components/Modal/DescriptionPoints.js +2 -2
  38. package/lib/commonjs/components/Modal/DescriptionPoints.js.map +1 -1
  39. package/lib/commonjs/components/Modal/Disclaimer.js +2 -2
  40. package/lib/commonjs/components/Modal/Disclaimer.js.map +1 -1
  41. package/lib/commonjs/components/Modal/OfferDetailsModal.js +6 -2
  42. package/lib/commonjs/components/Modal/OfferDetailsModal.js.map +1 -1
  43. package/lib/commonjs/components/MoneyLionOfferCarousel.js +14 -16
  44. package/lib/commonjs/components/MoneyLionOfferCarousel.js.map +1 -1
  45. package/lib/commonjs/components/Text/index.js +18 -38
  46. package/lib/commonjs/components/Text/index.js.map +1 -1
  47. package/lib/commonjs/components/View/index.js +11 -94
  48. package/lib/commonjs/components/View/index.js.map +1 -1
  49. package/lib/commonjs/config/mocks/cnfContext.js +44 -8
  50. package/lib/commonjs/config/mocks/cnfContext.js.map +1 -1
  51. package/lib/commonjs/context/ThemeProvider.js +2 -2
  52. package/lib/commonjs/context/ThemeProvider.js.map +1 -1
  53. package/lib/commonjs/pageData.js +4 -3
  54. package/lib/commonjs/pageData.js.map +1 -1
  55. package/lib/commonjs/services/getDynamicOffers.js.map +1 -1
  56. package/lib/commonjs/services/getProductTypesByQuery.js +1 -1
  57. package/lib/commonjs/services/getProductTypesByQuery.js.map +1 -1
  58. package/lib/commonjs/utils/formatOfferUrl.js +1 -1
  59. package/lib/commonjs/utils/getOffersByProductTypes.js +2 -2
  60. package/lib/commonjs/utils/getOffersByProductTypes.js.map +1 -1
  61. package/lib/commonjs/utils/selectDynamicOffers.js.map +1 -1
  62. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Brand.js +45 -9
  63. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -1
  64. package/lib/module/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -1
  65. package/lib/module/capabilities/ui/elements/src/components/MarkdownText/components.js +2 -3
  66. package/lib/module/capabilities/ui/elements/src/components/MarkdownText/components.js.map +1 -1
  67. package/lib/module/components/Button/index.js +4 -21
  68. package/lib/module/components/Button/index.js.map +1 -1
  69. package/lib/module/components/Cards/VideosCard/VideosCard.js +3 -3
  70. package/lib/module/components/Common/BaseOfferCard/Stat/Stat.js +4 -4
  71. package/lib/module/components/Common/BaseOfferCard/Stat/Stat.js.map +1 -1
  72. package/lib/module/components/Common/BaseOfferCard/index.js +16 -15
  73. package/lib/module/components/Common/BaseOfferCard/index.js.map +1 -1
  74. package/lib/module/components/Common/DynamicOfferCard/CallToAction.js +2 -0
  75. package/lib/module/components/Common/DynamicOfferCard/CallToAction.js.map +1 -1
  76. package/lib/module/components/Common/DynamicOfferCard/SeeMore.js +1 -1
  77. package/lib/module/components/Common/DynamicOfferCard/SeeMore.js.map +1 -1
  78. package/lib/module/components/Common/DynamicOfferCard/index.js +3 -2
  79. package/lib/module/components/Common/DynamicOfferCard/index.js.map +1 -1
  80. package/lib/module/components/DynamicOffers/DynamicOffers.js +2 -2
  81. package/lib/module/components/DynamicOffers/DynamicOffers.js.map +1 -1
  82. package/lib/module/components/DynamicOffers/DynamicOffersContainer.js +1 -1
  83. package/lib/module/components/DynamicOffers/DynamicOffersContainer.js.map +1 -1
  84. package/lib/module/components/DynamicOffers/Render/DynamicOffersRender.js +5 -5
  85. package/lib/module/components/DynamicOffers/Render/DynamicOffersRender.js.map +1 -1
  86. package/lib/module/components/DynamicOffers/Render/FallbackOfferTemplate.js +2 -2
  87. package/lib/module/components/DynamicOffers/Render/FallbackOfferTemplate.js.map +1 -1
  88. package/lib/module/components/DynamicOffers/Render/Offer.js +5 -4
  89. package/lib/module/components/DynamicOffers/Render/Offer.js.map +1 -1
  90. package/lib/module/components/Layouts/CreditCardOfferCard/index.js +4 -3
  91. package/lib/module/components/Layouts/CreditCardOfferCard/index.js.map +1 -1
  92. package/lib/module/components/Layouts/CreditCardOfferCard/statsBuilder.js +1 -1
  93. package/lib/module/components/Layouts/CreditCardOfferCard/statsBuilder.js.map +1 -1
  94. package/lib/module/components/Layouts/DefaultOfferCard/index.js +2 -2
  95. package/lib/module/components/Layouts/DefaultOfferCard/index.js.map +1 -1
  96. package/lib/module/components/Layouts/DefaultOfferCard/statsBuilder.js +1 -1
  97. package/lib/module/components/Layouts/DefaultOfferCard/statsBuilder.js.map +1 -1
  98. package/lib/module/components/Layouts/HeadlineWithDescriptionCard/index.js +2 -2
  99. package/lib/module/components/Layouts/HeadlineWithDescriptionCard/index.js.map +1 -1
  100. package/lib/module/components/Modal/DescriptionPoints.js +2 -2
  101. package/lib/module/components/Modal/DescriptionPoints.js.map +1 -1
  102. package/lib/module/components/Modal/Disclaimer.js +2 -2
  103. package/lib/module/components/Modal/Disclaimer.js.map +1 -1
  104. package/lib/module/components/Modal/OfferDetailsModal.js +6 -2
  105. package/lib/module/components/Modal/OfferDetailsModal.js.map +1 -1
  106. package/lib/module/components/MoneyLionOfferCarousel.js +14 -16
  107. package/lib/module/components/MoneyLionOfferCarousel.js.map +1 -1
  108. package/lib/module/components/Text/index.js +17 -38
  109. package/lib/module/components/Text/index.js.map +1 -1
  110. package/lib/module/components/View/index.js +12 -95
  111. package/lib/module/components/View/index.js.map +1 -1
  112. package/lib/module/config/mocks/cnfContext.js +44 -8
  113. package/lib/module/config/mocks/cnfContext.js.map +1 -1
  114. package/lib/module/context/ThemeProvider.js +2 -2
  115. package/lib/module/context/ThemeProvider.js.map +1 -1
  116. package/lib/module/pageData.js +4 -3
  117. package/lib/module/pageData.js.map +1 -1
  118. package/lib/module/services/getDynamicOffers.js.map +1 -1
  119. package/lib/module/services/getProductTypesByQuery.js +1 -1
  120. package/lib/module/services/getProductTypesByQuery.js.map +1 -1
  121. package/lib/module/utils/formatOfferUrl.js +1 -1
  122. package/lib/module/utils/formatOfferUrl.js.map +1 -1
  123. package/lib/module/utils/getOffersByProductTypes.js +3 -2
  124. package/lib/module/utils/getOffersByProductTypes.js.map +1 -1
  125. package/lib/module/utils/selectDynamicOffers.js.map +1 -1
  126. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts +90 -18
  127. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts.map +1 -1
  128. package/lib/typescript/src/capabilities/offer-catalog/src/api/offerCatalogApi.d.ts +1 -1
  129. package/lib/typescript/src/capabilities/offer-catalog/src/api/offerCatalogApi.d.ts.map +1 -1
  130. package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/components.d.ts +3 -2
  131. package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/components.d.ts.map +1 -1
  132. package/lib/typescript/src/components/Button/index.d.ts +3 -3
  133. package/lib/typescript/src/components/Button/index.d.ts.map +1 -1
  134. package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts +4 -4
  135. package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts.map +1 -1
  136. package/lib/typescript/src/components/Common/DynamicOfferCard/CallToAction.d.ts +2 -2
  137. package/lib/typescript/src/components/Common/DynamicOfferCard/CallToAction.d.ts.map +1 -1
  138. package/lib/typescript/src/components/Common/DynamicOfferCard/SeeMore.d.ts +1 -1
  139. package/lib/typescript/src/components/Common/DynamicOfferCard/SeeMore.d.ts.map +1 -1
  140. package/lib/typescript/src/components/Common/DynamicOfferCard/index.d.ts +3 -3
  141. package/lib/typescript/src/components/Common/DynamicOfferCard/index.d.ts.map +1 -1
  142. package/lib/typescript/src/components/DynamicOffers/DynamicOffers.d.ts +2 -2
  143. package/lib/typescript/src/components/DynamicOffers/DynamicOffers.d.ts.map +1 -1
  144. package/lib/typescript/src/components/DynamicOffers/Render/DynamicOffersRender.d.ts +3 -3
  145. package/lib/typescript/src/components/DynamicOffers/Render/DynamicOffersRender.d.ts.map +1 -1
  146. package/lib/typescript/src/components/DynamicOffers/Render/FallbackOfferTemplate.d.ts +3 -3
  147. package/lib/typescript/src/components/DynamicOffers/Render/FallbackOfferTemplate.d.ts.map +1 -1
  148. package/lib/typescript/src/components/DynamicOffers/Render/Offer.d.ts +5 -4
  149. package/lib/typescript/src/components/DynamicOffers/Render/Offer.d.ts.map +1 -1
  150. package/lib/typescript/src/components/Layouts/CreditCardOfferCard/index.d.ts +3 -3
  151. package/lib/typescript/src/components/Layouts/CreditCardOfferCard/index.d.ts.map +1 -1
  152. package/lib/typescript/src/components/Layouts/CreditCardOfferCard/statsBuilder.d.ts +2 -2
  153. package/lib/typescript/src/components/Layouts/CreditCardOfferCard/statsBuilder.d.ts.map +1 -1
  154. package/lib/typescript/src/components/Layouts/DefaultOfferCard/index.d.ts +3 -3
  155. package/lib/typescript/src/components/Layouts/DefaultOfferCard/index.d.ts.map +1 -1
  156. package/lib/typescript/src/components/Layouts/DefaultOfferCard/statsBuilder.d.ts +3 -3
  157. package/lib/typescript/src/components/Layouts/DefaultOfferCard/statsBuilder.d.ts.map +1 -1
  158. package/lib/typescript/src/components/Layouts/HeadlineWithDescriptionCard/index.d.ts +3 -3
  159. package/lib/typescript/src/components/Layouts/HeadlineWithDescriptionCard/index.d.ts.map +1 -1
  160. package/lib/typescript/src/components/Modal/Disclaimer.d.ts.map +1 -1
  161. package/lib/typescript/src/components/Modal/OfferDetailsModal.d.ts +1 -1
  162. package/lib/typescript/src/components/Modal/OfferDetailsModal.d.ts.map +1 -1
  163. package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts +2 -0
  164. package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts.map +1 -1
  165. package/lib/typescript/src/components/Text/index.d.ts +2 -2
  166. package/lib/typescript/src/components/Text/index.d.ts.map +1 -1
  167. package/lib/typescript/src/components/View/index.d.ts +4 -2
  168. package/lib/typescript/src/components/View/index.d.ts.map +1 -1
  169. package/lib/typescript/src/config/mocks/cnfContext.d.ts.map +1 -1
  170. package/lib/typescript/src/context/EventHandlerProvider.d.ts +1 -1
  171. package/lib/typescript/src/context/EventHandlerProvider.d.ts.map +1 -1
  172. package/lib/typescript/src/context/ThemeProvider.d.ts +47 -11
  173. package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
  174. package/lib/typescript/src/pageData.d.ts +2 -1
  175. package/lib/typescript/src/pageData.d.ts.map +1 -1
  176. package/lib/typescript/src/services/getDynamicOffers.d.ts +3 -3
  177. package/lib/typescript/src/services/getDynamicOffers.d.ts.map +1 -1
  178. package/lib/typescript/src/utils/addClientTagsToOfferLinks.d.ts +1 -1
  179. package/lib/typescript/src/utils/addClientTagsToOfferLinks.d.ts.map +1 -1
  180. package/lib/typescript/src/utils/formatOfferUrl.d.ts +6 -1
  181. package/lib/typescript/src/utils/formatOfferUrl.d.ts.map +1 -1
  182. package/lib/typescript/src/utils/getDefaultProductType.d.ts +1 -1
  183. package/lib/typescript/src/utils/getDefaultProductType.d.ts.map +1 -1
  184. package/lib/typescript/src/utils/getEnableUseCachedOffers.d.ts +1 -1
  185. package/lib/typescript/src/utils/getEnableUseCachedOffers.d.ts.map +1 -1
  186. package/lib/typescript/src/utils/getOffersBasedOnLayout.d.ts +1 -1
  187. package/lib/typescript/src/utils/getOffersBasedOnLayout.d.ts.map +1 -1
  188. package/lib/typescript/src/utils/getOffersByProductTypes.d.ts +1 -1
  189. package/lib/typescript/src/utils/getOffersByProductTypes.d.ts.map +1 -1
  190. package/lib/typescript/src/utils/getProductTypesDefinition.d.ts +1 -1
  191. package/lib/typescript/src/utils/getProductTypesDefinition.d.ts.map +1 -1
  192. package/lib/typescript/src/utils/selectDynamicOffers.d.ts +1 -1
  193. package/lib/typescript/src/utils/selectDynamicOffers.d.ts.map +1 -1
  194. package/lib/typescript/src/utils/sortOffersByRecommendationScore.d.ts +1 -1
  195. package/lib/typescript/src/utils/sortOffersByRecommendationScore.d.ts.map +1 -1
  196. package/package.json +1 -1
  197. package/src/capabilities/core/src/system/cnfContext/schemas/Brand.ts +46 -10
  198. package/src/capabilities/offer-catalog/src/api/offerCatalogApi.ts +1 -1
  199. package/src/capabilities/ui/elements/src/components/MarkdownText/components.tsx +4 -4
  200. package/src/components/Button/index.tsx +7 -20
  201. package/src/components/Cards/VideosCard/VideosCard.tsx +3 -3
  202. package/src/components/Common/BaseOfferCard/Stat/Stat.tsx +4 -4
  203. package/src/components/Common/BaseOfferCard/index.tsx +36 -17
  204. package/src/components/Common/DynamicOfferCard/CallToAction.tsx +3 -1
  205. package/src/components/Common/DynamicOfferCard/SeeMore.tsx +2 -2
  206. package/src/components/Common/DynamicOfferCard/index.tsx +5 -4
  207. package/src/components/DynamicOffers/DynamicOffers.tsx +3 -3
  208. package/src/components/DynamicOffers/DynamicOffersContainer.tsx +1 -1
  209. package/src/components/DynamicOffers/Render/DynamicOffersRender.tsx +7 -7
  210. package/src/components/DynamicOffers/Render/FallbackOfferTemplate.tsx +4 -4
  211. package/src/components/DynamicOffers/Render/Offer.tsx +9 -6
  212. package/src/components/Layouts/CreditCardOfferCard/index.tsx +6 -6
  213. package/src/components/Layouts/CreditCardOfferCard/statsBuilder.tsx +2 -2
  214. package/src/components/Layouts/DefaultOfferCard/index.tsx +4 -5
  215. package/src/components/Layouts/DefaultOfferCard/statsBuilder.tsx +2 -2
  216. package/src/components/Layouts/HeadlineWithDescriptionCard/index.tsx +4 -4
  217. package/src/components/Modal/DescriptionPoints.tsx +2 -2
  218. package/src/components/Modal/Disclaimer.tsx +6 -2
  219. package/src/components/Modal/OfferDetailsModal.tsx +12 -7
  220. package/src/components/MoneyLionOfferCarousel.tsx +20 -14
  221. package/src/components/Text/index.tsx +10 -45
  222. package/src/components/View/index.tsx +14 -72
  223. package/src/config/mocks/cnfContext.ts +44 -8
  224. package/src/context/EventHandlerProvider.tsx +1 -1
  225. package/src/context/ThemeProvider.tsx +51 -14
  226. package/src/pageData.ts +5 -3
  227. package/src/services/getDynamicOffers.ts +5 -5
  228. package/src/services/getProductTypesByQuery.ts +1 -1
  229. package/src/utils/addClientTagsToOfferLinks.ts +1 -1
  230. package/src/utils/formatOfferUrl.ts +1 -1
  231. package/src/utils/getDefaultProductType.ts +1 -1
  232. package/src/utils/getEnableUseCachedOffers.ts +1 -1
  233. package/src/utils/getOffersBasedOnLayout.ts +1 -1
  234. package/src/utils/getOffersByProductTypes.ts +4 -3
  235. package/src/utils/getProductTypesDefinition.ts +1 -1
  236. package/src/utils/selectDynamicOffers.ts +1 -2
  237. package/src/utils/sortOffersByRecommendationScore.ts +1 -1
  238. package/lib/commonjs/utils/getDefaultPaletteColor.js +0 -20
  239. package/lib/commonjs/utils/getDefaultPaletteColor.js.map +0 -1
  240. package/lib/module/utils/getDefaultPaletteColor.js +0 -13
  241. package/lib/module/utils/getDefaultPaletteColor.js.map +0 -1
  242. package/lib/typescript/src/utils/getDefaultPaletteColor.d.ts +0 -3
  243. package/lib/typescript/src/utils/getDefaultPaletteColor.d.ts.map +0 -1
  244. package/src/utils/getDefaultPaletteColor.ts +0 -15
@@ -1,37 +1,14 @@
1
1
  import React from "react";
2
- import { View as RNView, type ViewStyle, StyleSheet } from "react-native";
2
+ import { View as RNView, type ViewStyle } from "react-native";
3
+ import { useTheme, type ThemeColors } from "../../context/ThemeProvider";
4
+
5
+ type Colors = keyof ThemeColors;
3
6
 
4
7
  export interface ViewProps {
5
8
  children?: React.ReactNode;
6
9
  style?: ViewStyle;
7
- backgroundColor?:
8
- | "neutral"
9
- | "neutral-faded"
10
- | "critical"
11
- | "critical-faded"
12
- | "positive"
13
- | "positive-faded"
14
- | "warning"
15
- | "warning-faded"
16
- | "primary"
17
- | "primary-faded"
18
- | "elevation-base"
19
- | "elevation-raised"
20
- | "elevation-overlay"
21
- | "page"
22
- | "page-faded"
23
- | "disabled"
24
- | "disabled-faded"
25
- | "brand"
26
- | "white"
27
- | "black";
28
- borderColor?:
29
- | "neutral"
30
- | "positive"
31
- | "warning"
32
- | "critical"
33
- | "primary"
34
- | string;
10
+ backgroundColor?: Colors;
11
+ borderColor?: Colors;
35
12
  direction?: "row" | "row-reverse" | "column" | "column-reverse";
36
13
  height?: number | string;
37
14
  maxHeight?: number | string;
@@ -61,27 +38,24 @@ const View: React.FC<ViewProps> = ({
61
38
  testID,
62
39
  ...rest
63
40
  }) => {
64
- // Create a single style object directly - faster than array.filter(Boolean)
41
+ const themeContext = useTheme();
42
+ const theme = themeContext?.theme || {};
43
+
44
+ // Create a single style object directly
65
45
  const containerStyles: Record<string, any> = {
66
46
  // Background color handling
67
47
  ...(backgroundColor && {
68
- backgroundColor:
69
- styles[`bg${backgroundColor}`]?.backgroundColor || backgroundColor,
48
+ backgroundColor: theme[backgroundColor] || backgroundColor,
70
49
  }),
71
50
 
72
51
  // Border color handling
73
52
  ...(borderColor && {
74
- borderColor:
75
- (borderColor in
76
- ["neutral", "positive", "warning", "critical", "primary"]
77
- ? styles[
78
- `border${borderColor as "neutral" | "positive" | "warning" | "critical" | "primary"}`
79
- ]?.borderColor
80
- : undefined) || borderColor,
53
+ borderWidth: 1,
54
+ borderColor: theme[borderColor],
81
55
  }),
82
56
 
83
57
  // Direction handling
84
- ...(direction && styles[`direction${direction}`]),
58
+ ...(direction && { flexDirection: direction }),
85
59
 
86
60
  // Dimension styles - applied only when provided
87
61
  ...(height !== undefined && { height }),
@@ -109,36 +83,4 @@ const View: React.FC<ViewProps> = ({
109
83
  );
110
84
  };
111
85
 
112
- const styles = StyleSheet.create({
113
- "bgneutral": { backgroundColor: "#e0e0e0" },
114
- "bgneutral-faded": { backgroundColor: "#f5f5f5" },
115
- "bgcritical": { backgroundColor: "#f44336" },
116
- "bgcritical-faded": { backgroundColor: "#ffebee" },
117
- "bgpositive": { backgroundColor: "#4caf50" },
118
- "bgpositive-faded": { backgroundColor: "#e8f5e9" },
119
- "bgwarning": { backgroundColor: "#ff9800" },
120
- "bgwarning-faded": { backgroundColor: "#fff3e0" },
121
- "bgprimary": { backgroundColor: "#2196f3" },
122
- "bgprimary-faded": { backgroundColor: "#ebfff9" },
123
- "bgelevation-base": { backgroundColor: "#fafafa" },
124
- "bgelevation-raised": { backgroundColor: "#eeeeee" },
125
- "bgelevation-overlay": { backgroundColor: "#bdbdbd" },
126
- "bgpage": { backgroundColor: "#ffffff" },
127
- "bgpage-faded": { backgroundColor: "#f5f5f5" },
128
- "bgdisabled": { backgroundColor: "#bdbdbd" },
129
- "bgdisabled-faded": { backgroundColor: "#e0e0e0" },
130
- "bgbrand": { backgroundColor: "#6200ea" },
131
- "bgwhite": { backgroundColor: "#ffffff" },
132
- "bgblack": { backgroundColor: "#000000" },
133
- "borderneutral": { borderColor: "#bdbdbd" },
134
- "borderpositive": { borderColor: "#388e3c" },
135
- "borderwarning": { borderColor: "#f57c00" },
136
- "bordercritical": { borderColor: "#d32f2f" },
137
- "borderprimary": { borderColor: "#1976d2" },
138
- "directionrow": { flexDirection: "row" },
139
- "directionrow-reverse": { flexDirection: "row-reverse" },
140
- "directioncolumn": { flexDirection: "column" },
141
- "directioncolumn-reverse": { flexDirection: "column-reverse" },
142
- });
143
-
144
86
  export default View;
@@ -36,14 +36,50 @@ export const localCnfContext: CnfContext = {
36
36
  icon: null,
37
37
  },
38
38
  type: "business",
39
- palette: {
40
- promotional: "#592b86",
41
- generation: "provided",
42
- colorScheme: "balanced",
43
- positive: "#ec8a07",
44
- critical: "#ce0202",
45
- highlight: "#ec8a07",
46
- neutral: "#14181f",
39
+ themeColors: {
40
+ backgroundCritical: "#ff7200",
41
+ backgroundCriticalFaded: "#fff2e8",
42
+ backgroundCriticalHighlighted: "#ee6a00",
43
+ backgroundDisabled: "#eeeeee",
44
+ backgroundDisabledFaded: "#f6f6f6",
45
+ backgroundElevationBase: "#ffffff",
46
+ backgroundElevationOverlay: "#ffffff",
47
+ backgroundElevationRaised: "#ffffff",
48
+ backgroundNeutral: "#e2e2e2",
49
+ backgroundNeutralFaded: "#f5f5f5",
50
+ backgroundNeutralHighlighted: "#d7d7d7",
51
+ backgroundPage: "#ffffff",
52
+ backgroundPageFaded: "#f9f9f9",
53
+ backgroundPositive: "#00e5c4",
54
+ backgroundPositiveFaded: "#e8fffc",
55
+ backgroundPositiveHighlighted: "#00d9b9",
56
+ backgroundPrimary: "#00e5c4",
57
+ backgroundPrimaryFaded: "#e8fffc",
58
+ backgroundPrimaryHighlighted: "#00d9b9",
59
+ backgroundWarning: "#facc15",
60
+ backgroundWarningFaded: "#fffae9",
61
+ backgroundWarningHighlighted: "#edc113",
62
+ black: "#000000",
63
+ borderCritical: "#d35d00",
64
+ borderCriticalFaded: "#fce3ce",
65
+ borderDisabled: "#e2e2e2",
66
+ borderNeutral: "#bbbbbb",
67
+ borderNeutralFaded: "#e1e1e1",
68
+ borderPositive: "#00bfa3",
69
+ borderPositiveFaded: "#b8faf2",
70
+ borderPrimary: "#00bfa3",
71
+ borderPrimaryFaded: "#b8faf2",
72
+ borderWarning: "#cfa90f",
73
+ borderWarningFaded: "#faedbb",
74
+ brand: "#00e5c4",
75
+ foregroundCritical: "#a94900",
76
+ foregroundDisabled: "#cccccc",
77
+ foregroundNeutral: "#181818",
78
+ foregroundNeutralFaded: "#666666",
79
+ foregroundPositive: "#007362",
80
+ foregroundPrimary: "#007362",
81
+ foregroundWarning: "#7b6305",
82
+ white: "#ffffff",
47
83
  },
48
84
  isLicensed: true,
49
85
  allowedMarks: { logo: true, name: true },
@@ -1,6 +1,6 @@
1
1
  import React, { createContext, useContext } from "react";
2
2
  import type { ResultType } from "../services/getProductTypes";
3
- import type { BaseOffer } from "../../src/capabilities/offer-catalog/src";
3
+ import type { BaseOffer } from "../capabilities/offer-catalog/src";
4
4
 
5
5
  interface onInitializeProps {
6
6
  timestamp: string;
@@ -7,15 +7,52 @@ import React, {
7
7
  } from "react";
8
8
  import { Platform } from "react-native";
9
9
 
10
- export interface ThemePalette {
11
- promotional?: string;
12
- generation?: ("generate" | "provided") | null;
13
- colorScheme?: ("balanced" | "light" | "dark") | null;
14
- positive: string;
15
- critical?: string;
16
- highlight?: string;
17
- neutral?: string;
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: ThemePalette;
69
+ theme: ThemeColors;
33
70
  fontFamily: FontFamily;
34
- updateTheme: (newTheme: Partial<ThemePalette>) => void;
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
- palette?: ThemePalette;
86
+ themeColors?: ThemeColors;
50
87
  fontFamily?: Partial<FontFamily>;
51
88
  children: ReactNode;
52
89
  }
53
90
 
54
91
  export const ThemeProvider: FC<ThemeProviderProps> = ({
55
- palette = {} as ThemePalette, // should be safe to assert as ThemePalette since the fallback colors are already handled by the consumers of ThemeProvider
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<ThemePalette>(palette);
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<ThemePalette>) => {
102
+ const updateTheme = (newTheme: Partial<ThemeColors>) => {
66
103
  setTheme((prevTheme) => ({
67
104
  ...prevTheme,
68
105
  ...newTheme,
package/src/pageData.ts CHANGED
@@ -1,5 +1,6 @@
1
- import type { CnfContext } from "../src/capabilities/core/src/system/cnfContext/CnfContext";
2
- import { getIsDevEnvironment } from "../src/capabilities/offer-catalog/src/utils/contextUtil";
1
+ import type { CnfContext } from "./capabilities/core/src/system/cnfContext/CnfContext";
2
+ import { getIsDevEnvironment } from "./capabilities/offer-catalog/src/utils/contextUtil";
3
+
3
4
  import type { MoneyLionOfferCarouselProps } from "./components/MoneyLionOfferCarousel";
4
5
  import type { onRateTableSubmitProps } from "./context/EventHandlerProvider";
5
6
  import { getDynamicOffers } from "./services/getDynamicOffers";
@@ -30,6 +31,7 @@ export async function getPageData({
30
31
  displayLayout,
31
32
  searchAPIToken,
32
33
  showProductTypeLabel,
34
+ showCardBorder,
33
35
  } = params;
34
36
 
35
37
  // Resolve Tags
@@ -90,7 +92,7 @@ export async function getPageData({
90
92
  offers,
91
93
  currentCountry,
92
94
  // videosContent,
93
- // showBorder,
95
+ showCardBorder,
94
96
  // shouldHideFooter,
95
97
  showProductTypeLabel,
96
98
  displayLayout: safeDisplayLayout,
@@ -1,9 +1,4 @@
1
1
  import { isEmpty } from "radash";
2
- import type { CnfContext } from "../../src/capabilities/core/src/system/cnfContext/CnfContext";
3
- import type {
4
- PartnerOverride,
5
- ProductTypeDefinition,
6
- } from "../../src/capabilities/offer-catalog/src";
7
2
  import {
8
3
  addClientTagsToOfferLinks,
9
4
  getOffersByProductTypes,
@@ -18,6 +13,11 @@ import { sortOffersByRecommendationScore } from "../utils/sortOffersByRecommenda
18
13
  import { pipe } from "effect";
19
14
  import { formatOfferUrl } from "../utils/formatOfferUrl";
20
15
  import { getOffersBasedOnLayout } from "../utils/getOffersBasedOnLayout";
16
+ import type {
17
+ PartnerOverride,
18
+ ProductTypeDefinition,
19
+ } from "../capabilities/offer-catalog/src";
20
+ import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
21
21
 
22
22
  export type GetDynamicOffersProps = {
23
23
  tags: string;
@@ -1,6 +1,6 @@
1
1
  import { pipe } from "effect";
2
- import { orderProductTypesByRank } from "../../src/capabilities/core/src/domain/third-party-search";
3
2
  import { getEwsSearchApiBaseUrl } from "../apiEnvironment";
3
+ import { orderProductTypesByRank } from "../capabilities/core/src/domain/third-party-search";
4
4
 
5
5
  type GetProductTypesByQueryProps = {
6
6
  query: string;
@@ -1,4 +1,4 @@
1
- import type { BaseOffer } from "../../src/capabilities/offer-catalog/src";
1
+ import type { BaseOffer } from "../capabilities/offer-catalog/src";
2
2
 
3
3
  /**
4
4
  * Add client tags to offer links
@@ -3,7 +3,7 @@ import {
3
3
  type BaseOffer,
4
4
  type PartnerOverride,
5
5
  type ProductTypeDefinition,
6
- } from "../../src/capabilities/offer-catalog/src";
6
+ } from "../capabilities/offer-catalog/src";
7
7
 
8
8
  /**
9
9
  * Format the offer URL
@@ -1,4 +1,4 @@
1
- import type { CnfContext } from "../../src/capabilities/core/src/system/cnfContext/CnfContext";
1
+ import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
2
2
 
3
3
  export const getDefaultProductType = (context: CnfContext) =>
4
4
  context.configuration.configuration.defaultProductTypeSlug;
@@ -1,4 +1,4 @@
1
- import type { CnfContext } from "../../src/capabilities/core/src/system/cnfContext/CnfContext";
1
+ import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
2
2
 
3
3
  /**
4
4
  * Get enabled cache offers request
@@ -1,7 +1,7 @@
1
1
  import { pipe } from "effect";
2
2
  import type { Layout } from "./layouts";
3
3
  import { sortOffersByRecommendationScore } from "./sortOffersByRecommendationScore";
4
- import type { BaseOffer } from "../../src/capabilities/offer-catalog/src";
4
+ import type { BaseOffer } from "../capabilities/offer-catalog/src";
5
5
 
6
6
  const MAX_OFFERS_TO_DISPLAY = 3;
7
7
 
@@ -1,9 +1,10 @@
1
- import type { CnfContext } from "../../src/capabilities/core/src/system/cnfContext/CnfContext";
1
+ import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
2
2
  import {
3
3
  getCachedOffersByProductTypes,
4
4
  getOffersForProductTypes,
5
- } from "../../src/capabilities/offer-catalog/src/api/offerCatalogApi";
6
- import { parseClientTags } from "../../src/capabilities/offer-catalog/src/utils/contextUtil";
5
+ } from "../capabilities/offer-catalog/src/api/offerCatalogApi";
6
+ import { parseClientTags } from "../capabilities/offer-catalog/src/utils/contextUtil";
7
+
7
8
  /**
8
9
  * Retrieves offers by product types.
9
10
  *
@@ -1,4 +1,4 @@
1
- import type { CnfContext } from "../../src/capabilities/core/src/system/cnfContext/CnfContext";
1
+ import type { CnfContext } from "../capabilities/core/src/system/cnfContext/CnfContext";
2
2
 
3
3
  export const getProductTypesDefinition = (context: CnfContext) => {
4
4
  const offersConfig = context.configuration.configuration;
@@ -1,7 +1,6 @@
1
- import type { BaseOffer } from "../../src/capabilities/offer-catalog/src";
1
+ import type { BaseOffer } from "../capabilities/offer-catalog/src";
2
2
  import { sortOffersByRecommendationScore } from "./sortOffersByRecommendationScore";
3
3
 
4
-
5
4
  export const selectDynamicOffers = (
6
5
  offers: BaseOffer[],
7
6
  productTypes: string[]
@@ -1,5 +1,5 @@
1
1
  import { sort } from "radash";
2
- import type { BaseOffer } from "../../src/capabilities/offer-catalog/src";
2
+ import type { BaseOffer } from "../capabilities/offer-catalog/src";
3
3
 
4
4
  export const sortOffersByRecommendationScore = (offers: BaseOffer[]) => {
5
5
  return sort(offers, (offer) => offer.recommendationScore, true);
@@ -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,3 +0,0 @@
1
- import type { Colors } from "../components/Button";
2
- export declare const getDefaultPaletteColor: (colorKey: Colors) => string;
3
- //# sourceMappingURL=getDefaultPaletteColor.d.ts.map
@@ -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
- };