@btndprojects/loam-ui-native 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion/index.js +4 -2
- package/dist/adaptive/index.js +12 -2
- package/dist/address-block/index.js +23 -0
- package/dist/alert/index.js +5 -2
- package/dist/analyzer/index.js +13 -5
- package/dist/announcement/index.js +15 -5
- package/dist/appearance-picker/index.js +15 -0
- package/dist/audio-player/index.js +26 -2
- package/dist/avatar/index.js +2 -2
- package/dist/avatar-group/index.js +5 -3
- package/dist/badge/index.js +6 -3
- package/dist/banner/index.js +3 -2
- package/dist/board/index.js +13 -6
- package/dist/button/index.js +6 -3
- package/dist/camera-permission/index.js +19 -11
- package/dist/capture-result/index.js +26 -16
- package/dist/card/index.js +7 -3
- package/dist/card-form/index.js +15 -9
- package/dist/carousel/index.js +3 -1
- package/dist/chart/index.js +15 -5
- package/dist/charts/index.js +18 -5
- package/dist/chat/index.js +35 -10
- package/dist/checkbox/index.js +6 -4
- package/dist/checklist/index.js +16 -7
- package/dist/checkout/index.js +25 -12
- package/dist/chip/index.js +7 -4
- package/dist/chunk-2BZD3NAP.js +1110 -0
- package/dist/chunk-2YKVID2V.js +35 -0
- package/dist/{chunk-H7DWSL4O.js → chunk-36DA3IPO.js} +115 -27
- package/dist/chunk-3A56MIAN.js +599 -0
- package/dist/{chunk-AEB7KCHQ.js → chunk-3SCKCWF5.js} +39 -28
- package/dist/chunk-3TZNDHKO.js +187 -0
- package/dist/chunk-43K3BLXV.js +9 -0
- package/dist/chunk-46ZJIQ2Z.js +208 -0
- package/dist/{chunk-PMMTGBBS.js → chunk-4CZMQDQL.js} +75 -22
- package/dist/chunk-4QCR3K2J.js +1 -0
- package/dist/{chunk-E2E3I5W2.js → chunk-5DTKORLI.js} +54 -45
- package/dist/{chunk-5VFZRGVD.js → chunk-5J4WFXFA.js} +32 -15
- package/dist/{chunk-JBMLWFSJ.js → chunk-5KJ7TEQ6.js} +83 -48
- package/dist/chunk-5NU33TXK.js +529 -0
- package/dist/chunk-6KSUS7DF.js +690 -0
- package/dist/{chunk-3WEZCGHX.js → chunk-6RV6UW2J.js} +140 -56
- package/dist/chunk-6RZM7RP2.js +520 -0
- package/dist/{chunk-JJLPBRVZ.js → chunk-75BDCC7K.js} +2 -0
- package/dist/{chunk-U5NLHYV6.js → chunk-7CGJBQUA.js} +333 -22
- package/dist/{chunk-I4FHVKEC.js → chunk-7IVF6JLJ.js} +16 -5
- package/dist/chunk-7IWCGXYA.js +143 -0
- package/dist/chunk-7LM4ASFH.js +172 -0
- package/dist/chunk-7MCEJFWV.js +341 -0
- package/dist/{chunk-2SY63FCH.js → chunk-7NGMUVNU.js} +66 -30
- package/dist/chunk-7PBSIXT7.js +355 -0
- package/dist/chunk-7QOYGENL.js +443 -0
- package/dist/{chunk-TDMG26JI.js → chunk-A7SWYDE5.js} +40 -9
- package/dist/chunk-ADHPJALR.js +3051 -0
- package/dist/{chunk-ZLTO5VQI.js → chunk-ALJYZLNQ.js} +131 -61
- package/dist/{chunk-GDKVKNR2.js → chunk-AQ5FIG74.js} +110 -30
- package/dist/chunk-B2MMZZQB.js +426 -0
- package/dist/{chunk-QYPE5JX3.js → chunk-B7JZ3N5G.js} +142 -105
- package/dist/{chunk-QHTVYA65.js → chunk-BL37SW6G.js} +388 -102
- package/dist/chunk-BTRMA7GC.js +21 -0
- package/dist/{chunk-FUMHAAF3.js → chunk-C7IUWIUZ.js} +243 -92
- package/dist/chunk-CA3DUVYD.js +10 -0
- package/dist/{chunk-FYWNRX4F.js → chunk-CBCJSO2B.js} +143 -13
- package/dist/chunk-CHPX4MFI.js +239 -0
- package/dist/chunk-CLGAMIOT.js +648 -0
- package/dist/chunk-CUE7VML6.js +1141 -0
- package/dist/{chunk-D5N5QWI7.js → chunk-CVU6S2E5.js} +497 -235
- package/dist/{chunk-U23FYWME.js → chunk-CXPQMA6Z.js} +101 -34
- package/dist/{chunk-36EC2T6P.js → chunk-D2LN4I7I.js} +1 -1
- package/dist/{chunk-TLCIR6RG.js → chunk-D34LNBO5.js} +411 -155
- package/dist/{chunk-FV6HMP7W.js → chunk-D4BCQICM.js} +207 -65
- package/dist/chunk-EABKIIA4.js +1 -0
- package/dist/chunk-EICSYRAG.js +341 -0
- package/dist/chunk-EMWAJMAS.js +83 -0
- package/dist/chunk-EOLZWRV6.js +149 -0
- package/dist/chunk-EOQVTGB6.js +350 -0
- package/dist/{chunk-ZVATDZOM.js → chunk-ESGUHNB2.js} +106 -28
- package/dist/{chunk-46MMSDGL.js → chunk-F2KNBPKY.js} +104 -73
- package/dist/{chunk-KQZ3GLHR.js → chunk-G7H3NX3G.js} +40 -17
- package/dist/{chunk-3QMEOFW5.js → chunk-GM7YIPB7.js} +421 -207
- package/dist/{chunk-QHAITQIF.js → chunk-GVQQG435.js} +256 -86
- package/dist/chunk-HE43OMEL.js +1056 -0
- package/dist/{chunk-XIDTBCBA.js → chunk-HHOMFQ7R.js} +1049 -207
- package/dist/chunk-HNAKS4Z3.js +207 -0
- package/dist/chunk-HP6ST2OW.js +352 -0
- package/dist/chunk-HW3OWDTU.js +1 -0
- package/dist/{chunk-QP3KMOVF.js → chunk-HZDB44K4.js} +24 -14
- package/dist/chunk-I6CUP2LW.js +1155 -0
- package/dist/chunk-ICV4Y2WY.js +27 -0
- package/dist/chunk-IHSIENOE.js +3950 -0
- package/dist/{chunk-T5LTPKX6.js → chunk-IMMALLRU.js} +53 -25
- package/dist/{chunk-C4GTDLRC.js → chunk-JA6TK7H2.js} +154 -67
- package/dist/{chunk-EVOIGUBI.js → chunk-JAVZ5JPV.js} +43 -13
- package/dist/{chunk-CPTOADB2.js → chunk-JCMTP3E4.js} +527 -201
- package/dist/{chunk-OJQUBQWA.js → chunk-JCXFFK64.js} +73 -16
- package/dist/{chunk-V2OEB75Z.js → chunk-JWCVBFDU.js} +75 -35
- package/dist/chunk-JXRTD5RI.js +414 -0
- package/dist/chunk-JYIUZUIQ.js +1567 -0
- package/dist/chunk-K3TK3GIV.js +219 -0
- package/dist/chunk-KEVZIHM2.js +1511 -0
- package/dist/{chunk-VAOAKWUK.js → chunk-KHZDNQQD.js} +42 -8
- package/dist/chunk-KL4GDV4V.js +131 -0
- package/dist/{chunk-Q6NKEPRE.js → chunk-KNILMM4H.js} +73 -28
- package/dist/chunk-KRBUZV45.js +25 -0
- package/dist/{chunk-7BUIKDD6.js → chunk-KXLDK6HB.js} +91 -30
- package/dist/chunk-KZ3X7TSL.js +196 -0
- package/dist/{chunk-5UTRIXQ6.js → chunk-L2WMOA2V.js} +187 -43
- package/dist/chunk-L4D5LHCH.js +109 -0
- package/dist/{chunk-W63AJTM7.js → chunk-LAUJPLDB.js} +236 -71
- package/dist/{chunk-TN2ZNJUI.js → chunk-LGNTP5XA.js} +47 -13
- package/dist/chunk-LUZFCCSD.js +271 -0
- package/dist/{chunk-XTORZWRF.js → chunk-LXJCP4PL.js} +111 -30
- package/dist/chunk-MCOZJWPU.js +731 -0
- package/dist/{chunk-SATMR6SG.js → chunk-MG4SKWLL.js} +780 -142
- package/dist/{chunk-JUYWSSKW.js → chunk-MPEPTSER.js} +95 -16
- package/dist/chunk-MWPJ4YGP.js +1 -0
- package/dist/{chunk-LUMVGO2K.js → chunk-N7AX4OA4.js} +80 -29
- package/dist/chunk-NHSLM6SE.js +523 -0
- package/dist/{chunk-IT6FUXXG.js → chunk-NNJLVA7M.js} +43 -11
- package/dist/{chunk-TQVAIKFD.js → chunk-NZG75DGA.js} +102 -62
- package/dist/chunk-O76QXRBV.js +431 -0
- package/dist/chunk-OANH27AK.js +223 -0
- package/dist/chunk-OCHPK5YV.js +609 -0
- package/dist/chunk-OMHVEVX4.js +436 -0
- package/dist/{chunk-SWS5JQIF.js → chunk-ONKQUJWD.js} +187 -60
- package/dist/chunk-OVTK7A6T.js +615 -0
- package/dist/{chunk-UXGIW7OK.js → chunk-PCEFCOLN.js} +5 -1
- package/dist/{chunk-QIKT7LIB.js → chunk-PFLNFIVB.js} +91 -23
- package/dist/chunk-PHSZY37H.js +300 -0
- package/dist/chunk-PJLTKDVY.js +18 -0
- package/dist/{chunk-SHHY5OMK.js → chunk-PK7BN3MI.js} +83 -15
- package/dist/{chunk-YXOAPXMU.js → chunk-PWFRDRGS.js} +101 -14
- package/dist/{chunk-TY4MTKQJ.js → chunk-PYPMD46W.js} +332 -66
- package/dist/chunk-Q6CCHDI7.js +331 -0
- package/dist/chunk-QFA5WS2A.js +750 -0
- package/dist/chunk-QJMMM4RC.js +124 -0
- package/dist/chunk-QYWEVAM6.js +407 -0
- package/dist/chunk-R5T4VZ7Z.js +126 -0
- package/dist/chunk-R77HFLZD.js +1 -0
- package/dist/{chunk-LMPHCVJJ.js → chunk-RAESDNU5.js} +162 -68
- package/dist/chunk-RBYQUXNL.js +1 -0
- package/dist/chunk-RCM3DT5E.js +1 -0
- package/dist/chunk-RGNY56L7.js +282 -0
- package/dist/chunk-RIK6UX2K.js +344 -0
- package/dist/{chunk-5LAAAXFP.js → chunk-RJA3RXO3.js} +63 -54
- package/dist/chunk-RJYRJ3LD.js +1 -0
- package/dist/chunk-RMA3NOY4.js +599 -0
- package/dist/{chunk-VDPK5CY4.js → chunk-RSWKKAHK.js} +143 -61
- package/dist/{chunk-B7N4ASYE.js → chunk-RVOIIX3V.js} +17 -45
- package/dist/chunk-SA2RRBGT.js +1077 -0
- package/dist/{chunk-7OVVSVEZ.js → chunk-SG3J4R45.js} +440 -169
- package/dist/chunk-SPUK7JD4.js +238 -0
- package/dist/chunk-SWXV2K5N.js +434 -0
- package/dist/chunk-SYJEPXP6.js +1303 -0
- package/dist/{chunk-LKFC4CS7.js → chunk-SZLI34TA.js} +18 -9
- package/dist/{chunk-NBEF4EPJ.js → chunk-T77WJA74.js} +131 -16
- package/dist/chunk-TDWWVJA4.js +630 -0
- package/dist/chunk-TFHI5XDR.js +610 -0
- package/dist/chunk-TH4PW2WU.js +17 -0
- package/dist/chunk-TTQ24HQX.js +12 -0
- package/dist/chunk-TUACVJNG.js +12 -0
- package/dist/{chunk-F5B3UINI.js → chunk-TUL5RUIA.js} +171 -62
- package/dist/{chunk-C6APNDVA.js → chunk-TYOSA7JG.js} +63 -34
- package/dist/chunk-TYQTMMEV.js +1 -0
- package/dist/{chunk-DW3L54DQ.js → chunk-TZO6YDS7.js} +53 -12
- package/dist/{chunk-67IZZ2MJ.js → chunk-U3ETF22F.js} +75 -30
- package/dist/{chunk-EDCBJV7J.js → chunk-U6BYHD2N.js} +87 -31
- package/dist/{chunk-ENP3BMZU.js → chunk-UF6EJXPQ.js} +16 -1
- package/dist/{chunk-IPUNJMAQ.js → chunk-UNNQIPGK.js} +304 -68
- package/dist/chunk-UQVO6AJV.js +171 -0
- package/dist/{chunk-FZGAAOKS.js → chunk-VFDQAAIW.js} +138 -32
- package/dist/chunk-VIUE3VQT.js +1 -0
- package/dist/{chunk-5RENVKBQ.js → chunk-VJLSSSGC.js} +126 -30
- package/dist/chunk-VLMT6KYT.js +350 -0
- package/dist/chunk-VMHGBUGS.js +35 -0
- package/dist/{chunk-4IZXHVFJ.js → chunk-VQKPBYW6.js} +228 -172
- package/dist/{chunk-G6UESEVN.js → chunk-VSSTWLC5.js} +49 -11
- package/dist/{chunk-TRGFFU6A.js → chunk-VZYYZRPN.js} +866 -330
- package/dist/{chunk-JLC6PM5S.js → chunk-WAIJCD2V.js} +128 -54
- package/dist/chunk-WFMQ3WKM.js +378 -0
- package/dist/chunk-WJ2KDRMY.js +66 -0
- package/dist/chunk-WKFZJO54.js +437 -0
- package/dist/{chunk-QEYFDRHR.js → chunk-WVVD3XOV.js} +146 -84
- package/dist/chunk-XAIWMSLB.js +1 -0
- package/dist/chunk-XBXUBBJZ.js +98 -0
- package/dist/chunk-XCU7MYBJ.js +1 -0
- package/dist/chunk-XHE4PGCI.js +717 -0
- package/dist/chunk-XRSJ32M3.js +331 -0
- package/dist/chunk-XTCVOEAW.js +1 -0
- package/dist/chunk-XWGXVQF6.js +58 -0
- package/dist/{chunk-MKSNFG7H.js → chunk-Y3XKKO5K.js} +191 -109
- package/dist/chunk-Y4QNMBLO.js +533 -0
- package/dist/chunk-Y5H4CTKO.js +1 -0
- package/dist/chunk-YBQIN75A.js +403 -0
- package/dist/{chunk-PNF3NKB5.js → chunk-YJ5PXOX3.js} +28 -11
- package/dist/{chunk-M656FYNH.js → chunk-YLRSRUPS.js} +63 -49
- package/dist/chunk-YM6MPJ4A.js +1 -0
- package/dist/chunk-YV7KZENV.js +200 -0
- package/dist/chunk-Z7I4ZSO6.js +316 -0
- package/dist/{chunk-EY4DD67D.js → chunk-ZIRMWD2B.js} +199 -126
- package/dist/chunk-ZPMG3FWU.js +75 -0
- package/dist/{chunk-QRUMA22E.js → chunk-ZTXMK2G7.js} +92 -43
- package/dist/{chunk-2OLKPG4E.js → chunk-ZVJCWXAL.js} +189 -87
- package/dist/{chunk-YAAHPATV.js → chunk-ZYQ23DPT.js} +49 -34
- package/dist/coachmark/index.js +7 -3
- package/dist/code-block/index.js +4 -3
- package/dist/color-field/index.js +12 -4
- package/dist/color-picker/index.js +23 -0
- package/dist/commerce/index.js +27 -16
- package/dist/confirm/index.js +31 -0
- package/dist/connection-card/index.js +34 -0
- package/dist/connectivity/index.js +3 -2
- package/dist/context-menu/index.js +10 -2
- package/dist/copy-button/index.js +3 -2
- package/dist/data-grid/index.js +30 -17
- package/dist/date-range-picker/index.js +19 -9
- package/dist/description-list/index.js +4 -1
- package/dist/device-frame/index.js +30 -0
- package/dist/dialog/index.js +8 -2
- package/dist/divider/index.js +2 -0
- package/dist/empty-state/index.js +13 -2
- package/dist/error-summary/index.js +7 -2
- package/dist/fab/index.js +4 -2
- package/dist/file-manager/index.js +33 -17
- package/dist/file-upload/index.js +12 -6
- package/dist/filter-bar/index.js +10 -6
- package/dist/flow-run/index.js +19 -12
- package/dist/form/index.js +30 -3
- package/dist/gallery/index.js +5 -2
- package/dist/hold-to-confirm/index.js +4 -2
- package/dist/hover-card/index.js +18 -0
- package/dist/icon-tile/index.js +10 -0
- package/dist/image/index.js +9 -0
- package/dist/index.d.ts +29826 -17941
- package/dist/index.js +197 -141
- package/dist/infinite-list/index.js +4 -2
- package/dist/inline-edit/index.js +5 -4
- package/dist/input/index.js +4 -3
- package/dist/interactions/index.js +4 -1
- package/dist/invoice/index.js +18 -9
- package/dist/job-row/index.js +22 -0
- package/dist/json-inspector/index.js +20 -0
- package/dist/kbd/index.js +2 -2
- package/dist/keyboard/index.js +7 -2
- package/dist/level-meter/index.js +9 -0
- package/dist/list-row/index.js +11 -3
- package/dist/log-viewer/index.js +9 -2
- package/dist/map-view/index.js +13 -2
- package/dist/markdown/index.js +8 -5
- package/dist/metric/index.js +6 -3
- package/dist/metric-strip/index.js +12 -0
- package/dist/money/index.js +11 -4
- package/dist/nav-drawer/index.js +6 -2
- package/dist/nav-header/index.js +10 -4
- package/dist/navigation/index.js +29 -2
- package/dist/notification-center/index.js +24 -10
- package/dist/number-roll/index.js +3 -1
- package/dist/onboarding-pager/index.js +22 -0
- package/dist/one-handed/index.js +2 -2
- package/dist/os-surfaces/index.js +6 -3
- package/dist/otp/index.js +5 -4
- package/dist/page-header/index.js +2 -1
- package/dist/pagination/index.js +4 -2
- package/dist/payment-method/index.js +17 -11
- package/dist/payment-status/index.js +22 -14
- package/dist/permission/index.js +18 -2
- package/dist/picker/index.js +17 -6
- package/dist/progress/index.js +7 -2
- package/dist/provenance/index.js +16 -0
- package/dist/pull-to-refresh/index.js +2 -2
- package/dist/qr-code/index.js +16 -0
- package/dist/query-builder/index.js +30 -0
- package/dist/radio-group/index.js +6 -4
- package/dist/rating/index.js +7 -2
- package/dist/receivables/index.js +31 -18
- package/dist/recording-indicator/index.js +21 -0
- package/dist/refund/index.js +24 -15
- package/dist/repeatable-rows/index.js +19 -0
- package/dist/save-status/index.js +5 -3
- package/dist/screen/index.js +3 -0
- package/dist/scroll-area/index.js +1 -1
- package/dist/search-field/index.js +8 -3
- package/dist/secret-field/index.js +19 -0
- package/dist/section-header/index.js +4 -0
- package/dist/segmented-control/index.js +2 -2
- package/dist/sheet/index.js +9 -3
- package/dist/shortcuts-sheet/index.js +2 -0
- package/dist/sign-in-screen/index.js +25 -0
- package/dist/skeleton/index.js +3 -1
- package/dist/slider/index.js +2 -1
- package/dist/sortable/index.js +4 -3
- package/dist/spinner/index.js +2 -1
- package/dist/split-button/index.js +17 -5
- package/dist/spotlight/index.js +7 -1
- package/dist/stack/index.js +2 -0
- package/dist/stage-timeline/index.js +6 -3
- package/dist/status-dot/index.js +6 -2
- package/dist/stepper/index.js +7 -3
- package/dist/streaming-text/index.js +2 -1
- package/dist/survey/index.js +24 -14
- package/dist/switch/index.js +6 -2
- package/dist/system-state/index.js +12 -4
- package/dist/tab-bar/index.js +10 -2
- package/dist/tabs/index.js +10 -2
- package/dist/tags-input/index.js +8 -5
- package/dist/text/index.js +4 -0
- package/dist/textarea/index.js +5 -4
- package/dist/thinking/index.js +4 -1
- package/dist/tile-rail/index.js +10 -0
- package/dist/time-field/index.js +15 -7
- package/dist/time-range-control/index.js +26 -12
- package/dist/timeline/index.js +2 -2
- package/dist/toast/index.js +4 -2
- package/dist/toolbar/index.js +3 -2
- package/dist/tour/index.js +12 -10
- package/dist/transcript/index.js +28 -0
- package/dist/truncation-notice/index.js +2 -2
- package/dist/update-notice/index.js +15 -8
- package/dist/video-player/index.js +26 -2
- package/dist/viewfinder/index.js +12 -4
- package/dist/widget/index.js +11 -4
- package/dist/wizard/index.js +7 -4
- package/package.json +13 -13
- package/dist/chunk-2PKYGLQ6.js +0 -268
- package/dist/chunk-2SWKL3AJ.js +0 -466
- package/dist/chunk-2TXERVVA.js +0 -1081
- package/dist/chunk-3DUWIYV5.js +0 -437
- package/dist/chunk-3NMD74ZU.js +0 -4
- package/dist/chunk-4DS5ZWVC.js +0 -83
- package/dist/chunk-6YAQBXB3.js +0 -93
- package/dist/chunk-74FLKD24.js +0 -237
- package/dist/chunk-CMTVNF3D.js +0 -104
- package/dist/chunk-DN7MNQIP.js +0 -799
- package/dist/chunk-DVGBZ3TX.js +0 -455
- package/dist/chunk-F3H33DQX.js +0 -300
- package/dist/chunk-FAJI7BSC.js +0 -443
- package/dist/chunk-G3AFC24V.js +0 -60
- package/dist/chunk-HJLPZA4X.js +0 -369
- package/dist/chunk-HYEOQWT7.js +0 -647
- package/dist/chunk-IDM7JJMO.js +0 -110
- package/dist/chunk-IVKMZ7BB.js +0 -326
- package/dist/chunk-IXKWIFWZ.js +0 -334
- package/dist/chunk-JV5YOTOB.js +0 -164
- package/dist/chunk-KFJGFLMW.js +0 -158
- package/dist/chunk-LQP4KEXZ.js +0 -214
- package/dist/chunk-NTQ2F3AU.js +0 -257
- package/dist/chunk-O5V4TG3V.js +0 -329
- package/dist/chunk-OWAMM2DK.js +0 -280
- package/dist/chunk-PID3NJB7.js +0 -405
- package/dist/chunk-QDZGFXQD.js +0 -176
- package/dist/chunk-QPWDDJJ4.js +0 -385
- package/dist/chunk-ROCUG24E.js +0 -416
- package/dist/chunk-RU3ZPNL6.js +0 -1986
- package/dist/chunk-RXSCIO6W.js +0 -153
- package/dist/chunk-SKWO3SZF.js +0 -2284
- package/dist/chunk-UQGBTPXH.js +0 -218
- package/dist/chunk-UYGDJWMN.js +0 -273
- package/dist/chunk-W74TXYFB.js +0 -107
- package/dist/chunk-WRDSPUE7.js +0 -417
- package/dist/chunk-XBZGDDMR.js +0 -105
- package/dist/chunk-XN4KG3P4.js +0 -1040
- package/dist/chunk-XQXMLMH3.js +0 -211
- package/dist/chunk-ZECZOOSB.js +0 -245
- /package/dist/{chunk-VFCUIDRT.js → chunk-3BKLBYPK.js} +0 -0
- /package/dist/{chunk-GEIGMWNF.js → chunk-QNZII37O.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useLabels, useLoamLocale } from './chunk-APCWFOZW.js';
|
|
2
|
-
import { Icon } from './chunk-
|
|
2
|
+
import { Icon } from './chunk-PCEFCOLN.js';
|
|
3
3
|
import { useResolvedMotion } from './chunk-J64KGCGX.js';
|
|
4
|
-
import 'react';
|
|
4
|
+
import * as React from 'react';
|
|
5
5
|
import { View, Text, Pressable, LayoutAnimation } from 'react-native';
|
|
6
6
|
import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -10,7 +10,8 @@ var DEFAULT_LABELS = {
|
|
|
10
10
|
items: "items",
|
|
11
11
|
showing: (shown, total, noun) => `Showing ${shown} of ${total} ${noun}`,
|
|
12
12
|
showAllName: (total, noun) => `Show all ${total} ${noun}`,
|
|
13
|
-
showAll: (total) => `Show all ${total}
|
|
13
|
+
showAll: (total) => `Show all ${total}`,
|
|
14
|
+
dismiss: "Dismiss"
|
|
14
15
|
};
|
|
15
16
|
function TruncationNotice({
|
|
16
17
|
shown,
|
|
@@ -21,6 +22,10 @@ function TruncationNotice({
|
|
|
21
22
|
variant = "inline",
|
|
22
23
|
size = "md",
|
|
23
24
|
motion = "full",
|
|
25
|
+
tone = "neutral",
|
|
26
|
+
dismissible = false,
|
|
27
|
+
onDismiss,
|
|
28
|
+
icon,
|
|
24
29
|
labels: labelsProp
|
|
25
30
|
}) {
|
|
26
31
|
const labels = useLabels("truncationNotice", DEFAULT_LABELS, labelsProp);
|
|
@@ -29,13 +34,21 @@ function TruncationNotice({
|
|
|
29
34
|
const { styles } = useStyles(sheet, { variant, size });
|
|
30
35
|
const theme = useLoamTheme("truncation-notice");
|
|
31
36
|
const level = useResolvedMotion(motion, "truncation-notice");
|
|
32
|
-
|
|
37
|
+
const [dismissed, setDismissed] = React.useState(false);
|
|
38
|
+
if (shown >= total || dismissed) return null;
|
|
33
39
|
const totalText = total.toLocaleString(locale);
|
|
34
40
|
const message = labels.showing(shown.toLocaleString(locale), totalText, noun);
|
|
35
41
|
const iconSize = size === "sm" ? theme.icon.xs : theme.icon.sm;
|
|
36
42
|
const pad = variant === "bar" ? size === "sm" ? { paddingHorizontal: theme.space.s3, paddingVertical: theme.space.s2 } : { paddingHorizontal: theme.space.s4, paddingVertical: theme.space.s3 } : null;
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
const toned = tone === "neutral" ? null : {
|
|
44
|
+
ink: theme.color[`${tone}OnSoft`],
|
|
45
|
+
fill: theme.color[`${tone}Soft`],
|
|
46
|
+
edge: theme.edge[tone]
|
|
47
|
+
};
|
|
48
|
+
const barTone = toned && variant === "bar" ? { backgroundColor: toned.fill, borderTopColor: toned.edge } : null;
|
|
49
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.base, pad, barTone], children: [
|
|
50
|
+
icon ? /* @__PURE__ */ jsx(Icon, { name: icon, size: iconSize, color: toned?.ink ?? theme.color.text2 }) : null,
|
|
51
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.message, toned ? { color: toned.ink } : null], children: message }),
|
|
39
52
|
onShowAll ? /* @__PURE__ */ jsxs(
|
|
40
53
|
Pressable,
|
|
41
54
|
{
|
|
@@ -56,10 +69,31 @@ function TruncationNotice({
|
|
|
56
69
|
hitSlop: { top: theme.space.s2, bottom: theme.space.s2 },
|
|
57
70
|
style: ({ pressed }) => [styles.action, pressed ? styles.pressed : null],
|
|
58
71
|
children: [
|
|
59
|
-
/* @__PURE__ */ jsx(Text, { style: styles.actionLabel, children: labels.showAll(totalText) }),
|
|
60
|
-
actionIcon ? /* @__PURE__ */ jsx(
|
|
72
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.actionLabel, toned ? { color: toned.ink } : null], children: labels.showAll(totalText) }),
|
|
73
|
+
actionIcon ? /* @__PURE__ */ jsx(
|
|
74
|
+
Icon,
|
|
75
|
+
{
|
|
76
|
+
name: actionIcon,
|
|
77
|
+
size: iconSize,
|
|
78
|
+
color: toned?.ink ?? theme.color.accentStrong
|
|
79
|
+
}
|
|
80
|
+
) : null
|
|
61
81
|
]
|
|
62
82
|
}
|
|
83
|
+
) : null,
|
|
84
|
+
dismissible ? /* @__PURE__ */ jsx(
|
|
85
|
+
Pressable,
|
|
86
|
+
{
|
|
87
|
+
accessibilityRole: "button",
|
|
88
|
+
accessibilityLabel: labels.dismiss,
|
|
89
|
+
hitSlop: theme.space.s2,
|
|
90
|
+
onPress: () => {
|
|
91
|
+
setDismissed(true);
|
|
92
|
+
onDismiss?.();
|
|
93
|
+
},
|
|
94
|
+
style: ({ pressed }) => [pressed ? styles.pressed : null],
|
|
95
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "x", size: iconSize, color: toned?.ink ?? theme.color.text2 })
|
|
96
|
+
}
|
|
63
97
|
) : null
|
|
64
98
|
] });
|
|
65
99
|
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { NativeModules, NativeEventEmitter, Platform } from 'react-native';
|
|
3
|
+
|
|
4
|
+
// src/shortcuts-sheet/shortcuts-sheet.tsx
|
|
5
|
+
var IOS_MOD = {
|
|
6
|
+
cmd: "command",
|
|
7
|
+
command: "command",
|
|
8
|
+
meta: "command",
|
|
9
|
+
mod: "command",
|
|
10
|
+
shift: "shift",
|
|
11
|
+
alt: "alternate",
|
|
12
|
+
option: "alternate",
|
|
13
|
+
opt: "alternate",
|
|
14
|
+
ctrl: "control",
|
|
15
|
+
control: "control"
|
|
16
|
+
};
|
|
17
|
+
var ANDROID_MOD = {
|
|
18
|
+
cmd: "CTRL",
|
|
19
|
+
command: "CTRL",
|
|
20
|
+
mod: "CTRL",
|
|
21
|
+
ctrl: "CTRL",
|
|
22
|
+
control: "CTRL",
|
|
23
|
+
meta: "META",
|
|
24
|
+
shift: "SHIFT",
|
|
25
|
+
alt: "ALT",
|
|
26
|
+
option: "ALT",
|
|
27
|
+
opt: "ALT"
|
|
28
|
+
};
|
|
29
|
+
var IOS_KEY = {
|
|
30
|
+
up: "UIKeyInputUpArrow",
|
|
31
|
+
down: "UIKeyInputDownArrow",
|
|
32
|
+
left: "UIKeyInputLeftArrow",
|
|
33
|
+
right: "UIKeyInputRightArrow",
|
|
34
|
+
esc: "UIKeyInputEscape",
|
|
35
|
+
escape: "UIKeyInputEscape",
|
|
36
|
+
enter: "\r",
|
|
37
|
+
return: "\r",
|
|
38
|
+
tab: " ",
|
|
39
|
+
space: " ",
|
|
40
|
+
backspace: "\b"
|
|
41
|
+
};
|
|
42
|
+
var ANDROID_KEY = {
|
|
43
|
+
up: "KEYCODE_DPAD_UP",
|
|
44
|
+
down: "KEYCODE_DPAD_DOWN",
|
|
45
|
+
left: "KEYCODE_DPAD_LEFT",
|
|
46
|
+
right: "KEYCODE_DPAD_RIGHT",
|
|
47
|
+
esc: "KEYCODE_ESCAPE",
|
|
48
|
+
escape: "KEYCODE_ESCAPE",
|
|
49
|
+
enter: "KEYCODE_ENTER",
|
|
50
|
+
return: "KEYCODE_ENTER",
|
|
51
|
+
tab: "KEYCODE_TAB",
|
|
52
|
+
space: "KEYCODE_SPACE",
|
|
53
|
+
backspace: "KEYCODE_DEL",
|
|
54
|
+
",": "KEYCODE_COMMA",
|
|
55
|
+
".": "KEYCODE_PERIOD",
|
|
56
|
+
"/": "KEYCODE_SLASH",
|
|
57
|
+
";": "KEYCODE_SEMICOLON",
|
|
58
|
+
"[": "KEYCODE_LEFT_BRACKET",
|
|
59
|
+
"]": "KEYCODE_RIGHT_BRACKET",
|
|
60
|
+
"-": "KEYCODE_MINUS",
|
|
61
|
+
"=": "KEYCODE_EQUALS",
|
|
62
|
+
"+": "KEYCODE_PLUS"
|
|
63
|
+
};
|
|
64
|
+
function split(binding) {
|
|
65
|
+
if (/\s/.test(binding.trim())) return null;
|
|
66
|
+
const parts = binding.endsWith("++") ? [...binding.slice(0, -2).split("+"), "+"] : binding.split("+");
|
|
67
|
+
const key = parts.pop();
|
|
68
|
+
if (!key) return null;
|
|
69
|
+
return { mods: parts.map((m) => m.toLowerCase()), key };
|
|
70
|
+
}
|
|
71
|
+
function toKeyCommands(shortcuts) {
|
|
72
|
+
const out = [];
|
|
73
|
+
for (const s of shortcuts) {
|
|
74
|
+
const parsed = split(s.binding);
|
|
75
|
+
if (!parsed) continue;
|
|
76
|
+
const lower = parsed.key.toLowerCase();
|
|
77
|
+
out.push({
|
|
78
|
+
id: s.id,
|
|
79
|
+
input: IOS_KEY[lower] ?? (parsed.key.length === 1 ? lower : parsed.key),
|
|
80
|
+
modifierFlags: parsed.mods.flatMap((m) => IOS_MOD[m] ? [IOS_MOD[m]] : []),
|
|
81
|
+
discoverabilityTitle: s.label,
|
|
82
|
+
disabled: s.disabledReason !== void 0
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
function toKeyboardShortcutGroups(shortcuts, fallbackGroup = "General") {
|
|
88
|
+
const groups = /* @__PURE__ */ new Map();
|
|
89
|
+
for (const s of shortcuts) {
|
|
90
|
+
const parsed = split(s.binding);
|
|
91
|
+
if (!parsed) continue;
|
|
92
|
+
const lower = parsed.key.toLowerCase();
|
|
93
|
+
const keyCode = ANDROID_KEY[lower] ?? (/^[a-z0-9]$/.test(lower) ? `KEYCODE_${lower.toUpperCase()}` : `KEYCODE_${parsed.key.toUpperCase()}`);
|
|
94
|
+
const modifiers = [
|
|
95
|
+
...new Set(parsed.mods.flatMap((m) => ANDROID_MOD[m] ? [ANDROID_MOD[m]] : []))
|
|
96
|
+
];
|
|
97
|
+
const label = s.group ?? fallbackGroup;
|
|
98
|
+
const list = groups.get(label) ?? [];
|
|
99
|
+
list.push({
|
|
100
|
+
id: s.id,
|
|
101
|
+
label: s.label,
|
|
102
|
+
keyCode,
|
|
103
|
+
modifiers,
|
|
104
|
+
disabled: s.disabledReason !== void 0
|
|
105
|
+
});
|
|
106
|
+
groups.set(label, list);
|
|
107
|
+
}
|
|
108
|
+
return [...groups].map(([label, items]) => ({ label, items }));
|
|
109
|
+
}
|
|
110
|
+
function useKeyboardShortcuts(shortcuts, platform = Platform.OS === "android" ? "android" : "ios") {
|
|
111
|
+
const latest = React.useRef(shortcuts);
|
|
112
|
+
latest.current = shortcuts;
|
|
113
|
+
React.useEffect(() => {
|
|
114
|
+
const mod = NativeModules.LoamKeyCommands;
|
|
115
|
+
if (!mod) return;
|
|
116
|
+
if (platform === "android") mod.setShortcutGroups?.(toKeyboardShortcutGroups(shortcuts));
|
|
117
|
+
else mod.setKeyCommands?.(toKeyCommands(shortcuts));
|
|
118
|
+
}, [shortcuts, platform]);
|
|
119
|
+
React.useEffect(() => {
|
|
120
|
+
const mod = NativeModules.LoamKeyCommands;
|
|
121
|
+
if (!mod?.addListener) return;
|
|
122
|
+
const emitter = new NativeEventEmitter(mod);
|
|
123
|
+
const sub = emitter.addListener("onKeyCommand", (e) => {
|
|
124
|
+
const hit = latest.current.find((s) => s.id === e.id);
|
|
125
|
+
if (hit && hit.disabledReason === void 0) hit.run?.();
|
|
126
|
+
});
|
|
127
|
+
return () => sub.remove();
|
|
128
|
+
}, []);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { toKeyCommands, toKeyboardShortcutGroups, useKeyboardShortcuts };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldMessage } from './chunk-BTRMA7GC.js';
|
|
2
|
+
import { useColorTransition } from './chunk-KXLDK6HB.js';
|
|
2
3
|
import { haptics } from './chunk-NY2U3PBI.js';
|
|
3
|
-
import {
|
|
4
|
+
import { useFocusRing } from './chunk-2YKVID2V.js';
|
|
5
|
+
import { Icon } from './chunk-PCEFCOLN.js';
|
|
4
6
|
import { useResolvedMotion, springConfig } from './chunk-J64KGCGX.js';
|
|
5
7
|
import * as React from 'react';
|
|
6
8
|
import { Easing, Animated, Pressable, View, Text, Platform } from 'react-native';
|
|
@@ -10,6 +12,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
10
12
|
var BOX = { sm: 16, md: 24 };
|
|
11
13
|
var GLYPH = { sm: 12, md: 14 };
|
|
12
14
|
var CHECK_STROKE = 3.5;
|
|
15
|
+
var HALO = 44;
|
|
13
16
|
function nextChecked(current) {
|
|
14
17
|
return current === true ? false : true;
|
|
15
18
|
}
|
|
@@ -29,7 +32,10 @@ function Checkbox({
|
|
|
29
32
|
disabled = false,
|
|
30
33
|
motion = "full",
|
|
31
34
|
accessibilityLabel,
|
|
32
|
-
label
|
|
35
|
+
label,
|
|
36
|
+
error = false,
|
|
37
|
+
tone = "accent",
|
|
38
|
+
hint
|
|
33
39
|
}) {
|
|
34
40
|
const isControlled = checked !== void 0;
|
|
35
41
|
const [internal, setInternal] = React.useState(defaultChecked);
|
|
@@ -41,66 +47,90 @@ function Checkbox({
|
|
|
41
47
|
const os = useResolvedPlatform(platform);
|
|
42
48
|
const { styles } = useStyles(sheet, { shape: `${os}-${size}`, disabled });
|
|
43
49
|
const hasLabel = label != null && label !== "";
|
|
50
|
+
const invalid = Boolean(error);
|
|
51
|
+
const onFill = theme.color[tone];
|
|
52
|
+
const onInk = theme.color[`${tone}Ink`];
|
|
53
|
+
const message = typeof error === "string" && error ? error : hint;
|
|
44
54
|
const resolvedMotion = useResolvedMotion(motion, "checkbox");
|
|
45
55
|
const animateColour = resolvedMotion !== "none";
|
|
46
56
|
const animatePress = resolvedMotion === "full";
|
|
47
57
|
const easing = React.useMemo(() => Easing.bezier(...theme.easing.base), [theme.easing.base]);
|
|
48
58
|
const fillMs = isOn ? theme.spring.de.duration : theme.spring.fe.duration;
|
|
49
59
|
const backgroundColor = useColorTransition(
|
|
50
|
-
isOn ?
|
|
60
|
+
isOn ? onFill : "transparent",
|
|
51
61
|
fillMs,
|
|
52
62
|
easing,
|
|
53
63
|
animateColour
|
|
54
64
|
);
|
|
55
65
|
const borderColor = useColorTransition(
|
|
56
|
-
isOn ? theme.color.
|
|
66
|
+
isOn ? onFill : invalid ? theme.color.danger : theme.color.text3,
|
|
57
67
|
fillMs,
|
|
58
68
|
easing,
|
|
59
69
|
animateColour
|
|
60
70
|
);
|
|
71
|
+
const android = os === "android";
|
|
72
|
+
const focusRing = useFocusRing(
|
|
73
|
+
hasLabel ? theme.radius.sm : android ? theme.radius.xs : theme.radius.full
|
|
74
|
+
);
|
|
61
75
|
const scale = React.useRef(new Animated.Value(1)).current;
|
|
62
76
|
const spring = (to) => Animated.spring(scale, {
|
|
63
77
|
...springConfig(theme, "fs"),
|
|
64
78
|
toValue: to,
|
|
65
79
|
useNativeDriver: true
|
|
66
80
|
}).start();
|
|
81
|
+
const [pressed, setPressed] = React.useState(false);
|
|
82
|
+
const pressIn = disabled ? void 0 : android ? () => setPressed(true) : animatePress ? () => spring(0.97) : void 0;
|
|
83
|
+
const pressOut = disabled ? void 0 : android ? () => setPressed(false) : animatePress ? () => spring(1) : void 0;
|
|
67
84
|
const handlePress = () => {
|
|
68
85
|
const next = nextChecked(value);
|
|
69
86
|
if (!isControlled) setInternal(next);
|
|
70
87
|
haptics.impact("light");
|
|
71
88
|
onCheckedChange?.(next);
|
|
72
89
|
};
|
|
73
|
-
|
|
90
|
+
const control = /* @__PURE__ */ jsxs(
|
|
74
91
|
Pressable,
|
|
75
92
|
{
|
|
76
93
|
accessibilityRole: "checkbox",
|
|
77
94
|
accessibilityLabel: accessibilityLabel ?? label,
|
|
78
95
|
accessibilityState: { checked: isIndeterminate ? "mixed" : isChecked, disabled },
|
|
79
96
|
"aria-checked": isIndeterminate ? "mixed" : isChecked,
|
|
97
|
+
"aria-invalid": invalid || void 0,
|
|
80
98
|
disabled,
|
|
81
99
|
hitSlop: hasLabel ? void 0 : Math.max(0, (theme.tapMin - BOX[size]) / 2),
|
|
82
|
-
style: hasLabel ? [styles.row, { minHeight: theme.tapMin }] :
|
|
100
|
+
style: [hasLabel ? [styles.row, { minHeight: theme.tapMin }] : null, focusRing.style],
|
|
101
|
+
onFocus: focusRing.handlers.onFocus,
|
|
102
|
+
onBlur: focusRing.handlers.onBlur,
|
|
83
103
|
onPress: disabled ? void 0 : handlePress,
|
|
84
|
-
onPressIn:
|
|
85
|
-
onPressOut:
|
|
104
|
+
onPressIn: pressIn,
|
|
105
|
+
onPressOut: pressOut,
|
|
86
106
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
/* @__PURE__ */ jsxs(View, { style: styles.markWrap, children: [
|
|
108
|
+
android && pressed ? /* @__PURE__ */ jsx(
|
|
109
|
+
View,
|
|
110
|
+
{
|
|
111
|
+
testID: "checkbox-halo",
|
|
112
|
+
pointerEvents: "none",
|
|
113
|
+
style: [styles.halo, { backgroundColor: theme.state.pressed }]
|
|
114
|
+
}
|
|
115
|
+
) : null,
|
|
116
|
+
/* @__PURE__ */ jsx(
|
|
117
|
+
Animated.View,
|
|
118
|
+
{
|
|
119
|
+
testID: "checkbox-box",
|
|
120
|
+
style: [styles.box, { backgroundColor, borderColor, transform: [{ scale }] }],
|
|
121
|
+
children: isOn ? /* @__PURE__ */ jsx(
|
|
122
|
+
Glyph,
|
|
123
|
+
{
|
|
124
|
+
name: isIndeterminate ? "minus" : "check",
|
|
125
|
+
size: GLYPH[size],
|
|
126
|
+
color: onInk,
|
|
127
|
+
animate: animatePress
|
|
128
|
+
},
|
|
129
|
+
isIndeterminate ? "minus" : "check"
|
|
130
|
+
) : null
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
] }),
|
|
104
134
|
hasLabel ? (
|
|
105
135
|
// Part of the control's name already — not a second element to reach.
|
|
106
136
|
/* @__PURE__ */ jsx(View, { accessible: false, importantForAccessibility: "no", style: styles.labelWrap, children: /* @__PURE__ */ jsx(Text, { style: styles.label, children: label }) })
|
|
@@ -108,6 +138,11 @@ function Checkbox({
|
|
|
108
138
|
]
|
|
109
139
|
}
|
|
110
140
|
);
|
|
141
|
+
if (!message) return control;
|
|
142
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.field, children: [
|
|
143
|
+
control,
|
|
144
|
+
/* @__PURE__ */ jsx(FieldMessage, { invalid: invalid && typeof error === "string", children: message })
|
|
145
|
+
] });
|
|
111
146
|
}
|
|
112
147
|
function Glyph({
|
|
113
148
|
name,
|
|
@@ -136,11 +171,21 @@ function boxStyle(os, size, radius) {
|
|
|
136
171
|
return {
|
|
137
172
|
width: BOX[size],
|
|
138
173
|
height: BOX[size],
|
|
139
|
-
borderRadius: os === "ios" ? radius.full : radius.
|
|
174
|
+
borderRadius: os === "ios" ? radius.full : radius.xs
|
|
140
175
|
};
|
|
141
176
|
}
|
|
142
177
|
var sheet = createStyleSheet((theme) => ({
|
|
143
|
-
|
|
178
|
+
// Label 10 from the box (R10).
|
|
179
|
+
row: { flexDirection: "row", alignItems: "center", gap: theme.space[10] },
|
|
180
|
+
// Message under the control, aligned with the label's start (box + R10 gap).
|
|
181
|
+
field: { gap: theme.space.s1 },
|
|
182
|
+
markWrap: { alignItems: "center", justifyContent: "center" },
|
|
183
|
+
halo: {
|
|
184
|
+
position: "absolute",
|
|
185
|
+
width: HALO,
|
|
186
|
+
height: HALO,
|
|
187
|
+
borderRadius: HALO / 2
|
|
188
|
+
},
|
|
144
189
|
labelWrap: { flexShrink: 1 },
|
|
145
190
|
label: {
|
|
146
191
|
fontFamily: theme.font.sans,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TIMING } from '@btndprojects/loam-tokens';
|
|
3
|
+
|
|
4
|
+
// src/lib/delayed-loading.ts
|
|
5
|
+
function useDelayedLoading(loading, delay = TIMING.loadingFloor) {
|
|
6
|
+
const [visible, setVisible] = React.useState(false);
|
|
7
|
+
const shownAt = React.useRef(0);
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
if (loading) {
|
|
10
|
+
if (visible) return;
|
|
11
|
+
const t2 = setTimeout(() => {
|
|
12
|
+
shownAt.current = Date.now();
|
|
13
|
+
setVisible(true);
|
|
14
|
+
}, delay);
|
|
15
|
+
return () => clearTimeout(t2);
|
|
16
|
+
}
|
|
17
|
+
if (!visible) return;
|
|
18
|
+
const remaining = Math.max(0, delay - (Date.now() - shownAt.current));
|
|
19
|
+
const t = setTimeout(() => setVisible(false), remaining);
|
|
20
|
+
return () => clearTimeout(t);
|
|
21
|
+
}, [loading, visible, delay]);
|
|
22
|
+
return visible;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { useDelayedLoading };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fieldSurfaceFill } from './chunk-43K3BLXV.js';
|
|
2
2
|
import { useLabels } from './chunk-APCWFOZW.js';
|
|
3
|
-
import {
|
|
3
|
+
import { NO_UA_FOCUS_RING } from './chunk-2YKVID2V.js';
|
|
4
|
+
import { Icon } from './chunk-PCEFCOLN.js';
|
|
4
5
|
import { useResolvedMotion } from './chunk-J64KGCGX.js';
|
|
5
6
|
import * as React2 from 'react';
|
|
6
|
-
import { Animated, Easing, View, TextInput, ActivityIndicator, Text } from 'react-native';
|
|
7
|
-
import { createStyleSheet,
|
|
7
|
+
import { Animated, Platform, Easing, View, TextInput, ActivityIndicator, Pressable, Text } from 'react-native';
|
|
8
|
+
import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
|
|
8
9
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
9
10
|
|
|
10
11
|
function useFieldValidation({
|
|
@@ -58,25 +59,37 @@ function useColorTransition(target, duration, easing, animate = true) {
|
|
|
58
59
|
}, [from, to, progress, duration, easing, animate]);
|
|
59
60
|
return progress.interpolate({ inputRange: [0, 1], outputRange: [from, to] });
|
|
60
61
|
}
|
|
62
|
+
function useInputPlatform(explicit) {
|
|
63
|
+
const theme = useLoamTheme("input");
|
|
64
|
+
if (explicit) return explicit;
|
|
65
|
+
if (Platform.OS === "ios") return "ios";
|
|
66
|
+
if (Platform.OS === "android") return "android";
|
|
67
|
+
return theme.platform === "iOS" ? "ios" : "android";
|
|
68
|
+
}
|
|
61
69
|
var DEFAULT_LABELS = {
|
|
62
70
|
validating: "Validating",
|
|
63
71
|
valid: "Valid",
|
|
64
|
-
invalid: "Invalid"
|
|
72
|
+
invalid: "Invalid",
|
|
73
|
+
clear: "Clear"
|
|
65
74
|
};
|
|
66
75
|
function Input({
|
|
67
|
-
size = "
|
|
76
|
+
size = "lg",
|
|
77
|
+
platform,
|
|
68
78
|
error = false,
|
|
69
79
|
success = false,
|
|
70
80
|
loading = false,
|
|
71
81
|
leadingIcon,
|
|
72
82
|
trailingIcon,
|
|
73
83
|
validationState = "default",
|
|
84
|
+
surface = "filled",
|
|
85
|
+
clearable = false,
|
|
74
86
|
message,
|
|
75
87
|
showStatusIcon = true,
|
|
76
88
|
motion = "full",
|
|
77
89
|
editable = true,
|
|
78
90
|
onFocus,
|
|
79
91
|
onBlur,
|
|
92
|
+
onChangeText,
|
|
80
93
|
style,
|
|
81
94
|
containerStyle,
|
|
82
95
|
labels: labelsProp,
|
|
@@ -84,24 +97,40 @@ function Input({
|
|
|
84
97
|
}) {
|
|
85
98
|
const labels = useLabels("input", DEFAULT_LABELS, labelsProp);
|
|
86
99
|
const [focused, setFocused] = React2.useState(false);
|
|
100
|
+
const inputRef = React2.useRef(null);
|
|
101
|
+
const [typed, setTyped] = React2.useState(String(rest.defaultValue ?? ""));
|
|
102
|
+
const text = rest.value !== void 0 ? rest.value : typed;
|
|
103
|
+
const handleChangeText = (next) => {
|
|
104
|
+
setTyped(next);
|
|
105
|
+
onChangeText?.(next);
|
|
106
|
+
};
|
|
107
|
+
const clearText = () => {
|
|
108
|
+
inputRef.current?.clear();
|
|
109
|
+
handleChangeText("");
|
|
110
|
+
inputRef.current?.focus();
|
|
111
|
+
};
|
|
87
112
|
const animateColour = useResolvedMotion(motion, "input") === "full";
|
|
88
113
|
const disabled = editable === false;
|
|
89
114
|
const isLoading = loading && !disabled;
|
|
90
115
|
const valid = !isLoading && (validationState === "valid" || success);
|
|
91
116
|
const invalid = !isLoading && (validationState === "invalid" || error);
|
|
117
|
+
const os = useInputPlatform(platform);
|
|
92
118
|
const { styles } = useStyles(sheet, { size, disabled });
|
|
93
119
|
const theme = useLoamTheme("input");
|
|
94
120
|
const iconSize = theme.ctl.icon[size];
|
|
95
121
|
const iconColor = theme.color.text3;
|
|
122
|
+
const valueFont = size === "lg" ? { fontSize: theme.fontSize[os === "ios" ? 17 : 16] } : null;
|
|
96
123
|
const slopY = Math.max(0, (theme.hit[size] - theme.ctl[size]) / 2);
|
|
97
|
-
const
|
|
124
|
+
const restFill = fieldSurfaceFill(theme, surface);
|
|
125
|
+
const tone = disabled ? { border: theme.color.borderStrong, fill: restFill } : isLoading ? { border: theme.focus.ringColor, fill: theme.color.surface } : invalid ? { border: theme.color.danger, fill: focused ? theme.color.surface : restFill } : focused ? { border: theme.focus.ringColor, fill: theme.color.surface } : { border: theme.color.borderStrong, fill: restFill };
|
|
98
126
|
const easing = React2.useMemo(() => Easing.bezier(...theme.easing.base), [theme.easing.base]);
|
|
99
127
|
const borderColor = useColorTransition(tone.border, theme.duration.base, easing, animateColour);
|
|
100
128
|
const backgroundColor = useColorTransition(tone.fill, theme.duration.base, easing, animateColour);
|
|
101
129
|
const statusIconName = valid ? "check-circle" : invalid ? "alert-triangle" : void 0;
|
|
102
|
-
const statusColor = valid ? theme.color.
|
|
130
|
+
const statusColor = valid ? theme.color.good : theme.color.danger;
|
|
103
131
|
const showStatus = showStatusIcon && statusIconName !== void 0;
|
|
104
|
-
const
|
|
132
|
+
const showClear = clearable && !disabled && !isLoading && text.length > 0;
|
|
133
|
+
const messageColor = invalid ? theme.color.dangerOnSoft : valid ? theme.color.goodOnSoft : theme.color.text2;
|
|
105
134
|
const showMessageRow = validationState !== "default" || message !== void 0;
|
|
106
135
|
const statusOpacity = React2.useRef(new Animated.Value(0)).current;
|
|
107
136
|
React2.useEffect(() => {
|
|
@@ -130,7 +159,18 @@ function Input({
|
|
|
130
159
|
Animated.View,
|
|
131
160
|
{
|
|
132
161
|
testID: "input-container",
|
|
133
|
-
style: [
|
|
162
|
+
style: [
|
|
163
|
+
styles.container,
|
|
164
|
+
// A multiline field wraps rather than clips: the ramp height becomes
|
|
165
|
+
// a floor and the box grows with its text.
|
|
166
|
+
rest.multiline ? {
|
|
167
|
+
height: "auto",
|
|
168
|
+
minHeight: theme.ctl.lg * 2,
|
|
169
|
+
alignItems: "flex-start",
|
|
170
|
+
paddingVertical: theme.space[8]
|
|
171
|
+
} : null,
|
|
172
|
+
{ borderColor, backgroundColor }
|
|
173
|
+
],
|
|
134
174
|
accessibilityState: { disabled },
|
|
135
175
|
children: [
|
|
136
176
|
leadingIcon ? /* @__PURE__ */ jsx(Icon, { name: leadingIcon, size: iconSize, color: iconColor }) : null,
|
|
@@ -138,13 +178,18 @@ function Input({
|
|
|
138
178
|
TextInput,
|
|
139
179
|
{
|
|
140
180
|
...rest,
|
|
181
|
+
ref: inputRef,
|
|
182
|
+
numberOfLines: rest.numberOfLines ?? (rest.multiline ? 4 : void 0),
|
|
183
|
+
onChangeText: handleChangeText,
|
|
141
184
|
editable,
|
|
185
|
+
"aria-disabled": disabled || void 0,
|
|
142
186
|
"aria-busy": isLoading || void 0,
|
|
187
|
+
clearButtonMode: rest.clearButtonMode ?? (os === "ios" && !clearable ? "while-editing" : "never"),
|
|
143
188
|
placeholderTextColor: theme.color.text3,
|
|
144
189
|
onFocus: handleFocus,
|
|
145
190
|
onBlur: handleBlur,
|
|
146
191
|
hitSlop: { top: slopY, bottom: slopY },
|
|
147
|
-
style: [styles.input, NO_UA_FOCUS_RING, style]
|
|
192
|
+
style: [styles.input, valueFont, NO_UA_FOCUS_RING, style]
|
|
148
193
|
}
|
|
149
194
|
),
|
|
150
195
|
isLoading ? (
|
|
@@ -160,6 +205,17 @@ function Input({
|
|
|
160
205
|
}
|
|
161
206
|
)
|
|
162
207
|
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
208
|
+
showClear ? /* @__PURE__ */ jsx(
|
|
209
|
+
Pressable,
|
|
210
|
+
{
|
|
211
|
+
testID: "input-clear",
|
|
212
|
+
accessibilityRole: "button",
|
|
213
|
+
accessibilityLabel: labels.clear,
|
|
214
|
+
onPress: clearText,
|
|
215
|
+
hitSlop: Math.max(0, (theme.tapMin - iconSize) / 2),
|
|
216
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "x", size: iconSize, color: iconColor })
|
|
217
|
+
}
|
|
218
|
+
) : null,
|
|
163
219
|
trailingIcon ? /* @__PURE__ */ jsx(Icon, { name: trailingIcon, size: iconSize, color: iconColor }) : null,
|
|
164
220
|
showStatus ? /* @__PURE__ */ jsx(
|
|
165
221
|
Animated.View,
|
|
@@ -189,7 +245,8 @@ function TextField({
|
|
|
189
245
|
onChangeText,
|
|
190
246
|
...inputProps
|
|
191
247
|
}) {
|
|
192
|
-
const
|
|
248
|
+
const os = useInputPlatform(inputProps.platform);
|
|
249
|
+
const { styles } = useStyles(fieldSheet, { os });
|
|
193
250
|
const { error, success, ...handlers } = useFieldValidation({
|
|
194
251
|
validate,
|
|
195
252
|
error: errorProp,
|
|
@@ -204,7 +261,7 @@ function TextField({
|
|
|
204
261
|
// a helper line that did not follow the field's width would read as a
|
|
205
262
|
// different control.
|
|
206
263
|
/* @__PURE__ */ jsxs(View, { style: [styles.field, containerStyle], children: [
|
|
207
|
-
label ? /* @__PURE__ */ jsx(Text, { nativeID: labelId, style: styles.label, children: label }) : null,
|
|
264
|
+
label ? /* @__PURE__ */ jsx(Text, { nativeID: labelId, style: [styles.label, error ? styles.labelError : null], children: label }) : null,
|
|
208
265
|
/* @__PURE__ */ jsx(
|
|
209
266
|
Input,
|
|
210
267
|
{
|
|
@@ -257,14 +314,11 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
257
314
|
borderRadius: theme.ctl.r.lg
|
|
258
315
|
}
|
|
259
316
|
},
|
|
260
|
-
//
|
|
261
|
-
//
|
|
262
|
-
// exempts
|
|
263
|
-
// ~2.2:1. The disabled state now reads from the muted `surface3` fill,
|
|
264
|
-
// plain `border` edge and `text2` value colour instead — all AA on their
|
|
265
|
-
// own, no opacity dim on the text. (Same shape as the launch-screen fix.)
|
|
317
|
+
// Final 02 R5: the whole shell, value included, sits at
|
|
318
|
+
// `state.disabledOpacity`; the field is announced disabled, which WCAG
|
|
319
|
+
// exempts from contrast.
|
|
266
320
|
disabled: {
|
|
267
|
-
true: {},
|
|
321
|
+
true: { opacity: theme.state.disabledOpacity },
|
|
268
322
|
false: {}
|
|
269
323
|
}
|
|
270
324
|
}
|
|
@@ -286,11 +340,11 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
286
340
|
xs: { fontSize: theme.fontSize[14] },
|
|
287
341
|
sm: { fontSize: theme.fontSize[14] },
|
|
288
342
|
md: { fontSize: theme.fontSize[16] },
|
|
289
|
-
lg
|
|
343
|
+
// The lg value is the platform body, set at the use site: 17 on iOS,
|
|
344
|
+
// 16 on Android.
|
|
345
|
+
lg: {}
|
|
290
346
|
},
|
|
291
|
-
//
|
|
292
|
-
// `surface3` fill and plain edge, not a dimmed ink. `text2` measures only
|
|
293
|
-
// 4.4:1 on `surface3` (WCAG fail), so the value keeps primary `text`.
|
|
347
|
+
// The value keeps primary `text`; the shell's opacity does the dimming.
|
|
294
348
|
disabled: {
|
|
295
349
|
true: { color: theme.color.text },
|
|
296
350
|
false: {}
|
|
@@ -304,13 +358,20 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
304
358
|
}
|
|
305
359
|
}));
|
|
306
360
|
var fieldSheet = createStyleSheet((theme) => ({
|
|
307
|
-
field: { gap: theme.space
|
|
361
|
+
field: { gap: theme.space[6] },
|
|
362
|
+
// R11: the label sits in `text`, 6 above the shell — 13 / 600 on iOS,
|
|
363
|
+
// 14 / 500 on Android; it turns `dangerOnSoft` with the error.
|
|
308
364
|
label: {
|
|
309
365
|
fontFamily: theme.font.sans,
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
366
|
+
color: theme.color.text,
|
|
367
|
+
variants: {
|
|
368
|
+
os: {
|
|
369
|
+
ios: { fontSize: theme.fontSize[13], fontWeight: theme.fontWeight.semibold },
|
|
370
|
+
android: { fontSize: theme.fontSize[14], fontWeight: theme.fontWeight.medium }
|
|
371
|
+
}
|
|
372
|
+
}
|
|
313
373
|
},
|
|
374
|
+
labelError: { color: theme.color.dangerOnSoft },
|
|
314
375
|
hint: {
|
|
315
376
|
fontFamily: theme.font.sans,
|
|
316
377
|
fontSize: theme.fontSize[12],
|
|
@@ -319,8 +380,8 @@ var fieldSheet = createStyleSheet((theme) => ({
|
|
|
319
380
|
error: {
|
|
320
381
|
fontFamily: theme.font.sans,
|
|
321
382
|
fontSize: theme.fontSize[12],
|
|
322
|
-
color: theme.color.
|
|
383
|
+
color: theme.color.dangerOnSoft
|
|
323
384
|
}
|
|
324
385
|
}));
|
|
325
386
|
|
|
326
|
-
export { Input, TextField, useColorTransition, useFieldValidation };
|
|
387
|
+
export { Input, TextField, useColorTransition, useFieldValidation, useInputPlatform };
|