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