@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,13 +1,15 @@
|
|
|
1
1
|
import { DRAG_CURSOR } from './chunk-KTAC4MGE.js';
|
|
2
|
-
import {
|
|
2
|
+
import { Sheet } from './chunk-B7JZ3N5G.js';
|
|
3
|
+
import { Input } from './chunk-KXLDK6HB.js';
|
|
3
4
|
import { haptics } from './chunk-NY2U3PBI.js';
|
|
4
5
|
import { useLabels } from './chunk-APCWFOZW.js';
|
|
5
|
-
import { Icon } from './chunk-
|
|
6
|
+
import { Icon } from './chunk-PCEFCOLN.js';
|
|
7
|
+
import { useResolvedMotion } from './chunk-J64KGCGX.js';
|
|
6
8
|
import * as React from 'react';
|
|
7
|
-
import {
|
|
9
|
+
import { View, Pressable, Text, PanResponder, StyleSheet, Platform, Animated, Easing } from 'react-native';
|
|
8
10
|
import { Svg, Defs, LinearGradient, Stop, Rect, Pattern } from 'react-native-svg';
|
|
9
11
|
import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
|
|
10
|
-
import {
|
|
12
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
13
|
|
|
12
14
|
var GEOMETRY = {
|
|
13
15
|
sm: { plane: 120, hue: 12, thumb: 16 },
|
|
@@ -99,6 +101,8 @@ var DEFAULT_LABELS = {
|
|
|
99
101
|
hexError: "Enter a 6-digit hex, like #4A7C59",
|
|
100
102
|
savedColours: "Saved colours",
|
|
101
103
|
useSaved: (hex) => `Use saved colour ${hex}`,
|
|
104
|
+
presetColours: "Preset colours",
|
|
105
|
+
usePreset: (hex) => `Use preset colour ${hex}`,
|
|
102
106
|
saveColour: "Save this colour"
|
|
103
107
|
};
|
|
104
108
|
var CHECK = 4;
|
|
@@ -110,22 +114,31 @@ function Checker({ id, dark }) {
|
|
|
110
114
|
/* @__PURE__ */ jsx(Rect, { x: CHECK, y: CHECK, width: CHECK, height: CHECK, fill: b })
|
|
111
115
|
] });
|
|
112
116
|
}
|
|
113
|
-
function
|
|
117
|
+
function ColorFieldBody({
|
|
114
118
|
value,
|
|
115
119
|
defaultValue = "#4A7C59",
|
|
116
120
|
onValueChange,
|
|
117
121
|
showInput = true,
|
|
122
|
+
surface = "filled",
|
|
118
123
|
disabled = false,
|
|
124
|
+
readOnly = false,
|
|
125
|
+
hint,
|
|
126
|
+
error,
|
|
127
|
+
success = false,
|
|
128
|
+
loading = false,
|
|
129
|
+
placeholder,
|
|
119
130
|
size = "md",
|
|
120
131
|
accessibilityLabel,
|
|
121
132
|
style,
|
|
122
133
|
savedColors,
|
|
134
|
+
presets,
|
|
123
135
|
onSavedColorsChange,
|
|
124
136
|
showAlpha = false,
|
|
125
137
|
alpha: alphaProp,
|
|
126
138
|
defaultAlpha = 1,
|
|
127
139
|
onAlphaChange,
|
|
128
|
-
labels: labelsProp
|
|
140
|
+
labels: labelsProp,
|
|
141
|
+
motion = "full"
|
|
129
142
|
}) {
|
|
130
143
|
const labels = useLabels("colorField", DEFAULT_LABELS, labelsProp);
|
|
131
144
|
const isControlled = value !== void 0;
|
|
@@ -147,8 +160,9 @@ function ColorField({
|
|
|
147
160
|
const hueBox = React.useRef({ w: 0, x: 0 });
|
|
148
161
|
const hsvRef = React.useRef(hsv);
|
|
149
162
|
hsvRef.current = hsv;
|
|
150
|
-
const
|
|
151
|
-
disabledRef
|
|
163
|
+
const locked = disabled || readOnly;
|
|
164
|
+
const disabledRef = React.useRef(locked);
|
|
165
|
+
disabledRef.current = locked;
|
|
152
166
|
const editingHex = React.useRef(false);
|
|
153
167
|
const [hexTouched, setHexTouched] = React.useState(false);
|
|
154
168
|
const [planeW, setPlaneW] = React.useState(0);
|
|
@@ -220,8 +234,10 @@ function ColorField({
|
|
|
220
234
|
else return false;
|
|
221
235
|
return true;
|
|
222
236
|
}
|
|
223
|
-
if (key === "ArrowRight" || key === "ArrowUp")
|
|
224
|
-
|
|
237
|
+
if (key === "ArrowRight" || key === "ArrowUp")
|
|
238
|
+
commit({ ...cur, h: clamp(cur.h + step, 0, 360) });
|
|
239
|
+
else if (key === "ArrowLeft" || key === "ArrowDown")
|
|
240
|
+
commit({ ...cur, h: clamp(cur.h - step, 0, 360) });
|
|
225
241
|
else if (key === "Home") commit({ ...cur, h: 0 });
|
|
226
242
|
else if (key === "End") commit({ ...cur, h: 360 });
|
|
227
243
|
else return false;
|
|
@@ -308,7 +324,9 @@ function ColorField({
|
|
|
308
324
|
};
|
|
309
325
|
const onAlphaAction = (e) => {
|
|
310
326
|
if (disabledRef.current) return;
|
|
311
|
-
commitAlpha.current(
|
|
327
|
+
commitAlpha.current(
|
|
328
|
+
alphaRefVal.current + (e.nativeEvent.actionName === "increment" ? 0.1 : -0.1)
|
|
329
|
+
);
|
|
312
330
|
};
|
|
313
331
|
const saveCurrent = () => {
|
|
314
332
|
const key = hex.toUpperCase();
|
|
@@ -316,7 +334,7 @@ function ColorField({
|
|
|
316
334
|
onSavedColorsChange?.([key, ...rest]);
|
|
317
335
|
};
|
|
318
336
|
const pickSaved = (c) => {
|
|
319
|
-
if (
|
|
337
|
+
if (locked) return;
|
|
320
338
|
const next = hexToHsv(c, hsvRef.current.h);
|
|
321
339
|
if (next) commit(next);
|
|
322
340
|
};
|
|
@@ -347,9 +365,9 @@ function ColorField({
|
|
|
347
365
|
"aria-valuemax": 100,
|
|
348
366
|
"aria-valuenow": Math.round(hsv.v),
|
|
349
367
|
"aria-valuetext": labels.planeValue(Math.round(hsv.s), Math.round(hsv.v)),
|
|
350
|
-
style: [styles.plane, !
|
|
351
|
-
...
|
|
352
|
-
...{ tabIndex:
|
|
368
|
+
style: [styles.plane, !locked && DRAG_CURSOR],
|
|
369
|
+
...locked ? {} : planePan.panHandlers,
|
|
370
|
+
...{ tabIndex: locked ? -1 : 0, onKeyDown: keyHandler("plane") },
|
|
353
371
|
children: [
|
|
354
372
|
planeW > 0 ? /* @__PURE__ */ jsxs(Svg, { width: planeW, height: geo.plane, style: StyleSheet.absoluteFill, children: [
|
|
355
373
|
/* @__PURE__ */ jsxs(Defs, { children: [
|
|
@@ -392,9 +410,9 @@ function ColorField({
|
|
|
392
410
|
"aria-valuenow": Math.round(hsv.h),
|
|
393
411
|
accessibilityActions: hueActions,
|
|
394
412
|
onAccessibilityAction: onHueAction,
|
|
395
|
-
style: [styles.hue, !
|
|
396
|
-
...
|
|
397
|
-
...{ tabIndex:
|
|
413
|
+
style: [styles.hue, !locked && DRAG_CURSOR],
|
|
414
|
+
...locked ? {} : huePan.panHandlers,
|
|
415
|
+
...{ tabIndex: locked ? -1 : 0, onKeyDown: keyHandler("hue") },
|
|
398
416
|
children: [
|
|
399
417
|
hueW > 0 ? /* @__PURE__ */ jsxs(Svg, { width: hueW, height: geo.hue, style: StyleSheet.absoluteFill, children: [
|
|
400
418
|
/* @__PURE__ */ jsx(Defs, { children: /* @__PURE__ */ jsxs(LinearGradient, { id: "loam-cf-hue", x1: "0", y1: "0", x2: "1", y2: "0", children: [
|
|
@@ -429,7 +447,12 @@ function ColorField({
|
|
|
429
447
|
onLayout: onAlphaLayout,
|
|
430
448
|
accessibilityRole: "adjustable",
|
|
431
449
|
accessibilityLabel: accessibilityLabel ? labels.opacityNamed(accessibilityLabel) : labels.opacity,
|
|
432
|
-
accessibilityValue: {
|
|
450
|
+
accessibilityValue: {
|
|
451
|
+
min: 0,
|
|
452
|
+
max: 100,
|
|
453
|
+
now: Math.round(alpha * 100),
|
|
454
|
+
text: labels.opacityValue(Math.round(alpha * 100))
|
|
455
|
+
},
|
|
433
456
|
accessibilityState: { disabled },
|
|
434
457
|
"aria-valuemin": 0,
|
|
435
458
|
"aria-valuemax": 100,
|
|
@@ -437,9 +460,9 @@ function ColorField({
|
|
|
437
460
|
"aria-valuetext": labels.opacityValue(Math.round(alpha * 100)),
|
|
438
461
|
accessibilityActions: hueActions,
|
|
439
462
|
onAccessibilityAction: onAlphaAction,
|
|
440
|
-
style: [styles.hue, !
|
|
441
|
-
...
|
|
442
|
-
...{ tabIndex:
|
|
463
|
+
style: [styles.hue, !locked && DRAG_CURSOR],
|
|
464
|
+
...locked ? {} : alphaPan.panHandlers,
|
|
465
|
+
...{ tabIndex: locked ? -1 : 0, onKeyDown: onAlphaKey },
|
|
443
466
|
children: [
|
|
444
467
|
alphaW > 0 ? /* @__PURE__ */ jsxs(Svg, { width: alphaW, height: geo.hue, style: StyleSheet.absoluteFill, children: [
|
|
445
468
|
/* @__PURE__ */ jsxs(Defs, { children: [
|
|
@@ -449,8 +472,28 @@ function ColorField({
|
|
|
449
472
|
/* @__PURE__ */ jsx(Stop, { offset: "1", stopColor: hex, stopOpacity: 1 })
|
|
450
473
|
] })
|
|
451
474
|
] }),
|
|
452
|
-
/* @__PURE__ */ jsx(
|
|
453
|
-
|
|
475
|
+
/* @__PURE__ */ jsx(
|
|
476
|
+
Rect,
|
|
477
|
+
{
|
|
478
|
+
x: "0",
|
|
479
|
+
y: "0",
|
|
480
|
+
width: alphaW,
|
|
481
|
+
height: geo.hue,
|
|
482
|
+
rx: geo.hue / 2,
|
|
483
|
+
fill: "url(#loam-cf-check)"
|
|
484
|
+
}
|
|
485
|
+
),
|
|
486
|
+
/* @__PURE__ */ jsx(
|
|
487
|
+
Rect,
|
|
488
|
+
{
|
|
489
|
+
x: "0",
|
|
490
|
+
y: "0",
|
|
491
|
+
width: alphaW,
|
|
492
|
+
height: geo.hue,
|
|
493
|
+
rx: geo.hue / 2,
|
|
494
|
+
fill: "url(#loam-cf-alpha)"
|
|
495
|
+
}
|
|
496
|
+
)
|
|
454
497
|
] }) : null,
|
|
455
498
|
/* @__PURE__ */ jsx(
|
|
456
499
|
View,
|
|
@@ -468,12 +511,22 @@ function ColorField({
|
|
|
468
511
|
showInput ? /* @__PURE__ */ jsxs(View, { style: styles.row, children: [
|
|
469
512
|
showAlpha ? /* @__PURE__ */ jsx(View, { style: [styles.preview, styles.alphaPreview], testID: "color-field-alpha-preview", children: [false, true].map((dark) => /* @__PURE__ */ jsxs(Svg, { width: "50%", height: "100%", children: [
|
|
470
513
|
/* @__PURE__ */ jsx(Defs, { children: /* @__PURE__ */ jsx(Checker, { id: dark ? "loam-cf-pd" : "loam-cf-pl", dark }) }),
|
|
471
|
-
/* @__PURE__ */ jsx(
|
|
514
|
+
/* @__PURE__ */ jsx(
|
|
515
|
+
Rect,
|
|
516
|
+
{
|
|
517
|
+
x: "0",
|
|
518
|
+
y: "0",
|
|
519
|
+
width: "100%",
|
|
520
|
+
height: "100%",
|
|
521
|
+
fill: `url(#${dark ? "loam-cf-pd" : "loam-cf-pl"})`
|
|
522
|
+
}
|
|
523
|
+
),
|
|
472
524
|
/* @__PURE__ */ jsx(Rect, { x: "0", y: "0", width: "100%", height: "100%", fill: hex, fillOpacity: alpha })
|
|
473
|
-
] }, String(dark))) }) : /* @__PURE__ */ jsx(PreviewSwatch, { color: hex, style: styles.preview }),
|
|
525
|
+
] }, String(dark))) }) : /* @__PURE__ */ jsx(PreviewSwatch, { color: hex, style: styles.preview, motion }),
|
|
474
526
|
/* @__PURE__ */ jsx(View, { style: styles.inputWrap, children: /* @__PURE__ */ jsx(
|
|
475
527
|
Input,
|
|
476
528
|
{
|
|
529
|
+
surface,
|
|
477
530
|
value: hexText,
|
|
478
531
|
onChangeText: onHexChange,
|
|
479
532
|
onFocus: () => {
|
|
@@ -484,61 +537,108 @@ function ColorField({
|
|
|
484
537
|
setHexTouched(true);
|
|
485
538
|
setHexText(hex);
|
|
486
539
|
},
|
|
487
|
-
editable: !
|
|
540
|
+
editable: !locked,
|
|
488
541
|
autoCapitalize: "characters",
|
|
489
542
|
autoCorrect: false,
|
|
490
543
|
maxLength: 7,
|
|
491
|
-
size: size === "sm" ? "
|
|
492
|
-
|
|
493
|
-
|
|
544
|
+
size: size === "sm" ? "md" : "lg",
|
|
545
|
+
placeholder,
|
|
546
|
+
loading,
|
|
547
|
+
success,
|
|
548
|
+
validationState: hexError || error ? "invalid" : "default",
|
|
549
|
+
message: error ?? (hexError ? labels.hexError : void 0),
|
|
494
550
|
showStatusIcon: false,
|
|
495
551
|
accessibilityLabel: labels.hexColour,
|
|
496
552
|
style: { fontFamily: theme.font.mono }
|
|
497
553
|
}
|
|
498
554
|
) })
|
|
499
555
|
] }) : null,
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
556
|
+
presets && presets.length > 0 ? /* @__PURE__ */ jsx(
|
|
557
|
+
View,
|
|
558
|
+
{
|
|
559
|
+
accessibilityRole: "radiogroup",
|
|
560
|
+
accessibilityLabel: labels.presetColours,
|
|
561
|
+
testID: "color-field-presets",
|
|
562
|
+
style: styles.saved,
|
|
563
|
+
children: presets.map((c) => {
|
|
564
|
+
const checked = c.toUpperCase() === hex.toUpperCase();
|
|
565
|
+
return /* @__PURE__ */ jsx(
|
|
566
|
+
Pressable,
|
|
567
|
+
{
|
|
568
|
+
accessibilityRole: "radio",
|
|
569
|
+
accessibilityLabel: labels.usePreset(c.toUpperCase()),
|
|
570
|
+
accessibilityState: { checked, disabled },
|
|
571
|
+
...Platform.OS === "web" ? { "aria-checked": checked } : null,
|
|
572
|
+
disabled: locked,
|
|
573
|
+
onPress: () => pickSaved(c),
|
|
574
|
+
hitSlop: theme.space[4],
|
|
575
|
+
style: [
|
|
576
|
+
styles.swatch,
|
|
577
|
+
{ backgroundColor: c },
|
|
578
|
+
checked ? styles.swatchChecked : null
|
|
579
|
+
]
|
|
580
|
+
},
|
|
581
|
+
c
|
|
582
|
+
);
|
|
583
|
+
})
|
|
584
|
+
}
|
|
585
|
+
) : null,
|
|
586
|
+
savedColors || onSavedColorsChange ? /* @__PURE__ */ jsxs(
|
|
587
|
+
View,
|
|
588
|
+
{
|
|
589
|
+
accessibilityRole: "group",
|
|
590
|
+
accessibilityLabel: labels.savedColours,
|
|
591
|
+
style: styles.saved,
|
|
592
|
+
children: [
|
|
593
|
+
(savedColors ?? []).map((c) => /* @__PURE__ */ jsx(
|
|
594
|
+
Pressable,
|
|
595
|
+
{
|
|
596
|
+
accessibilityRole: "button",
|
|
597
|
+
accessibilityLabel: labels.useSaved(c.toUpperCase()),
|
|
598
|
+
accessibilityState: { disabled },
|
|
599
|
+
disabled: locked,
|
|
600
|
+
onPress: () => pickSaved(c),
|
|
601
|
+
hitSlop: theme.space[4],
|
|
602
|
+
style: [styles.swatch, { backgroundColor: c }]
|
|
603
|
+
},
|
|
604
|
+
c
|
|
605
|
+
)),
|
|
606
|
+
onSavedColorsChange ? (
|
|
607
|
+
// A swatch-sized slot rather than a 30px button, so the row reads
|
|
608
|
+
// as one strip of equal squares with the next free slot at its end.
|
|
609
|
+
/* @__PURE__ */ jsx(
|
|
610
|
+
Pressable,
|
|
611
|
+
{
|
|
612
|
+
accessibilityRole: "button",
|
|
613
|
+
accessibilityLabel: labels.saveColour,
|
|
614
|
+
accessibilityState: { disabled },
|
|
615
|
+
disabled: locked,
|
|
616
|
+
onPress: saveCurrent,
|
|
617
|
+
hitSlop: theme.space[4],
|
|
618
|
+
style: ({ pressed }) => [
|
|
619
|
+
styles.swatch,
|
|
620
|
+
styles.saveSlot,
|
|
621
|
+
pressed ? { backgroundColor: theme.state.pressed } : null,
|
|
622
|
+
disabled ? { opacity: theme.state.disabledOpacity } : null
|
|
623
|
+
],
|
|
624
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "plus", size: 14, color: theme.color.text2 })
|
|
625
|
+
}
|
|
626
|
+
)
|
|
627
|
+
) : null
|
|
628
|
+
]
|
|
629
|
+
}
|
|
630
|
+
) : null,
|
|
631
|
+
hint ? /* @__PURE__ */ jsx(Text, { style: styles.hint, children: hint }) : null
|
|
537
632
|
] });
|
|
538
633
|
}
|
|
539
634
|
var HEAVY_SHADOW_RATIO = 1.2;
|
|
540
|
-
function PreviewSwatch({
|
|
635
|
+
function PreviewSwatch({
|
|
636
|
+
color,
|
|
637
|
+
style,
|
|
638
|
+
motion = "full"
|
|
639
|
+
}) {
|
|
541
640
|
const theme = useLoamTheme("color-field");
|
|
641
|
+
const animate = useResolvedMotion(motion, "color-field") !== "none";
|
|
542
642
|
const progress = React.useRef(new Animated.Value(1)).current;
|
|
543
643
|
const [range, setRange] = React.useState([color, color]);
|
|
544
644
|
React.useEffect(() => {
|
|
@@ -546,6 +646,10 @@ function PreviewSwatch({ color, style }) {
|
|
|
546
646
|
}, [color]);
|
|
547
647
|
React.useEffect(() => {
|
|
548
648
|
if (range[0] === range[1]) return;
|
|
649
|
+
if (!animate) {
|
|
650
|
+
progress.setValue(1);
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
549
653
|
progress.setValue(0);
|
|
550
654
|
Animated.timing(progress, {
|
|
551
655
|
toValue: 1,
|
|
@@ -553,11 +657,14 @@ function PreviewSwatch({ color, style }) {
|
|
|
553
657
|
easing: Easing.out(Easing.quad),
|
|
554
658
|
useNativeDriver: false
|
|
555
659
|
}).start();
|
|
556
|
-
}, [range, progress, theme.spring.fe.duration]);
|
|
660
|
+
}, [range, progress, animate, theme.spring.fe.duration]);
|
|
557
661
|
const backgroundColor = progress.interpolate({ inputRange: [0, 1], outputRange: range });
|
|
558
662
|
return /* @__PURE__ */ jsx(Animated.View, { style: [style, { backgroundColor }] });
|
|
559
663
|
}
|
|
560
664
|
var sheet = createStyleSheet((theme) => ({
|
|
665
|
+
hint: { fontFamily: theme.font.sans, fontSize: theme.fontSize[12], color: theme.color.text3 },
|
|
666
|
+
sheetTrigger: { flexDirection: "row", alignItems: "center", gap: theme.space[8] },
|
|
667
|
+
sheetHex: { fontFamily: theme.font.mono, fontSize: theme.fontSize[14], color: theme.color.text },
|
|
561
668
|
// The per-size `width` is the picker's preferred measure: a plane a little wider
|
|
562
669
|
// than it is tall, which also leaves the swatch and the hex field a line they
|
|
563
670
|
// both fit on. The caller's `style` merges after it, so it is a default rather
|
|
@@ -652,7 +759,7 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
652
759
|
preview: {
|
|
653
760
|
width: theme.space[32],
|
|
654
761
|
height: theme.space[32],
|
|
655
|
-
borderRadius: theme.radius.
|
|
762
|
+
borderRadius: theme.radius.xs,
|
|
656
763
|
borderWidth: theme.borderWidth.base,
|
|
657
764
|
borderColor: theme.color.border
|
|
658
765
|
},
|
|
@@ -673,10 +780,14 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
673
780
|
swatch: {
|
|
674
781
|
width: theme.space[24],
|
|
675
782
|
height: theme.space[24],
|
|
676
|
-
borderRadius: theme.radius.
|
|
783
|
+
borderRadius: theme.radius.xs,
|
|
677
784
|
borderWidth: theme.borderWidth.base,
|
|
678
785
|
borderColor: theme.color.border
|
|
679
786
|
},
|
|
787
|
+
swatchChecked: {
|
|
788
|
+
borderWidth: theme.borderWidth.heavy,
|
|
789
|
+
borderColor: theme.color.text
|
|
790
|
+
},
|
|
680
791
|
saveSlot: {
|
|
681
792
|
alignItems: "center",
|
|
682
793
|
justifyContent: "center",
|
|
@@ -684,5 +795,59 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
684
795
|
borderColor: theme.color.borderStrong
|
|
685
796
|
}
|
|
686
797
|
}));
|
|
798
|
+
function ColorField({
|
|
799
|
+
presentation = "inline",
|
|
800
|
+
...props
|
|
801
|
+
}) {
|
|
802
|
+
const [open, setOpen] = React.useState(false);
|
|
803
|
+
const [local, setLocal] = React.useState(props.value ?? props.defaultValue ?? "#4A7C59");
|
|
804
|
+
const { styles } = useStyles(sheet, {
|
|
805
|
+
size: props.size ?? "md",
|
|
806
|
+
disabled: props.disabled ?? false
|
|
807
|
+
});
|
|
808
|
+
const labels = useLabels("colorField", DEFAULT_LABELS, props.labels);
|
|
809
|
+
const current = props.value ?? local;
|
|
810
|
+
if (presentation === "inline") return /* @__PURE__ */ jsx(ColorFieldBody, { ...props });
|
|
811
|
+
const locked = Boolean(props.disabled || props.readOnly);
|
|
812
|
+
return /* @__PURE__ */ jsxs(View, { style: props.style, children: [
|
|
813
|
+
/* @__PURE__ */ jsxs(
|
|
814
|
+
Pressable,
|
|
815
|
+
{
|
|
816
|
+
accessibilityRole: "button",
|
|
817
|
+
accessibilityLabel: `${props.accessibilityLabel ?? labels.hexColour} ${current.toUpperCase()}`,
|
|
818
|
+
accessibilityState: { disabled: locked, expanded: open },
|
|
819
|
+
disabled: locked,
|
|
820
|
+
onPress: () => setOpen(true),
|
|
821
|
+
style: styles.sheetTrigger,
|
|
822
|
+
children: [
|
|
823
|
+
/* @__PURE__ */ jsx(PreviewSwatch, { color: current, style: styles.preview, motion: props.motion }),
|
|
824
|
+
/* @__PURE__ */ jsx(Text, { style: styles.sheetHex, children: current.toUpperCase() })
|
|
825
|
+
]
|
|
826
|
+
}
|
|
827
|
+
),
|
|
828
|
+
props.hint ? /* @__PURE__ */ jsx(Text, { style: styles.hint, children: props.hint }) : null,
|
|
829
|
+
/* @__PURE__ */ jsx(
|
|
830
|
+
Sheet,
|
|
831
|
+
{
|
|
832
|
+
open,
|
|
833
|
+
onClose: () => setOpen(false),
|
|
834
|
+
title: props.accessibilityLabel,
|
|
835
|
+
motion: props.motion,
|
|
836
|
+
children: /* @__PURE__ */ jsx(
|
|
837
|
+
ColorFieldBody,
|
|
838
|
+
{
|
|
839
|
+
...props,
|
|
840
|
+
style: void 0,
|
|
841
|
+
value: current,
|
|
842
|
+
onValueChange: (next) => {
|
|
843
|
+
setLocal(next);
|
|
844
|
+
props.onValueChange?.(next);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
)
|
|
848
|
+
}
|
|
849
|
+
)
|
|
850
|
+
] });
|
|
851
|
+
}
|
|
687
852
|
|
|
688
853
|
export { ColorField };
|
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import { NumberRoll } from './chunk-
|
|
1
|
+
import { NumberRoll } from './chunk-IMMALLRU.js';
|
|
2
2
|
import { NAMED_ROLE } from './chunk-W23G6JLF.js';
|
|
3
|
-
import {
|
|
3
|
+
import { useFocusRing } from './chunk-2YKVID2V.js';
|
|
4
|
+
import { Icon } from './chunk-PCEFCOLN.js';
|
|
4
5
|
import { useResolvedMotion, springConfig, motionTiming } from './chunk-J64KGCGX.js';
|
|
5
6
|
import * as React from 'react';
|
|
6
|
-
import { Animated, StyleSheet, Text } from 'react-native';
|
|
7
|
+
import { Animated, StyleSheet, Text, Pressable } from 'react-native';
|
|
7
8
|
import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
|
|
8
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
10
|
|
|
10
|
-
function useForeground(variant) {
|
|
11
|
+
function useForeground(variant, solid = false) {
|
|
11
12
|
const theme = useLoamTheme("badge");
|
|
13
|
+
if (solid) {
|
|
14
|
+
switch (variant) {
|
|
15
|
+
case "accent":
|
|
16
|
+
return theme.color.accentInk;
|
|
17
|
+
case "good":
|
|
18
|
+
return theme.color.goodInk;
|
|
19
|
+
case "warn":
|
|
20
|
+
return theme.color.warnInk;
|
|
21
|
+
case "danger":
|
|
22
|
+
return theme.color.dangerInk;
|
|
23
|
+
case "info":
|
|
24
|
+
return theme.color.infoInk;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
12
27
|
switch (variant) {
|
|
13
28
|
case "accent":
|
|
14
29
|
return theme.color.accentOnSoft;
|
|
@@ -30,6 +45,7 @@ function Badge({
|
|
|
30
45
|
variant = "neutral",
|
|
31
46
|
size = "md",
|
|
32
47
|
outline = false,
|
|
48
|
+
solid = false,
|
|
33
49
|
leadingIcon,
|
|
34
50
|
dot = false,
|
|
35
51
|
dotStyle,
|
|
@@ -39,14 +55,16 @@ function Badge({
|
|
|
39
55
|
announce = false,
|
|
40
56
|
motion = "full",
|
|
41
57
|
animateCount = false,
|
|
58
|
+
onPress,
|
|
42
59
|
accessibilityLabel,
|
|
43
60
|
style
|
|
44
61
|
}) {
|
|
45
62
|
const { styles } = useStyles(sheet, { variant, size, outline });
|
|
46
63
|
const theme = useLoamTheme("badge");
|
|
47
|
-
const fg = useForeground(variant);
|
|
64
|
+
const fg = useForeground(variant, solid);
|
|
65
|
+
const focusRing = useFocusRing(theme.radius.full);
|
|
48
66
|
const iconSize = size === "sm" ? 12 : 14;
|
|
49
|
-
const dotSize =
|
|
67
|
+
const dotSize = theme.space[6];
|
|
50
68
|
const label = typeof children === "string" ? children : void 0;
|
|
51
69
|
const level = useResolvedMotion(motion, "badge");
|
|
52
70
|
const appear = React.useRef(new Animated.Value(level === "full" ? 0.5 : 1)).current;
|
|
@@ -79,13 +97,18 @@ function Badge({
|
|
|
79
97
|
const isCount = count !== void 0;
|
|
80
98
|
if (isCount && count === 0 && !showZero) return null;
|
|
81
99
|
const display = isCount ? count > max ? `${max}+` : String(count) : void 0;
|
|
82
|
-
|
|
100
|
+
const pill = /* @__PURE__ */ jsxs(
|
|
83
101
|
Animated.View,
|
|
84
102
|
{
|
|
85
|
-
accessibilityRole: NAMED_ROLE,
|
|
103
|
+
accessibilityRole: onPress ? void 0 : NAMED_ROLE,
|
|
86
104
|
accessibilityLabel: accessibilityLabel ?? (isCount ? String(count) : label),
|
|
87
105
|
accessibilityLiveRegion: announce && isCount ? "polite" : "none",
|
|
88
|
-
style: [
|
|
106
|
+
style: [
|
|
107
|
+
styles.base,
|
|
108
|
+
solid && variant !== "neutral" && !outline ? { backgroundColor: theme.color[variant], borderColor: theme.color[variant] } : null,
|
|
109
|
+
style,
|
|
110
|
+
{ transform: [{ scale: appear }] }
|
|
111
|
+
],
|
|
89
112
|
children: [
|
|
90
113
|
ghost ? /* @__PURE__ */ jsx(
|
|
91
114
|
Animated.View,
|
|
@@ -129,6 +152,19 @@ function Badge({
|
|
|
129
152
|
]
|
|
130
153
|
}
|
|
131
154
|
);
|
|
155
|
+
if (!onPress) return pill;
|
|
156
|
+
return /* @__PURE__ */ jsx(
|
|
157
|
+
Pressable,
|
|
158
|
+
{
|
|
159
|
+
accessibilityRole: "link",
|
|
160
|
+
accessibilityLabel: accessibilityLabel ?? (isCount ? String(count) : label),
|
|
161
|
+
onPress,
|
|
162
|
+
onFocus: focusRing.handlers.onFocus,
|
|
163
|
+
onBlur: focusRing.handlers.onBlur,
|
|
164
|
+
style: [{ alignSelf: "flex-start", borderRadius: theme.radius.full }, focusRing.style],
|
|
165
|
+
children: pill
|
|
166
|
+
}
|
|
167
|
+
);
|
|
132
168
|
}
|
|
133
169
|
var sheet = createStyleSheet((theme) => ({
|
|
134
170
|
base: {
|
|
@@ -157,9 +193,8 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
157
193
|
},
|
|
158
194
|
size: {
|
|
159
195
|
sm: { height: theme.space[20], paddingHorizontal: theme.space.s2 },
|
|
160
|
-
//
|
|
161
|
-
|
|
162
|
-
md: { paddingVertical: theme.space[7], paddingHorizontal: theme.space[13] }
|
|
196
|
+
// Final 03 (R10): md is pinned at 24 with 10 padding, like web.
|
|
197
|
+
md: { height: theme.space[24], paddingHorizontal: theme.space[10] }
|
|
163
198
|
},
|
|
164
199
|
outline: {
|
|
165
200
|
true: {
|
|
@@ -177,7 +212,6 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
177
212
|
variants: {
|
|
178
213
|
size: {
|
|
179
214
|
sm: { fontSize: theme.fontSize[12] },
|
|
180
|
-
// Reference (buildWidgets chip): `font-size:13px` — 13px, read from the ramp rather than hardcoded.
|
|
181
215
|
md: { fontSize: theme.fontSize[13] }
|
|
182
216
|
},
|
|
183
217
|
variant: {},
|