@btndprojects/loam-ui-native 0.1.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 +7 -3
- package/dist/adaptive/index.js +16 -2
- package/dist/address-block/index.js +23 -0
- package/dist/alert/index.js +8 -2
- package/dist/analyzer/index.js +17 -6
- package/dist/announcement/index.js +18 -5
- package/dist/appearance-picker/index.js +15 -0
- package/dist/audio-player/index.js +29 -3
- package/dist/avatar/index.js +5 -2
- package/dist/avatar-group/index.js +9 -3
- package/dist/badge/index.js +10 -4
- package/dist/banner/index.js +6 -2
- package/dist/board/index.js +18 -6
- package/dist/button/index.js +9 -3
- package/dist/camera-permission/index.js +23 -12
- package/dist/capture-result/index.js +30 -17
- package/dist/card/index.js +10 -3
- package/dist/card-form/index.js +19 -9
- package/dist/carousel/index.js +6 -2
- package/dist/chart/index.js +18 -5
- package/dist/charts/index.js +21 -6
- package/dist/chat/index.js +41 -0
- package/dist/checkbox/index.js +9 -5
- package/dist/checklist/index.js +20 -8
- package/dist/checkout/index.js +30 -12
- package/dist/chip/index.js +11 -5
- package/dist/chunk-2BZD3NAP.js +1110 -0
- package/dist/chunk-2YKVID2V.js +35 -0
- package/dist/{chunk-JUAMLEHX.js → chunk-36DA3IPO.js} +137 -37
- package/dist/chunk-3A56MIAN.js +599 -0
- package/dist/chunk-3SCKCWF5.js +298 -0
- package/dist/chunk-3TZNDHKO.js +187 -0
- package/dist/chunk-43K3BLXV.js +9 -0
- package/dist/chunk-46ZJIQ2Z.js +208 -0
- package/dist/chunk-4CZMQDQL.js +192 -0
- package/dist/chunk-5DTKORLI.js +255 -0
- package/dist/{chunk-LOE5YNN3.js → chunk-5J4WFXFA.js} +68 -24
- package/dist/chunk-5KJ7TEQ6.js +305 -0
- package/dist/chunk-5NU33TXK.js +529 -0
- package/dist/chunk-5Z5ZYMOJ.js +1 -0
- package/dist/chunk-6KSUS7DF.js +690 -0
- package/dist/chunk-6RV6UW2J.js +349 -0
- package/dist/chunk-6RZM7RP2.js +520 -0
- package/dist/{chunk-4BXMXBJO.js → chunk-75BDCC7K.js} +24 -11
- package/dist/{chunk-PZXZJBMP.js → chunk-7CGJBQUA.js} +357 -32
- package/dist/{chunk-CJ5EOYZE.js → chunk-7IVF6JLJ.js} +24 -7
- package/dist/chunk-7IWCGXYA.js +143 -0
- package/dist/chunk-7LM4ASFH.js +172 -0
- package/dist/chunk-7MCEJFWV.js +341 -0
- package/dist/chunk-7NGMUVNU.js +245 -0
- package/dist/chunk-7PBSIXT7.js +355 -0
- package/dist/chunk-7QOYGENL.js +443 -0
- package/dist/{chunk-H6NIOQHK.js → chunk-A7SWYDE5.js} +66 -15
- package/dist/chunk-ADHPJALR.js +3051 -0
- package/dist/chunk-ALJYZLNQ.js +509 -0
- package/dist/chunk-APCWFOZW.js +28 -0
- package/dist/chunk-AQ5FIG74.js +419 -0
- package/dist/chunk-AWKQIE5I.js +139 -0
- package/dist/chunk-B2MMZZQB.js +426 -0
- package/dist/{chunk-ZVFE5QGU.js → chunk-B7JZ3N5G.js} +174 -97
- package/dist/chunk-BL37SW6G.js +1314 -0
- package/dist/chunk-BTRMA7GC.js +21 -0
- package/dist/chunk-C7IUWIUZ.js +643 -0
- package/dist/chunk-CA3DUVYD.js +10 -0
- package/dist/{chunk-S7F6XLTK.js → chunk-CBCJSO2B.js} +213 -54
- package/dist/chunk-CHPX4MFI.js +239 -0
- package/dist/chunk-CLGAMIOT.js +648 -0
- package/dist/chunk-CUE7VML6.js +1141 -0
- package/dist/chunk-CVU6S2E5.js +1587 -0
- package/dist/{chunk-AZRX6SAC.js → chunk-CXPQMA6Z.js} +112 -37
- package/dist/chunk-D2LN4I7I.js +581 -0
- package/dist/{chunk-UWFLYMAR.js → chunk-D34LNBO5.js} +635 -238
- package/dist/chunk-D4BCQICM.js +765 -0
- 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-BEDBFJND.js → chunk-ESGUHNB2.js} +119 -43
- package/dist/{chunk-Q72LJOVE.js → chunk-F2KNBPKY.js} +74 -18
- package/dist/{chunk-O7AE6DAF.js → chunk-G7H3NX3G.js} +57 -24
- package/dist/chunk-GM7YIPB7.js +1052 -0
- package/dist/chunk-GVQQG435.js +581 -0
- package/dist/chunk-HE43OMEL.js +1056 -0
- package/dist/chunk-HHOMFQ7R.js +2535 -0
- package/dist/chunk-HJFFOOJ4.js +1 -0
- package/dist/chunk-HNAKS4Z3.js +207 -0
- package/dist/chunk-HP6ST2OW.js +352 -0
- package/dist/chunk-HW3OWDTU.js +1 -0
- package/dist/{chunk-3ENTMPQY.js → chunk-HZDB44K4.js} +102 -52
- package/dist/chunk-I2KLQ2HA.js +19 -0
- package/dist/chunk-I6CUP2LW.js +1155 -0
- package/dist/chunk-ICV4Y2WY.js +27 -0
- package/dist/chunk-IHSIENOE.js +3950 -0
- package/dist/{chunk-CUMUNPXY.js → chunk-IMMALLRU.js} +68 -32
- package/dist/chunk-J64KGCGX.js +55 -0
- package/dist/{chunk-IVNRBPGC.js → chunk-JA6TK7H2.js} +255 -84
- package/dist/{chunk-OOPPQH27.js → chunk-JAVZ5JPV.js} +83 -29
- package/dist/chunk-JCMTP3E4.js +1251 -0
- package/dist/{chunk-U7TFM2JA.js → chunk-JCXFFK64.js} +75 -18
- package/dist/chunk-JWCVBFDU.js +236 -0
- 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-KHZDNQQD.js +171 -0
- package/dist/chunk-KL4GDV4V.js +131 -0
- package/dist/chunk-KNILMM4H.js +225 -0
- package/dist/chunk-KRBUZV45.js +25 -0
- package/dist/{chunk-ITTYJZWX.js → chunk-KXLDK6HB.js} +161 -45
- package/dist/chunk-KZ3X7TSL.js +196 -0
- package/dist/chunk-L2WMOA2V.js +474 -0
- package/dist/chunk-L4D5LHCH.js +109 -0
- package/dist/chunk-LAUJPLDB.js +853 -0
- package/dist/{chunk-SBMNWWBV.js → chunk-LGNTP5XA.js} +89 -17
- package/dist/chunk-LUZFCCSD.js +271 -0
- package/dist/{chunk-HPPW424V.js → chunk-LXJCP4PL.js} +129 -37
- package/dist/chunk-MCOZJWPU.js +731 -0
- package/dist/chunk-MG4SKWLL.js +2587 -0
- package/dist/chunk-MPEPTSER.js +414 -0
- package/dist/chunk-MWPJ4YGP.js +1 -0
- package/dist/{chunk-TKQYWZ5V.js → chunk-N7AX4OA4.js} +108 -41
- package/dist/chunk-NHSLM6SE.js +523 -0
- package/dist/chunk-NNCOFLNE.js +24 -0
- package/dist/{chunk-J7Q7VCVC.js → chunk-NNJLVA7M.js} +54 -15
- package/dist/chunk-NZG75DGA.js +282 -0
- 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-YF4NSSMT.js → chunk-ONKQUJWD.js} +220 -65
- package/dist/chunk-OVTK7A6T.js +615 -0
- package/dist/chunk-PCEFCOLN.js +120 -0
- package/dist/chunk-PFLNFIVB.js +186 -0
- package/dist/chunk-PHSZY37H.js +300 -0
- package/dist/chunk-PJLTKDVY.js +18 -0
- package/dist/{chunk-4YIP3CWS.js → chunk-PK7BN3MI.js} +89 -19
- package/dist/{chunk-KMI5ML5I.js → chunk-PWFRDRGS.js} +155 -29
- package/dist/chunk-PYPMD46W.js +707 -0
- package/dist/chunk-Q6CCHDI7.js +331 -0
- package/dist/chunk-QFA5WS2A.js +750 -0
- package/dist/chunk-QJMMM4RC.js +124 -0
- package/dist/chunk-QNZII37O.js +10 -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-YC6WORFL.js → chunk-RAESDNU5.js} +228 -102
- 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-LAECSR4H.js → chunk-RJA3RXO3.js} +75 -60
- package/dist/chunk-RJYRJ3LD.js +1 -0
- package/dist/chunk-RMA3NOY4.js +599 -0
- package/dist/{chunk-DM5QUKKO.js → chunk-RSWKKAHK.js} +160 -66
- package/dist/chunk-RVOIIX3V.js +204 -0
- package/dist/chunk-SA2RRBGT.js +1077 -0
- package/dist/chunk-SG3J4R45.js +1428 -0
- package/dist/chunk-SPUK7JD4.js +238 -0
- package/dist/chunk-SWXV2K5N.js +434 -0
- package/dist/chunk-SYJEPXP6.js +1303 -0
- package/dist/{chunk-N32RGOA5.js → chunk-SZLI34TA.js} +93 -28
- package/dist/{chunk-4GBOGOTV.js → chunk-T77WJA74.js} +143 -18
- 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-CYRBHQQZ.js → chunk-TUL5RUIA.js} +201 -59
- package/dist/{chunk-4ZAHCY44.js → chunk-TYOSA7JG.js} +74 -38
- package/dist/chunk-TYQTMMEV.js +1 -0
- package/dist/chunk-TZO6YDS7.js +346 -0
- package/dist/chunk-U3ETF22F.js +328 -0
- package/dist/chunk-U6BYHD2N.js +213 -0
- package/dist/{chunk-WSW6ZFAQ.js → chunk-UF6EJXPQ.js} +20 -5
- package/dist/chunk-UNNQIPGK.js +792 -0
- package/dist/chunk-UQEN55EY.js +1 -0
- package/dist/chunk-UQVO6AJV.js +171 -0
- package/dist/chunk-VFDQAAIW.js +351 -0
- package/dist/chunk-VIUE3VQT.js +1 -0
- package/dist/chunk-VJLSSSGC.js +438 -0
- package/dist/chunk-VLMT6KYT.js +350 -0
- package/dist/chunk-VMHGBUGS.js +35 -0
- package/dist/{chunk-7O2FMUPT.js → chunk-VQKPBYW6.js} +400 -139
- package/dist/{chunk-EJBDRVIH.js → chunk-VSSTWLC5.js} +61 -16
- package/dist/chunk-VZYYZRPN.js +1992 -0
- package/dist/chunk-W23G6JLF.js +37 -0
- package/dist/chunk-WAIJCD2V.js +480 -0
- package/dist/chunk-WFMQ3WKM.js +378 -0
- package/dist/chunk-WJ2KDRMY.js +66 -0
- package/dist/chunk-WKFZJO54.js +437 -0
- package/dist/{chunk-SYNOJOQO.js → chunk-WVVD3XOV.js} +189 -93
- 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-35OFI3JG.js → chunk-Y3XKKO5K.js} +258 -123
- package/dist/chunk-Y4QNMBLO.js +533 -0
- package/dist/chunk-Y5H4CTKO.js +1 -0
- package/dist/chunk-YBQIN75A.js +403 -0
- package/dist/chunk-YJ5PXOX3.js +158 -0
- package/dist/{chunk-AWJOCGFZ.js → chunk-YLRSRUPS.js} +81 -55
- package/dist/chunk-YM6MPJ4A.js +1 -0
- package/dist/chunk-YV7KZENV.js +200 -0
- package/dist/chunk-Z7I4ZSO6.js +316 -0
- package/dist/chunk-ZIRMWD2B.js +555 -0
- package/dist/chunk-ZPMG3FWU.js +75 -0
- package/dist/{chunk-QWCMU5B2.js → chunk-ZTXMK2G7.js} +289 -115
- package/dist/chunk-ZVJCWXAL.js +541 -0
- package/dist/{chunk-P23EQNRQ.js → chunk-ZYQ23DPT.js} +215 -49
- package/dist/coachmark/index.js +10 -3
- package/dist/code-block/index.js +6 -3
- package/dist/color-field/index.js +15 -5
- package/dist/color-picker/index.js +23 -0
- package/dist/commerce/index.js +31 -17
- package/dist/confirm/index.js +31 -0
- package/dist/connection-card/index.js +34 -0
- package/dist/connectivity/index.js +6 -2
- package/dist/context-menu/index.js +13 -3
- package/dist/copy-button/index.js +5 -2
- package/dist/data-grid/index.js +35 -17
- package/dist/date-range-picker/index.js +22 -9
- package/dist/description-list/index.js +6 -1
- package/dist/device-frame/index.js +30 -0
- package/dist/dialog/index.js +10 -2
- package/dist/divider/index.js +2 -0
- package/dist/empty-state/index.js +15 -2
- package/dist/error-summary/index.js +9 -2
- package/dist/fab/index.js +7 -2
- package/dist/file-manager/index.js +44 -0
- package/dist/file-upload/index.js +16 -7
- package/dist/filter-bar/index.js +14 -7
- package/dist/flow-run/index.js +23 -13
- package/dist/form/index.js +32 -3
- package/dist/gallery/index.js +8 -2
- package/dist/hold-to-confirm/index.js +6 -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 +30789 -12332
- package/dist/index.js +424 -135
- package/dist/infinite-list/index.js +6 -2
- package/dist/inline-edit/index.js +8 -5
- package/dist/input/index.js +7 -4
- package/dist/interactions/index.js +5 -1
- package/dist/invoice/index.js +22 -9
- package/dist/job-row/index.js +22 -0
- package/dist/json-inspector/index.js +20 -0
- package/dist/kbd/index.js +5 -1
- package/dist/keyboard/index.js +9 -2
- package/dist/level-meter/index.js +9 -0
- package/dist/list-row/index.js +14 -4
- package/dist/log-viewer/index.js +11 -2
- package/dist/map-view/index.js +16 -3
- package/dist/markdown/index.js +12 -6
- package/dist/metric/index.js +10 -4
- package/dist/metric-strip/index.js +12 -0
- package/dist/money/index.js +16 -3
- package/dist/nav-drawer/index.js +8 -2
- package/dist/nav-header/index.js +15 -0
- package/dist/navigation/index.js +32 -2
- package/dist/notification-center/index.js +28 -12
- package/dist/number-roll/index.js +7 -2
- package/dist/onboarding-pager/index.js +22 -0
- package/dist/one-handed/index.js +5 -3
- package/dist/os-surfaces/index.js +9 -3
- package/dist/otp/index.js +9 -5
- package/dist/page-header/index.js +3 -1
- package/dist/pagination/index.js +8 -0
- package/dist/payment-method/index.js +21 -11
- package/dist/payment-status/index.js +26 -15
- package/dist/permission/index.js +21 -2
- package/dist/picker/index.js +22 -6
- package/dist/progress/index.js +11 -3
- package/dist/provenance/index.js +16 -0
- package/dist/pull-to-refresh/index.js +4 -2
- package/dist/qr-code/index.js +16 -0
- package/dist/query-builder/index.js +30 -0
- package/dist/radio-group/index.js +9 -5
- package/dist/rating/index.js +10 -2
- package/dist/receivables/index.js +35 -17
- package/dist/recording-indicator/index.js +21 -0
- package/dist/refund/index.js +28 -15
- package/dist/repeatable-rows/index.js +19 -0
- package/dist/save-status/index.js +7 -3
- package/dist/screen/index.js +3 -0
- package/dist/scroll-area/index.js +3 -1
- package/dist/search-field/index.js +13 -0
- package/dist/secret-field/index.js +19 -0
- package/dist/section-header/index.js +4 -0
- package/dist/segmented-control/index.js +4 -3
- package/dist/sheet/index.js +11 -3
- package/dist/shortcuts-sheet/index.js +2 -0
- package/dist/sign-in-screen/index.js +25 -0
- package/dist/skeleton/index.js +5 -1
- package/dist/slider/index.js +5 -2
- package/dist/sortable/index.js +8 -0
- package/dist/spinner/index.js +4 -1
- package/dist/split-button/index.js +21 -6
- package/dist/spotlight/index.js +9 -1
- package/dist/stack/index.js +2 -0
- package/dist/stage-timeline/index.js +8 -3
- package/dist/status-dot/index.js +8 -2
- package/dist/stepper/index.js +11 -4
- package/dist/streaming-text/index.js +4 -2
- package/dist/survey/index.js +29 -16
- package/dist/switch/index.js +9 -3
- package/dist/system-state/index.js +15 -4
- package/dist/tab-bar/index.js +13 -2
- package/dist/tabs/index.js +12 -2
- package/dist/tags-input/index.js +13 -0
- package/dist/text/index.js +4 -0
- package/dist/textarea/index.js +8 -5
- package/dist/thinking/index.js +6 -1
- package/dist/tile-rail/index.js +10 -0
- package/dist/time-field/index.js +20 -0
- package/dist/time-range-control/index.js +36 -0
- package/dist/timeline/index.js +4 -2
- package/dist/toast/index.js +6 -2
- package/dist/toolbar/index.js +5 -2
- package/dist/tour/index.js +15 -10
- package/dist/transcript/index.js +28 -0
- package/dist/truncation-notice/index.js +5 -2
- package/dist/update-notice/index.js +19 -9
- package/dist/video-player/index.js +29 -2
- package/dist/viewfinder/index.js +15 -5
- package/dist/widget/index.js +14 -4
- package/dist/wizard/index.js +10 -4
- package/package.json +13 -12
- package/dist/chunk-223Q2T2Q.js +0 -229
- package/dist/chunk-2A5NIQAK.js +0 -254
- package/dist/chunk-2GK6PHGE.js +0 -363
- package/dist/chunk-2ZZ7TDJ4.js +0 -324
- package/dist/chunk-3ARE4TES.js +0 -195
- package/dist/chunk-3NMD74ZU.js +0 -4
- package/dist/chunk-3WPW4KUN.js +0 -182
- package/dist/chunk-423B7SPN.js +0 -993
- package/dist/chunk-47FWHGUN.js +0 -394
- package/dist/chunk-4DS5ZWVC.js +0 -83
- package/dist/chunk-4SZYY6AN.js +0 -99
- package/dist/chunk-4YQOR7JM.js +0 -204
- package/dist/chunk-52X2VYTD.js +0 -228
- package/dist/chunk-5YNTNN5A.js +0 -177
- package/dist/chunk-6HT2LP62.js +0 -504
- package/dist/chunk-6N33LFQA.js +0 -35
- package/dist/chunk-6X6PQ443.js +0 -432
- package/dist/chunk-7CFF4HXS.js +0 -126
- package/dist/chunk-AI4DWZCD.js +0 -162
- package/dist/chunk-BTTFCMKG.js +0 -166
- package/dist/chunk-BV3B2HYZ.js +0 -1635
- package/dist/chunk-C2NTXVWM.js +0 -98
- package/dist/chunk-CDRZHT42.js +0 -424
- package/dist/chunk-DHWADYZX.js +0 -144
- package/dist/chunk-F5XNPWS7.js +0 -1024
- package/dist/chunk-FMYDDECK.js +0 -1521
- package/dist/chunk-GDKZTW34.js +0 -395
- package/dist/chunk-GL7B2DOW.js +0 -134
- package/dist/chunk-GNNJ4GCC.js +0 -471
- package/dist/chunk-HET4LLMX.js +0 -129
- package/dist/chunk-HZ6CNMAF.js +0 -870
- package/dist/chunk-IIQTAY3J.js +0 -715
- package/dist/chunk-JNH2TYIN.js +0 -96
- package/dist/chunk-JNY4ZHAR.js +0 -634
- package/dist/chunk-JXJB2X6M.js +0 -131
- package/dist/chunk-LRJNDEIA.js +0 -302
- package/dist/chunk-LSS54GLJ.js +0 -116
- package/dist/chunk-LZLHELAG.js +0 -137
- package/dist/chunk-MOUJOP55.js +0 -425
- package/dist/chunk-NKB7BZYK.js +0 -167
- package/dist/chunk-NQYBUO3K.js +0 -1795
- package/dist/chunk-O4AEHWII.js +0 -464
- package/dist/chunk-OETCUXQP.js +0 -134
- package/dist/chunk-OPXFZ4Y5.js +0 -204
- package/dist/chunk-PJXUJYS6.js +0 -248
- package/dist/chunk-PUPM2YGF.js +0 -376
- package/dist/chunk-QCDXZBC5.js +0 -247
- package/dist/chunk-QDYDBCFP.js +0 -197
- package/dist/chunk-QJJ6MADV.js +0 -274
- package/dist/chunk-QKXCPTFS.js +0 -349
- package/dist/chunk-RIBDXGUG.js +0 -108
- package/dist/chunk-RJQOOHT2.js +0 -214
- package/dist/chunk-RNGLIHFA.js +0 -191
- package/dist/chunk-RQ3HASCC.js +0 -6
- package/dist/chunk-RSOJT5YW.js +0 -124
- package/dist/chunk-RUZHTGKB.js +0 -237
- package/dist/chunk-RW6ZL2FQ.js +0 -284
- package/dist/chunk-TKVFVF5D.js +0 -95
- package/dist/chunk-TOXAGRDQ.js +0 -144
- package/dist/chunk-TUTI5HOZ.js +0 -112
- package/dist/chunk-UC2WGUP3.js +0 -627
- package/dist/chunk-UYG5L34B.js +0 -87
- package/dist/chunk-VBOXAEPI.js +0 -336
- package/dist/chunk-VCDBXW5H.js +0 -188
- package/dist/chunk-VEAYTRPX.js +0 -414
- package/dist/chunk-VQHPQEUH.js +0 -273
- package/dist/chunk-VXDZFJGP.js +0 -874
- package/dist/chunk-XNUVB5OL.js +0 -375
- package/dist/chunk-XOSCY2CW.js +0 -242
- package/dist/chunk-XXXEFXY5.js +0 -99
- package/dist/chunk-YDGVJETP.js +0 -60
- package/dist/chunk-YG3ZJHGU.js +0 -223
- package/dist/chunk-YTFKPRUK.js +0 -845
- package/dist/chunk-Z7H7VSFZ.js +0 -323
- package/dist/header/index.js +0 -5
- package/dist/search-bar/index.js +0 -5
- /package/dist/{chunk-3ECPOSKO.js → chunk-3BKLBYPK.js} +0 -0
- /package/dist/{chunk-JRLTGLN4.js → chunk-3UG6JUCV.js} +0 -0
- /package/dist/{chunk-RTIKSY6A.js → chunk-4QCR3K2J.js} +0 -0
- /package/dist/{chunk-VFCUIDRT.js → chunk-5WWRTEPS.js} +0 -0
|
@@ -0,0 +1,1567 @@
|
|
|
1
|
+
import { LAUNCH_MARK, OS_MATERIAL, OS_MATERIAL_INK_OPACITY, LIVE_ACTIVITY_CARD, LIVE_ACTIVITY_MAX_H, DYNAMIC_ISLAND_FILL, DYNAMIC_ISLAND, IOS_EDIT_MENU_RADIUS, SHEET_GRABBER_W, APP_ICON_PREVIEW_PX, ICON_MARK_RATIO, APP_ICON_ASSET_PX, LOCK_SCREEN_WALLPAPER, WIDGET_SIZE, WIDGET_CORNER, WIDGET_INNER_CORNER_ANDROID, ANDROID_ICON_MASK_RATIO, IOS_ICON_CORNER_RATIO, OS_SIZE_RATIO } from './chunk-XWGXVQF6.js';
|
|
2
|
+
import { Avatar } from './chunk-JWCVBFDU.js';
|
|
3
|
+
import { softToneSkin } from './chunk-PJLTKDVY.js';
|
|
4
|
+
import { isAndroidIdiom } from './chunk-TH4PW2WU.js';
|
|
5
|
+
import { useLabels } from './chunk-APCWFOZW.js';
|
|
6
|
+
import { Icon } from './chunk-PCEFCOLN.js';
|
|
7
|
+
import { useResolvedMotion, motionTiming } from './chunk-J64KGCGX.js';
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import { StyleSheet, View, Text, ActivityIndicator, Pressable, Animated, Easing } from 'react-native';
|
|
10
|
+
import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
|
|
11
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
// src/os-surfaces/labels.ts
|
|
14
|
+
var DEFAULT_LABELS = {
|
|
15
|
+
appIconPreview: (px, sizeClass, shape) => `App icon preview, ${px} px ${sizeClass}, ${shape} mask`,
|
|
16
|
+
launchScreenPreview: "Launch screen preview",
|
|
17
|
+
cancel: "Cancel",
|
|
18
|
+
moreGrouped: (count) => `+${count} more`,
|
|
19
|
+
lockScreenPreview: "Lock screen preview",
|
|
20
|
+
shareSheetPreview: "Share sheet preview",
|
|
21
|
+
shareWith: (name) => `Share with ${name}`,
|
|
22
|
+
textSelectionMenu: "Text selection menu",
|
|
23
|
+
dismiss: "Dismiss",
|
|
24
|
+
loading: "Loading"
|
|
25
|
+
};
|
|
26
|
+
function OsEntrance({
|
|
27
|
+
motion,
|
|
28
|
+
component,
|
|
29
|
+
style,
|
|
30
|
+
children
|
|
31
|
+
}) {
|
|
32
|
+
const theme = useLoamTheme("os-surfaces");
|
|
33
|
+
const level = useResolvedMotion(motion ?? "none", component);
|
|
34
|
+
const animated = motion !== void 0 && level !== "none";
|
|
35
|
+
const progress = React.useRef(new Animated.Value(animated ? 0 : 1)).current;
|
|
36
|
+
const { duration, easing } = theme.motion.expand;
|
|
37
|
+
React.useEffect(() => {
|
|
38
|
+
if (!animated) {
|
|
39
|
+
progress.setValue(1);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
progress.setValue(0);
|
|
43
|
+
Animated.timing(progress, {
|
|
44
|
+
...level === "reduced" ? motionTiming(level) : { duration, easing: Easing.bezier(...easing) },
|
|
45
|
+
toValue: 1,
|
|
46
|
+
useNativeDriver: true
|
|
47
|
+
}).start();
|
|
48
|
+
}, [animated, level, progress, duration, easing]);
|
|
49
|
+
if (motion === void 0) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
Animated.View,
|
|
52
|
+
{
|
|
53
|
+
style: [
|
|
54
|
+
style,
|
|
55
|
+
{
|
|
56
|
+
opacity: progress,
|
|
57
|
+
transform: level === "full" ? [
|
|
58
|
+
{
|
|
59
|
+
translateY: progress.interpolate({
|
|
60
|
+
inputRange: [0, 1],
|
|
61
|
+
outputRange: [theme.space.s2, 0]
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
] : []
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
children
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
function AppIconPreview({
|
|
72
|
+
sizeClass = "home",
|
|
73
|
+
size,
|
|
74
|
+
shape,
|
|
75
|
+
showCaption = false,
|
|
76
|
+
accessibilityLabel,
|
|
77
|
+
loading = false,
|
|
78
|
+
motion,
|
|
79
|
+
labels: labelsProp
|
|
80
|
+
}) {
|
|
81
|
+
const { styles } = useStyles(sheet);
|
|
82
|
+
const labels = useLabels("osSurfaces", DEFAULT_LABELS, labelsProp);
|
|
83
|
+
const theme = useLoamTheme("os-surfaces");
|
|
84
|
+
const px = size ?? APP_ICON_PREVIEW_PX[sizeClass];
|
|
85
|
+
const resolved = shape ?? (isAndroidIdiom(theme) ? "circle" : "squircle");
|
|
86
|
+
const radius = resolved === "circle" ? px * ANDROID_ICON_MASK_RATIO : Math.round(px * IOS_ICON_CORNER_RATIO);
|
|
87
|
+
const mark = Math.round(px * ICON_MARK_RATIO.size);
|
|
88
|
+
const caption = `${APP_ICON_ASSET_PX[sizeClass]} ${sizeClass}`;
|
|
89
|
+
return /* @__PURE__ */ jsx(OsEntrance, { motion, component: "app-icon-preview", children: /* @__PURE__ */ jsxs(View, { style: styles.cell, children: [
|
|
90
|
+
/* @__PURE__ */ jsx(
|
|
91
|
+
View,
|
|
92
|
+
{
|
|
93
|
+
accessibilityRole: "image",
|
|
94
|
+
"aria-busy": loading || void 0,
|
|
95
|
+
accessibilityLabel: accessibilityLabel ?? labels.appIconPreview(APP_ICON_ASSET_PX[sizeClass], sizeClass, resolved),
|
|
96
|
+
style: [
|
|
97
|
+
styles.tile,
|
|
98
|
+
{
|
|
99
|
+
width: px,
|
|
100
|
+
height: px,
|
|
101
|
+
borderRadius: radius,
|
|
102
|
+
// The reference paints a 160° accent gradient; RN has no gradient
|
|
103
|
+
// primitive without a dependency, so the icon is a flat accent.
|
|
104
|
+
backgroundColor: loading ? theme.color.surface3 : theme.color.accent
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
children: loading ? null : /* @__PURE__ */ jsx(
|
|
108
|
+
View,
|
|
109
|
+
{
|
|
110
|
+
style: [
|
|
111
|
+
styles.mark,
|
|
112
|
+
{
|
|
113
|
+
width: mark,
|
|
114
|
+
height: mark,
|
|
115
|
+
borderRadius: Math.round(px * ICON_MARK_RATIO.radius)
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
showCaption ? /* @__PURE__ */ jsx(Text, { style: styles.caption, children: caption }) : null
|
|
123
|
+
] }) });
|
|
124
|
+
}
|
|
125
|
+
var sheet = createStyleSheet((theme) => ({
|
|
126
|
+
cell: { alignItems: "center", gap: theme.space.s1 },
|
|
127
|
+
tile: {
|
|
128
|
+
alignItems: "center",
|
|
129
|
+
justifyContent: "center",
|
|
130
|
+
overflow: "hidden",
|
|
131
|
+
...theme.shadow.md
|
|
132
|
+
},
|
|
133
|
+
// `accentInk` is the measured foreground for the accent fill — the mark must
|
|
134
|
+
// stay legible on it in both modes and under every tenant.
|
|
135
|
+
mark: { backgroundColor: theme.color.accentInk, opacity: theme.opacity[92] },
|
|
136
|
+
caption: {
|
|
137
|
+
fontFamily: theme.font.mono,
|
|
138
|
+
fontSize: theme.type.caption2.fontSize,
|
|
139
|
+
lineHeight: theme.type.caption2.lineHeight,
|
|
140
|
+
color: theme.color.text3
|
|
141
|
+
}
|
|
142
|
+
}));
|
|
143
|
+
|
|
144
|
+
// src/os-surfaces/os-size.ts
|
|
145
|
+
function osScale(px, size) {
|
|
146
|
+
return size === void 0 ? px : Math.round(px * OS_SIZE_RATIO[size]);
|
|
147
|
+
}
|
|
148
|
+
function osType(theme, size, role) {
|
|
149
|
+
if (size === void 0 || size === "md") return null;
|
|
150
|
+
const t = theme.type;
|
|
151
|
+
const step = size === "sm" ? { title: t.caption1, body: t.caption1, meta: t.caption2 } : { title: t.subheadline, body: t.subheadline, meta: t.caption1 };
|
|
152
|
+
return { fontSize: step[role].fontSize, lineHeight: step[role].lineHeight };
|
|
153
|
+
}
|
|
154
|
+
function LaunchScreenPreview({
|
|
155
|
+
wordmark,
|
|
156
|
+
reviewNote,
|
|
157
|
+
loading = false,
|
|
158
|
+
accessibilityLabel,
|
|
159
|
+
motion,
|
|
160
|
+
size,
|
|
161
|
+
labels: labelsProp
|
|
162
|
+
}) {
|
|
163
|
+
const { styles } = useStyles(sheet2);
|
|
164
|
+
const theme = useLoamTheme("os-surfaces");
|
|
165
|
+
const labels = useLabels("osSurfaces", DEFAULT_LABELS, labelsProp);
|
|
166
|
+
return /* @__PURE__ */ jsxs(
|
|
167
|
+
View,
|
|
168
|
+
{
|
|
169
|
+
accessibilityRole: "image",
|
|
170
|
+
accessibilityLabel: accessibilityLabel ?? labels.launchScreenPreview,
|
|
171
|
+
"aria-busy": loading || void 0,
|
|
172
|
+
style: styles.screen,
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ jsx(OsEntrance, { motion, component: "launch-screen-preview", children: /* @__PURE__ */ jsxs(View, { style: styles.stack, children: [
|
|
175
|
+
/* @__PURE__ */ jsx(
|
|
176
|
+
View,
|
|
177
|
+
{
|
|
178
|
+
style: [
|
|
179
|
+
styles.mark,
|
|
180
|
+
size === void 0 ? null : {
|
|
181
|
+
width: osScale(LAUNCH_MARK.size, size),
|
|
182
|
+
height: osScale(LAUNCH_MARK.size, size),
|
|
183
|
+
borderRadius: osScale(LAUNCH_MARK.radius, size)
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
wordmark ? /* @__PURE__ */ jsx(Text, { style: styles.wordmark, children: wordmark }) : null,
|
|
189
|
+
loading ? /* @__PURE__ */ jsx(
|
|
190
|
+
ActivityIndicator,
|
|
191
|
+
{
|
|
192
|
+
size: "small",
|
|
193
|
+
color: theme.color.accentInk,
|
|
194
|
+
accessibilityLabel: labels.loading
|
|
195
|
+
}
|
|
196
|
+
) : null
|
|
197
|
+
] }) }),
|
|
198
|
+
reviewNote ? /* @__PURE__ */ jsx(Text, { style: styles.note, children: reviewNote }) : null
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
var sheet2 = createStyleSheet((theme) => ({
|
|
204
|
+
// The reference paints a flat `var(--accent)` here — the one screen in the
|
|
205
|
+
// system that is a single brand colour edge to edge.
|
|
206
|
+
screen: {
|
|
207
|
+
flex: 1,
|
|
208
|
+
backgroundColor: theme.color.accent,
|
|
209
|
+
alignItems: "center",
|
|
210
|
+
justifyContent: "center",
|
|
211
|
+
padding: theme.layout.screenPad
|
|
212
|
+
},
|
|
213
|
+
stack: { alignItems: "center", gap: theme.space.s4 },
|
|
214
|
+
// OS-mandated-ish geometry: 64px at an 18px radius, from the reference. It has
|
|
215
|
+
// to match the app icon's mark, not a Loam radius step.
|
|
216
|
+
mark: {
|
|
217
|
+
width: LAUNCH_MARK.size,
|
|
218
|
+
height: LAUNCH_MARK.size,
|
|
219
|
+
borderRadius: LAUNCH_MARK.radius,
|
|
220
|
+
backgroundColor: theme.color.accentInk,
|
|
221
|
+
opacity: theme.opacity[96]
|
|
222
|
+
},
|
|
223
|
+
wordmark: {
|
|
224
|
+
fontFamily: theme.font.display,
|
|
225
|
+
fontWeight: theme.font.displayWeight,
|
|
226
|
+
fontSize: theme.type.title3.fontSize,
|
|
227
|
+
lineHeight: theme.type.title3.lineHeight,
|
|
228
|
+
letterSpacing: theme.type.title3.letterSpacing,
|
|
229
|
+
color: theme.color.accentInk
|
|
230
|
+
},
|
|
231
|
+
note: {
|
|
232
|
+
position: "absolute",
|
|
233
|
+
bottom: theme.space.s6,
|
|
234
|
+
fontFamily: theme.font.sans,
|
|
235
|
+
fontSize: theme.type.caption1.fontSize,
|
|
236
|
+
lineHeight: theme.type.caption1.lineHeight,
|
|
237
|
+
// Full `accentInk` (no alpha): at 0.7 it composited to ~#ecccc4 on the accent
|
|
238
|
+
// fill = 3.02:1 (WCAG fail); the solid ink clears AA at 4.53:1.
|
|
239
|
+
color: theme.color.accentInk,
|
|
240
|
+
textAlign: "center"
|
|
241
|
+
}
|
|
242
|
+
}));
|
|
243
|
+
var NOTIFICATION_TILE = { size: 26, radius: 8 };
|
|
244
|
+
function notificationTile(size) {
|
|
245
|
+
if (size === void 0) return null;
|
|
246
|
+
return {
|
|
247
|
+
width: osScale(NOTIFICATION_TILE.size, size),
|
|
248
|
+
height: osScale(NOTIFICATION_TILE.size, size),
|
|
249
|
+
borderRadius: osScale(NOTIFICATION_TILE.radius, size)
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
var GROUP_STACK_OFFSET = 6;
|
|
253
|
+
function notificationLabel({ appName, title, body, time, groupCount }, labels) {
|
|
254
|
+
return [
|
|
255
|
+
appName,
|
|
256
|
+
title,
|
|
257
|
+
body,
|
|
258
|
+
time,
|
|
259
|
+
groupCount && groupCount > 0 ? labels.moreGrouped(groupCount) : void 0
|
|
260
|
+
].filter(Boolean).join(", ");
|
|
261
|
+
}
|
|
262
|
+
function NotificationBanner(props) {
|
|
263
|
+
const { styles } = useStyles(sheet3);
|
|
264
|
+
const theme = useLoamTheme("os-surfaces");
|
|
265
|
+
const labels = useLabels("osSurfaces", DEFAULT_LABELS, props.labels);
|
|
266
|
+
const {
|
|
267
|
+
appName,
|
|
268
|
+
icon,
|
|
269
|
+
title,
|
|
270
|
+
body,
|
|
271
|
+
time,
|
|
272
|
+
actionLabel,
|
|
273
|
+
onAction,
|
|
274
|
+
onPress,
|
|
275
|
+
groupCount,
|
|
276
|
+
style,
|
|
277
|
+
tone,
|
|
278
|
+
variant = "soft",
|
|
279
|
+
dismissible,
|
|
280
|
+
onDismiss,
|
|
281
|
+
size,
|
|
282
|
+
motion,
|
|
283
|
+
layout = "default"
|
|
284
|
+
} = props;
|
|
285
|
+
const skin = tone ? softToneSkin(theme, tone) : null;
|
|
286
|
+
const solid = variant === "solid";
|
|
287
|
+
const ink = solid ? { color: theme.color.accentInk } : null;
|
|
288
|
+
const headed = layout === "header";
|
|
289
|
+
const tileSize = notificationTile(size);
|
|
290
|
+
const android = isAndroidIdiom(theme);
|
|
291
|
+
const content = headed ? /* @__PURE__ */ jsxs(View, { style: styles.main, children: [
|
|
292
|
+
/* @__PURE__ */ jsxs(View, { style: styles.titleRow, children: [
|
|
293
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.appName, styles.headerName, osType(theme, size, "meta"), ink], children: appName }),
|
|
294
|
+
time ? /* @__PURE__ */ jsx(Text, { style: [styles.time, osType(theme, size, "meta"), ink], children: time }) : null
|
|
295
|
+
] }),
|
|
296
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.titleFlat, osType(theme, size, "title"), ink], numberOfLines: 1, children: title }),
|
|
297
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.body, osType(theme, size, "body"), ink], numberOfLines: 2, children: body }),
|
|
298
|
+
groupCount && groupCount > 0 ? /* @__PURE__ */ jsx(Text, { style: [styles.group, osType(theme, size, "meta"), ink], children: labels.moreGrouped(groupCount) }) : null
|
|
299
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
300
|
+
/* @__PURE__ */ jsx(
|
|
301
|
+
View,
|
|
302
|
+
{
|
|
303
|
+
style: [
|
|
304
|
+
styles.tile,
|
|
305
|
+
tileSize,
|
|
306
|
+
skin ? { backgroundColor: skin.fill } : null,
|
|
307
|
+
solid ? { backgroundColor: theme.color.accentInk } : null
|
|
308
|
+
],
|
|
309
|
+
children: /* @__PURE__ */ jsx(
|
|
310
|
+
Icon,
|
|
311
|
+
{
|
|
312
|
+
name: icon ?? "bell",
|
|
313
|
+
size: theme.icon.sm,
|
|
314
|
+
color: solid ? theme.color.accent : skin ? skin.ink : theme.color.accentInk
|
|
315
|
+
}
|
|
316
|
+
)
|
|
317
|
+
}
|
|
318
|
+
),
|
|
319
|
+
/* @__PURE__ */ jsxs(View, { style: styles.main, children: [
|
|
320
|
+
android && appName ? /* @__PURE__ */ jsxs(Text, { style: [styles.appName, osType(theme, size, "meta"), ink], children: [
|
|
321
|
+
appName,
|
|
322
|
+
time ? ` \xB7 ${time}` : ""
|
|
323
|
+
] }) : null,
|
|
324
|
+
/* @__PURE__ */ jsxs(View, { style: styles.titleRow, children: [
|
|
325
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.title, osType(theme, size, "title"), ink], numberOfLines: 1, children: title }),
|
|
326
|
+
!android && time ? /* @__PURE__ */ jsx(Text, { style: [styles.time, osType(theme, size, "meta"), ink], children: time }) : null
|
|
327
|
+
] }),
|
|
328
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.body, osType(theme, size, "body"), ink], numberOfLines: 2, children: body }),
|
|
329
|
+
groupCount && groupCount > 0 ? /* @__PURE__ */ jsx(Text, { style: [styles.group, osType(theme, size, "meta"), ink], children: labels.moreGrouped(groupCount) }) : null
|
|
330
|
+
] })
|
|
331
|
+
] });
|
|
332
|
+
return /* @__PURE__ */ jsx(OsEntrance, { motion, component: "notification-banner", style: styles.stackRoot, children: /* @__PURE__ */ jsxs(View, { style: styles.stackRoot, children: [
|
|
333
|
+
/* @__PURE__ */ jsxs(
|
|
334
|
+
View,
|
|
335
|
+
{
|
|
336
|
+
style: [
|
|
337
|
+
styles.banner,
|
|
338
|
+
solid ? styles.bannerSolid : null,
|
|
339
|
+
variant === "outline" ? styles.bannerOutline : null,
|
|
340
|
+
style
|
|
341
|
+
],
|
|
342
|
+
children: [
|
|
343
|
+
onPress ? /* @__PURE__ */ jsx(
|
|
344
|
+
Pressable,
|
|
345
|
+
{
|
|
346
|
+
accessibilityRole: "button",
|
|
347
|
+
accessibilityLabel: notificationLabel(props, labels),
|
|
348
|
+
onPress,
|
|
349
|
+
style: ({ pressed }) => [styles.bannerBody, pressed ? styles.pressed : null],
|
|
350
|
+
children: content
|
|
351
|
+
}
|
|
352
|
+
) : /* @__PURE__ */ jsx(
|
|
353
|
+
View,
|
|
354
|
+
{
|
|
355
|
+
accessibilityRole: "image",
|
|
356
|
+
accessibilityLabel: notificationLabel(props, labels),
|
|
357
|
+
style: styles.bannerBody,
|
|
358
|
+
children: content
|
|
359
|
+
}
|
|
360
|
+
),
|
|
361
|
+
actionLabel ? /* @__PURE__ */ jsx(
|
|
362
|
+
Pressable,
|
|
363
|
+
{
|
|
364
|
+
accessibilityRole: "button",
|
|
365
|
+
accessibilityLabel: actionLabel,
|
|
366
|
+
onPress: onAction,
|
|
367
|
+
style: ({ pressed }) => [styles.action, pressed ? styles.pressed : null],
|
|
368
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles.actionLabel, ink], children: actionLabel })
|
|
369
|
+
}
|
|
370
|
+
) : null,
|
|
371
|
+
dismissible ? /* @__PURE__ */ jsx(
|
|
372
|
+
Pressable,
|
|
373
|
+
{
|
|
374
|
+
accessibilityRole: "button",
|
|
375
|
+
accessibilityLabel: labels.dismiss,
|
|
376
|
+
onPress: onDismiss,
|
|
377
|
+
style: ({ pressed }) => [styles.action, pressed ? styles.pressed : null],
|
|
378
|
+
children: /* @__PURE__ */ jsx(
|
|
379
|
+
Icon,
|
|
380
|
+
{
|
|
381
|
+
name: "x",
|
|
382
|
+
size: theme.icon.sm,
|
|
383
|
+
color: solid ? theme.color.accentInk : theme.color.text2
|
|
384
|
+
}
|
|
385
|
+
)
|
|
386
|
+
}
|
|
387
|
+
) : null
|
|
388
|
+
]
|
|
389
|
+
}
|
|
390
|
+
),
|
|
391
|
+
groupCount && groupCount > 0 ? /* @__PURE__ */ jsx(View, { "aria-hidden": true, style: styles.stackPeek }) : null
|
|
392
|
+
] }) });
|
|
393
|
+
}
|
|
394
|
+
function LockScreenNotification(props) {
|
|
395
|
+
const { styles } = useStyles(sheet3);
|
|
396
|
+
const labels = useLabels("osSurfaces", DEFAULT_LABELS, props.labels);
|
|
397
|
+
const theme = useLoamTheme("os-surfaces");
|
|
398
|
+
const {
|
|
399
|
+
title,
|
|
400
|
+
body,
|
|
401
|
+
time,
|
|
402
|
+
actionLabel,
|
|
403
|
+
onAction,
|
|
404
|
+
onPress,
|
|
405
|
+
groupCount,
|
|
406
|
+
style,
|
|
407
|
+
tone,
|
|
408
|
+
variant = "soft",
|
|
409
|
+
dismissible,
|
|
410
|
+
onDismiss,
|
|
411
|
+
size,
|
|
412
|
+
motion,
|
|
413
|
+
appName,
|
|
414
|
+
layout = "default"
|
|
415
|
+
} = props;
|
|
416
|
+
const skin = tone ? softToneSkin(theme, tone) : null;
|
|
417
|
+
const solid = variant === "solid";
|
|
418
|
+
const ink = solid ? { color: theme.color.accentInk, opacity: 1 } : null;
|
|
419
|
+
const tileSize = notificationTile(size);
|
|
420
|
+
const content = layout === "header" ? /* @__PURE__ */ jsxs(View, { style: styles.main, children: [
|
|
421
|
+
/* @__PURE__ */ jsxs(View, { style: styles.titleRow, children: [
|
|
422
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.materialTime, styles.headerName, osType(theme, size, "meta"), ink], children: appName }),
|
|
423
|
+
time ? /* @__PURE__ */ jsx(Text, { style: [styles.materialTime, osType(theme, size, "meta"), ink], children: time }) : null
|
|
424
|
+
] }),
|
|
425
|
+
/* @__PURE__ */ jsx(
|
|
426
|
+
Text,
|
|
427
|
+
{
|
|
428
|
+
style: [styles.materialTitleFlat, osType(theme, size, "title"), ink],
|
|
429
|
+
numberOfLines: 1,
|
|
430
|
+
children: title
|
|
431
|
+
}
|
|
432
|
+
),
|
|
433
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.materialBody, osType(theme, size, "body"), ink], numberOfLines: 2, children: body }),
|
|
434
|
+
groupCount && groupCount > 0 ? /* @__PURE__ */ jsx(Text, { style: [styles.materialTime, osType(theme, size, "meta"), ink], children: labels.moreGrouped(groupCount) }) : null
|
|
435
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
436
|
+
/* @__PURE__ */ jsx(
|
|
437
|
+
View,
|
|
438
|
+
{
|
|
439
|
+
style: [
|
|
440
|
+
styles.materialTile,
|
|
441
|
+
tileSize,
|
|
442
|
+
skin ? { backgroundColor: skin.fill } : null,
|
|
443
|
+
solid ? { backgroundColor: theme.color.accentInk } : null
|
|
444
|
+
]
|
|
445
|
+
}
|
|
446
|
+
),
|
|
447
|
+
/* @__PURE__ */ jsxs(View, { style: styles.main, children: [
|
|
448
|
+
/* @__PURE__ */ jsxs(View, { style: styles.titleRow, children: [
|
|
449
|
+
/* @__PURE__ */ jsx(
|
|
450
|
+
Text,
|
|
451
|
+
{
|
|
452
|
+
style: [styles.materialTitle, osType(theme, size, "title"), ink],
|
|
453
|
+
numberOfLines: 1,
|
|
454
|
+
children: title
|
|
455
|
+
}
|
|
456
|
+
),
|
|
457
|
+
time ? /* @__PURE__ */ jsx(Text, { style: [styles.materialTime, osType(theme, size, "meta"), ink], children: time }) : null
|
|
458
|
+
] }),
|
|
459
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.materialBody, osType(theme, size, "body"), ink], numberOfLines: 2, children: body }),
|
|
460
|
+
groupCount && groupCount > 0 ? /* @__PURE__ */ jsx(Text, { style: [styles.materialTime, osType(theme, size, "meta"), ink], children: labels.moreGrouped(groupCount) }) : null
|
|
461
|
+
] })
|
|
462
|
+
] });
|
|
463
|
+
return /* @__PURE__ */ jsx(OsEntrance, { motion, component: "lock-screen-notification", style: styles.stackRoot, children: /* @__PURE__ */ jsxs(View, { style: styles.stackRoot, children: [
|
|
464
|
+
/* @__PURE__ */ jsxs(
|
|
465
|
+
View,
|
|
466
|
+
{
|
|
467
|
+
style: [
|
|
468
|
+
styles.materialCard,
|
|
469
|
+
solid ? styles.materialSolid : null,
|
|
470
|
+
variant === "outline" ? styles.materialOutline : null,
|
|
471
|
+
style
|
|
472
|
+
],
|
|
473
|
+
children: [
|
|
474
|
+
onPress ? /* @__PURE__ */ jsx(
|
|
475
|
+
Pressable,
|
|
476
|
+
{
|
|
477
|
+
accessibilityRole: "button",
|
|
478
|
+
accessibilityLabel: notificationLabel(props, labels),
|
|
479
|
+
onPress,
|
|
480
|
+
style: ({ pressed }) => [styles.materialBodyRow, pressed ? styles.pressed : null],
|
|
481
|
+
children: content
|
|
482
|
+
}
|
|
483
|
+
) : /* @__PURE__ */ jsx(
|
|
484
|
+
View,
|
|
485
|
+
{
|
|
486
|
+
accessibilityRole: "image",
|
|
487
|
+
accessibilityLabel: notificationLabel(props, labels),
|
|
488
|
+
style: styles.materialBodyRow,
|
|
489
|
+
children: content
|
|
490
|
+
}
|
|
491
|
+
),
|
|
492
|
+
actionLabel ? /* @__PURE__ */ jsx(
|
|
493
|
+
Pressable,
|
|
494
|
+
{
|
|
495
|
+
accessibilityRole: "button",
|
|
496
|
+
accessibilityLabel: actionLabel,
|
|
497
|
+
onPress: onAction,
|
|
498
|
+
style: ({ pressed }) => [styles.materialAction, pressed ? styles.pressed : null],
|
|
499
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles.materialActionLabel, ink], children: actionLabel })
|
|
500
|
+
}
|
|
501
|
+
) : null,
|
|
502
|
+
dismissible ? /* @__PURE__ */ jsx(
|
|
503
|
+
Pressable,
|
|
504
|
+
{
|
|
505
|
+
accessibilityRole: "button",
|
|
506
|
+
accessibilityLabel: labels.dismiss,
|
|
507
|
+
onPress: onDismiss,
|
|
508
|
+
style: ({ pressed }) => [styles.materialAction, pressed ? styles.pressed : null],
|
|
509
|
+
children: /* @__PURE__ */ jsx(
|
|
510
|
+
Icon,
|
|
511
|
+
{
|
|
512
|
+
name: "x",
|
|
513
|
+
size: theme.icon.sm,
|
|
514
|
+
color: solid ? theme.color.accentInk : OS_MATERIAL.ink
|
|
515
|
+
}
|
|
516
|
+
)
|
|
517
|
+
}
|
|
518
|
+
) : null
|
|
519
|
+
]
|
|
520
|
+
}
|
|
521
|
+
),
|
|
522
|
+
groupCount && groupCount > 0 ? /* @__PURE__ */ jsx(View, { "aria-hidden": true, style: [styles.stackPeek, styles.stackPeekMaterial] }) : null
|
|
523
|
+
] }) });
|
|
524
|
+
}
|
|
525
|
+
function LockScreenPreview({
|
|
526
|
+
time,
|
|
527
|
+
date,
|
|
528
|
+
activity,
|
|
529
|
+
notifications = [],
|
|
530
|
+
onNotificationPress,
|
|
531
|
+
wallpaperColor = LOCK_SCREEN_WALLPAPER,
|
|
532
|
+
loading = false,
|
|
533
|
+
size,
|
|
534
|
+
motion,
|
|
535
|
+
labels: labelsProp
|
|
536
|
+
}) {
|
|
537
|
+
const { styles } = useStyles(sheet3);
|
|
538
|
+
const labels = useLabels("osSurfaces", DEFAULT_LABELS, labelsProp);
|
|
539
|
+
const theme = useLoamTheme("os-surfaces");
|
|
540
|
+
const clockPx = osScale(theme.fontSize[56], size);
|
|
541
|
+
return /* @__PURE__ */ jsxs(
|
|
542
|
+
View,
|
|
543
|
+
{
|
|
544
|
+
role: "group",
|
|
545
|
+
accessibilityLabel: labels.lockScreenPreview,
|
|
546
|
+
"aria-busy": loading || void 0,
|
|
547
|
+
style: [styles.lockScreen, { backgroundColor: wallpaperColor }],
|
|
548
|
+
children: [
|
|
549
|
+
/* @__PURE__ */ jsx(OsEntrance, { motion, component: "lock-screen-preview", children: /* @__PURE__ */ jsxs(View, { style: styles.clock, children: [
|
|
550
|
+
/* @__PURE__ */ jsx(Text, { style: styles.clockDate, children: date }),
|
|
551
|
+
/* @__PURE__ */ jsx(
|
|
552
|
+
Text,
|
|
553
|
+
{
|
|
554
|
+
style: [
|
|
555
|
+
styles.clockTime,
|
|
556
|
+
size === void 0 ? null : { fontSize: clockPx, lineHeight: clockPx * theme.lineHeight.tight }
|
|
557
|
+
],
|
|
558
|
+
children: time
|
|
559
|
+
}
|
|
560
|
+
)
|
|
561
|
+
] }) }),
|
|
562
|
+
loading ? /* @__PURE__ */ jsx(
|
|
563
|
+
ActivityIndicator,
|
|
564
|
+
{
|
|
565
|
+
size: "small",
|
|
566
|
+
color: OS_MATERIAL.ink,
|
|
567
|
+
accessibilityLabel: labels.loading
|
|
568
|
+
}
|
|
569
|
+
) : null,
|
|
570
|
+
activity,
|
|
571
|
+
notifications.map((n) => /* @__PURE__ */ jsx(
|
|
572
|
+
LockScreenNotification,
|
|
573
|
+
{
|
|
574
|
+
title: n.title,
|
|
575
|
+
body: n.body,
|
|
576
|
+
time: n.time,
|
|
577
|
+
appName: n.appName,
|
|
578
|
+
icon: n.icon,
|
|
579
|
+
onPress: onNotificationPress ? () => onNotificationPress(n.id) : void 0
|
|
580
|
+
},
|
|
581
|
+
n.id
|
|
582
|
+
))
|
|
583
|
+
]
|
|
584
|
+
}
|
|
585
|
+
);
|
|
586
|
+
}
|
|
587
|
+
var sheet3 = createStyleSheet((theme) => ({
|
|
588
|
+
stackRoot: { alignSelf: "stretch" },
|
|
589
|
+
// Sits directly under the card, inset on both sides and rounded only at the
|
|
590
|
+
// bottom, so it reads as a second card behind the front one without ever
|
|
591
|
+
// intersecting it (no translucency doubling) or leaving the entry's own box.
|
|
592
|
+
stackPeek: {
|
|
593
|
+
height: theme.space[GROUP_STACK_OFFSET],
|
|
594
|
+
marginHorizontal: theme.space.s2,
|
|
595
|
+
borderBottomStartRadius: theme.radius.lg,
|
|
596
|
+
borderBottomEndRadius: theme.radius.lg,
|
|
597
|
+
backgroundColor: theme.color.surface2
|
|
598
|
+
},
|
|
599
|
+
// Dimmed, because two layers of the same material would read as one tall card
|
|
600
|
+
// rather than as a stack. `surface2` behind the opaque banner needs no help.
|
|
601
|
+
stackPeekMaterial: {
|
|
602
|
+
backgroundColor: OS_MATERIAL.fillWeak,
|
|
603
|
+
opacity: OS_MATERIAL_INK_OPACITY.tertiary
|
|
604
|
+
},
|
|
605
|
+
// ---- banner (over the app's own window: Loam tokens) ----
|
|
606
|
+
banner: {
|
|
607
|
+
flexDirection: "row",
|
|
608
|
+
alignItems: "center",
|
|
609
|
+
gap: theme.space.s3,
|
|
610
|
+
padding: theme.space.s3,
|
|
611
|
+
borderRadius: theme.radius.lg,
|
|
612
|
+
backgroundColor: theme.color.surface,
|
|
613
|
+
borderWidth: theme.borderWidth.base,
|
|
614
|
+
borderColor: theme.color.border,
|
|
615
|
+
...theme.shadow.lg
|
|
616
|
+
},
|
|
617
|
+
bannerBody: {
|
|
618
|
+
flex: 1,
|
|
619
|
+
flexDirection: "row",
|
|
620
|
+
alignItems: "center",
|
|
621
|
+
gap: theme.space.s3,
|
|
622
|
+
minHeight: theme.tapMin
|
|
623
|
+
},
|
|
624
|
+
bannerSolid: { backgroundColor: theme.color.accent, borderColor: theme.color.accent },
|
|
625
|
+
bannerOutline: { borderColor: theme.color.borderStrong, shadowOpacity: 0, elevation: 0 },
|
|
626
|
+
pressed: { opacity: theme.state.pressedOpacity },
|
|
627
|
+
tile: {
|
|
628
|
+
width: NOTIFICATION_TILE.size,
|
|
629
|
+
height: NOTIFICATION_TILE.size,
|
|
630
|
+
borderRadius: NOTIFICATION_TILE.radius,
|
|
631
|
+
flexShrink: 0,
|
|
632
|
+
alignItems: "center",
|
|
633
|
+
justifyContent: "center",
|
|
634
|
+
backgroundColor: theme.color.accent
|
|
635
|
+
},
|
|
636
|
+
main: { flex: 1, minWidth: 0, gap: theme.space.s1 },
|
|
637
|
+
titleRow: { flexDirection: "row", alignItems: "center", gap: theme.space.s2 },
|
|
638
|
+
headerName: { flex: 1 },
|
|
639
|
+
titleFlat: {
|
|
640
|
+
fontFamily: theme.font.sans,
|
|
641
|
+
fontWeight: theme.fontWeight.bold,
|
|
642
|
+
fontSize: theme.type.footnote.fontSize,
|
|
643
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
644
|
+
color: theme.color.text
|
|
645
|
+
},
|
|
646
|
+
materialTitleFlat: {
|
|
647
|
+
fontFamily: theme.font.sans,
|
|
648
|
+
fontWeight: theme.fontWeight.bold,
|
|
649
|
+
fontSize: theme.type.footnote.fontSize,
|
|
650
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
651
|
+
color: OS_MATERIAL.ink
|
|
652
|
+
},
|
|
653
|
+
appName: {
|
|
654
|
+
fontFamily: theme.font.sans,
|
|
655
|
+
fontSize: theme.type.caption2.fontSize,
|
|
656
|
+
lineHeight: theme.type.caption2.lineHeight,
|
|
657
|
+
color: theme.color.text3
|
|
658
|
+
},
|
|
659
|
+
title: {
|
|
660
|
+
flex: 1,
|
|
661
|
+
fontFamily: theme.font.sans,
|
|
662
|
+
fontWeight: theme.fontWeight.bold,
|
|
663
|
+
fontSize: theme.type.footnote.fontSize,
|
|
664
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
665
|
+
color: theme.color.text
|
|
666
|
+
},
|
|
667
|
+
time: {
|
|
668
|
+
fontFamily: theme.font.sans,
|
|
669
|
+
fontSize: theme.type.caption2.fontSize,
|
|
670
|
+
lineHeight: theme.type.caption2.lineHeight,
|
|
671
|
+
color: theme.color.text3
|
|
672
|
+
},
|
|
673
|
+
body: {
|
|
674
|
+
fontFamily: theme.font.sans,
|
|
675
|
+
fontSize: theme.type.footnote.fontSize,
|
|
676
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
677
|
+
color: theme.color.text2
|
|
678
|
+
},
|
|
679
|
+
group: {
|
|
680
|
+
fontFamily: theme.font.sans,
|
|
681
|
+
fontSize: theme.type.caption2.fontSize,
|
|
682
|
+
lineHeight: theme.type.caption2.lineHeight,
|
|
683
|
+
color: theme.color.text3
|
|
684
|
+
},
|
|
685
|
+
action: {
|
|
686
|
+
minHeight: theme.tapMin,
|
|
687
|
+
justifyContent: "center",
|
|
688
|
+
paddingHorizontal: theme.space.s3,
|
|
689
|
+
flexShrink: 0
|
|
690
|
+
},
|
|
691
|
+
actionLabel: {
|
|
692
|
+
fontFamily: theme.font.sans,
|
|
693
|
+
fontWeight: theme.fontWeight.bold,
|
|
694
|
+
fontSize: theme.type.footnote.fontSize,
|
|
695
|
+
color: theme.color.accentStrong
|
|
696
|
+
},
|
|
697
|
+
// ---- lock screen / notification centre (OS material over a wallpaper) ----
|
|
698
|
+
lockScreen: {
|
|
699
|
+
flex: 1,
|
|
700
|
+
paddingHorizontal: theme.space.s3,
|
|
701
|
+
paddingTop: theme.space.s6,
|
|
702
|
+
gap: theme.space.s3
|
|
703
|
+
},
|
|
704
|
+
clock: { alignItems: "center", gap: theme.space.s1 },
|
|
705
|
+
clockDate: {
|
|
706
|
+
fontFamily: theme.font.sans,
|
|
707
|
+
fontSize: theme.type.caption1.fontSize,
|
|
708
|
+
lineHeight: theme.type.caption1.lineHeight,
|
|
709
|
+
color: OS_MATERIAL.ink,
|
|
710
|
+
opacity: OS_MATERIAL_INK_OPACITY.secondary
|
|
711
|
+
},
|
|
712
|
+
// The lock-screen clock is OS chrome with no counterpart in the semantic ramp,
|
|
713
|
+
// so it takes the size-only `hero` step (52) the reference specifies.
|
|
714
|
+
clockTime: {
|
|
715
|
+
fontFamily: theme.font.display,
|
|
716
|
+
fontWeight: theme.font.displayWeight,
|
|
717
|
+
fontSize: theme.fontSize[56],
|
|
718
|
+
lineHeight: theme.fontSize[56] * theme.lineHeight.tight,
|
|
719
|
+
color: OS_MATERIAL.ink
|
|
720
|
+
},
|
|
721
|
+
materialCard: {
|
|
722
|
+
flexDirection: "row",
|
|
723
|
+
alignItems: "center",
|
|
724
|
+
gap: theme.space.s3,
|
|
725
|
+
padding: theme.space.s3,
|
|
726
|
+
borderRadius: theme.radius.lg,
|
|
727
|
+
// Translucent scrim, NOT a blur: RN has no `backdrop-filter`. See OS_MATERIAL.
|
|
728
|
+
backgroundColor: OS_MATERIAL.fillWeak
|
|
729
|
+
},
|
|
730
|
+
materialSolid: { backgroundColor: theme.color.accent },
|
|
731
|
+
materialOutline: { borderWidth: theme.borderWidth.thin, borderColor: OS_MATERIAL.ink },
|
|
732
|
+
materialBodyRow: {
|
|
733
|
+
flex: 1,
|
|
734
|
+
flexDirection: "row",
|
|
735
|
+
alignItems: "center",
|
|
736
|
+
gap: theme.space.s3,
|
|
737
|
+
minHeight: theme.tapMin
|
|
738
|
+
},
|
|
739
|
+
materialTile: {
|
|
740
|
+
width: NOTIFICATION_TILE.size,
|
|
741
|
+
height: NOTIFICATION_TILE.size,
|
|
742
|
+
borderRadius: NOTIFICATION_TILE.radius,
|
|
743
|
+
flexShrink: 0,
|
|
744
|
+
backgroundColor: theme.color.accent
|
|
745
|
+
},
|
|
746
|
+
materialTitle: {
|
|
747
|
+
flex: 1,
|
|
748
|
+
fontFamily: theme.font.sans,
|
|
749
|
+
fontWeight: theme.fontWeight.bold,
|
|
750
|
+
fontSize: theme.type.footnote.fontSize,
|
|
751
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
752
|
+
color: OS_MATERIAL.ink
|
|
753
|
+
},
|
|
754
|
+
materialTime: {
|
|
755
|
+
fontFamily: theme.font.sans,
|
|
756
|
+
fontSize: theme.type.caption2.fontSize,
|
|
757
|
+
lineHeight: theme.type.caption2.lineHeight,
|
|
758
|
+
color: OS_MATERIAL.ink,
|
|
759
|
+
opacity: OS_MATERIAL_INK_OPACITY.tertiary
|
|
760
|
+
},
|
|
761
|
+
materialBody: {
|
|
762
|
+
fontFamily: theme.font.sans,
|
|
763
|
+
fontSize: theme.type.footnote.fontSize,
|
|
764
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
765
|
+
color: OS_MATERIAL.ink,
|
|
766
|
+
opacity: OS_MATERIAL_INK_OPACITY.secondary
|
|
767
|
+
},
|
|
768
|
+
materialAction: {
|
|
769
|
+
minHeight: theme.tapMin,
|
|
770
|
+
justifyContent: "center",
|
|
771
|
+
paddingHorizontal: theme.space.s3,
|
|
772
|
+
flexShrink: 0
|
|
773
|
+
},
|
|
774
|
+
materialActionLabel: {
|
|
775
|
+
fontFamily: theme.font.sans,
|
|
776
|
+
fontWeight: theme.fontWeight.bold,
|
|
777
|
+
fontSize: theme.type.footnote.fontSize,
|
|
778
|
+
color: OS_MATERIAL.ink
|
|
779
|
+
}
|
|
780
|
+
}));
|
|
781
|
+
function clamp01(n) {
|
|
782
|
+
return Math.max(0, Math.min(1, n));
|
|
783
|
+
}
|
|
784
|
+
function LiveActivityPreview({
|
|
785
|
+
title,
|
|
786
|
+
progress,
|
|
787
|
+
status,
|
|
788
|
+
detail,
|
|
789
|
+
icon = "upload",
|
|
790
|
+
presentation = "lockScreen",
|
|
791
|
+
cancelLabel,
|
|
792
|
+
onCancel,
|
|
793
|
+
accessibilityLabel,
|
|
794
|
+
interactive = true,
|
|
795
|
+
loading = false,
|
|
796
|
+
motion = "standard",
|
|
797
|
+
padding = "md",
|
|
798
|
+
variant = "default",
|
|
799
|
+
size,
|
|
800
|
+
elevation,
|
|
801
|
+
labels: labelsProp
|
|
802
|
+
}) {
|
|
803
|
+
const { styles } = useStyles(sheet4);
|
|
804
|
+
const labels = useLabels("osSurfaces", DEFAULT_LABELS, labelsProp);
|
|
805
|
+
const theme = useLoamTheme("os-surfaces");
|
|
806
|
+
const announced = accessibilityLabel ?? [title, status, detail].filter(Boolean).join(", ");
|
|
807
|
+
const fraction = progress === void 0 || loading ? void 0 : clamp01(progress);
|
|
808
|
+
const percent = fraction === void 0 ? void 0 : Math.round(fraction * 100);
|
|
809
|
+
const grow = React.useRef(new Animated.Value(fraction ?? 0)).current;
|
|
810
|
+
React.useEffect(() => {
|
|
811
|
+
if (fraction === void 0) return;
|
|
812
|
+
if (motion === "none") {
|
|
813
|
+
grow.setValue(fraction);
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
Animated.timing(grow, {
|
|
817
|
+
toValue: fraction,
|
|
818
|
+
duration: theme.motion.expand.duration,
|
|
819
|
+
easing: Easing.bezier(...theme.motion.expand.easing),
|
|
820
|
+
useNativeDriver: false
|
|
821
|
+
}).start();
|
|
822
|
+
}, [fraction, grow, motion, theme.motion.expand.duration, theme.motion.expand.easing]);
|
|
823
|
+
const width = grow.interpolate({
|
|
824
|
+
inputRange: [0, 1],
|
|
825
|
+
outputRange: ["0%", "100%"]
|
|
826
|
+
});
|
|
827
|
+
if (presentation === "island") {
|
|
828
|
+
const android = isAndroidIdiom(theme);
|
|
829
|
+
return /* @__PURE__ */ jsxs(
|
|
830
|
+
View,
|
|
831
|
+
{
|
|
832
|
+
accessibilityRole: "progressbar",
|
|
833
|
+
"aria-busy": loading || void 0,
|
|
834
|
+
accessibilityLabel: announced,
|
|
835
|
+
accessibilityValue: percent === void 0 ? void 0 : { now: percent, min: 0, max: 100 },
|
|
836
|
+
"aria-valuenow": percent,
|
|
837
|
+
"aria-valuemin": percent === void 0 ? void 0 : 0,
|
|
838
|
+
"aria-valuemax": percent === void 0 ? void 0 : 100,
|
|
839
|
+
style: [
|
|
840
|
+
styles.island,
|
|
841
|
+
android ? styles.islandAndroid : null,
|
|
842
|
+
size === void 0 ? null : { height: osScale(DYNAMIC_ISLAND.height, size) }
|
|
843
|
+
],
|
|
844
|
+
children: [
|
|
845
|
+
/* @__PURE__ */ jsx(
|
|
846
|
+
Icon,
|
|
847
|
+
{
|
|
848
|
+
name: icon,
|
|
849
|
+
size: theme.icon.sm,
|
|
850
|
+
color: android ? theme.color.accentInk : OS_MATERIAL.ink
|
|
851
|
+
}
|
|
852
|
+
),
|
|
853
|
+
/* @__PURE__ */ jsx(
|
|
854
|
+
Text,
|
|
855
|
+
{
|
|
856
|
+
style: [
|
|
857
|
+
styles.islandLabel,
|
|
858
|
+
android ? styles.islandLabelAndroid : null,
|
|
859
|
+
osType(theme, size, "title")
|
|
860
|
+
],
|
|
861
|
+
numberOfLines: 1,
|
|
862
|
+
children: title
|
|
863
|
+
}
|
|
864
|
+
),
|
|
865
|
+
status ? /* @__PURE__ */ jsx(
|
|
866
|
+
Text,
|
|
867
|
+
{
|
|
868
|
+
style: [
|
|
869
|
+
styles.islandStatus,
|
|
870
|
+
android ? styles.islandLabelAndroid : null,
|
|
871
|
+
osType(theme, size, "meta")
|
|
872
|
+
],
|
|
873
|
+
children: status
|
|
874
|
+
}
|
|
875
|
+
) : null
|
|
876
|
+
]
|
|
877
|
+
}
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
return (
|
|
881
|
+
// A `group`, not a `progressbar`: the card also holds the interactive cancel
|
|
882
|
+
// control, and `progressbar` (like `img`) makes its children presentational —
|
|
883
|
+
// nesting a focusable button inside it is a nested-interactive violation. The
|
|
884
|
+
// progressbar role lives on the track below, which owns no interactive content.
|
|
885
|
+
/* @__PURE__ */ jsxs(
|
|
886
|
+
View,
|
|
887
|
+
{
|
|
888
|
+
role: "group",
|
|
889
|
+
"aria-busy": loading || void 0,
|
|
890
|
+
style: [
|
|
891
|
+
styles.card,
|
|
892
|
+
padding === "md" ? null : padding === "sm" ? styles.cardSm : styles.cardLg,
|
|
893
|
+
variant === "elevated" ? styles.cardElevated : null,
|
|
894
|
+
variant === "outline" ? styles.cardOutline : null,
|
|
895
|
+
elevation === void 0 ? null : elevation === "flat" ? styles.cardFlat : elevation === "raised" ? styles.cardRaised : styles.cardDefault
|
|
896
|
+
],
|
|
897
|
+
children: [
|
|
898
|
+
/* @__PURE__ */ jsx(
|
|
899
|
+
View,
|
|
900
|
+
{
|
|
901
|
+
style: [
|
|
902
|
+
styles.cardTile,
|
|
903
|
+
size === void 0 ? null : {
|
|
904
|
+
width: osScale(LIVE_ACTIVITY_CARD.tile, size),
|
|
905
|
+
height: osScale(LIVE_ACTIVITY_CARD.tile, size),
|
|
906
|
+
borderRadius: osScale(LIVE_ACTIVITY_CARD.tileRadius, size)
|
|
907
|
+
}
|
|
908
|
+
],
|
|
909
|
+
children: /* @__PURE__ */ jsx(Icon, { name: icon, size: theme.icon.sm, color: theme.color.accentInk })
|
|
910
|
+
}
|
|
911
|
+
),
|
|
912
|
+
/* @__PURE__ */ jsxs(View, { style: styles.cardMain, children: [
|
|
913
|
+
/* @__PURE__ */ jsxs(View, { style: styles.cardTitleRow, children: [
|
|
914
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.cardTitle, osType(theme, size, "title")], numberOfLines: 1, children: title }),
|
|
915
|
+
status ? /* @__PURE__ */ jsx(Text, { style: [styles.cardStatus, osType(theme, size, "meta")], numberOfLines: 1, children: status }) : null
|
|
916
|
+
] }),
|
|
917
|
+
/* @__PURE__ */ jsx(
|
|
918
|
+
View,
|
|
919
|
+
{
|
|
920
|
+
accessibilityRole: "progressbar",
|
|
921
|
+
accessibilityLabel: announced,
|
|
922
|
+
accessibilityValue: percent === void 0 ? void 0 : { now: percent, min: 0, max: 100 },
|
|
923
|
+
"aria-valuenow": percent,
|
|
924
|
+
"aria-valuemin": percent === void 0 ? void 0 : 0,
|
|
925
|
+
"aria-valuemax": percent === void 0 ? void 0 : 100,
|
|
926
|
+
style: styles.track,
|
|
927
|
+
children: /* @__PURE__ */ jsx(
|
|
928
|
+
Animated.View,
|
|
929
|
+
{
|
|
930
|
+
style: [styles.fill, fraction === void 0 ? styles.fillIndeterminate : { width }]
|
|
931
|
+
}
|
|
932
|
+
)
|
|
933
|
+
}
|
|
934
|
+
),
|
|
935
|
+
detail ? /* @__PURE__ */ jsx(Text, { style: [styles.cardDetail, osType(theme, size, "meta")], numberOfLines: 1, children: detail }) : null
|
|
936
|
+
] }),
|
|
937
|
+
onCancel && interactive ? /* @__PURE__ */ jsx(
|
|
938
|
+
Pressable,
|
|
939
|
+
{
|
|
940
|
+
accessibilityRole: "button",
|
|
941
|
+
accessibilityLabel: cancelLabel ?? labels.cancel,
|
|
942
|
+
onPress: onCancel,
|
|
943
|
+
style: ({ pressed }) => [styles.cancel, pressed ? styles.pressed : null],
|
|
944
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "x", size: theme.icon.sm, color: OS_MATERIAL.ink })
|
|
945
|
+
}
|
|
946
|
+
) : null
|
|
947
|
+
]
|
|
948
|
+
}
|
|
949
|
+
)
|
|
950
|
+
);
|
|
951
|
+
}
|
|
952
|
+
var sheet4 = createStyleSheet((theme) => ({
|
|
953
|
+
// ---- compact: the Dynamic Island pill ----
|
|
954
|
+
island: {
|
|
955
|
+
flexDirection: "row",
|
|
956
|
+
alignItems: "center",
|
|
957
|
+
alignSelf: "flex-start",
|
|
958
|
+
gap: theme.space.s2,
|
|
959
|
+
minWidth: DYNAMIC_ISLAND.minWidth,
|
|
960
|
+
height: DYNAMIC_ISLAND.height,
|
|
961
|
+
// Fully rounded: the housing is a capsule, so the radius is half its height,
|
|
962
|
+
// not a Loam radius step.
|
|
963
|
+
borderRadius: DYNAMIC_ISLAND.height / 2,
|
|
964
|
+
paddingHorizontal: theme.space.s3,
|
|
965
|
+
backgroundColor: DYNAMIC_ISLAND_FILL
|
|
966
|
+
},
|
|
967
|
+
islandAndroid: { backgroundColor: theme.color.accent },
|
|
968
|
+
islandLabel: {
|
|
969
|
+
flexShrink: 1,
|
|
970
|
+
fontFamily: theme.font.sans,
|
|
971
|
+
fontWeight: theme.fontWeight.bold,
|
|
972
|
+
fontSize: theme.type.caption1.fontSize,
|
|
973
|
+
lineHeight: theme.type.caption1.lineHeight,
|
|
974
|
+
color: OS_MATERIAL.ink
|
|
975
|
+
},
|
|
976
|
+
islandLabelAndroid: { color: theme.color.accentInk },
|
|
977
|
+
islandStatus: {
|
|
978
|
+
marginStart: "auto",
|
|
979
|
+
fontFamily: theme.font.mono,
|
|
980
|
+
fontSize: theme.type.caption2.fontSize,
|
|
981
|
+
lineHeight: theme.type.caption2.lineHeight,
|
|
982
|
+
color: OS_MATERIAL.ink,
|
|
983
|
+
opacity: OS_MATERIAL_INK_OPACITY.secondary
|
|
984
|
+
},
|
|
985
|
+
// ---- expanded: the lock-screen card, on system material ----
|
|
986
|
+
card: {
|
|
987
|
+
flexDirection: "row",
|
|
988
|
+
alignItems: "center",
|
|
989
|
+
gap: theme.space.s3,
|
|
990
|
+
padding: theme.space.s3,
|
|
991
|
+
// The OS clips an expanded Live Activity at 160pt.
|
|
992
|
+
maxHeight: LIVE_ACTIVITY_MAX_H,
|
|
993
|
+
borderRadius: theme.radius.lg,
|
|
994
|
+
// Translucent scrim, NOT a blur — RN has no `backdrop-filter`. See OS_MATERIAL.
|
|
995
|
+
backgroundColor: OS_MATERIAL.fill
|
|
996
|
+
},
|
|
997
|
+
cardElevated: { ...theme.shadow.lg },
|
|
998
|
+
cardFlat: { shadowOpacity: 0, elevation: 0 },
|
|
999
|
+
cardDefault: { ...theme.shadow.sm },
|
|
1000
|
+
cardRaised: { ...theme.shadow.md },
|
|
1001
|
+
cardOutline: { borderWidth: theme.borderWidth.thin, borderColor: OS_MATERIAL.ink },
|
|
1002
|
+
cardSm: { padding: theme.space.s2 },
|
|
1003
|
+
cardLg: { padding: theme.space.s4 },
|
|
1004
|
+
cardTile: {
|
|
1005
|
+
width: LIVE_ACTIVITY_CARD.tile,
|
|
1006
|
+
height: LIVE_ACTIVITY_CARD.tile,
|
|
1007
|
+
borderRadius: LIVE_ACTIVITY_CARD.tileRadius,
|
|
1008
|
+
flexShrink: 0,
|
|
1009
|
+
alignItems: "center",
|
|
1010
|
+
justifyContent: "center",
|
|
1011
|
+
backgroundColor: theme.color.accent
|
|
1012
|
+
},
|
|
1013
|
+
cardMain: { flex: 1, minWidth: 0, gap: theme.space.s1 },
|
|
1014
|
+
cardTitleRow: { flexDirection: "row", alignItems: "baseline", gap: theme.space.s2 },
|
|
1015
|
+
cardTitle: {
|
|
1016
|
+
flex: 1,
|
|
1017
|
+
fontFamily: theme.font.sans,
|
|
1018
|
+
fontWeight: theme.fontWeight.bold,
|
|
1019
|
+
fontSize: theme.type.footnote.fontSize,
|
|
1020
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
1021
|
+
color: OS_MATERIAL.ink
|
|
1022
|
+
},
|
|
1023
|
+
cardDetail: {
|
|
1024
|
+
fontFamily: theme.font.sans,
|
|
1025
|
+
fontSize: theme.type.caption2.fontSize,
|
|
1026
|
+
lineHeight: theme.type.caption2.lineHeight,
|
|
1027
|
+
color: OS_MATERIAL.ink,
|
|
1028
|
+
opacity: OS_MATERIAL_INK_OPACITY.secondary
|
|
1029
|
+
},
|
|
1030
|
+
track: {
|
|
1031
|
+
height: LIVE_ACTIVITY_CARD.trackH,
|
|
1032
|
+
borderRadius: LIVE_ACTIVITY_CARD.trackH / 2,
|
|
1033
|
+
overflow: "hidden",
|
|
1034
|
+
backgroundColor: OS_MATERIAL.track
|
|
1035
|
+
},
|
|
1036
|
+
fill: { height: "100%", backgroundColor: OS_MATERIAL.ink },
|
|
1037
|
+
fillIndeterminate: { width: "100%", opacity: OS_MATERIAL_INK_OPACITY.tertiary },
|
|
1038
|
+
cardStatus: {
|
|
1039
|
+
flexShrink: 0,
|
|
1040
|
+
fontFamily: theme.font.mono,
|
|
1041
|
+
fontSize: theme.type.caption2.fontSize,
|
|
1042
|
+
lineHeight: theme.type.caption2.lineHeight,
|
|
1043
|
+
color: OS_MATERIAL.ink,
|
|
1044
|
+
opacity: OS_MATERIAL_INK_OPACITY.secondary
|
|
1045
|
+
},
|
|
1046
|
+
cancel: {
|
|
1047
|
+
width: theme.icon["2xl"],
|
|
1048
|
+
height: theme.icon["2xl"],
|
|
1049
|
+
flexShrink: 0,
|
|
1050
|
+
alignItems: "center",
|
|
1051
|
+
justifyContent: "center"
|
|
1052
|
+
},
|
|
1053
|
+
pressed: { opacity: theme.state.pressedOpacity }
|
|
1054
|
+
}));
|
|
1055
|
+
var STAT_BUDGET = { small: 1, medium: 2, large: 4 };
|
|
1056
|
+
var TITLE_LINES = { small: 2, medium: 2, large: 3 };
|
|
1057
|
+
function WidgetPreview({
|
|
1058
|
+
sizeClass = "small",
|
|
1059
|
+
appName,
|
|
1060
|
+
icon = "grid",
|
|
1061
|
+
title,
|
|
1062
|
+
subtitle,
|
|
1063
|
+
stats = [],
|
|
1064
|
+
caption,
|
|
1065
|
+
onPress,
|
|
1066
|
+
accessibilityLabel,
|
|
1067
|
+
variant = "default",
|
|
1068
|
+
elevation = "md",
|
|
1069
|
+
padding = "md",
|
|
1070
|
+
tone,
|
|
1071
|
+
loading = false,
|
|
1072
|
+
size: tier,
|
|
1073
|
+
motion
|
|
1074
|
+
}) {
|
|
1075
|
+
const { styles } = useStyles(sheet5);
|
|
1076
|
+
const theme = useLoamTheme("os-surfaces");
|
|
1077
|
+
const size = WIDGET_SIZE[sizeClass];
|
|
1078
|
+
const android = isAndroidIdiom(theme);
|
|
1079
|
+
const radius = android ? WIDGET_CORNER.android : WIDGET_CORNER.iOS;
|
|
1080
|
+
const innerRadius = android ? WIDGET_INNER_CORNER_ANDROID : theme.radius.md;
|
|
1081
|
+
const skin = tone ? softToneSkin(theme, tone) : null;
|
|
1082
|
+
const shown = stats.slice(0, STAT_BUDGET[sizeClass]);
|
|
1083
|
+
const announced = accessibilityLabel ?? [appName, title, subtitle].filter(Boolean).join(", ");
|
|
1084
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1085
|
+
/* @__PURE__ */ jsxs(View, { style: styles.glance, children: [
|
|
1086
|
+
/* @__PURE__ */ jsxs(View, { style: styles.header, children: [
|
|
1087
|
+
/* @__PURE__ */ jsx(Icon, { name: icon, size: theme.icon.xs, color: theme.color.accentStrong }),
|
|
1088
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.appName, skin ? { color: skin.ink } : null], numberOfLines: 1, children: appName })
|
|
1089
|
+
] }),
|
|
1090
|
+
/* @__PURE__ */ jsx(
|
|
1091
|
+
Text,
|
|
1092
|
+
{
|
|
1093
|
+
style: [styles.title, osType(theme, tier, "title"), loading ? styles.redacted : null],
|
|
1094
|
+
numberOfLines: TITLE_LINES[sizeClass],
|
|
1095
|
+
children: title
|
|
1096
|
+
}
|
|
1097
|
+
),
|
|
1098
|
+
subtitle ? /* @__PURE__ */ jsx(Text, { style: [styles.subtitle, osType(theme, tier, "meta")], numberOfLines: 1, children: subtitle }) : null
|
|
1099
|
+
] }),
|
|
1100
|
+
shown.length > 0 || caption ? /* @__PURE__ */ jsxs(View, { style: styles.readout, children: [
|
|
1101
|
+
shown.length > 0 ? /* @__PURE__ */ jsx(View, { style: [styles.stats, sizeClass === "large" ? styles.statsWrap : null], children: shown.map((s) => /* @__PURE__ */ jsxs(View, { style: [styles.stat, { borderRadius: innerRadius }], children: [
|
|
1102
|
+
/* @__PURE__ */ jsx(
|
|
1103
|
+
Text,
|
|
1104
|
+
{
|
|
1105
|
+
style: [styles.statValue, osType(theme, tier, "body"), loading ? styles.redacted : null],
|
|
1106
|
+
numberOfLines: 1,
|
|
1107
|
+
children: s.value
|
|
1108
|
+
}
|
|
1109
|
+
),
|
|
1110
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.statLabel, osType(theme, tier, "meta")], numberOfLines: 1, children: s.label })
|
|
1111
|
+
] }, s.id)) }) : null,
|
|
1112
|
+
caption ? /* @__PURE__ */ jsx(Text, { style: [styles.caption, osType(theme, tier, "meta")], numberOfLines: 1, children: caption }) : null
|
|
1113
|
+
] }) : null
|
|
1114
|
+
] });
|
|
1115
|
+
const frame = [
|
|
1116
|
+
styles.widget,
|
|
1117
|
+
variant === "outline" ? styles.widgetOutline : null,
|
|
1118
|
+
variant === "tinted" ? styles.widgetTinted : null,
|
|
1119
|
+
elevation === "none" || variant === "outline" ? styles.shadowNone : elevation === "sm" ? styles.shadowSm : null,
|
|
1120
|
+
padding === "sm" ? styles.padSm : padding === "lg" ? styles.padLg : null,
|
|
1121
|
+
skin ? { backgroundColor: skin.fill, borderColor: skin.edge } : null,
|
|
1122
|
+
{ width: size.width, height: size.height, borderRadius: radius }
|
|
1123
|
+
];
|
|
1124
|
+
if (onPress) {
|
|
1125
|
+
return /* @__PURE__ */ jsx(OsEntrance, { motion, component: "widget-preview", style: styles.entrance, children: /* @__PURE__ */ jsx(
|
|
1126
|
+
Pressable,
|
|
1127
|
+
{
|
|
1128
|
+
accessibilityRole: "button",
|
|
1129
|
+
accessibilityLabel: announced,
|
|
1130
|
+
"aria-busy": loading || void 0,
|
|
1131
|
+
onPress,
|
|
1132
|
+
style: frame,
|
|
1133
|
+
children: body
|
|
1134
|
+
}
|
|
1135
|
+
) });
|
|
1136
|
+
}
|
|
1137
|
+
return /* @__PURE__ */ jsx(OsEntrance, { motion, component: "widget-preview", style: styles.entrance, children: /* @__PURE__ */ jsx(
|
|
1138
|
+
View,
|
|
1139
|
+
{
|
|
1140
|
+
accessibilityRole: "image",
|
|
1141
|
+
accessibilityLabel: announced,
|
|
1142
|
+
"aria-busy": loading || void 0,
|
|
1143
|
+
style: frame,
|
|
1144
|
+
children: body
|
|
1145
|
+
}
|
|
1146
|
+
) });
|
|
1147
|
+
}
|
|
1148
|
+
var sheet5 = createStyleSheet((theme) => ({
|
|
1149
|
+
entrance: { alignSelf: "flex-start" },
|
|
1150
|
+
// `s3` padding, not `s4`: a `systemSmall` widget is 170pt square, so 16pt on
|
|
1151
|
+
// every side spent a fifth of the canvas on margin and left the glance and the
|
|
1152
|
+
// stat tile fighting over what was left.
|
|
1153
|
+
widget: {
|
|
1154
|
+
overflow: "hidden",
|
|
1155
|
+
padding: theme.space.s3,
|
|
1156
|
+
gap: theme.space.s2,
|
|
1157
|
+
backgroundColor: theme.color.surface,
|
|
1158
|
+
borderWidth: theme.borderWidth.base,
|
|
1159
|
+
borderColor: theme.color.border,
|
|
1160
|
+
...theme.shadow.md
|
|
1161
|
+
},
|
|
1162
|
+
widgetOutline: { backgroundColor: "transparent" },
|
|
1163
|
+
widgetTinted: { backgroundColor: theme.color.accentSoft },
|
|
1164
|
+
shadowNone: {
|
|
1165
|
+
shadowColor: "transparent",
|
|
1166
|
+
shadowOpacity: 0,
|
|
1167
|
+
shadowRadius: 0,
|
|
1168
|
+
shadowOffset: { width: 0, height: 0 },
|
|
1169
|
+
elevation: 0
|
|
1170
|
+
},
|
|
1171
|
+
shadowSm: { ...theme.shadow.sm },
|
|
1172
|
+
padSm: { padding: theme.space.s2 },
|
|
1173
|
+
padLg: { padding: theme.space.s4 },
|
|
1174
|
+
redacted: {
|
|
1175
|
+
color: "transparent",
|
|
1176
|
+
backgroundColor: theme.color.surface3,
|
|
1177
|
+
borderRadius: theme.radius.sm
|
|
1178
|
+
},
|
|
1179
|
+
glance: { gap: theme.space.s1 },
|
|
1180
|
+
readout: { gap: theme.space.s1, marginTop: "auto" },
|
|
1181
|
+
header: { flexDirection: "row", alignItems: "center", gap: theme.space.s1 },
|
|
1182
|
+
appName: {
|
|
1183
|
+
...theme.type.overline,
|
|
1184
|
+
flex: 1,
|
|
1185
|
+
fontFamily: theme.font.sans,
|
|
1186
|
+
color: theme.color.text3
|
|
1187
|
+
},
|
|
1188
|
+
// `subheadline`, not `title3`: two lines of a 20pt serif is 50pt of a 146pt
|
|
1189
|
+
// content box, which is what made the headline collide with the rows either
|
|
1190
|
+
// side of it. 15/20 is the smallest step that still reads as the glance's
|
|
1191
|
+
// headline, and two lines of it fit the family with room to spare.
|
|
1192
|
+
title: {
|
|
1193
|
+
fontFamily: theme.font.display,
|
|
1194
|
+
fontWeight: theme.font.displayWeight,
|
|
1195
|
+
fontSize: theme.type.subheadline.fontSize,
|
|
1196
|
+
lineHeight: theme.type.subheadline.lineHeight,
|
|
1197
|
+
letterSpacing: theme.type.subheadline.letterSpacing,
|
|
1198
|
+
color: theme.color.text
|
|
1199
|
+
},
|
|
1200
|
+
subtitle: {
|
|
1201
|
+
fontFamily: theme.font.sans,
|
|
1202
|
+
fontSize: theme.type.caption1.fontSize,
|
|
1203
|
+
lineHeight: theme.type.caption1.lineHeight,
|
|
1204
|
+
color: theme.color.text2
|
|
1205
|
+
},
|
|
1206
|
+
stats: { flexDirection: "row", gap: theme.space.s2 },
|
|
1207
|
+
statsWrap: { flexWrap: "wrap" },
|
|
1208
|
+
stat: {
|
|
1209
|
+
flexGrow: 1,
|
|
1210
|
+
flexBasis: 0,
|
|
1211
|
+
minWidth: theme.space.s8,
|
|
1212
|
+
paddingVertical: theme.space.s1,
|
|
1213
|
+
paddingHorizontal: theme.space.s2,
|
|
1214
|
+
backgroundColor: theme.color.surface2
|
|
1215
|
+
},
|
|
1216
|
+
statValue: {
|
|
1217
|
+
fontFamily: theme.font.sans,
|
|
1218
|
+
fontWeight: theme.fontWeight.bold,
|
|
1219
|
+
fontSize: theme.type.subheadline.fontSize,
|
|
1220
|
+
lineHeight: theme.type.subheadline.lineHeight,
|
|
1221
|
+
color: theme.color.text
|
|
1222
|
+
},
|
|
1223
|
+
statLabel: {
|
|
1224
|
+
fontFamily: theme.font.sans,
|
|
1225
|
+
fontSize: theme.type.caption2.fontSize,
|
|
1226
|
+
lineHeight: theme.type.caption2.lineHeight,
|
|
1227
|
+
color: theme.color.text3
|
|
1228
|
+
},
|
|
1229
|
+
caption: {
|
|
1230
|
+
fontFamily: theme.font.mono,
|
|
1231
|
+
fontSize: theme.type.caption2.fontSize,
|
|
1232
|
+
lineHeight: theme.type.caption2.lineHeight,
|
|
1233
|
+
color: theme.color.text3
|
|
1234
|
+
}
|
|
1235
|
+
}));
|
|
1236
|
+
var SHARE_TILE = 40;
|
|
1237
|
+
function ShareSheetPreview({
|
|
1238
|
+
fileName,
|
|
1239
|
+
fileMeta,
|
|
1240
|
+
icon = "filedoc",
|
|
1241
|
+
people = [],
|
|
1242
|
+
onPersonPress,
|
|
1243
|
+
actions = [],
|
|
1244
|
+
onActionPress,
|
|
1245
|
+
dismissible = false,
|
|
1246
|
+
onDismiss,
|
|
1247
|
+
size,
|
|
1248
|
+
side = "bottom",
|
|
1249
|
+
presentation = "sheet",
|
|
1250
|
+
labels: labelsProp
|
|
1251
|
+
}) {
|
|
1252
|
+
const { styles } = useStyles(sheet6);
|
|
1253
|
+
const labels = useLabels("osSurfaces", DEFAULT_LABELS, labelsProp);
|
|
1254
|
+
const theme = useLoamTheme("os-surfaces");
|
|
1255
|
+
const grabber = presentation === "inline" ? null : /* @__PURE__ */ jsx(View, { style: styles.grabber });
|
|
1256
|
+
const tile = osScale(SHARE_TILE, size);
|
|
1257
|
+
return /* @__PURE__ */ jsxs(
|
|
1258
|
+
View,
|
|
1259
|
+
{
|
|
1260
|
+
role: "group",
|
|
1261
|
+
accessibilityLabel: labels.shareSheetPreview,
|
|
1262
|
+
style: [styles.sheet, side === "top" ? styles.sheetTop : null],
|
|
1263
|
+
children: [
|
|
1264
|
+
side === "top" ? null : grabber,
|
|
1265
|
+
/* @__PURE__ */ jsxs(View, { style: styles.preview, children: [
|
|
1266
|
+
/* @__PURE__ */ jsx(
|
|
1267
|
+
View,
|
|
1268
|
+
{
|
|
1269
|
+
style: [
|
|
1270
|
+
styles.previewTile,
|
|
1271
|
+
size === void 0 ? null : { width: tile, height: tile }
|
|
1272
|
+
],
|
|
1273
|
+
children: /* @__PURE__ */ jsx(Icon, { name: icon, size: theme.icon.md, color: theme.color.accentOnSoft })
|
|
1274
|
+
}
|
|
1275
|
+
),
|
|
1276
|
+
/* @__PURE__ */ jsxs(View, { style: styles.previewMain, children: [
|
|
1277
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.previewTitle, osType(theme, size, "title")], numberOfLines: 1, children: fileName }),
|
|
1278
|
+
fileMeta ? /* @__PURE__ */ jsx(Text, { style: [styles.previewMeta, osType(theme, size, "meta")], numberOfLines: 1, children: fileMeta }) : null
|
|
1279
|
+
] }),
|
|
1280
|
+
dismissible ? /* @__PURE__ */ jsx(
|
|
1281
|
+
Pressable,
|
|
1282
|
+
{
|
|
1283
|
+
accessibilityRole: "button",
|
|
1284
|
+
accessibilityLabel: labels.dismiss,
|
|
1285
|
+
onPress: onDismiss,
|
|
1286
|
+
style: ({ pressed }) => [styles.close, pressed ? styles.pressed : null],
|
|
1287
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "x", size: theme.icon.sm, color: theme.color.text2 })
|
|
1288
|
+
}
|
|
1289
|
+
) : null
|
|
1290
|
+
] }),
|
|
1291
|
+
people.length > 0 ? /* @__PURE__ */ jsx(View, { style: styles.people, children: people.map((p) => /* @__PURE__ */ jsxs(
|
|
1292
|
+
Pressable,
|
|
1293
|
+
{
|
|
1294
|
+
accessibilityRole: "button",
|
|
1295
|
+
accessibilityLabel: labels.shareWith(p.name),
|
|
1296
|
+
onPress: onPersonPress ? () => onPersonPress(p.id) : void 0,
|
|
1297
|
+
style: ({ pressed }) => [styles.person, pressed ? styles.pressed : null],
|
|
1298
|
+
children: [
|
|
1299
|
+
/* @__PURE__ */ jsx(Avatar, { name: p.name, src: p.src, size: size === "sm" ? "lg" : "xl", accent: true }),
|
|
1300
|
+
/* @__PURE__ */ jsx(Text, { style: styles.personName, numberOfLines: 1, children: p.name.split(" ")[0] })
|
|
1301
|
+
]
|
|
1302
|
+
},
|
|
1303
|
+
p.id
|
|
1304
|
+
)) }) : null,
|
|
1305
|
+
actions.length > 0 ? /* @__PURE__ */ jsx(View, { style: styles.actions, children: actions.map((a, i) => /* @__PURE__ */ jsxs(
|
|
1306
|
+
Pressable,
|
|
1307
|
+
{
|
|
1308
|
+
accessibilityRole: "button",
|
|
1309
|
+
accessibilityLabel: a.label,
|
|
1310
|
+
onPress: onActionPress ? () => onActionPress(a.id) : void 0,
|
|
1311
|
+
style: ({ pressed }) => [
|
|
1312
|
+
styles.actionRow,
|
|
1313
|
+
i > 0 ? styles.actionRowDivided : null,
|
|
1314
|
+
pressed ? styles.pressed : null
|
|
1315
|
+
],
|
|
1316
|
+
children: [
|
|
1317
|
+
a.icon ? /* @__PURE__ */ jsx(Icon, { name: a.icon, size: theme.icon.md, color: theme.color.text2 }) : null,
|
|
1318
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.actionLabel, osType(theme, size, "body")], children: a.label })
|
|
1319
|
+
]
|
|
1320
|
+
},
|
|
1321
|
+
a.id
|
|
1322
|
+
)) }) : null,
|
|
1323
|
+
side === "top" ? grabber : null
|
|
1324
|
+
]
|
|
1325
|
+
}
|
|
1326
|
+
);
|
|
1327
|
+
}
|
|
1328
|
+
function TextSelectionMenu({
|
|
1329
|
+
items,
|
|
1330
|
+
onItemPress,
|
|
1331
|
+
platform,
|
|
1332
|
+
dismissible = false,
|
|
1333
|
+
onDismiss,
|
|
1334
|
+
density,
|
|
1335
|
+
size,
|
|
1336
|
+
selected = false,
|
|
1337
|
+
side,
|
|
1338
|
+
labels: labelsProp
|
|
1339
|
+
}) {
|
|
1340
|
+
const { styles } = useStyles(sheet6);
|
|
1341
|
+
const theme = useLoamTheme("os-surfaces");
|
|
1342
|
+
const labels = useLabels("osSurfaces", DEFAULT_LABELS, labelsProp);
|
|
1343
|
+
const resolved = platform ?? (isAndroidIdiom(theme) ? "Android" : "iOS");
|
|
1344
|
+
const ios = resolved === "iOS";
|
|
1345
|
+
const rowPad = density === "compact" ? { paddingVertical: theme.space.s2 } : density === "comfortable" ? { paddingVertical: theme.space.s3 } : null;
|
|
1346
|
+
const labelSize = size === "sm" ? theme.type.caption1 : size === "lg" ? theme.type.subheadline : null;
|
|
1347
|
+
const labelStyle = labelSize ? { fontSize: labelSize.fontSize, lineHeight: labelSize.lineHeight } : null;
|
|
1348
|
+
const menu = /* @__PURE__ */ jsxs(
|
|
1349
|
+
View,
|
|
1350
|
+
{
|
|
1351
|
+
accessibilityRole: "menu",
|
|
1352
|
+
accessibilityLabel: labels.textSelectionMenu,
|
|
1353
|
+
accessibilityState: selected ? { selected: true } : void 0,
|
|
1354
|
+
style: [styles.menu, ios ? styles.menuIOS : styles.menuAndroid],
|
|
1355
|
+
children: [
|
|
1356
|
+
selected ? /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: styles.menuSelected }) : null,
|
|
1357
|
+
items.map((item, i) => /* @__PURE__ */ jsx(
|
|
1358
|
+
Pressable,
|
|
1359
|
+
{
|
|
1360
|
+
accessibilityRole: "menuitem",
|
|
1361
|
+
accessibilityLabel: item.label,
|
|
1362
|
+
onPress: onItemPress ? () => onItemPress(item.id) : void 0,
|
|
1363
|
+
style: ({ pressed }) => [
|
|
1364
|
+
styles.menuItem,
|
|
1365
|
+
rowPad,
|
|
1366
|
+
i > 0 ? styles.menuItemDivided : null,
|
|
1367
|
+
pressed ? styles.pressed : null
|
|
1368
|
+
],
|
|
1369
|
+
children: /* @__PURE__ */ jsx(
|
|
1370
|
+
Text,
|
|
1371
|
+
{
|
|
1372
|
+
style: [
|
|
1373
|
+
styles.menuLabel,
|
|
1374
|
+
ios ? styles.menuLabelIOS : styles.menuLabelAndroid,
|
|
1375
|
+
labelStyle
|
|
1376
|
+
],
|
|
1377
|
+
children: item.label
|
|
1378
|
+
}
|
|
1379
|
+
)
|
|
1380
|
+
},
|
|
1381
|
+
item.id
|
|
1382
|
+
)),
|
|
1383
|
+
dismissible ? /* @__PURE__ */ jsx(
|
|
1384
|
+
Pressable,
|
|
1385
|
+
{
|
|
1386
|
+
accessibilityRole: "menuitem",
|
|
1387
|
+
accessibilityLabel: labels.dismiss,
|
|
1388
|
+
onPress: onDismiss,
|
|
1389
|
+
style: ({ pressed }) => [
|
|
1390
|
+
styles.menuItem,
|
|
1391
|
+
rowPad,
|
|
1392
|
+
items.length > 0 ? styles.menuItemDivided : null,
|
|
1393
|
+
pressed ? styles.pressed : null
|
|
1394
|
+
],
|
|
1395
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "x", size: theme.icon.sm, color: ios ? theme.color.bg : theme.color.text })
|
|
1396
|
+
}
|
|
1397
|
+
) : null
|
|
1398
|
+
]
|
|
1399
|
+
}
|
|
1400
|
+
);
|
|
1401
|
+
if (!side) return menu;
|
|
1402
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.menuHost, testID: `edit-menu-arrow-${side}`, children: [
|
|
1403
|
+
/* @__PURE__ */ jsx(
|
|
1404
|
+
View,
|
|
1405
|
+
{
|
|
1406
|
+
"aria-hidden": true,
|
|
1407
|
+
pointerEvents: "none",
|
|
1408
|
+
style: [
|
|
1409
|
+
styles.menuArrow,
|
|
1410
|
+
ios ? styles.menuArrowIOS : styles.menuArrowAndroid,
|
|
1411
|
+
side === "top" ? styles.menuArrowTop : side === "bottom" ? styles.menuArrowBottom : side === "left" ? styles.menuArrowLeft : styles.menuArrowRight
|
|
1412
|
+
]
|
|
1413
|
+
}
|
|
1414
|
+
),
|
|
1415
|
+
menu
|
|
1416
|
+
] });
|
|
1417
|
+
}
|
|
1418
|
+
var sheet6 = createStyleSheet((theme) => ({
|
|
1419
|
+
// ---- share sheet ----
|
|
1420
|
+
sheet: {
|
|
1421
|
+
// A sheet's top corners are `radius['2xl']` per the reference; the bottom two are
|
|
1422
|
+
// square because it is anchored to the screen edge.
|
|
1423
|
+
borderTopLeftRadius: theme.radius["2xl"],
|
|
1424
|
+
borderTopRightRadius: theme.radius["2xl"],
|
|
1425
|
+
backgroundColor: theme.color.surface,
|
|
1426
|
+
padding: theme.space.s4,
|
|
1427
|
+
gap: theme.space.s4,
|
|
1428
|
+
// Anchored to the screen edge with no scrim of its own: `edge.neutral` is
|
|
1429
|
+
// what draws the sheet once high contrast zeroes the elevation, and it is
|
|
1430
|
+
// `transparent` before that.
|
|
1431
|
+
borderTopWidth: theme.borderWidth.base,
|
|
1432
|
+
borderTopColor: theme.edge.neutral,
|
|
1433
|
+
...theme.shadow.lg
|
|
1434
|
+
},
|
|
1435
|
+
// Anchored to the top edge: the rounded corners and the rule flip to the bottom.
|
|
1436
|
+
sheetTop: {
|
|
1437
|
+
borderTopLeftRadius: 0,
|
|
1438
|
+
borderTopRightRadius: 0,
|
|
1439
|
+
borderTopWidth: 0,
|
|
1440
|
+
borderBottomLeftRadius: theme.radius["2xl"],
|
|
1441
|
+
borderBottomRightRadius: theme.radius["2xl"],
|
|
1442
|
+
borderBottomWidth: theme.borderWidth.base,
|
|
1443
|
+
borderBottomColor: theme.edge.neutral
|
|
1444
|
+
},
|
|
1445
|
+
grabber: {
|
|
1446
|
+
alignSelf: "center",
|
|
1447
|
+
width: SHEET_GRABBER_W,
|
|
1448
|
+
// `sheetGrabber` is fixed at 5 and is deliberately not scaled by density.
|
|
1449
|
+
height: theme.layout.sheetGrabber,
|
|
1450
|
+
borderRadius: theme.radius.full,
|
|
1451
|
+
backgroundColor: theme.color.surface3
|
|
1452
|
+
},
|
|
1453
|
+
preview: { flexDirection: "row", alignItems: "center", gap: theme.space.s3 },
|
|
1454
|
+
previewTile: {
|
|
1455
|
+
width: SHARE_TILE,
|
|
1456
|
+
height: SHARE_TILE,
|
|
1457
|
+
borderRadius: theme.radius.md,
|
|
1458
|
+
alignItems: "center",
|
|
1459
|
+
justifyContent: "center",
|
|
1460
|
+
backgroundColor: theme.color.accentSoft,
|
|
1461
|
+
borderWidth: theme.borderWidth.base,
|
|
1462
|
+
borderColor: theme.edge.accent
|
|
1463
|
+
},
|
|
1464
|
+
previewMain: { flex: 1, minWidth: 0, gap: theme.space.s1 },
|
|
1465
|
+
previewTitle: {
|
|
1466
|
+
fontFamily: theme.font.sans,
|
|
1467
|
+
fontWeight: theme.type.headline.fontWeight,
|
|
1468
|
+
fontSize: theme.type.headline.fontSize,
|
|
1469
|
+
lineHeight: theme.type.headline.lineHeight,
|
|
1470
|
+
letterSpacing: theme.type.headline.letterSpacing,
|
|
1471
|
+
color: theme.color.text
|
|
1472
|
+
},
|
|
1473
|
+
previewMeta: {
|
|
1474
|
+
fontFamily: theme.font.sans,
|
|
1475
|
+
fontSize: theme.type.footnote.fontSize,
|
|
1476
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
1477
|
+
color: theme.color.text3
|
|
1478
|
+
},
|
|
1479
|
+
people: { flexDirection: "row", gap: theme.space.s4, overflow: "hidden" },
|
|
1480
|
+
person: { alignItems: "center", gap: theme.space.s1, maxWidth: theme.space.s8 },
|
|
1481
|
+
personName: {
|
|
1482
|
+
fontFamily: theme.font.sans,
|
|
1483
|
+
fontSize: theme.type.caption2.fontSize,
|
|
1484
|
+
lineHeight: theme.type.caption2.lineHeight,
|
|
1485
|
+
color: theme.color.text2
|
|
1486
|
+
},
|
|
1487
|
+
actions: {
|
|
1488
|
+
borderRadius: theme.radius.md,
|
|
1489
|
+
backgroundColor: theme.color.surface2,
|
|
1490
|
+
overflow: "hidden"
|
|
1491
|
+
},
|
|
1492
|
+
actionRow: {
|
|
1493
|
+
flexDirection: "row",
|
|
1494
|
+
alignItems: "center",
|
|
1495
|
+
gap: theme.space.s3,
|
|
1496
|
+
minHeight: theme.tapMin,
|
|
1497
|
+
paddingHorizontal: theme.space.s3
|
|
1498
|
+
},
|
|
1499
|
+
actionRowDivided: {
|
|
1500
|
+
borderTopWidth: theme.borderWidth.base,
|
|
1501
|
+
borderTopColor: theme.color.border
|
|
1502
|
+
},
|
|
1503
|
+
actionLabel: {
|
|
1504
|
+
flex: 1,
|
|
1505
|
+
fontFamily: theme.font.sans,
|
|
1506
|
+
fontWeight: theme.fontWeight.semibold,
|
|
1507
|
+
fontSize: theme.type.subheadline.fontSize,
|
|
1508
|
+
lineHeight: theme.type.subheadline.lineHeight,
|
|
1509
|
+
color: theme.color.text
|
|
1510
|
+
},
|
|
1511
|
+
pressed: { opacity: theme.state.pressedOpacity },
|
|
1512
|
+
close: {
|
|
1513
|
+
width: theme.tapMin,
|
|
1514
|
+
height: theme.tapMin,
|
|
1515
|
+
alignItems: "center",
|
|
1516
|
+
justifyContent: "center"
|
|
1517
|
+
},
|
|
1518
|
+
// ---- system edit menu ----
|
|
1519
|
+
menu: {
|
|
1520
|
+
flexDirection: "row",
|
|
1521
|
+
alignSelf: "flex-start",
|
|
1522
|
+
overflow: "hidden",
|
|
1523
|
+
...theme.shadow.lg
|
|
1524
|
+
},
|
|
1525
|
+
// iOS: dark chrome at the system callout's own tight radius (OS-mandated, not a
|
|
1526
|
+
// Loam radius step) — the menu has to look like the OS's, not ours.
|
|
1527
|
+
menuIOS: { backgroundColor: theme.color.text, borderRadius: IOS_EDIT_MENU_RADIUS },
|
|
1528
|
+
// Android: a Material menu surface, which *is* a Loam radius.
|
|
1529
|
+
menuAndroid: { backgroundColor: theme.color.surface, borderRadius: theme.radius.md },
|
|
1530
|
+
menuItem: {
|
|
1531
|
+
minHeight: theme.tapMin,
|
|
1532
|
+
justifyContent: "center",
|
|
1533
|
+
paddingHorizontal: theme.space.s3
|
|
1534
|
+
},
|
|
1535
|
+
// A grey with enough contrast on both the dark iOS chrome and the light Android
|
|
1536
|
+
// surface — the OS's own separator, not a Loam border token.
|
|
1537
|
+
menuItemDivided: {
|
|
1538
|
+
borderStartWidth: theme.borderWidth.base,
|
|
1539
|
+
borderStartColor: OS_MATERIAL.divider
|
|
1540
|
+
},
|
|
1541
|
+
menuLabel: {
|
|
1542
|
+
fontFamily: theme.font.sans,
|
|
1543
|
+
fontWeight: theme.fontWeight.semibold,
|
|
1544
|
+
fontSize: theme.type.footnote.fontSize,
|
|
1545
|
+
lineHeight: theme.type.footnote.lineHeight
|
|
1546
|
+
},
|
|
1547
|
+
menuSelected: { ...StyleSheet.absoluteFillObject, backgroundColor: theme.state.selected },
|
|
1548
|
+
// The callout arrow: a rotated square in the menu's own fill, half of it
|
|
1549
|
+
// tucked behind the menu so only the point shows.
|
|
1550
|
+
menuHost: { alignSelf: "flex-start" },
|
|
1551
|
+
menuArrow: {
|
|
1552
|
+
position: "absolute",
|
|
1553
|
+
width: theme.space.s2,
|
|
1554
|
+
height: theme.space.s2,
|
|
1555
|
+
transform: [{ rotate: "45deg" }]
|
|
1556
|
+
},
|
|
1557
|
+
menuArrowIOS: { backgroundColor: theme.color.text },
|
|
1558
|
+
menuArrowAndroid: { backgroundColor: theme.color.surface },
|
|
1559
|
+
menuArrowTop: { top: -theme.space.s1, start: "50%", marginStart: -theme.space.s1 },
|
|
1560
|
+
menuArrowBottom: { bottom: -theme.space.s1, start: "50%", marginStart: -theme.space.s1 },
|
|
1561
|
+
menuArrowLeft: { start: -theme.space.s1, top: "50%", marginTop: -theme.space.s1 },
|
|
1562
|
+
menuArrowRight: { end: -theme.space.s1, top: "50%", marginTop: -theme.space.s1 },
|
|
1563
|
+
menuLabelIOS: { color: theme.color.bg },
|
|
1564
|
+
menuLabelAndroid: { color: theme.color.text }
|
|
1565
|
+
}));
|
|
1566
|
+
|
|
1567
|
+
export { AppIconPreview, LaunchScreenPreview, LiveActivityPreview, LockScreenNotification, LockScreenPreview, NotificationBanner, ShareSheetPreview, TextSelectionMenu, WidgetPreview };
|