@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
package/dist/chunk-DN7MNQIP.js
DELETED
|
@@ -1,799 +0,0 @@
|
|
|
1
|
-
import { Skeleton } from './chunk-PNF3NKB5.js';
|
|
2
|
-
import { Button } from './chunk-E2E3I5W2.js';
|
|
3
|
-
import { useLabels } from './chunk-APCWFOZW.js';
|
|
4
|
-
import { Icon } from './chunk-UXGIW7OK.js';
|
|
5
|
-
import { useResolvedMotion } from './chunk-J64KGCGX.js';
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
import { View, Text, Animated, Easing } from 'react-native';
|
|
8
|
-
import { Svg, Path, Polyline, Circle, Line, Rect } from 'react-native-svg';
|
|
9
|
-
import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
|
|
10
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
|
-
|
|
12
|
-
// src/charts/charts-labels.ts
|
|
13
|
-
var DEFAULT_CHARTS_LABELS = {
|
|
14
|
-
emptyTitle: "No data",
|
|
15
|
-
emptyMessage: "There is nothing to show for this range.",
|
|
16
|
-
errorTitle: "Could not load this chart",
|
|
17
|
-
errorMessage: "The data could not be loaded.",
|
|
18
|
-
retry: "Retry",
|
|
19
|
-
loading: "Loading chart",
|
|
20
|
-
other: "Other",
|
|
21
|
-
lineChart: "Line chart",
|
|
22
|
-
barChart: "Bar chart",
|
|
23
|
-
donutChart: "DonutChart chart",
|
|
24
|
-
stackedBarChart: "Stacked bar chart",
|
|
25
|
-
noData: (kind) => kind + ", no data",
|
|
26
|
-
pointCount: (n) => n + " " + (n === 1 ? "point" : "points"),
|
|
27
|
-
span: (first, end) => first + " to " + end,
|
|
28
|
-
seriesSummary: (kind, span, points, min, max, last) => kind + (span ? ", " + span : "") + ", " + points + ", " + min + " to " + max + ", last " + last,
|
|
29
|
-
donutSummary: (kind, slices) => kind + ": " + slices,
|
|
30
|
-
donutSlice: (label, pct) => label + " " + pct + "%",
|
|
31
|
-
stackedSummary: (kind, names, columns) => kind + " of " + names + " across " + columns + " columns"
|
|
32
|
-
};
|
|
33
|
-
function ChartFrame({
|
|
34
|
-
state = "data",
|
|
35
|
-
width,
|
|
36
|
-
height,
|
|
37
|
-
compact = false,
|
|
38
|
-
emptyTitle: emptyTitleProp,
|
|
39
|
-
emptyMessage: emptyMessageProp,
|
|
40
|
-
errorTitle: errorTitleProp,
|
|
41
|
-
errorMessage: errorMessageProp,
|
|
42
|
-
retryLabel: retryLabelProp,
|
|
43
|
-
loadingLabel: loadingLabelProp,
|
|
44
|
-
labels: labelsProp,
|
|
45
|
-
onRetry
|
|
46
|
-
}) {
|
|
47
|
-
const labels = useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
48
|
-
const emptyTitle = emptyTitleProp ?? labels.emptyTitle;
|
|
49
|
-
const emptyMessage = emptyMessageProp ?? labels.emptyMessage;
|
|
50
|
-
const errorTitle = errorTitleProp ?? labels.errorTitle;
|
|
51
|
-
const errorMessage = errorMessageProp ?? labels.errorMessage;
|
|
52
|
-
const retryLabel = retryLabelProp ?? labels.retry;
|
|
53
|
-
const loadingLabel = loadingLabelProp ?? labels.loading;
|
|
54
|
-
const theme = useLoamTheme("charts");
|
|
55
|
-
const { styles } = useStyles(frameSheet);
|
|
56
|
-
if (state === "data") return null;
|
|
57
|
-
const box = { minWidth: width, minHeight: height };
|
|
58
|
-
if (state === "loading") {
|
|
59
|
-
return /* @__PURE__ */ jsx(
|
|
60
|
-
Skeleton,
|
|
61
|
-
{
|
|
62
|
-
variant: "rect",
|
|
63
|
-
width,
|
|
64
|
-
height: height ?? 120,
|
|
65
|
-
accessibilityLabel: loadingLabel,
|
|
66
|
-
style: box
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
if (state === "empty") {
|
|
71
|
-
return /* @__PURE__ */ jsxs(
|
|
72
|
-
View,
|
|
73
|
-
{
|
|
74
|
-
accessibilityRole: "image",
|
|
75
|
-
accessibilityLabel: `${emptyTitle}. ${emptyMessage}`,
|
|
76
|
-
style: [styles.center, box],
|
|
77
|
-
children: [
|
|
78
|
-
/* @__PURE__ */ jsx(Icon, { name: "chart-bar", size: compact ? 18 : 24, color: theme.color.text3 }),
|
|
79
|
-
compact ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
80
|
-
/* @__PURE__ */ jsx(Text, { style: styles.title, children: emptyTitle }),
|
|
81
|
-
/* @__PURE__ */ jsx(Text, { style: styles.message, children: emptyMessage })
|
|
82
|
-
] })
|
|
83
|
-
]
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
return /* @__PURE__ */ jsxs(View, { style: [compact ? styles.centerRow : styles.center, box], children: [
|
|
88
|
-
/* @__PURE__ */ jsx(Icon, { name: "alert-triangle", size: compact ? 18 : 24, color: theme.color.danger }),
|
|
89
|
-
compact ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
90
|
-
/* @__PURE__ */ jsx(Text, { style: styles.title, children: errorTitle }),
|
|
91
|
-
/* @__PURE__ */ jsx(Text, { style: styles.message, children: errorMessage })
|
|
92
|
-
] }),
|
|
93
|
-
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onPress: onRetry, accessibilityLabel: retryLabel, children: retryLabel })
|
|
94
|
-
] });
|
|
95
|
-
}
|
|
96
|
-
var frameSheet = createStyleSheet((theme) => ({
|
|
97
|
-
center: {
|
|
98
|
-
alignItems: "center",
|
|
99
|
-
justifyContent: "center",
|
|
100
|
-
gap: theme.space.s2,
|
|
101
|
-
padding: theme.space.s4
|
|
102
|
-
},
|
|
103
|
-
centerRow: {
|
|
104
|
-
flexDirection: "row",
|
|
105
|
-
alignItems: "center",
|
|
106
|
-
justifyContent: "center",
|
|
107
|
-
gap: theme.space.s2,
|
|
108
|
-
padding: theme.space.s2
|
|
109
|
-
},
|
|
110
|
-
title: {
|
|
111
|
-
fontFamily: theme.font.sans,
|
|
112
|
-
fontWeight: theme.fontWeight.bold,
|
|
113
|
-
fontSize: theme.fontSize[14],
|
|
114
|
-
color: theme.color.text,
|
|
115
|
-
textAlign: "center"
|
|
116
|
-
},
|
|
117
|
-
message: {
|
|
118
|
-
fontFamily: theme.font.sans,
|
|
119
|
-
fontSize: theme.fontSize[12],
|
|
120
|
-
color: theme.color.text2,
|
|
121
|
-
textAlign: "center"
|
|
122
|
-
}
|
|
123
|
-
}));
|
|
124
|
-
function toneColors(theme, tone) {
|
|
125
|
-
switch (tone) {
|
|
126
|
-
case "good":
|
|
127
|
-
return { main: theme.color.good, soft: theme.color.goodSoft };
|
|
128
|
-
case "warn":
|
|
129
|
-
return { main: theme.color.warn, soft: theme.color.warnSoft };
|
|
130
|
-
case "danger":
|
|
131
|
-
return { main: theme.color.danger, soft: theme.color.dangerSoft };
|
|
132
|
-
default:
|
|
133
|
-
return { main: theme.color.accentStrong, soft: theme.color.accentSoft };
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function useToneColors(tone) {
|
|
137
|
-
return toneColors(useLoamTheme("charts"), tone);
|
|
138
|
-
}
|
|
139
|
-
function clamp(n, lo, hi) {
|
|
140
|
-
return Math.max(lo, Math.min(hi, n));
|
|
141
|
-
}
|
|
142
|
-
function useDrawIn(motion, animate) {
|
|
143
|
-
const resolved = useResolvedMotion(motion ?? (animate ? "full" : "none"), "charts");
|
|
144
|
-
const on = resolved !== "none";
|
|
145
|
-
const theme = useLoamTheme("charts");
|
|
146
|
-
const opacity = React.useRef(new Animated.Value(on ? 0 : 1)).current;
|
|
147
|
-
React.useEffect(() => {
|
|
148
|
-
if (!on) return;
|
|
149
|
-
const anim = Animated.timing(opacity, {
|
|
150
|
-
toValue: 1,
|
|
151
|
-
duration: theme.motion.enter.duration,
|
|
152
|
-
easing: Easing.bezier(...theme.motion.enter.easing),
|
|
153
|
-
useNativeDriver: true
|
|
154
|
-
});
|
|
155
|
-
anim.start();
|
|
156
|
-
return () => anim.stop();
|
|
157
|
-
}, [on, opacity, theme.motion.enter]);
|
|
158
|
-
return opacity;
|
|
159
|
-
}
|
|
160
|
-
function Sparkline({
|
|
161
|
-
labels: labelsProp,
|
|
162
|
-
data,
|
|
163
|
-
width = 120,
|
|
164
|
-
height = 32,
|
|
165
|
-
tone = "accent",
|
|
166
|
-
strokeWidth = 2,
|
|
167
|
-
showArea = false,
|
|
168
|
-
showDot = false,
|
|
169
|
-
motion,
|
|
170
|
-
animate = false,
|
|
171
|
-
state = "data",
|
|
172
|
-
emptyTitle,
|
|
173
|
-
emptyMessage,
|
|
174
|
-
errorTitle,
|
|
175
|
-
errorMessage,
|
|
176
|
-
retryLabel,
|
|
177
|
-
loadingLabel,
|
|
178
|
-
onRetry,
|
|
179
|
-
accessibilityLabel: labelProp
|
|
180
|
-
}) {
|
|
181
|
-
const labels = useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
182
|
-
const { main, soft } = useToneColors(tone);
|
|
183
|
-
const opacity = useDrawIn(motion, animate);
|
|
184
|
-
const dotR = strokeWidth + 1.5;
|
|
185
|
-
const accessibilityLabel = labelProp ?? summarizeSeries(labels.lineChart, data, void 0, labels);
|
|
186
|
-
const pad = Math.max(strokeWidth, showDot ? dotR : 0);
|
|
187
|
-
const innerW = Math.max(0, width - pad * 2);
|
|
188
|
-
const innerH = Math.max(0, height - pad * 2);
|
|
189
|
-
const n = data.length;
|
|
190
|
-
const min = n > 0 ? Math.min(...data) : 0;
|
|
191
|
-
const max = n > 0 ? Math.max(...data) : 0;
|
|
192
|
-
const range = max - min || 1;
|
|
193
|
-
const stepX = n > 1 ? innerW / (n - 1) : 0;
|
|
194
|
-
const px = (i) => pad + i * stepX;
|
|
195
|
-
const py = (v) => pad + (1 - (v - min) / range) * innerH;
|
|
196
|
-
const points = data.map((v, i) => `${px(i)},${py(v)}`).join(" ");
|
|
197
|
-
const lastX = px(n - 1);
|
|
198
|
-
const lastY = n > 0 ? py(data[n - 1]) : 0;
|
|
199
|
-
const areaPath = n > 1 ? `M ${points.replace(/ /g, " L ")} L ${lastX},${height} L ${px(0)},${height} Z` : "";
|
|
200
|
-
if (state !== "data") {
|
|
201
|
-
return /* @__PURE__ */ jsx(
|
|
202
|
-
ChartFrame,
|
|
203
|
-
{
|
|
204
|
-
labels,
|
|
205
|
-
compact: true,
|
|
206
|
-
state,
|
|
207
|
-
width,
|
|
208
|
-
height,
|
|
209
|
-
emptyTitle,
|
|
210
|
-
emptyMessage,
|
|
211
|
-
errorTitle,
|
|
212
|
-
errorMessage,
|
|
213
|
-
retryLabel,
|
|
214
|
-
loadingLabel,
|
|
215
|
-
onRetry
|
|
216
|
-
}
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
return /* @__PURE__ */ jsx(
|
|
220
|
-
Animated.View,
|
|
221
|
-
{
|
|
222
|
-
accessibilityRole: "image",
|
|
223
|
-
accessibilityLabel,
|
|
224
|
-
style: { width, height, opacity },
|
|
225
|
-
children: /* @__PURE__ */ jsxs(Svg, { width, height, viewBox: `0 0 ${width} ${height}`, fill: "none", children: [
|
|
226
|
-
showArea && areaPath ? /* @__PURE__ */ jsx(Path, { d: areaPath, fill: soft }) : null,
|
|
227
|
-
n > 1 ? /* @__PURE__ */ jsx(
|
|
228
|
-
Polyline,
|
|
229
|
-
{
|
|
230
|
-
points,
|
|
231
|
-
fill: "none",
|
|
232
|
-
stroke: main,
|
|
233
|
-
strokeWidth,
|
|
234
|
-
strokeLinecap: "round",
|
|
235
|
-
strokeLinejoin: "round"
|
|
236
|
-
}
|
|
237
|
-
) : null,
|
|
238
|
-
showDot && n > 0 ? /* @__PURE__ */ jsx(Circle, { cx: lastX, cy: lastY, r: dotR, fill: main }) : null
|
|
239
|
-
] })
|
|
240
|
-
}
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
function spoken(n) {
|
|
244
|
-
return new Intl.NumberFormat("en", { notation: "compact", maximumFractionDigits: 1 }).format(n);
|
|
245
|
-
}
|
|
246
|
-
function summarizeSeries(kind, values, labels, copy = DEFAULT_CHARTS_LABELS) {
|
|
247
|
-
if (values.length === 0) return copy.noData(kind);
|
|
248
|
-
const min = Math.min(...values);
|
|
249
|
-
const max = Math.max(...values);
|
|
250
|
-
const last = values[values.length - 1];
|
|
251
|
-
const first = labels?.[0];
|
|
252
|
-
const end = labels?.[values.length - 1];
|
|
253
|
-
const span = first && end ? copy.span(first, end) : "";
|
|
254
|
-
return copy.seriesSummary(
|
|
255
|
-
kind,
|
|
256
|
-
span,
|
|
257
|
-
copy.pointCount(values.length),
|
|
258
|
-
spoken(min),
|
|
259
|
-
spoken(max),
|
|
260
|
-
spoken(last)
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
function normalizeBars(data) {
|
|
264
|
-
return data.map((d) => typeof d === "number" ? { value: d } : d);
|
|
265
|
-
}
|
|
266
|
-
function topRoundedBar(x, y, w, h, r) {
|
|
267
|
-
const rr = Math.max(0, Math.min(r, w / 2, h));
|
|
268
|
-
if (rr <= 0) return `M ${x},${y} h ${w} v ${h} h ${-w} Z`;
|
|
269
|
-
return `M ${x},${y + h} L ${x},${y + rr} Q ${x},${y} ${x + rr},${y} L ${x + w - rr},${y} Q ${x + w},${y} ${x + w},${y + rr} L ${x + w},${y + h} Z`;
|
|
270
|
-
}
|
|
271
|
-
function BarChart({
|
|
272
|
-
labels: labelsProp,
|
|
273
|
-
data,
|
|
274
|
-
width = 140,
|
|
275
|
-
height = 150,
|
|
276
|
-
tone = "accent",
|
|
277
|
-
gap = 8,
|
|
278
|
-
barRadius = 6,
|
|
279
|
-
highlightLast = true,
|
|
280
|
-
highlightIndex,
|
|
281
|
-
colors,
|
|
282
|
-
accessibilityLabel: labelProp
|
|
283
|
-
}) {
|
|
284
|
-
const labels = useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
285
|
-
const theme = useLoamTheme("charts");
|
|
286
|
-
const { main, soft } = useToneColors(tone);
|
|
287
|
-
const bars = normalizeBars(data);
|
|
288
|
-
const accessibilityLabel = labelProp ?? summarizeSeries(
|
|
289
|
-
labels.barChart,
|
|
290
|
-
bars.map((b) => b.value),
|
|
291
|
-
bars.map((b) => b.label),
|
|
292
|
-
labels
|
|
293
|
-
);
|
|
294
|
-
const n = bars.length;
|
|
295
|
-
const values = bars.map((b) => b.value);
|
|
296
|
-
const max = n > 0 ? Math.max(...values, 0) : 0;
|
|
297
|
-
const barW = n > 0 ? Math.max(0, (width - gap * (n - 1)) / n) : 0;
|
|
298
|
-
const fillFor = (i) => {
|
|
299
|
-
if (colors && colors.length > 0) return colors[i % colors.length];
|
|
300
|
-
if (highlightIndex !== void 0) {
|
|
301
|
-
return i === highlightIndex ? theme.chart.c1 : theme.chart.c2;
|
|
302
|
-
}
|
|
303
|
-
return highlightLast ? i === n - 1 ? main : soft : main;
|
|
304
|
-
};
|
|
305
|
-
return /* @__PURE__ */ jsx(
|
|
306
|
-
View,
|
|
307
|
-
{
|
|
308
|
-
accessibilityRole: "image",
|
|
309
|
-
accessibilityLabel,
|
|
310
|
-
style: { width, height },
|
|
311
|
-
children: /* @__PURE__ */ jsx(Svg, { width, height, viewBox: `0 0 ${width} ${height}`, fill: "none", children: bars.map((b, i) => {
|
|
312
|
-
const h = max > 0 ? clamp(b.value / max, 0, 1) * height : 0;
|
|
313
|
-
const x = i * (barW + gap);
|
|
314
|
-
const y = height - h;
|
|
315
|
-
return /* @__PURE__ */ jsx(Path, { d: topRoundedBar(x, y, barW, h, barRadius), fill: fillFor(i) }, i);
|
|
316
|
-
}) })
|
|
317
|
-
}
|
|
318
|
-
);
|
|
319
|
-
}
|
|
320
|
-
function RingChart({
|
|
321
|
-
labels: labelsProp,
|
|
322
|
-
value,
|
|
323
|
-
max = 100,
|
|
324
|
-
size = 92,
|
|
325
|
-
thickness = 8,
|
|
326
|
-
tone = "accent",
|
|
327
|
-
label = false,
|
|
328
|
-
accessibilityLabel
|
|
329
|
-
}) {
|
|
330
|
-
useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
331
|
-
const theme = useLoamTheme("charts");
|
|
332
|
-
const { main } = useToneColors(tone);
|
|
333
|
-
const fraction = max > 0 ? clamp(value / max, 0, 1) : 0;
|
|
334
|
-
const now = Math.round(fraction * 100);
|
|
335
|
-
const center = size / 2;
|
|
336
|
-
const radius = (size - thickness) / 2;
|
|
337
|
-
const circumference = 2 * Math.PI * radius;
|
|
338
|
-
const dashOffset = circumference * (1 - fraction);
|
|
339
|
-
const labelText = label === true ? `${now}%` : typeof label === "string" ? label : null;
|
|
340
|
-
const labelSize = Math.max(theme.fontSize[14], Math.round(size * 0.2));
|
|
341
|
-
return /* @__PURE__ */ jsxs(
|
|
342
|
-
View,
|
|
343
|
-
{
|
|
344
|
-
accessibilityRole: "progressbar",
|
|
345
|
-
accessibilityLabel,
|
|
346
|
-
accessibilityValue: { min: 0, max, now: Math.round(fraction * max) },
|
|
347
|
-
"aria-valuemin": 0,
|
|
348
|
-
"aria-valuemax": max,
|
|
349
|
-
"aria-valuenow": Math.round(fraction * max),
|
|
350
|
-
style: { width: size, height: size, alignItems: "center", justifyContent: "center" },
|
|
351
|
-
children: [
|
|
352
|
-
/* @__PURE__ */ jsxs(
|
|
353
|
-
Svg,
|
|
354
|
-
{
|
|
355
|
-
width: size,
|
|
356
|
-
height: size,
|
|
357
|
-
viewBox: `0 0 ${size} ${size}`,
|
|
358
|
-
fill: "none",
|
|
359
|
-
style: ringSvgStyle,
|
|
360
|
-
children: [
|
|
361
|
-
/* @__PURE__ */ jsx(
|
|
362
|
-
Circle,
|
|
363
|
-
{
|
|
364
|
-
cx: center,
|
|
365
|
-
cy: center,
|
|
366
|
-
r: radius,
|
|
367
|
-
stroke: theme.color.surface3,
|
|
368
|
-
strokeWidth: thickness,
|
|
369
|
-
fill: "none"
|
|
370
|
-
}
|
|
371
|
-
),
|
|
372
|
-
/* @__PURE__ */ jsx(
|
|
373
|
-
Circle,
|
|
374
|
-
{
|
|
375
|
-
cx: center,
|
|
376
|
-
cy: center,
|
|
377
|
-
r: radius,
|
|
378
|
-
stroke: main,
|
|
379
|
-
strokeWidth: thickness,
|
|
380
|
-
strokeLinecap: "round",
|
|
381
|
-
fill: "none",
|
|
382
|
-
strokeDasharray: `${circumference} ${circumference}`,
|
|
383
|
-
strokeDashoffset: dashOffset,
|
|
384
|
-
transform: `rotate(-90 ${center} ${center})`
|
|
385
|
-
}
|
|
386
|
-
)
|
|
387
|
-
]
|
|
388
|
-
}
|
|
389
|
-
),
|
|
390
|
-
labelText !== null ? /* @__PURE__ */ jsx(
|
|
391
|
-
Text,
|
|
392
|
-
{
|
|
393
|
-
style: {
|
|
394
|
-
position: "absolute",
|
|
395
|
-
fontFamily: theme.font.sans,
|
|
396
|
-
fontWeight: theme.fontWeight.bold,
|
|
397
|
-
fontSize: labelSize,
|
|
398
|
-
color: theme.color.text
|
|
399
|
-
},
|
|
400
|
-
children: labelText
|
|
401
|
-
}
|
|
402
|
-
) : null
|
|
403
|
-
]
|
|
404
|
-
}
|
|
405
|
-
);
|
|
406
|
-
}
|
|
407
|
-
var ringSvgStyle = { position: "absolute" };
|
|
408
|
-
function foldDonutSlices(data, max, other) {
|
|
409
|
-
if (max <= 0 || data.length <= max) return data;
|
|
410
|
-
const keep = new Set(
|
|
411
|
-
data.map((d, i) => ({ v: d.value, i })).sort((a, b) => b.v - a.v).slice(0, max - 1).map((x) => x.i)
|
|
412
|
-
);
|
|
413
|
-
const rest = data.filter((_, i) => !keep.has(i)).reduce((a, d) => a + d.value, 0);
|
|
414
|
-
return [...data.filter((_, i) => keep.has(i)), { label: other, value: rest }];
|
|
415
|
-
}
|
|
416
|
-
function DonutChart({
|
|
417
|
-
labels: labelsProp,
|
|
418
|
-
data: rawData,
|
|
419
|
-
maxSlices = 5,
|
|
420
|
-
otherLabel: otherLabelProp,
|
|
421
|
-
size = 140,
|
|
422
|
-
thickness = 18,
|
|
423
|
-
showLegend = true,
|
|
424
|
-
centerLabel,
|
|
425
|
-
motion,
|
|
426
|
-
animate = false,
|
|
427
|
-
state = "data",
|
|
428
|
-
emptyTitle,
|
|
429
|
-
emptyMessage,
|
|
430
|
-
errorTitle,
|
|
431
|
-
errorMessage,
|
|
432
|
-
retryLabel,
|
|
433
|
-
loadingLabel,
|
|
434
|
-
onRetry,
|
|
435
|
-
accessibilityLabel: labelProp
|
|
436
|
-
}) {
|
|
437
|
-
const labels = useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
438
|
-
const data = foldDonutSlices(rawData, maxSlices, otherLabelProp ?? labels.other);
|
|
439
|
-
const donutTotal = data.reduce((a, d) => a + d.value, 0);
|
|
440
|
-
const accessibilityLabel = labelProp ?? (data.length && donutTotal > 0 ? labels.donutSummary(
|
|
441
|
-
labels.donutChart,
|
|
442
|
-
data.map((d) => labels.donutSlice(d.label, Math.round(d.value / donutTotal * 100))).join(", ")
|
|
443
|
-
) : labels.noData(labels.donutChart));
|
|
444
|
-
const theme = useLoamTheme("charts");
|
|
445
|
-
const { styles } = useStyles(donutSheet);
|
|
446
|
-
const opacity = useDrawIn(motion, animate);
|
|
447
|
-
if (state !== "data") {
|
|
448
|
-
return /* @__PURE__ */ jsx(
|
|
449
|
-
ChartFrame,
|
|
450
|
-
{
|
|
451
|
-
labels,
|
|
452
|
-
state,
|
|
453
|
-
width: size,
|
|
454
|
-
height: size,
|
|
455
|
-
emptyTitle,
|
|
456
|
-
emptyMessage,
|
|
457
|
-
errorTitle,
|
|
458
|
-
errorMessage,
|
|
459
|
-
retryLabel,
|
|
460
|
-
loadingLabel,
|
|
461
|
-
onRetry
|
|
462
|
-
}
|
|
463
|
-
);
|
|
464
|
-
}
|
|
465
|
-
const palette = [
|
|
466
|
-
theme.chart.c1,
|
|
467
|
-
theme.chart.c2,
|
|
468
|
-
theme.chart.c3,
|
|
469
|
-
theme.chart.c4,
|
|
470
|
-
theme.chart.c5,
|
|
471
|
-
theme.chart.c6
|
|
472
|
-
];
|
|
473
|
-
const colorAt = (i) => palette[i % palette.length];
|
|
474
|
-
const center = size / 2;
|
|
475
|
-
const radius = (size - thickness) / 2;
|
|
476
|
-
const circumference = 2 * Math.PI * radius;
|
|
477
|
-
const total = data.reduce((sum, d) => sum + Math.max(0, d.value), 0);
|
|
478
|
-
const fractionOf = (v) => total > 0 ? Math.max(0, v) / total : 0;
|
|
479
|
-
let acc = 0;
|
|
480
|
-
const segments = data.map((d, i) => {
|
|
481
|
-
const fraction = fractionOf(d.value);
|
|
482
|
-
const start = acc;
|
|
483
|
-
acc += fraction;
|
|
484
|
-
return { i, fraction, start, color: colorAt(i), pct: Math.round(fraction * 100) };
|
|
485
|
-
});
|
|
486
|
-
const centerContent = centerLabel ?? "100%";
|
|
487
|
-
const centerSize = Math.round(size * 0.16);
|
|
488
|
-
return /* @__PURE__ */ jsxs(
|
|
489
|
-
View,
|
|
490
|
-
{
|
|
491
|
-
accessibilityRole: "image",
|
|
492
|
-
accessibilityLabel,
|
|
493
|
-
style: showLegend ? styles.container : void 0,
|
|
494
|
-
children: [
|
|
495
|
-
/* @__PURE__ */ jsxs(
|
|
496
|
-
Animated.View,
|
|
497
|
-
{
|
|
498
|
-
style: {
|
|
499
|
-
width: size,
|
|
500
|
-
height: size,
|
|
501
|
-
alignItems: "center",
|
|
502
|
-
justifyContent: "center",
|
|
503
|
-
opacity
|
|
504
|
-
},
|
|
505
|
-
children: [
|
|
506
|
-
/* @__PURE__ */ jsxs(
|
|
507
|
-
Svg,
|
|
508
|
-
{
|
|
509
|
-
width: size,
|
|
510
|
-
height: size,
|
|
511
|
-
viewBox: `0 0 ${size} ${size}`,
|
|
512
|
-
fill: "none",
|
|
513
|
-
style: ringSvgStyle,
|
|
514
|
-
children: [
|
|
515
|
-
/* @__PURE__ */ jsx(
|
|
516
|
-
Circle,
|
|
517
|
-
{
|
|
518
|
-
cx: center,
|
|
519
|
-
cy: center,
|
|
520
|
-
r: radius,
|
|
521
|
-
stroke: theme.chart.grid,
|
|
522
|
-
strokeWidth: thickness,
|
|
523
|
-
fill: "none"
|
|
524
|
-
}
|
|
525
|
-
),
|
|
526
|
-
segments.map((s) => /* @__PURE__ */ jsx(
|
|
527
|
-
Circle,
|
|
528
|
-
{
|
|
529
|
-
cx: center,
|
|
530
|
-
cy: center,
|
|
531
|
-
r: radius,
|
|
532
|
-
stroke: s.color,
|
|
533
|
-
strokeWidth: thickness,
|
|
534
|
-
fill: "none",
|
|
535
|
-
strokeDasharray: `${s.fraction * circumference} ${circumference - s.fraction * circumference}`,
|
|
536
|
-
strokeDashoffset: -s.start * circumference,
|
|
537
|
-
transform: `rotate(-90 ${center} ${center})`
|
|
538
|
-
},
|
|
539
|
-
s.i
|
|
540
|
-
))
|
|
541
|
-
]
|
|
542
|
-
}
|
|
543
|
-
),
|
|
544
|
-
typeof centerContent === "string" || typeof centerContent === "number" ? /* @__PURE__ */ jsx(
|
|
545
|
-
Text,
|
|
546
|
-
{
|
|
547
|
-
style: {
|
|
548
|
-
position: "absolute",
|
|
549
|
-
fontFamily: theme.font.display,
|
|
550
|
-
fontWeight: theme.fontWeight.bold,
|
|
551
|
-
fontSize: centerSize,
|
|
552
|
-
color: theme.color.text
|
|
553
|
-
},
|
|
554
|
-
children: centerContent
|
|
555
|
-
}
|
|
556
|
-
) : centerContent
|
|
557
|
-
]
|
|
558
|
-
}
|
|
559
|
-
),
|
|
560
|
-
showLegend ? /* @__PURE__ */ jsx(View, { style: styles.legend, children: segments.map((s) => /* @__PURE__ */ jsxs(View, { style: styles.legendRow, children: [
|
|
561
|
-
/* @__PURE__ */ jsx(View, { style: [styles.chip, { backgroundColor: s.color }] }),
|
|
562
|
-
/* @__PURE__ */ jsx(Text, { style: styles.legendLabel, children: data[s.i].label }),
|
|
563
|
-
/* @__PURE__ */ jsxs(Text, { style: styles.legendPct, children: [
|
|
564
|
-
s.pct,
|
|
565
|
-
"%"
|
|
566
|
-
] })
|
|
567
|
-
] }, s.i)) }) : null
|
|
568
|
-
]
|
|
569
|
-
}
|
|
570
|
-
);
|
|
571
|
-
}
|
|
572
|
-
var donutSheet = createStyleSheet((theme) => ({
|
|
573
|
-
container: { flexDirection: "row", alignItems: "center", gap: theme.space.s5 },
|
|
574
|
-
legend: { flexShrink: 1, gap: theme.space.s2 },
|
|
575
|
-
legendRow: {
|
|
576
|
-
flexDirection: "row",
|
|
577
|
-
alignItems: "center",
|
|
578
|
-
gap: theme.space.s2,
|
|
579
|
-
minWidth: theme.space[140]
|
|
580
|
-
},
|
|
581
|
-
chip: { width: theme.space[11], height: theme.space[11], borderRadius: theme.radius[3] },
|
|
582
|
-
legendLabel: {
|
|
583
|
-
fontFamily: theme.font.sans,
|
|
584
|
-
fontWeight: theme.fontWeight.bold,
|
|
585
|
-
fontSize: theme.fontSize[14],
|
|
586
|
-
color: theme.color.text
|
|
587
|
-
},
|
|
588
|
-
legendPct: {
|
|
589
|
-
marginLeft: "auto",
|
|
590
|
-
textAlign: "right",
|
|
591
|
-
fontFamily: theme.font.mono,
|
|
592
|
-
fontSize: theme.fontSize[14],
|
|
593
|
-
color: theme.color.text2
|
|
594
|
-
}
|
|
595
|
-
}));
|
|
596
|
-
function StackedBarChart({
|
|
597
|
-
labels: labelsProp,
|
|
598
|
-
data,
|
|
599
|
-
series,
|
|
600
|
-
width = 280,
|
|
601
|
-
height = 160,
|
|
602
|
-
gap = 10,
|
|
603
|
-
barRadius = 4,
|
|
604
|
-
colors,
|
|
605
|
-
stackMax,
|
|
606
|
-
showLabels = false,
|
|
607
|
-
showLegend = true,
|
|
608
|
-
motion,
|
|
609
|
-
animate = false,
|
|
610
|
-
state = "data",
|
|
611
|
-
emptyTitle,
|
|
612
|
-
emptyMessage,
|
|
613
|
-
errorTitle,
|
|
614
|
-
errorMessage,
|
|
615
|
-
retryLabel,
|
|
616
|
-
loadingLabel,
|
|
617
|
-
onRetry,
|
|
618
|
-
accessibilityLabel
|
|
619
|
-
}) {
|
|
620
|
-
const labels = useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
621
|
-
const theme = useLoamTheme("charts");
|
|
622
|
-
const { styles } = useStyles(stackedSheet);
|
|
623
|
-
const opacity = useDrawIn(motion, animate);
|
|
624
|
-
const palette = [
|
|
625
|
-
theme.chart.c1,
|
|
626
|
-
theme.chart.c2,
|
|
627
|
-
theme.chart.c3,
|
|
628
|
-
theme.chart.c4,
|
|
629
|
-
theme.chart.c5,
|
|
630
|
-
theme.chart.c6
|
|
631
|
-
];
|
|
632
|
-
const segColor = (i) => colors && colors.length > 0 ? colors[i % colors.length] : palette[i % palette.length];
|
|
633
|
-
const label = accessibilityLabel ?? (series && series.length ? labels.stackedSummary(
|
|
634
|
-
labels.stackedBarChart,
|
|
635
|
-
series.map((s) => s.label).join(", "),
|
|
636
|
-
data.length
|
|
637
|
-
) : labels.stackedBarChart);
|
|
638
|
-
if (state !== "data") {
|
|
639
|
-
return /* @__PURE__ */ jsx(
|
|
640
|
-
ChartFrame,
|
|
641
|
-
{
|
|
642
|
-
labels,
|
|
643
|
-
state,
|
|
644
|
-
width,
|
|
645
|
-
height,
|
|
646
|
-
emptyTitle,
|
|
647
|
-
emptyMessage,
|
|
648
|
-
errorTitle,
|
|
649
|
-
errorMessage,
|
|
650
|
-
retryLabel,
|
|
651
|
-
loadingLabel,
|
|
652
|
-
onRetry
|
|
653
|
-
}
|
|
654
|
-
);
|
|
655
|
-
}
|
|
656
|
-
const n = data.length;
|
|
657
|
-
const colW = n > 0 ? Math.max(0, (width - gap * (n - 1)) / n) : 0;
|
|
658
|
-
const totals = data.map((d) => d.values.reduce((a, v) => a + Math.max(0, v), 0));
|
|
659
|
-
const domain = stackMax ?? Math.max(...totals, 0);
|
|
660
|
-
const gridFractions = [0.25, 0.5, 0.75];
|
|
661
|
-
return /* @__PURE__ */ jsxs(View, { accessibilityRole: "image", accessibilityLabel: label, style: styles.wrap, children: [
|
|
662
|
-
/* @__PURE__ */ jsx(Animated.View, { style: { opacity }, children: /* @__PURE__ */ jsxs(Svg, { width, height, viewBox: `0 0 ${width} ${height}`, fill: "none", children: [
|
|
663
|
-
gridFractions.map((f) => /* @__PURE__ */ jsx(
|
|
664
|
-
Line,
|
|
665
|
-
{
|
|
666
|
-
x1: 0,
|
|
667
|
-
y1: f * height,
|
|
668
|
-
x2: width,
|
|
669
|
-
y2: f * height,
|
|
670
|
-
stroke: theme.chart.grid,
|
|
671
|
-
strokeWidth: 1
|
|
672
|
-
},
|
|
673
|
-
f
|
|
674
|
-
)),
|
|
675
|
-
data.map((d, ci) => {
|
|
676
|
-
const x = ci * (colW + gap);
|
|
677
|
-
let topIdx = -1;
|
|
678
|
-
d.values.forEach((v, si) => {
|
|
679
|
-
if (v > 0) topIdx = si;
|
|
680
|
-
});
|
|
681
|
-
let yCursor = height;
|
|
682
|
-
return d.values.map((v, si) => {
|
|
683
|
-
const h = domain > 0 ? Math.max(0, v) / domain * height : 0;
|
|
684
|
-
if (h <= 0) return null;
|
|
685
|
-
yCursor -= h;
|
|
686
|
-
const y = yCursor;
|
|
687
|
-
if (si === topIdx) {
|
|
688
|
-
return /* @__PURE__ */ jsx(
|
|
689
|
-
Path,
|
|
690
|
-
{
|
|
691
|
-
d: topRoundedBar(x, y, colW, h, Math.min(barRadius, colW / 2)),
|
|
692
|
-
fill: segColor(si)
|
|
693
|
-
},
|
|
694
|
-
`${ci}-${si}`
|
|
695
|
-
);
|
|
696
|
-
}
|
|
697
|
-
return /* @__PURE__ */ jsx(Rect, { x, y, width: colW, height: h, fill: segColor(si) }, `${ci}-${si}`);
|
|
698
|
-
});
|
|
699
|
-
})
|
|
700
|
-
] }) }),
|
|
701
|
-
showLabels ? /* @__PURE__ */ jsx(View, { style: styles.axis, children: data.map((d, i) => /* @__PURE__ */ jsx(Text, { style: styles.axisLabel, children: d.label }, i)) }) : null,
|
|
702
|
-
showLegend && series && series.length ? /* @__PURE__ */ jsx(View, { style: styles.legend, children: series.map((s, i) => /* @__PURE__ */ jsxs(View, { style: styles.legendItem, children: [
|
|
703
|
-
/* @__PURE__ */ jsx(View, { style: [styles.legendChip, { backgroundColor: segColor(i) }] }),
|
|
704
|
-
/* @__PURE__ */ jsx(Text, { style: styles.legendLabel, children: s.label })
|
|
705
|
-
] }, i)) }) : null
|
|
706
|
-
] });
|
|
707
|
-
}
|
|
708
|
-
var stackedSheet = createStyleSheet((theme) => ({
|
|
709
|
-
wrap: { gap: theme.space.s2 },
|
|
710
|
-
axis: { flexDirection: "row", justifyContent: "space-between" },
|
|
711
|
-
axisLabel: {
|
|
712
|
-
flex: 1,
|
|
713
|
-
textAlign: "center",
|
|
714
|
-
fontFamily: theme.font.mono,
|
|
715
|
-
fontSize: theme.fontSize[10],
|
|
716
|
-
color: theme.color.text3
|
|
717
|
-
},
|
|
718
|
-
legend: {
|
|
719
|
-
flexDirection: "row",
|
|
720
|
-
flexWrap: "wrap",
|
|
721
|
-
columnGap: theme.space.s4,
|
|
722
|
-
rowGap: theme.space.s2
|
|
723
|
-
},
|
|
724
|
-
legendItem: { flexDirection: "row", alignItems: "center", gap: theme.space.s2 },
|
|
725
|
-
legendChip: { width: theme.space[10], height: theme.space[10], borderRadius: theme.radius[3] },
|
|
726
|
-
legendLabel: {
|
|
727
|
-
fontFamily: theme.font.sans,
|
|
728
|
-
fontWeight: theme.fontWeight.semibold,
|
|
729
|
-
fontSize: theme.fontSize[12],
|
|
730
|
-
color: theme.color.text
|
|
731
|
-
}
|
|
732
|
-
}));
|
|
733
|
-
function StatCard({
|
|
734
|
-
labels: labelsProp,
|
|
735
|
-
label,
|
|
736
|
-
value,
|
|
737
|
-
delta,
|
|
738
|
-
deltaTone = "good",
|
|
739
|
-
data,
|
|
740
|
-
tone = "accent",
|
|
741
|
-
accessibilityLabel
|
|
742
|
-
}) {
|
|
743
|
-
useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
744
|
-
const { styles } = useStyles(statSheet, { deltaTone });
|
|
745
|
-
const [sparkW, setSparkW] = React.useState(0);
|
|
746
|
-
const onSparkLayout = React.useCallback((e) => {
|
|
747
|
-
setSparkW(e.nativeEvent.layout.width);
|
|
748
|
-
}, []);
|
|
749
|
-
return /* @__PURE__ */ jsxs(
|
|
750
|
-
View,
|
|
751
|
-
{
|
|
752
|
-
accessibilityRole: "image",
|
|
753
|
-
accessibilityLabel: accessibilityLabel ?? label,
|
|
754
|
-
style: styles.card,
|
|
755
|
-
children: [
|
|
756
|
-
/* @__PURE__ */ jsx(Text, { style: styles.label, children: label }),
|
|
757
|
-
/* @__PURE__ */ jsxs(View, { style: styles.valueRow, children: [
|
|
758
|
-
typeof value === "string" || typeof value === "number" ? /* @__PURE__ */ jsx(Text, { style: styles.value, children: value }) : value,
|
|
759
|
-
delta ? /* @__PURE__ */ jsx(Text, { style: styles.delta, children: delta }) : null
|
|
760
|
-
] }),
|
|
761
|
-
/* @__PURE__ */ jsx(View, { style: styles.spark, onLayout: onSparkLayout, children: /* @__PURE__ */ jsx(Sparkline, { data, tone, width: sparkW > 0 ? sparkW : 120, height: 34, showArea: true }) })
|
|
762
|
-
]
|
|
763
|
-
}
|
|
764
|
-
);
|
|
765
|
-
}
|
|
766
|
-
var statSheet = createStyleSheet((theme) => ({
|
|
767
|
-
card: {
|
|
768
|
-
backgroundColor: theme.color.surface2,
|
|
769
|
-
borderWidth: theme.borderWidth.thin,
|
|
770
|
-
borderColor: theme.color.border,
|
|
771
|
-
borderRadius: theme.radius.lg,
|
|
772
|
-
minHeight: theme.space[112],
|
|
773
|
-
padding: theme.space[14],
|
|
774
|
-
gap: theme.space.s2
|
|
775
|
-
},
|
|
776
|
-
label: { fontFamily: theme.font.sans, fontSize: theme.fontSize[12], color: theme.color.text2 },
|
|
777
|
-
valueRow: { flexDirection: "row", alignItems: "baseline", gap: theme.space[7] },
|
|
778
|
-
value: {
|
|
779
|
-
fontFamily: theme.font.display,
|
|
780
|
-
fontWeight: theme.fontWeight.bold,
|
|
781
|
-
fontSize: theme.fontSize[24],
|
|
782
|
-
lineHeight: theme.fontSize[24] * theme.lineHeight.none,
|
|
783
|
-
color: theme.color.text
|
|
784
|
-
},
|
|
785
|
-
delta: {
|
|
786
|
-
fontFamily: theme.font.sans,
|
|
787
|
-
fontWeight: theme.fontWeight.bold,
|
|
788
|
-
fontSize: theme.fontSize[11],
|
|
789
|
-
variants: {
|
|
790
|
-
deltaTone: {
|
|
791
|
-
good: { color: theme.color.good },
|
|
792
|
-
danger: { color: theme.color.danger }
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
},
|
|
796
|
-
spark: { marginTop: "auto" }
|
|
797
|
-
}));
|
|
798
|
-
|
|
799
|
-
export { BarChart, ChartFrame, DonutChart, RingChart, Sparkline, StackedBarChart, StatCard, foldDonutSlices };
|