@umituz/react-native-subscription 2.12.2 → 2.12.4

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 (47) hide show
  1. package/package.json +2 -2
  2. package/src/domains/index.ts +5 -0
  3. package/src/domains/paywall/components/CreditCard.tsx +117 -0
  4. package/src/domains/paywall/components/FeatureItem.tsx +50 -0
  5. package/src/domains/paywall/components/FeatureList.tsx +34 -0
  6. package/src/domains/paywall/components/PaywallFooter.tsx +98 -0
  7. package/src/{presentation/components/paywall/PaywallHeroHeader.tsx → domains/paywall/components/PaywallHeader.tsx} +15 -44
  8. package/src/domains/paywall/components/PaywallModal.tsx +187 -0
  9. package/src/domains/paywall/components/PaywallTabBar.tsx +102 -0
  10. package/src/domains/paywall/components/PlanCard.tsx +124 -0
  11. package/src/domains/paywall/components/index.ts +14 -0
  12. package/src/domains/paywall/entities/index.ts +5 -0
  13. package/src/domains/paywall/entities/types.ts +48 -0
  14. package/src/domains/paywall/hooks/index.ts +6 -0
  15. package/src/{presentation → domains/paywall}/hooks/usePaywall.ts +1 -1
  16. package/src/domains/paywall/index.ts +13 -0
  17. package/src/index.ts +15 -22
  18. package/src/presentation/components/details/PremiumDetailsCard.tsx +35 -11
  19. package/src/domain/entities/paywall/CreditsPackage.ts +0 -16
  20. package/src/domain/entities/paywall/PaywallMode.ts +0 -6
  21. package/src/domain/entities/paywall/PaywallTab.ts +0 -11
  22. package/src/domain/entities/paywall/SubscriptionPlan.ts +0 -27
  23. package/src/presentation/components/paywall/BestValueBadge.tsx +0 -59
  24. package/src/presentation/components/paywall/CreditsPackageCard.tsx +0 -161
  25. package/src/presentation/components/paywall/CreditsTabContent.tsx +0 -123
  26. package/src/presentation/components/paywall/PaywallFeatureItem.tsx +0 -79
  27. package/src/presentation/components/paywall/PaywallFeaturesList.tsx +0 -47
  28. package/src/presentation/components/paywall/PaywallHeader.tsx +0 -82
  29. package/src/presentation/components/paywall/PaywallLegalFooter.tsx +0 -145
  30. package/src/presentation/components/paywall/PaywallLegalFooterStyles.ts +0 -53
  31. package/src/presentation/components/paywall/PaywallLegalFooterTypes.ts +0 -19
  32. package/src/presentation/components/paywall/PaywallModal.tsx +0 -162
  33. package/src/presentation/components/paywall/PaywallTabBar.tsx +0 -120
  34. package/src/presentation/components/paywall/SubscriptionFooter.tsx +0 -116
  35. package/src/presentation/components/paywall/SubscriptionModal.tsx +0 -168
  36. package/src/presentation/components/paywall/SubscriptionModalHeader.tsx +0 -78
  37. package/src/presentation/components/paywall/SubscriptionPackageList.tsx +0 -171
  38. package/src/presentation/components/paywall/SubscriptionPlanCard.tsx +0 -213
  39. package/src/presentation/components/paywall/SubscriptionPlanCardStyles.ts +0 -61
  40. package/src/presentation/components/paywall/SubscriptionPlanCardTypes.ts +0 -15
  41. package/src/presentation/components/paywall/SubscriptionTabContent.tsx +0 -139
  42. package/src/presentation/components/paywall/accordion/AccordionPlanCard.tsx +0 -98
  43. package/src/presentation/components/paywall/accordion/AccordionPlanCardTypes.ts +0 -39
  44. package/src/presentation/components/paywall/accordion/PlanCardDetails.tsx +0 -107
  45. package/src/presentation/components/paywall/accordion/PlanCardHeader.tsx +0 -155
  46. package/src/presentation/components/paywall/accordion/index.ts +0 -12
  47. /package/src/{presentation → domains/paywall}/hooks/useSubscriptionModal.ts +0 -0
@@ -1,39 +0,0 @@
1
- /**
2
- * Accordion Plan Card Types
3
- * Type definitions for accordion-style subscription cards
4
- */
5
-
6
- import type { PurchasesPackage } from "react-native-purchases";
7
-
8
- export interface AccordionPlanCardProps {
9
- package: PurchasesPackage;
10
- isSelected: boolean;
11
- isExpanded: boolean;
12
- onSelect: () => void;
13
- onToggleExpand: () => void;
14
- isBestValue?: boolean;
15
- creditAmount?: number;
16
- billingPeriodLabel?: string;
17
- totalPriceLabel?: string;
18
- perMonthLabel?: string;
19
- }
20
-
21
- export interface PlanCardHeaderProps {
22
- title: string;
23
- price: string;
24
- creditAmount?: number;
25
- isSelected: boolean;
26
- isExpanded: boolean;
27
- isBestValue?: boolean;
28
- onToggle: () => void;
29
- }
30
-
31
- export interface PlanCardDetailsProps {
32
- fullPrice: string;
33
- monthlyEquivalent: string | null;
34
- periodLabel: string;
35
- isYearly: boolean;
36
- billingPeriodLabel?: string;
37
- totalPriceLabel?: string;
38
- perMonthLabel?: string;
39
- }
@@ -1,107 +0,0 @@
1
- /**
2
- * Plan Card Details
3
- * Expanded state of accordion subscription card
4
- */
5
-
6
- import React, { useMemo } from "react";
7
- import { View, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- useAppDesignTokens,
11
- useResponsive,
12
- } from "@umituz/react-native-design-system";
13
- import type { PlanCardDetailsProps } from "./AccordionPlanCardTypes";
14
-
15
- export const PlanCardDetails: React.FC<PlanCardDetailsProps> = ({
16
- fullPrice,
17
- monthlyEquivalent,
18
- periodLabel,
19
- isYearly,
20
- billingPeriodLabel = "Billing Period",
21
- totalPriceLabel = "Total Price",
22
- perMonthLabel = "Per Month",
23
- }) => {
24
- const tokens = useAppDesignTokens();
25
- const { spacingMultiplier } = useResponsive();
26
-
27
- const styles = useMemo(() => createStyles(spacingMultiplier), [spacingMultiplier]);
28
-
29
- return (
30
- <View
31
- style={[
32
- styles.container,
33
- {
34
- backgroundColor: tokens.colors.surfaceSecondary,
35
- borderTopColor: tokens.colors.border,
36
- },
37
- ]}
38
- >
39
- <View style={styles.row}>
40
- <AtomicText
41
- type="bodyMedium"
42
- style={{ color: tokens.colors.textSecondary }}
43
- >
44
- {billingPeriodLabel}
45
- </AtomicText>
46
- <AtomicText
47
- type="bodyMedium"
48
- style={{ color: tokens.colors.textPrimary, fontWeight: "600" }}
49
- >
50
- {periodLabel}
51
- </AtomicText>
52
- </View>
53
-
54
- {isYearly && (
55
- <View style={styles.row}>
56
- <AtomicText
57
- type="bodyMedium"
58
- style={{ color: tokens.colors.textSecondary }}
59
- >
60
- {totalPriceLabel}
61
- </AtomicText>
62
- <AtomicText
63
- type="bodyMedium"
64
- style={{
65
- color: tokens.colors.primary,
66
- fontWeight: "700",
67
- }}
68
- >
69
- {fullPrice}
70
- </AtomicText>
71
- </View>
72
- )}
73
-
74
- {monthlyEquivalent && (
75
- <View style={styles.row}>
76
- <AtomicText
77
- type="bodyMedium"
78
- style={{ color: tokens.colors.textSecondary }}
79
- >
80
- {perMonthLabel}
81
- </AtomicText>
82
- <AtomicText
83
- type="bodyMedium"
84
- style={{ color: tokens.colors.textPrimary, fontWeight: "600" }}
85
- >
86
- {monthlyEquivalent}
87
- </AtomicText>
88
- </View>
89
- )}
90
- </View>
91
- );
92
- };
93
-
94
- const createStyles = (spacingMult: number) =>
95
- StyleSheet.create({
96
- container: {
97
- paddingHorizontal: 16 * spacingMult,
98
- paddingVertical: 12 * spacingMult,
99
- borderTopWidth: 1,
100
- gap: 10 * spacingMult,
101
- },
102
- row: {
103
- flexDirection: "row",
104
- justifyContent: "space-between",
105
- alignItems: "center",
106
- },
107
- });
@@ -1,155 +0,0 @@
1
- /**
2
- * Plan Card Header
3
- * Header for accordion subscription card
4
- */
5
-
6
- import React, { useMemo } from "react";
7
- import { View, TouchableOpacity, StyleSheet } from "react-native";
8
- import {
9
- AtomicText,
10
- AtomicIcon,
11
- useAppDesignTokens,
12
- withAlpha,
13
- useResponsive,
14
- } from "@umituz/react-native-design-system";
15
- import { BestValueBadge } from "../BestValueBadge";
16
- import { useLocalization } from "@umituz/react-native-localization";
17
- import type { PlanCardHeaderProps } from "./AccordionPlanCardTypes";
18
-
19
- export const PlanCardHeader: React.FC<PlanCardHeaderProps> = ({
20
- title,
21
- price,
22
- creditAmount,
23
- isSelected,
24
- isBestValue,
25
- onToggle,
26
- }) => {
27
- const tokens = useAppDesignTokens();
28
- const { t } = useLocalization();
29
- const { spacingMultiplier, getFontSize, minTouchTarget } = useResponsive();
30
-
31
- const styles = useMemo(
32
- () => createStyles(spacingMultiplier, minTouchTarget),
33
- [spacingMultiplier, minTouchTarget]
34
- );
35
- const creditFontSize = getFontSize(11);
36
-
37
- return (
38
- <TouchableOpacity
39
- onPress={onToggle}
40
- activeOpacity={0.7}
41
- style={styles.container}
42
- >
43
- <BestValueBadge text={t("paywall.bestValue")} visible={isBestValue} />
44
-
45
- <View style={styles.content}>
46
- <View style={styles.leftSection}>
47
- <View
48
- style={[
49
- styles.radio,
50
- {
51
- borderColor: isSelected ? tokens.colors.primary : tokens.colors.border,
52
- backgroundColor: isSelected ? tokens.colors.primary : "transparent",
53
- },
54
- ]}
55
- >
56
- {isSelected && (
57
- <AtomicIcon name="checkmark" customSize={14} customColor={tokens.colors.onPrimary} />
58
- )}
59
- </View>
60
-
61
- <View style={styles.textContainer}>
62
- <AtomicText
63
- type="titleSmall"
64
- style={{ color: tokens.colors.textPrimary, fontWeight: "600" }}
65
- >
66
- {title}
67
- </AtomicText>
68
- {creditAmount && (
69
- <View
70
- style={[
71
- styles.creditBadge,
72
- {
73
- backgroundColor: withAlpha(tokens.colors.primary, 0.15),
74
- borderColor: withAlpha(tokens.colors.primary, 0.3),
75
- },
76
- ]}
77
- >
78
- <AtomicIcon name="flash" customSize={creditFontSize} customColor={tokens.colors.primary} />
79
- <AtomicText
80
- type="labelSmall"
81
- style={{
82
- color: tokens.colors.primary,
83
- fontWeight: "700",
84
- fontSize: creditFontSize,
85
- marginLeft: 4,
86
- }}
87
- >
88
- {creditAmount} {t("paywall.credits")}
89
- </AtomicText>
90
- </View>
91
- )}
92
- </View>
93
- </View>
94
-
95
- <View style={styles.rightSection}>
96
- <AtomicText
97
- type="titleMedium"
98
- style={{ color: tokens.colors.textPrimary, fontWeight: "700" }}
99
- >
100
- {price}
101
- </AtomicText>
102
- </View>
103
- </View>
104
- </TouchableOpacity>
105
- );
106
- };
107
-
108
- const createStyles = (spacingMult: number, touchTarget: number) => {
109
- const radioSize = Math.max(touchTarget * 0.4, 22);
110
-
111
- return StyleSheet.create({
112
- container: {
113
- width: "100%",
114
- },
115
- content: {
116
- flexDirection: "row",
117
- alignItems: "center",
118
- justifyContent: "space-between",
119
- paddingVertical: 16 * spacingMult,
120
- paddingHorizontal: 16 * spacingMult,
121
- },
122
- leftSection: {
123
- flexDirection: "row",
124
- alignItems: "center",
125
- flex: 1,
126
- },
127
- radio: {
128
- width: radioSize,
129
- height: radioSize,
130
- borderRadius: radioSize / 2,
131
- borderWidth: 2,
132
- alignItems: "center",
133
- justifyContent: "center",
134
- marginRight: 12 * spacingMult,
135
- },
136
- textContainer: {
137
- flex: 1,
138
- gap: 6 * spacingMult,
139
- },
140
- creditBadge: {
141
- flexDirection: "row",
142
- alignItems: "center",
143
- paddingHorizontal: 8 * spacingMult,
144
- paddingVertical: 4 * spacingMult,
145
- borderRadius: 12 * spacingMult,
146
- borderWidth: 1,
147
- alignSelf: "flex-start",
148
- },
149
- rightSection: {
150
- flexDirection: "row",
151
- alignItems: "center",
152
- gap: 12 * spacingMult,
153
- },
154
- });
155
- };
@@ -1,12 +0,0 @@
1
- /**
2
- * Accordion Components Barrel Export
3
- */
4
-
5
- export { AccordionPlanCard } from "./AccordionPlanCard";
6
- export { PlanCardHeader } from "./PlanCardHeader";
7
- export { PlanCardDetails } from "./PlanCardDetails";
8
- export type {
9
- AccordionPlanCardProps,
10
- PlanCardHeaderProps,
11
- PlanCardDetailsProps,
12
- } from "./AccordionPlanCardTypes";