@sudobility/subscription-components-rn 1.0.3 → 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/SegmentedControl.d.ts.map +1 -1
- package/dist/SubscriptionLayout.d.ts.map +1 -1
- package/dist/index.js +178 -59
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +179 -60
- 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/SegmentedControl.tsx +143 -70
- 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":"SegmentedControl.d.ts","sourceRoot":"","sources":["../src/SegmentedControl.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC/D,4BAA4B;IAC5B,KAAK,EAAE,CAAC,CAAC;IACT,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC9D,wBAAwB;IACxB,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,EAAE,CAAC;IACrC,+BAA+B;IAC/B,KAAK,EAAE,CAAC,CAAC;IACT,+BAA+B;IAC/B,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,sBAAsB;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0BAA0B;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../src/SegmentedControl.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC/D,4BAA4B;IAC5B,KAAK,EAAE,CAAC,CAAC;IACT,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC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AAC;IAC1B,mBAAmB;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,cAAc,EACd,YAAwB,EACxB,WAAsB,EACtB,aAAa,EACb,IAAW,EACX,SAAc,EACd,QAAgB,GACjB,EAAE,mBAAmB,2CAiBrB;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -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;IAE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IAAI,CAAC;IAC1B,qCAAqC;IACrC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,mBAAmB;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,SAA8B,EAC9B,WAA8B,EAC9B,WAAiC,EACjC,SAAS,EACT,YAAY,EACZ,cAAc,EACd,SAAc,GACf,EAAE,uBAAuB,2CA2CzB;AAED,eAAe,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1192,6 +1192,24 @@ 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 }),
|
|
@@ -1357,26 +1388,6 @@ function SubscriptionFooter({
|
|
|
1357
1388
|
/* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-xs text-gray-400 dark:text-gray-500 text-center px-4", children: "Subscriptions will automatically renew unless canceled at least 24 hours before the end of the current period." })
|
|
1358
1389
|
] });
|
|
1359
1390
|
}
|
|
1360
|
-
const sizeClasses = {
|
|
1361
|
-
sm: {
|
|
1362
|
-
container: "p-1 rounded-lg",
|
|
1363
|
-
segment: "px-3 py-1.5 rounded-md",
|
|
1364
|
-
text: "text-xs",
|
|
1365
|
-
badge: "text-xs px-1.5 py-0.5"
|
|
1366
|
-
},
|
|
1367
|
-
md: {
|
|
1368
|
-
container: "p-1 rounded-lg",
|
|
1369
|
-
segment: "px-4 py-2 rounded-md",
|
|
1370
|
-
text: "text-sm",
|
|
1371
|
-
badge: "text-xs px-2 py-0.5"
|
|
1372
|
-
},
|
|
1373
|
-
lg: {
|
|
1374
|
-
container: "p-1 rounded-lg",
|
|
1375
|
-
segment: "px-6 py-3 rounded-lg",
|
|
1376
|
-
text: "text-base",
|
|
1377
|
-
badge: "text-sm px-2 py-1"
|
|
1378
|
-
}
|
|
1379
|
-
};
|
|
1380
1391
|
function SegmentedControl({
|
|
1381
1392
|
options,
|
|
1382
1393
|
value,
|
|
@@ -1387,34 +1398,22 @@ function SegmentedControl({
|
|
|
1387
1398
|
fullWidth = true,
|
|
1388
1399
|
accessibilityLabel
|
|
1389
1400
|
}) {
|
|
1390
|
-
const sizes = sizeClasses[size];
|
|
1391
|
-
const containerClasses = [
|
|
1392
|
-
"flex-row bg-gray-100 dark:bg-gray-800",
|
|
1393
|
-
sizes.container,
|
|
1394
|
-
fullWidth ? "w-full" : "",
|
|
1395
|
-
disabled ? "opacity-50" : "",
|
|
1396
|
-
className
|
|
1397
|
-
].filter(Boolean).join(" ");
|
|
1398
1401
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1399
1402
|
reactNative.View,
|
|
1400
1403
|
{
|
|
1401
|
-
|
|
1404
|
+
style: [
|
|
1405
|
+
styles.container,
|
|
1406
|
+
fullWidth && styles.fullWidth,
|
|
1407
|
+
disabled && styles.disabled,
|
|
1408
|
+
size === "sm" && styles.containerSm,
|
|
1409
|
+
size === "md" && styles.containerMd,
|
|
1410
|
+
size === "lg" && styles.containerLg
|
|
1411
|
+
],
|
|
1402
1412
|
accessibilityRole: "tablist",
|
|
1403
1413
|
accessibilityLabel,
|
|
1404
1414
|
children: options.map((option) => {
|
|
1405
1415
|
const isSelected = value === option.value;
|
|
1406
1416
|
const isDisabled = disabled || option.disabled;
|
|
1407
|
-
const segmentClasses = [
|
|
1408
|
-
sizes.segment,
|
|
1409
|
-
"flex-1 items-center justify-center flex-row gap-2",
|
|
1410
|
-
isSelected ? "bg-white dark:bg-gray-700 shadow-sm" : "bg-transparent",
|
|
1411
|
-
isDisabled ? "opacity-50" : ""
|
|
1412
|
-
].filter(Boolean).join(" ");
|
|
1413
|
-
const textClasses = [
|
|
1414
|
-
sizes.text,
|
|
1415
|
-
"font-medium",
|
|
1416
|
-
isSelected ? "text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"
|
|
1417
|
-
].join(" ");
|
|
1418
1417
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1419
1418
|
reactNative.Pressable,
|
|
1420
1419
|
{
|
|
@@ -1426,24 +1425,45 @@ function SegmentedControl({
|
|
|
1426
1425
|
disabled: isDisabled
|
|
1427
1426
|
},
|
|
1428
1427
|
accessibilityLabel: option.label + (option.badge ? ", " + option.badge : ""),
|
|
1429
|
-
|
|
1428
|
+
style: [
|
|
1429
|
+
styles.segment,
|
|
1430
|
+
size === "sm" && styles.segmentSm,
|
|
1431
|
+
size === "md" && styles.segmentMd,
|
|
1432
|
+
size === "lg" && styles.segmentLg,
|
|
1433
|
+
isSelected && styles.segmentSelected,
|
|
1434
|
+
isDisabled && styles.disabled
|
|
1435
|
+
],
|
|
1430
1436
|
children: [
|
|
1431
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1437
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1438
|
+
reactNative.Text,
|
|
1439
|
+
{
|
|
1440
|
+
style: [
|
|
1441
|
+
styles.text,
|
|
1442
|
+
size === "sm" && styles.textSm,
|
|
1443
|
+
size === "md" && styles.textMd,
|
|
1444
|
+
size === "lg" && styles.textLg,
|
|
1445
|
+
isSelected ? styles.textSelected : styles.textUnselected
|
|
1446
|
+
],
|
|
1447
|
+
children: option.label
|
|
1448
|
+
}
|
|
1449
|
+
),
|
|
1432
1450
|
option.badge && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1433
1451
|
reactNative.View,
|
|
1434
1452
|
{
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
"
|
|
1438
|
-
|
|
1439
|
-
|
|
1453
|
+
style: [
|
|
1454
|
+
styles.badge,
|
|
1455
|
+
size === "sm" && styles.badgeSm,
|
|
1456
|
+
size === "md" && styles.badgeMd,
|
|
1457
|
+
size === "lg" && styles.badgeLg,
|
|
1458
|
+
isSelected ? styles.badgeSelected : styles.badgeUnselected
|
|
1459
|
+
],
|
|
1440
1460
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1441
1461
|
reactNative.Text,
|
|
1442
1462
|
{
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
isSelected ?
|
|
1446
|
-
]
|
|
1463
|
+
style: [
|
|
1464
|
+
styles.badgeText,
|
|
1465
|
+
isSelected ? styles.badgeTextSelected : styles.badgeTextUnselected
|
|
1466
|
+
],
|
|
1447
1467
|
children: option.badge
|
|
1448
1468
|
}
|
|
1449
1469
|
)
|
|
@@ -1484,6 +1504,105 @@ function PeriodSelector({
|
|
|
1484
1504
|
}
|
|
1485
1505
|
);
|
|
1486
1506
|
}
|
|
1507
|
+
const styles = reactNative.StyleSheet.create({
|
|
1508
|
+
container: {
|
|
1509
|
+
flexDirection: "row",
|
|
1510
|
+
backgroundColor: "#f3f4f6",
|
|
1511
|
+
borderRadius: 8,
|
|
1512
|
+
padding: 4
|
|
1513
|
+
},
|
|
1514
|
+
fullWidth: {
|
|
1515
|
+
width: "100%"
|
|
1516
|
+
},
|
|
1517
|
+
disabled: {
|
|
1518
|
+
opacity: 0.5
|
|
1519
|
+
},
|
|
1520
|
+
containerSm: {
|
|
1521
|
+
borderRadius: 8
|
|
1522
|
+
},
|
|
1523
|
+
containerMd: {
|
|
1524
|
+
borderRadius: 8
|
|
1525
|
+
},
|
|
1526
|
+
containerLg: {
|
|
1527
|
+
borderRadius: 12
|
|
1528
|
+
},
|
|
1529
|
+
segment: {
|
|
1530
|
+
flex: 1,
|
|
1531
|
+
alignItems: "center",
|
|
1532
|
+
justifyContent: "center",
|
|
1533
|
+
flexDirection: "row"
|
|
1534
|
+
},
|
|
1535
|
+
segmentSm: {
|
|
1536
|
+
paddingHorizontal: 12,
|
|
1537
|
+
paddingVertical: 6,
|
|
1538
|
+
borderRadius: 6,
|
|
1539
|
+
gap: 8
|
|
1540
|
+
},
|
|
1541
|
+
segmentMd: {
|
|
1542
|
+
paddingHorizontal: 16,
|
|
1543
|
+
paddingVertical: 8,
|
|
1544
|
+
borderRadius: 6,
|
|
1545
|
+
gap: 8
|
|
1546
|
+
},
|
|
1547
|
+
segmentLg: {
|
|
1548
|
+
paddingHorizontal: 24,
|
|
1549
|
+
paddingVertical: 12,
|
|
1550
|
+
borderRadius: 8,
|
|
1551
|
+
gap: 8
|
|
1552
|
+
},
|
|
1553
|
+
segmentSelected: {
|
|
1554
|
+
backgroundColor: "#ffffff"
|
|
1555
|
+
},
|
|
1556
|
+
text: {
|
|
1557
|
+
fontWeight: "500"
|
|
1558
|
+
},
|
|
1559
|
+
textSm: {
|
|
1560
|
+
fontSize: 12
|
|
1561
|
+
},
|
|
1562
|
+
textMd: {
|
|
1563
|
+
fontSize: 14
|
|
1564
|
+
},
|
|
1565
|
+
textLg: {
|
|
1566
|
+
fontSize: 16
|
|
1567
|
+
},
|
|
1568
|
+
textSelected: {
|
|
1569
|
+
color: "#111827"
|
|
1570
|
+
},
|
|
1571
|
+
textUnselected: {
|
|
1572
|
+
color: "#4b5563"
|
|
1573
|
+
},
|
|
1574
|
+
badge: {
|
|
1575
|
+
borderRadius: 999
|
|
1576
|
+
},
|
|
1577
|
+
badgeSm: {
|
|
1578
|
+
paddingHorizontal: 6,
|
|
1579
|
+
paddingVertical: 2
|
|
1580
|
+
},
|
|
1581
|
+
badgeMd: {
|
|
1582
|
+
paddingHorizontal: 8,
|
|
1583
|
+
paddingVertical: 2
|
|
1584
|
+
},
|
|
1585
|
+
badgeLg: {
|
|
1586
|
+
paddingHorizontal: 8,
|
|
1587
|
+
paddingVertical: 4
|
|
1588
|
+
},
|
|
1589
|
+
badgeSelected: {
|
|
1590
|
+
backgroundColor: "#dcfce7"
|
|
1591
|
+
},
|
|
1592
|
+
badgeUnselected: {
|
|
1593
|
+
backgroundColor: "#e5e7eb"
|
|
1594
|
+
},
|
|
1595
|
+
badgeText: {
|
|
1596
|
+
fontSize: 12,
|
|
1597
|
+
fontWeight: "600"
|
|
1598
|
+
},
|
|
1599
|
+
badgeTextSelected: {
|
|
1600
|
+
color: "#15803d"
|
|
1601
|
+
},
|
|
1602
|
+
badgeTextUnselected: {
|
|
1603
|
+
color: "#4b5563"
|
|
1604
|
+
}
|
|
1605
|
+
});
|
|
1487
1606
|
const SubscriptionContext = require$$0.createContext(
|
|
1488
1607
|
void 0
|
|
1489
1608
|
);
|