@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
package/dist/index.mjs
CHANGED
|
@@ -1190,6 +1190,24 @@ function SubscriptionTile({
|
|
|
1190
1190
|
}
|
|
1191
1191
|
);
|
|
1192
1192
|
}
|
|
1193
|
+
const PLATFORM_ICONS = {
|
|
1194
|
+
web: "🌐",
|
|
1195
|
+
ios: "",
|
|
1196
|
+
android: "🤖",
|
|
1197
|
+
macos: ""
|
|
1198
|
+
};
|
|
1199
|
+
const PLATFORM_DISPLAY_NAMES = {
|
|
1200
|
+
web: "Web",
|
|
1201
|
+
ios: "iOS",
|
|
1202
|
+
android: "Android",
|
|
1203
|
+
macos: "macOS"
|
|
1204
|
+
};
|
|
1205
|
+
function PlatformIcon({ platform, className }) {
|
|
1206
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className, children: PLATFORM_ICONS[platform] });
|
|
1207
|
+
}
|
|
1208
|
+
function platformDisplayName(platform) {
|
|
1209
|
+
return PLATFORM_DISPLAY_NAMES[platform];
|
|
1210
|
+
}
|
|
1193
1211
|
function SubscriptionLayout({
|
|
1194
1212
|
title,
|
|
1195
1213
|
children,
|
|
@@ -1208,7 +1226,7 @@ function SubscriptionLayout({
|
|
|
1208
1226
|
trackingLabel,
|
|
1209
1227
|
componentName = "SubscriptionLayout"
|
|
1210
1228
|
}) {
|
|
1211
|
-
var _a, _b, _c, _d;
|
|
1229
|
+
var _a, _b, _c, _d, _e;
|
|
1212
1230
|
const showActionButtons = variant === "selection" && primaryAction;
|
|
1213
1231
|
const shouldShowFreeTile = variant === "cta" && freeTileConfig;
|
|
1214
1232
|
const handlePrimaryPress = () => {
|
|
@@ -1229,23 +1247,36 @@ function SubscriptionLayout({
|
|
|
1229
1247
|
headerContent,
|
|
1230
1248
|
currentStatus && /* @__PURE__ */ jsxRuntimeExports.jsxs(View, { className: "mb-6", children: [
|
|
1231
1249
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: "text-2xl font-bold text-gray-900 dark:text-gray-100 mb-4", children: currentStatusLabel }),
|
|
1232
|
-
currentStatus.isActive ? /* @__PURE__ */ jsxRuntimeExports.jsxs(View, { className: "bg-
|
|
1250
|
+
currentStatus.isActive ? /* @__PURE__ */ jsxRuntimeExports.jsxs(View, { className: "bg-gray-50 dark:bg-gray-800/30 border border-gray-200 dark:border-gray-700 rounded-lg p-4", children: [
|
|
1233
1251
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(View, { className: "flex-row items-center mb-2", children: [
|
|
1234
1252
|
/* @__PURE__ */ jsxRuntimeExports.jsx(View, { className: "w-3 h-3 bg-green-500 rounded-full mr-3" }),
|
|
1235
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: "font-semibold text-
|
|
1253
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: "font-semibold text-gray-800 dark:text-gray-200", children: ((_a = currentStatus.activeContent) == null ? void 0 : _a.title) || "Active Subscription" })
|
|
1236
1254
|
] }),
|
|
1237
1255
|
((_b = currentStatus.activeContent) == null ? void 0 : _b.fields) && currentStatus.activeContent.fields.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(View, { className: "mt-4 gap-4", children: currentStatus.activeContent.fields.map(
|
|
1238
1256
|
(field, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(View, { children: [
|
|
1239
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: "text-sm text-
|
|
1240
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: "font-semibold text-
|
|
1257
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: "text-sm text-gray-500 dark:text-gray-400", children: field.label }),
|
|
1258
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: "font-semibold text-gray-700 dark:text-gray-300", children: field.value })
|
|
1241
1259
|
] }, index)
|
|
1242
|
-
) })
|
|
1260
|
+
) }),
|
|
1261
|
+
((_c = currentStatus.activeContent) == null ? void 0 : _c.platform) && /* @__PURE__ */ jsxRuntimeExports.jsxs(View, { className: "mt-4", children: [
|
|
1262
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: "text-sm text-gray-500 dark:text-gray-400", children: currentStatus.activeContent.platform.label }),
|
|
1263
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(View, { className: "flex-row items-center gap-1.5 mt-0.5", children: [
|
|
1264
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1265
|
+
PlatformIcon,
|
|
1266
|
+
{
|
|
1267
|
+
platform: currentStatus.activeContent.platform.value,
|
|
1268
|
+
className: "text-gray-600 dark:text-gray-300"
|
|
1269
|
+
}
|
|
1270
|
+
),
|
|
1271
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: "font-semibold text-gray-700 dark:text-gray-300", children: platformDisplayName(currentStatus.activeContent.platform.value) })
|
|
1272
|
+
] })
|
|
1273
|
+
] })
|
|
1243
1274
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(View, { className: "bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4", children: [
|
|
1244
1275
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(View, { className: "flex-row items-center mb-2", children: [
|
|
1245
1276
|
/* @__PURE__ */ jsxRuntimeExports.jsx(View, { className: "w-3 h-3 bg-yellow-500 rounded-full mr-3" }),
|
|
1246
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: "font-semibold text-yellow-800 dark:text-yellow-300", children: ((
|
|
1277
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: "font-semibold text-yellow-800 dark:text-yellow-300", children: ((_d = currentStatus.inactiveContent) == null ? void 0 : _d.title) || "No Active Subscription" })
|
|
1247
1278
|
] }),
|
|
1248
|
-
((
|
|
1279
|
+
((_e = currentStatus.inactiveContent) == null ? void 0 : _e.message) && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: "text-yellow-700 dark:text-yellow-400", children: currentStatus.inactiveContent.message })
|
|
1249
1280
|
] })
|
|
1250
1281
|
] }),
|
|
1251
1282
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { className: "text-2xl font-bold text-gray-900 dark:text-gray-100 mb-4", children: title }),
|