@sudobility/subscription-components-rn 1.0.4 → 1.0.5
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/dist/PlatformIcon.d.ts +9 -0
- package/dist/PlatformIcon.d.ts.map +1 -0
- package/dist/SubscriptionLayout.d.ts.map +1 -1
- package/dist/index.js +39 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -8
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/PlatformIcon.tsx +34 -0
- package/src/SubscriptionLayout.tsx +21 -4
- package/src/types.ts +5 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type PlatformType = 'web' | 'ios' | 'android' | 'macos';
|
|
2
|
+
interface PlatformIconProps {
|
|
3
|
+
platform: PlatformType;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function PlatformIcon({ platform, className }: PlatformIconProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function platformDisplayName(platform: PlatformType): string;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=PlatformIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlatformIcon.d.ts","sourceRoot":"","sources":["../src/PlatformIcon.tsx"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC;AAExD,UAAU,iBAAiB;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgBD,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,iBAAiB,2CAMtE;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAElE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionLayout.d.ts","sourceRoot":"","sources":["../src/SubscriptionLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SubscriptionLayout.d.ts","sourceRoot":"","sources":["../src/SubscriptionLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,OAAO,KAAK,EACV,cAAc,EACd,8BAA8B,EAC9B,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,KAAK,CAAC;AAE5D,MAAM,WAAW,uBAAuB;IACtC,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,QAAQ,EAAE,SAAS,CAAC;IACpB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,yBAAyB,CAAC;IAEpC,gDAAgD;IAChD,aAAa,CAAC,EAAE,wBAAwB,CAAC;IAEzC,wFAAwF;IACxF,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAEnC,6FAA6F;IAC7F,eAAe,CAAC,EAAE,kBAAkB,CAAC;IAErC,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,4BAA4B;IAC5B,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B,gFAAgF;IAChF,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B,4DAA4D;IAC5D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC,iCAAiC;IACjC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,8BAA8B,KAAK,IAAI,CAAC;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function SubscriptionTile({
|
|
|
1192
1192
|
}
|
|
1193
1193
|
);
|
|
1194
1194
|
}
|
|
1195
|
+
const PLATFORM_ICONS = {
|
|
1196
|
+
web: "🌐",
|
|
1197
|
+
ios: "",
|
|
1198
|
+
android: "🤖",
|
|
1199
|
+
macos: ""
|
|
1200
|
+
};
|
|
1201
|
+
const PLATFORM_DISPLAY_NAMES = {
|
|
1202
|
+
web: "Web",
|
|
1203
|
+
ios: "iOS",
|
|
1204
|
+
android: "Android",
|
|
1205
|
+
macos: "macOS"
|
|
1206
|
+
};
|
|
1207
|
+
function PlatformIcon({ platform, className }) {
|
|
1208
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className, children: PLATFORM_ICONS[platform] });
|
|
1209
|
+
}
|
|
1210
|
+
function platformDisplayName(platform) {
|
|
1211
|
+
return PLATFORM_DISPLAY_NAMES[platform];
|
|
1212
|
+
}
|
|
1195
1213
|
function SubscriptionLayout({
|
|
1196
1214
|
title,
|
|
1197
1215
|
children,
|
|
@@ -1210,7 +1228,7 @@ function SubscriptionLayout({
|
|
|
1210
1228
|
trackingLabel,
|
|
1211
1229
|
componentName = "SubscriptionLayout"
|
|
1212
1230
|
}) {
|
|
1213
|
-
var _a, _b, _c, _d;
|
|
1231
|
+
var _a, _b, _c, _d, _e;
|
|
1214
1232
|
const showActionButtons = variant === "selection" && primaryAction;
|
|
1215
1233
|
const shouldShowFreeTile = variant === "cta" && freeTileConfig;
|
|
1216
1234
|
const handlePrimaryPress = () => {
|
|
@@ -1231,23 +1249,36 @@ function SubscriptionLayout({
|
|
|
1231
1249
|
headerContent,
|
|
1232
1250
|
currentStatus && /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "mb-6", children: [
|
|
1233
1251
|
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-2xl font-bold text-gray-900 dark:text-gray-100 mb-4", children: currentStatusLabel }),
|
|
1234
|
-
currentStatus.isActive ? /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "bg-
|
|
1252
|
+
currentStatus.isActive ? /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "bg-gray-50 dark:bg-gray-800/30 border border-gray-200 dark:border-gray-700 rounded-lg p-4", children: [
|
|
1235
1253
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row items-center mb-2", children: [
|
|
1236
1254
|
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "w-3 h-3 bg-green-500 rounded-full mr-3" }),
|
|
1237
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "font-semibold text-
|
|
1255
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "font-semibold text-gray-800 dark:text-gray-200", children: ((_a = currentStatus.activeContent) == null ? void 0 : _a.title) || "Active Subscription" })
|
|
1238
1256
|
] }),
|
|
1239
1257
|
((_b = currentStatus.activeContent) == null ? void 0 : _b.fields) && currentStatus.activeContent.fields.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "mt-4 gap-4", children: currentStatus.activeContent.fields.map(
|
|
1240
1258
|
(field, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { children: [
|
|
1241
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm text-
|
|
1242
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "font-semibold text-
|
|
1259
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm text-gray-500 dark:text-gray-400", children: field.label }),
|
|
1260
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "font-semibold text-gray-700 dark:text-gray-300", children: field.value })
|
|
1243
1261
|
] }, index)
|
|
1244
|
-
) })
|
|
1262
|
+
) }),
|
|
1263
|
+
((_c = currentStatus.activeContent) == null ? void 0 : _c.platform) && /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "mt-4", children: [
|
|
1264
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm text-gray-500 dark:text-gray-400", children: currentStatus.activeContent.platform.label }),
|
|
1265
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row items-center gap-1.5 mt-0.5", children: [
|
|
1266
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1267
|
+
PlatformIcon,
|
|
1268
|
+
{
|
|
1269
|
+
platform: currentStatus.activeContent.platform.value,
|
|
1270
|
+
className: "text-gray-600 dark:text-gray-300"
|
|
1271
|
+
}
|
|
1272
|
+
),
|
|
1273
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "font-semibold text-gray-700 dark:text-gray-300", children: platformDisplayName(currentStatus.activeContent.platform.value) })
|
|
1274
|
+
] })
|
|
1275
|
+
] })
|
|
1245
1276
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4", children: [
|
|
1246
1277
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row items-center mb-2", children: [
|
|
1247
1278
|
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "w-3 h-3 bg-yellow-500 rounded-full mr-3" }),
|
|
1248
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "font-semibold text-yellow-800 dark:text-yellow-300", children: ((
|
|
1279
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "font-semibold text-yellow-800 dark:text-yellow-300", children: ((_d = currentStatus.inactiveContent) == null ? void 0 : _d.title) || "No Active Subscription" })
|
|
1249
1280
|
] }),
|
|
1250
|
-
((
|
|
1281
|
+
((_e = currentStatus.inactiveContent) == null ? void 0 : _e.message) && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-yellow-700 dark:text-yellow-400", children: currentStatus.inactiveContent.message })
|
|
1251
1282
|
] })
|
|
1252
1283
|
] }),
|
|
1253
1284
|
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-2xl font-bold text-gray-900 dark:text-gray-100 mb-4", children: title }),
|