@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
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLabels } from './chunk-APCWFOZW.js';
|
|
2
|
+
import { Icon } from './chunk-PCEFCOLN.js';
|
|
3
|
+
import { useResolvedMotion, springConfig } from './chunk-J64KGCGX.js';
|
|
2
4
|
import * as React from 'react';
|
|
3
|
-
import { View, Text, Pressable,
|
|
5
|
+
import { Animated, View, Text, Pressable, Platform, Easing, PanResponder } from 'react-native';
|
|
4
6
|
import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
|
|
5
7
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
6
8
|
|
|
@@ -19,29 +21,62 @@ var SEVERITY_DURATION = {
|
|
|
19
21
|
function severityColors(theme, severity) {
|
|
20
22
|
switch (severity) {
|
|
21
23
|
case "success":
|
|
22
|
-
return {
|
|
24
|
+
return {
|
|
25
|
+
accent: theme.color.good,
|
|
26
|
+
glyph: theme.color.goodOnSoft,
|
|
27
|
+
soft: theme.color.goodSoft,
|
|
28
|
+
edge: theme.edge.good
|
|
29
|
+
};
|
|
23
30
|
case "warning":
|
|
24
|
-
return {
|
|
31
|
+
return {
|
|
32
|
+
accent: theme.color.warn,
|
|
33
|
+
glyph: theme.color.warnOnSoft,
|
|
34
|
+
soft: theme.color.warnSoft,
|
|
35
|
+
edge: theme.edge.warn
|
|
36
|
+
};
|
|
25
37
|
case "error":
|
|
26
38
|
return {
|
|
39
|
+
accent: theme.color.danger,
|
|
27
40
|
glyph: theme.color.dangerOnSoft,
|
|
28
41
|
soft: theme.color.dangerSoft,
|
|
29
42
|
edge: theme.edge.danger
|
|
30
43
|
};
|
|
31
44
|
default:
|
|
32
|
-
return {
|
|
45
|
+
return {
|
|
46
|
+
accent: theme.color.info,
|
|
47
|
+
glyph: theme.color.infoOnSoft,
|
|
48
|
+
soft: theme.color.infoSoft,
|
|
49
|
+
edge: theme.edge.info
|
|
50
|
+
};
|
|
33
51
|
}
|
|
34
52
|
}
|
|
53
|
+
var DEFAULT_LABELS = {
|
|
54
|
+
dismiss: "Dismiss"
|
|
55
|
+
};
|
|
35
56
|
function ToastCard({
|
|
36
57
|
message,
|
|
58
|
+
description,
|
|
37
59
|
severity = "info",
|
|
38
60
|
action,
|
|
39
61
|
countdown,
|
|
40
|
-
onPress
|
|
62
|
+
onPress,
|
|
63
|
+
labels: labelsProp,
|
|
64
|
+
platform,
|
|
65
|
+
variant = "default",
|
|
66
|
+
size = "md",
|
|
67
|
+
dismissible = true,
|
|
68
|
+
motion = "full"
|
|
41
69
|
}) {
|
|
70
|
+
const labels = useLabels("toast", DEFAULT_LABELS, labelsProp);
|
|
42
71
|
const { styles } = useStyles(sheet);
|
|
43
|
-
const theme = useLoamTheme();
|
|
72
|
+
const theme = useLoamTheme("toast");
|
|
44
73
|
const colors = severityColors(theme, severity);
|
|
74
|
+
const level = useResolvedMotion(motion, "toast");
|
|
75
|
+
const pressScale = React.useRef(new Animated.Value(1)).current;
|
|
76
|
+
const pressTo = (to) => {
|
|
77
|
+
if (level !== "full") return;
|
|
78
|
+
Animated.spring(pressScale, { toValue: to, ...springConfig(theme, "fs"), useNativeDriver: true }).start();
|
|
79
|
+
};
|
|
45
80
|
const actionHitSlop = Math.max(0, Math.round((theme.tapMin - theme.ctl.sm) / 2));
|
|
46
81
|
const copy = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
47
82
|
/* @__PURE__ */ jsx(
|
|
@@ -50,41 +85,97 @@ function ToastCard({
|
|
|
50
85
|
style: [styles.disc, { backgroundColor: colors.soft, borderColor: colors.edge }],
|
|
51
86
|
accessibilityElementsHidden: true,
|
|
52
87
|
importantForAccessibility: "no-hide-descendants",
|
|
53
|
-
children: /* @__PURE__ */ jsx(Icon, { name: SEVERITY_ICON[severity], size: theme.
|
|
88
|
+
children: /* @__PURE__ */ jsx(Icon, { name: SEVERITY_ICON[severity], size: theme.space[18], color: colors.glyph })
|
|
54
89
|
}
|
|
55
90
|
),
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/* @__PURE__ */ jsxs(View, { style: styles.body, children: [
|
|
60
|
-
onPress ? /* @__PURE__ */ jsx(
|
|
61
|
-
Pressable,
|
|
62
|
-
{
|
|
63
|
-
accessibilityRole: "button",
|
|
64
|
-
accessibilityLabel: "Dismiss",
|
|
65
|
-
onPress,
|
|
66
|
-
style: styles.copyRegion,
|
|
67
|
-
children: copy
|
|
68
|
-
}
|
|
69
|
-
) : /* @__PURE__ */ jsx(View, { style: styles.copyRegion, children: copy }),
|
|
70
|
-
action ? /* @__PURE__ */ jsx(
|
|
71
|
-
Pressable,
|
|
91
|
+
/* @__PURE__ */ jsxs(View, { style: styles.textCol, children: [
|
|
92
|
+
/* @__PURE__ */ jsx(
|
|
93
|
+
Text,
|
|
72
94
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
children: /* @__PURE__ */ jsx(Text, { style: styles.actionLabel, children: action.label })
|
|
95
|
+
style: [
|
|
96
|
+
styles.message,
|
|
97
|
+
isAndroid(theme, platform) && { fontWeight: theme.fontWeight.regular }
|
|
98
|
+
],
|
|
99
|
+
children: message
|
|
79
100
|
}
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
|
|
101
|
+
),
|
|
102
|
+
description ? /* @__PURE__ */ jsx(Text, { style: styles.description, children: description }) : null
|
|
103
|
+
] })
|
|
83
104
|
] });
|
|
105
|
+
return (
|
|
106
|
+
// No start bar (F8): the disc carries the tone, its edge in high contrast.
|
|
107
|
+
/* @__PURE__ */ jsxs(
|
|
108
|
+
Animated.View,
|
|
109
|
+
{
|
|
110
|
+
style: [
|
|
111
|
+
styles.card,
|
|
112
|
+
variant === "soft" ? { backgroundColor: colors.soft, borderColor: colors.edge } : null,
|
|
113
|
+
onPress && level === "full" ? { transform: [{ scale: pressScale }] } : null
|
|
114
|
+
],
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsxs(
|
|
117
|
+
View,
|
|
118
|
+
{
|
|
119
|
+
style: [
|
|
120
|
+
styles.body,
|
|
121
|
+
size === "compact" ? { paddingVertical: theme.space.s2 } : null,
|
|
122
|
+
countdown ? styles.bodyTimed : null
|
|
123
|
+
],
|
|
124
|
+
children: [
|
|
125
|
+
onPress ? /* @__PURE__ */ jsx(
|
|
126
|
+
Pressable,
|
|
127
|
+
{
|
|
128
|
+
accessibilityRole: "button",
|
|
129
|
+
accessibilityLabel: description ? `${message}. ${description}` : message,
|
|
130
|
+
onPress,
|
|
131
|
+
onPressIn: () => pressTo(PRESS_SCALE),
|
|
132
|
+
onPressOut: () => pressTo(1),
|
|
133
|
+
style: styles.copyRegion,
|
|
134
|
+
children: copy
|
|
135
|
+
}
|
|
136
|
+
) : /* @__PURE__ */ jsx(View, { style: styles.copyRegion, children: copy }),
|
|
137
|
+
action ? /* @__PURE__ */ jsx(
|
|
138
|
+
Pressable,
|
|
139
|
+
{
|
|
140
|
+
accessibilityRole: "button",
|
|
141
|
+
accessibilityLabel: action.label,
|
|
142
|
+
onPress: action.onPress,
|
|
143
|
+
hitSlop: actionHitSlop,
|
|
144
|
+
style: ({ pressed }) => [styles.action, pressed && styles.actionPressed],
|
|
145
|
+
children: /* @__PURE__ */ jsx(Text, { style: styles.actionLabel, children: action.label })
|
|
146
|
+
}
|
|
147
|
+
) : null,
|
|
148
|
+
onPress && dismissible ? /* @__PURE__ */ jsx(
|
|
149
|
+
Pressable,
|
|
150
|
+
{
|
|
151
|
+
accessibilityRole: "button",
|
|
152
|
+
accessibilityLabel: labels.dismiss,
|
|
153
|
+
onPress,
|
|
154
|
+
hitSlop: Math.max(0, Math.round((theme.tapMin - theme.space[26]) / 2)),
|
|
155
|
+
style: ({ pressed }) => [styles.dismiss, pressed && styles.actionPressed],
|
|
156
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "x", size: theme.space[16], color: theme.color.text3 })
|
|
157
|
+
}
|
|
158
|
+
) : null
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
countdown ? /* @__PURE__ */ jsx(View, { style: styles.countdownTrack, children: countdown }) : null
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
var PRESS_SCALE = 0.98;
|
|
169
|
+
function isAndroid(theme, platform) {
|
|
170
|
+
if (platform) return platform === "android";
|
|
171
|
+
if (Platform.OS === "android") return true;
|
|
172
|
+
if (Platform.OS === "ios") return false;
|
|
173
|
+
return theme.platform === "Android";
|
|
84
174
|
}
|
|
85
175
|
var TRAVEL = 12;
|
|
86
176
|
function Toast({
|
|
87
177
|
message,
|
|
178
|
+
description,
|
|
88
179
|
severity = "info",
|
|
89
180
|
action,
|
|
90
181
|
open = true,
|
|
@@ -92,10 +183,19 @@ function Toast({
|
|
|
92
183
|
onDismiss,
|
|
93
184
|
countdown = false,
|
|
94
185
|
motion = "full",
|
|
95
|
-
safeAreaTop = 0
|
|
186
|
+
safeAreaTop = 0,
|
|
187
|
+
safeAreaBottom = 0,
|
|
188
|
+
platform,
|
|
189
|
+
labels,
|
|
190
|
+
variant,
|
|
191
|
+
size,
|
|
192
|
+
dismissible
|
|
96
193
|
}) {
|
|
97
|
-
const theme = useLoamTheme();
|
|
194
|
+
const theme = useLoamTheme("toast");
|
|
98
195
|
const { styles } = useStyles(sheet);
|
|
196
|
+
const android = isAndroid(theme, platform);
|
|
197
|
+
const androidRef = React.useRef(android);
|
|
198
|
+
androidRef.current = android;
|
|
99
199
|
const reduced = theme.reduceMotion || motion === "reduced";
|
|
100
200
|
const instant = motion === "none";
|
|
101
201
|
const offset = reduced || instant ? 0 : TRAVEL;
|
|
@@ -173,13 +273,14 @@ function Toast({
|
|
|
173
273
|
const pan = React.useRef(
|
|
174
274
|
// eslint-disable-next-line loam/no-pan-responder
|
|
175
275
|
PanResponder.create({
|
|
176
|
-
onMoveShouldSetPanResponder: (_e, g) => g.dy < -2 && Math.abs(g.dy) > Math.abs(g.dx),
|
|
276
|
+
onMoveShouldSetPanResponder: (_e, g) => androidRef.current ? Math.abs(g.dx) > 2 && Math.abs(g.dx) > Math.abs(g.dy) : g.dy < -2 && Math.abs(g.dy) > Math.abs(g.dx),
|
|
177
277
|
onPanResponderMove: (_e, g) => {
|
|
178
|
-
const
|
|
179
|
-
progress.setValue(Math.max(0, 1 +
|
|
278
|
+
const travel = androidRef.current ? -Math.abs(g.dx) : Math.min(0, g.dy);
|
|
279
|
+
progress.setValue(Math.max(0, 1 + travel / 80));
|
|
180
280
|
},
|
|
181
281
|
onPanResponderRelease: (_e, g) => {
|
|
182
|
-
|
|
282
|
+
const past = androidRef.current ? Math.abs(g.dx) > 32 || Math.abs(g.vx) > 0.5 : g.dy < -32 || g.vy < -0.5;
|
|
283
|
+
if (past) {
|
|
183
284
|
requestDismiss();
|
|
184
285
|
} else {
|
|
185
286
|
Animated.timing(progress, {
|
|
@@ -194,7 +295,7 @@ function Toast({
|
|
|
194
295
|
).current;
|
|
195
296
|
const translateY = progress.interpolate({
|
|
196
297
|
inputRange: [0, 1],
|
|
197
|
-
outputRange: [-offset, 0]
|
|
298
|
+
outputRange: [android ? offset : -offset, 0]
|
|
198
299
|
});
|
|
199
300
|
const bar = showCountdown ? /* @__PURE__ */ jsx(
|
|
200
301
|
Animated.View,
|
|
@@ -202,7 +303,7 @@ function Toast({
|
|
|
202
303
|
style: [
|
|
203
304
|
styles.countdownBar,
|
|
204
305
|
{
|
|
205
|
-
backgroundColor: severityColors(theme, severity).
|
|
306
|
+
backgroundColor: severityColors(theme, severity).accent,
|
|
206
307
|
transform: [{ translateX: countdownX }]
|
|
207
308
|
}
|
|
208
309
|
]
|
|
@@ -211,7 +312,7 @@ function Toast({
|
|
|
211
312
|
return /* @__PURE__ */ jsx(
|
|
212
313
|
View,
|
|
213
314
|
{
|
|
214
|
-
style: [styles.root, { paddingTop: safeAreaTop + theme.space.s2 }],
|
|
315
|
+
style: android ? [styles.root, styles.rootBottom, { paddingBottom: safeAreaBottom + theme.space.s4 }] : [styles.root, { paddingTop: safeAreaTop + theme.space.s2 }],
|
|
215
316
|
pointerEvents: "box-none",
|
|
216
317
|
children: /* @__PURE__ */ jsx(
|
|
217
318
|
Animated.View,
|
|
@@ -226,10 +327,17 @@ function Toast({
|
|
|
226
327
|
ToastCard,
|
|
227
328
|
{
|
|
228
329
|
message,
|
|
330
|
+
description,
|
|
229
331
|
severity,
|
|
230
332
|
action,
|
|
231
333
|
countdown: bar,
|
|
232
|
-
onPress: requestDismiss
|
|
334
|
+
onPress: requestDismiss,
|
|
335
|
+
labels,
|
|
336
|
+
platform: android ? "android" : "ios",
|
|
337
|
+
variant,
|
|
338
|
+
size,
|
|
339
|
+
dismissible,
|
|
340
|
+
motion
|
|
233
341
|
}
|
|
234
342
|
)
|
|
235
343
|
}
|
|
@@ -244,6 +352,7 @@ var nextId = () => `loam-toast-${++idCounter}`;
|
|
|
244
352
|
function ToastProvider({
|
|
245
353
|
children,
|
|
246
354
|
safeAreaTop = 0,
|
|
355
|
+
safeAreaBottom = 0,
|
|
247
356
|
motion = "full"
|
|
248
357
|
}) {
|
|
249
358
|
const [queue, setQueue] = React.useState([]);
|
|
@@ -305,12 +414,17 @@ function ToastProvider({
|
|
|
305
414
|
{
|
|
306
415
|
open: current.open,
|
|
307
416
|
message: current.message,
|
|
417
|
+
description: current.description,
|
|
308
418
|
severity: current.severity,
|
|
309
419
|
action: current.action,
|
|
310
420
|
duration: current.duration,
|
|
311
421
|
countdown: current.countdown,
|
|
422
|
+
variant: current.variant,
|
|
423
|
+
size: current.size,
|
|
424
|
+
dismissible: current.dismissible,
|
|
312
425
|
motion,
|
|
313
426
|
safeAreaTop,
|
|
427
|
+
safeAreaBottom,
|
|
314
428
|
onDismiss: () => close(current.id)
|
|
315
429
|
},
|
|
316
430
|
current.id
|
|
@@ -324,6 +438,9 @@ function useToast() {
|
|
|
324
438
|
}
|
|
325
439
|
return ctx;
|
|
326
440
|
}
|
|
441
|
+
function useOptionalToast() {
|
|
442
|
+
return React.useContext(ToastContext);
|
|
443
|
+
}
|
|
327
444
|
var TOAST_MAX_W = 480;
|
|
328
445
|
var sheet = createStyleSheet((theme) => ({
|
|
329
446
|
// Full-bleed top overlay; `box-none` so touches pass through the empty gutters.
|
|
@@ -336,14 +453,15 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
336
453
|
paddingHorizontal: theme.space.s4,
|
|
337
454
|
alignItems: "center"
|
|
338
455
|
},
|
|
456
|
+
rootBottom: { top: void 0, bottom: 0 },
|
|
339
457
|
animated: {
|
|
340
458
|
width: "100%",
|
|
341
459
|
maxWidth: TOAST_MAX_W
|
|
342
460
|
},
|
|
343
461
|
// The surface card. `overflow: hidden` clips the countdown bar to the radius.
|
|
344
462
|
card: {
|
|
345
|
-
borderRadius: theme.radius.
|
|
346
|
-
borderWidth: theme.borderWidth.
|
|
463
|
+
borderRadius: theme.radius.md,
|
|
464
|
+
borderWidth: theme.borderWidth.thin,
|
|
347
465
|
borderColor: theme.color.border,
|
|
348
466
|
backgroundColor: theme.color.surface,
|
|
349
467
|
overflow: "hidden",
|
|
@@ -354,8 +472,11 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
354
472
|
alignItems: "center",
|
|
355
473
|
gap: theme.space.s3,
|
|
356
474
|
paddingVertical: theme.space.s3,
|
|
357
|
-
|
|
475
|
+
paddingStart: theme.space.s3,
|
|
476
|
+
paddingEnd: theme.space[6]
|
|
358
477
|
},
|
|
478
|
+
// The timer line sits 6 above the edge; the card owes it 16 below.
|
|
479
|
+
bodyTimed: { paddingBottom: theme.space[16] },
|
|
359
480
|
// The tap-to-dismiss region: icon + message. `flex: 1` lets it absorb the
|
|
360
481
|
// width so the action sits flush at the trailing edge.
|
|
361
482
|
copyRegion: {
|
|
@@ -369,43 +490,64 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
369
490
|
width: theme.space[32],
|
|
370
491
|
height: theme.space[32],
|
|
371
492
|
borderRadius: theme.radius.full,
|
|
372
|
-
borderWidth: theme.borderWidth.
|
|
493
|
+
borderWidth: theme.borderWidth.thin,
|
|
373
494
|
alignItems: "center",
|
|
374
495
|
justifyContent: "center"
|
|
375
496
|
},
|
|
376
497
|
// `flex: 1` + `minWidth: 0` lets the message wrap instead of shoving the action off-card.
|
|
377
498
|
message: {
|
|
378
|
-
flex: 1,
|
|
379
|
-
minWidth: 0,
|
|
380
499
|
fontFamily: theme.font.sans,
|
|
381
|
-
|
|
500
|
+
fontWeight: theme.fontWeight.bold,
|
|
501
|
+
fontSize: theme.fontSize[14],
|
|
382
502
|
lineHeight: theme.type.subheadline.lineHeight,
|
|
383
503
|
color: theme.color.text
|
|
384
504
|
},
|
|
505
|
+
textCol: { flex: 1, minWidth: 0, gap: theme.space[2] },
|
|
506
|
+
description: {
|
|
507
|
+
fontFamily: theme.font.sans,
|
|
508
|
+
fontSize: theme.fontSize[13],
|
|
509
|
+
lineHeight: theme.type.footnote.lineHeight,
|
|
510
|
+
color: theme.color.text2
|
|
511
|
+
},
|
|
512
|
+
dismiss: {
|
|
513
|
+
width: theme.ctl.xs,
|
|
514
|
+
height: theme.ctl.xs,
|
|
515
|
+
borderRadius: theme.ctl.r.xs,
|
|
516
|
+
alignItems: "center",
|
|
517
|
+
justifyContent: "center"
|
|
518
|
+
},
|
|
519
|
+
// A ghost sm Button: ctl.sm tall, r sm, state-hover on press.
|
|
385
520
|
action: {
|
|
386
521
|
flexShrink: 0,
|
|
387
|
-
|
|
388
|
-
|
|
522
|
+
minHeight: theme.ctl.sm,
|
|
523
|
+
justifyContent: "center",
|
|
524
|
+
paddingHorizontal: theme.space[10],
|
|
389
525
|
borderRadius: theme.radius.sm
|
|
390
526
|
},
|
|
527
|
+
actionPressed: { backgroundColor: theme.state.hover },
|
|
391
528
|
actionLabel: {
|
|
392
529
|
fontFamily: theme.font.sans,
|
|
393
|
-
fontWeight: theme.fontWeight.
|
|
530
|
+
fontWeight: theme.fontWeight.semibold,
|
|
394
531
|
fontSize: theme.type.footnote.fontSize,
|
|
395
532
|
color: theme.color.accentStrong
|
|
396
533
|
},
|
|
534
|
+
// A 2 px tone line, inset 12 / 6 on a surface-3 track, so nothing runs along
|
|
535
|
+
// the rounded edge (G13 S1).
|
|
397
536
|
countdownTrack: {
|
|
398
537
|
position: "absolute",
|
|
399
|
-
bottom:
|
|
400
|
-
start:
|
|
401
|
-
end:
|
|
402
|
-
height: theme.space[
|
|
538
|
+
bottom: theme.space[6],
|
|
539
|
+
start: theme.space[12],
|
|
540
|
+
end: theme.space[12],
|
|
541
|
+
height: theme.space[2],
|
|
542
|
+
borderRadius: theme.radius.full,
|
|
543
|
+
backgroundColor: theme.color.surface3,
|
|
403
544
|
overflow: "hidden"
|
|
404
545
|
},
|
|
405
546
|
countdownBar: {
|
|
406
547
|
width: "100%",
|
|
407
|
-
height: theme.space[
|
|
548
|
+
height: theme.space[2],
|
|
549
|
+
borderRadius: theme.radius.full
|
|
408
550
|
}
|
|
409
551
|
}));
|
|
410
552
|
|
|
411
|
-
export { SEVERITY_DURATION, Toast, ToastCard, ToastProvider, useToast };
|
|
553
|
+
export { SEVERITY_DURATION, Toast, ToastCard, ToastProvider, useOptionalToast, useToast };
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isAndroidIdiom } from './chunk-TH4PW2WU.js';
|
|
2
|
+
import { useLabels } from './chunk-APCWFOZW.js';
|
|
3
|
+
import { Icon } from './chunk-PCEFCOLN.js';
|
|
2
4
|
import * as React from 'react';
|
|
3
|
-
import { Animated, Easing, Pressable, View, Text, AccessibilityInfo } from 'react-native';
|
|
5
|
+
import { Animated, Easing, Pressable, View, ActivityIndicator, Text, AccessibilityInfo } from 'react-native';
|
|
4
6
|
import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
|
|
5
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
8
|
|
|
9
|
+
var DEFAULT_LABELS = {
|
|
10
|
+
copy: "Copy",
|
|
11
|
+
copied: "Copied"
|
|
12
|
+
};
|
|
7
13
|
function CopyButton({
|
|
8
14
|
onCopy,
|
|
9
15
|
label,
|
|
@@ -11,13 +17,22 @@ function CopyButton({
|
|
|
11
17
|
size = "sm",
|
|
12
18
|
timeout = 2e3,
|
|
13
19
|
motion = "full",
|
|
14
|
-
accessibilityLabel
|
|
20
|
+
accessibilityLabel,
|
|
21
|
+
disabled = false,
|
|
22
|
+
fullWidth = false,
|
|
23
|
+
tone = "neutral",
|
|
24
|
+
loading = false,
|
|
25
|
+
leading,
|
|
26
|
+
trailing,
|
|
27
|
+
labels: labelsProp
|
|
15
28
|
}) {
|
|
29
|
+
const labels = useLabels("copyButton", DEFAULT_LABELS, labelsProp);
|
|
16
30
|
const { styles } = useStyles(sheet, { variant, size });
|
|
17
|
-
const theme = useLoamTheme();
|
|
18
|
-
const fg = theme.color.text;
|
|
31
|
+
const theme = useLoamTheme("copy-button");
|
|
32
|
+
const fg = tone === "accent" ? theme.color.accentStrong : tone === "good" ? theme.color.goodOnSoft : tone === "warn" ? theme.color.warnOnSoft : tone === "danger" ? theme.color.danger : theme.color.text;
|
|
19
33
|
const iconSize = theme.ctl.icon[size];
|
|
20
34
|
const slop = Math.max(0, (theme.hit[size] - theme.ctl[size]) / 2);
|
|
35
|
+
const android = isAndroidIdiom(theme);
|
|
21
36
|
const reduced = theme.reduceMotion || motion === "reduced" || motion === "none";
|
|
22
37
|
const [copied, setCopied] = React.useState(false);
|
|
23
38
|
const timer = React.useRef();
|
|
@@ -43,9 +58,10 @@ function CopyButton({
|
|
|
43
58
|
bounciness: 6
|
|
44
59
|
}).start();
|
|
45
60
|
const handlePress = () => {
|
|
61
|
+
if (loading) return;
|
|
46
62
|
onCopy?.();
|
|
47
63
|
setCopied(true);
|
|
48
|
-
AccessibilityInfo.announceForAccessibility(
|
|
64
|
+
AccessibilityInfo.announceForAccessibility(labels.copied);
|
|
49
65
|
clearTimeout(timer.current);
|
|
50
66
|
timer.current = setTimeout(() => setCopied(false), timeout);
|
|
51
67
|
};
|
|
@@ -58,38 +74,58 @@ function CopyButton({
|
|
|
58
74
|
Pressable,
|
|
59
75
|
{
|
|
60
76
|
accessibilityRole: "button",
|
|
61
|
-
accessibilityLabel: accessibilityLabel ?? label ??
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
77
|
+
accessibilityLabel: accessibilityLabel ?? label ?? labels.copy,
|
|
78
|
+
accessibilityState: { disabled, busy: loading },
|
|
79
|
+
"aria-disabled": disabled || void 0,
|
|
80
|
+
disabled,
|
|
81
|
+
onPress: disabled ? void 0 : handlePress,
|
|
82
|
+
onPressIn: disabled || android ? void 0 : () => press(0.97),
|
|
83
|
+
onPressOut: disabled || android ? void 0 : () => press(1),
|
|
65
84
|
hitSlop: { top: slop, bottom: slop, left: slop, right: slop },
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
android_ripple: android && !disabled ? { color: theme.state.pressed, borderless: false, foreground: true } : void 0,
|
|
86
|
+
style: [
|
|
87
|
+
android ? { borderRadius: theme.ctl.r[size], overflow: "hidden" } : null,
|
|
88
|
+
fullWidth ? { alignSelf: "stretch" } : null
|
|
89
|
+
],
|
|
90
|
+
children: /* @__PURE__ */ jsxs(
|
|
91
|
+
Animated.View,
|
|
92
|
+
{
|
|
93
|
+
style: [
|
|
94
|
+
styles.base,
|
|
95
|
+
{ transform: [{ scale: pressScale }] },
|
|
96
|
+
disabled ? { opacity: theme.state.disabledOpacity } : null
|
|
97
|
+
],
|
|
98
|
+
children: [
|
|
99
|
+
leading,
|
|
100
|
+
/* @__PURE__ */ jsx(View, { style: glyphBox, children: loading ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: fg, accessibilityLabel: "Loading" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
101
|
+
/* @__PURE__ */ jsx(
|
|
102
|
+
Animated.View,
|
|
103
|
+
{
|
|
104
|
+
testID: "copy-glyph",
|
|
105
|
+
style: [
|
|
106
|
+
styles.glyph,
|
|
107
|
+
reduced ? { opacity: copied ? 0 : 1 } : { opacity: copyOpacity, transform: [{ scale: copyScale }] }
|
|
108
|
+
],
|
|
109
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "copy", size: iconSize, color: fg })
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ jsx(
|
|
113
|
+
Animated.View,
|
|
114
|
+
{
|
|
115
|
+
testID: "check-glyph",
|
|
116
|
+
style: [
|
|
117
|
+
styles.glyph,
|
|
118
|
+
reduced ? { opacity: copied ? 1 : 0 } : { opacity: checkOpacity, transform: [{ scale: checkScale }] }
|
|
119
|
+
],
|
|
120
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "check", size: iconSize, color: fg })
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] }) }),
|
|
124
|
+
label ? /* @__PURE__ */ jsx(Text, { style: [styles.label, { color: fg }], children: label }) : null,
|
|
125
|
+
trailing
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
)
|
|
93
129
|
}
|
|
94
130
|
);
|
|
95
131
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|