@btndprojects/loam-ui-native 0.2.1 → 0.3.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/dist/accordion/index.js +4 -2
- package/dist/adaptive/index.js +12 -2
- package/dist/address-block/index.js +23 -0
- package/dist/alert/index.js +5 -2
- package/dist/analyzer/index.js +13 -5
- package/dist/announcement/index.js +15 -5
- package/dist/appearance-picker/index.js +15 -0
- package/dist/audio-player/index.js +26 -2
- package/dist/avatar/index.js +2 -2
- package/dist/avatar-group/index.js +5 -3
- package/dist/badge/index.js +6 -3
- package/dist/banner/index.js +3 -2
- package/dist/board/index.js +13 -6
- package/dist/button/index.js +6 -3
- package/dist/camera-permission/index.js +19 -11
- package/dist/capture-result/index.js +26 -16
- package/dist/card/index.js +7 -3
- package/dist/card-form/index.js +15 -9
- package/dist/carousel/index.js +3 -1
- package/dist/chart/index.js +15 -5
- package/dist/charts/index.js +18 -5
- package/dist/chat/index.js +35 -10
- package/dist/checkbox/index.js +6 -4
- package/dist/checklist/index.js +16 -7
- package/dist/checkout/index.js +25 -12
- package/dist/chip/index.js +7 -4
- package/dist/chunk-2BZD3NAP.js +1110 -0
- package/dist/chunk-2YKVID2V.js +35 -0
- package/dist/{chunk-H7DWSL4O.js → chunk-36DA3IPO.js} +115 -27
- package/dist/chunk-3A56MIAN.js +599 -0
- package/dist/{chunk-AEB7KCHQ.js → chunk-3SCKCWF5.js} +39 -28
- package/dist/chunk-3TZNDHKO.js +187 -0
- package/dist/chunk-43K3BLXV.js +9 -0
- package/dist/chunk-46ZJIQ2Z.js +208 -0
- package/dist/{chunk-PMMTGBBS.js → chunk-4CZMQDQL.js} +75 -22
- package/dist/chunk-4QCR3K2J.js +1 -0
- package/dist/{chunk-E2E3I5W2.js → chunk-5DTKORLI.js} +54 -45
- package/dist/{chunk-5VFZRGVD.js → chunk-5J4WFXFA.js} +32 -15
- package/dist/{chunk-JBMLWFSJ.js → chunk-5KJ7TEQ6.js} +83 -48
- package/dist/chunk-5NU33TXK.js +529 -0
- package/dist/chunk-6KSUS7DF.js +690 -0
- package/dist/{chunk-3WEZCGHX.js → chunk-6RV6UW2J.js} +140 -56
- package/dist/chunk-6RZM7RP2.js +520 -0
- package/dist/{chunk-JJLPBRVZ.js → chunk-75BDCC7K.js} +2 -0
- package/dist/{chunk-U5NLHYV6.js → chunk-7CGJBQUA.js} +333 -22
- package/dist/{chunk-I4FHVKEC.js → chunk-7IVF6JLJ.js} +16 -5
- package/dist/chunk-7IWCGXYA.js +143 -0
- package/dist/chunk-7LM4ASFH.js +172 -0
- package/dist/chunk-7MCEJFWV.js +341 -0
- package/dist/{chunk-2SY63FCH.js → chunk-7NGMUVNU.js} +66 -30
- package/dist/chunk-7PBSIXT7.js +355 -0
- package/dist/chunk-7QOYGENL.js +443 -0
- package/dist/{chunk-TDMG26JI.js → chunk-A7SWYDE5.js} +40 -9
- package/dist/chunk-ADHPJALR.js +3051 -0
- package/dist/{chunk-ZLTO5VQI.js → chunk-ALJYZLNQ.js} +131 -61
- package/dist/{chunk-GDKVKNR2.js → chunk-AQ5FIG74.js} +110 -30
- package/dist/chunk-B2MMZZQB.js +426 -0
- package/dist/{chunk-QYPE5JX3.js → chunk-B7JZ3N5G.js} +142 -105
- package/dist/{chunk-QHTVYA65.js → chunk-BL37SW6G.js} +388 -102
- package/dist/chunk-BTRMA7GC.js +21 -0
- package/dist/{chunk-FUMHAAF3.js → chunk-C7IUWIUZ.js} +243 -92
- package/dist/chunk-CA3DUVYD.js +10 -0
- package/dist/{chunk-FYWNRX4F.js → chunk-CBCJSO2B.js} +143 -13
- package/dist/chunk-CHPX4MFI.js +239 -0
- package/dist/chunk-CLGAMIOT.js +648 -0
- package/dist/chunk-CUE7VML6.js +1141 -0
- package/dist/{chunk-D5N5QWI7.js → chunk-CVU6S2E5.js} +497 -235
- package/dist/{chunk-U23FYWME.js → chunk-CXPQMA6Z.js} +101 -34
- package/dist/{chunk-36EC2T6P.js → chunk-D2LN4I7I.js} +1 -1
- package/dist/{chunk-TLCIR6RG.js → chunk-D34LNBO5.js} +411 -155
- package/dist/{chunk-FV6HMP7W.js → chunk-D4BCQICM.js} +207 -65
- package/dist/chunk-EABKIIA4.js +1 -0
- package/dist/chunk-EICSYRAG.js +341 -0
- package/dist/chunk-EMWAJMAS.js +83 -0
- package/dist/chunk-EOLZWRV6.js +149 -0
- package/dist/chunk-EOQVTGB6.js +350 -0
- package/dist/{chunk-ZVATDZOM.js → chunk-ESGUHNB2.js} +106 -28
- package/dist/{chunk-46MMSDGL.js → chunk-F2KNBPKY.js} +104 -73
- package/dist/{chunk-KQZ3GLHR.js → chunk-G7H3NX3G.js} +40 -17
- package/dist/{chunk-3QMEOFW5.js → chunk-GM7YIPB7.js} +421 -207
- package/dist/{chunk-QHAITQIF.js → chunk-GVQQG435.js} +256 -86
- package/dist/chunk-HE43OMEL.js +1056 -0
- package/dist/{chunk-XIDTBCBA.js → chunk-HHOMFQ7R.js} +1049 -207
- package/dist/chunk-HNAKS4Z3.js +207 -0
- package/dist/chunk-HP6ST2OW.js +352 -0
- package/dist/chunk-HW3OWDTU.js +1 -0
- package/dist/{chunk-QP3KMOVF.js → chunk-HZDB44K4.js} +24 -14
- package/dist/chunk-I6CUP2LW.js +1155 -0
- package/dist/chunk-ICV4Y2WY.js +27 -0
- package/dist/chunk-IHSIENOE.js +3950 -0
- package/dist/{chunk-T5LTPKX6.js → chunk-IMMALLRU.js} +53 -25
- package/dist/{chunk-C4GTDLRC.js → chunk-JA6TK7H2.js} +154 -67
- package/dist/{chunk-EVOIGUBI.js → chunk-JAVZ5JPV.js} +43 -13
- package/dist/{chunk-CPTOADB2.js → chunk-JCMTP3E4.js} +527 -201
- package/dist/{chunk-OJQUBQWA.js → chunk-JCXFFK64.js} +73 -16
- package/dist/{chunk-V2OEB75Z.js → chunk-JWCVBFDU.js} +75 -35
- package/dist/chunk-JXRTD5RI.js +414 -0
- package/dist/chunk-JYIUZUIQ.js +1567 -0
- package/dist/chunk-K3TK3GIV.js +219 -0
- package/dist/chunk-KEVZIHM2.js +1511 -0
- package/dist/{chunk-VAOAKWUK.js → chunk-KHZDNQQD.js} +42 -8
- package/dist/chunk-KL4GDV4V.js +131 -0
- package/dist/{chunk-Q6NKEPRE.js → chunk-KNILMM4H.js} +73 -28
- package/dist/chunk-KRBUZV45.js +25 -0
- package/dist/{chunk-7BUIKDD6.js → chunk-KXLDK6HB.js} +91 -30
- package/dist/chunk-KZ3X7TSL.js +196 -0
- package/dist/{chunk-5UTRIXQ6.js → chunk-L2WMOA2V.js} +187 -43
- package/dist/chunk-L4D5LHCH.js +109 -0
- package/dist/{chunk-W63AJTM7.js → chunk-LAUJPLDB.js} +236 -71
- package/dist/{chunk-TN2ZNJUI.js → chunk-LGNTP5XA.js} +47 -13
- package/dist/chunk-LUZFCCSD.js +271 -0
- package/dist/{chunk-XTORZWRF.js → chunk-LXJCP4PL.js} +111 -30
- package/dist/chunk-MCOZJWPU.js +731 -0
- package/dist/{chunk-SATMR6SG.js → chunk-MG4SKWLL.js} +780 -142
- package/dist/{chunk-JUYWSSKW.js → chunk-MPEPTSER.js} +95 -16
- package/dist/chunk-MWPJ4YGP.js +1 -0
- package/dist/{chunk-LUMVGO2K.js → chunk-N7AX4OA4.js} +80 -29
- package/dist/chunk-NHSLM6SE.js +523 -0
- package/dist/{chunk-IT6FUXXG.js → chunk-NNJLVA7M.js} +43 -11
- package/dist/{chunk-TQVAIKFD.js → chunk-NZG75DGA.js} +102 -62
- package/dist/chunk-O76QXRBV.js +431 -0
- package/dist/chunk-OANH27AK.js +223 -0
- package/dist/chunk-OCHPK5YV.js +609 -0
- package/dist/chunk-OMHVEVX4.js +436 -0
- package/dist/{chunk-SWS5JQIF.js → chunk-ONKQUJWD.js} +187 -60
- package/dist/chunk-OVTK7A6T.js +615 -0
- package/dist/{chunk-UXGIW7OK.js → chunk-PCEFCOLN.js} +5 -1
- package/dist/{chunk-QIKT7LIB.js → chunk-PFLNFIVB.js} +91 -23
- package/dist/chunk-PHSZY37H.js +300 -0
- package/dist/chunk-PJLTKDVY.js +18 -0
- package/dist/{chunk-SHHY5OMK.js → chunk-PK7BN3MI.js} +83 -15
- package/dist/{chunk-YXOAPXMU.js → chunk-PWFRDRGS.js} +101 -14
- package/dist/{chunk-TY4MTKQJ.js → chunk-PYPMD46W.js} +332 -66
- package/dist/chunk-Q6CCHDI7.js +331 -0
- package/dist/chunk-QFA5WS2A.js +750 -0
- package/dist/chunk-QJMMM4RC.js +124 -0
- package/dist/chunk-QYWEVAM6.js +407 -0
- package/dist/chunk-R5T4VZ7Z.js +126 -0
- package/dist/chunk-R77HFLZD.js +1 -0
- package/dist/{chunk-LMPHCVJJ.js → chunk-RAESDNU5.js} +162 -68
- package/dist/chunk-RBYQUXNL.js +1 -0
- package/dist/chunk-RCM3DT5E.js +1 -0
- package/dist/chunk-RGNY56L7.js +282 -0
- package/dist/chunk-RIK6UX2K.js +344 -0
- package/dist/{chunk-5LAAAXFP.js → chunk-RJA3RXO3.js} +63 -54
- package/dist/chunk-RJYRJ3LD.js +1 -0
- package/dist/chunk-RMA3NOY4.js +599 -0
- package/dist/{chunk-VDPK5CY4.js → chunk-RSWKKAHK.js} +143 -61
- package/dist/{chunk-B7N4ASYE.js → chunk-RVOIIX3V.js} +17 -45
- package/dist/chunk-SA2RRBGT.js +1077 -0
- package/dist/{chunk-7OVVSVEZ.js → chunk-SG3J4R45.js} +440 -169
- package/dist/chunk-SPUK7JD4.js +238 -0
- package/dist/chunk-SWXV2K5N.js +434 -0
- package/dist/chunk-SYJEPXP6.js +1303 -0
- package/dist/{chunk-LKFC4CS7.js → chunk-SZLI34TA.js} +18 -9
- package/dist/{chunk-NBEF4EPJ.js → chunk-T77WJA74.js} +131 -16
- package/dist/chunk-TDWWVJA4.js +630 -0
- package/dist/chunk-TFHI5XDR.js +610 -0
- package/dist/chunk-TH4PW2WU.js +17 -0
- package/dist/chunk-TTQ24HQX.js +12 -0
- package/dist/chunk-TUACVJNG.js +12 -0
- package/dist/{chunk-F5B3UINI.js → chunk-TUL5RUIA.js} +171 -62
- package/dist/{chunk-C6APNDVA.js → chunk-TYOSA7JG.js} +63 -34
- package/dist/chunk-TYQTMMEV.js +1 -0
- package/dist/{chunk-DW3L54DQ.js → chunk-TZO6YDS7.js} +53 -12
- package/dist/{chunk-67IZZ2MJ.js → chunk-U3ETF22F.js} +75 -30
- package/dist/{chunk-EDCBJV7J.js → chunk-U6BYHD2N.js} +87 -31
- package/dist/{chunk-ENP3BMZU.js → chunk-UF6EJXPQ.js} +16 -1
- package/dist/{chunk-IPUNJMAQ.js → chunk-UNNQIPGK.js} +304 -68
- package/dist/chunk-UQVO6AJV.js +171 -0
- package/dist/{chunk-FZGAAOKS.js → chunk-VFDQAAIW.js} +138 -32
- package/dist/chunk-VIUE3VQT.js +1 -0
- package/dist/{chunk-5RENVKBQ.js → chunk-VJLSSSGC.js} +126 -30
- package/dist/chunk-VLMT6KYT.js +350 -0
- package/dist/chunk-VMHGBUGS.js +35 -0
- package/dist/{chunk-4IZXHVFJ.js → chunk-VQKPBYW6.js} +228 -172
- package/dist/{chunk-G6UESEVN.js → chunk-VSSTWLC5.js} +49 -11
- package/dist/{chunk-TRGFFU6A.js → chunk-VZYYZRPN.js} +866 -330
- package/dist/{chunk-JLC6PM5S.js → chunk-WAIJCD2V.js} +128 -54
- package/dist/chunk-WFMQ3WKM.js +378 -0
- package/dist/chunk-WJ2KDRMY.js +66 -0
- package/dist/chunk-WKFZJO54.js +437 -0
- package/dist/{chunk-QEYFDRHR.js → chunk-WVVD3XOV.js} +146 -84
- package/dist/chunk-XAIWMSLB.js +1 -0
- package/dist/chunk-XBXUBBJZ.js +98 -0
- package/dist/chunk-XCU7MYBJ.js +1 -0
- package/dist/chunk-XHE4PGCI.js +717 -0
- package/dist/chunk-XRSJ32M3.js +331 -0
- package/dist/chunk-XTCVOEAW.js +1 -0
- package/dist/chunk-XWGXVQF6.js +58 -0
- package/dist/{chunk-MKSNFG7H.js → chunk-Y3XKKO5K.js} +191 -109
- package/dist/chunk-Y4QNMBLO.js +533 -0
- package/dist/chunk-Y5H4CTKO.js +1 -0
- package/dist/chunk-YBQIN75A.js +403 -0
- package/dist/{chunk-PNF3NKB5.js → chunk-YJ5PXOX3.js} +28 -11
- package/dist/{chunk-M656FYNH.js → chunk-YLRSRUPS.js} +63 -49
- package/dist/chunk-YM6MPJ4A.js +1 -0
- package/dist/chunk-YV7KZENV.js +200 -0
- package/dist/chunk-Z7I4ZSO6.js +316 -0
- package/dist/{chunk-EY4DD67D.js → chunk-ZIRMWD2B.js} +199 -126
- package/dist/chunk-ZPMG3FWU.js +75 -0
- package/dist/{chunk-QRUMA22E.js → chunk-ZTXMK2G7.js} +92 -43
- package/dist/{chunk-2OLKPG4E.js → chunk-ZVJCWXAL.js} +189 -87
- package/dist/{chunk-YAAHPATV.js → chunk-ZYQ23DPT.js} +49 -34
- package/dist/coachmark/index.js +7 -3
- package/dist/code-block/index.js +4 -3
- package/dist/color-field/index.js +12 -4
- package/dist/color-picker/index.js +23 -0
- package/dist/commerce/index.js +27 -16
- package/dist/confirm/index.js +31 -0
- package/dist/connection-card/index.js +34 -0
- package/dist/connectivity/index.js +3 -2
- package/dist/context-menu/index.js +10 -2
- package/dist/copy-button/index.js +3 -2
- package/dist/data-grid/index.js +30 -17
- package/dist/date-range-picker/index.js +19 -9
- package/dist/description-list/index.js +4 -1
- package/dist/device-frame/index.js +30 -0
- package/dist/dialog/index.js +8 -2
- package/dist/divider/index.js +2 -0
- package/dist/empty-state/index.js +13 -2
- package/dist/error-summary/index.js +7 -2
- package/dist/fab/index.js +4 -2
- package/dist/file-manager/index.js +33 -17
- package/dist/file-upload/index.js +12 -6
- package/dist/filter-bar/index.js +10 -6
- package/dist/flow-run/index.js +19 -12
- package/dist/form/index.js +30 -3
- package/dist/gallery/index.js +5 -2
- package/dist/hold-to-confirm/index.js +4 -2
- package/dist/hover-card/index.js +18 -0
- package/dist/icon-tile/index.js +10 -0
- package/dist/image/index.js +9 -0
- package/dist/index.d.ts +29826 -17941
- package/dist/index.js +197 -141
- package/dist/infinite-list/index.js +4 -2
- package/dist/inline-edit/index.js +5 -4
- package/dist/input/index.js +4 -3
- package/dist/interactions/index.js +4 -1
- package/dist/invoice/index.js +18 -9
- package/dist/job-row/index.js +22 -0
- package/dist/json-inspector/index.js +20 -0
- package/dist/kbd/index.js +2 -2
- package/dist/keyboard/index.js +7 -2
- package/dist/level-meter/index.js +9 -0
- package/dist/list-row/index.js +11 -3
- package/dist/log-viewer/index.js +9 -2
- package/dist/map-view/index.js +13 -2
- package/dist/markdown/index.js +8 -5
- package/dist/metric/index.js +6 -3
- package/dist/metric-strip/index.js +12 -0
- package/dist/money/index.js +11 -4
- package/dist/nav-drawer/index.js +6 -2
- package/dist/nav-header/index.js +10 -4
- package/dist/navigation/index.js +29 -2
- package/dist/notification-center/index.js +24 -10
- package/dist/number-roll/index.js +3 -1
- package/dist/onboarding-pager/index.js +22 -0
- package/dist/one-handed/index.js +2 -2
- package/dist/os-surfaces/index.js +6 -3
- package/dist/otp/index.js +5 -4
- package/dist/page-header/index.js +2 -1
- package/dist/pagination/index.js +4 -2
- package/dist/payment-method/index.js +17 -11
- package/dist/payment-status/index.js +22 -14
- package/dist/permission/index.js +18 -2
- package/dist/picker/index.js +17 -6
- package/dist/progress/index.js +7 -2
- package/dist/provenance/index.js +16 -0
- package/dist/pull-to-refresh/index.js +2 -2
- package/dist/qr-code/index.js +16 -0
- package/dist/query-builder/index.js +30 -0
- package/dist/radio-group/index.js +6 -4
- package/dist/rating/index.js +7 -2
- package/dist/receivables/index.js +31 -18
- package/dist/recording-indicator/index.js +21 -0
- package/dist/refund/index.js +24 -15
- package/dist/repeatable-rows/index.js +19 -0
- package/dist/save-status/index.js +5 -3
- package/dist/screen/index.js +3 -0
- package/dist/scroll-area/index.js +1 -1
- package/dist/search-field/index.js +8 -3
- package/dist/secret-field/index.js +19 -0
- package/dist/section-header/index.js +4 -0
- package/dist/segmented-control/index.js +2 -2
- package/dist/sheet/index.js +9 -3
- package/dist/shortcuts-sheet/index.js +2 -0
- package/dist/sign-in-screen/index.js +25 -0
- package/dist/skeleton/index.js +3 -1
- package/dist/slider/index.js +2 -1
- package/dist/sortable/index.js +4 -3
- package/dist/spinner/index.js +2 -1
- package/dist/split-button/index.js +17 -5
- package/dist/spotlight/index.js +7 -1
- package/dist/stack/index.js +2 -0
- package/dist/stage-timeline/index.js +6 -3
- package/dist/status-dot/index.js +6 -2
- package/dist/stepper/index.js +7 -3
- package/dist/streaming-text/index.js +2 -1
- package/dist/survey/index.js +24 -14
- package/dist/switch/index.js +6 -2
- package/dist/system-state/index.js +12 -4
- package/dist/tab-bar/index.js +10 -2
- package/dist/tabs/index.js +10 -2
- package/dist/tags-input/index.js +8 -5
- package/dist/text/index.js +4 -0
- package/dist/textarea/index.js +5 -4
- package/dist/thinking/index.js +4 -1
- package/dist/tile-rail/index.js +10 -0
- package/dist/time-field/index.js +15 -7
- package/dist/time-range-control/index.js +26 -12
- package/dist/timeline/index.js +2 -2
- package/dist/toast/index.js +4 -2
- package/dist/toolbar/index.js +3 -2
- package/dist/tour/index.js +12 -10
- package/dist/transcript/index.js +28 -0
- package/dist/truncation-notice/index.js +2 -2
- package/dist/update-notice/index.js +15 -8
- package/dist/video-player/index.js +26 -2
- package/dist/viewfinder/index.js +12 -4
- package/dist/widget/index.js +11 -4
- package/dist/wizard/index.js +7 -4
- package/package.json +13 -13
- package/dist/chunk-2PKYGLQ6.js +0 -268
- package/dist/chunk-2SWKL3AJ.js +0 -466
- package/dist/chunk-2TXERVVA.js +0 -1081
- package/dist/chunk-3DUWIYV5.js +0 -437
- package/dist/chunk-3NMD74ZU.js +0 -4
- package/dist/chunk-4DS5ZWVC.js +0 -83
- package/dist/chunk-6YAQBXB3.js +0 -93
- package/dist/chunk-74FLKD24.js +0 -237
- package/dist/chunk-CMTVNF3D.js +0 -104
- package/dist/chunk-DN7MNQIP.js +0 -799
- package/dist/chunk-DVGBZ3TX.js +0 -455
- package/dist/chunk-F3H33DQX.js +0 -300
- package/dist/chunk-FAJI7BSC.js +0 -443
- package/dist/chunk-G3AFC24V.js +0 -60
- package/dist/chunk-HJLPZA4X.js +0 -369
- package/dist/chunk-HYEOQWT7.js +0 -647
- package/dist/chunk-IDM7JJMO.js +0 -110
- package/dist/chunk-IVKMZ7BB.js +0 -326
- package/dist/chunk-IXKWIFWZ.js +0 -334
- package/dist/chunk-JV5YOTOB.js +0 -164
- package/dist/chunk-KFJGFLMW.js +0 -158
- package/dist/chunk-LQP4KEXZ.js +0 -214
- package/dist/chunk-NTQ2F3AU.js +0 -257
- package/dist/chunk-O5V4TG3V.js +0 -329
- package/dist/chunk-OWAMM2DK.js +0 -280
- package/dist/chunk-PID3NJB7.js +0 -405
- package/dist/chunk-QDZGFXQD.js +0 -176
- package/dist/chunk-QPWDDJJ4.js +0 -385
- package/dist/chunk-ROCUG24E.js +0 -416
- package/dist/chunk-RU3ZPNL6.js +0 -1986
- package/dist/chunk-RXSCIO6W.js +0 -153
- package/dist/chunk-SKWO3SZF.js +0 -2284
- package/dist/chunk-UQGBTPXH.js +0 -218
- package/dist/chunk-UYGDJWMN.js +0 -273
- package/dist/chunk-W74TXYFB.js +0 -107
- package/dist/chunk-WRDSPUE7.js +0 -417
- package/dist/chunk-XBZGDDMR.js +0 -105
- package/dist/chunk-XN4KG3P4.js +0 -1040
- package/dist/chunk-XQXMLMH3.js +0 -211
- package/dist/chunk-ZECZOOSB.js +0 -245
- /package/dist/{chunk-VFCUIDRT.js → chunk-3BKLBYPK.js} +0 -0
- /package/dist/{chunk-GEIGMWNF.js → chunk-QNZII37O.js} +0 -0
|
@@ -0,0 +1,1511 @@
|
|
|
1
|
+
import { PanelRoot } from './chunk-R5T4VZ7Z.js';
|
|
2
|
+
import { Amount, PriceRow } from './chunk-GVQQG435.js';
|
|
3
|
+
import { usePayLabels } from './chunk-QNZII37O.js';
|
|
4
|
+
import { MetricDelta } from './chunk-N7AX4OA4.js';
|
|
5
|
+
import { Checkbox } from './chunk-KNILMM4H.js';
|
|
6
|
+
import { Chip } from './chunk-7NGMUVNU.js';
|
|
7
|
+
import { Alert } from './chunk-Z7I4ZSO6.js';
|
|
8
|
+
import { Button } from './chunk-5DTKORLI.js';
|
|
9
|
+
import { resolveTextRole } from './chunk-L4D5LHCH.js';
|
|
10
|
+
import { Badge } from './chunk-LGNTP5XA.js';
|
|
11
|
+
import { SkeletonText, Skeleton } from './chunk-YJ5PXOX3.js';
|
|
12
|
+
import { softToneSkin } from './chunk-PJLTKDVY.js';
|
|
13
|
+
import { NAMED_ROLE, announce } from './chunk-W23G6JLF.js';
|
|
14
|
+
import { SegmentedControl } from './chunk-NZG75DGA.js';
|
|
15
|
+
import { RadioGroup, RadioGroupItem } from './chunk-PK7BN3MI.js';
|
|
16
|
+
import { TextField } from './chunk-KXLDK6HB.js';
|
|
17
|
+
import { isAndroidIdiom } from './chunk-TH4PW2WU.js';
|
|
18
|
+
import { useLabels, useLoamLocale } from './chunk-APCWFOZW.js';
|
|
19
|
+
import { Icon } from './chunk-PCEFCOLN.js';
|
|
20
|
+
import { useResolvedMotion, springConfig } from './chunk-J64KGCGX.js';
|
|
21
|
+
import * as React2 from 'react';
|
|
22
|
+
import { View, Text, Animated, AccessibilityInfo, Pressable } from 'react-native';
|
|
23
|
+
import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
|
|
24
|
+
import { arrivalText, refundRemaining, money, refundLedger, refundReasons, parseAmount, clampRefund, REFUND_FRACTIONS, refundFraction, evidenceTone, evidenceLabel, disputeWorthDefending, DISPUTE_ACCEPT_THRESHOLD_MINOR } from '@btndprojects/loam-pay';
|
|
25
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
26
|
+
|
|
27
|
+
// src/refund/refund-shell.ts
|
|
28
|
+
function refundShellStyle(theme, { variant = "default", elevation = "default", padding = "md", tone }) {
|
|
29
|
+
const raised = variant === "elevated" || elevation === "raised";
|
|
30
|
+
const flat = elevation === "flat";
|
|
31
|
+
return {
|
|
32
|
+
...padding === "sm" ? { padding: theme.space.s4 } : null,
|
|
33
|
+
...padding === "lg" ? { padding: theme.space.s6 } : null,
|
|
34
|
+
...variant === "outline" ? { backgroundColor: "transparent" } : null,
|
|
35
|
+
...tone && tone !== "neutral" ? { backgroundColor: softToneSkin(theme, tone).fill, borderColor: softToneSkin(theme, tone).edge } : null,
|
|
36
|
+
...raised && !flat ? theme.shadow.lg : null
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function panelBaseStyle(theme) {
|
|
40
|
+
return {
|
|
41
|
+
alignSelf: "stretch",
|
|
42
|
+
gap: theme.space.s5,
|
|
43
|
+
padding: theme.space.s5,
|
|
44
|
+
borderRadius: theme.radius.lg,
|
|
45
|
+
borderWidth: theme.borderWidth.base,
|
|
46
|
+
borderColor: theme.color.border,
|
|
47
|
+
backgroundColor: theme.color.surface
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// src/refund/refund-labels.ts
|
|
52
|
+
var DEFAULT_LABELS = {
|
|
53
|
+
issuedTitle: "Refund issued",
|
|
54
|
+
refundAnother: "Refund another charge",
|
|
55
|
+
title: "Refund",
|
|
56
|
+
notify: "Email the customer",
|
|
57
|
+
irreversible: "A refund cannot be undone. Check the amount before you issue it.",
|
|
58
|
+
modeAria: "Refund amount mode",
|
|
59
|
+
modeFull: "Full",
|
|
60
|
+
modePartial: "Partial",
|
|
61
|
+
fullBalance: "Refunding the full remaining balance",
|
|
62
|
+
commit: (amount) => `Refund ${amount}`,
|
|
63
|
+
states: {
|
|
64
|
+
requested: "Requested",
|
|
65
|
+
processing: "Processing",
|
|
66
|
+
sent: "Sent",
|
|
67
|
+
arrived: "Arrived",
|
|
68
|
+
failed: "Failed"
|
|
69
|
+
},
|
|
70
|
+
of: "of",
|
|
71
|
+
stillRefundable: "still refundable",
|
|
72
|
+
ledgerCaption: (currency) => `Refund ledger \xB7 ${currency}`,
|
|
73
|
+
reason: "Reason",
|
|
74
|
+
amount: "Refund amount",
|
|
75
|
+
upTo: (max) => `Up to ${max}.`,
|
|
76
|
+
capped: (max) => `That is more than the ${max} left, so it was capped.`,
|
|
77
|
+
percent: (percent) => `${percent}%`,
|
|
78
|
+
fractionAria: (percent, amount) => `Refund ${percent}% \u2014 ${amount}`,
|
|
79
|
+
amountMode: "Amount mode",
|
|
80
|
+
fullRefund: "Full refund",
|
|
81
|
+
partialRefund: "Partial refund",
|
|
82
|
+
refunding: "Refunding",
|
|
83
|
+
notStated: "Not stated",
|
|
84
|
+
customerEmail: "Customer email",
|
|
85
|
+
notifyYes: (label) => `${label} \u2014 yes`,
|
|
86
|
+
notifyNo: (label) => `${label} \u2014 no`,
|
|
87
|
+
announceIssued: (title, amount) => `${title}. ${amount}`,
|
|
88
|
+
disputeTitle: "Chargeback",
|
|
89
|
+
disputeDescription: "The amount and the network fee have already left the account. Submitting evidence asks the network to reverse the first of those; the fee is not refundable either way, and the network decides \u2014 not us.",
|
|
90
|
+
submitEvidence: "Submit evidence",
|
|
91
|
+
acceptDispute: "Accept the dispute",
|
|
92
|
+
evidence: "Evidence",
|
|
93
|
+
attach: "Attach",
|
|
94
|
+
days: (n) => `${n} ${n === 1 ? "day" : "days"}`,
|
|
95
|
+
toRespond: (due) => `to respond \xB7 evidence due ${due}`,
|
|
96
|
+
disputed: "Disputed",
|
|
97
|
+
networkFee: "Network fee",
|
|
98
|
+
reasonNetwork: (reason, network) => `${reason} \xB7 ${network}`,
|
|
99
|
+
opened: "Opened",
|
|
100
|
+
guidance: (worth, threshold, complete) => `${worth ? `Above ${threshold} this is usually worth defending \u2014 the amount at stake exceeds the staff time a response costs.` : `Below ${threshold} the staff time spent defending this usually exceeds the amount at stake. Accepting is a legitimate answer, not a loss.`}${complete ? "" : " Some evidence is still missing; submitting now sends what is attached."}`
|
|
101
|
+
};
|
|
102
|
+
var REFUND_STATE = {
|
|
103
|
+
requested: { variant: "neutral" },
|
|
104
|
+
processing: { variant: "info" },
|
|
105
|
+
sent: { variant: "info" },
|
|
106
|
+
arrived: { variant: "good" },
|
|
107
|
+
failed: { variant: "danger" }
|
|
108
|
+
};
|
|
109
|
+
var ALIGN_JUSTIFY = {
|
|
110
|
+
start: { justifyContent: "flex-start" },
|
|
111
|
+
center: { justifyContent: "center" },
|
|
112
|
+
end: { justifyContent: "flex-end" }
|
|
113
|
+
};
|
|
114
|
+
function RefundStatus({
|
|
115
|
+
state,
|
|
116
|
+
label,
|
|
117
|
+
size = "sm",
|
|
118
|
+
variant,
|
|
119
|
+
count,
|
|
120
|
+
motion,
|
|
121
|
+
error = false,
|
|
122
|
+
labels: labelsProp
|
|
123
|
+
}) {
|
|
124
|
+
const labels = useLabels("refund", DEFAULT_LABELS, labelsProp);
|
|
125
|
+
const { styles } = useStyles(sheet);
|
|
126
|
+
const meta = REFUND_STATE[state];
|
|
127
|
+
const tone = error ? "danger" : variant ?? meta.variant;
|
|
128
|
+
const pill = /* @__PURE__ */ jsx(Badge, { variant: tone, size, dot: true, children: label ?? labels.states[state] });
|
|
129
|
+
const hasCount = count !== void 0 && count > 0;
|
|
130
|
+
const message = typeof error === "string" && error ? error : null;
|
|
131
|
+
if (!hasCount && !message) return pill;
|
|
132
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.statusRow, children: [
|
|
133
|
+
pill,
|
|
134
|
+
hasCount ? /* @__PURE__ */ jsx(Badge, { variant: tone, size, count, ...motion ? { motion } : null }) : null,
|
|
135
|
+
message ? /* @__PURE__ */ jsx(Text, { accessibilityRole: "alert", style: styles.errorText, children: message }) : null
|
|
136
|
+
] });
|
|
137
|
+
}
|
|
138
|
+
function RefundArrivalNote({
|
|
139
|
+
method,
|
|
140
|
+
window: text,
|
|
141
|
+
inline = false,
|
|
142
|
+
tone = "info",
|
|
143
|
+
variant,
|
|
144
|
+
dismissible,
|
|
145
|
+
onDismiss,
|
|
146
|
+
action,
|
|
147
|
+
icon = "clock",
|
|
148
|
+
size = "compact",
|
|
149
|
+
motion,
|
|
150
|
+
loading = false,
|
|
151
|
+
labels: labelsProp,
|
|
152
|
+
style,
|
|
153
|
+
error = false
|
|
154
|
+
}) {
|
|
155
|
+
const pay = usePayLabels(labelsProp);
|
|
156
|
+
const theme = useLoamTheme("refund");
|
|
157
|
+
const { styles } = useStyles(sheet);
|
|
158
|
+
const body = text ?? arrivalText(method, pay);
|
|
159
|
+
const message = typeof error === "string" && error ? error : null;
|
|
160
|
+
const noteTone = error ? "danger" : tone;
|
|
161
|
+
if (loading) {
|
|
162
|
+
return /* @__PURE__ */ jsx(View, { accessibilityState: { busy: true }, "aria-busy": true, style: [styles.arrivalInline, style], children: /* @__PURE__ */ jsx(SkeletonText, { lines: 1 }) });
|
|
163
|
+
}
|
|
164
|
+
if (!inline) {
|
|
165
|
+
return /* @__PURE__ */ jsx(View, { style, children: /* @__PURE__ */ jsx(
|
|
166
|
+
Alert,
|
|
167
|
+
{
|
|
168
|
+
tone: noteTone,
|
|
169
|
+
size: message ? "md" : size,
|
|
170
|
+
icon,
|
|
171
|
+
title: body,
|
|
172
|
+
...variant ? { variant } : null,
|
|
173
|
+
...dismissible !== void 0 ? { dismissible } : null,
|
|
174
|
+
...onDismiss ? { onDismiss } : null,
|
|
175
|
+
...action ? { action } : null,
|
|
176
|
+
...motion ? { motion } : null,
|
|
177
|
+
children: message ? /* @__PURE__ */ jsx(Text, { style: styles.arrivalBlockError, children: message }) : null
|
|
178
|
+
}
|
|
179
|
+
) });
|
|
180
|
+
}
|
|
181
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.arrivalInline, style], children: [
|
|
182
|
+
icon ? /* @__PURE__ */ jsx(
|
|
183
|
+
Icon,
|
|
184
|
+
{
|
|
185
|
+
name: icon,
|
|
186
|
+
size: theme.icon.sm,
|
|
187
|
+
color: noteTone === "info" || noteTone === "neutral" ? theme.color.text3 : theme.color[noteTone]
|
|
188
|
+
}
|
|
189
|
+
) : null,
|
|
190
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.arrivalInlineBody, size === "md" ? styles.arrivalInlineMd : null], children: body }),
|
|
191
|
+
message ? /* @__PURE__ */ jsx(Text, { role: "alert", accessibilityRole: "alert", style: styles.arrivalError, children: message }) : null
|
|
192
|
+
] });
|
|
193
|
+
}
|
|
194
|
+
function RefundRemainingNote({
|
|
195
|
+
charge,
|
|
196
|
+
currency,
|
|
197
|
+
label: labelProp,
|
|
198
|
+
size = "sm",
|
|
199
|
+
unit,
|
|
200
|
+
tone,
|
|
201
|
+
loading = false,
|
|
202
|
+
align = "start",
|
|
203
|
+
locale: localeProp,
|
|
204
|
+
labels: labelsProp,
|
|
205
|
+
style,
|
|
206
|
+
error
|
|
207
|
+
}) {
|
|
208
|
+
const labels = useLabels("refund", DEFAULT_LABELS, labelsProp);
|
|
209
|
+
const providerLocale = useLoamLocale();
|
|
210
|
+
const locale = localeProp ?? providerLocale;
|
|
211
|
+
const label = labelProp ?? labels.stillRefundable;
|
|
212
|
+
const { styles } = useStyles(sheet);
|
|
213
|
+
const code = currency ?? charge.currency ?? "USD";
|
|
214
|
+
const wordSize = size === "sm" ? null : size === "md" ? styles.wordMd : styles.wordLg;
|
|
215
|
+
return /* @__PURE__ */ jsxs(
|
|
216
|
+
View,
|
|
217
|
+
{
|
|
218
|
+
accessible: true,
|
|
219
|
+
accessibilityRole: NAMED_ROLE,
|
|
220
|
+
accessibilityLabel: `${money(refundRemaining(charge), code, { locale })} ${labels.of} ${money(charge.amountMinor, code, { locale })}${unit ? ` ${unit}` : ""} ${label}${error ? `. ${error}` : ""}`,
|
|
221
|
+
accessibilityState: loading ? { busy: true } : void 0,
|
|
222
|
+
"aria-busy": loading || void 0,
|
|
223
|
+
style: [styles.remaining, ALIGN_JUSTIFY[align], style],
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ jsx(
|
|
226
|
+
Amount,
|
|
227
|
+
{
|
|
228
|
+
minor: refundRemaining(charge),
|
|
229
|
+
currency: code,
|
|
230
|
+
size,
|
|
231
|
+
weight: "bold",
|
|
232
|
+
locale,
|
|
233
|
+
loading,
|
|
234
|
+
...error ? { tone: "danger" } : tone ? { tone } : null,
|
|
235
|
+
...unit ? { noSymbol: true } : null
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.remainingWord, wordSize], children: labels.of }),
|
|
239
|
+
/* @__PURE__ */ jsx(
|
|
240
|
+
Amount,
|
|
241
|
+
{
|
|
242
|
+
minor: charge.amountMinor,
|
|
243
|
+
currency: code,
|
|
244
|
+
size,
|
|
245
|
+
locale,
|
|
246
|
+
loading,
|
|
247
|
+
...unit ? { noSymbol: true } : null
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
unit ? /* @__PURE__ */ jsx(Text, { style: [styles.remainingWord, wordSize], children: unit }) : null,
|
|
251
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.remainingWord, wordSize], children: label }),
|
|
252
|
+
error ? /* @__PURE__ */ jsx(
|
|
253
|
+
Text,
|
|
254
|
+
{
|
|
255
|
+
role: "alert",
|
|
256
|
+
accessibilityRole: "alert",
|
|
257
|
+
style: [styles.remainingWord, wordSize, styles.remainingError],
|
|
258
|
+
children: error
|
|
259
|
+
}
|
|
260
|
+
) : null
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
function RefundLedger({
|
|
266
|
+
charge,
|
|
267
|
+
next = 0,
|
|
268
|
+
currency,
|
|
269
|
+
caption,
|
|
270
|
+
loading = false,
|
|
271
|
+
density,
|
|
272
|
+
orientation,
|
|
273
|
+
align,
|
|
274
|
+
size,
|
|
275
|
+
unit,
|
|
276
|
+
tone,
|
|
277
|
+
error,
|
|
278
|
+
locale: localeProp,
|
|
279
|
+
labels: labelsProp,
|
|
280
|
+
style
|
|
281
|
+
}) {
|
|
282
|
+
const labels = useLabels("refund", DEFAULT_LABELS, labelsProp);
|
|
283
|
+
const pay = usePayLabels(labelsProp);
|
|
284
|
+
const providerLocale = useLoamLocale();
|
|
285
|
+
const locale = localeProp ?? providerLocale;
|
|
286
|
+
const theme = useLoamTheme("refund");
|
|
287
|
+
const { styles } = useStyles(sheet);
|
|
288
|
+
const code = currency ?? charge.currency ?? "USD";
|
|
289
|
+
const rows = refundLedger(charge, next, pay);
|
|
290
|
+
return /* @__PURE__ */ jsxs(
|
|
291
|
+
View,
|
|
292
|
+
{
|
|
293
|
+
accessibilityState: loading ? { busy: true } : void 0,
|
|
294
|
+
"aria-busy": loading || void 0,
|
|
295
|
+
style: [
|
|
296
|
+
styles.ledger,
|
|
297
|
+
density === "compact" ? styles.ledgerCompact : null,
|
|
298
|
+
tone && tone !== "neutral" ? {
|
|
299
|
+
backgroundColor: softToneSkin(theme, tone).fill,
|
|
300
|
+
borderColor: softToneSkin(theme, tone).edge
|
|
301
|
+
} : null,
|
|
302
|
+
style
|
|
303
|
+
],
|
|
304
|
+
children: [
|
|
305
|
+
/* @__PURE__ */ jsx(
|
|
306
|
+
Text,
|
|
307
|
+
{
|
|
308
|
+
style: [
|
|
309
|
+
styles.overline,
|
|
310
|
+
align === "start" ? styles.captionStart : null,
|
|
311
|
+
// `text3` is measured against the neutral surfaces; a tint takes `text2`.
|
|
312
|
+
tone && tone !== "neutral" ? { color: theme.color.text2 } : null
|
|
313
|
+
],
|
|
314
|
+
children: caption ?? labels.ledgerCaption(unit ?? code)
|
|
315
|
+
}
|
|
316
|
+
),
|
|
317
|
+
rows.map((row) => /* @__PURE__ */ jsx(
|
|
318
|
+
PriceRow,
|
|
319
|
+
{
|
|
320
|
+
label: row.label,
|
|
321
|
+
minor: row.amountMinor,
|
|
322
|
+
currency: code,
|
|
323
|
+
tone: row.tone === "good" && !(tone && tone !== "neutral") ? "good" : void 0,
|
|
324
|
+
strong: row.strong,
|
|
325
|
+
rule: row.strong,
|
|
326
|
+
noSymbol: true,
|
|
327
|
+
locale,
|
|
328
|
+
loading,
|
|
329
|
+
...density ? { density } : null,
|
|
330
|
+
...orientation ? { orientation } : null,
|
|
331
|
+
...align ? { align } : null,
|
|
332
|
+
...size ? { size } : null,
|
|
333
|
+
...unit ? { unit } : null
|
|
334
|
+
},
|
|
335
|
+
row.label
|
|
336
|
+
)),
|
|
337
|
+
error ? /* @__PURE__ */ jsx(Text, { accessibilityRole: "alert", style: styles.errorText, children: error }) : null
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
function RefundReasonList({
|
|
343
|
+
value,
|
|
344
|
+
onChange,
|
|
345
|
+
reasons,
|
|
346
|
+
label,
|
|
347
|
+
showNotes = true,
|
|
348
|
+
size,
|
|
349
|
+
error,
|
|
350
|
+
disabled,
|
|
351
|
+
hint,
|
|
352
|
+
tone,
|
|
353
|
+
loading = false,
|
|
354
|
+
labels: labelsProp
|
|
355
|
+
}) {
|
|
356
|
+
const labels = useLabels("refund", DEFAULT_LABELS, labelsProp);
|
|
357
|
+
const pay = usePayLabels(labelsProp);
|
|
358
|
+
const list = reasons ?? refundReasons(pay);
|
|
359
|
+
const { styles } = useStyles(sheet);
|
|
360
|
+
const theme = useLoamTheme("refund");
|
|
361
|
+
if (loading) {
|
|
362
|
+
return /* @__PURE__ */ jsxs(
|
|
363
|
+
View,
|
|
364
|
+
{
|
|
365
|
+
accessibilityState: { busy: true },
|
|
366
|
+
"aria-busy": true,
|
|
367
|
+
style: [styles.reasonRow, styles.reasonLoading],
|
|
368
|
+
children: [
|
|
369
|
+
/* @__PURE__ */ jsx(Text, { style: styles.overline, children: label ?? labels.reason }),
|
|
370
|
+
list.map(([id]) => /* @__PURE__ */ jsx(Skeleton, { variant: "rect", height: theme.ctl.lg, decorative: true }, id))
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
const skin = tone && tone !== "neutral" ? softToneSkin(theme, tone) : null;
|
|
376
|
+
const group = /* @__PURE__ */ jsx(
|
|
377
|
+
RadioGroup,
|
|
378
|
+
{
|
|
379
|
+
label: label ?? labels.reason,
|
|
380
|
+
size,
|
|
381
|
+
error,
|
|
382
|
+
disabled,
|
|
383
|
+
hint,
|
|
384
|
+
value: value ?? void 0,
|
|
385
|
+
onValueChange: (next) => onChange(next),
|
|
386
|
+
children: list.map(([id, text, note]) => /* @__PURE__ */ jsxs(View, { style: styles.reasonRow, children: [
|
|
387
|
+
/* @__PURE__ */ jsx(RadioGroupItem, { value: id, label: text, accessibilityLabel: `${text}. ${note}` }),
|
|
388
|
+
showNotes ? /* @__PURE__ */ jsx(Text, { style: [styles.reasonNote, skin ? { color: theme.color.text2 } : null], children: note }) : null
|
|
389
|
+
] }, id))
|
|
390
|
+
}
|
|
391
|
+
);
|
|
392
|
+
return skin ? /* @__PURE__ */ jsx(View, { style: [styles.reasonTone, { backgroundColor: skin.fill, borderColor: skin.edge }], children: group }) : group;
|
|
393
|
+
}
|
|
394
|
+
function RefundAmountField({
|
|
395
|
+
valueMinor,
|
|
396
|
+
onChangeMinor,
|
|
397
|
+
remaining,
|
|
398
|
+
currency,
|
|
399
|
+
label,
|
|
400
|
+
hint,
|
|
401
|
+
error,
|
|
402
|
+
fractions = REFUND_FRACTIONS,
|
|
403
|
+
disabled = false,
|
|
404
|
+
readOnly = false,
|
|
405
|
+
size,
|
|
406
|
+
tone,
|
|
407
|
+
surface,
|
|
408
|
+
success,
|
|
409
|
+
loading,
|
|
410
|
+
clearable,
|
|
411
|
+
leadingIcon,
|
|
412
|
+
trailingIcon,
|
|
413
|
+
motion,
|
|
414
|
+
locale: localeProp,
|
|
415
|
+
labels: labelsProp,
|
|
416
|
+
style
|
|
417
|
+
}) {
|
|
418
|
+
const labels = useLabels("refund", DEFAULT_LABELS, labelsProp);
|
|
419
|
+
const providerLocale = useLoamLocale();
|
|
420
|
+
const locale = localeProp ?? providerLocale;
|
|
421
|
+
const { styles } = useStyles(sheet);
|
|
422
|
+
const [draft, setDraft] = React2.useState(null);
|
|
423
|
+
const [capped, setCapped] = React2.useState(false);
|
|
424
|
+
const display = draft ?? money(valueMinor, currency, { noSymbol: true, locale });
|
|
425
|
+
const maxText = money(remaining, currency, { locale });
|
|
426
|
+
const chips = fractions === false || readOnly ? [] : fractions;
|
|
427
|
+
const cappedMessage = labels.capped(maxText);
|
|
428
|
+
React2.useEffect(() => {
|
|
429
|
+
if (capped) announce(cappedMessage);
|
|
430
|
+
}, [capped]);
|
|
431
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.amountBlock, style], children: [
|
|
432
|
+
/* @__PURE__ */ jsx(
|
|
433
|
+
TextField,
|
|
434
|
+
{
|
|
435
|
+
label: label ?? labels.amount,
|
|
436
|
+
hint: hint ?? labels.upTo(maxText),
|
|
437
|
+
error: error ?? (capped ? cappedMessage : void 0),
|
|
438
|
+
...tone ? { validationState: tone === "good" ? "valid" : "invalid" } : null,
|
|
439
|
+
value: display,
|
|
440
|
+
editable: !disabled,
|
|
441
|
+
readOnly,
|
|
442
|
+
...size ? { size } : null,
|
|
443
|
+
surface,
|
|
444
|
+
...success !== void 0 ? { success } : null,
|
|
445
|
+
...loading !== void 0 ? { loading } : null,
|
|
446
|
+
...clearable !== void 0 ? { clearable } : null,
|
|
447
|
+
...leadingIcon ? { leadingIcon } : null,
|
|
448
|
+
...trailingIcon ? { trailingIcon } : null,
|
|
449
|
+
...motion ? { motion } : null,
|
|
450
|
+
inputMode: "decimal",
|
|
451
|
+
autoComplete: "off",
|
|
452
|
+
autoCorrect: false,
|
|
453
|
+
keyboardType: "decimal-pad",
|
|
454
|
+
onChangeText: (text) => {
|
|
455
|
+
setDraft(text);
|
|
456
|
+
const parsed = parseAmount(text, currency);
|
|
457
|
+
setCapped(parsed !== null && parsed > remaining);
|
|
458
|
+
onChangeMinor(clampRefund(parsed ?? 0, remaining));
|
|
459
|
+
},
|
|
460
|
+
onBlur: () => setDraft(null)
|
|
461
|
+
}
|
|
462
|
+
),
|
|
463
|
+
chips.length > 0 ? /* @__PURE__ */ jsx(View, { style: styles.chipRow, children: chips.map((percent) => {
|
|
464
|
+
const target = refundFraction(percent, remaining);
|
|
465
|
+
return /* @__PURE__ */ jsx(
|
|
466
|
+
Chip,
|
|
467
|
+
{
|
|
468
|
+
variant: "filter",
|
|
469
|
+
size: "sm",
|
|
470
|
+
disabled,
|
|
471
|
+
selected: !disabled && valueMinor === target && remaining > 0,
|
|
472
|
+
accessibilityLabel: labels.fractionAria(
|
|
473
|
+
percent,
|
|
474
|
+
money(target, currency, { locale })
|
|
475
|
+
),
|
|
476
|
+
onSelectedChange: () => {
|
|
477
|
+
setDraft(null);
|
|
478
|
+
setCapped(false);
|
|
479
|
+
onChangeMinor(target);
|
|
480
|
+
},
|
|
481
|
+
children: labels.percent(percent)
|
|
482
|
+
},
|
|
483
|
+
percent
|
|
484
|
+
);
|
|
485
|
+
}) }) : null
|
|
486
|
+
] });
|
|
487
|
+
}
|
|
488
|
+
var sheet = createStyleSheet((theme) => ({
|
|
489
|
+
errorText: {
|
|
490
|
+
fontFamily: theme.font.sans,
|
|
491
|
+
fontSize: theme.type.caption1.fontSize,
|
|
492
|
+
color: theme.color.dangerOnSoft
|
|
493
|
+
},
|
|
494
|
+
arrivalError: {
|
|
495
|
+
fontFamily: theme.font.sans,
|
|
496
|
+
fontSize: theme.type.footnote.fontSize,
|
|
497
|
+
color: theme.color.danger
|
|
498
|
+
},
|
|
499
|
+
arrivalBlockError: {
|
|
500
|
+
fontFamily: theme.font.sans,
|
|
501
|
+
fontSize: theme.type.footnote.fontSize,
|
|
502
|
+
color: theme.color.dangerOnSoft
|
|
503
|
+
},
|
|
504
|
+
remainingError: { color: theme.color.danger },
|
|
505
|
+
statusRow: { flexDirection: "row", alignItems: "center", gap: theme.space.s1 },
|
|
506
|
+
arrivalInline: { flexDirection: "row", alignItems: "flex-start", gap: theme.space.s2 },
|
|
507
|
+
arrivalInlineBody: {
|
|
508
|
+
flexShrink: 1,
|
|
509
|
+
fontFamily: theme.font.sans,
|
|
510
|
+
fontSize: theme.type.footnote.fontSize,
|
|
511
|
+
lineHeight: theme.type.footnote.fontSize * theme.lineHeight.normal,
|
|
512
|
+
color: theme.color.text2
|
|
513
|
+
},
|
|
514
|
+
arrivalInlineMd: {
|
|
515
|
+
fontSize: theme.type.subheadline.fontSize,
|
|
516
|
+
lineHeight: theme.type.subheadline.fontSize * theme.lineHeight.normal
|
|
517
|
+
},
|
|
518
|
+
remaining: {
|
|
519
|
+
flexDirection: "row",
|
|
520
|
+
flexWrap: "wrap",
|
|
521
|
+
alignItems: "baseline",
|
|
522
|
+
gap: theme.space.s1
|
|
523
|
+
},
|
|
524
|
+
wordMd: {
|
|
525
|
+
fontSize: theme.type.subheadline.fontSize,
|
|
526
|
+
lineHeight: theme.type.subheadline.lineHeight
|
|
527
|
+
},
|
|
528
|
+
wordLg: {
|
|
529
|
+
fontSize: theme.type.body.fontSize,
|
|
530
|
+
lineHeight: theme.type.body.lineHeight
|
|
531
|
+
},
|
|
532
|
+
remainingWord: {
|
|
533
|
+
fontFamily: theme.font.sans,
|
|
534
|
+
fontSize: theme.type.footnote.fontSize,
|
|
535
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
536
|
+
color: theme.color.text2
|
|
537
|
+
},
|
|
538
|
+
ledger: {
|
|
539
|
+
alignSelf: "stretch",
|
|
540
|
+
gap: theme.space.s2,
|
|
541
|
+
padding: theme.space.s4,
|
|
542
|
+
borderRadius: theme.radius.md,
|
|
543
|
+
borderWidth: theme.borderWidth.base,
|
|
544
|
+
borderColor: theme.color.border,
|
|
545
|
+
backgroundColor: theme.color.surface2
|
|
546
|
+
},
|
|
547
|
+
ledgerCompact: { gap: theme.space.s1, padding: theme.space.s3 },
|
|
548
|
+
captionStart: { textAlign: theme.rtl ? "right" : "left" },
|
|
549
|
+
overline: {
|
|
550
|
+
...theme.type.overline,
|
|
551
|
+
fontFamily: theme.font.sans,
|
|
552
|
+
color: theme.color.text3
|
|
553
|
+
},
|
|
554
|
+
reasonRow: { gap: theme.space[2] },
|
|
555
|
+
reasonLoading: { gap: theme.space.s2 },
|
|
556
|
+
reasonTone: {
|
|
557
|
+
padding: theme.space.s3,
|
|
558
|
+
borderRadius: theme.radius.md,
|
|
559
|
+
borderWidth: theme.borderWidth.base
|
|
560
|
+
},
|
|
561
|
+
reasonNote: {
|
|
562
|
+
marginStart: theme.space.s7,
|
|
563
|
+
fontFamily: theme.font.sans,
|
|
564
|
+
fontSize: theme.type.caption1.fontSize,
|
|
565
|
+
lineHeight: theme.type.caption1.fontSize * theme.lineHeight.normal,
|
|
566
|
+
color: theme.color.text3
|
|
567
|
+
},
|
|
568
|
+
amountBlock: { alignSelf: "stretch", gap: theme.space.s2 },
|
|
569
|
+
chipRow: {
|
|
570
|
+
flexDirection: "row",
|
|
571
|
+
flexWrap: "wrap",
|
|
572
|
+
alignItems: "center",
|
|
573
|
+
gap: theme.space.s1
|
|
574
|
+
}
|
|
575
|
+
}));
|
|
576
|
+
function RefundConfirmation({
|
|
577
|
+
charge,
|
|
578
|
+
result,
|
|
579
|
+
method,
|
|
580
|
+
currency,
|
|
581
|
+
title: titleProp,
|
|
582
|
+
refundAnotherLabel,
|
|
583
|
+
onRefundAnother,
|
|
584
|
+
actions,
|
|
585
|
+
locale: localeProp,
|
|
586
|
+
labels: labelsProp,
|
|
587
|
+
platform,
|
|
588
|
+
style,
|
|
589
|
+
roll = false,
|
|
590
|
+
motion = "full",
|
|
591
|
+
variant,
|
|
592
|
+
elevation,
|
|
593
|
+
padding,
|
|
594
|
+
tone,
|
|
595
|
+
size = "hero",
|
|
596
|
+
delta,
|
|
597
|
+
loading = false,
|
|
598
|
+
error,
|
|
599
|
+
interactive = false,
|
|
600
|
+
onPress
|
|
601
|
+
}) {
|
|
602
|
+
const labels = useLabels("refund", DEFAULT_LABELS, labelsProp);
|
|
603
|
+
const providerLocale = useLoamLocale();
|
|
604
|
+
const locale = localeProp ?? providerLocale;
|
|
605
|
+
const title = titleProp ?? labels.issuedTitle;
|
|
606
|
+
const theme = useLoamTheme("refund");
|
|
607
|
+
const android = isAndroidIdiom(theme, platform);
|
|
608
|
+
const titleType = resolveTextRole(theme, "surfaceTitle", android);
|
|
609
|
+
const { styles } = useStyles(sheet2);
|
|
610
|
+
const code = currency ?? charge.currency ?? "USD";
|
|
611
|
+
const level = useResolvedMotion(motion, "refund");
|
|
612
|
+
const rise = React2.useRef(new Animated.Value(level === "full" ? 0 : 1)).current;
|
|
613
|
+
const pop = React2.useRef(new Animated.Value(level === "full" ? 0 : 1)).current;
|
|
614
|
+
React2.useEffect(() => {
|
|
615
|
+
AccessibilityInfo.announceForAccessibility(
|
|
616
|
+
labels.announceIssued(title, money(result.amountMinor, code, { locale }))
|
|
617
|
+
);
|
|
618
|
+
}, []);
|
|
619
|
+
React2.useEffect(() => {
|
|
620
|
+
if (level !== "full") return;
|
|
621
|
+
const run = Animated.parallel([
|
|
622
|
+
Animated.spring(rise, { ...springConfig(theme, "ds"), toValue: 1, useNativeDriver: true }),
|
|
623
|
+
Animated.sequence([
|
|
624
|
+
// loam-audit-ignore raw-duration — one stagger step after the panel starts rising.
|
|
625
|
+
Animated.delay(60),
|
|
626
|
+
Animated.spring(pop, { ...springConfig(theme, "fs"), toValue: 1, useNativeDriver: true })
|
|
627
|
+
])
|
|
628
|
+
]);
|
|
629
|
+
run.start();
|
|
630
|
+
return () => run.stop();
|
|
631
|
+
}, []);
|
|
632
|
+
return /* @__PURE__ */ jsxs(
|
|
633
|
+
PanelRoot,
|
|
634
|
+
{
|
|
635
|
+
interactive,
|
|
636
|
+
onPress,
|
|
637
|
+
role: "status",
|
|
638
|
+
accessibilityLiveRegion: "polite",
|
|
639
|
+
accessibilityLabel: title,
|
|
640
|
+
accessibilityState: loading ? { busy: true } : void 0,
|
|
641
|
+
"aria-busy": loading || void 0,
|
|
642
|
+
style: [styles.panel, refundShellStyle(theme, { variant, elevation, padding, tone }), style],
|
|
643
|
+
...{ "aria-live": "polite" },
|
|
644
|
+
children: [
|
|
645
|
+
/* @__PURE__ */ jsxs(
|
|
646
|
+
Animated.View,
|
|
647
|
+
{
|
|
648
|
+
style: [
|
|
649
|
+
styles.confirmHead,
|
|
650
|
+
{
|
|
651
|
+
opacity: rise,
|
|
652
|
+
transform: [
|
|
653
|
+
{
|
|
654
|
+
translateY: rise.interpolate({
|
|
655
|
+
inputRange: [0, 1],
|
|
656
|
+
outputRange: [theme.space.s3, 0]
|
|
657
|
+
})
|
|
658
|
+
}
|
|
659
|
+
]
|
|
660
|
+
}
|
|
661
|
+
],
|
|
662
|
+
children: [
|
|
663
|
+
/* @__PURE__ */ jsx(
|
|
664
|
+
Animated.View,
|
|
665
|
+
{
|
|
666
|
+
"aria-hidden": true,
|
|
667
|
+
accessibilityElementsHidden: true,
|
|
668
|
+
importantForAccessibility: "no-hide-descendants",
|
|
669
|
+
style: [
|
|
670
|
+
styles.checkPlate,
|
|
671
|
+
{
|
|
672
|
+
opacity: pop,
|
|
673
|
+
transform: [
|
|
674
|
+
{ scale: pop.interpolate({ inputRange: [0, 1], outputRange: [0.5, 1] }) }
|
|
675
|
+
]
|
|
676
|
+
}
|
|
677
|
+
],
|
|
678
|
+
children: /* @__PURE__ */ jsx(
|
|
679
|
+
Icon,
|
|
680
|
+
{
|
|
681
|
+
name: "check",
|
|
682
|
+
size: theme.icon.md,
|
|
683
|
+
color: theme.color.goodOnSoft,
|
|
684
|
+
strokeWidth: theme.icon.strokeBold
|
|
685
|
+
}
|
|
686
|
+
)
|
|
687
|
+
}
|
|
688
|
+
),
|
|
689
|
+
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles.title, titleType], children: title }),
|
|
690
|
+
/* @__PURE__ */ jsx(
|
|
691
|
+
Amount,
|
|
692
|
+
{
|
|
693
|
+
minor: result.amountMinor,
|
|
694
|
+
currency: code,
|
|
695
|
+
size,
|
|
696
|
+
locale,
|
|
697
|
+
loading,
|
|
698
|
+
...roll ? { roll: true, motion } : null
|
|
699
|
+
}
|
|
700
|
+
),
|
|
701
|
+
delta !== void 0 ? /* @__PURE__ */ jsx(MetricDelta, { delta }) : null,
|
|
702
|
+
/* @__PURE__ */ jsxs(View, { style: styles.confirmMeta, children: [
|
|
703
|
+
/* @__PURE__ */ jsx(RefundStatus, { state: result.state, labels: labelsProp }),
|
|
704
|
+
result.issuedLabel ? /* @__PURE__ */ jsx(Text, { style: styles.meta, children: result.issuedLabel }) : null,
|
|
705
|
+
result.refundId ? /* @__PURE__ */ jsx(Text, { style: styles.mono, children: result.refundId }) : null
|
|
706
|
+
] })
|
|
707
|
+
]
|
|
708
|
+
}
|
|
709
|
+
),
|
|
710
|
+
/* @__PURE__ */ jsx(RefundArrivalNote, { method, labels: labelsProp }),
|
|
711
|
+
/* @__PURE__ */ jsx(
|
|
712
|
+
RefundLedger,
|
|
713
|
+
{
|
|
714
|
+
charge,
|
|
715
|
+
next: result.amountMinor,
|
|
716
|
+
currency: code,
|
|
717
|
+
loading,
|
|
718
|
+
locale,
|
|
719
|
+
labels: labelsProp
|
|
720
|
+
}
|
|
721
|
+
),
|
|
722
|
+
error ? /* @__PURE__ */ jsx(Alert, { tone: "danger", title: error }) : null,
|
|
723
|
+
/* @__PURE__ */ jsxs(View, { style: [styles.actionRow, android ? styles.actionRowEnd : null], children: [
|
|
724
|
+
onRefundAnother ? /* @__PURE__ */ jsx(View, { style: android ? null : styles.actionShare, children: /* @__PURE__ */ jsx(Button, { variant: "outline", fullWidth: !android, onPress: onRefundAnother, children: refundAnotherLabel ?? labels.refundAnother }) }) : null,
|
|
725
|
+
actions
|
|
726
|
+
] })
|
|
727
|
+
]
|
|
728
|
+
}
|
|
729
|
+
);
|
|
730
|
+
}
|
|
731
|
+
function RefundPanel({
|
|
732
|
+
charge,
|
|
733
|
+
method,
|
|
734
|
+
mode,
|
|
735
|
+
amountMinor,
|
|
736
|
+
reason,
|
|
737
|
+
notify,
|
|
738
|
+
currency,
|
|
739
|
+
title: titleProp,
|
|
740
|
+
chargeLabel,
|
|
741
|
+
error,
|
|
742
|
+
result,
|
|
743
|
+
busy = false,
|
|
744
|
+
notifyLabel: notifyLabelProp,
|
|
745
|
+
irreversibleNote: irreversibleNoteProp,
|
|
746
|
+
onModeChange,
|
|
747
|
+
onAmountChange,
|
|
748
|
+
onReasonChange,
|
|
749
|
+
onNotifyChange,
|
|
750
|
+
onSubmit,
|
|
751
|
+
onRefundAnother,
|
|
752
|
+
locale: localeProp,
|
|
753
|
+
roll = true,
|
|
754
|
+
labels: labelsProp,
|
|
755
|
+
platform,
|
|
756
|
+
style,
|
|
757
|
+
motion = "full",
|
|
758
|
+
variant,
|
|
759
|
+
elevation,
|
|
760
|
+
padding,
|
|
761
|
+
tone,
|
|
762
|
+
density = "comfortable",
|
|
763
|
+
size,
|
|
764
|
+
disabled = false,
|
|
765
|
+
interactive = false,
|
|
766
|
+
onPress
|
|
767
|
+
}) {
|
|
768
|
+
const labels = useLabels("refund", DEFAULT_LABELS, labelsProp);
|
|
769
|
+
const pay = usePayLabels(labelsProp);
|
|
770
|
+
const providerLocale = useLoamLocale();
|
|
771
|
+
const locale = localeProp ?? providerLocale;
|
|
772
|
+
const title = titleProp ?? labels.title;
|
|
773
|
+
const notifyLabel = notifyLabelProp ?? labels.notify;
|
|
774
|
+
const irreversibleNote = irreversibleNoteProp ?? labels.irreversible;
|
|
775
|
+
const theme = useLoamTheme("refund");
|
|
776
|
+
const android = isAndroidIdiom(theme, platform);
|
|
777
|
+
const titleType = resolveTextRole(theme, "surfaceTitle", android);
|
|
778
|
+
const { styles } = useStyles(sheet2);
|
|
779
|
+
const code = currency ?? charge.currency ?? "USD";
|
|
780
|
+
const remaining = refundRemaining(charge);
|
|
781
|
+
const effective = mode === "full" ? remaining : amountMinor;
|
|
782
|
+
const reasonRow = reason === null ? void 0 : refundReasons(pay).find(([id]) => id === reason);
|
|
783
|
+
if (result) {
|
|
784
|
+
return /* @__PURE__ */ jsx(
|
|
785
|
+
RefundConfirmation,
|
|
786
|
+
{
|
|
787
|
+
charge,
|
|
788
|
+
result,
|
|
789
|
+
method,
|
|
790
|
+
currency: code,
|
|
791
|
+
onRefundAnother,
|
|
792
|
+
locale,
|
|
793
|
+
labels: labelsProp,
|
|
794
|
+
style,
|
|
795
|
+
variant,
|
|
796
|
+
elevation,
|
|
797
|
+
padding,
|
|
798
|
+
tone
|
|
799
|
+
}
|
|
800
|
+
);
|
|
801
|
+
}
|
|
802
|
+
return /* @__PURE__ */ jsxs(
|
|
803
|
+
PanelRoot,
|
|
804
|
+
{
|
|
805
|
+
interactive,
|
|
806
|
+
onPress,
|
|
807
|
+
role: "region",
|
|
808
|
+
accessibilityLabel: title,
|
|
809
|
+
style: [
|
|
810
|
+
styles.panel,
|
|
811
|
+
density === "compact" ? styles.panelCompact : null,
|
|
812
|
+
refundShellStyle(theme, { variant, elevation, padding, tone }),
|
|
813
|
+
style
|
|
814
|
+
],
|
|
815
|
+
children: [
|
|
816
|
+
/* @__PURE__ */ jsxs(View, { style: styles.header, children: [
|
|
817
|
+
/* @__PURE__ */ jsxs(View, { style: styles.headerRow, children: [
|
|
818
|
+
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles.title, titleType], children: title }),
|
|
819
|
+
charge.receiptId ? /* @__PURE__ */ jsx(View, { style: styles.pushEnd, children: /* @__PURE__ */ jsx(Text, { style: styles.mono, children: charge.receiptId }) }) : null
|
|
820
|
+
] }),
|
|
821
|
+
chargeLabel ? /* @__PURE__ */ jsx(Text, { style: styles.chargeLabel, children: chargeLabel }) : null,
|
|
822
|
+
/* @__PURE__ */ jsx(RefundRemainingNote, { charge, currency: code, locale, labels: labelsProp })
|
|
823
|
+
] }),
|
|
824
|
+
onModeChange ? /* @__PURE__ */ jsx(
|
|
825
|
+
SegmentedControl,
|
|
826
|
+
{
|
|
827
|
+
accessibilityLabel: labels.amountMode,
|
|
828
|
+
disabled,
|
|
829
|
+
value: mode,
|
|
830
|
+
onValueChange: (next) => onModeChange(next),
|
|
831
|
+
items: [
|
|
832
|
+
{ value: "full", label: labels.modeFull },
|
|
833
|
+
{ value: "partial", label: labels.modePartial }
|
|
834
|
+
]
|
|
835
|
+
}
|
|
836
|
+
) : /* @__PURE__ */ jsx(
|
|
837
|
+
Stated,
|
|
838
|
+
{
|
|
839
|
+
label: mode === "full" ? labels.fullRefund : labels.partialRefund,
|
|
840
|
+
overline: labels.amountMode
|
|
841
|
+
}
|
|
842
|
+
),
|
|
843
|
+
mode === "full" ? /* @__PURE__ */ jsxs(View, { style: styles.fullBox, children: [
|
|
844
|
+
/* @__PURE__ */ jsx(Text, { style: styles.fullLabel, children: labels.fullBalance }),
|
|
845
|
+
/* @__PURE__ */ jsx(View, { style: styles.pushEnd, children: /* @__PURE__ */ jsx(
|
|
846
|
+
Amount,
|
|
847
|
+
{
|
|
848
|
+
minor: remaining,
|
|
849
|
+
currency: code,
|
|
850
|
+
size: "lg",
|
|
851
|
+
weight: "bold",
|
|
852
|
+
locale,
|
|
853
|
+
roll
|
|
854
|
+
}
|
|
855
|
+
) })
|
|
856
|
+
] }) : onAmountChange ? /* @__PURE__ */ jsx(
|
|
857
|
+
RefundAmountField,
|
|
858
|
+
{
|
|
859
|
+
valueMinor: amountMinor,
|
|
860
|
+
onChangeMinor: onAmountChange,
|
|
861
|
+
remaining,
|
|
862
|
+
currency: code,
|
|
863
|
+
disabled,
|
|
864
|
+
...size ? { size } : null,
|
|
865
|
+
locale,
|
|
866
|
+
labels: labelsProp
|
|
867
|
+
}
|
|
868
|
+
) : /* @__PURE__ */ jsxs(View, { style: styles.fullBox, children: [
|
|
869
|
+
/* @__PURE__ */ jsx(Text, { style: styles.fullLabel, children: labels.refunding }),
|
|
870
|
+
/* @__PURE__ */ jsx(View, { style: styles.pushEnd, children: /* @__PURE__ */ jsx(
|
|
871
|
+
Amount,
|
|
872
|
+
{
|
|
873
|
+
minor: amountMinor,
|
|
874
|
+
currency: code,
|
|
875
|
+
size: "lg",
|
|
876
|
+
weight: "bold",
|
|
877
|
+
locale,
|
|
878
|
+
roll,
|
|
879
|
+
motion
|
|
880
|
+
}
|
|
881
|
+
) })
|
|
882
|
+
] }),
|
|
883
|
+
onReasonChange ? /* @__PURE__ */ jsx(
|
|
884
|
+
RefundReasonList,
|
|
885
|
+
{
|
|
886
|
+
value: reason,
|
|
887
|
+
onChange: onReasonChange,
|
|
888
|
+
disabled,
|
|
889
|
+
...size ? { size: size === "sm" ? "sm" : "md" } : null,
|
|
890
|
+
labels: labelsProp
|
|
891
|
+
}
|
|
892
|
+
) : /* @__PURE__ */ jsx(
|
|
893
|
+
Stated,
|
|
894
|
+
{
|
|
895
|
+
overline: labels.reason,
|
|
896
|
+
label: reasonRow ? reasonRow[1] : labels.notStated,
|
|
897
|
+
note: reasonRow ? reasonRow[2] : void 0
|
|
898
|
+
}
|
|
899
|
+
),
|
|
900
|
+
onNotifyChange ? (
|
|
901
|
+
// The box and its text are one control: one tap target, one focus
|
|
902
|
+
// stop, read once as "<label>, checkbox".
|
|
903
|
+
/* @__PURE__ */ jsx(
|
|
904
|
+
Checkbox,
|
|
905
|
+
{
|
|
906
|
+
checked: notify,
|
|
907
|
+
disabled,
|
|
908
|
+
onCheckedChange: (next) => onNotifyChange(next),
|
|
909
|
+
label: notifyLabel
|
|
910
|
+
}
|
|
911
|
+
)
|
|
912
|
+
) : /* @__PURE__ */ jsx(
|
|
913
|
+
Stated,
|
|
914
|
+
{
|
|
915
|
+
overline: labels.customerEmail,
|
|
916
|
+
label: notify ? labels.notifyYes(notifyLabel) : labels.notifyNo(notifyLabel)
|
|
917
|
+
}
|
|
918
|
+
),
|
|
919
|
+
/* @__PURE__ */ jsx(
|
|
920
|
+
RefundLedger,
|
|
921
|
+
{
|
|
922
|
+
charge,
|
|
923
|
+
next: effective,
|
|
924
|
+
currency: code,
|
|
925
|
+
locale,
|
|
926
|
+
labels: labelsProp
|
|
927
|
+
}
|
|
928
|
+
),
|
|
929
|
+
/* @__PURE__ */ jsx(RefundArrivalNote, { method, labels: labelsProp }),
|
|
930
|
+
error ? /* @__PURE__ */ jsx(Alert, { tone: "danger", title: error }) : null,
|
|
931
|
+
/* @__PURE__ */ jsxs(View, { style: styles.commitBlock, children: [
|
|
932
|
+
/* @__PURE__ */ jsxs(View, { style: styles.irreversibleRow, children: [
|
|
933
|
+
/* @__PURE__ */ jsx(Icon, { name: "alert-circle", size: theme.icon.sm, color: theme.color.text3 }),
|
|
934
|
+
/* @__PURE__ */ jsx(Text, { style: styles.irreversible, children: irreversibleNote })
|
|
935
|
+
] }),
|
|
936
|
+
/* @__PURE__ */ jsx(Button, { loading: busy, disabled, ...size ? { size } : null, onPress: onSubmit, children: labels.commit(money(effective, code, { locale })) })
|
|
937
|
+
] })
|
|
938
|
+
]
|
|
939
|
+
}
|
|
940
|
+
);
|
|
941
|
+
}
|
|
942
|
+
function Stated({
|
|
943
|
+
overline,
|
|
944
|
+
label,
|
|
945
|
+
note
|
|
946
|
+
}) {
|
|
947
|
+
const { styles } = useStyles(sheet2);
|
|
948
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.stated, children: [
|
|
949
|
+
/* @__PURE__ */ jsx(Text, { style: styles.overline, children: overline }),
|
|
950
|
+
/* @__PURE__ */ jsx(Text, { style: styles.statedValue, children: label }),
|
|
951
|
+
note ? /* @__PURE__ */ jsx(Text, { style: styles.statedNote, children: note }) : null
|
|
952
|
+
] });
|
|
953
|
+
}
|
|
954
|
+
var sheet2 = createStyleSheet((theme) => ({
|
|
955
|
+
panel: panelBaseStyle(theme),
|
|
956
|
+
panelCompact: { gap: theme.space.s3 },
|
|
957
|
+
header: { gap: theme.space.s1 },
|
|
958
|
+
headerRow: {
|
|
959
|
+
flexDirection: "row",
|
|
960
|
+
flexWrap: "wrap",
|
|
961
|
+
alignItems: "baseline",
|
|
962
|
+
gap: theme.space.s2
|
|
963
|
+
},
|
|
964
|
+
title: {
|
|
965
|
+
fontFamily: theme.font.display,
|
|
966
|
+
fontWeight: theme.font.displayWeight,
|
|
967
|
+
fontSize: theme.type.title3.fontSize,
|
|
968
|
+
lineHeight: theme.type.title3.lineHeight,
|
|
969
|
+
letterSpacing: theme.type.title3.letterSpacing,
|
|
970
|
+
color: theme.color.text
|
|
971
|
+
},
|
|
972
|
+
pushEnd: { marginStart: "auto" },
|
|
973
|
+
// Refinement 12: the one reference style — mono 12 / 500, tabular, text-2.
|
|
974
|
+
mono: {
|
|
975
|
+
fontFamily: theme.font.mono,
|
|
976
|
+
fontVariant: ["tabular-nums"],
|
|
977
|
+
fontSize: theme.fontSize[12],
|
|
978
|
+
fontWeight: theme.fontWeight.medium,
|
|
979
|
+
color: theme.color.text2
|
|
980
|
+
},
|
|
981
|
+
chargeLabel: {
|
|
982
|
+
fontFamily: theme.font.sans,
|
|
983
|
+
fontSize: theme.type.footnote.fontSize,
|
|
984
|
+
lineHeight: theme.type.footnote.fontSize * theme.lineHeight.normal,
|
|
985
|
+
color: theme.color.text2
|
|
986
|
+
},
|
|
987
|
+
fullBox: {
|
|
988
|
+
flexDirection: "row",
|
|
989
|
+
flexWrap: "wrap",
|
|
990
|
+
alignItems: "baseline",
|
|
991
|
+
gap: theme.space.s2,
|
|
992
|
+
padding: theme.space.s4,
|
|
993
|
+
borderRadius: theme.radius.md,
|
|
994
|
+
borderWidth: theme.borderWidth.base,
|
|
995
|
+
borderColor: theme.color.border,
|
|
996
|
+
backgroundColor: theme.color.surface2
|
|
997
|
+
},
|
|
998
|
+
fullLabel: {
|
|
999
|
+
fontFamily: theme.font.sans,
|
|
1000
|
+
fontSize: theme.type.footnote.fontSize,
|
|
1001
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
1002
|
+
color: theme.color.text2
|
|
1003
|
+
},
|
|
1004
|
+
stated: { gap: theme.space[2] },
|
|
1005
|
+
overline: {
|
|
1006
|
+
...theme.type.overline,
|
|
1007
|
+
fontFamily: theme.font.sans,
|
|
1008
|
+
color: theme.color.text3
|
|
1009
|
+
},
|
|
1010
|
+
statedValue: {
|
|
1011
|
+
fontFamily: theme.font.sans,
|
|
1012
|
+
fontWeight: theme.fontWeight.semibold,
|
|
1013
|
+
fontSize: theme.type.footnote.fontSize,
|
|
1014
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
1015
|
+
color: theme.color.text
|
|
1016
|
+
},
|
|
1017
|
+
statedNote: {
|
|
1018
|
+
fontFamily: theme.font.sans,
|
|
1019
|
+
fontSize: theme.type.caption1.fontSize,
|
|
1020
|
+
lineHeight: theme.type.caption1.fontSize * theme.lineHeight.normal,
|
|
1021
|
+
color: theme.color.text3
|
|
1022
|
+
},
|
|
1023
|
+
commitBlock: { gap: theme.space.s2 },
|
|
1024
|
+
irreversibleRow: { flexDirection: "row", alignItems: "flex-start", gap: theme.space.s2 },
|
|
1025
|
+
irreversible: {
|
|
1026
|
+
flexShrink: 1,
|
|
1027
|
+
fontFamily: theme.font.sans,
|
|
1028
|
+
fontSize: theme.type.caption1.fontSize,
|
|
1029
|
+
lineHeight: theme.type.caption1.fontSize * theme.lineHeight.normal,
|
|
1030
|
+
color: theme.color.text3
|
|
1031
|
+
},
|
|
1032
|
+
confirmHead: { alignItems: "center", gap: theme.space.s3 },
|
|
1033
|
+
checkPlate: {
|
|
1034
|
+
width: theme.ctl.iconBtn,
|
|
1035
|
+
height: theme.ctl.iconBtn,
|
|
1036
|
+
alignItems: "center",
|
|
1037
|
+
justifyContent: "center",
|
|
1038
|
+
borderRadius: theme.radius.full,
|
|
1039
|
+
// The soft tint always carries its tone edge.
|
|
1040
|
+
borderWidth: theme.borderWidth.base,
|
|
1041
|
+
borderColor: theme.edge.good,
|
|
1042
|
+
backgroundColor: theme.color.goodSoft
|
|
1043
|
+
},
|
|
1044
|
+
confirmMeta: {
|
|
1045
|
+
flexDirection: "row",
|
|
1046
|
+
flexWrap: "wrap",
|
|
1047
|
+
alignItems: "center",
|
|
1048
|
+
justifyContent: "center",
|
|
1049
|
+
gap: theme.space.s2
|
|
1050
|
+
},
|
|
1051
|
+
meta: {
|
|
1052
|
+
fontFamily: theme.font.sans,
|
|
1053
|
+
fontSize: theme.type.footnote.fontSize,
|
|
1054
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
1055
|
+
color: theme.color.text3
|
|
1056
|
+
},
|
|
1057
|
+
actionRow: {
|
|
1058
|
+
flexDirection: "row",
|
|
1059
|
+
flexWrap: "wrap",
|
|
1060
|
+
alignItems: "center",
|
|
1061
|
+
gap: theme.space.s2
|
|
1062
|
+
},
|
|
1063
|
+
// iOS: footer actions share the width (F30); Android: end-aligned.
|
|
1064
|
+
actionShare: { flexGrow: 1, flexBasis: 0 },
|
|
1065
|
+
actionRowEnd: { justifyContent: "flex-end" }
|
|
1066
|
+
}));
|
|
1067
|
+
var BADGE_VARIANT = {
|
|
1068
|
+
info: "info",
|
|
1069
|
+
good: "good",
|
|
1070
|
+
warn: "warn",
|
|
1071
|
+
danger: "danger",
|
|
1072
|
+
"text-3": "neutral"
|
|
1073
|
+
};
|
|
1074
|
+
var EVIDENCE_ICON = {
|
|
1075
|
+
have: "check-circle",
|
|
1076
|
+
missing: "alert-circle",
|
|
1077
|
+
"n/a": "minus"
|
|
1078
|
+
};
|
|
1079
|
+
function DisputeDeadline({
|
|
1080
|
+
dispute,
|
|
1081
|
+
urgentAt = 3,
|
|
1082
|
+
size = "md",
|
|
1083
|
+
density = "comfortable",
|
|
1084
|
+
orientation = "vertical",
|
|
1085
|
+
align = "start",
|
|
1086
|
+
unit,
|
|
1087
|
+
loading = false,
|
|
1088
|
+
locale: localeProp,
|
|
1089
|
+
labels: labelsProp,
|
|
1090
|
+
style,
|
|
1091
|
+
error
|
|
1092
|
+
}) {
|
|
1093
|
+
const labels = useLabels("refund", DEFAULT_LABELS, labelsProp);
|
|
1094
|
+
const providerLocale = useLoamLocale();
|
|
1095
|
+
const locale = localeProp ?? providerLocale;
|
|
1096
|
+
const theme = useLoamTheme("refund");
|
|
1097
|
+
const { styles } = useStyles(sheet3);
|
|
1098
|
+
const urgent = Boolean(error) || dispute.daysLeft <= urgentAt;
|
|
1099
|
+
const ink = urgent ? theme.color.dangerOnSoft : theme.color.warnOnSoft;
|
|
1100
|
+
return /* @__PURE__ */ jsxs(
|
|
1101
|
+
View,
|
|
1102
|
+
{
|
|
1103
|
+
accessibilityState: loading ? { busy: true } : void 0,
|
|
1104
|
+
"aria-busy": loading || void 0,
|
|
1105
|
+
style: [
|
|
1106
|
+
styles.deadline,
|
|
1107
|
+
density === "compact" ? styles.deadlineCompact : null,
|
|
1108
|
+
orientation === "horizontal" ? styles.deadlineRow : null,
|
|
1109
|
+
{
|
|
1110
|
+
// A soft tint always carries its tone edge.
|
|
1111
|
+
borderColor: urgent ? theme.edge.danger : theme.edge.warn,
|
|
1112
|
+
backgroundColor: urgent ? theme.color.dangerSoft : theme.color.warnSoft
|
|
1113
|
+
},
|
|
1114
|
+
style
|
|
1115
|
+
],
|
|
1116
|
+
children: [
|
|
1117
|
+
/* @__PURE__ */ jsxs(
|
|
1118
|
+
View,
|
|
1119
|
+
{
|
|
1120
|
+
style: [
|
|
1121
|
+
styles.daysBox,
|
|
1122
|
+
align === "center" ? styles.daysCentre : align === "end" ? styles.daysEnd : null
|
|
1123
|
+
],
|
|
1124
|
+
children: [
|
|
1125
|
+
loading ? /* @__PURE__ */ jsx(Skeleton, { variant: "rect", width: theme.space[64], height: theme.fontSize[32], decorative: true }) : /* @__PURE__ */ jsx(
|
|
1126
|
+
Text,
|
|
1127
|
+
{
|
|
1128
|
+
style: [
|
|
1129
|
+
styles.daysLeft,
|
|
1130
|
+
size === "sm" ? styles.daysLeftSm : null,
|
|
1131
|
+
size === "lg" ? styles.daysLeftLg : null,
|
|
1132
|
+
align === "center" ? styles.textCentre : align === "end" ? styles.textEnd : null,
|
|
1133
|
+
{ color: ink }
|
|
1134
|
+
],
|
|
1135
|
+
children: unit ? `${dispute.daysLeft} ${unit}` : labels.days(dispute.daysLeft)
|
|
1136
|
+
}
|
|
1137
|
+
),
|
|
1138
|
+
/* @__PURE__ */ jsx(
|
|
1139
|
+
Text,
|
|
1140
|
+
{
|
|
1141
|
+
style: [
|
|
1142
|
+
styles.daysNote,
|
|
1143
|
+
align === "center" ? styles.textCentre : align === "end" ? styles.textEnd : null,
|
|
1144
|
+
{ color: ink }
|
|
1145
|
+
],
|
|
1146
|
+
children: labels.toRespond(dispute.due)
|
|
1147
|
+
}
|
|
1148
|
+
)
|
|
1149
|
+
]
|
|
1150
|
+
}
|
|
1151
|
+
),
|
|
1152
|
+
/* @__PURE__ */ jsxs(View, { style: styles.factGrid, children: [
|
|
1153
|
+
/* @__PURE__ */ jsxs(View, { style: styles.fact, children: [
|
|
1154
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.factTerm, { color: ink }], children: labels.disputed }),
|
|
1155
|
+
/* @__PURE__ */ jsx(
|
|
1156
|
+
Amount,
|
|
1157
|
+
{
|
|
1158
|
+
minor: dispute.amountMinor,
|
|
1159
|
+
currency: dispute.currency,
|
|
1160
|
+
size: "lg",
|
|
1161
|
+
weight: "bold",
|
|
1162
|
+
locale
|
|
1163
|
+
}
|
|
1164
|
+
)
|
|
1165
|
+
] }),
|
|
1166
|
+
/* @__PURE__ */ jsxs(View, { style: styles.fact, children: [
|
|
1167
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.factTerm, { color: ink }], children: labels.networkFee }),
|
|
1168
|
+
/* @__PURE__ */ jsx(Text, { style: styles.factValueNum, children: money(dispute.feeMinor, dispute.currency, { locale }) })
|
|
1169
|
+
] }),
|
|
1170
|
+
/* @__PURE__ */ jsxs(View, { style: styles.fact, children: [
|
|
1171
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.factTerm, { color: ink }], children: labels.reason }),
|
|
1172
|
+
/* @__PURE__ */ jsx(Text, { style: styles.factValue, children: labels.reasonNetwork(dispute.reason, dispute.network) })
|
|
1173
|
+
] }),
|
|
1174
|
+
/* @__PURE__ */ jsxs(View, { style: styles.fact, children: [
|
|
1175
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.factTerm, { color: ink }], children: labels.opened }),
|
|
1176
|
+
/* @__PURE__ */ jsx(Text, { style: styles.factValue, children: dispute.opened })
|
|
1177
|
+
] })
|
|
1178
|
+
] }),
|
|
1179
|
+
error ? /* @__PURE__ */ jsx(Text, { role: "alert", accessibilityRole: "alert", style: [styles.evidenceError, { color: ink }], children: error }) : null
|
|
1180
|
+
]
|
|
1181
|
+
}
|
|
1182
|
+
);
|
|
1183
|
+
}
|
|
1184
|
+
function DisputeEvidenceRow({
|
|
1185
|
+
item,
|
|
1186
|
+
attachLabel,
|
|
1187
|
+
onAttach,
|
|
1188
|
+
density = "comfortable",
|
|
1189
|
+
selected = false,
|
|
1190
|
+
disabled = false,
|
|
1191
|
+
onPress,
|
|
1192
|
+
loading = false,
|
|
1193
|
+
labels: labelsProp,
|
|
1194
|
+
style,
|
|
1195
|
+
error = false
|
|
1196
|
+
}) {
|
|
1197
|
+
const labels = useLabels("refund", DEFAULT_LABELS, labelsProp);
|
|
1198
|
+
const pay = usePayLabels(labelsProp);
|
|
1199
|
+
const theme = useLoamTheme("refund");
|
|
1200
|
+
const { styles } = useStyles(sheet3);
|
|
1201
|
+
const tone = evidenceTone(item.state);
|
|
1202
|
+
const glyphColor = error ? theme.color.danger : tone === "good" ? theme.color.good : tone === "warn" ? theme.color.warn : theme.color.text3;
|
|
1203
|
+
const lead = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1204
|
+
/* @__PURE__ */ jsx(Icon, { name: EVIDENCE_ICON[item.state], size: theme.icon.sm, color: glyphColor }),
|
|
1205
|
+
/* @__PURE__ */ jsx(View, { style: styles.evidenceBody, children: loading ? /* @__PURE__ */ jsx(SkeletonText, { lines: 2 }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1206
|
+
/* @__PURE__ */ jsx(Text, { style: styles.evidenceLabel, children: item.label }),
|
|
1207
|
+
/* @__PURE__ */ jsx(Text, { style: styles.evidenceNote, children: item.note }),
|
|
1208
|
+
typeof error === "string" && error ? /* @__PURE__ */ jsx(Text, { role: "alert", accessibilityRole: "alert", style: styles.evidenceError, children: error }) : null
|
|
1209
|
+
] }) })
|
|
1210
|
+
] });
|
|
1211
|
+
return /* @__PURE__ */ jsxs(
|
|
1212
|
+
View,
|
|
1213
|
+
{
|
|
1214
|
+
role: "listitem",
|
|
1215
|
+
accessibilityState: { disabled, busy: loading },
|
|
1216
|
+
...selected ? { "aria-current": "true" } : null,
|
|
1217
|
+
"aria-disabled": disabled || void 0,
|
|
1218
|
+
"aria-busy": loading || void 0,
|
|
1219
|
+
"aria-invalid": error ? true : void 0,
|
|
1220
|
+
style: [
|
|
1221
|
+
styles.evidenceRow,
|
|
1222
|
+
density === "compact" ? styles.evidenceRowCompact : null,
|
|
1223
|
+
selected ? styles.evidenceRowSelected : null,
|
|
1224
|
+
disabled ? styles.evidenceRowDisabled : null,
|
|
1225
|
+
error ? { borderTopColor: theme.color.danger } : null,
|
|
1226
|
+
style
|
|
1227
|
+
],
|
|
1228
|
+
children: [
|
|
1229
|
+
onPress && !loading ? /* @__PURE__ */ jsx(
|
|
1230
|
+
Pressable,
|
|
1231
|
+
{
|
|
1232
|
+
accessibilityRole: "button",
|
|
1233
|
+
accessibilityLabel: `${item.label}. ${item.note}`,
|
|
1234
|
+
accessibilityState: { selected, disabled },
|
|
1235
|
+
disabled,
|
|
1236
|
+
onPress: () => onPress(item),
|
|
1237
|
+
style: styles.evidenceLead,
|
|
1238
|
+
children: lead
|
|
1239
|
+
}
|
|
1240
|
+
) : /* @__PURE__ */ jsx(View, { style: styles.evidenceLead, children: lead }),
|
|
1241
|
+
/* @__PURE__ */ jsxs(View, { style: styles.evidenceTrail, children: [
|
|
1242
|
+
/* @__PURE__ */ jsx(Badge, { style: styles.rowBadge, variant: BADGE_VARIANT[tone], size: "sm", children: evidenceLabel(item.state, pay) }),
|
|
1243
|
+
item.state === "missing" && onAttach ? /* @__PURE__ */ jsx(
|
|
1244
|
+
Button,
|
|
1245
|
+
{
|
|
1246
|
+
size: "sm",
|
|
1247
|
+
variant: "outline",
|
|
1248
|
+
leadingIcon: "upload",
|
|
1249
|
+
disabled,
|
|
1250
|
+
onPress: () => onAttach(item),
|
|
1251
|
+
children: attachLabel ?? labels.attach
|
|
1252
|
+
}
|
|
1253
|
+
) : null
|
|
1254
|
+
] })
|
|
1255
|
+
]
|
|
1256
|
+
}
|
|
1257
|
+
);
|
|
1258
|
+
}
|
|
1259
|
+
function DisputePanel({
|
|
1260
|
+
dispute,
|
|
1261
|
+
title,
|
|
1262
|
+
description,
|
|
1263
|
+
submitLabel,
|
|
1264
|
+
acceptLabel,
|
|
1265
|
+
canSubmit = true,
|
|
1266
|
+
busy = false,
|
|
1267
|
+
showGuidance = true,
|
|
1268
|
+
onSubmitEvidence,
|
|
1269
|
+
onAccept,
|
|
1270
|
+
onAttach,
|
|
1271
|
+
variant,
|
|
1272
|
+
elevation,
|
|
1273
|
+
padding,
|
|
1274
|
+
tone,
|
|
1275
|
+
density = "comfortable",
|
|
1276
|
+
size,
|
|
1277
|
+
error,
|
|
1278
|
+
locale: localeProp,
|
|
1279
|
+
labels: labelsProp,
|
|
1280
|
+
platform,
|
|
1281
|
+
style,
|
|
1282
|
+
interactive = false,
|
|
1283
|
+
onPress
|
|
1284
|
+
}) {
|
|
1285
|
+
const labels = useLabels("refund", DEFAULT_LABELS, labelsProp);
|
|
1286
|
+
const providerLocale = useLoamLocale();
|
|
1287
|
+
const locale = localeProp ?? providerLocale;
|
|
1288
|
+
const theme = useLoamTheme("refund");
|
|
1289
|
+
const android = isAndroidIdiom(theme, platform);
|
|
1290
|
+
const { styles } = useStyles(sheet3);
|
|
1291
|
+
const worth = disputeWorthDefending(dispute.amountMinor);
|
|
1292
|
+
const threshold = money(DISPUTE_ACCEPT_THRESHOLD_MINOR, dispute.currency, { locale });
|
|
1293
|
+
return /* @__PURE__ */ jsxs(
|
|
1294
|
+
PanelRoot,
|
|
1295
|
+
{
|
|
1296
|
+
interactive,
|
|
1297
|
+
onPress,
|
|
1298
|
+
role: "region",
|
|
1299
|
+
accessibilityLabel: title ?? labels.disputeTitle,
|
|
1300
|
+
style: [
|
|
1301
|
+
styles.panel,
|
|
1302
|
+
density === "compact" ? styles.panelCompact : null,
|
|
1303
|
+
refundShellStyle(theme, { variant, elevation, padding, tone }),
|
|
1304
|
+
style
|
|
1305
|
+
],
|
|
1306
|
+
children: [
|
|
1307
|
+
/* @__PURE__ */ jsxs(View, { style: styles.header, children: [
|
|
1308
|
+
/* @__PURE__ */ jsx(
|
|
1309
|
+
Text,
|
|
1310
|
+
{
|
|
1311
|
+
accessibilityRole: "header",
|
|
1312
|
+
style: [styles.title, resolveTextRole(theme, "surfaceTitle", android)],
|
|
1313
|
+
children: title ?? labels.disputeTitle
|
|
1314
|
+
}
|
|
1315
|
+
),
|
|
1316
|
+
/* @__PURE__ */ jsx(DisputeDeadline, { dispute, locale, labels: labelsProp }),
|
|
1317
|
+
/* @__PURE__ */ jsx(Text, { style: styles.description, children: description ?? labels.disputeDescription })
|
|
1318
|
+
] }),
|
|
1319
|
+
/* @__PURE__ */ jsxs(View, { style: styles.evidenceBlock, children: [
|
|
1320
|
+
/* @__PURE__ */ jsx(Text, { style: styles.overline, children: labels.evidence }),
|
|
1321
|
+
/* @__PURE__ */ jsx(View, { role: "list", accessibilityRole: "list", children: dispute.evidence.map((item) => /* @__PURE__ */ jsx(
|
|
1322
|
+
DisputeEvidenceRow,
|
|
1323
|
+
{
|
|
1324
|
+
item,
|
|
1325
|
+
onAttach,
|
|
1326
|
+
density,
|
|
1327
|
+
labels: labelsProp
|
|
1328
|
+
},
|
|
1329
|
+
item.label
|
|
1330
|
+
)) })
|
|
1331
|
+
] }),
|
|
1332
|
+
showGuidance ? /* @__PURE__ */ jsxs(View, { style: styles.guidanceRow, children: [
|
|
1333
|
+
/* @__PURE__ */ jsx(Icon, { name: "info", size: theme.icon.sm, color: theme.color.text3 }),
|
|
1334
|
+
/* @__PURE__ */ jsx(Text, { style: styles.guidance, children: labels.guidance(worth, threshold, canSubmit) })
|
|
1335
|
+
] }) : null,
|
|
1336
|
+
error ? /* @__PURE__ */ jsx(Alert, { tone: "danger", title: error }) : null,
|
|
1337
|
+
/* @__PURE__ */ jsx(View, { style: [styles.actionRow, android ? styles.actionRowEnd : null], children: android ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1338
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", ...size ? { size } : null, onPress: onAccept, children: acceptLabel ?? labels.acceptDispute }),
|
|
1339
|
+
/* @__PURE__ */ jsx(Button, { loading: busy, ...size ? { size } : null, onPress: onSubmitEvidence, children: submitLabel ?? labels.submitEvidence })
|
|
1340
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1341
|
+
/* @__PURE__ */ jsx(View, { style: styles.actionShare, children: /* @__PURE__ */ jsx(
|
|
1342
|
+
Button,
|
|
1343
|
+
{
|
|
1344
|
+
fullWidth: true,
|
|
1345
|
+
loading: busy,
|
|
1346
|
+
...size ? { size } : null,
|
|
1347
|
+
onPress: onSubmitEvidence,
|
|
1348
|
+
children: submitLabel ?? labels.submitEvidence
|
|
1349
|
+
}
|
|
1350
|
+
) }),
|
|
1351
|
+
/* @__PURE__ */ jsx(View, { style: styles.actionShare, children: /* @__PURE__ */ jsx(Button, { fullWidth: true, variant: "outline", ...size ? { size } : null, onPress: onAccept, children: acceptLabel ?? labels.acceptDispute }) })
|
|
1352
|
+
] }) })
|
|
1353
|
+
]
|
|
1354
|
+
}
|
|
1355
|
+
);
|
|
1356
|
+
}
|
|
1357
|
+
var sheet3 = createStyleSheet((theme) => ({
|
|
1358
|
+
panel: panelBaseStyle(theme),
|
|
1359
|
+
panelCompact: { gap: theme.space.s3 },
|
|
1360
|
+
header: { gap: theme.space.s3 },
|
|
1361
|
+
title: {
|
|
1362
|
+
fontFamily: theme.font.display,
|
|
1363
|
+
fontWeight: theme.font.displayWeight,
|
|
1364
|
+
fontSize: theme.type.title3.fontSize,
|
|
1365
|
+
lineHeight: theme.type.title3.lineHeight,
|
|
1366
|
+
letterSpacing: theme.type.title3.letterSpacing,
|
|
1367
|
+
color: theme.color.text
|
|
1368
|
+
},
|
|
1369
|
+
description: {
|
|
1370
|
+
fontFamily: theme.font.sans,
|
|
1371
|
+
fontSize: theme.type.footnote.fontSize,
|
|
1372
|
+
lineHeight: theme.type.footnote.fontSize * theme.lineHeight.normal,
|
|
1373
|
+
color: theme.color.text2
|
|
1374
|
+
},
|
|
1375
|
+
deadline: {
|
|
1376
|
+
gap: theme.space.s4,
|
|
1377
|
+
padding: theme.space.s4,
|
|
1378
|
+
borderRadius: theme.radius.md,
|
|
1379
|
+
borderWidth: theme.borderWidth.base
|
|
1380
|
+
},
|
|
1381
|
+
deadlineCompact: { gap: theme.space.s3, padding: theme.space.s3 },
|
|
1382
|
+
deadlineRow: { flexDirection: "row", flexWrap: "wrap", alignItems: "center" },
|
|
1383
|
+
// Shrinkable, so a long figure ("6 working days") wraps inside the banner instead of running off its edge.
|
|
1384
|
+
daysBox: { flexShrink: 1, minWidth: 0 },
|
|
1385
|
+
daysCentre: { alignItems: "center" },
|
|
1386
|
+
textCentre: { textAlign: "center" },
|
|
1387
|
+
daysEnd: { alignItems: "flex-end" },
|
|
1388
|
+
textEnd: { textAlign: theme.rtl ? "left" : "right" },
|
|
1389
|
+
daysLeftSm: {
|
|
1390
|
+
fontSize: theme.fontSize[24],
|
|
1391
|
+
lineHeight: theme.fontSize[24] * theme.lineHeight.tight
|
|
1392
|
+
},
|
|
1393
|
+
daysLeftLg: {
|
|
1394
|
+
fontSize: theme.fontSize[40],
|
|
1395
|
+
lineHeight: theme.fontSize[40] * theme.lineHeight.tight
|
|
1396
|
+
},
|
|
1397
|
+
daysLeft: {
|
|
1398
|
+
fontFamily: theme.font.sans,
|
|
1399
|
+
fontWeight: theme.fontWeight.bold,
|
|
1400
|
+
fontVariant: ["tabular-nums"],
|
|
1401
|
+
fontSize: theme.fontSize[32],
|
|
1402
|
+
lineHeight: theme.fontSize[32] * theme.lineHeight.tight
|
|
1403
|
+
},
|
|
1404
|
+
daysNote: {
|
|
1405
|
+
fontFamily: theme.font.sans,
|
|
1406
|
+
fontSize: theme.type.footnote.fontSize,
|
|
1407
|
+
lineHeight: theme.type.footnote.lineHeight
|
|
1408
|
+
},
|
|
1409
|
+
factGrid: {
|
|
1410
|
+
flexShrink: 1,
|
|
1411
|
+
minWidth: 0,
|
|
1412
|
+
maxWidth: "100%",
|
|
1413
|
+
flexDirection: "row",
|
|
1414
|
+
flexWrap: "wrap",
|
|
1415
|
+
columnGap: theme.space.s5,
|
|
1416
|
+
rowGap: theme.space.s2
|
|
1417
|
+
},
|
|
1418
|
+
fact: { gap: theme.space[2], flexShrink: 1, maxWidth: "100%" },
|
|
1419
|
+
// No `color` here: the fact terms are inked by the caller with the *tint's*
|
|
1420
|
+
// own measured ink (`dangerOnSoft` / `warnOnSoft`), the same one the days-left
|
|
1421
|
+
// figure uses. They used to be `theme.color.text3`, and `--text-3` is measured
|
|
1422
|
+
// against the neutral surface ramp only — on this banner's tint it read 4.20:1
|
|
1423
|
+
// on `--danger-soft` and 3.78:1 on `--warn-soft` in dark mode, 28 axe
|
|
1424
|
+
// `color-contrast` nodes from one style (seven deadlines x four terms).
|
|
1425
|
+
factTerm: {
|
|
1426
|
+
...theme.type.overline,
|
|
1427
|
+
fontFamily: theme.font.sans
|
|
1428
|
+
},
|
|
1429
|
+
factValue: {
|
|
1430
|
+
fontFamily: theme.font.sans,
|
|
1431
|
+
fontSize: theme.type.footnote.fontSize,
|
|
1432
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
1433
|
+
color: theme.color.text
|
|
1434
|
+
},
|
|
1435
|
+
factValueNum: {
|
|
1436
|
+
fontFamily: theme.font.sans,
|
|
1437
|
+
fontWeight: theme.fontWeight.bold,
|
|
1438
|
+
fontVariant: ["tabular-nums"],
|
|
1439
|
+
fontSize: theme.type.footnote.fontSize,
|
|
1440
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
1441
|
+
color: theme.color.text
|
|
1442
|
+
},
|
|
1443
|
+
evidenceBlock: { gap: theme.space.s2 },
|
|
1444
|
+
overline: {
|
|
1445
|
+
...theme.type.overline,
|
|
1446
|
+
fontFamily: theme.font.sans,
|
|
1447
|
+
color: theme.color.text3
|
|
1448
|
+
},
|
|
1449
|
+
evidenceRowCompact: { paddingVertical: theme.space.s2 },
|
|
1450
|
+
evidenceRowSelected: { backgroundColor: theme.state.selected },
|
|
1451
|
+
evidenceRowDisabled: { opacity: theme.state.disabledOpacity },
|
|
1452
|
+
evidenceLead: {
|
|
1453
|
+
flexDirection: "row",
|
|
1454
|
+
flexGrow: 1,
|
|
1455
|
+
flexShrink: 1,
|
|
1456
|
+
flexBasis: theme.panel.xs,
|
|
1457
|
+
alignItems: "flex-start",
|
|
1458
|
+
gap: theme.space.s3
|
|
1459
|
+
},
|
|
1460
|
+
evidenceRow: {
|
|
1461
|
+
flexDirection: "row",
|
|
1462
|
+
flexWrap: "wrap",
|
|
1463
|
+
alignItems: "flex-start",
|
|
1464
|
+
gap: theme.space.s3,
|
|
1465
|
+
paddingVertical: theme.space.s3,
|
|
1466
|
+
borderTopWidth: theme.borderWidth.base,
|
|
1467
|
+
borderTopColor: theme.color.border
|
|
1468
|
+
},
|
|
1469
|
+
// A floor, so the row wraps the badge and Attach under the text rather than
|
|
1470
|
+
// squeezing the note to a 126px column beside them.
|
|
1471
|
+
evidenceError: {
|
|
1472
|
+
fontFamily: theme.font.sans,
|
|
1473
|
+
fontSize: theme.type.footnote.fontSize,
|
|
1474
|
+
color: theme.color.danger
|
|
1475
|
+
},
|
|
1476
|
+
evidenceBody: { flexGrow: 1, flexShrink: 1, flexBasis: 0, gap: theme.space[2] },
|
|
1477
|
+
evidenceLabel: {
|
|
1478
|
+
fontFamily: theme.font.sans,
|
|
1479
|
+
fontWeight: theme.fontWeight.semibold,
|
|
1480
|
+
fontSize: theme.type.footnote.fontSize,
|
|
1481
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
1482
|
+
color: theme.color.text
|
|
1483
|
+
},
|
|
1484
|
+
evidenceNote: {
|
|
1485
|
+
fontFamily: theme.font.sans,
|
|
1486
|
+
fontSize: theme.type.caption1.fontSize,
|
|
1487
|
+
lineHeight: theme.type.caption1.fontSize * theme.lineHeight.normal,
|
|
1488
|
+
color: theme.color.text3
|
|
1489
|
+
},
|
|
1490
|
+
evidenceTrail: { flexDirection: "row", alignItems: "center", gap: theme.space.s2 },
|
|
1491
|
+
guidanceRow: { flexDirection: "row", alignItems: "flex-start", gap: theme.space.s2 },
|
|
1492
|
+
guidance: {
|
|
1493
|
+
flexShrink: 1,
|
|
1494
|
+
fontFamily: theme.font.sans,
|
|
1495
|
+
fontSize: theme.type.caption1.fontSize,
|
|
1496
|
+
lineHeight: theme.type.caption1.fontSize * theme.lineHeight.normal,
|
|
1497
|
+
color: theme.color.text3
|
|
1498
|
+
},
|
|
1499
|
+
actionRow: {
|
|
1500
|
+
flexDirection: "row",
|
|
1501
|
+
flexWrap: "wrap",
|
|
1502
|
+
alignItems: "center",
|
|
1503
|
+
gap: theme.space.s2
|
|
1504
|
+
},
|
|
1505
|
+
actionShare: { flexGrow: 1, flexBasis: 0 },
|
|
1506
|
+
actionRowEnd: { justifyContent: "flex-end" },
|
|
1507
|
+
// Badge hugs with `flex-start`, which pins it to the top of this centred row.
|
|
1508
|
+
rowBadge: { alignSelf: "center" }
|
|
1509
|
+
}));
|
|
1510
|
+
|
|
1511
|
+
export { DisputeDeadline, DisputeEvidenceRow, DisputePanel, RefundAmountField, RefundArrivalNote, RefundConfirmation, RefundLedger, RefundPanel, RefundReasonList, RefundRemainingNote, RefundStatus };
|