@btndprojects/loam-ui-native 0.1.0 → 0.2.1
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/README.md +56 -0
- package/dist/accordion/index.js +5 -3
- package/dist/adaptive/index.js +6 -2
- package/dist/alert/index.js +5 -2
- package/dist/analyzer/index.js +9 -6
- package/dist/announcement/index.js +8 -5
- package/dist/audio-player/index.js +5 -3
- package/dist/avatar/index.js +5 -2
- package/dist/avatar-group/index.js +7 -3
- package/dist/badge/index.js +7 -4
- package/dist/banner/index.js +5 -2
- package/dist/board/index.js +11 -6
- package/dist/button/index.js +6 -3
- package/dist/camera-permission/index.js +15 -12
- package/dist/capture-result/index.js +19 -16
- package/dist/card/index.js +6 -3
- package/dist/card-form/index.js +12 -8
- package/dist/carousel/index.js +4 -2
- package/dist/chart/index.js +8 -5
- package/dist/charts/index.js +8 -6
- package/dist/chat/index.js +16 -0
- package/dist/checkbox/index.js +6 -4
- package/dist/checklist/index.js +11 -8
- package/dist/checkout/index.js +16 -11
- package/dist/chip/index.js +7 -4
- package/dist/{chunk-XNUVB5OL.js → chunk-2OLKPG4E.js} +92 -28
- package/dist/{chunk-RUZHTGKB.js → chunk-2PKYGLQ6.js} +71 -40
- package/dist/{chunk-UC2WGUP3.js → chunk-2SWKL3AJ.js} +91 -252
- package/dist/{chunk-AI4DWZCD.js → chunk-2SY63FCH.js} +63 -16
- package/dist/{chunk-F5XNPWS7.js → chunk-2TXERVVA.js} +92 -35
- package/dist/chunk-36EC2T6P.js +581 -0
- package/dist/chunk-3DUWIYV5.js +437 -0
- package/dist/{chunk-RGQWWKLA.js → chunk-3QMEOFW5.js} +275 -71
- package/dist/chunk-3WEZCGHX.js +265 -0
- package/dist/chunk-46MMSDGL.js +194 -0
- package/dist/{chunk-7O2FMUPT.js → chunk-4IZXHVFJ.js} +297 -92
- package/dist/{chunk-LAECSR4H.js → chunk-5LAAAXFP.js} +14 -8
- package/dist/{chunk-2A5NIQAK.js → chunk-5RENVKBQ.js} +134 -46
- package/dist/{chunk-2ZZ7TDJ4.js → chunk-5UTRIXQ6.js} +37 -31
- package/dist/{chunk-LOE5YNN3.js → chunk-5VFZRGVD.js} +37 -10
- package/dist/{chunk-52X2VYTD.js → chunk-67IZZ2MJ.js} +115 -60
- package/dist/{chunk-UYG5L34B.js → chunk-6YAQBXB3.js} +10 -4
- package/dist/{chunk-BTTFCMKG.js → chunk-74FLKD24.js} +94 -23
- package/dist/{chunk-ITTYJZWX.js → chunk-7BUIKDD6.js} +73 -18
- package/dist/{chunk-FOKG57CR.js → chunk-7OVVSVEZ.js} +273 -109
- package/dist/chunk-AEB7KCHQ.js +287 -0
- package/dist/chunk-APCWFOZW.js +28 -0
- package/dist/chunk-AWKQIE5I.js +139 -0
- package/dist/{chunk-VCDBXW5H.js → chunk-B7N4ASYE.js} +86 -42
- package/dist/{chunk-IVNRBPGC.js → chunk-C4GTDLRC.js} +104 -20
- package/dist/{chunk-4ZAHCY44.js → chunk-C6APNDVA.js} +12 -5
- package/dist/{chunk-4SZYY6AN.js → chunk-CMTVNF3D.js} +18 -13
- package/dist/{chunk-WVKKJA6U.js → chunk-CPTOADB2.js} +151 -96
- package/dist/chunk-D5N5QWI7.js +1325 -0
- package/dist/{chunk-IIQTAY3J.js → chunk-DN7MNQIP.js} +113 -29
- package/dist/{chunk-47FWHGUN.js → chunk-DVGBZ3TX.js} +84 -23
- package/dist/chunk-DW3L54DQ.js +305 -0
- package/dist/{chunk-3ARE4TES.js → chunk-E2E3I5W2.js} +69 -18
- package/dist/{chunk-DHWADYZX.js → chunk-EDCBJV7J.js} +41 -28
- package/dist/{chunk-WSW6ZFAQ.js → chunk-ENP3BMZU.js} +4 -4
- package/dist/{chunk-OOPPQH27.js → chunk-EVOIGUBI.js} +43 -19
- package/dist/{chunk-VEAYTRPX.js → chunk-EY4DD67D.js} +165 -97
- package/dist/{chunk-223Q2T2Q.js → chunk-F3H33DQX.js} +132 -61
- package/dist/{chunk-CYRBHQQZ.js → chunk-F5B3UINI.js} +68 -35
- package/dist/{chunk-6X6PQ443.js → chunk-FAJI7BSC.js} +20 -9
- package/dist/{chunk-MOUJOP55.js → chunk-FUMHAAF3.js} +96 -29
- package/dist/{chunk-6HT2LP62.js → chunk-FV6HMP7W.js} +192 -73
- package/dist/{chunk-S7F6XLTK.js → chunk-FYWNRX4F.js} +76 -47
- package/dist/{chunk-YG3ZJHGU.js → chunk-FZGAAOKS.js} +30 -8
- package/dist/{chunk-YDGVJETP.js → chunk-G3AFC24V.js} +1 -1
- package/dist/{chunk-EJBDRVIH.js → chunk-G6UESEVN.js} +15 -8
- package/dist/chunk-GDKVKNR2.js +339 -0
- package/dist/chunk-GEIGMWNF.js +10 -0
- package/dist/{chunk-JUAMLEHX.js → chunk-H7DWSL4O.js} +24 -12
- package/dist/chunk-HJFFOOJ4.js +1 -0
- package/dist/{chunk-RW6ZL2FQ.js → chunk-HJLPZA4X.js} +106 -21
- package/dist/chunk-HYEOQWT7.js +647 -0
- package/dist/chunk-I2KLQ2HA.js +19 -0
- package/dist/{chunk-CJ5EOYZE.js → chunk-I4FHVKEC.js} +11 -5
- package/dist/{chunk-JNH2TYIN.js → chunk-IDM7JJMO.js} +19 -5
- package/dist/{chunk-O4AEHWII.js → chunk-IPUNJMAQ.js} +141 -49
- package/dist/{chunk-J7Q7VCVC.js → chunk-IT6FUXXG.js} +13 -6
- package/dist/{chunk-QJJ6MADV.js → chunk-IVKMZ7BB.js} +80 -28
- package/dist/{chunk-Z7H7VSFZ.js → chunk-IXKWIFWZ.js} +17 -6
- package/dist/chunk-J64KGCGX.js +55 -0
- package/dist/chunk-JBMLWFSJ.js +270 -0
- package/dist/{chunk-4BXMXBJO.js → chunk-JJLPBRVZ.js} +22 -11
- package/dist/chunk-JLC6PM5S.js +406 -0
- package/dist/chunk-JUYWSSKW.js +335 -0
- package/dist/{chunk-7CFF4HXS.js → chunk-JV5YOTOB.js} +49 -11
- package/dist/{chunk-LZLHELAG.js → chunk-KFJGFLMW.js} +29 -8
- package/dist/{chunk-O7AE6DAF.js → chunk-KQZ3GLHR.js} +18 -8
- package/dist/{chunk-N32RGOA5.js → chunk-LKFC4CS7.js} +80 -24
- package/dist/{chunk-YC6WORFL.js → chunk-LMPHCVJJ.js} +82 -50
- package/dist/{chunk-3WPW4KUN.js → chunk-LQP4KEXZ.js} +45 -13
- package/dist/{chunk-TKQYWZ5V.js → chunk-LUMVGO2K.js} +47 -31
- package/dist/{chunk-AWJOCGFZ.js → chunk-M656FYNH.js} +25 -13
- package/dist/{chunk-35OFI3JG.js → chunk-MKSNFG7H.js} +73 -20
- package/dist/{chunk-4GBOGOTV.js → chunk-NBEF4EPJ.js} +16 -6
- package/dist/chunk-NNCOFLNE.js +24 -0
- package/dist/{chunk-4YQOR7JM.js → chunk-NTQ2F3AU.js} +73 -20
- package/dist/{chunk-QCDXZBC5.js → chunk-O5V4TG3V.js} +126 -44
- package/dist/{chunk-U7TFM2JA.js → chunk-OJQUBQWA.js} +3 -3
- package/dist/{chunk-VQHPQEUH.js → chunk-OWAMM2DK.js} +13 -6
- package/dist/chunk-PID3NJB7.js +405 -0
- package/dist/{chunk-66SG2H23.js → chunk-PMMTGBBS.js} +27 -17
- package/dist/{chunk-RIBDXGUG.js → chunk-PNF3NKB5.js} +49 -16
- package/dist/{chunk-JXJB2X6M.js → chunk-Q6NKEPRE.js} +81 -32
- package/dist/chunk-QDZGFXQD.js +176 -0
- package/dist/{chunk-SYNOJOQO.js → chunk-QEYFDRHR.js} +60 -26
- package/dist/{chunk-VBOXAEPI.js → chunk-QHAITQIF.js} +97 -22
- package/dist/{chunk-VXDZFJGP.js → chunk-QHTVYA65.js} +230 -76
- package/dist/{chunk-TUTI5HOZ.js → chunk-QIKT7LIB.js} +14 -8
- package/dist/{chunk-3ENTMPQY.js → chunk-QP3KMOVF.js} +82 -42
- package/dist/{chunk-GNNJ4GCC.js → chunk-QPWDDJJ4.js} +62 -148
- package/dist/{chunk-QWCMU5B2.js → chunk-QRUMA22E.js} +205 -80
- package/dist/{chunk-ZVFE5QGU.js → chunk-QYPE5JX3.js} +50 -10
- package/dist/{chunk-PUPM2YGF.js → chunk-ROCUG24E.js} +76 -36
- package/dist/{chunk-NQYBUO3K.js → chunk-RU3ZPNL6.js} +333 -142
- package/dist/{chunk-TOXAGRDQ.js → chunk-RXSCIO6W.js} +14 -5
- package/dist/{chunk-FIF2M24N.js → chunk-SATMR6SG.js} +631 -203
- package/dist/{chunk-4YIP3CWS.js → chunk-SHHY5OMK.js} +7 -5
- package/dist/chunk-SKWO3SZF.js +2284 -0
- package/dist/{chunk-YF4NSSMT.js → chunk-SWS5JQIF.js} +41 -13
- package/dist/{chunk-CUMUNPXY.js → chunk-T5LTPKX6.js} +15 -7
- package/dist/{chunk-H6NIOQHK.js → chunk-TDMG26JI.js} +26 -6
- package/dist/{chunk-UWFLYMAR.js → chunk-TLCIR6RG.js} +267 -126
- package/dist/{chunk-SBMNWWBV.js → chunk-TN2ZNJUI.js} +47 -9
- package/dist/{chunk-5YNTNN5A.js → chunk-TQVAIKFD.js} +106 -41
- package/dist/chunk-TRGFFU6A.js +1456 -0
- package/dist/{chunk-2GK6PHGE.js → chunk-TY4MTKQJ.js} +100 -22
- package/dist/{chunk-AZRX6SAC.js → chunk-U23FYWME.js} +15 -7
- package/dist/{chunk-PZXZJBMP.js → chunk-U5NLHYV6.js} +26 -12
- package/dist/chunk-UQEN55EY.js +1 -0
- package/dist/chunk-UQGBTPXH.js +218 -0
- package/dist/chunk-UXGIW7OK.js +116 -0
- package/dist/{chunk-PJXUJYS6.js → chunk-UYGDJWMN.js} +55 -30
- package/dist/{chunk-QDYDBCFP.js → chunk-V2OEB75Z.js} +50 -51
- package/dist/{chunk-LSS54GLJ.js → chunk-VAOAKWUK.js} +34 -13
- package/dist/{chunk-DM5QUKKO.js → chunk-VDPK5CY4.js} +18 -6
- package/dist/chunk-W23G6JLF.js +37 -0
- package/dist/{chunk-CDRZHT42.js → chunk-W63AJTM7.js} +276 -12
- package/dist/{chunk-XXXEFXY5.js → chunk-W74TXYFB.js} +13 -5
- package/dist/{chunk-LRJNDEIA.js → chunk-WRDSPUE7.js} +144 -29
- package/dist/{chunk-C2NTXVWM.js → chunk-XBZGDDMR.js} +11 -4
- package/dist/{chunk-BV3B2HYZ.js → chunk-XIDTBCBA.js} +189 -131
- package/dist/{chunk-DSJBXLUG.js → chunk-XN4KG3P4.js} +348 -153
- package/dist/chunk-XQXMLMH3.js +211 -0
- package/dist/{chunk-HPPW424V.js → chunk-XTORZWRF.js} +19 -8
- package/dist/{chunk-P23EQNRQ.js → chunk-YAAHPATV.js} +181 -30
- package/dist/{chunk-KMI5ML5I.js → chunk-YXOAPXMU.js} +57 -18
- package/dist/{chunk-RJQOOHT2.js → chunk-ZECZOOSB.js} +59 -28
- package/dist/{chunk-QKXCPTFS.js → chunk-ZLTO5VQI.js} +121 -31
- package/dist/{chunk-BEDBFJND.js → chunk-ZVATDZOM.js} +16 -18
- package/dist/coachmark/index.js +6 -3
- package/dist/code-block/index.js +5 -3
- package/dist/color-field/index.js +6 -4
- package/dist/commerce/index.js +19 -16
- package/dist/connectivity/index.js +5 -2
- package/dist/context-menu/index.js +5 -3
- package/dist/copy-button/index.js +4 -2
- package/dist/data-grid/index.js +21 -16
- package/dist/date-range-picker/index.js +11 -8
- package/dist/description-list/index.js +3 -1
- package/dist/dialog/index.js +4 -2
- package/dist/empty-state/index.js +4 -2
- package/dist/error-summary/index.js +4 -2
- package/dist/fab/index.js +5 -2
- package/dist/file-manager/index.js +28 -0
- package/dist/file-upload/index.js +10 -7
- package/dist/filter-bar/index.js +9 -6
- package/dist/flow-run/index.js +15 -12
- package/dist/form/index.js +5 -3
- package/dist/gallery/index.js +5 -2
- package/dist/hold-to-confirm/index.js +4 -2
- package/dist/index.d.ts +9557 -2985
- package/dist/index.js +355 -122
- package/dist/infinite-list/index.js +4 -2
- package/dist/inline-edit/index.js +6 -4
- package/dist/input/index.js +5 -3
- package/dist/interactions/index.js +2 -1
- package/dist/invoice/index.js +13 -9
- package/dist/kbd/index.js +5 -1
- package/dist/keyboard/index.js +4 -2
- package/dist/list-row/index.js +6 -4
- package/dist/log-viewer/index.js +4 -2
- package/dist/map-view/index.js +5 -3
- package/dist/markdown/index.js +9 -6
- package/dist/metric/index.js +7 -4
- package/dist/money/index.js +9 -3
- package/dist/nav-drawer/index.js +4 -2
- package/dist/nav-header/index.js +9 -0
- package/dist/navigation/index.js +5 -2
- package/dist/notification-center/index.js +12 -10
- package/dist/number-roll/index.js +5 -2
- package/dist/one-handed/index.js +5 -3
- package/dist/os-surfaces/index.js +6 -3
- package/dist/otp/index.js +7 -4
- package/dist/page-header/index.js +1 -0
- package/dist/pagination/index.js +6 -0
- package/dist/payment-method/index.js +14 -10
- package/dist/payment-status/index.js +17 -14
- package/dist/permission/index.js +5 -2
- package/dist/picker/index.js +11 -6
- package/dist/progress/index.js +6 -3
- package/dist/pull-to-refresh/index.js +4 -2
- package/dist/radio-group/index.js +6 -4
- package/dist/rating/index.js +5 -2
- package/dist/receivables/index.js +21 -16
- package/dist/refund/index.js +18 -14
- package/dist/save-status/index.js +5 -3
- package/dist/scroll-area/index.js +3 -1
- package/dist/search-field/index.js +8 -0
- package/dist/segmented-control/index.js +4 -3
- package/dist/sheet/index.js +5 -3
- package/dist/skeleton/index.js +3 -1
- package/dist/slider/index.js +4 -2
- package/dist/sortable/index.js +7 -0
- package/dist/spinner/index.js +3 -1
- package/dist/split-button/index.js +9 -6
- package/dist/spotlight/index.js +3 -1
- package/dist/stage-timeline/index.js +5 -3
- package/dist/status-dot/index.js +4 -2
- package/dist/stepper/index.js +7 -4
- package/dist/streaming-text/index.js +3 -2
- package/dist/survey/index.js +18 -15
- package/dist/switch/index.js +5 -3
- package/dist/system-state/index.js +7 -4
- package/dist/tab-bar/index.js +5 -2
- package/dist/tabs/index.js +4 -2
- package/dist/tags-input/index.js +10 -0
- package/dist/textarea/index.js +6 -4
- package/dist/thinking/index.js +3 -1
- package/dist/time-field/index.js +12 -0
- package/dist/time-range-control/index.js +22 -0
- package/dist/timeline/index.js +4 -2
- package/dist/toast/index.js +4 -2
- package/dist/toolbar/index.js +4 -2
- package/dist/tour/index.js +12 -9
- package/dist/truncation-notice/index.js +5 -2
- package/dist/update-notice/index.js +12 -9
- package/dist/video-player/index.js +5 -2
- package/dist/viewfinder/index.js +6 -4
- package/dist/widget/index.js +7 -4
- package/dist/wizard/index.js +7 -4
- package/package.json +13 -12
- package/dist/chunk-6N33LFQA.js +0 -35
- package/dist/chunk-GDKZTW34.js +0 -395
- package/dist/chunk-GL7B2DOW.js +0 -134
- package/dist/chunk-NKB7BZYK.js +0 -167
- package/dist/chunk-OETCUXQP.js +0 -134
- package/dist/chunk-OPXFZ4Y5.js +0 -204
- package/dist/chunk-Q72LJOVE.js +0 -169
- package/dist/chunk-RNGLIHFA.js +0 -191
- package/dist/chunk-RQ3HASCC.js +0 -6
- package/dist/chunk-RSOJT5YW.js +0 -124
- package/dist/chunk-TKVFVF5D.js +0 -95
- package/dist/chunk-XOSCY2CW.js +0 -242
- package/dist/header/index.js +0 -5
- package/dist/search-bar/index.js +0 -5
- /package/dist/{chunk-3ECPOSKO.js → chunk-3UG6JUCV.js} +0 -0
- /package/dist/{chunk-JRLTGLN4.js → chunk-5WWRTEPS.js} +0 -0
- /package/dist/{chunk-RTIKSY6A.js → chunk-5Z5ZYMOJ.js} +0 -0
|
@@ -1,20 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { SegmentedControl } from './chunk-
|
|
4
|
-
import { Progress } from './chunk-
|
|
5
|
-
import { Amount, PriceRow } from './chunk-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
1
|
+
import { List, ListRow } from './chunk-C4GTDLRC.js';
|
|
2
|
+
import { Switch } from './chunk-FZGAAOKS.js';
|
|
3
|
+
import { SegmentedControl } from './chunk-TQVAIKFD.js';
|
|
4
|
+
import { Progress } from './chunk-5UTRIXQ6.js';
|
|
5
|
+
import { Amount, PriceRow } from './chunk-QHAITQIF.js';
|
|
6
|
+
import { usePayLabels } from './chunk-GEIGMWNF.js';
|
|
7
|
+
import { TextField } from './chunk-7BUIKDD6.js';
|
|
8
|
+
import { Badge } from './chunk-TN2ZNJUI.js';
|
|
9
|
+
import { Button } from './chunk-E2E3I5W2.js';
|
|
10
|
+
import { useLabels, useLoamLocale } from './chunk-APCWFOZW.js';
|
|
11
|
+
import { Icon } from './chunk-UXGIW7OK.js';
|
|
12
|
+
import * as React2 from 'react';
|
|
11
13
|
import { Platform, ScrollView, Text, View, Pressable } from 'react-native';
|
|
12
14
|
import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
|
|
13
15
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
14
|
-
import { yearlySaving, planDelta,
|
|
16
|
+
import { yearlySaving, planDelta, planCta, yearlyMonthly, money } from '@btndprojects/loam-pay';
|
|
15
17
|
|
|
18
|
+
// src/commerce/commerce-labels.ts
|
|
19
|
+
var TOGGLE_ROW_LABELS = {
|
|
20
|
+
withDescription: (label, description) => `${label}, ${description}`
|
|
21
|
+
};
|
|
22
|
+
var NOTIFICATION_PREFERENCES_LABELS = {
|
|
23
|
+
systemOn: "System notifications are on. Turn categories off here rather than muting the whole app.",
|
|
24
|
+
systemOff: "Notifications are turned off for this app in system settings. Your choices below are kept, and take effect as soon as you turn them back on.",
|
|
25
|
+
openSettings: "Open Settings"
|
|
26
|
+
};
|
|
27
|
+
var DELETE_ACCOUNT_LABELS = {
|
|
28
|
+
title: "Delete account",
|
|
29
|
+
whatIsDeleted: "What is deleted",
|
|
30
|
+
whatIsKept: "What is kept, and why",
|
|
31
|
+
deletionCompletes: (duration) => `Deletion completes ${duration}.`,
|
|
32
|
+
typeToConfirm: (phrase) => `Type ${phrase} to confirm`,
|
|
33
|
+
confirm: "Delete my account",
|
|
34
|
+
busy: "Deleting\u2026",
|
|
35
|
+
keep: "Keep my account"
|
|
36
|
+
};
|
|
37
|
+
var MANAGE_SUBSCRIPTION_LABELS = {
|
|
38
|
+
statusActive: "Active",
|
|
39
|
+
statusTrial: "Trial",
|
|
40
|
+
statusCanceled: "Canceled",
|
|
41
|
+
statusPastDue: "Past due",
|
|
42
|
+
renews: "renews",
|
|
43
|
+
renewalLine: (price, renews, date) => `${price} \xB7 ${renews} ${date}`,
|
|
44
|
+
payment: "Payment",
|
|
45
|
+
paymentLine: (payment, method) => `${payment} \xB7 ${method}`,
|
|
46
|
+
cancel: "Cancel subscription"
|
|
47
|
+
};
|
|
16
48
|
function DeleteAccountScreen({
|
|
17
|
-
title
|
|
49
|
+
title: titleProp,
|
|
18
50
|
deletes,
|
|
19
51
|
retains,
|
|
20
52
|
duration,
|
|
@@ -22,15 +54,24 @@ function DeleteAccountScreen({
|
|
|
22
54
|
confirmationLabel,
|
|
23
55
|
confirmationValue,
|
|
24
56
|
onConfirmationChange,
|
|
25
|
-
confirmLabel
|
|
57
|
+
confirmLabel: confirmLabelProp,
|
|
26
58
|
onConfirm,
|
|
27
|
-
|
|
28
|
-
|
|
59
|
+
loading = false,
|
|
60
|
+
busyLabel: busyLabelProp,
|
|
61
|
+
cancelLabel: cancelLabelProp,
|
|
62
|
+
onCancel,
|
|
63
|
+
labels: labelsProp
|
|
29
64
|
}) {
|
|
30
65
|
const { styles } = useStyles(sheet);
|
|
31
|
-
const
|
|
66
|
+
const labels = useLabels("deleteAccount", DELETE_ACCOUNT_LABELS, labelsProp);
|
|
67
|
+
const title = titleProp ?? labels.title;
|
|
68
|
+
const confirmLabel = confirmLabelProp ?? labels.confirm;
|
|
69
|
+
const busyLabel = busyLabelProp ?? labels.busy;
|
|
70
|
+
const cancelLabel = cancelLabelProp ?? labels.keep;
|
|
71
|
+
const confirmationName = confirmationLabel ?? labels.typeToConfirm(confirmationPhrase);
|
|
72
|
+
const theme = useLoamTheme("commerce");
|
|
32
73
|
const isControlled = confirmationValue !== void 0;
|
|
33
|
-
const [internal, setInternal] =
|
|
74
|
+
const [internal, setInternal] = React2.useState("");
|
|
34
75
|
const typed = isControlled ? confirmationValue : internal;
|
|
35
76
|
const armed = typed.trim() === confirmationPhrase;
|
|
36
77
|
const change = (next) => {
|
|
@@ -40,45 +81,45 @@ function DeleteAccountScreen({
|
|
|
40
81
|
return /* @__PURE__ */ jsxs(ScrollView, { style: styles.screen, contentContainerStyle: styles.scroll, children: [
|
|
41
82
|
/* @__PURE__ */ jsx(Text, { style: styles.title, children: title }),
|
|
42
83
|
/* @__PURE__ */ jsxs(View, { style: styles.group, children: [
|
|
43
|
-
/* @__PURE__ */ jsx(Text, { style: styles.caption, children:
|
|
84
|
+
/* @__PURE__ */ jsx(Text, { style: styles.caption, children: labels.whatIsDeleted }),
|
|
44
85
|
deletes.map((d) => /* @__PURE__ */ jsxs(View, { style: styles.row, children: [
|
|
45
86
|
/* @__PURE__ */ jsx(Icon, { name: "trash", size: theme.icon.sm, color: theme.color.danger }),
|
|
46
87
|
/* @__PURE__ */ jsx(Text, { style: styles.rowLabel, children: d })
|
|
47
88
|
] }, d))
|
|
48
89
|
] }),
|
|
49
90
|
/* @__PURE__ */ jsxs(View, { style: styles.group, children: [
|
|
50
|
-
/* @__PURE__ */ jsx(Text, { style: styles.caption, children:
|
|
91
|
+
/* @__PURE__ */ jsx(Text, { style: styles.caption, children: labels.whatIsKept }),
|
|
51
92
|
retains.map((r) => /* @__PURE__ */ jsxs(View, { style: styles.row, children: [
|
|
52
93
|
/* @__PURE__ */ jsx(Icon, { name: "lock", size: theme.icon.sm, color: theme.color.text3 }),
|
|
53
94
|
/* @__PURE__ */ jsx(Text, { style: styles.rowLabel, children: r })
|
|
54
95
|
] }, r))
|
|
55
96
|
] }),
|
|
56
|
-
/* @__PURE__ */ jsx(View, { style: styles.duration, children: /* @__PURE__ */ jsx(Text, { style: styles.durationText, children:
|
|
97
|
+
/* @__PURE__ */ jsx(View, { style: styles.duration, children: /* @__PURE__ */ jsx(Text, { style: styles.durationText, children: labels.deletionCompletes(duration) }) }),
|
|
57
98
|
/* @__PURE__ */ jsx(
|
|
58
99
|
TextField,
|
|
59
100
|
{
|
|
60
|
-
label:
|
|
101
|
+
label: confirmationName,
|
|
61
102
|
value: typed,
|
|
62
103
|
onChangeText: change,
|
|
63
104
|
autoCapitalize: "characters",
|
|
64
105
|
autoCorrect: false,
|
|
65
|
-
accessibilityLabel:
|
|
106
|
+
accessibilityLabel: confirmationName
|
|
66
107
|
}
|
|
67
108
|
),
|
|
68
109
|
/* @__PURE__ */ jsx(
|
|
69
110
|
Pressable,
|
|
70
111
|
{
|
|
71
112
|
accessibilityRole: "button",
|
|
72
|
-
accessibilityLabel: confirmLabel,
|
|
73
|
-
accessibilityState: { disabled: !armed },
|
|
113
|
+
accessibilityLabel: loading ? busyLabel : confirmLabel,
|
|
114
|
+
accessibilityState: { disabled: !armed, busy: loading },
|
|
74
115
|
disabled: !armed,
|
|
75
|
-
onPress: armed ? onConfirm : void 0,
|
|
116
|
+
onPress: armed && !loading ? onConfirm : void 0,
|
|
76
117
|
style: ({ pressed }) => [
|
|
77
118
|
styles.confirm,
|
|
78
119
|
armed ? null : styles.confirmDisabled,
|
|
79
120
|
pressed && armed ? styles.pressed : null
|
|
80
121
|
],
|
|
81
|
-
children: /* @__PURE__ */ jsx(Text, { style: [styles.confirmLabel, armed ? null : styles.confirmLabelDisabled], children: confirmLabel })
|
|
122
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles.confirmLabel, armed ? null : styles.confirmLabelDisabled], children: loading ? busyLabel : confirmLabel })
|
|
82
123
|
}
|
|
83
124
|
),
|
|
84
125
|
/* @__PURE__ */ jsx(
|
|
@@ -168,6 +209,67 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
168
209
|
},
|
|
169
210
|
pressed: { opacity: theme.state.pressedOpacity }
|
|
170
211
|
}));
|
|
212
|
+
var DEFAULT_LABELS = {
|
|
213
|
+
platformNote: "Billed by the app store on your account. Prices come from its catalogue.",
|
|
214
|
+
restorePurchase: "Restore purchase",
|
|
215
|
+
close: "Close",
|
|
216
|
+
bestValue: "Best value",
|
|
217
|
+
planLine: (name, price, period) => `${name} \xB7 ${price} ${period}`,
|
|
218
|
+
planSpoken: (name, price, period) => `${name} ${price} ${period}`,
|
|
219
|
+
notNow: "Not now",
|
|
220
|
+
restorePurchases: "Restore purchases",
|
|
221
|
+
meterReadout: (value, max, unit) => `${value} of ${max}${unit ? ` ${unit}` : ""}`,
|
|
222
|
+
save: "Save",
|
|
223
|
+
perYear: "a year",
|
|
224
|
+
samePrice: "Same price",
|
|
225
|
+
billedYearlyTail: "billed yearly",
|
|
226
|
+
yourPlan: "Your plan",
|
|
227
|
+
included: "Included",
|
|
228
|
+
notIncluded: "Not included",
|
|
229
|
+
featureState: (state) => `${state}: `,
|
|
230
|
+
comparisonCell: (label, included) => `${label}: ${included ? "included" : "not included"}`,
|
|
231
|
+
billingPeriod: "Billing period",
|
|
232
|
+
plansCompared: "Plans compared",
|
|
233
|
+
feature: "Feature",
|
|
234
|
+
choosePlanRow: "Choose a plan",
|
|
235
|
+
creditedNextInvoice: "credited to your next invoice",
|
|
236
|
+
today: "today",
|
|
237
|
+
then: "then",
|
|
238
|
+
cadenceFrom: (cadence, date) => `${cadence} from ${date}`,
|
|
239
|
+
monthly: "monthly",
|
|
240
|
+
midCycleChange: (currency) => `Mid-cycle change \xB7 ${currency}`,
|
|
241
|
+
unusedTime: (plan, daysLeft, cycleDays) => `Unused ${plan}, ${daysLeft} of ${cycleDays} days`,
|
|
242
|
+
sameDays: (plan, daysLeft) => `${plan} for the same ${daysLeft} days`,
|
|
243
|
+
creditOnNextInvoice: "Credit on your next invoice",
|
|
244
|
+
chargedToday: "Charged today",
|
|
245
|
+
fromDate: (date, cadence) => `From ${date}, ${cadence}`,
|
|
246
|
+
moveTo: (plan) => `Move to ${plan}`,
|
|
247
|
+
upgrade: "upgrade",
|
|
248
|
+
downgrade: "downgrade",
|
|
249
|
+
planArrow: (from, to) => `${from} \u2192 ${to}`,
|
|
250
|
+
perCycle: "per cycle",
|
|
251
|
+
confirmChange: (way) => `Confirm ${way}`,
|
|
252
|
+
keepCurrentPlan: "Keep current plan",
|
|
253
|
+
subscription: "Subscription",
|
|
254
|
+
plan: "Plan",
|
|
255
|
+
seats: (count) => `${count} seats`,
|
|
256
|
+
billedYearly: "Billed yearly",
|
|
257
|
+
billedMonthly: "Billed monthly",
|
|
258
|
+
renews: "Renews",
|
|
259
|
+
method: "Method",
|
|
260
|
+
trialDaysLeft: (days) => `${days} ${days === 1 ? "day" : "days"} left in your trial`,
|
|
261
|
+
trialUsed: "Trial used",
|
|
262
|
+
days: "days",
|
|
263
|
+
graceTitle: "We could not charge your card",
|
|
264
|
+
updatePaymentMethod: "Update payment method",
|
|
265
|
+
graceSchedule: (day) => `due \xB7 day ${day} of the retry schedule`,
|
|
266
|
+
accessEnds: (date) => `Access ends ${date}.`,
|
|
267
|
+
cancelPlan: (plan) => `Cancel ${plan}`,
|
|
268
|
+
staysActiveUntil: (plan, date) => React2.createElement(React2.Fragment, null, `${plan} stays active until `, date, "."),
|
|
269
|
+
whatYouLose: (date) => `What you lose on ${date}`,
|
|
270
|
+
whyCancelling: "Why are you cancelling?",
|
|
271
|
+
keepMyPlan: "Keep my plan"
|
|
272
|
+
};
|
|
171
273
|
var INDICATOR = { ring: 20, dot: 10 };
|
|
172
274
|
function Paywall({
|
|
173
275
|
title,
|
|
@@ -181,19 +283,23 @@ function Paywall({
|
|
|
181
283
|
onPurchase,
|
|
182
284
|
busy = false,
|
|
183
285
|
legalText,
|
|
184
|
-
restoreLabel
|
|
286
|
+
restoreLabel: restoreLabelProp,
|
|
185
287
|
onRestore,
|
|
186
288
|
footNote,
|
|
187
289
|
links = [],
|
|
188
290
|
onLinkPress,
|
|
189
291
|
onClose,
|
|
190
|
-
closeLabel
|
|
292
|
+
closeLabel: closeLabelProp,
|
|
293
|
+
labels: labelsProp
|
|
191
294
|
}) {
|
|
192
295
|
const { styles } = useStyles(sheet2);
|
|
193
|
-
const
|
|
296
|
+
const labels = useLabels("paywall", DEFAULT_LABELS, labelsProp);
|
|
297
|
+
const restoreLabel = restoreLabelProp ?? labels.restorePurchase;
|
|
298
|
+
const closeLabel = closeLabelProp ?? labels.close;
|
|
299
|
+
const theme = useLoamTheme("commerce");
|
|
194
300
|
const fallback = plans.find((p) => p.recommended)?.id ?? plans[0]?.id;
|
|
195
301
|
const isControlled = selectedPlanId !== void 0;
|
|
196
|
-
const [internal, setInternal] =
|
|
302
|
+
const [internal, setInternal] = React2.useState(fallback);
|
|
197
303
|
const selected = isControlled ? selectedPlanId : internal;
|
|
198
304
|
const select = (id) => {
|
|
199
305
|
if (!isControlled) setInternal(id);
|
|
@@ -230,7 +336,7 @@ function Paywall({
|
|
|
230
336
|
Pressable,
|
|
231
337
|
{
|
|
232
338
|
accessibilityRole: "radio",
|
|
233
|
-
accessibilityLabel:
|
|
339
|
+
accessibilityLabel: labels.planSpoken(plan.name, plan.price, plan.period),
|
|
234
340
|
accessibilityState: { checked: on, selected: on },
|
|
235
341
|
"aria-checked": on,
|
|
236
342
|
onPress: () => select(plan.id),
|
|
@@ -242,14 +348,8 @@ function Paywall({
|
|
|
242
348
|
children: [
|
|
243
349
|
/* @__PURE__ */ jsx(View, { style: [styles.indicator, on ? styles.indicatorOn : null], children: on ? /* @__PURE__ */ jsx(View, { style: styles.indicatorDot }) : null }),
|
|
244
350
|
/* @__PURE__ */ jsxs(View, { style: styles.planMain, children: [
|
|
245
|
-
plan.recommended ? /* @__PURE__ */ jsx(Badge, { style: styles.rowBadge, variant: "accent", size: "sm", children: plan.recommendedLabel ??
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
plan.name,
|
|
248
|
-
" \xB7 ",
|
|
249
|
-
plan.price,
|
|
250
|
-
" ",
|
|
251
|
-
plan.period
|
|
252
|
-
] }),
|
|
351
|
+
plan.recommended ? /* @__PURE__ */ jsx(Badge, { style: styles.rowBadge, variant: "accent", size: "sm", children: plan.recommendedLabel ?? labels.bestValue }) : null,
|
|
352
|
+
/* @__PURE__ */ jsx(Text, { style: styles.planTitle, children: labels.planLine(plan.name, plan.price, plan.period) }),
|
|
253
353
|
plan.note ? /* @__PURE__ */ jsx(Text, { style: styles.planNote, children: plan.note }) : null
|
|
254
354
|
] })
|
|
255
355
|
]
|
|
@@ -419,7 +519,6 @@ var sheet2 = createStyleSheet((theme) => ({
|
|
|
419
519
|
rowBadge: { alignSelf: "flex-start" }
|
|
420
520
|
}));
|
|
421
521
|
var WEB_BLUR = Platform.OS === "web";
|
|
422
|
-
var WEB_BLUR_STYLE = { filter: "blur(8px) saturate(0.6)", opacity: 0.7 };
|
|
423
522
|
var FADE_STEPS = [0.25, 0.5, 0.75, 0.92];
|
|
424
523
|
function PaywallGate({
|
|
425
524
|
children,
|
|
@@ -479,7 +578,15 @@ function PaywallGate({
|
|
|
479
578
|
"aria-hidden": true,
|
|
480
579
|
style: [
|
|
481
580
|
treatment === "dim" ? styles.dimmed : null,
|
|
482
|
-
treatment === "blur" && WEB_BLUR ?
|
|
581
|
+
treatment === "blur" && WEB_BLUR ? (
|
|
582
|
+
// react-native-web forwards `filter` as CSS; cast because RN's own
|
|
583
|
+
// `filter` type is the new-architecture array form. `blur.md`
|
|
584
|
+
// matches the web component's `--blur-md`.
|
|
585
|
+
{
|
|
586
|
+
filter: `blur(${theme.blur.md}px) saturate(0.6)`,
|
|
587
|
+
opacity: theme.opacity[72]
|
|
588
|
+
}
|
|
589
|
+
) : null,
|
|
483
590
|
fade ? { maxHeight: preview + theme.space.s8, overflow: "hidden" } : null
|
|
484
591
|
],
|
|
485
592
|
children: [
|
|
@@ -497,7 +604,7 @@ var sheet3 = createStyleSheet((theme) => ({
|
|
|
497
604
|
fill: { position: "absolute", top: 0, right: 0, bottom: 0, left: 0 },
|
|
498
605
|
// The frosted fallback: opaque enough that no row of sample text is
|
|
499
606
|
// legible through it, translucent enough that the shape still shows.
|
|
500
|
-
veil: { backgroundColor: theme.color.surface, opacity:
|
|
607
|
+
veil: { backgroundColor: theme.color.surface, opacity: theme.opacity[72] },
|
|
501
608
|
dimmed: { opacity: theme.state.disabledOpacity },
|
|
502
609
|
fadeBands: { position: "absolute", left: 0, right: 0, bottom: 0 },
|
|
503
610
|
fadeBand: { height: theme.space.s2, backgroundColor: theme.color.bg },
|
|
@@ -528,7 +635,9 @@ var sheet3 = createStyleSheet((theme) => ({
|
|
|
528
635
|
alignItems: "center",
|
|
529
636
|
justifyContent: "center",
|
|
530
637
|
borderRadius: theme.radius.full,
|
|
531
|
-
backgroundColor: theme.color.accentSoft
|
|
638
|
+
backgroundColor: theme.color.accentSoft,
|
|
639
|
+
borderWidth: theme.borderWidth.base,
|
|
640
|
+
borderColor: theme.edge.accent
|
|
532
641
|
},
|
|
533
642
|
lockRegular: { width: theme.ctl.md, height: theme.ctl.md },
|
|
534
643
|
lockCompact: { width: theme.ctl.sm, height: theme.ctl.sm },
|
|
@@ -540,7 +649,7 @@ var sheet3 = createStyleSheet((theme) => ({
|
|
|
540
649
|
lineHeight: theme.type.caption2.lineHeight,
|
|
541
650
|
letterSpacing: theme.tracking.caps,
|
|
542
651
|
textTransform: "uppercase",
|
|
543
|
-
color: theme.color.
|
|
652
|
+
color: theme.color.accentStrong
|
|
544
653
|
},
|
|
545
654
|
title: {
|
|
546
655
|
fontFamily: theme.font.sans,
|
|
@@ -573,10 +682,13 @@ function MeterBar({
|
|
|
573
682
|
size = "md",
|
|
574
683
|
animate = false,
|
|
575
684
|
accessibilityLabel,
|
|
685
|
+
labels: labelsProp,
|
|
576
686
|
style
|
|
577
687
|
}) {
|
|
578
688
|
const { styles } = useStyles(sheet4);
|
|
579
|
-
const
|
|
689
|
+
const labels = useLabels("paywall", DEFAULT_LABELS, labelsProp);
|
|
690
|
+
const locale = useLoamLocale();
|
|
691
|
+
const readout = labels.meterReadout(value.toLocaleString(locale), max.toLocaleString(locale), unit);
|
|
580
692
|
const name = accessibilityLabel ?? (label ? `${label}: ${readout}` : readout);
|
|
581
693
|
return /* @__PURE__ */ jsxs(View, { style: [styles.block, style], children: [
|
|
582
694
|
label == null && unit == null ? null : /* @__PURE__ */ jsxs(View, { style: styles.readoutRow, children: [
|
|
@@ -632,17 +744,19 @@ function SavingsChip({
|
|
|
632
744
|
savingMinor,
|
|
633
745
|
plan,
|
|
634
746
|
currency,
|
|
635
|
-
label
|
|
636
|
-
per
|
|
747
|
+
label,
|
|
748
|
+
per,
|
|
637
749
|
locale,
|
|
750
|
+
labels: labelsProp,
|
|
638
751
|
style
|
|
639
752
|
}) {
|
|
640
|
-
const
|
|
753
|
+
const labels = useLabels("paywall", DEFAULT_LABELS, labelsProp);
|
|
754
|
+
const theme = useLoamTheme("commerce");
|
|
641
755
|
const { styles } = useStyles(sheet5);
|
|
642
756
|
const saving = savingMinor ?? (plan ? yearlySaving(plan) : null);
|
|
643
757
|
if (saving == null) return null;
|
|
644
758
|
return /* @__PURE__ */ jsxs(View, { style: [styles.savingChip, style], children: [
|
|
645
|
-
/* @__PURE__ */ jsx(Text, { style: styles.savingWord, children: label }),
|
|
759
|
+
/* @__PURE__ */ jsx(Text, { style: styles.savingWord, children: label ?? labels.save }),
|
|
646
760
|
/* @__PURE__ */ jsx(
|
|
647
761
|
Amount,
|
|
648
762
|
{
|
|
@@ -654,22 +768,25 @@ function SavingsChip({
|
|
|
654
768
|
style: { color: theme.color.goodOnSoft }
|
|
655
769
|
}
|
|
656
770
|
),
|
|
657
|
-
/* @__PURE__ */ jsx(Text, { style: styles.savingWord, children: per })
|
|
771
|
+
/* @__PURE__ */ jsx(Text, { style: styles.savingWord, children: per ?? labels.perYear })
|
|
658
772
|
] });
|
|
659
773
|
}
|
|
660
774
|
function PlanPriceDelta({
|
|
661
775
|
fromMinor,
|
|
662
776
|
toMinor,
|
|
663
777
|
currency,
|
|
664
|
-
unit
|
|
665
|
-
sameLabel
|
|
778
|
+
unit,
|
|
779
|
+
sameLabel,
|
|
666
780
|
locale,
|
|
781
|
+
labels: labelsProp,
|
|
667
782
|
style
|
|
668
783
|
}) {
|
|
669
784
|
const { styles } = useStyles(sheet5);
|
|
785
|
+
const labels = useLabels("paywall", DEFAULT_LABELS, labelsProp);
|
|
786
|
+
const pay = usePayLabels(labelsProp);
|
|
670
787
|
const delta = planDelta(fromMinor, toMinor);
|
|
671
788
|
if (delta === 0) {
|
|
672
|
-
return /* @__PURE__ */ jsx(Text, { style: [styles.deltaUnit, style], children: sameLabel });
|
|
789
|
+
return /* @__PURE__ */ jsx(Text, { style: [styles.deltaUnit, style], children: sameLabel ?? labels.samePrice });
|
|
673
790
|
}
|
|
674
791
|
return /* @__PURE__ */ jsxs(View, { style: [styles.deltaRow, style], children: [
|
|
675
792
|
/* @__PURE__ */ jsx(
|
|
@@ -684,7 +801,7 @@ function PlanPriceDelta({
|
|
|
684
801
|
locale
|
|
685
802
|
}
|
|
686
803
|
),
|
|
687
|
-
/* @__PURE__ */ jsx(Text, { style: styles.deltaUnit, children: unit })
|
|
804
|
+
/* @__PURE__ */ jsx(Text, { style: styles.deltaUnit, children: unit ?? pay.perSeat })
|
|
688
805
|
] });
|
|
689
806
|
}
|
|
690
807
|
function PlanFeatureRow({
|
|
@@ -692,16 +809,18 @@ function PlanFeatureRow({
|
|
|
692
809
|
included = true,
|
|
693
810
|
detail,
|
|
694
811
|
stateLabel,
|
|
812
|
+
labels: labelsProp,
|
|
695
813
|
style
|
|
696
814
|
}) {
|
|
697
|
-
const
|
|
815
|
+
const labels = useLabels("paywall", DEFAULT_LABELS, labelsProp);
|
|
816
|
+
const theme = useLoamTheme("commerce");
|
|
698
817
|
const { styles } = useStyles(sheet5);
|
|
699
|
-
const state = stateLabel ?? (included ?
|
|
818
|
+
const state = stateLabel ?? (included ? labels.included : labels.notIncluded);
|
|
700
819
|
return /* @__PURE__ */ jsxs(
|
|
701
820
|
View,
|
|
702
821
|
{
|
|
703
822
|
role: "listitem",
|
|
704
|
-
accessibilityLabel: `${state}
|
|
823
|
+
accessibilityLabel: `${labels.featureState(state)}${label}${detail ? `. ${detail}` : ""}`,
|
|
705
824
|
style: [styles.featureRow, style],
|
|
706
825
|
children: [
|
|
707
826
|
/* @__PURE__ */ jsx(
|
|
@@ -727,28 +846,44 @@ function PlanPriceCell({
|
|
|
727
846
|
size = "lg",
|
|
728
847
|
savingMinor,
|
|
729
848
|
locale,
|
|
730
|
-
|
|
849
|
+
labels: labelsProp,
|
|
850
|
+
style,
|
|
851
|
+
motion = "full"
|
|
731
852
|
}) {
|
|
732
853
|
const { styles } = useStyles(sheet5);
|
|
733
|
-
const
|
|
854
|
+
const labels = useLabels("paywall", DEFAULT_LABELS, labelsProp);
|
|
855
|
+
const pay = usePayLabels(labelsProp);
|
|
856
|
+
const words = planCta(plan, pay).price;
|
|
734
857
|
const perMonth = yearlyMonthly(plan);
|
|
735
858
|
const yearly = cadence === "yr" && plan.yearly != null ? plan.yearly : null;
|
|
736
859
|
const headline = yearly != null && perMonth != null ? perMonth : plan.price;
|
|
737
860
|
return /* @__PURE__ */ jsxs(View, { style: [styles.priceCell, style], children: [
|
|
738
861
|
/* @__PURE__ */ jsx(View, { style: styles.priceHeadline, children: words ? /* @__PURE__ */ jsx(Text, { style: size === "hero" ? styles.priceWordsHero : styles.priceWords, children: words }) : headline == null ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
739
|
-
/* @__PURE__ */ jsx(
|
|
740
|
-
|
|
862
|
+
/* @__PURE__ */ jsx(
|
|
863
|
+
Amount,
|
|
864
|
+
{
|
|
865
|
+
minor: headline,
|
|
866
|
+
currency,
|
|
867
|
+
size,
|
|
868
|
+
weight: "bold",
|
|
869
|
+
locale,
|
|
870
|
+
roll: true,
|
|
871
|
+
motion
|
|
872
|
+
}
|
|
873
|
+
),
|
|
874
|
+
/* @__PURE__ */ jsx(Text, { style: styles.priceUnit, children: pay.perSeat })
|
|
741
875
|
] }) }),
|
|
742
876
|
yearly == null ? null : /* @__PURE__ */ jsxs(View, { style: styles.yearlyRow, children: [
|
|
743
877
|
/* @__PURE__ */ jsx(Amount, { minor: yearly, currency, size: "sm", weight: "bold", locale }),
|
|
744
|
-
/* @__PURE__ */ jsx(Text, { style: styles.priceUnit, children:
|
|
878
|
+
/* @__PURE__ */ jsx(Text, { style: styles.priceUnit, children: labels.billedYearlyTail }),
|
|
745
879
|
/* @__PURE__ */ jsx(
|
|
746
880
|
SavingsChip,
|
|
747
881
|
{
|
|
748
882
|
savingMinor,
|
|
749
883
|
plan,
|
|
750
884
|
currency,
|
|
751
|
-
locale
|
|
885
|
+
locale,
|
|
886
|
+
labels: labelsProp
|
|
752
887
|
}
|
|
753
888
|
)
|
|
754
889
|
] })
|
|
@@ -762,13 +897,19 @@ function PlanCard({
|
|
|
762
897
|
isCurrent = false,
|
|
763
898
|
savingMinor,
|
|
764
899
|
ctaLabel,
|
|
765
|
-
currentLabel
|
|
900
|
+
currentLabel: currentLabelProp,
|
|
766
901
|
onSelect,
|
|
902
|
+
loading = false,
|
|
903
|
+
locked = false,
|
|
767
904
|
locale,
|
|
905
|
+
labels: labelsProp,
|
|
768
906
|
style
|
|
769
907
|
}) {
|
|
770
|
-
const theme = useLoamTheme();
|
|
908
|
+
const theme = useLoamTheme("commerce");
|
|
771
909
|
const { styles } = useStyles(sheet5);
|
|
910
|
+
const labels = useLabels("paywall", DEFAULT_LABELS, labelsProp);
|
|
911
|
+
const pay = usePayLabels(labelsProp);
|
|
912
|
+
const currentLabel = currentLabelProp ?? labels.yourPlan;
|
|
772
913
|
const recommended = highlighted ?? plan.popular ?? false;
|
|
773
914
|
return /* @__PURE__ */ jsxs(
|
|
774
915
|
View,
|
|
@@ -785,7 +926,7 @@ function PlanCard({
|
|
|
785
926
|
children: [
|
|
786
927
|
/* @__PURE__ */ jsxs(View, { style: styles.cardHead, children: [
|
|
787
928
|
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: styles.planName, children: plan.name }),
|
|
788
|
-
recommended ? /* @__PURE__ */ jsx(Badge, { style: styles.rowBadge, variant: "accent", size: "sm", children:
|
|
929
|
+
recommended ? /* @__PURE__ */ jsx(Badge, { style: styles.rowBadge, variant: "accent", size: "sm", children: pay.popularBadge }) : null,
|
|
789
930
|
isCurrent ? /* @__PURE__ */ jsx(Badge, { variant: "neutral", size: "sm", outline: true, children: currentLabel }) : null
|
|
790
931
|
] }),
|
|
791
932
|
/* @__PURE__ */ jsx(
|
|
@@ -795,12 +936,13 @@ function PlanCard({
|
|
|
795
936
|
currency,
|
|
796
937
|
cadence,
|
|
797
938
|
savingMinor,
|
|
798
|
-
locale
|
|
939
|
+
locale,
|
|
940
|
+
labels: labelsProp
|
|
799
941
|
}
|
|
800
942
|
),
|
|
801
943
|
/* @__PURE__ */ jsx(Text, { style: styles.blurb, children: plan.blurb }),
|
|
802
944
|
/* @__PURE__ */ jsx(View, { style: styles.rule }),
|
|
803
|
-
/* @__PURE__ */ jsx(View, { role: "list", accessibilityRole: "list", style: styles.featureList, children: plan.features.map((feature) => /* @__PURE__ */ jsx(PlanFeatureRow, { label: feature }, feature)) }),
|
|
945
|
+
/* @__PURE__ */ jsx(View, { role: "list", accessibilityRole: "list", style: styles.featureList, children: plan.features.map((feature) => /* @__PURE__ */ jsx(PlanFeatureRow, { label: feature, labels: labelsProp }, feature)) }),
|
|
804
946
|
isCurrent ? (
|
|
805
947
|
// Not a disabled button: a dead control invites the press that teaches
|
|
806
948
|
// nothing. The marker states the fact and takes no tab stop.
|
|
@@ -813,8 +955,9 @@ function PlanCard({
|
|
|
813
955
|
{
|
|
814
956
|
fullWidth: true,
|
|
815
957
|
variant: recommended ? "primary" : "outline",
|
|
816
|
-
|
|
817
|
-
|
|
958
|
+
loading,
|
|
959
|
+
onPress: locked ? void 0 : () => onSelect?.(plan.id),
|
|
960
|
+
children: ctaLabel ?? planCta(plan, pay).cta
|
|
818
961
|
}
|
|
819
962
|
)
|
|
820
963
|
]
|
|
@@ -824,29 +967,41 @@ function PlanCard({
|
|
|
824
967
|
function BillingPeriodToggle({
|
|
825
968
|
value,
|
|
826
969
|
onValueChange,
|
|
827
|
-
monthlyLabel
|
|
828
|
-
yearlyLabel
|
|
970
|
+
monthlyLabel,
|
|
971
|
+
yearlyLabel,
|
|
829
972
|
size = "md",
|
|
830
973
|
savingMinor,
|
|
831
974
|
currency,
|
|
832
975
|
locale,
|
|
976
|
+
labels: labelsProp,
|
|
833
977
|
style
|
|
834
978
|
}) {
|
|
835
979
|
const { styles } = useStyles(sheet5);
|
|
980
|
+
const labels = useLabels("paywall", DEFAULT_LABELS, labelsProp);
|
|
981
|
+
const pay = usePayLabels(labelsProp);
|
|
836
982
|
return /* @__PURE__ */ jsxs(View, { style: [styles.toggleRow, style], children: [
|
|
837
983
|
/* @__PURE__ */ jsx(
|
|
838
984
|
SegmentedControl,
|
|
839
985
|
{
|
|
986
|
+
accessibilityLabel: labels.billingPeriod,
|
|
840
987
|
size,
|
|
841
988
|
value,
|
|
842
989
|
onValueChange: (next) => onValueChange(next),
|
|
843
990
|
items: [
|
|
844
|
-
{ value: "mo", label: monthlyLabel },
|
|
845
|
-
{ value: "yr", label: yearlyLabel }
|
|
991
|
+
{ value: "mo", label: monthlyLabel ?? pay.cadenceMonthly },
|
|
992
|
+
{ value: "yr", label: yearlyLabel ?? pay.cadenceYearly }
|
|
846
993
|
]
|
|
847
994
|
}
|
|
848
995
|
),
|
|
849
|
-
savingMinor != null && currency ? /* @__PURE__ */ jsx(
|
|
996
|
+
savingMinor != null && currency ? /* @__PURE__ */ jsx(
|
|
997
|
+
SavingsChip,
|
|
998
|
+
{
|
|
999
|
+
savingMinor,
|
|
1000
|
+
currency,
|
|
1001
|
+
locale,
|
|
1002
|
+
labels: labelsProp
|
|
1003
|
+
}
|
|
1004
|
+
) : null
|
|
850
1005
|
] });
|
|
851
1006
|
}
|
|
852
1007
|
function PlanGrid({
|
|
@@ -856,9 +1011,11 @@ function PlanGrid({
|
|
|
856
1011
|
onCadenceChange,
|
|
857
1012
|
onSelect,
|
|
858
1013
|
currentPlanId,
|
|
1014
|
+
pendingPlanId,
|
|
859
1015
|
savings,
|
|
860
1016
|
hideIds,
|
|
861
1017
|
locale,
|
|
1018
|
+
labels: labelsProp,
|
|
862
1019
|
style
|
|
863
1020
|
}) {
|
|
864
1021
|
const { styles } = useStyles(sheet5);
|
|
@@ -870,7 +1027,8 @@ function PlanGrid({
|
|
|
870
1027
|
value: cadence,
|
|
871
1028
|
onValueChange: onCadenceChange,
|
|
872
1029
|
currency,
|
|
873
|
-
locale
|
|
1030
|
+
locale,
|
|
1031
|
+
labels: labelsProp
|
|
874
1032
|
}
|
|
875
1033
|
) : null,
|
|
876
1034
|
/* @__PURE__ */ jsx(View, { style: styles.gridStack, children: shown.map((plan) => /* @__PURE__ */ jsx(
|
|
@@ -882,7 +1040,10 @@ function PlanGrid({
|
|
|
882
1040
|
isCurrent: currentPlanId === plan.id,
|
|
883
1041
|
savingMinor: savings?.[plan.id],
|
|
884
1042
|
onSelect,
|
|
885
|
-
|
|
1043
|
+
loading: pendingPlanId === plan.id,
|
|
1044
|
+
locked: pendingPlanId != null,
|
|
1045
|
+
locale,
|
|
1046
|
+
labels: labelsProp
|
|
886
1047
|
},
|
|
887
1048
|
plan.id
|
|
888
1049
|
)) })
|
|
@@ -1051,11 +1212,13 @@ function ProrationLine({
|
|
|
1051
1212
|
currency,
|
|
1052
1213
|
effectiveLabel,
|
|
1053
1214
|
nextMinor,
|
|
1054
|
-
nextCadenceLabel
|
|
1215
|
+
nextCadenceLabel,
|
|
1055
1216
|
locale,
|
|
1217
|
+
labels: labelsProp,
|
|
1056
1218
|
style
|
|
1057
1219
|
}) {
|
|
1058
1220
|
const { styles } = useStyles(sheet6);
|
|
1221
|
+
const labels = useLabels("paywall", DEFAULT_LABELS, labelsProp);
|
|
1059
1222
|
const downgrade = prorationWay(proration) === "downgrade";
|
|
1060
1223
|
return /* @__PURE__ */ jsxs(View, { style: [styles.prorationLine, style], children: [
|
|
1061
1224
|
/* @__PURE__ */ jsx(
|
|
@@ -1069,12 +1232,12 @@ function ProrationLine({
|
|
|
1069
1232
|
locale
|
|
1070
1233
|
}
|
|
1071
1234
|
),
|
|
1072
|
-
/* @__PURE__ */ jsx(Text, { style: styles.prorationWord, children: downgrade ?
|
|
1235
|
+
/* @__PURE__ */ jsx(Text, { style: styles.prorationWord, children: downgrade ? labels.creditedNextInvoice : labels.today }),
|
|
1073
1236
|
nextMinor == null ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1074
1237
|
/* @__PURE__ */ jsx(Text, { style: styles.prorationSep, children: "\xB7" }),
|
|
1075
|
-
/* @__PURE__ */ jsx(Text, { style: styles.prorationWord, children:
|
|
1238
|
+
/* @__PURE__ */ jsx(Text, { style: styles.prorationWord, children: labels.then }),
|
|
1076
1239
|
/* @__PURE__ */ jsx(Amount, { minor: nextMinor, currency, size: "sm", weight: "bold", locale }),
|
|
1077
|
-
/* @__PURE__ */ jsx(Text, { style: styles.prorationWord, children:
|
|
1240
|
+
/* @__PURE__ */ jsx(Text, { style: styles.prorationWord, children: labels.cadenceFrom(nextCadenceLabel ?? labels.monthly, effectiveLabel) })
|
|
1078
1241
|
] })
|
|
1079
1242
|
] });
|
|
1080
1243
|
}
|
|
@@ -1087,20 +1250,23 @@ function ProrationTable({
|
|
|
1087
1250
|
cycleDays = proration.cycleDays,
|
|
1088
1251
|
effectiveLabel,
|
|
1089
1252
|
nextMinor,
|
|
1090
|
-
nextCadenceLabel
|
|
1253
|
+
nextCadenceLabel,
|
|
1091
1254
|
caption,
|
|
1092
|
-
note
|
|
1255
|
+
note,
|
|
1093
1256
|
locale,
|
|
1257
|
+
labels: labelsProp,
|
|
1094
1258
|
style
|
|
1095
1259
|
}) {
|
|
1096
1260
|
const { styles } = useStyles(sheet6);
|
|
1261
|
+
const labels = useLabels("paywall", DEFAULT_LABELS, labelsProp);
|
|
1262
|
+
const pay = usePayLabels(labelsProp);
|
|
1097
1263
|
const downgrade = prorationWay(proration) === "downgrade";
|
|
1098
1264
|
return /* @__PURE__ */ jsxs(View, { style: [styles.prorationTable, style], children: [
|
|
1099
|
-
/* @__PURE__ */ jsx(Text, { style: styles.overline, children: caption ??
|
|
1265
|
+
/* @__PURE__ */ jsx(Text, { style: styles.overline, children: caption ?? labels.midCycleChange(currency) }),
|
|
1100
1266
|
/* @__PURE__ */ jsx(
|
|
1101
1267
|
PriceRow,
|
|
1102
1268
|
{
|
|
1103
|
-
label:
|
|
1269
|
+
label: labels.unusedTime(fromName, daysLeft, cycleDays),
|
|
1104
1270
|
minor: -proration.credit,
|
|
1105
1271
|
currency,
|
|
1106
1272
|
tone: "good",
|
|
@@ -1111,7 +1277,7 @@ function ProrationTable({
|
|
|
1111
1277
|
/* @__PURE__ */ jsx(
|
|
1112
1278
|
PriceRow,
|
|
1113
1279
|
{
|
|
1114
|
-
label:
|
|
1280
|
+
label: labels.sameDays(toName, daysLeft),
|
|
1115
1281
|
minor: proration.charge,
|
|
1116
1282
|
currency,
|
|
1117
1283
|
noSymbol: true,
|
|
@@ -1121,7 +1287,7 @@ function ProrationTable({
|
|
|
1121
1287
|
/* @__PURE__ */ jsx(
|
|
1122
1288
|
PriceRow,
|
|
1123
1289
|
{
|
|
1124
|
-
label: downgrade ?
|
|
1290
|
+
label: downgrade ? labels.creditOnNextInvoice : labels.chargedToday,
|
|
1125
1291
|
minor: downgrade ? proration.refund : proration.dueNow,
|
|
1126
1292
|
currency,
|
|
1127
1293
|
tone: downgrade ? "good" : void 0,
|
|
@@ -1134,26 +1300,26 @@ function ProrationTable({
|
|
|
1134
1300
|
nextMinor == null ? null : /* @__PURE__ */ jsx(
|
|
1135
1301
|
PriceRow,
|
|
1136
1302
|
{
|
|
1137
|
-
label:
|
|
1303
|
+
label: labels.fromDate(effectiveLabel, nextCadenceLabel ?? labels.monthly),
|
|
1138
1304
|
minor: nextMinor,
|
|
1139
1305
|
currency,
|
|
1140
1306
|
noSymbol: true,
|
|
1141
1307
|
locale
|
|
1142
1308
|
}
|
|
1143
1309
|
),
|
|
1144
|
-
note === false ? null : /* @__PURE__ */ jsx(Text, { style: styles.prorationNote, children: note })
|
|
1310
|
+
note === false ? null : /* @__PURE__ */ jsx(Text, { style: styles.prorationNote, children: note === void 0 ? pay.prorationNote : note })
|
|
1145
1311
|
] });
|
|
1146
1312
|
}
|
|
1147
|
-
function toPaywallPlan(plan, currency, cadence, savingMinor, isCurrent, currentLabel, locale) {
|
|
1148
|
-
const words = planCta(plan).price;
|
|
1313
|
+
function toPaywallPlan(plan, currency, cadence, savingMinor, isCurrent, currentLabel, locale, labels, pay) {
|
|
1314
|
+
const words = planCta(plan, pay).price;
|
|
1149
1315
|
const perMonth = yearlyMonthly(plan);
|
|
1150
1316
|
const yearly = cadence === "yr" && plan.yearly != null ? plan.yearly : null;
|
|
1151
1317
|
const headline = yearly != null && perMonth != null ? perMonth : plan.price;
|
|
1152
1318
|
const saving = savingMinor ?? yearlySaving(plan);
|
|
1153
1319
|
const notes = [];
|
|
1154
|
-
if (yearly != null) notes.push(`${money(yearly, currency, { locale })}
|
|
1320
|
+
if (yearly != null) notes.push(`${money(yearly, currency, { locale })} ${labels.billedYearlyTail}`);
|
|
1155
1321
|
if (yearly != null && saving != null) {
|
|
1156
|
-
notes.push(
|
|
1322
|
+
notes.push(`${labels.save} ${money(saving, currency, { locale })} ${labels.perYear}`);
|
|
1157
1323
|
}
|
|
1158
1324
|
notes.push(plan.blurb);
|
|
1159
1325
|
if (isCurrent) notes.push(currentLabel);
|
|
@@ -1161,10 +1327,10 @@ function toPaywallPlan(plan, currency, cadence, savingMinor, isCurrent, currentL
|
|
|
1161
1327
|
id: plan.id,
|
|
1162
1328
|
name: plan.name,
|
|
1163
1329
|
price: words || (headline == null ? "" : money(headline, currency, { locale })),
|
|
1164
|
-
period: words ? "" :
|
|
1330
|
+
period: words ? "" : pay.perSeat,
|
|
1165
1331
|
note: notes.join(" \xB7 "),
|
|
1166
1332
|
recommended: plan.popular ?? false,
|
|
1167
|
-
recommendedLabel:
|
|
1333
|
+
recommendedLabel: pay.popularBadge
|
|
1168
1334
|
};
|
|
1169
1335
|
}
|
|
1170
1336
|
function PaywallSurface({
|
|
@@ -1178,40 +1344,58 @@ function PaywallSurface({
|
|
|
1178
1344
|
onCadenceChange,
|
|
1179
1345
|
onPickPlan,
|
|
1180
1346
|
currentPlanId,
|
|
1181
|
-
|
|
1347
|
+
pendingPlanId,
|
|
1348
|
+
currentLabel: currentLabelProp,
|
|
1182
1349
|
savings,
|
|
1183
1350
|
hideIds,
|
|
1184
1351
|
featureOffer,
|
|
1185
1352
|
billing = "ours",
|
|
1186
|
-
platformNote
|
|
1353
|
+
platformNote: platformNoteProp,
|
|
1187
1354
|
legalText,
|
|
1188
1355
|
footNote,
|
|
1189
|
-
dismissLabel
|
|
1356
|
+
dismissLabel: dismissLabelProp,
|
|
1190
1357
|
onDismiss,
|
|
1191
|
-
restoreLabel
|
|
1358
|
+
restoreLabel: restoreLabelProp,
|
|
1192
1359
|
onRestore,
|
|
1193
1360
|
upgradeLabel,
|
|
1194
1361
|
onUpgrade,
|
|
1195
|
-
locale,
|
|
1362
|
+
locale: localeProp,
|
|
1363
|
+
labels: labelsProp,
|
|
1196
1364
|
style
|
|
1197
1365
|
}) {
|
|
1198
1366
|
const { styles } = useStyles(sheet6);
|
|
1367
|
+
const labels = useLabels("paywall", DEFAULT_LABELS, labelsProp);
|
|
1368
|
+
const pay = usePayLabels(labelsProp);
|
|
1369
|
+
const providerLocale = useLoamLocale();
|
|
1370
|
+
const locale = localeProp ?? providerLocale;
|
|
1371
|
+
const currentLabel = currentLabelProp ?? labels.yourPlan;
|
|
1372
|
+
const platformNote = platformNoteProp ?? labels.platformNote;
|
|
1373
|
+
const dismissLabel = dismissLabelProp ?? labels.notNow;
|
|
1374
|
+
const restoreLabel = restoreLabelProp ?? labels.restorePurchases;
|
|
1199
1375
|
const canDismiss = variant !== "hard" && Boolean(onDismiss);
|
|
1200
1376
|
const showMeter = (variant === "metered" || variant === "trial") && meter != null;
|
|
1201
1377
|
const offer = variant === "feature" ? featureOffer : void 0;
|
|
1202
|
-
const shown =
|
|
1378
|
+
const shown = React2.useMemo(() => {
|
|
1203
1379
|
const list = plans ?? [];
|
|
1204
1380
|
return hideIds?.length ? list.filter((p) => !hideIds.includes(p.id)) : list;
|
|
1205
1381
|
}, [plans, hideIds]);
|
|
1206
|
-
const [selected, setSelected] =
|
|
1382
|
+
const [selected, setSelected] = React2.useState(
|
|
1207
1383
|
() => shown.find((p) => p.popular)?.id ?? shown[0]?.id
|
|
1208
1384
|
);
|
|
1209
1385
|
const selectedPlan = shown.find((p) => p.id === selected);
|
|
1210
1386
|
const footer = /* @__PURE__ */ jsx(View, { style: styles.footerNotes, children: footNote ? /* @__PURE__ */ jsx(Text, { style: styles.footNote, children: footNote }) : null });
|
|
1211
1387
|
const slot = /* @__PURE__ */ jsxs(View, { style: styles.slot, children: [
|
|
1212
1388
|
billing === "platform" ? /* @__PURE__ */ jsx(Text, { style: styles.platformNote, children: platformNote }) : null,
|
|
1213
|
-
showMeter && meter ? /* @__PURE__ */ jsx(MeterBar, { ...meter }) : null,
|
|
1214
|
-
onCadenceChange ? /* @__PURE__ */ jsx(
|
|
1389
|
+
showMeter && meter ? /* @__PURE__ */ jsx(MeterBar, { labels: labelsProp, ...meter }) : null,
|
|
1390
|
+
onCadenceChange ? /* @__PURE__ */ jsx(
|
|
1391
|
+
BillingPeriodToggle,
|
|
1392
|
+
{
|
|
1393
|
+
value: cadence,
|
|
1394
|
+
onValueChange: onCadenceChange,
|
|
1395
|
+
locale,
|
|
1396
|
+
labels: labelsProp
|
|
1397
|
+
}
|
|
1398
|
+
) : null
|
|
1215
1399
|
] });
|
|
1216
1400
|
if (offer) {
|
|
1217
1401
|
return /* @__PURE__ */ jsxs(View, { role: "region", accessibilityLabel: title, style: [styles.featureSurface, style], children: [
|
|
@@ -1229,11 +1413,15 @@ function PaywallSurface({
|
|
|
1229
1413
|
savingMinor: offer.savingMinor,
|
|
1230
1414
|
highlighted: true,
|
|
1231
1415
|
ctaLabel: upgradeLabel,
|
|
1416
|
+
loading: pendingPlanId === offer.plan.id,
|
|
1417
|
+
locked: pendingPlanId != null,
|
|
1232
1418
|
onSelect: () => {
|
|
1233
1419
|
onUpgrade?.();
|
|
1234
1420
|
onPickPlan?.(offer.plan.id);
|
|
1235
1421
|
},
|
|
1236
|
-
locale
|
|
1422
|
+
locale,
|
|
1423
|
+
labels: labelsProp,
|
|
1424
|
+
currentLabel: currentLabelProp
|
|
1237
1425
|
}
|
|
1238
1426
|
),
|
|
1239
1427
|
offer.proration && offer.effectiveLabel ? /* @__PURE__ */ jsx(
|
|
@@ -1243,7 +1431,8 @@ function PaywallSurface({
|
|
|
1243
1431
|
currency,
|
|
1244
1432
|
effectiveLabel: offer.effectiveLabel,
|
|
1245
1433
|
nextMinor: offer.nextMinor,
|
|
1246
|
-
locale
|
|
1434
|
+
locale,
|
|
1435
|
+
labels: labelsProp
|
|
1247
1436
|
}
|
|
1248
1437
|
) : null,
|
|
1249
1438
|
/* @__PURE__ */ jsx(Text, { style: styles.legal, children: legalText }),
|
|
@@ -1276,19 +1465,23 @@ function PaywallSurface({
|
|
|
1276
1465
|
savings?.[plan.id],
|
|
1277
1466
|
currentPlanId === plan.id,
|
|
1278
1467
|
currentLabel,
|
|
1279
|
-
locale
|
|
1468
|
+
locale,
|
|
1469
|
+
labels,
|
|
1470
|
+
pay
|
|
1280
1471
|
)
|
|
1281
1472
|
),
|
|
1282
1473
|
selectedPlanId: selected,
|
|
1283
1474
|
onSelectPlan: setSelected,
|
|
1284
|
-
ctaLabel: selectedPlan ? planCta(selectedPlan).cta : restoreLabel,
|
|
1475
|
+
ctaLabel: selectedPlan ? planCta(selectedPlan, pay).cta : restoreLabel,
|
|
1476
|
+
busy: pendingPlanId != null,
|
|
1285
1477
|
onPurchase: (id) => onPickPlan?.(id),
|
|
1286
1478
|
legalText,
|
|
1287
1479
|
footNote: footer,
|
|
1288
1480
|
restoreLabel,
|
|
1289
1481
|
onRestore,
|
|
1290
1482
|
onClose: canDismiss ? onDismiss : void 0,
|
|
1291
|
-
closeLabel: dismissLabel
|
|
1483
|
+
closeLabel: dismissLabel,
|
|
1484
|
+
labels: labelsProp
|
|
1292
1485
|
}
|
|
1293
1486
|
) });
|
|
1294
1487
|
}
|
|
@@ -1401,10 +1594,10 @@ var sheet6 = createStyleSheet((theme) => ({
|
|
|
1401
1594
|
}
|
|
1402
1595
|
}));
|
|
1403
1596
|
var STATUS = {
|
|
1404
|
-
active: { variant: "good", label: "
|
|
1405
|
-
trial: { variant: "info", label: "
|
|
1406
|
-
canceled: { variant: "neutral", label: "
|
|
1407
|
-
"past-due": { variant: "warn", label: "
|
|
1597
|
+
active: { variant: "good", label: "statusActive" },
|
|
1598
|
+
trial: { variant: "info", label: "statusTrial" },
|
|
1599
|
+
canceled: { variant: "neutral", label: "statusCanceled" },
|
|
1600
|
+
"past-due": { variant: "warn", label: "statusPastDue" }
|
|
1408
1601
|
};
|
|
1409
1602
|
function ManageSubscription({
|
|
1410
1603
|
planName,
|
|
@@ -1412,36 +1605,32 @@ function ManageSubscription({
|
|
|
1412
1605
|
statusLabel,
|
|
1413
1606
|
price,
|
|
1414
1607
|
renewalDate,
|
|
1415
|
-
renewalLabel
|
|
1608
|
+
renewalLabel: renewalLabelProp,
|
|
1416
1609
|
paymentMethod,
|
|
1417
|
-
paymentLabel
|
|
1610
|
+
paymentLabel: paymentLabelProp,
|
|
1418
1611
|
actions = [],
|
|
1419
1612
|
onAction,
|
|
1420
|
-
cancelLabel
|
|
1613
|
+
cancelLabel: cancelLabelProp,
|
|
1421
1614
|
onCancel,
|
|
1422
|
-
cancelNote
|
|
1615
|
+
cancelNote,
|
|
1616
|
+
cancelBusy = false,
|
|
1617
|
+
labels: labelsProp
|
|
1423
1618
|
}) {
|
|
1424
1619
|
const { styles } = useStyles(sheet7);
|
|
1425
|
-
const
|
|
1620
|
+
const labels = useLabels("manageSubscription", MANAGE_SUBSCRIPTION_LABELS, labelsProp);
|
|
1621
|
+
const renewalLabel = renewalLabelProp ?? labels.renews;
|
|
1622
|
+
const paymentLabel = paymentLabelProp ?? labels.payment;
|
|
1623
|
+
const cancelLabel = cancelLabelProp ?? labels.cancel;
|
|
1624
|
+
const theme = useLoamTheme("commerce");
|
|
1426
1625
|
const badge = STATUS[status];
|
|
1427
1626
|
return /* @__PURE__ */ jsxs(ScrollView, { style: styles.screen, contentContainerStyle: styles.scroll, children: [
|
|
1428
1627
|
/* @__PURE__ */ jsxs(View, { style: styles.card, children: [
|
|
1429
1628
|
/* @__PURE__ */ jsxs(View, { style: styles.cardHead, children: [
|
|
1430
1629
|
/* @__PURE__ */ jsx(Text, { style: styles.planName, children: planName }),
|
|
1431
|
-
/* @__PURE__ */ jsx(Badge, { style: styles.rowBadge, variant: badge.variant, size: "sm", children: statusLabel ?? badge.label })
|
|
1432
|
-
] }),
|
|
1433
|
-
/* @__PURE__ */ jsxs(Text, { style: styles.meta, children: [
|
|
1434
|
-
price,
|
|
1435
|
-
" \xB7 ",
|
|
1436
|
-
renewalLabel,
|
|
1437
|
-
" ",
|
|
1438
|
-
renewalDate
|
|
1630
|
+
/* @__PURE__ */ jsx(Badge, { style: styles.rowBadge, variant: badge.variant, size: "sm", children: statusLabel ?? labels[badge.label] })
|
|
1439
1631
|
] }),
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
" \xB7 ",
|
|
1443
|
-
paymentMethod
|
|
1444
|
-
] }) : null
|
|
1632
|
+
/* @__PURE__ */ jsx(Text, { style: styles.meta, children: labels.renewalLine(price, renewalLabel, renewalDate) }),
|
|
1633
|
+
paymentMethod ? /* @__PURE__ */ jsx(Text, { style: styles.meta, children: labels.paymentLine(paymentLabel, paymentMethod) }) : null
|
|
1445
1634
|
] }),
|
|
1446
1635
|
actions.length > 0 ? /* @__PURE__ */ jsx(List, { children: actions.map((a) => /* @__PURE__ */ jsx(
|
|
1447
1636
|
ListRow,
|
|
@@ -1460,7 +1649,8 @@ function ManageSubscription({
|
|
|
1460
1649
|
{
|
|
1461
1650
|
accessibilityRole: "button",
|
|
1462
1651
|
accessibilityLabel: cancelLabel,
|
|
1463
|
-
|
|
1652
|
+
accessibilityState: { busy: cancelBusy },
|
|
1653
|
+
onPress: cancelBusy ? void 0 : onCancel,
|
|
1464
1654
|
style: ({ pressed }) => [styles.cancel, pressed ? styles.cancelPressed : null],
|
|
1465
1655
|
children: /* @__PURE__ */ jsx(Text, { style: styles.cancelLabel, children: cancelLabel })
|
|
1466
1656
|
}
|
|
@@ -1532,10 +1722,12 @@ function ToggleRow({
|
|
|
1532
1722
|
onValueChange,
|
|
1533
1723
|
disabled = false,
|
|
1534
1724
|
style,
|
|
1535
|
-
accessibilityLabel
|
|
1725
|
+
accessibilityLabel,
|
|
1726
|
+
labels: labelsProp
|
|
1536
1727
|
}) {
|
|
1537
1728
|
const { styles } = useStyles(sheet8);
|
|
1538
|
-
const
|
|
1729
|
+
const labels = useLabels("toggleRow", TOGGLE_ROW_LABELS, labelsProp);
|
|
1730
|
+
const announced = accessibilityLabel ?? (description ? labels.withDescription(label, description) : label);
|
|
1539
1731
|
return /* @__PURE__ */ jsxs(
|
|
1540
1732
|
Pressable,
|
|
1541
1733
|
{
|
|
@@ -1598,7 +1790,7 @@ function SettingsScreen({
|
|
|
1598
1790
|
onToggle
|
|
1599
1791
|
}) {
|
|
1600
1792
|
const { styles } = useStyles(sheet9);
|
|
1601
|
-
const theme = useLoamTheme();
|
|
1793
|
+
const theme = useLoamTheme("commerce");
|
|
1602
1794
|
return /* @__PURE__ */ jsx(ScrollView, { style: styles.screen, contentContainerStyle: styles.scroll, children: groups.map((group) => /* @__PURE__ */ jsxs(View, { style: styles.group, children: [
|
|
1603
1795
|
group.title ? /* @__PURE__ */ jsx(Text, { style: styles.caption, children: group.title }) : null,
|
|
1604
1796
|
/* @__PURE__ */ jsx(List, { children: group.rows.map((row) => {
|
|
@@ -1694,20 +1886,19 @@ var sheet9 = createStyleSheet((theme) => ({
|
|
|
1694
1886
|
color: theme.color.text3
|
|
1695
1887
|
}
|
|
1696
1888
|
}));
|
|
1697
|
-
var SYSTEM_NOTE = {
|
|
1698
|
-
on: "System notifications are on. Turn categories off here rather than muting the whole app.",
|
|
1699
|
-
off: "Notifications are turned off for this app in system settings. Your choices below are kept, and take effect as soon as you turn them back on."
|
|
1700
|
-
};
|
|
1701
1889
|
function NotificationPreferences({
|
|
1702
1890
|
systemEnabled = true,
|
|
1703
1891
|
systemNote,
|
|
1704
|
-
systemActionLabel
|
|
1892
|
+
systemActionLabel: systemActionLabelProp,
|
|
1705
1893
|
onOpenSystemSettings,
|
|
1706
1894
|
categories,
|
|
1707
|
-
onChange
|
|
1895
|
+
onChange,
|
|
1896
|
+
labels: labelsProp
|
|
1708
1897
|
}) {
|
|
1709
1898
|
const { styles } = useStyles(sheet10);
|
|
1710
|
-
const
|
|
1899
|
+
const labels = useLabels("notificationPreferences", NOTIFICATION_PREFERENCES_LABELS, labelsProp);
|
|
1900
|
+
const systemActionLabel = systemActionLabelProp ?? labels.openSettings;
|
|
1901
|
+
const note = systemNote ?? (systemEnabled ? labels.systemOn : labels.systemOff);
|
|
1711
1902
|
return /* @__PURE__ */ jsxs(ScrollView, { style: styles.screen, contentContainerStyle: styles.scroll, children: [
|
|
1712
1903
|
/* @__PURE__ */ jsxs(
|
|
1713
1904
|
View,
|