@btndprojects/loam-ui-native 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion/index.js +4 -2
- package/dist/adaptive/index.js +12 -2
- package/dist/address-block/index.js +23 -0
- package/dist/alert/index.js +5 -2
- package/dist/analyzer/index.js +13 -5
- package/dist/announcement/index.js +15 -5
- package/dist/appearance-picker/index.js +15 -0
- package/dist/audio-player/index.js +26 -2
- package/dist/avatar/index.js +2 -2
- package/dist/avatar-group/index.js +5 -3
- package/dist/badge/index.js +6 -3
- package/dist/banner/index.js +3 -2
- package/dist/board/index.js +13 -6
- package/dist/button/index.js +6 -3
- package/dist/camera-permission/index.js +19 -11
- package/dist/capture-result/index.js +26 -16
- package/dist/card/index.js +7 -3
- package/dist/card-form/index.js +15 -9
- package/dist/carousel/index.js +3 -1
- package/dist/chart/index.js +15 -5
- package/dist/charts/index.js +18 -5
- package/dist/chat/index.js +35 -10
- package/dist/checkbox/index.js +6 -4
- package/dist/checklist/index.js +16 -7
- package/dist/checkout/index.js +25 -12
- package/dist/chip/index.js +7 -4
- package/dist/chunk-2BZD3NAP.js +1110 -0
- package/dist/chunk-2YKVID2V.js +35 -0
- package/dist/{chunk-H7DWSL4O.js → chunk-36DA3IPO.js} +115 -27
- package/dist/chunk-3A56MIAN.js +599 -0
- package/dist/{chunk-AEB7KCHQ.js → chunk-3SCKCWF5.js} +39 -28
- package/dist/chunk-3TZNDHKO.js +187 -0
- package/dist/chunk-43K3BLXV.js +9 -0
- package/dist/chunk-46ZJIQ2Z.js +208 -0
- package/dist/{chunk-PMMTGBBS.js → chunk-4CZMQDQL.js} +75 -22
- package/dist/chunk-4QCR3K2J.js +1 -0
- package/dist/{chunk-E2E3I5W2.js → chunk-5DTKORLI.js} +54 -45
- package/dist/{chunk-5VFZRGVD.js → chunk-5J4WFXFA.js} +32 -15
- package/dist/{chunk-JBMLWFSJ.js → chunk-5KJ7TEQ6.js} +83 -48
- package/dist/chunk-5NU33TXK.js +529 -0
- package/dist/chunk-6KSUS7DF.js +690 -0
- package/dist/{chunk-3WEZCGHX.js → chunk-6RV6UW2J.js} +140 -56
- package/dist/chunk-6RZM7RP2.js +520 -0
- package/dist/{chunk-JJLPBRVZ.js → chunk-75BDCC7K.js} +2 -0
- package/dist/{chunk-U5NLHYV6.js → chunk-7CGJBQUA.js} +333 -22
- package/dist/{chunk-I4FHVKEC.js → chunk-7IVF6JLJ.js} +16 -5
- package/dist/chunk-7IWCGXYA.js +143 -0
- package/dist/chunk-7LM4ASFH.js +172 -0
- package/dist/chunk-7MCEJFWV.js +341 -0
- package/dist/{chunk-2SY63FCH.js → chunk-7NGMUVNU.js} +66 -30
- package/dist/chunk-7PBSIXT7.js +355 -0
- package/dist/chunk-7QOYGENL.js +443 -0
- package/dist/{chunk-TDMG26JI.js → chunk-A7SWYDE5.js} +40 -9
- package/dist/chunk-ADHPJALR.js +3051 -0
- package/dist/{chunk-ZLTO5VQI.js → chunk-ALJYZLNQ.js} +131 -61
- package/dist/{chunk-GDKVKNR2.js → chunk-AQ5FIG74.js} +110 -30
- package/dist/chunk-B2MMZZQB.js +426 -0
- package/dist/{chunk-QYPE5JX3.js → chunk-B7JZ3N5G.js} +142 -105
- package/dist/{chunk-QHTVYA65.js → chunk-BL37SW6G.js} +388 -102
- package/dist/chunk-BTRMA7GC.js +21 -0
- package/dist/{chunk-FUMHAAF3.js → chunk-C7IUWIUZ.js} +243 -92
- package/dist/chunk-CA3DUVYD.js +10 -0
- package/dist/{chunk-FYWNRX4F.js → chunk-CBCJSO2B.js} +143 -13
- package/dist/chunk-CHPX4MFI.js +239 -0
- package/dist/chunk-CLGAMIOT.js +648 -0
- package/dist/chunk-CUE7VML6.js +1141 -0
- package/dist/{chunk-D5N5QWI7.js → chunk-CVU6S2E5.js} +497 -235
- package/dist/{chunk-U23FYWME.js → chunk-CXPQMA6Z.js} +101 -34
- package/dist/{chunk-36EC2T6P.js → chunk-D2LN4I7I.js} +1 -1
- package/dist/{chunk-TLCIR6RG.js → chunk-D34LNBO5.js} +411 -155
- package/dist/{chunk-FV6HMP7W.js → chunk-D4BCQICM.js} +207 -65
- package/dist/chunk-EABKIIA4.js +1 -0
- package/dist/chunk-EICSYRAG.js +341 -0
- package/dist/chunk-EMWAJMAS.js +83 -0
- package/dist/chunk-EOLZWRV6.js +149 -0
- package/dist/chunk-EOQVTGB6.js +350 -0
- package/dist/{chunk-ZVATDZOM.js → chunk-ESGUHNB2.js} +106 -28
- package/dist/{chunk-46MMSDGL.js → chunk-F2KNBPKY.js} +104 -73
- package/dist/{chunk-KQZ3GLHR.js → chunk-G7H3NX3G.js} +40 -17
- package/dist/{chunk-3QMEOFW5.js → chunk-GM7YIPB7.js} +421 -207
- package/dist/{chunk-QHAITQIF.js → chunk-GVQQG435.js} +256 -86
- package/dist/chunk-HE43OMEL.js +1056 -0
- package/dist/{chunk-XIDTBCBA.js → chunk-HHOMFQ7R.js} +1049 -207
- package/dist/chunk-HNAKS4Z3.js +207 -0
- package/dist/chunk-HP6ST2OW.js +352 -0
- package/dist/chunk-HW3OWDTU.js +1 -0
- package/dist/{chunk-QP3KMOVF.js → chunk-HZDB44K4.js} +24 -14
- package/dist/chunk-I6CUP2LW.js +1155 -0
- package/dist/chunk-ICV4Y2WY.js +27 -0
- package/dist/chunk-IHSIENOE.js +3950 -0
- package/dist/{chunk-T5LTPKX6.js → chunk-IMMALLRU.js} +53 -25
- package/dist/{chunk-C4GTDLRC.js → chunk-JA6TK7H2.js} +154 -67
- package/dist/{chunk-EVOIGUBI.js → chunk-JAVZ5JPV.js} +43 -13
- package/dist/{chunk-CPTOADB2.js → chunk-JCMTP3E4.js} +527 -201
- package/dist/{chunk-OJQUBQWA.js → chunk-JCXFFK64.js} +73 -16
- package/dist/{chunk-V2OEB75Z.js → chunk-JWCVBFDU.js} +75 -35
- package/dist/chunk-JXRTD5RI.js +414 -0
- package/dist/chunk-JYIUZUIQ.js +1567 -0
- package/dist/chunk-K3TK3GIV.js +219 -0
- package/dist/chunk-KEVZIHM2.js +1511 -0
- package/dist/{chunk-VAOAKWUK.js → chunk-KHZDNQQD.js} +42 -8
- package/dist/chunk-KL4GDV4V.js +131 -0
- package/dist/{chunk-Q6NKEPRE.js → chunk-KNILMM4H.js} +73 -28
- package/dist/chunk-KRBUZV45.js +25 -0
- package/dist/{chunk-7BUIKDD6.js → chunk-KXLDK6HB.js} +91 -30
- package/dist/chunk-KZ3X7TSL.js +196 -0
- package/dist/{chunk-5UTRIXQ6.js → chunk-L2WMOA2V.js} +187 -43
- package/dist/chunk-L4D5LHCH.js +109 -0
- package/dist/{chunk-W63AJTM7.js → chunk-LAUJPLDB.js} +236 -71
- package/dist/{chunk-TN2ZNJUI.js → chunk-LGNTP5XA.js} +47 -13
- package/dist/chunk-LUZFCCSD.js +271 -0
- package/dist/{chunk-XTORZWRF.js → chunk-LXJCP4PL.js} +111 -30
- package/dist/chunk-MCOZJWPU.js +731 -0
- package/dist/{chunk-SATMR6SG.js → chunk-MG4SKWLL.js} +780 -142
- package/dist/{chunk-JUYWSSKW.js → chunk-MPEPTSER.js} +95 -16
- package/dist/chunk-MWPJ4YGP.js +1 -0
- package/dist/{chunk-LUMVGO2K.js → chunk-N7AX4OA4.js} +80 -29
- package/dist/chunk-NHSLM6SE.js +523 -0
- package/dist/{chunk-IT6FUXXG.js → chunk-NNJLVA7M.js} +43 -11
- package/dist/{chunk-TQVAIKFD.js → chunk-NZG75DGA.js} +102 -62
- package/dist/chunk-O76QXRBV.js +431 -0
- package/dist/chunk-OANH27AK.js +223 -0
- package/dist/chunk-OCHPK5YV.js +609 -0
- package/dist/chunk-OMHVEVX4.js +436 -0
- package/dist/{chunk-SWS5JQIF.js → chunk-ONKQUJWD.js} +187 -60
- package/dist/chunk-OVTK7A6T.js +615 -0
- package/dist/{chunk-UXGIW7OK.js → chunk-PCEFCOLN.js} +5 -1
- package/dist/{chunk-QIKT7LIB.js → chunk-PFLNFIVB.js} +91 -23
- package/dist/chunk-PHSZY37H.js +300 -0
- package/dist/chunk-PJLTKDVY.js +18 -0
- package/dist/{chunk-SHHY5OMK.js → chunk-PK7BN3MI.js} +83 -15
- package/dist/{chunk-YXOAPXMU.js → chunk-PWFRDRGS.js} +101 -14
- package/dist/{chunk-TY4MTKQJ.js → chunk-PYPMD46W.js} +332 -66
- package/dist/chunk-Q6CCHDI7.js +331 -0
- package/dist/chunk-QFA5WS2A.js +750 -0
- package/dist/chunk-QJMMM4RC.js +124 -0
- package/dist/chunk-QYWEVAM6.js +407 -0
- package/dist/chunk-R5T4VZ7Z.js +126 -0
- package/dist/chunk-R77HFLZD.js +1 -0
- package/dist/{chunk-LMPHCVJJ.js → chunk-RAESDNU5.js} +162 -68
- package/dist/chunk-RBYQUXNL.js +1 -0
- package/dist/chunk-RCM3DT5E.js +1 -0
- package/dist/chunk-RGNY56L7.js +282 -0
- package/dist/chunk-RIK6UX2K.js +344 -0
- package/dist/{chunk-5LAAAXFP.js → chunk-RJA3RXO3.js} +63 -54
- package/dist/chunk-RJYRJ3LD.js +1 -0
- package/dist/chunk-RMA3NOY4.js +599 -0
- package/dist/{chunk-VDPK5CY4.js → chunk-RSWKKAHK.js} +143 -61
- package/dist/{chunk-B7N4ASYE.js → chunk-RVOIIX3V.js} +17 -45
- package/dist/chunk-SA2RRBGT.js +1077 -0
- package/dist/{chunk-7OVVSVEZ.js → chunk-SG3J4R45.js} +440 -169
- package/dist/chunk-SPUK7JD4.js +238 -0
- package/dist/chunk-SWXV2K5N.js +434 -0
- package/dist/chunk-SYJEPXP6.js +1303 -0
- package/dist/{chunk-LKFC4CS7.js → chunk-SZLI34TA.js} +18 -9
- package/dist/{chunk-NBEF4EPJ.js → chunk-T77WJA74.js} +131 -16
- package/dist/chunk-TDWWVJA4.js +630 -0
- package/dist/chunk-TFHI5XDR.js +610 -0
- package/dist/chunk-TH4PW2WU.js +17 -0
- package/dist/chunk-TTQ24HQX.js +12 -0
- package/dist/chunk-TUACVJNG.js +12 -0
- package/dist/{chunk-F5B3UINI.js → chunk-TUL5RUIA.js} +171 -62
- package/dist/{chunk-C6APNDVA.js → chunk-TYOSA7JG.js} +63 -34
- package/dist/chunk-TYQTMMEV.js +1 -0
- package/dist/{chunk-DW3L54DQ.js → chunk-TZO6YDS7.js} +53 -12
- package/dist/{chunk-67IZZ2MJ.js → chunk-U3ETF22F.js} +75 -30
- package/dist/{chunk-EDCBJV7J.js → chunk-U6BYHD2N.js} +87 -31
- package/dist/{chunk-ENP3BMZU.js → chunk-UF6EJXPQ.js} +16 -1
- package/dist/{chunk-IPUNJMAQ.js → chunk-UNNQIPGK.js} +304 -68
- package/dist/chunk-UQVO6AJV.js +171 -0
- package/dist/{chunk-FZGAAOKS.js → chunk-VFDQAAIW.js} +138 -32
- package/dist/chunk-VIUE3VQT.js +1 -0
- package/dist/{chunk-5RENVKBQ.js → chunk-VJLSSSGC.js} +126 -30
- package/dist/chunk-VLMT6KYT.js +350 -0
- package/dist/chunk-VMHGBUGS.js +35 -0
- package/dist/{chunk-4IZXHVFJ.js → chunk-VQKPBYW6.js} +228 -172
- package/dist/{chunk-G6UESEVN.js → chunk-VSSTWLC5.js} +49 -11
- package/dist/{chunk-TRGFFU6A.js → chunk-VZYYZRPN.js} +866 -330
- package/dist/{chunk-JLC6PM5S.js → chunk-WAIJCD2V.js} +128 -54
- package/dist/chunk-WFMQ3WKM.js +378 -0
- package/dist/chunk-WJ2KDRMY.js +66 -0
- package/dist/chunk-WKFZJO54.js +437 -0
- package/dist/{chunk-QEYFDRHR.js → chunk-WVVD3XOV.js} +146 -84
- package/dist/chunk-XAIWMSLB.js +1 -0
- package/dist/chunk-XBXUBBJZ.js +98 -0
- package/dist/chunk-XCU7MYBJ.js +1 -0
- package/dist/chunk-XHE4PGCI.js +717 -0
- package/dist/chunk-XRSJ32M3.js +331 -0
- package/dist/chunk-XTCVOEAW.js +1 -0
- package/dist/chunk-XWGXVQF6.js +58 -0
- package/dist/{chunk-MKSNFG7H.js → chunk-Y3XKKO5K.js} +191 -109
- package/dist/chunk-Y4QNMBLO.js +533 -0
- package/dist/chunk-Y5H4CTKO.js +1 -0
- package/dist/chunk-YBQIN75A.js +403 -0
- package/dist/{chunk-PNF3NKB5.js → chunk-YJ5PXOX3.js} +28 -11
- package/dist/{chunk-M656FYNH.js → chunk-YLRSRUPS.js} +63 -49
- package/dist/chunk-YM6MPJ4A.js +1 -0
- package/dist/chunk-YV7KZENV.js +200 -0
- package/dist/chunk-Z7I4ZSO6.js +316 -0
- package/dist/{chunk-EY4DD67D.js → chunk-ZIRMWD2B.js} +199 -126
- package/dist/chunk-ZPMG3FWU.js +75 -0
- package/dist/{chunk-QRUMA22E.js → chunk-ZTXMK2G7.js} +92 -43
- package/dist/{chunk-2OLKPG4E.js → chunk-ZVJCWXAL.js} +189 -87
- package/dist/{chunk-YAAHPATV.js → chunk-ZYQ23DPT.js} +49 -34
- package/dist/coachmark/index.js +7 -3
- package/dist/code-block/index.js +4 -3
- package/dist/color-field/index.js +12 -4
- package/dist/color-picker/index.js +23 -0
- package/dist/commerce/index.js +27 -16
- package/dist/confirm/index.js +31 -0
- package/dist/connection-card/index.js +34 -0
- package/dist/connectivity/index.js +3 -2
- package/dist/context-menu/index.js +10 -2
- package/dist/copy-button/index.js +3 -2
- package/dist/data-grid/index.js +30 -17
- package/dist/date-range-picker/index.js +19 -9
- package/dist/description-list/index.js +4 -1
- package/dist/device-frame/index.js +30 -0
- package/dist/dialog/index.js +8 -2
- package/dist/divider/index.js +2 -0
- package/dist/empty-state/index.js +13 -2
- package/dist/error-summary/index.js +7 -2
- package/dist/fab/index.js +4 -2
- package/dist/file-manager/index.js +33 -17
- package/dist/file-upload/index.js +12 -6
- package/dist/filter-bar/index.js +10 -6
- package/dist/flow-run/index.js +19 -12
- package/dist/form/index.js +30 -3
- package/dist/gallery/index.js +5 -2
- package/dist/hold-to-confirm/index.js +4 -2
- package/dist/hover-card/index.js +18 -0
- package/dist/icon-tile/index.js +10 -0
- package/dist/image/index.js +9 -0
- package/dist/index.d.ts +29826 -17941
- package/dist/index.js +197 -141
- package/dist/infinite-list/index.js +4 -2
- package/dist/inline-edit/index.js +5 -4
- package/dist/input/index.js +4 -3
- package/dist/interactions/index.js +4 -1
- package/dist/invoice/index.js +18 -9
- package/dist/job-row/index.js +22 -0
- package/dist/json-inspector/index.js +20 -0
- package/dist/kbd/index.js +2 -2
- package/dist/keyboard/index.js +7 -2
- package/dist/level-meter/index.js +9 -0
- package/dist/list-row/index.js +11 -3
- package/dist/log-viewer/index.js +9 -2
- package/dist/map-view/index.js +13 -2
- package/dist/markdown/index.js +8 -5
- package/dist/metric/index.js +6 -3
- package/dist/metric-strip/index.js +12 -0
- package/dist/money/index.js +11 -4
- package/dist/nav-drawer/index.js +6 -2
- package/dist/nav-header/index.js +10 -4
- package/dist/navigation/index.js +29 -2
- package/dist/notification-center/index.js +24 -10
- package/dist/number-roll/index.js +3 -1
- package/dist/onboarding-pager/index.js +22 -0
- package/dist/one-handed/index.js +2 -2
- package/dist/os-surfaces/index.js +6 -3
- package/dist/otp/index.js +5 -4
- package/dist/page-header/index.js +2 -1
- package/dist/pagination/index.js +4 -2
- package/dist/payment-method/index.js +17 -11
- package/dist/payment-status/index.js +22 -14
- package/dist/permission/index.js +18 -2
- package/dist/picker/index.js +17 -6
- package/dist/progress/index.js +7 -2
- package/dist/provenance/index.js +16 -0
- package/dist/pull-to-refresh/index.js +2 -2
- package/dist/qr-code/index.js +16 -0
- package/dist/query-builder/index.js +30 -0
- package/dist/radio-group/index.js +6 -4
- package/dist/rating/index.js +7 -2
- package/dist/receivables/index.js +31 -18
- package/dist/recording-indicator/index.js +21 -0
- package/dist/refund/index.js +24 -15
- package/dist/repeatable-rows/index.js +19 -0
- package/dist/save-status/index.js +5 -3
- package/dist/screen/index.js +3 -0
- package/dist/scroll-area/index.js +1 -1
- package/dist/search-field/index.js +8 -3
- package/dist/secret-field/index.js +19 -0
- package/dist/section-header/index.js +4 -0
- package/dist/segmented-control/index.js +2 -2
- package/dist/sheet/index.js +9 -3
- package/dist/shortcuts-sheet/index.js +2 -0
- package/dist/sign-in-screen/index.js +25 -0
- package/dist/skeleton/index.js +3 -1
- package/dist/slider/index.js +2 -1
- package/dist/sortable/index.js +4 -3
- package/dist/spinner/index.js +2 -1
- package/dist/split-button/index.js +17 -5
- package/dist/spotlight/index.js +7 -1
- package/dist/stack/index.js +2 -0
- package/dist/stage-timeline/index.js +6 -3
- package/dist/status-dot/index.js +6 -2
- package/dist/stepper/index.js +7 -3
- package/dist/streaming-text/index.js +2 -1
- package/dist/survey/index.js +24 -14
- package/dist/switch/index.js +6 -2
- package/dist/system-state/index.js +12 -4
- package/dist/tab-bar/index.js +10 -2
- package/dist/tabs/index.js +10 -2
- package/dist/tags-input/index.js +8 -5
- package/dist/text/index.js +4 -0
- package/dist/textarea/index.js +5 -4
- package/dist/thinking/index.js +4 -1
- package/dist/tile-rail/index.js +10 -0
- package/dist/time-field/index.js +15 -7
- package/dist/time-range-control/index.js +26 -12
- package/dist/timeline/index.js +2 -2
- package/dist/toast/index.js +4 -2
- package/dist/toolbar/index.js +3 -2
- package/dist/tour/index.js +12 -10
- package/dist/transcript/index.js +28 -0
- package/dist/truncation-notice/index.js +2 -2
- package/dist/update-notice/index.js +15 -8
- package/dist/video-player/index.js +26 -2
- package/dist/viewfinder/index.js +12 -4
- package/dist/widget/index.js +11 -4
- package/dist/wizard/index.js +7 -4
- package/package.json +13 -13
- package/dist/chunk-2PKYGLQ6.js +0 -268
- package/dist/chunk-2SWKL3AJ.js +0 -466
- package/dist/chunk-2TXERVVA.js +0 -1081
- package/dist/chunk-3DUWIYV5.js +0 -437
- package/dist/chunk-3NMD74ZU.js +0 -4
- package/dist/chunk-4DS5ZWVC.js +0 -83
- package/dist/chunk-6YAQBXB3.js +0 -93
- package/dist/chunk-74FLKD24.js +0 -237
- package/dist/chunk-CMTVNF3D.js +0 -104
- package/dist/chunk-DN7MNQIP.js +0 -799
- package/dist/chunk-DVGBZ3TX.js +0 -455
- package/dist/chunk-F3H33DQX.js +0 -300
- package/dist/chunk-FAJI7BSC.js +0 -443
- package/dist/chunk-G3AFC24V.js +0 -60
- package/dist/chunk-HJLPZA4X.js +0 -369
- package/dist/chunk-HYEOQWT7.js +0 -647
- package/dist/chunk-IDM7JJMO.js +0 -110
- package/dist/chunk-IVKMZ7BB.js +0 -326
- package/dist/chunk-IXKWIFWZ.js +0 -334
- package/dist/chunk-JV5YOTOB.js +0 -164
- package/dist/chunk-KFJGFLMW.js +0 -158
- package/dist/chunk-LQP4KEXZ.js +0 -214
- package/dist/chunk-NTQ2F3AU.js +0 -257
- package/dist/chunk-O5V4TG3V.js +0 -329
- package/dist/chunk-OWAMM2DK.js +0 -280
- package/dist/chunk-PID3NJB7.js +0 -405
- package/dist/chunk-QDZGFXQD.js +0 -176
- package/dist/chunk-QPWDDJJ4.js +0 -385
- package/dist/chunk-ROCUG24E.js +0 -416
- package/dist/chunk-RU3ZPNL6.js +0 -1986
- package/dist/chunk-RXSCIO6W.js +0 -153
- package/dist/chunk-SKWO3SZF.js +0 -2284
- package/dist/chunk-UQGBTPXH.js +0 -218
- package/dist/chunk-UYGDJWMN.js +0 -273
- package/dist/chunk-W74TXYFB.js +0 -107
- package/dist/chunk-WRDSPUE7.js +0 -417
- package/dist/chunk-XBZGDDMR.js +0 -105
- package/dist/chunk-XN4KG3P4.js +0 -1040
- package/dist/chunk-XQXMLMH3.js +0 -211
- package/dist/chunk-ZECZOOSB.js +0 -245
- /package/dist/{chunk-VFCUIDRT.js → chunk-3BKLBYPK.js} +0 -0
- /package/dist/{chunk-GEIGMWNF.js → chunk-QNZII37O.js} +0 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { Sheet } from './chunk-B7JZ3N5G.js';
|
|
2
|
+
import { Badge } from './chunk-LGNTP5XA.js';
|
|
3
|
+
import { Spinner } from './chunk-G7H3NX3G.js';
|
|
4
|
+
import { isAndroidIdiom } from './chunk-TH4PW2WU.js';
|
|
5
|
+
import { useLabels } from './chunk-APCWFOZW.js';
|
|
6
|
+
import { Icon } from './chunk-PCEFCOLN.js';
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { View, Text, Pressable } from 'react-native';
|
|
9
|
+
import { createStyleSheet, useStyles } from '@btndprojects/loam-theme-native';
|
|
10
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
var DEFAULT_LABELS = {
|
|
13
|
+
badge: "AI",
|
|
14
|
+
drafted: "Drafted with AI",
|
|
15
|
+
generating: "Generating\u2026",
|
|
16
|
+
onDevice: "On this device",
|
|
17
|
+
cloud: (region) => `Cloud \xB7 ${region}`,
|
|
18
|
+
editedBy: (name) => `Edited by ${name}`,
|
|
19
|
+
glyph: (origin) => `AI-generated \xB7 ${origin}`,
|
|
20
|
+
detailTitle: "How this was made",
|
|
21
|
+
madeBy: "Made by",
|
|
22
|
+
ranOn: "Ran on",
|
|
23
|
+
thisDevice: "This device",
|
|
24
|
+
sources: "Sources",
|
|
25
|
+
created: "Created",
|
|
26
|
+
edited: "Edited",
|
|
27
|
+
editedYes: (name) => `Yes, by ${name}`,
|
|
28
|
+
editedNo: "No",
|
|
29
|
+
sourceCount: (n) => `${n} source${n === 1 ? "" : "s"}`
|
|
30
|
+
};
|
|
31
|
+
function GlyphSpinner({
|
|
32
|
+
px,
|
|
33
|
+
color,
|
|
34
|
+
motion
|
|
35
|
+
}) {
|
|
36
|
+
return /* @__PURE__ */ jsx(View, { style: { width: px, height: px, alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ jsx(View, { style: { transform: [{ scale: px / 16 }] }, children: /* @__PURE__ */ jsx(Spinner, { size: "sm", color, accessibilityLabel: "", motion }) }) });
|
|
37
|
+
}
|
|
38
|
+
function ProvenanceMark({
|
|
39
|
+
variant = "byline",
|
|
40
|
+
origin,
|
|
41
|
+
editedBy,
|
|
42
|
+
model,
|
|
43
|
+
sources,
|
|
44
|
+
created,
|
|
45
|
+
status,
|
|
46
|
+
detail,
|
|
47
|
+
detailPresentation = "sheet",
|
|
48
|
+
defaultOpen = false,
|
|
49
|
+
platform,
|
|
50
|
+
size = "md",
|
|
51
|
+
count,
|
|
52
|
+
motion = "full",
|
|
53
|
+
labels: labelsProp,
|
|
54
|
+
style,
|
|
55
|
+
testID
|
|
56
|
+
}) {
|
|
57
|
+
const labels = useLabels("provenanceMark", DEFAULT_LABELS, labelsProp);
|
|
58
|
+
const { styles, theme } = useStyles(sheet);
|
|
59
|
+
const android = isAndroidIdiom(theme, platform);
|
|
60
|
+
const inlineDetail = detailPresentation === "inline";
|
|
61
|
+
const [open, setOpen] = React.useState(inlineDetail || defaultOpen);
|
|
62
|
+
const generating = status === "generating";
|
|
63
|
+
const originText = origin === void 0 ? void 0 : origin === "device" ? labels.onDevice : labels.cloud(origin.cloud);
|
|
64
|
+
const ink = theme.color.text2;
|
|
65
|
+
const icon = { sm: theme.space[12], md: theme.space[14], lg: theme.space[16] }[size];
|
|
66
|
+
const glyphPx = { sm: theme.space[14], md: theme.space[16], lg: theme.space[20] }[size];
|
|
67
|
+
const sizeText = size === "sm" ? { fontSize: theme.fontSize[12], lineHeight: theme.space[16] } : size === "lg" ? { fontSize: theme.fontSize[15], lineHeight: theme.space[20] } : null;
|
|
68
|
+
const countText = count !== void 0 ? labels.sourceCount(count) : void 0;
|
|
69
|
+
let detailNode = null;
|
|
70
|
+
if (detail !== false && !generating) {
|
|
71
|
+
if (detail !== void 0) detailNode = detail;
|
|
72
|
+
else {
|
|
73
|
+
const rows = [];
|
|
74
|
+
if (model) rows.push([labels.madeBy, model]);
|
|
75
|
+
if (origin)
|
|
76
|
+
rows.push([
|
|
77
|
+
labels.ranOn,
|
|
78
|
+
origin === "device" ? labels.thisDevice : labels.cloud(origin.cloud)
|
|
79
|
+
]);
|
|
80
|
+
if (sources) rows.push([labels.sources, sources]);
|
|
81
|
+
if (created) rows.push([labels.created, created]);
|
|
82
|
+
rows.push([labels.edited, editedBy ? labels.editedYes(editedBy) : labels.editedNo]);
|
|
83
|
+
detailNode = /* @__PURE__ */ jsx(View, { style: styles.facts, children: rows.map(([k, v]) => /* @__PURE__ */ jsxs(View, { style: styles.factRow, children: [
|
|
84
|
+
/* @__PURE__ */ jsx(Text, { style: styles.factKey, children: k }),
|
|
85
|
+
/* @__PURE__ */ jsx(Text, { style: styles.factValue, children: v })
|
|
86
|
+
] }, k)) });
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const detailSheet = detailNode ? /* @__PURE__ */ jsx(
|
|
90
|
+
Sheet,
|
|
91
|
+
{
|
|
92
|
+
open,
|
|
93
|
+
onOpenChange: setOpen,
|
|
94
|
+
title: labels.detailTitle,
|
|
95
|
+
detents: android || inlineDetail ? void 0 : ["half"],
|
|
96
|
+
presentation: inlineDetail ? "inline" : "modal",
|
|
97
|
+
children: detailNode
|
|
98
|
+
}
|
|
99
|
+
) : null;
|
|
100
|
+
const pressable = (child, a11yLabel) => detailNode ? /* @__PURE__ */ jsx(
|
|
101
|
+
Pressable,
|
|
102
|
+
{
|
|
103
|
+
accessibilityRole: "button",
|
|
104
|
+
accessibilityLabel: a11yLabel,
|
|
105
|
+
onPress: () => setOpen(true),
|
|
106
|
+
hitSlop: theme.space[8],
|
|
107
|
+
style: ({ pressed }) => [styles.press, pressed && { opacity: theme.state.pressedOpacity }],
|
|
108
|
+
children: child
|
|
109
|
+
}
|
|
110
|
+
) : child;
|
|
111
|
+
if (variant === "badge") {
|
|
112
|
+
const badge = generating ? /* @__PURE__ */ jsxs(Badge, { size: size === "lg" ? "md" : "sm", variant: "neutral", accessibilityLabel: labels.badge, children: [
|
|
113
|
+
/* @__PURE__ */ jsx(GlyphSpinner, { px: 12, color: theme.color.accentStrong, motion }),
|
|
114
|
+
/* @__PURE__ */ jsx(Text, { style: styles.badgeText, children: labels.badge })
|
|
115
|
+
] }) : /* @__PURE__ */ jsx(Badge, { size: size === "lg" ? "md" : "sm", variant: "neutral", leadingIcon: "sparkle", children: countText ? `${labels.badge} \xB7 ${countText}` : labels.badge });
|
|
116
|
+
return /* @__PURE__ */ jsxs(View, { style, testID, children: [
|
|
117
|
+
pressable(badge, labels.detailTitle),
|
|
118
|
+
detailSheet
|
|
119
|
+
] });
|
|
120
|
+
}
|
|
121
|
+
if (variant === "glyph") {
|
|
122
|
+
const name = labels.glyph(originText ?? labels.badge) + (countText ? ` \xB7 ${countText}` : "");
|
|
123
|
+
const glyph = /* @__PURE__ */ jsx(
|
|
124
|
+
View,
|
|
125
|
+
{
|
|
126
|
+
accessible: !detailNode,
|
|
127
|
+
accessibilityRole: "image",
|
|
128
|
+
accessibilityLabel: name,
|
|
129
|
+
style: [styles.glyph, { width: glyphPx, height: glyphPx }],
|
|
130
|
+
children: generating ? /* @__PURE__ */ jsx(GlyphSpinner, { px: icon, color: theme.color.accentStrong, motion }) : /* @__PURE__ */ jsx(Icon, { name: "sparkle", size: glyphPx, color: ink })
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
return /* @__PURE__ */ jsxs(View, { style, testID, children: [
|
|
134
|
+
pressable(glyph, name),
|
|
135
|
+
detailSheet
|
|
136
|
+
] });
|
|
137
|
+
}
|
|
138
|
+
const text = [styles.byline, android ? styles.bylineAndroid : styles.bylineIos, sizeText];
|
|
139
|
+
const lead = generating ? labels.generating : labels.drafted;
|
|
140
|
+
const bylineRow = /* @__PURE__ */ jsxs(View, { style: [styles.row, inlineDetail ? null : style], testID: inlineDetail ? void 0 : testID, children: [
|
|
141
|
+
generating ? /* @__PURE__ */ jsx(GlyphSpinner, { px: icon, color: theme.color.accentStrong, motion }) : /* @__PURE__ */ jsx(Icon, { name: "sparkle", size: icon, color: ink }),
|
|
142
|
+
pressable(/* @__PURE__ */ jsx(Text, { style: [text, detailNode ? styles.link : null], children: lead }), lead),
|
|
143
|
+
!generating && originText ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
144
|
+
/* @__PURE__ */ jsx(Text, { style: text, accessible: false, children: "\xB7" }),
|
|
145
|
+
/* @__PURE__ */ jsx(Icon, { name: origin === "device" ? "devices" : "globe", size: icon, color: ink }),
|
|
146
|
+
/* @__PURE__ */ jsx(Text, { style: text, children: originText })
|
|
147
|
+
] }) : null,
|
|
148
|
+
!generating && countText ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
149
|
+
/* @__PURE__ */ jsx(Text, { style: text, accessible: false, children: "\xB7" }),
|
|
150
|
+
/* @__PURE__ */ jsx(Text, { style: text, children: countText })
|
|
151
|
+
] }) : null,
|
|
152
|
+
!generating && editedBy ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
153
|
+
/* @__PURE__ */ jsx(Text, { style: text, accessible: false, children: "\xB7" }),
|
|
154
|
+
/* @__PURE__ */ jsx(Text, { style: text, children: labels.editedBy(editedBy) })
|
|
155
|
+
] }) : null,
|
|
156
|
+
inlineDetail ? null : detailSheet
|
|
157
|
+
] });
|
|
158
|
+
if (!inlineDetail) return bylineRow;
|
|
159
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.inlineStack, style], testID, children: [
|
|
160
|
+
bylineRow,
|
|
161
|
+
detailSheet
|
|
162
|
+
] });
|
|
163
|
+
}
|
|
164
|
+
var sheet = createStyleSheet((theme) => ({
|
|
165
|
+
row: { flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: theme.space[6] },
|
|
166
|
+
inlineStack: { gap: theme.space.s2 },
|
|
167
|
+
press: { borderRadius: theme.radius.xs },
|
|
168
|
+
byline: {
|
|
169
|
+
fontFamily: theme.font.sans,
|
|
170
|
+
fontWeight: theme.fontWeight.medium,
|
|
171
|
+
color: theme.color.text2
|
|
172
|
+
},
|
|
173
|
+
// iOS footnote 13 / 18; Android body-small 12 / 16.
|
|
174
|
+
bylineIos: { fontSize: theme.fontSize[13], lineHeight: theme.space[18] },
|
|
175
|
+
bylineAndroid: { fontSize: theme.fontSize[12], lineHeight: theme.space[16] },
|
|
176
|
+
link: { color: theme.color.accentStrong },
|
|
177
|
+
badgeText: {
|
|
178
|
+
fontFamily: theme.font.sans,
|
|
179
|
+
fontSize: theme.fontSize[12],
|
|
180
|
+
fontWeight: theme.fontWeight.semibold,
|
|
181
|
+
color: theme.color.text2
|
|
182
|
+
},
|
|
183
|
+
glyph: {
|
|
184
|
+
width: theme.space[16],
|
|
185
|
+
height: theme.space[16],
|
|
186
|
+
alignItems: "center",
|
|
187
|
+
justifyContent: "center"
|
|
188
|
+
},
|
|
189
|
+
facts: { gap: theme.space[6] },
|
|
190
|
+
factRow: { flexDirection: "row", gap: theme.space[16] },
|
|
191
|
+
factKey: {
|
|
192
|
+
fontFamily: theme.font.sans,
|
|
193
|
+
fontSize: theme.fontSize[13],
|
|
194
|
+
lineHeight: theme.space[18],
|
|
195
|
+
color: theme.color.text2,
|
|
196
|
+
minWidth: theme.space[80]
|
|
197
|
+
},
|
|
198
|
+
factValue: {
|
|
199
|
+
flex: 1,
|
|
200
|
+
fontFamily: theme.font.sans,
|
|
201
|
+
fontSize: theme.fontSize[13],
|
|
202
|
+
lineHeight: theme.space[18],
|
|
203
|
+
color: theme.color.text
|
|
204
|
+
}
|
|
205
|
+
}));
|
|
206
|
+
|
|
207
|
+
export { ProvenanceMark };
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { NumberRoll } from './chunk-IMMALLRU.js';
|
|
2
|
+
import { fieldSurfaceFill } from './chunk-43K3BLXV.js';
|
|
3
|
+
import { haptics } from './chunk-NY2U3PBI.js';
|
|
4
|
+
import { isAndroidIdiom } from './chunk-TH4PW2WU.js';
|
|
5
|
+
import { useLabels } from './chunk-APCWFOZW.js';
|
|
6
|
+
import { Icon } from './chunk-PCEFCOLN.js';
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { Animated, View, Pressable, ActivityIndicator, TextInput, Easing } from 'react-native';
|
|
9
|
+
import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
|
|
10
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
var BUTTON_PRESS_SCALE = 0.88;
|
|
13
|
+
var ROLL_H = { xs: 18, sm: 20, md: 24, lg: 28 };
|
|
14
|
+
var IOS_VALUE_FS = { xs: 13, sm: 15, md: 17, lg: 17 };
|
|
15
|
+
var ANDROID_VALUE_FS = { xs: 12, sm: 14, md: 14, lg: 16 };
|
|
16
|
+
var DEFAULT_LABELS = {
|
|
17
|
+
decrease: "Decrement",
|
|
18
|
+
increase: "Increment",
|
|
19
|
+
updating: "Updating",
|
|
20
|
+
clear: "Clear"
|
|
21
|
+
};
|
|
22
|
+
function clamp(n, lo, hi) {
|
|
23
|
+
const low = Math.max(lo, n);
|
|
24
|
+
return hi === void 0 ? low : Math.min(hi, low);
|
|
25
|
+
}
|
|
26
|
+
function tidy(n) {
|
|
27
|
+
return Number(n.toFixed(6));
|
|
28
|
+
}
|
|
29
|
+
function Stepper({
|
|
30
|
+
value,
|
|
31
|
+
defaultValue,
|
|
32
|
+
onValueChange,
|
|
33
|
+
min = 0,
|
|
34
|
+
max,
|
|
35
|
+
step = 1,
|
|
36
|
+
size: sizeProp,
|
|
37
|
+
platform,
|
|
38
|
+
disabled = false,
|
|
39
|
+
invalid = false,
|
|
40
|
+
success = false,
|
|
41
|
+
loading = false,
|
|
42
|
+
surface = "filled",
|
|
43
|
+
editable = false,
|
|
44
|
+
accessibilityLabel,
|
|
45
|
+
pill = false,
|
|
46
|
+
motion = "full",
|
|
47
|
+
leading,
|
|
48
|
+
trailing,
|
|
49
|
+
clearable = false,
|
|
50
|
+
onClear,
|
|
51
|
+
labels: labelsProp
|
|
52
|
+
}) {
|
|
53
|
+
const labels = useLabels("stepper", DEFAULT_LABELS, labelsProp);
|
|
54
|
+
const isControlled = value !== void 0;
|
|
55
|
+
const [internal, setInternal] = React.useState(defaultValue ?? min);
|
|
56
|
+
const current = clamp(isControlled ? value : internal, min, max);
|
|
57
|
+
const theme = useLoamTheme("stepper");
|
|
58
|
+
const android = isAndroidIdiom(theme, platform);
|
|
59
|
+
const size = sizeProp ?? (android ? "md" : "sm");
|
|
60
|
+
const { styles } = useStyles(sheet, { size, pill });
|
|
61
|
+
const [focused, setFocused] = React.useState(false);
|
|
62
|
+
const isLoading = loading && !disabled;
|
|
63
|
+
const isInvalid = !isLoading && invalid;
|
|
64
|
+
const isValid = !isLoading && !invalid && success;
|
|
65
|
+
const atMin = current <= min;
|
|
66
|
+
const atMax = max !== void 0 && current >= max;
|
|
67
|
+
const setValue = React.useCallback(
|
|
68
|
+
(next) => {
|
|
69
|
+
const clamped = clamp(tidy(next), min, max);
|
|
70
|
+
if (clamped === current) return;
|
|
71
|
+
if (!isControlled) setInternal(clamped);
|
|
72
|
+
onValueChange?.(clamped);
|
|
73
|
+
},
|
|
74
|
+
[current, isControlled, max, min, onValueChange]
|
|
75
|
+
);
|
|
76
|
+
const rollH = ROLL_H[size];
|
|
77
|
+
const decrement = () => {
|
|
78
|
+
haptics.impact("light");
|
|
79
|
+
setValue(current - step);
|
|
80
|
+
};
|
|
81
|
+
const increment = () => {
|
|
82
|
+
haptics.impact("light");
|
|
83
|
+
setValue(current + step);
|
|
84
|
+
};
|
|
85
|
+
const minusScale = React.useRef(new Animated.Value(1)).current;
|
|
86
|
+
const plusScale = React.useRef(new Animated.Value(1)).current;
|
|
87
|
+
const press = (target, to) => Animated.timing(target, {
|
|
88
|
+
toValue: to,
|
|
89
|
+
duration: theme.duration.fast,
|
|
90
|
+
easing: Easing.bezier(...theme.easing.base),
|
|
91
|
+
useNativeDriver: true
|
|
92
|
+
}).start();
|
|
93
|
+
const [text, setText] = React.useState(String(current));
|
|
94
|
+
React.useEffect(() => {
|
|
95
|
+
setText(String(current));
|
|
96
|
+
}, [current]);
|
|
97
|
+
const commit = () => {
|
|
98
|
+
const parsed = Number(text);
|
|
99
|
+
if (text.trim() === "" || Number.isNaN(parsed)) {
|
|
100
|
+
setText(String(current));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
setValue(parsed);
|
|
104
|
+
};
|
|
105
|
+
const iconSize = theme.ctl.icon[size];
|
|
106
|
+
const iconColor = (dim) => disabled || dim ? theme.color.text3 : theme.color.text;
|
|
107
|
+
const hit = android ? Math.max(theme.hit[size], theme.space[48]) : theme.hit[size];
|
|
108
|
+
const slop = Math.max(0, (hit - (theme.ctl[size] - theme.space[8])) / 2);
|
|
109
|
+
const ripple = android ? { color: theme.state.pressed, borderless: true, radius: hit / 2 } : void 0;
|
|
110
|
+
const valueFont = {
|
|
111
|
+
fontSize: (android ? ANDROID_VALUE_FS : IOS_VALUE_FS)[size],
|
|
112
|
+
fontWeight: android ? theme.fontWeight.medium : theme.fontWeight.semibold
|
|
113
|
+
};
|
|
114
|
+
return (
|
|
115
|
+
// The adjustable/slider semantics live on the value readout (a sibling of
|
|
116
|
+
// the +/- buttons), never on this wrapper — a slider must not contain nested
|
|
117
|
+
// interactive controls (WCAG nested-interactive). The wrapper stays a plain
|
|
118
|
+
// container with no role/label so its `<div>` carries no prohibited aria-label.
|
|
119
|
+
/* @__PURE__ */ jsxs(
|
|
120
|
+
View,
|
|
121
|
+
{
|
|
122
|
+
"aria-busy": isLoading || void 0,
|
|
123
|
+
style: [
|
|
124
|
+
styles.container,
|
|
125
|
+
surface !== "filled" ? { backgroundColor: fieldSurfaceFill(theme, surface) } : null,
|
|
126
|
+
surface === "ghost" ? { borderColor: theme.color.borderStrong } : null,
|
|
127
|
+
focused && { borderColor: theme.focus.ringColor },
|
|
128
|
+
isLoading && { borderColor: theme.focus.ringColor },
|
|
129
|
+
isInvalid && { borderColor: theme.color.danger },
|
|
130
|
+
isValid && { borderColor: theme.color.good },
|
|
131
|
+
disabled && styles.containerDisabled
|
|
132
|
+
],
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ jsx(
|
|
135
|
+
Pressable,
|
|
136
|
+
{
|
|
137
|
+
accessibilityRole: "button",
|
|
138
|
+
accessibilityLabel: labels.decrease,
|
|
139
|
+
accessibilityState: { disabled: disabled || atMin },
|
|
140
|
+
disabled: disabled || atMin,
|
|
141
|
+
onPress: disabled || atMin ? void 0 : decrement,
|
|
142
|
+
onPressIn: disabled || atMin ? void 0 : () => press(minusScale, BUTTON_PRESS_SCALE),
|
|
143
|
+
onPressOut: disabled || atMin ? void 0 : () => press(minusScale, 1),
|
|
144
|
+
hitSlop: slop,
|
|
145
|
+
android_ripple: ripple,
|
|
146
|
+
children: /* @__PURE__ */ jsx(Animated.View, { style: [styles.button, { transform: [{ scale: minusScale }] }], children: /* @__PURE__ */ jsx(Icon, { name: "minus", size: iconSize, color: iconColor(atMin) }) })
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
leading,
|
|
150
|
+
isLoading ? /* @__PURE__ */ jsx(View, { style: [styles.valueWrap, { height: rollH }], children: /* @__PURE__ */ jsx(
|
|
151
|
+
ActivityIndicator,
|
|
152
|
+
{
|
|
153
|
+
testID: "stepper-spinner",
|
|
154
|
+
size: "small",
|
|
155
|
+
color: theme.color.accent,
|
|
156
|
+
accessibilityLabel: labels.updating
|
|
157
|
+
}
|
|
158
|
+
) }) : editable ? /* @__PURE__ */ jsx(
|
|
159
|
+
TextInput,
|
|
160
|
+
{
|
|
161
|
+
accessibilityLabel,
|
|
162
|
+
editable: !disabled,
|
|
163
|
+
keyboardType: "numeric",
|
|
164
|
+
value: text,
|
|
165
|
+
onChangeText: setText,
|
|
166
|
+
onEndEditing: commit,
|
|
167
|
+
onFocus: () => setFocused(true),
|
|
168
|
+
onBlur: () => {
|
|
169
|
+
setFocused(false);
|
|
170
|
+
commit();
|
|
171
|
+
},
|
|
172
|
+
"aria-invalid": invalid || void 0,
|
|
173
|
+
style: [styles.value, valueFont]
|
|
174
|
+
}
|
|
175
|
+
) : (
|
|
176
|
+
// Clipping wrapper: overflow:hidden masks the rolling digits. This
|
|
177
|
+
// readout carries the adjustable/slider semantics (role + value) as a
|
|
178
|
+
// sibling of the buttons, so no interactive control is nested inside it,
|
|
179
|
+
// and the roll itself is decorative (the value lives on this wrapper).
|
|
180
|
+
/* @__PURE__ */ jsx(
|
|
181
|
+
View,
|
|
182
|
+
{
|
|
183
|
+
style: [styles.valueWrap, { height: rollH }],
|
|
184
|
+
accessibilityRole: "adjustable",
|
|
185
|
+
accessibilityLabel,
|
|
186
|
+
accessibilityValue: { min, max, now: current },
|
|
187
|
+
accessibilityState: { disabled },
|
|
188
|
+
"aria-valuemin": min,
|
|
189
|
+
"aria-valuemax": max,
|
|
190
|
+
"aria-valuenow": current,
|
|
191
|
+
children: /* @__PURE__ */ jsx(
|
|
192
|
+
NumberRoll,
|
|
193
|
+
{
|
|
194
|
+
value: current,
|
|
195
|
+
textStyle: [styles.valueText, valueFont],
|
|
196
|
+
motion,
|
|
197
|
+
decorative: true
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
),
|
|
203
|
+
clearable && !disabled && !isLoading && !editable && current > min ? /* @__PURE__ */ jsx(
|
|
204
|
+
Pressable,
|
|
205
|
+
{
|
|
206
|
+
accessibilityRole: "button",
|
|
207
|
+
accessibilityLabel: labels.clear,
|
|
208
|
+
onPress: () => {
|
|
209
|
+
haptics.impact("light");
|
|
210
|
+
setValue(min);
|
|
211
|
+
onClear?.();
|
|
212
|
+
},
|
|
213
|
+
hitSlop: slop,
|
|
214
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "x", size: iconSize, color: theme.color.text3 })
|
|
215
|
+
}
|
|
216
|
+
) : null,
|
|
217
|
+
trailing,
|
|
218
|
+
/* @__PURE__ */ jsx(
|
|
219
|
+
Pressable,
|
|
220
|
+
{
|
|
221
|
+
accessibilityRole: "button",
|
|
222
|
+
accessibilityLabel: labels.increase,
|
|
223
|
+
accessibilityState: { disabled: disabled || atMax },
|
|
224
|
+
disabled: disabled || atMax,
|
|
225
|
+
onPress: disabled || atMax ? void 0 : increment,
|
|
226
|
+
onPressIn: disabled || atMax ? void 0 : () => press(plusScale, BUTTON_PRESS_SCALE),
|
|
227
|
+
onPressOut: disabled || atMax ? void 0 : () => press(plusScale, 1),
|
|
228
|
+
hitSlop: slop,
|
|
229
|
+
android_ripple: ripple,
|
|
230
|
+
children: /* @__PURE__ */ jsx(Animated.View, { style: [styles.button, { transform: [{ scale: plusScale }] }], children: /* @__PURE__ */ jsx(Icon, { name: "plus", size: iconSize, color: iconColor(atMax) }) })
|
|
231
|
+
}
|
|
232
|
+
)
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
)
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
var sheet = createStyleSheet((theme) => ({
|
|
239
|
+
// A tinted tray, not an outlined box: the reference gives the wrapper a
|
|
240
|
+
// `surface2` fill, `radius.md` corners (or `radius.full` for pill), 4px
|
|
241
|
+
// padding and no border.
|
|
242
|
+
container: {
|
|
243
|
+
flexDirection: "row",
|
|
244
|
+
alignItems: "center",
|
|
245
|
+
alignSelf: "flex-start",
|
|
246
|
+
gap: theme.space.s1,
|
|
247
|
+
// Tray = tier height; the 1.5 edge (transparent at rest, accent on focus,
|
|
248
|
+
// danger when invalid) plus this padding leave buttons at tier − 8.
|
|
249
|
+
paddingHorizontal: theme.space[4] - theme.borderWidth.strong,
|
|
250
|
+
borderWidth: theme.borderWidth.strong,
|
|
251
|
+
borderColor: "transparent",
|
|
252
|
+
backgroundColor: theme.color.surface2,
|
|
253
|
+
variants: {
|
|
254
|
+
pill: {
|
|
255
|
+
true: { borderRadius: theme.radius.full },
|
|
256
|
+
false: {}
|
|
257
|
+
},
|
|
258
|
+
size: Object.fromEntries(
|
|
259
|
+
["xs", "sm", "md", "lg"].map((s) => [
|
|
260
|
+
s,
|
|
261
|
+
{ height: theme.ctl[s], borderRadius: theme.ctl.r[s] }
|
|
262
|
+
])
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
containerDisabled: { opacity: theme.state.disabledOpacity },
|
|
267
|
+
// Each button is a raised `surface` card with `radius.sm` corners
|
|
268
|
+
// (or `radius.full` when pill — the reference uses `50%` for a square).
|
|
269
|
+
button: {
|
|
270
|
+
alignItems: "center",
|
|
271
|
+
justifyContent: "center",
|
|
272
|
+
backgroundColor: theme.color.surface,
|
|
273
|
+
// `shadow.sm` is zeroed under high contrast and `surface` on the track it
|
|
274
|
+
// sits in is not a boundary, so the button needs a real edge there —
|
|
275
|
+
// `edge.neutral`, which is `transparent` until the preference flips.
|
|
276
|
+
borderWidth: theme.borderWidth.base,
|
|
277
|
+
borderColor: theme.edge.neutral,
|
|
278
|
+
...theme.shadow.sm,
|
|
279
|
+
variants: {
|
|
280
|
+
// Square buttons at tier − 8 with corners tier r − 4 (Final 05).
|
|
281
|
+
size: Object.fromEntries(
|
|
282
|
+
["xs", "sm", "md", "lg"].map((s) => [
|
|
283
|
+
s,
|
|
284
|
+
{
|
|
285
|
+
width: theme.ctl[s] - theme.space[8],
|
|
286
|
+
height: theme.ctl[s] - theme.space[8],
|
|
287
|
+
borderRadius: Math.max(0, theme.ctl.r[s] - theme.space[4])
|
|
288
|
+
}
|
|
289
|
+
])
|
|
290
|
+
),
|
|
291
|
+
pill: {
|
|
292
|
+
true: { borderRadius: theme.radius.full },
|
|
293
|
+
false: {}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
// Editable case: TextInput shares font/size/minWidth.
|
|
298
|
+
value: {
|
|
299
|
+
textAlign: "center",
|
|
300
|
+
fontFamily: theme.font.sans,
|
|
301
|
+
fontVariant: ["tabular-nums"],
|
|
302
|
+
color: theme.color.text,
|
|
303
|
+
variants: {
|
|
304
|
+
size: {
|
|
305
|
+
xs: { minWidth: theme.space[32], fontSize: theme.fontSize[12] },
|
|
306
|
+
sm: { minWidth: theme.space[36], fontSize: theme.fontSize[14] },
|
|
307
|
+
md: { minWidth: theme.space[44], fontSize: theme.fontSize[16] },
|
|
308
|
+
lg: { minWidth: theme.space[52], fontSize: theme.fontSize[20] }
|
|
309
|
+
},
|
|
310
|
+
pill: { true: {}, false: {} }
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
// Roll container: clips the entering/exiting digits.
|
|
314
|
+
valueWrap: {
|
|
315
|
+
overflow: "hidden",
|
|
316
|
+
alignItems: "center",
|
|
317
|
+
justifyContent: "center",
|
|
318
|
+
variants: {
|
|
319
|
+
size: {
|
|
320
|
+
xs: { height: theme.space[18], minWidth: theme.space[32] },
|
|
321
|
+
sm: { height: theme.space[20], minWidth: theme.space[36] },
|
|
322
|
+
md: { height: theme.space[24], minWidth: theme.space[44] },
|
|
323
|
+
lg: { height: theme.space[28], minWidth: theme.space[52] }
|
|
324
|
+
},
|
|
325
|
+
pill: { true: {}, false: {} }
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
// Text inside valueWrap (font only, no minWidth — that lives on valueWrap).
|
|
329
|
+
valueText: {
|
|
330
|
+
textAlign: "center",
|
|
331
|
+
fontFamily: theme.font.sans,
|
|
332
|
+
fontVariant: ["tabular-nums"],
|
|
333
|
+
color: theme.color.text,
|
|
334
|
+
variants: {
|
|
335
|
+
size: {
|
|
336
|
+
xs: { fontSize: theme.fontSize[12] },
|
|
337
|
+
sm: { fontSize: theme.fontSize[14] },
|
|
338
|
+
md: { fontSize: theme.fontSize[16] },
|
|
339
|
+
lg: { fontSize: theme.fontSize[20] }
|
|
340
|
+
},
|
|
341
|
+
pill: { true: {}, false: {} }
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
// Absolutely-positioned overlay for the exiting digit.
|
|
345
|
+
valueAbsolute: {
|
|
346
|
+
position: "absolute",
|
|
347
|
+
left: 0,
|
|
348
|
+
right: 0
|
|
349
|
+
}
|
|
350
|
+
}));
|
|
351
|
+
|
|
352
|
+
export { Stepper };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Input } from './chunk-
|
|
1
|
+
import { useInputPlatform, Input } from './chunk-KXLDK6HB.js';
|
|
2
2
|
import { useLabels } from './chunk-APCWFOZW.js';
|
|
3
|
-
import { Icon } from './chunk-
|
|
3
|
+
import { Icon } from './chunk-PCEFCOLN.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { Animated, View, Pressable, Text } from 'react-native';
|
|
5
|
+
import { Animated, View, Pressable, Text, ActivityIndicator } from 'react-native';
|
|
6
6
|
import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
@@ -12,8 +12,9 @@ var DEFAULT_LABELS = {
|
|
|
12
12
|
failure: "Couldn't save that change. Your edit is still here, so you can try again.",
|
|
13
13
|
readValue: (label, value) => `${label}, ${value}`
|
|
14
14
|
};
|
|
15
|
-
function valueFontSize(theme, size) {
|
|
16
|
-
|
|
15
|
+
function valueFontSize(theme, size, os) {
|
|
16
|
+
if (size === "lg") return theme.fontSize[os === "ios" ? 17 : 16];
|
|
17
|
+
return size === "md" ? theme.fontSize[16] : theme.fontSize[14];
|
|
17
18
|
}
|
|
18
19
|
function InlineEdit({
|
|
19
20
|
value,
|
|
@@ -21,18 +22,24 @@ function InlineEdit({
|
|
|
21
22
|
placeholder,
|
|
22
23
|
label,
|
|
23
24
|
as = "text",
|
|
24
|
-
size = "
|
|
25
|
+
size = "lg",
|
|
25
26
|
disabled = false,
|
|
26
27
|
multiline = false,
|
|
27
28
|
optimistic = true,
|
|
28
29
|
failureMessage,
|
|
29
30
|
motion = "full",
|
|
31
|
+
readOnly = false,
|
|
32
|
+
loading = false,
|
|
33
|
+
defaultEditing = false,
|
|
34
|
+
surface,
|
|
30
35
|
labels: labelsProp
|
|
31
36
|
}) {
|
|
32
37
|
const labels = useLabels("inlineEdit", DEFAULT_LABELS, labelsProp);
|
|
33
38
|
const theme = useLoamTheme("inline-edit");
|
|
39
|
+
const os = useInputPlatform();
|
|
34
40
|
const { styles } = useStyles(sheet, { size, disabled, multiline });
|
|
35
|
-
const [editing, setEditing] = React.useState(
|
|
41
|
+
const [editing, setEditing] = React.useState(defaultEditing);
|
|
42
|
+
const focusOnEdit = React.useRef(!defaultEditing);
|
|
36
43
|
const [draft, setDraft] = React.useState(value);
|
|
37
44
|
const [optimisticValue, setOptimisticValue] = React.useState(null);
|
|
38
45
|
const [failed, setFailed] = React.useState(false);
|
|
@@ -49,9 +56,10 @@ function InlineEdit({
|
|
|
49
56
|
displayRef.current = display;
|
|
50
57
|
const skipBlurRef = React.useRef(false);
|
|
51
58
|
const enterEdit = () => {
|
|
52
|
-
if (disabled) return;
|
|
59
|
+
if (disabled || readOnly || loading) return;
|
|
53
60
|
setFailed(false);
|
|
54
61
|
setDraft(display);
|
|
62
|
+
focusOnEdit.current = true;
|
|
55
63
|
setEditing(true);
|
|
56
64
|
};
|
|
57
65
|
const finalize = (next) => {
|
|
@@ -113,7 +121,8 @@ function InlineEdit({
|
|
|
113
121
|
/* @__PURE__ */ jsx(
|
|
114
122
|
Input,
|
|
115
123
|
{
|
|
116
|
-
autoFocus:
|
|
124
|
+
autoFocus: focusOnEdit.current,
|
|
125
|
+
surface,
|
|
117
126
|
value: draft,
|
|
118
127
|
onChangeText: (t) => {
|
|
119
128
|
setDraft(t);
|
|
@@ -168,12 +177,13 @@ function InlineEdit({
|
|
|
168
177
|
{
|
|
169
178
|
accessibilityRole: "button",
|
|
170
179
|
accessibilityLabel: isPlaceholder ? label : labels.readValue(label, display),
|
|
171
|
-
accessibilityState: { disabled },
|
|
180
|
+
accessibilityState: { disabled, busy: loading },
|
|
181
|
+
"aria-busy": loading || void 0,
|
|
172
182
|
disabled,
|
|
173
183
|
onPress: enterEdit,
|
|
174
184
|
style: ({ pressed }) => [
|
|
175
185
|
styles.read,
|
|
176
|
-
!disabled && pressed && { backgroundColor: theme.state.pressed }
|
|
186
|
+
!disabled && !readOnly && !loading && pressed && { backgroundColor: theme.state.pressed }
|
|
177
187
|
],
|
|
178
188
|
children: [
|
|
179
189
|
/* @__PURE__ */ jsx(
|
|
@@ -182,14 +192,14 @@ function InlineEdit({
|
|
|
182
192
|
numberOfLines: multiline ? void 0 : 1,
|
|
183
193
|
style: [
|
|
184
194
|
styles.value,
|
|
185
|
-
{ fontSize: valueFontSize(theme, size), fontWeight },
|
|
195
|
+
{ fontSize: valueFontSize(theme, size, os), fontWeight },
|
|
186
196
|
isPlaceholder && { color: theme.color.text3 },
|
|
187
197
|
disabled && { color: theme.color.text3 }
|
|
188
198
|
],
|
|
189
199
|
children: isPlaceholder ? placeholder ?? "" : display
|
|
190
200
|
}
|
|
191
201
|
),
|
|
192
|
-
!disabled ? /* @__PURE__ */ jsx(Icon, { name: "edit", size: iconSize, color: theme.color.text3 }) : null
|
|
202
|
+
loading ? /* @__PURE__ */ jsx(ActivityIndicator, { "aria-hidden": true, size: "small", color: theme.color.text3 }) : !disabled && !readOnly ? /* @__PURE__ */ jsx(Icon, { name: "edit", size: iconSize, color: theme.color.text3 }) : null
|
|
193
203
|
]
|
|
194
204
|
}
|
|
195
205
|
);
|
|
@@ -200,7 +210,7 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
200
210
|
fontFamily: theme.font.sans,
|
|
201
211
|
fontSize: theme.type.footnote.fontSize,
|
|
202
212
|
lineHeight: theme.type.footnote.lineHeight,
|
|
203
|
-
color: theme.color.
|
|
213
|
+
color: theme.color.dangerOnSoft
|
|
204
214
|
},
|
|
205
215
|
editRow: { flexDirection: "row", alignItems: "flex-start", gap: theme.space.s2 },
|
|
206
216
|
field: { flex: 1 },
|