@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,1303 @@
|
|
|
1
|
+
import { MetricDelta } from './chunk-N7AX4OA4.js';
|
|
2
|
+
import { EmptyState } from './chunk-QJMMM4RC.js';
|
|
3
|
+
import { Button } from './chunk-5DTKORLI.js';
|
|
4
|
+
import { resolveTextRole } from './chunk-L4D5LHCH.js';
|
|
5
|
+
import { NumberRoll } from './chunk-IMMALLRU.js';
|
|
6
|
+
import { Skeleton } from './chunk-YJ5PXOX3.js';
|
|
7
|
+
import { haptics } from './chunk-NY2U3PBI.js';
|
|
8
|
+
import { isAndroidIdiom } from './chunk-TH4PW2WU.js';
|
|
9
|
+
import { useLabels, useLoamLocale } from './chunk-APCWFOZW.js';
|
|
10
|
+
import { Icon } from './chunk-PCEFCOLN.js';
|
|
11
|
+
import { useResolvedMotion } from './chunk-J64KGCGX.js';
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
import { View, Animated, Text, Pressable, Easing } from 'react-native';
|
|
14
|
+
import { Svg, Path, Polyline, Circle, Line, Rect } from 'react-native-svg';
|
|
15
|
+
import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
|
|
16
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
17
|
+
|
|
18
|
+
// src/charts/charts-labels.ts
|
|
19
|
+
var DEFAULT_CHARTS_LABELS = {
|
|
20
|
+
emptyTitle: "No data",
|
|
21
|
+
emptyMessage: "There is nothing to show for this range.",
|
|
22
|
+
errorTitle: "Could not load this chart",
|
|
23
|
+
errorMessage: "The data could not be loaded.",
|
|
24
|
+
retry: "Retry",
|
|
25
|
+
loading: "Loading chart",
|
|
26
|
+
other: "Other",
|
|
27
|
+
lineChart: "Line chart",
|
|
28
|
+
barChart: "Bar chart",
|
|
29
|
+
donutChart: "DonutChart chart",
|
|
30
|
+
stackedBarChart: "Stacked bar chart",
|
|
31
|
+
noData: (kind) => kind + ", no data",
|
|
32
|
+
pointCount: (n) => n + " " + (n === 1 ? "point" : "points"),
|
|
33
|
+
span: (first, end) => first + " to " + end,
|
|
34
|
+
seriesSummary: (kind, span, points, min, max, last) => kind + (span ? ", " + span : "") + ", " + points + ", " + min + " to " + max + ", last " + last,
|
|
35
|
+
donutSummary: (kind, slices) => kind + ": " + slices,
|
|
36
|
+
donutSlice: (label, pct) => label + " " + pct + "%",
|
|
37
|
+
stackedSummary: (kind, names, columns) => kind + " of " + names + " across " + columns + " columns",
|
|
38
|
+
splitBar: "Split bar",
|
|
39
|
+
rankedBars: "Ranked bars",
|
|
40
|
+
free: "Free",
|
|
41
|
+
splitEmpty: "No data yet",
|
|
42
|
+
percent: (pct) => pct + " percent"
|
|
43
|
+
};
|
|
44
|
+
function ChartFrame({
|
|
45
|
+
state = "data",
|
|
46
|
+
width,
|
|
47
|
+
height,
|
|
48
|
+
compact = false,
|
|
49
|
+
icon,
|
|
50
|
+
tone,
|
|
51
|
+
variant = "plain",
|
|
52
|
+
motion,
|
|
53
|
+
emptyTitle: emptyTitleProp,
|
|
54
|
+
emptyMessage: emptyMessageProp,
|
|
55
|
+
errorTitle: errorTitleProp,
|
|
56
|
+
errorMessage: errorMessageProp,
|
|
57
|
+
retryLabel: retryLabelProp,
|
|
58
|
+
loadingLabel: loadingLabelProp,
|
|
59
|
+
labels: labelsProp,
|
|
60
|
+
onRetry
|
|
61
|
+
}) {
|
|
62
|
+
const labels = useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
63
|
+
const emptyTitle = emptyTitleProp ?? labels.emptyTitle;
|
|
64
|
+
const emptyMessage = emptyMessageProp ?? labels.emptyMessage;
|
|
65
|
+
const errorTitle = errorTitleProp ?? labels.errorTitle;
|
|
66
|
+
const errorMessage = errorMessageProp ?? labels.errorMessage;
|
|
67
|
+
const retryLabel = retryLabelProp ?? labels.retry;
|
|
68
|
+
const loadingLabel = loadingLabelProp ?? labels.loading;
|
|
69
|
+
const theme = useLoamTheme("charts");
|
|
70
|
+
const { styles } = useStyles(frameSheet);
|
|
71
|
+
if (state === "data") return null;
|
|
72
|
+
const box = {
|
|
73
|
+
minWidth: width,
|
|
74
|
+
minHeight: height,
|
|
75
|
+
...variant !== "plain" ? {
|
|
76
|
+
borderWidth: theme.borderWidth.thin,
|
|
77
|
+
borderColor: theme.color.border,
|
|
78
|
+
borderRadius: theme.radius.md,
|
|
79
|
+
...variant === "filled" ? { backgroundColor: theme.color.surface } : null
|
|
80
|
+
} : null
|
|
81
|
+
};
|
|
82
|
+
if (state === "loading") {
|
|
83
|
+
return /* @__PURE__ */ jsx(
|
|
84
|
+
Skeleton,
|
|
85
|
+
{
|
|
86
|
+
variant: "rect",
|
|
87
|
+
width,
|
|
88
|
+
height: height ?? 120,
|
|
89
|
+
accessibilityLabel: loadingLabel,
|
|
90
|
+
motion,
|
|
91
|
+
style: box
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
if (!compact) {
|
|
96
|
+
const error = state === "error";
|
|
97
|
+
return /* @__PURE__ */ jsx(View, { style: box, children: /* @__PURE__ */ jsx(
|
|
98
|
+
EmptyState,
|
|
99
|
+
{
|
|
100
|
+
variant: error || tone === "danger" ? "error" : "empty",
|
|
101
|
+
icon: icon ?? (error ? "alert-triangle" : "chart-bar"),
|
|
102
|
+
title: error ? errorTitle : emptyTitle,
|
|
103
|
+
description: error ? errorMessage : emptyMessage,
|
|
104
|
+
actionLabel: error && onRetry ? retryLabel : void 0,
|
|
105
|
+
onAction: error ? onRetry : void 0
|
|
106
|
+
}
|
|
107
|
+
) });
|
|
108
|
+
}
|
|
109
|
+
if (state === "empty") {
|
|
110
|
+
return /* @__PURE__ */ jsx(
|
|
111
|
+
View,
|
|
112
|
+
{
|
|
113
|
+
accessibilityRole: "image",
|
|
114
|
+
accessibilityLabel: `${emptyTitle}. ${emptyMessage}`,
|
|
115
|
+
style: [styles.center, box],
|
|
116
|
+
children: /* @__PURE__ */ jsx(
|
|
117
|
+
Icon,
|
|
118
|
+
{
|
|
119
|
+
name: icon ?? "chart-bar",
|
|
120
|
+
size: 18,
|
|
121
|
+
color: tone ? toneColors(theme, tone).main : theme.color.text3
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.centerRow, box], children: [
|
|
128
|
+
/* @__PURE__ */ jsx(Icon, { name: icon ?? "alert-triangle", size: 18, color: theme.color.danger }),
|
|
129
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onPress: onRetry, accessibilityLabel: retryLabel, children: retryLabel })
|
|
130
|
+
] });
|
|
131
|
+
}
|
|
132
|
+
var frameSheet = createStyleSheet((theme) => ({
|
|
133
|
+
center: {
|
|
134
|
+
alignItems: "center",
|
|
135
|
+
justifyContent: "center",
|
|
136
|
+
gap: theme.space.s2,
|
|
137
|
+
padding: theme.space.s4
|
|
138
|
+
},
|
|
139
|
+
centerRow: {
|
|
140
|
+
flexDirection: "row",
|
|
141
|
+
alignItems: "center",
|
|
142
|
+
justifyContent: "center",
|
|
143
|
+
gap: theme.space.s2,
|
|
144
|
+
padding: theme.space.s2
|
|
145
|
+
}
|
|
146
|
+
}));
|
|
147
|
+
function chartHue(theme, index) {
|
|
148
|
+
const palette = [
|
|
149
|
+
theme.chart.c1,
|
|
150
|
+
theme.chart.c2,
|
|
151
|
+
theme.chart.c3,
|
|
152
|
+
theme.chart.c4,
|
|
153
|
+
theme.chart.c5,
|
|
154
|
+
theme.chart.c6
|
|
155
|
+
];
|
|
156
|
+
return palette[((Math.round(index) - 1) % 6 + 6) % 6];
|
|
157
|
+
}
|
|
158
|
+
function chartEdgeHue(theme, index) {
|
|
159
|
+
return theme.chart.edge[((Math.round(index) - 1) % 6 + 6) % 6];
|
|
160
|
+
}
|
|
161
|
+
function toneColors(theme, tone) {
|
|
162
|
+
switch (tone) {
|
|
163
|
+
case "good":
|
|
164
|
+
return { main: theme.color.good, soft: theme.color.goodSoft };
|
|
165
|
+
case "warn":
|
|
166
|
+
return { main: theme.color.warn, soft: theme.color.warnSoft };
|
|
167
|
+
case "danger":
|
|
168
|
+
return { main: theme.color.danger, soft: theme.color.dangerSoft };
|
|
169
|
+
default:
|
|
170
|
+
return { main: theme.color.accentStrong, soft: theme.color.accentSoft };
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function toneStep(theme, i) {
|
|
174
|
+
const steps = [
|
|
175
|
+
theme.opacity[100],
|
|
176
|
+
theme.opacity[72],
|
|
177
|
+
theme.opacity[56],
|
|
178
|
+
theme.opacity[48],
|
|
179
|
+
theme.opacity[38],
|
|
180
|
+
theme.opacity[32]
|
|
181
|
+
];
|
|
182
|
+
return steps[Math.min(Math.max(0, Math.round(i)), steps.length - 1)];
|
|
183
|
+
}
|
|
184
|
+
function useToneColors(tone) {
|
|
185
|
+
return toneColors(useLoamTheme("charts"), tone);
|
|
186
|
+
}
|
|
187
|
+
function clamp(n, lo, hi) {
|
|
188
|
+
return Math.max(lo, Math.min(hi, n));
|
|
189
|
+
}
|
|
190
|
+
function useDrawIn(motion, animate) {
|
|
191
|
+
const resolved = useResolvedMotion(motion ?? (animate ? "full" : "none"), "charts");
|
|
192
|
+
const on = resolved !== "none";
|
|
193
|
+
const theme = useLoamTheme("charts");
|
|
194
|
+
const opacity = React.useRef(new Animated.Value(on ? 0 : 1)).current;
|
|
195
|
+
React.useEffect(() => {
|
|
196
|
+
if (!on) return;
|
|
197
|
+
const anim = Animated.timing(opacity, {
|
|
198
|
+
toValue: 1,
|
|
199
|
+
duration: theme.motion.enter.duration,
|
|
200
|
+
easing: Easing.bezier(...theme.motion.enter.easing),
|
|
201
|
+
useNativeDriver: true
|
|
202
|
+
});
|
|
203
|
+
anim.start();
|
|
204
|
+
return () => anim.stop();
|
|
205
|
+
}, [on, opacity, theme.motion.enter]);
|
|
206
|
+
return opacity;
|
|
207
|
+
}
|
|
208
|
+
function Sparkline({
|
|
209
|
+
labels: labelsProp,
|
|
210
|
+
data,
|
|
211
|
+
width = 120,
|
|
212
|
+
height = 32,
|
|
213
|
+
tone = "accent",
|
|
214
|
+
strokeWidth = 2,
|
|
215
|
+
showArea = false,
|
|
216
|
+
showDot = false,
|
|
217
|
+
motion,
|
|
218
|
+
animate = false,
|
|
219
|
+
state = "data",
|
|
220
|
+
emptyTitle,
|
|
221
|
+
emptyMessage,
|
|
222
|
+
errorTitle,
|
|
223
|
+
errorMessage,
|
|
224
|
+
retryLabel,
|
|
225
|
+
loadingLabel,
|
|
226
|
+
onRetry,
|
|
227
|
+
accessibilityLabel: labelProp
|
|
228
|
+
}) {
|
|
229
|
+
const labels = useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
230
|
+
const { main, soft } = useToneColors(tone);
|
|
231
|
+
const opacity = useDrawIn(motion, animate);
|
|
232
|
+
const dotR = strokeWidth + 1.5;
|
|
233
|
+
const accessibilityLabel = labelProp ?? summarizeSeries(labels.lineChart, data, void 0, labels);
|
|
234
|
+
const pad = Math.max(strokeWidth, showDot ? dotR : 0);
|
|
235
|
+
const innerW = Math.max(0, width - pad * 2);
|
|
236
|
+
const innerH = Math.max(0, height - pad * 2);
|
|
237
|
+
const n = data.length;
|
|
238
|
+
const min = n > 0 ? Math.min(...data) : 0;
|
|
239
|
+
const max = n > 0 ? Math.max(...data) : 0;
|
|
240
|
+
const range = max - min || 1;
|
|
241
|
+
const stepX = n > 1 ? innerW / (n - 1) : 0;
|
|
242
|
+
const px = (i) => pad + i * stepX;
|
|
243
|
+
const py = (v) => pad + (1 - (v - min) / range) * innerH;
|
|
244
|
+
const points = data.map((v, i) => `${px(i)},${py(v)}`).join(" ");
|
|
245
|
+
const lastX = px(n - 1);
|
|
246
|
+
const lastY = n > 0 ? py(data[n - 1]) : 0;
|
|
247
|
+
const areaPath = n > 1 ? `M ${points.replace(/ /g, " L ")} L ${lastX},${height} L ${px(0)},${height} Z` : "";
|
|
248
|
+
if (state !== "data") {
|
|
249
|
+
return /* @__PURE__ */ jsx(
|
|
250
|
+
ChartFrame,
|
|
251
|
+
{
|
|
252
|
+
labels,
|
|
253
|
+
compact: true,
|
|
254
|
+
state,
|
|
255
|
+
width,
|
|
256
|
+
height,
|
|
257
|
+
emptyTitle,
|
|
258
|
+
emptyMessage,
|
|
259
|
+
errorTitle,
|
|
260
|
+
errorMessage,
|
|
261
|
+
retryLabel,
|
|
262
|
+
loadingLabel,
|
|
263
|
+
onRetry
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
return /* @__PURE__ */ jsx(
|
|
268
|
+
Animated.View,
|
|
269
|
+
{
|
|
270
|
+
accessibilityRole: "image",
|
|
271
|
+
accessibilityLabel,
|
|
272
|
+
style: { width, height, opacity },
|
|
273
|
+
children: /* @__PURE__ */ jsxs(Svg, { width, height, viewBox: `0 0 ${width} ${height}`, fill: "none", children: [
|
|
274
|
+
showArea && areaPath ? /* @__PURE__ */ jsx(Path, { d: areaPath, fill: soft }) : null,
|
|
275
|
+
n > 1 ? /* @__PURE__ */ jsx(
|
|
276
|
+
Polyline,
|
|
277
|
+
{
|
|
278
|
+
points,
|
|
279
|
+
fill: "none",
|
|
280
|
+
stroke: main,
|
|
281
|
+
strokeWidth,
|
|
282
|
+
strokeLinecap: "round",
|
|
283
|
+
strokeLinejoin: "round"
|
|
284
|
+
}
|
|
285
|
+
) : null,
|
|
286
|
+
showDot && n > 0 ? /* @__PURE__ */ jsx(Circle, { cx: lastX, cy: lastY, r: dotR, fill: main }) : null
|
|
287
|
+
] })
|
|
288
|
+
}
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
function spoken(n) {
|
|
292
|
+
return new Intl.NumberFormat("en", { notation: "compact", maximumFractionDigits: 1 }).format(n);
|
|
293
|
+
}
|
|
294
|
+
function summarizeSeries(kind, values, labels, copy = DEFAULT_CHARTS_LABELS) {
|
|
295
|
+
if (values.length === 0) return copy.noData(kind);
|
|
296
|
+
const min = Math.min(...values);
|
|
297
|
+
const max = Math.max(...values);
|
|
298
|
+
const last = values[values.length - 1];
|
|
299
|
+
const first = labels?.[0];
|
|
300
|
+
const end = labels?.[values.length - 1];
|
|
301
|
+
const span = first && end ? copy.span(first, end) : "";
|
|
302
|
+
return copy.seriesSummary(
|
|
303
|
+
kind,
|
|
304
|
+
span,
|
|
305
|
+
copy.pointCount(values.length),
|
|
306
|
+
spoken(min),
|
|
307
|
+
spoken(max),
|
|
308
|
+
spoken(last)
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
function normalizeBars(data) {
|
|
312
|
+
return data.map((d) => typeof d === "number" ? { value: d } : d);
|
|
313
|
+
}
|
|
314
|
+
function topRoundedBar(x, y, w, h, r) {
|
|
315
|
+
const rr = Math.max(0, Math.min(r, w / 2, h));
|
|
316
|
+
if (rr <= 0) return `M ${x},${y} h ${w} v ${h} h ${-w} Z`;
|
|
317
|
+
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`;
|
|
318
|
+
}
|
|
319
|
+
function BarChart({
|
|
320
|
+
labels: labelsProp,
|
|
321
|
+
data,
|
|
322
|
+
width = 140,
|
|
323
|
+
height = 150,
|
|
324
|
+
tone = "accent",
|
|
325
|
+
gap = 8,
|
|
326
|
+
barRadius = 4,
|
|
327
|
+
highlightLast = true,
|
|
328
|
+
highlightIndex,
|
|
329
|
+
colors,
|
|
330
|
+
motion,
|
|
331
|
+
animate = false,
|
|
332
|
+
state = "data",
|
|
333
|
+
emptyTitle,
|
|
334
|
+
emptyMessage,
|
|
335
|
+
errorTitle,
|
|
336
|
+
errorMessage,
|
|
337
|
+
retryLabel,
|
|
338
|
+
loadingLabel,
|
|
339
|
+
onRetry,
|
|
340
|
+
accessibilityLabel: labelProp
|
|
341
|
+
}) {
|
|
342
|
+
const labels = useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
343
|
+
const theme = useLoamTheme("charts");
|
|
344
|
+
const { main, soft } = useToneColors(tone);
|
|
345
|
+
const opacity = useDrawIn(motion, animate);
|
|
346
|
+
const bars = normalizeBars(data);
|
|
347
|
+
const accessibilityLabel = labelProp ?? summarizeSeries(
|
|
348
|
+
labels.barChart,
|
|
349
|
+
bars.map((b) => b.value),
|
|
350
|
+
bars.map((b) => b.label),
|
|
351
|
+
labels
|
|
352
|
+
);
|
|
353
|
+
const n = bars.length;
|
|
354
|
+
const values = bars.map((b) => b.value);
|
|
355
|
+
const max = n > 0 ? Math.max(...values, 0) : 0;
|
|
356
|
+
const barW = n > 0 ? Math.max(0, (width - gap * (n - 1)) / n) : 0;
|
|
357
|
+
const fillFor = (i) => {
|
|
358
|
+
if (colors && colors.length > 0) {
|
|
359
|
+
const c = colors[i % colors.length];
|
|
360
|
+
return typeof c === "number" ? chartHue(theme, c) : toneColors(theme, c).main;
|
|
361
|
+
}
|
|
362
|
+
if (highlightIndex !== void 0) {
|
|
363
|
+
return i === highlightIndex ? theme.chart.c1 : theme.chart.c2;
|
|
364
|
+
}
|
|
365
|
+
return highlightLast ? i === n - 1 ? main : soft : main;
|
|
366
|
+
};
|
|
367
|
+
if (state !== "data") {
|
|
368
|
+
return /* @__PURE__ */ jsx(
|
|
369
|
+
ChartFrame,
|
|
370
|
+
{
|
|
371
|
+
labels,
|
|
372
|
+
state,
|
|
373
|
+
width,
|
|
374
|
+
height,
|
|
375
|
+
emptyTitle,
|
|
376
|
+
emptyMessage,
|
|
377
|
+
errorTitle,
|
|
378
|
+
errorMessage,
|
|
379
|
+
retryLabel,
|
|
380
|
+
loadingLabel,
|
|
381
|
+
onRetry
|
|
382
|
+
}
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
return /* @__PURE__ */ jsx(
|
|
386
|
+
Animated.View,
|
|
387
|
+
{
|
|
388
|
+
accessibilityRole: "image",
|
|
389
|
+
accessibilityLabel,
|
|
390
|
+
style: { width, height, opacity },
|
|
391
|
+
children: /* @__PURE__ */ jsx(Svg, { width, height, viewBox: `0 0 ${width} ${height}`, fill: "none", children: bars.map((b, i) => {
|
|
392
|
+
const h = max > 0 ? clamp(b.value / max, 0, 1) * height : 0;
|
|
393
|
+
const x = i * (barW + gap);
|
|
394
|
+
const y = height - h;
|
|
395
|
+
return /* @__PURE__ */ jsx(
|
|
396
|
+
Path,
|
|
397
|
+
{
|
|
398
|
+
d: topRoundedBar(x, y, barW, h, Math.min(barRadius, barW / 4)),
|
|
399
|
+
fill: fillFor(i)
|
|
400
|
+
},
|
|
401
|
+
i
|
|
402
|
+
);
|
|
403
|
+
}) })
|
|
404
|
+
}
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
function RingChart({
|
|
408
|
+
labels: labelsProp,
|
|
409
|
+
value,
|
|
410
|
+
max = 100,
|
|
411
|
+
diameter: size = 92,
|
|
412
|
+
thickness = 8,
|
|
413
|
+
tone = "accent",
|
|
414
|
+
label = false,
|
|
415
|
+
motion,
|
|
416
|
+
animate = false,
|
|
417
|
+
state = "data",
|
|
418
|
+
accessibilityLabel
|
|
419
|
+
}) {
|
|
420
|
+
const labels = useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
421
|
+
const theme = useLoamTheme("charts");
|
|
422
|
+
const { main } = useToneColors(tone);
|
|
423
|
+
const opacity = useDrawIn(motion, animate);
|
|
424
|
+
if (state !== "data") {
|
|
425
|
+
return /* @__PURE__ */ jsx(ChartFrame, { labels, state, width: size, height: size, compact: true });
|
|
426
|
+
}
|
|
427
|
+
const fraction = max > 0 ? clamp(value / max, 0, 1) : 0;
|
|
428
|
+
const now = Math.round(fraction * 100);
|
|
429
|
+
const center = size / 2;
|
|
430
|
+
const radius = (size - thickness) / 2;
|
|
431
|
+
const circumference = 2 * Math.PI * radius;
|
|
432
|
+
const dashOffset = circumference * (1 - fraction);
|
|
433
|
+
const labelText = label === true ? `${now}%` : typeof label === "string" ? label : null;
|
|
434
|
+
const labelSize = Math.max(theme.fontSize[14], Math.round(size * 0.2));
|
|
435
|
+
return /* @__PURE__ */ jsxs(
|
|
436
|
+
Animated.View,
|
|
437
|
+
{
|
|
438
|
+
accessibilityRole: "progressbar",
|
|
439
|
+
accessibilityLabel,
|
|
440
|
+
accessibilityValue: { min: 0, max, now: Math.round(fraction * max) },
|
|
441
|
+
"aria-valuemin": 0,
|
|
442
|
+
"aria-valuemax": max,
|
|
443
|
+
"aria-valuenow": Math.round(fraction * max),
|
|
444
|
+
style: { width: size, height: size, alignItems: "center", justifyContent: "center", opacity },
|
|
445
|
+
children: [
|
|
446
|
+
/* @__PURE__ */ jsxs(
|
|
447
|
+
Svg,
|
|
448
|
+
{
|
|
449
|
+
width: size,
|
|
450
|
+
height: size,
|
|
451
|
+
viewBox: `0 0 ${size} ${size}`,
|
|
452
|
+
fill: "none",
|
|
453
|
+
style: ringSvgStyle,
|
|
454
|
+
children: [
|
|
455
|
+
/* @__PURE__ */ jsx(
|
|
456
|
+
Circle,
|
|
457
|
+
{
|
|
458
|
+
cx: center,
|
|
459
|
+
cy: center,
|
|
460
|
+
r: radius,
|
|
461
|
+
stroke: theme.color.surface3,
|
|
462
|
+
strokeWidth: thickness,
|
|
463
|
+
fill: "none"
|
|
464
|
+
}
|
|
465
|
+
),
|
|
466
|
+
/* @__PURE__ */ jsx(
|
|
467
|
+
Circle,
|
|
468
|
+
{
|
|
469
|
+
cx: center,
|
|
470
|
+
cy: center,
|
|
471
|
+
r: radius,
|
|
472
|
+
stroke: main,
|
|
473
|
+
strokeWidth: thickness,
|
|
474
|
+
strokeLinecap: "round",
|
|
475
|
+
fill: "none",
|
|
476
|
+
strokeDasharray: `${circumference} ${circumference}`,
|
|
477
|
+
strokeDashoffset: dashOffset,
|
|
478
|
+
transform: `rotate(-90 ${center} ${center})`
|
|
479
|
+
}
|
|
480
|
+
)
|
|
481
|
+
]
|
|
482
|
+
}
|
|
483
|
+
),
|
|
484
|
+
labelText !== null ? /* @__PURE__ */ jsx(
|
|
485
|
+
Text,
|
|
486
|
+
{
|
|
487
|
+
style: {
|
|
488
|
+
position: "absolute",
|
|
489
|
+
fontFamily: theme.font.sans,
|
|
490
|
+
fontWeight: theme.fontWeight.bold,
|
|
491
|
+
fontSize: labelSize,
|
|
492
|
+
color: theme.color.text
|
|
493
|
+
},
|
|
494
|
+
children: labelText
|
|
495
|
+
}
|
|
496
|
+
) : null
|
|
497
|
+
]
|
|
498
|
+
}
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
var ringSvgStyle = { position: "absolute" };
|
|
502
|
+
function foldDonutSlices(data, max, other) {
|
|
503
|
+
if (max <= 0 || data.length <= max) return data;
|
|
504
|
+
const keep = new Set(
|
|
505
|
+
data.map((d, i) => ({ v: d.value, i })).sort((a, b) => b.v - a.v).slice(0, max - 1).map((x) => x.i)
|
|
506
|
+
);
|
|
507
|
+
const rest = data.filter((_, i) => !keep.has(i)).reduce((a, d) => a + d.value, 0);
|
|
508
|
+
return [...data.filter((_, i) => keep.has(i)), { label: other, value: rest }];
|
|
509
|
+
}
|
|
510
|
+
function DonutChart({
|
|
511
|
+
labels: labelsProp,
|
|
512
|
+
data: rawData,
|
|
513
|
+
maxSlices = 5,
|
|
514
|
+
otherLabel: otherLabelProp,
|
|
515
|
+
diameter: size = 140,
|
|
516
|
+
thickness = 18,
|
|
517
|
+
showLegend = true,
|
|
518
|
+
centerLabel,
|
|
519
|
+
motion,
|
|
520
|
+
animate = false,
|
|
521
|
+
state = "data",
|
|
522
|
+
emptyTitle,
|
|
523
|
+
emptyMessage,
|
|
524
|
+
errorTitle,
|
|
525
|
+
errorMessage,
|
|
526
|
+
retryLabel,
|
|
527
|
+
loadingLabel,
|
|
528
|
+
onRetry,
|
|
529
|
+
accessibilityLabel: labelProp,
|
|
530
|
+
tone
|
|
531
|
+
}) {
|
|
532
|
+
const labels = useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
533
|
+
const data = foldDonutSlices(rawData, maxSlices, otherLabelProp ?? labels.other);
|
|
534
|
+
const donutTotal = data.reduce((a, d) => a + d.value, 0);
|
|
535
|
+
const accessibilityLabel = labelProp ?? (data.length && donutTotal > 0 ? labels.donutSummary(
|
|
536
|
+
labels.donutChart,
|
|
537
|
+
data.map((d) => labels.donutSlice(d.label, Math.round(d.value / donutTotal * 100))).join(", ")
|
|
538
|
+
) : labels.noData(labels.donutChart));
|
|
539
|
+
const theme = useLoamTheme("charts");
|
|
540
|
+
const { styles } = useStyles(donutSheet);
|
|
541
|
+
const opacity = useDrawIn(motion, animate);
|
|
542
|
+
if (state !== "data") {
|
|
543
|
+
return /* @__PURE__ */ jsx(
|
|
544
|
+
ChartFrame,
|
|
545
|
+
{
|
|
546
|
+
labels,
|
|
547
|
+
state,
|
|
548
|
+
width: size,
|
|
549
|
+
height: size,
|
|
550
|
+
emptyTitle,
|
|
551
|
+
emptyMessage,
|
|
552
|
+
errorTitle,
|
|
553
|
+
errorMessage,
|
|
554
|
+
retryLabel,
|
|
555
|
+
loadingLabel,
|
|
556
|
+
onRetry
|
|
557
|
+
}
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
const palette = [
|
|
561
|
+
theme.chart.c1,
|
|
562
|
+
theme.chart.c2,
|
|
563
|
+
theme.chart.c3,
|
|
564
|
+
theme.chart.c4,
|
|
565
|
+
theme.chart.c5,
|
|
566
|
+
theme.chart.c6
|
|
567
|
+
];
|
|
568
|
+
const colorAt = (i) => tone ? toneColors(theme, tone).main : palette[i % palette.length];
|
|
569
|
+
const center = size / 2;
|
|
570
|
+
const radius = (size - thickness) / 2;
|
|
571
|
+
const circumference = 2 * Math.PI * radius;
|
|
572
|
+
const total = data.reduce((sum, d) => sum + Math.max(0, d.value), 0);
|
|
573
|
+
const fractionOf = (v) => total > 0 ? Math.max(0, v) / total : 0;
|
|
574
|
+
let acc = 0;
|
|
575
|
+
const segments = data.map((d, i) => {
|
|
576
|
+
const fraction = fractionOf(d.value);
|
|
577
|
+
const start = acc;
|
|
578
|
+
acc += fraction;
|
|
579
|
+
return { i, fraction, start, color: colorAt(i), pct: Math.round(fraction * 100) };
|
|
580
|
+
});
|
|
581
|
+
const centerContent = centerLabel ?? String(Math.round(total));
|
|
582
|
+
const seam = segments.length > 1 ? 2 : 0;
|
|
583
|
+
return /* @__PURE__ */ jsxs(
|
|
584
|
+
View,
|
|
585
|
+
{
|
|
586
|
+
accessibilityRole: "image",
|
|
587
|
+
accessibilityLabel,
|
|
588
|
+
style: showLegend ? styles.container : void 0,
|
|
589
|
+
children: [
|
|
590
|
+
/* @__PURE__ */ jsxs(
|
|
591
|
+
Animated.View,
|
|
592
|
+
{
|
|
593
|
+
style: {
|
|
594
|
+
width: size,
|
|
595
|
+
height: size,
|
|
596
|
+
alignItems: "center",
|
|
597
|
+
justifyContent: "center",
|
|
598
|
+
opacity
|
|
599
|
+
},
|
|
600
|
+
children: [
|
|
601
|
+
/* @__PURE__ */ jsxs(
|
|
602
|
+
Svg,
|
|
603
|
+
{
|
|
604
|
+
width: size,
|
|
605
|
+
height: size,
|
|
606
|
+
viewBox: `0 0 ${size} ${size}`,
|
|
607
|
+
fill: "none",
|
|
608
|
+
style: ringSvgStyle,
|
|
609
|
+
children: [
|
|
610
|
+
/* @__PURE__ */ jsx(
|
|
611
|
+
Circle,
|
|
612
|
+
{
|
|
613
|
+
cx: center,
|
|
614
|
+
cy: center,
|
|
615
|
+
r: radius,
|
|
616
|
+
stroke: theme.chart.grid,
|
|
617
|
+
strokeWidth: thickness,
|
|
618
|
+
fill: "none"
|
|
619
|
+
}
|
|
620
|
+
),
|
|
621
|
+
segments.map((s) => /* @__PURE__ */ jsx(
|
|
622
|
+
Circle,
|
|
623
|
+
{
|
|
624
|
+
cx: center,
|
|
625
|
+
cy: center,
|
|
626
|
+
r: radius,
|
|
627
|
+
stroke: s.color,
|
|
628
|
+
...tone ? { strokeOpacity: toneStep(theme, s.i) } : null,
|
|
629
|
+
strokeWidth: thickness,
|
|
630
|
+
fill: "none",
|
|
631
|
+
strokeDasharray: `${Math.max(0, s.fraction * circumference - seam)} ${circumference - Math.max(0, s.fraction * circumference - seam)}`,
|
|
632
|
+
strokeDashoffset: -s.start * circumference,
|
|
633
|
+
transform: `rotate(-90 ${center} ${center})`
|
|
634
|
+
},
|
|
635
|
+
s.i
|
|
636
|
+
))
|
|
637
|
+
]
|
|
638
|
+
}
|
|
639
|
+
),
|
|
640
|
+
typeof centerContent === "string" || typeof centerContent === "number" ? (
|
|
641
|
+
// The Metric value: sans 700 tabular, 20 on the donut (R18).
|
|
642
|
+
/* @__PURE__ */ jsx(Text, { style: styles.centre, children: centerContent })
|
|
643
|
+
) : centerContent
|
|
644
|
+
]
|
|
645
|
+
}
|
|
646
|
+
),
|
|
647
|
+
showLegend ? /* @__PURE__ */ jsx(View, { style: styles.legend, children: segments.map((s) => /* @__PURE__ */ jsxs(View, { style: styles.legendRow, children: [
|
|
648
|
+
/* @__PURE__ */ jsx(
|
|
649
|
+
View,
|
|
650
|
+
{
|
|
651
|
+
style: [
|
|
652
|
+
styles.chip,
|
|
653
|
+
{ backgroundColor: s.color, borderColor: chartEdgeHue(theme, s.i + 1) },
|
|
654
|
+
tone ? { borderColor: s.color, opacity: toneStep(theme, s.i) } : null
|
|
655
|
+
]
|
|
656
|
+
}
|
|
657
|
+
),
|
|
658
|
+
/* @__PURE__ */ jsx(Text, { style: styles.legendLabel, children: data[s.i].label }),
|
|
659
|
+
/* @__PURE__ */ jsxs(Text, { style: styles.legendPct, children: [
|
|
660
|
+
s.pct,
|
|
661
|
+
"%"
|
|
662
|
+
] })
|
|
663
|
+
] }, s.i)) }) : null
|
|
664
|
+
]
|
|
665
|
+
}
|
|
666
|
+
);
|
|
667
|
+
}
|
|
668
|
+
var donutSheet = createStyleSheet((theme) => ({
|
|
669
|
+
container: { flexDirection: "row", alignItems: "center", gap: theme.space.s5 },
|
|
670
|
+
legend: { flexShrink: 1, gap: theme.space.s2 },
|
|
671
|
+
legendRow: {
|
|
672
|
+
flexDirection: "row",
|
|
673
|
+
alignItems: "center",
|
|
674
|
+
gap: theme.space.s2,
|
|
675
|
+
minWidth: theme.space[140]
|
|
676
|
+
},
|
|
677
|
+
centre: {
|
|
678
|
+
position: "absolute",
|
|
679
|
+
fontFamily: theme.font.sans,
|
|
680
|
+
fontWeight: theme.fontWeight.bold,
|
|
681
|
+
fontSize: theme.fontSize[20],
|
|
682
|
+
fontVariant: ["tabular-nums"],
|
|
683
|
+
color: theme.color.text
|
|
684
|
+
},
|
|
685
|
+
// The static key (R18): 10 swatch r 3 with its series edge, gap 8, the label
|
|
686
|
+
// at the platform's label weight (F51), the value in the count style.
|
|
687
|
+
chip: {
|
|
688
|
+
width: theme.space[10],
|
|
689
|
+
height: theme.space[10],
|
|
690
|
+
borderRadius: theme.radius[3],
|
|
691
|
+
borderWidth: theme.borderWidth.thin
|
|
692
|
+
},
|
|
693
|
+
legendLabel: {
|
|
694
|
+
fontFamily: theme.font.sans,
|
|
695
|
+
fontWeight: isAndroidIdiom(theme) ? theme.fontWeight.medium : theme.fontWeight.semibold,
|
|
696
|
+
fontSize: theme.fontSize[13],
|
|
697
|
+
color: theme.color.text
|
|
698
|
+
},
|
|
699
|
+
legendPct: {
|
|
700
|
+
marginLeft: "auto",
|
|
701
|
+
textAlign: "right",
|
|
702
|
+
fontFamily: theme.font.mono,
|
|
703
|
+
fontWeight: theme.fontWeight.medium,
|
|
704
|
+
fontSize: theme.fontSize[12],
|
|
705
|
+
fontVariant: ["tabular-nums"],
|
|
706
|
+
color: theme.color.text2
|
|
707
|
+
}
|
|
708
|
+
}));
|
|
709
|
+
function StackedBarChart({
|
|
710
|
+
labels: labelsProp,
|
|
711
|
+
data,
|
|
712
|
+
series,
|
|
713
|
+
width = 280,
|
|
714
|
+
height = 160,
|
|
715
|
+
gap = 10,
|
|
716
|
+
barRadius = 4,
|
|
717
|
+
colors,
|
|
718
|
+
stackMax,
|
|
719
|
+
showLabels = false,
|
|
720
|
+
showLegend = true,
|
|
721
|
+
motion,
|
|
722
|
+
animate = false,
|
|
723
|
+
state = "data",
|
|
724
|
+
emptyTitle,
|
|
725
|
+
emptyMessage,
|
|
726
|
+
errorTitle,
|
|
727
|
+
errorMessage,
|
|
728
|
+
retryLabel,
|
|
729
|
+
loadingLabel,
|
|
730
|
+
onRetry,
|
|
731
|
+
accessibilityLabel,
|
|
732
|
+
tone
|
|
733
|
+
}) {
|
|
734
|
+
const labels = useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
735
|
+
const theme = useLoamTheme("charts");
|
|
736
|
+
const { styles } = useStyles(stackedSheet);
|
|
737
|
+
const opacity = useDrawIn(motion, animate);
|
|
738
|
+
const palette = [
|
|
739
|
+
theme.chart.c1,
|
|
740
|
+
theme.chart.c2,
|
|
741
|
+
theme.chart.c3,
|
|
742
|
+
theme.chart.c4,
|
|
743
|
+
theme.chart.c5,
|
|
744
|
+
theme.chart.c6
|
|
745
|
+
];
|
|
746
|
+
const segColor = (i) => tone ? toneColors(theme, tone).main : colors && colors.length > 0 ? chartHue(theme, colors[i % colors.length]) : palette[i % palette.length];
|
|
747
|
+
const label = accessibilityLabel ?? (series && series.length ? labels.stackedSummary(
|
|
748
|
+
labels.stackedBarChart,
|
|
749
|
+
series.map((s) => s.label).join(", "),
|
|
750
|
+
data.length
|
|
751
|
+
) : labels.stackedBarChart);
|
|
752
|
+
if (state !== "data") {
|
|
753
|
+
return /* @__PURE__ */ jsx(
|
|
754
|
+
ChartFrame,
|
|
755
|
+
{
|
|
756
|
+
labels,
|
|
757
|
+
state,
|
|
758
|
+
width,
|
|
759
|
+
height,
|
|
760
|
+
emptyTitle,
|
|
761
|
+
emptyMessage,
|
|
762
|
+
errorTitle,
|
|
763
|
+
errorMessage,
|
|
764
|
+
retryLabel,
|
|
765
|
+
loadingLabel,
|
|
766
|
+
onRetry
|
|
767
|
+
}
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
const n = data.length;
|
|
771
|
+
const colW = n > 0 ? Math.max(0, (width - gap * (n - 1)) / n) : 0;
|
|
772
|
+
const totals = data.map((d) => d.values.reduce((a, v) => a + Math.max(0, v), 0));
|
|
773
|
+
const domain = stackMax ?? Math.max(...totals, 0);
|
|
774
|
+
const gridFractions = [0.25, 0.5, 0.75];
|
|
775
|
+
return /* @__PURE__ */ jsxs(View, { accessibilityRole: "image", accessibilityLabel: label, style: styles.wrap, children: [
|
|
776
|
+
/* @__PURE__ */ jsx(Animated.View, { style: { opacity }, children: /* @__PURE__ */ jsxs(Svg, { width, height, viewBox: `0 0 ${width} ${height}`, fill: "none", children: [
|
|
777
|
+
gridFractions.map((f) => /* @__PURE__ */ jsx(
|
|
778
|
+
Line,
|
|
779
|
+
{
|
|
780
|
+
x1: 0,
|
|
781
|
+
y1: f * height,
|
|
782
|
+
x2: width,
|
|
783
|
+
y2: f * height,
|
|
784
|
+
stroke: theme.chart.grid,
|
|
785
|
+
strokeWidth: 1
|
|
786
|
+
},
|
|
787
|
+
f
|
|
788
|
+
)),
|
|
789
|
+
data.map((d, ci) => {
|
|
790
|
+
const x = ci * (colW + gap);
|
|
791
|
+
let topIdx = -1;
|
|
792
|
+
d.values.forEach((v, si) => {
|
|
793
|
+
if (v > 0) topIdx = si;
|
|
794
|
+
});
|
|
795
|
+
let yCursor = height;
|
|
796
|
+
return d.values.map((v, si) => {
|
|
797
|
+
const h = domain > 0 ? Math.max(0, v) / domain * height : 0;
|
|
798
|
+
if (h <= 0) return null;
|
|
799
|
+
yCursor -= h;
|
|
800
|
+
const y = yCursor;
|
|
801
|
+
if (si === topIdx) {
|
|
802
|
+
return /* @__PURE__ */ jsx(
|
|
803
|
+
Path,
|
|
804
|
+
{
|
|
805
|
+
d: topRoundedBar(x, y, colW, h, Math.min(barRadius, colW / 4)),
|
|
806
|
+
fill: segColor(si),
|
|
807
|
+
...tone ? { fillOpacity: toneStep(theme, si) } : null,
|
|
808
|
+
stroke: theme.color.surface,
|
|
809
|
+
strokeWidth: 1
|
|
810
|
+
},
|
|
811
|
+
`${ci}-${si}`
|
|
812
|
+
);
|
|
813
|
+
}
|
|
814
|
+
return (
|
|
815
|
+
// Touching segments part on a 1 px surface seam, no outline (R19 V1).
|
|
816
|
+
/* @__PURE__ */ jsx(
|
|
817
|
+
Rect,
|
|
818
|
+
{
|
|
819
|
+
x,
|
|
820
|
+
y,
|
|
821
|
+
width: colW,
|
|
822
|
+
height: h,
|
|
823
|
+
fill: segColor(si),
|
|
824
|
+
...tone ? { fillOpacity: toneStep(theme, si) } : null,
|
|
825
|
+
stroke: theme.color.surface,
|
|
826
|
+
strokeWidth: 1
|
|
827
|
+
},
|
|
828
|
+
`${ci}-${si}`
|
|
829
|
+
)
|
|
830
|
+
);
|
|
831
|
+
});
|
|
832
|
+
})
|
|
833
|
+
] }) }),
|
|
834
|
+
showLabels ? /* @__PURE__ */ jsx(View, { style: styles.axis, children: data.map((d, i) => /* @__PURE__ */ jsx(Text, { style: styles.axisLabel, children: d.label }, i)) }) : null,
|
|
835
|
+
showLegend && series && series.length ? /* @__PURE__ */ jsx(View, { style: styles.legend, children: series.map((s, i) => /* @__PURE__ */ jsxs(View, { style: styles.legendItem, children: [
|
|
836
|
+
/* @__PURE__ */ jsx(
|
|
837
|
+
View,
|
|
838
|
+
{
|
|
839
|
+
style: [
|
|
840
|
+
styles.legendChip,
|
|
841
|
+
{
|
|
842
|
+
backgroundColor: segColor(i),
|
|
843
|
+
borderColor: chartEdgeHue(
|
|
844
|
+
theme,
|
|
845
|
+
colors && colors.length > 0 ? colors[i % colors.length] : i + 1
|
|
846
|
+
)
|
|
847
|
+
},
|
|
848
|
+
tone ? { borderColor: segColor(i), opacity: toneStep(theme, i) } : null
|
|
849
|
+
]
|
|
850
|
+
}
|
|
851
|
+
),
|
|
852
|
+
/* @__PURE__ */ jsx(Text, { style: styles.legendLabel, children: s.label })
|
|
853
|
+
] }, i)) }) : null
|
|
854
|
+
] });
|
|
855
|
+
}
|
|
856
|
+
var stackedSheet = createStyleSheet((theme) => ({
|
|
857
|
+
wrap: { gap: theme.space.s2 },
|
|
858
|
+
axis: { flexDirection: "row", justifyContent: "space-between" },
|
|
859
|
+
axisLabel: {
|
|
860
|
+
flex: 1,
|
|
861
|
+
textAlign: "center",
|
|
862
|
+
fontFamily: theme.font.mono,
|
|
863
|
+
fontSize: theme.fontSize[11],
|
|
864
|
+
color: theme.color.text3
|
|
865
|
+
},
|
|
866
|
+
legend: {
|
|
867
|
+
flexDirection: "row",
|
|
868
|
+
flexWrap: "wrap",
|
|
869
|
+
columnGap: theme.space.s4,
|
|
870
|
+
rowGap: theme.space.s2
|
|
871
|
+
},
|
|
872
|
+
legendItem: { flexDirection: "row", alignItems: "center", gap: theme.space.s2 },
|
|
873
|
+
legendChip: {
|
|
874
|
+
width: theme.space[10],
|
|
875
|
+
height: theme.space[10],
|
|
876
|
+
borderRadius: theme.radius[3],
|
|
877
|
+
borderWidth: theme.borderWidth.thin
|
|
878
|
+
},
|
|
879
|
+
legendLabel: {
|
|
880
|
+
fontFamily: theme.font.sans,
|
|
881
|
+
fontWeight: isAndroidIdiom(theme) ? theme.fontWeight.medium : theme.fontWeight.semibold,
|
|
882
|
+
fontSize: theme.fontSize[13],
|
|
883
|
+
color: theme.color.text
|
|
884
|
+
}
|
|
885
|
+
}));
|
|
886
|
+
function StatCard({
|
|
887
|
+
labels: labelsProp,
|
|
888
|
+
label,
|
|
889
|
+
value,
|
|
890
|
+
delta,
|
|
891
|
+
deltaTone = "good",
|
|
892
|
+
data,
|
|
893
|
+
tone = "accent",
|
|
894
|
+
loading = false,
|
|
895
|
+
roll = false,
|
|
896
|
+
motion,
|
|
897
|
+
onPress,
|
|
898
|
+
accessibilityLabel,
|
|
899
|
+
elevation = "default",
|
|
900
|
+
size = "sm",
|
|
901
|
+
variant = "default",
|
|
902
|
+
padding = "md",
|
|
903
|
+
format,
|
|
904
|
+
unit,
|
|
905
|
+
align = "start"
|
|
906
|
+
}) {
|
|
907
|
+
useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
908
|
+
const locale = useLoamLocale();
|
|
909
|
+
const theme = useLoamTheme("charts");
|
|
910
|
+
const android = isAndroidIdiom(theme);
|
|
911
|
+
const { styles } = useStyles(statSheet, {
|
|
912
|
+
idiom: android ? "android" : "ios",
|
|
913
|
+
size,
|
|
914
|
+
elevation: elevation === "default" ? void 0 : elevation
|
|
915
|
+
});
|
|
916
|
+
const valueFont = size === "lg" ? theme.type.largeTitle.fontSize : size === "md" ? theme.type.title1.fontSize : android ? theme.fontSize[24] : theme.fontSize[22];
|
|
917
|
+
const alignText = {
|
|
918
|
+
textAlign: align === "start" ? "left" : align === "end" ? "right" : "center"
|
|
919
|
+
};
|
|
920
|
+
const alignRow = {
|
|
921
|
+
justifyContent: align === "start" ? "flex-start" : align === "end" ? "flex-end" : "center"
|
|
922
|
+
};
|
|
923
|
+
const trimmed = delta?.trim() ?? "";
|
|
924
|
+
const direction = /^[-−]/.test(trimmed) ? "down" : /^\+/.test(trimmed) ? "up" : "flat";
|
|
925
|
+
const invert = direction === "down" ? deltaTone === "good" : deltaTone === "danger";
|
|
926
|
+
const [sparkW, setSparkW] = React.useState(0);
|
|
927
|
+
const onSparkLayout = React.useCallback((e) => {
|
|
928
|
+
setSparkW(e.nativeEvent.layout.width);
|
|
929
|
+
}, []);
|
|
930
|
+
const cardStyle = [
|
|
931
|
+
styles.card,
|
|
932
|
+
variant === "outline" ? styles.cardOutline : variant === "ghost" ? styles.cardGhost : null,
|
|
933
|
+
padding === "sm" ? styles.cardPadSm : padding === "lg" ? styles.cardPadLg : null
|
|
934
|
+
];
|
|
935
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
936
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.label, resolveTextRole(theme, "overline", android), alignText], children: label }),
|
|
937
|
+
loading ? /* @__PURE__ */ jsxs(View, { style: styles.valueRow, children: [
|
|
938
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "rect", width: 96, height: Math.round(valueFont * 1.1), decorative: true }),
|
|
939
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "text", width: 48, height: theme.space[20], decorative: true })
|
|
940
|
+
] }) : /* @__PURE__ */ jsxs(View, { style: [styles.valueRow, alignRow], children: [
|
|
941
|
+
roll && typeof value === "number" ? /* @__PURE__ */ jsx(NumberRoll, { value, format, textStyle: styles.value, motion }) : typeof value === "string" || typeof value === "number" ? /* @__PURE__ */ jsx(Text, { style: styles.value, children: typeof value === "number" && format ? value.toLocaleString(locale, format) : value }) : value,
|
|
942
|
+
unit ? /* @__PURE__ */ jsx(Text, { style: styles.unit, children: unit }) : null,
|
|
943
|
+
delta ? /* @__PURE__ */ jsx(MetricDelta, { delta, deltaDirection: direction, invert, size: "sm" }) : null
|
|
944
|
+
] }),
|
|
945
|
+
/* @__PURE__ */ jsx(View, { style: styles.spark, onLayout: onSparkLayout, children: loading ? /* @__PURE__ */ jsx(Skeleton, { variant: "rect", height: 34, decorative: true }) : (
|
|
946
|
+
/* 120 is the pre-measurement fallback (first paint, jsdom). */
|
|
947
|
+
/* @__PURE__ */ jsx(
|
|
948
|
+
Sparkline,
|
|
949
|
+
{
|
|
950
|
+
data,
|
|
951
|
+
tone,
|
|
952
|
+
width: sparkW > 0 ? sparkW : 120,
|
|
953
|
+
height: 34,
|
|
954
|
+
showArea: true
|
|
955
|
+
}
|
|
956
|
+
)
|
|
957
|
+
) })
|
|
958
|
+
] });
|
|
959
|
+
if (onPress) {
|
|
960
|
+
return /* @__PURE__ */ jsx(
|
|
961
|
+
Pressable,
|
|
962
|
+
{
|
|
963
|
+
accessibilityRole: "button",
|
|
964
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
965
|
+
accessibilityState: loading ? { busy: true } : void 0,
|
|
966
|
+
"aria-busy": loading || void 0,
|
|
967
|
+
onPress,
|
|
968
|
+
style: ({ pressed }) => [cardStyle, pressed ? styles.cardPressed : null],
|
|
969
|
+
children: body
|
|
970
|
+
}
|
|
971
|
+
);
|
|
972
|
+
}
|
|
973
|
+
return /* @__PURE__ */ jsx(
|
|
974
|
+
View,
|
|
975
|
+
{
|
|
976
|
+
accessibilityRole: "image",
|
|
977
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
978
|
+
accessibilityState: loading ? { busy: true } : void 0,
|
|
979
|
+
"aria-busy": loading || void 0,
|
|
980
|
+
style: cardStyle,
|
|
981
|
+
children: body
|
|
982
|
+
}
|
|
983
|
+
);
|
|
984
|
+
}
|
|
985
|
+
var statSheet = createStyleSheet((theme) => ({
|
|
986
|
+
card: {
|
|
987
|
+
backgroundColor: theme.color.surface,
|
|
988
|
+
borderWidth: theme.borderWidth.thin,
|
|
989
|
+
borderColor: theme.color.border,
|
|
990
|
+
borderRadius: theme.radius.lg,
|
|
991
|
+
minHeight: theme.space[112],
|
|
992
|
+
padding: theme.space[16],
|
|
993
|
+
gap: theme.space.s2,
|
|
994
|
+
variants: {
|
|
995
|
+
elevation: {
|
|
996
|
+
flat: {},
|
|
997
|
+
raised: { ...theme.shadow.lg }
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
},
|
|
1001
|
+
cardOutline: { backgroundColor: "transparent" },
|
|
1002
|
+
cardGhost: { backgroundColor: "transparent", borderColor: "transparent" },
|
|
1003
|
+
cardPadSm: { padding: theme.space[10] },
|
|
1004
|
+
cardPadLg: { padding: theme.space[24] },
|
|
1005
|
+
unit: { fontFamily: theme.font.sans, color: theme.color.text2 },
|
|
1006
|
+
cardPressed: { backgroundColor: theme.state.pressed },
|
|
1007
|
+
label: { fontFamily: theme.font.sans, color: theme.color.text2 },
|
|
1008
|
+
valueRow: {
|
|
1009
|
+
flexDirection: "row",
|
|
1010
|
+
flexWrap: "wrap",
|
|
1011
|
+
alignItems: "center",
|
|
1012
|
+
columnGap: theme.space.s2,
|
|
1013
|
+
rowGap: theme.space.s1
|
|
1014
|
+
},
|
|
1015
|
+
// The money figure (F51): iOS 22 / 700, Android 24 / 400, tabular.
|
|
1016
|
+
value: {
|
|
1017
|
+
fontFamily: theme.font.sans,
|
|
1018
|
+
fontVariant: ["tabular-nums"],
|
|
1019
|
+
color: theme.color.text,
|
|
1020
|
+
variants: {
|
|
1021
|
+
idiom: {
|
|
1022
|
+
ios: { fontWeight: theme.fontWeight.bold, fontSize: theme.fontSize[22] },
|
|
1023
|
+
android: { fontWeight: theme.fontWeight.regular, fontSize: theme.fontSize[24] }
|
|
1024
|
+
},
|
|
1025
|
+
size: {
|
|
1026
|
+
sm: {},
|
|
1027
|
+
md: {
|
|
1028
|
+
fontSize: theme.type.title1.fontSize,
|
|
1029
|
+
lineHeight: theme.type.title1.lineHeight,
|
|
1030
|
+
letterSpacing: theme.type.title1.letterSpacing
|
|
1031
|
+
},
|
|
1032
|
+
lg: {
|
|
1033
|
+
fontSize: theme.type.largeTitle.fontSize,
|
|
1034
|
+
lineHeight: theme.type.largeTitle.lineHeight,
|
|
1035
|
+
letterSpacing: theme.type.largeTitle.letterSpacing
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
},
|
|
1040
|
+
spark: { marginTop: "auto" }
|
|
1041
|
+
}));
|
|
1042
|
+
var plain = (v) => String(Math.round(v * 100) / 100);
|
|
1043
|
+
function chartSlot(theme, i) {
|
|
1044
|
+
const six = [
|
|
1045
|
+
theme.chart.c1,
|
|
1046
|
+
theme.chart.c2,
|
|
1047
|
+
theme.chart.c3,
|
|
1048
|
+
theme.chart.c4,
|
|
1049
|
+
theme.chart.c5,
|
|
1050
|
+
theme.chart.c6
|
|
1051
|
+
];
|
|
1052
|
+
return i < 6 ? six[i] : theme.chart.tier[(i - 6) % 6] ?? six[i % 6];
|
|
1053
|
+
}
|
|
1054
|
+
function segFill(theme, kind) {
|
|
1055
|
+
if (kind === "free") return theme.color.surface2;
|
|
1056
|
+
if (kind === "other") return theme.color.borderStrong;
|
|
1057
|
+
return chartSlot(theme, kind % 12);
|
|
1058
|
+
}
|
|
1059
|
+
function splitSegments(parts, maxParts, total, labels) {
|
|
1060
|
+
const clean = parts.filter((p) => p.value > 0);
|
|
1061
|
+
const own = clean.length > maxParts ? clean.slice(0, Math.max(0, maxParts - 1)) : clean;
|
|
1062
|
+
const rest = clean.slice(own.length);
|
|
1063
|
+
const segs = own.map((p, i) => ({ ...p, kind: i }));
|
|
1064
|
+
if (rest.length) {
|
|
1065
|
+
segs.push({
|
|
1066
|
+
id: "__other",
|
|
1067
|
+
label: labels.other,
|
|
1068
|
+
value: rest.reduce((a, p) => a + p.value, 0),
|
|
1069
|
+
kind: "other"
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
const sum = segs.reduce((a, s) => a + s.value, 0);
|
|
1073
|
+
if (total !== void 0 && total > sum) {
|
|
1074
|
+
segs.push({ id: "__free", label: labels.free, value: total - sum, kind: "free" });
|
|
1075
|
+
}
|
|
1076
|
+
return segs;
|
|
1077
|
+
}
|
|
1078
|
+
function SplitBar({
|
|
1079
|
+
parts,
|
|
1080
|
+
total,
|
|
1081
|
+
maxParts = 5,
|
|
1082
|
+
format = plain,
|
|
1083
|
+
legend = "below",
|
|
1084
|
+
size = "md",
|
|
1085
|
+
title,
|
|
1086
|
+
summary,
|
|
1087
|
+
state = "data",
|
|
1088
|
+
emptyText,
|
|
1089
|
+
motion,
|
|
1090
|
+
labels: labelsProp,
|
|
1091
|
+
tone
|
|
1092
|
+
}) {
|
|
1093
|
+
const labels = useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
1094
|
+
const theme = useLoamTheme("charts");
|
|
1095
|
+
const android = isAndroidIdiom(theme);
|
|
1096
|
+
const { styles } = useStyles(splitSheet, { size });
|
|
1097
|
+
const segs = splitSegments(parts, maxParts, total, labels);
|
|
1098
|
+
const paint = (kind) => tone && typeof kind === "number" ? toneColors(theme, tone).main : segFill(theme, kind);
|
|
1099
|
+
const whole = segs.reduce((a, s) => a + s.value, 0);
|
|
1100
|
+
const [lit, setLit] = React.useState(null);
|
|
1101
|
+
const pct = (v) => whole > 0 ? Math.round(v / whole * 100) : 0;
|
|
1102
|
+
const readout = lit !== null && segs[lit] ? `${segs[lit].label} \xB7 ${format(segs[lit].value)} \xB7 ${pct(segs[lit].value)}%` : void 0;
|
|
1103
|
+
const detail = readout ?? summary;
|
|
1104
|
+
const header = title !== void 0 || detail !== void 0 ? /* @__PURE__ */ jsxs(View, { style: styles.header, children: [
|
|
1105
|
+
title !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [styles.title, resolveTextRole(theme, "body", android)], children: title }) : /* @__PURE__ */ jsx(View, {}),
|
|
1106
|
+
state === "data" && detail !== void 0 ? /* @__PURE__ */ jsx(
|
|
1107
|
+
Text,
|
|
1108
|
+
{
|
|
1109
|
+
accessibilityLiveRegion: "polite",
|
|
1110
|
+
style: [styles.detail, resolveTextRole(theme, "subheadline", android)],
|
|
1111
|
+
children: detail
|
|
1112
|
+
}
|
|
1113
|
+
) : null
|
|
1114
|
+
] }) : null;
|
|
1115
|
+
if (state !== "data" || segs.length === 0) {
|
|
1116
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.wrap, children: [
|
|
1117
|
+
header,
|
|
1118
|
+
state === "loading" ? /* @__PURE__ */ jsx(Skeleton, { variant: "rect", height: size === "sm" ? 8 : 12, motion }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1119
|
+
/* @__PURE__ */ jsx(View, { style: [styles.bar, styles.emptyTrack] }),
|
|
1120
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.emptyText, resolveTextRole(theme, "footnote", android)], children: emptyText ?? labels.splitEmpty })
|
|
1121
|
+
] })
|
|
1122
|
+
] });
|
|
1123
|
+
}
|
|
1124
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.wrap, children: [
|
|
1125
|
+
header,
|
|
1126
|
+
/* @__PURE__ */ jsx(View, { role: "group", accessibilityLabel: labels.splitBar, style: [styles.bar, styles.row], children: segs.map((s, i) => /* @__PURE__ */ jsx(
|
|
1127
|
+
Pressable,
|
|
1128
|
+
{
|
|
1129
|
+
accessibilityRole: "button",
|
|
1130
|
+
accessibilityLabel: `${s.label}, ${format(s.value)}, ${labels.percent(pct(s.value))}`,
|
|
1131
|
+
onPress: () => {
|
|
1132
|
+
haptics.selection();
|
|
1133
|
+
setLit(lit === i ? null : i);
|
|
1134
|
+
},
|
|
1135
|
+
hitSlop: { top: theme.space[16], bottom: theme.space[16] },
|
|
1136
|
+
style: [
|
|
1137
|
+
styles.segment,
|
|
1138
|
+
s.kind === "free" && styles.freeEdge,
|
|
1139
|
+
{
|
|
1140
|
+
flexGrow: s.value,
|
|
1141
|
+
backgroundColor: paint(s.kind),
|
|
1142
|
+
opacity: lit !== null && lit !== i ? theme.opacity[32] : tone && typeof s.kind === "number" ? toneStep(theme, s.kind) : 1
|
|
1143
|
+
}
|
|
1144
|
+
]
|
|
1145
|
+
},
|
|
1146
|
+
s.id
|
|
1147
|
+
)) }),
|
|
1148
|
+
legend === "below" ? /* @__PURE__ */ jsx(View, { style: styles.legend, children: segs.map((s) => /* @__PURE__ */ jsxs(View, { style: styles.legendItem, children: [
|
|
1149
|
+
/* @__PURE__ */ jsx(
|
|
1150
|
+
View,
|
|
1151
|
+
{
|
|
1152
|
+
style: [
|
|
1153
|
+
styles.dot,
|
|
1154
|
+
s.kind === "free" && styles.freeEdge,
|
|
1155
|
+
{ backgroundColor: paint(s.kind) },
|
|
1156
|
+
tone && typeof s.kind === "number" ? { opacity: toneStep(theme, s.kind) } : null
|
|
1157
|
+
]
|
|
1158
|
+
}
|
|
1159
|
+
),
|
|
1160
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.legendText, resolveTextRole(theme, "footnote", android)], children: s.label })
|
|
1161
|
+
] }, s.id)) }) : null
|
|
1162
|
+
] });
|
|
1163
|
+
}
|
|
1164
|
+
var splitSheet = createStyleSheet((theme) => ({
|
|
1165
|
+
wrap: { gap: theme.space[10] },
|
|
1166
|
+
header: {
|
|
1167
|
+
flexDirection: "row",
|
|
1168
|
+
justifyContent: "space-between",
|
|
1169
|
+
alignItems: "baseline",
|
|
1170
|
+
gap: theme.space.s3
|
|
1171
|
+
},
|
|
1172
|
+
title: { fontFamily: theme.font.sans, color: theme.color.text, flexShrink: 1 },
|
|
1173
|
+
detail: { fontFamily: theme.font.sans, color: theme.color.text2, fontVariant: ["tabular-nums"] },
|
|
1174
|
+
bar: { variants: { size: { sm: { height: theme.space[8] }, md: { height: theme.space[12] } } } },
|
|
1175
|
+
row: { flexDirection: "row", gap: theme.space[2] },
|
|
1176
|
+
// r 4 on every segment; min 2 so a tiny share stays visible.
|
|
1177
|
+
segment: { flexBasis: 0, minWidth: theme.space[2], borderRadius: theme.radius.xs },
|
|
1178
|
+
freeEdge: { borderWidth: theme.borderWidth.thin, borderColor: theme.color.border },
|
|
1179
|
+
emptyTrack: {
|
|
1180
|
+
borderRadius: theme.radius.xs,
|
|
1181
|
+
backgroundColor: theme.color.surface2,
|
|
1182
|
+
borderWidth: theme.borderWidth.thin,
|
|
1183
|
+
borderColor: theme.color.border
|
|
1184
|
+
},
|
|
1185
|
+
emptyText: { fontFamily: theme.font.sans, color: theme.color.text3 },
|
|
1186
|
+
legend: {
|
|
1187
|
+
flexDirection: "row",
|
|
1188
|
+
flexWrap: "wrap",
|
|
1189
|
+
columnGap: theme.space[14],
|
|
1190
|
+
rowGap: theme.space[6]
|
|
1191
|
+
},
|
|
1192
|
+
legendItem: { flexDirection: "row", alignItems: "center", gap: theme.space[6] },
|
|
1193
|
+
dot: { width: theme.space[8], height: theme.space[8], borderRadius: theme.radius.full },
|
|
1194
|
+
legendText: { fontFamily: theme.font.sans, color: theme.color.text2 }
|
|
1195
|
+
}));
|
|
1196
|
+
function RankedBars({
|
|
1197
|
+
items,
|
|
1198
|
+
limit = 5,
|
|
1199
|
+
tone = 1,
|
|
1200
|
+
format = plain,
|
|
1201
|
+
state = "data",
|
|
1202
|
+
emptyText,
|
|
1203
|
+
motion,
|
|
1204
|
+
accessibilityLabel,
|
|
1205
|
+
labels: labelsProp
|
|
1206
|
+
}) {
|
|
1207
|
+
const labels = useLabels("charts", DEFAULT_CHARTS_LABELS, labelsProp);
|
|
1208
|
+
const theme = useLoamTheme("charts");
|
|
1209
|
+
const android = isAndroidIdiom(theme);
|
|
1210
|
+
const { styles } = useStyles(rankedSheet);
|
|
1211
|
+
const shown = [...items].sort((a, b) => b.value - a.value).slice(0, limit);
|
|
1212
|
+
const max = Math.max(0, ...shown.map((r) => r.value));
|
|
1213
|
+
const fill = chartSlot(theme, ((Math.round(tone) - 1) % 12 + 12) % 12);
|
|
1214
|
+
const labelRole = resolveTextRole(theme, android ? "bodyMedium" : "subheadline", android);
|
|
1215
|
+
if (state === "loading") {
|
|
1216
|
+
return /* @__PURE__ */ jsx(View, { style: styles.list, children: Array.from({ length: Math.min(limit, 5) }, (_, i) => /* @__PURE__ */ jsxs(View, { style: [styles.row, styles.rowStatic], children: [
|
|
1217
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "text", width: 96, motion }),
|
|
1218
|
+
/* @__PURE__ */ jsx(View, { style: styles.trackCell, children: /* @__PURE__ */ jsx(Skeleton, { variant: "rect", height: 8, motion }) })
|
|
1219
|
+
] }, i)) });
|
|
1220
|
+
}
|
|
1221
|
+
if (state === "empty" || shown.length === 0) {
|
|
1222
|
+
return /* @__PURE__ */ jsx(Text, { style: [styles.empty, resolveTextRole(theme, "footnote", android)], children: emptyText ?? labels.splitEmpty });
|
|
1223
|
+
}
|
|
1224
|
+
return /* @__PURE__ */ jsx(
|
|
1225
|
+
View,
|
|
1226
|
+
{
|
|
1227
|
+
accessibilityRole: "list",
|
|
1228
|
+
accessibilityLabel: accessibilityLabel ?? labels.rankedBars,
|
|
1229
|
+
style: styles.list,
|
|
1230
|
+
children: shown.map((r) => {
|
|
1231
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1232
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.label, labelRole], children: r.label }),
|
|
1233
|
+
/* @__PURE__ */ jsx(View, { style: [styles.trackCell, styles.track], children: /* @__PURE__ */ jsx(
|
|
1234
|
+
View,
|
|
1235
|
+
{
|
|
1236
|
+
style: [
|
|
1237
|
+
styles.fill,
|
|
1238
|
+
{ width: `${max > 0 ? r.value / max * 100 : 0}%`, backgroundColor: fill }
|
|
1239
|
+
]
|
|
1240
|
+
}
|
|
1241
|
+
) }),
|
|
1242
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.value, labelRole, android && styles.valueAndroid], children: format(r.value) })
|
|
1243
|
+
] });
|
|
1244
|
+
return r.onPress ? /* @__PURE__ */ jsx(View, { role: "listitem", children: /* @__PURE__ */ jsx(
|
|
1245
|
+
Pressable,
|
|
1246
|
+
{
|
|
1247
|
+
accessibilityRole: "button",
|
|
1248
|
+
accessibilityLabel: `${r.label}, ${format(r.value)}`,
|
|
1249
|
+
onPress: r.onPress,
|
|
1250
|
+
android_ripple: android ? { color: theme.state.pressed } : void 0,
|
|
1251
|
+
style: ({ pressed }) => [
|
|
1252
|
+
styles.row,
|
|
1253
|
+
styles.rowTouch,
|
|
1254
|
+
pressed && !android && { backgroundColor: theme.state.pressed }
|
|
1255
|
+
],
|
|
1256
|
+
children: body
|
|
1257
|
+
}
|
|
1258
|
+
) }, r.id) : /* @__PURE__ */ jsx(
|
|
1259
|
+
View,
|
|
1260
|
+
{
|
|
1261
|
+
role: "listitem",
|
|
1262
|
+
accessible: true,
|
|
1263
|
+
accessibilityLabel: `${r.label}, ${format(r.value)}`,
|
|
1264
|
+
style: [styles.row, styles.rowStatic],
|
|
1265
|
+
children: body
|
|
1266
|
+
},
|
|
1267
|
+
r.id
|
|
1268
|
+
);
|
|
1269
|
+
})
|
|
1270
|
+
}
|
|
1271
|
+
);
|
|
1272
|
+
}
|
|
1273
|
+
var rankedSheet = createStyleSheet((theme) => ({
|
|
1274
|
+
list: { paddingVertical: theme.space[4] },
|
|
1275
|
+
row: {
|
|
1276
|
+
flexDirection: "row",
|
|
1277
|
+
alignItems: "center",
|
|
1278
|
+
gap: theme.space.s3,
|
|
1279
|
+
paddingHorizontal: theme.space.s4
|
|
1280
|
+
},
|
|
1281
|
+
rowStatic: { height: theme.space[32] },
|
|
1282
|
+
rowTouch: { height: theme.space[48] },
|
|
1283
|
+
label: { width: theme.space[96], fontFamily: theme.font.sans, color: theme.color.text },
|
|
1284
|
+
trackCell: { flex: 1 },
|
|
1285
|
+
track: {
|
|
1286
|
+
height: theme.space[8],
|
|
1287
|
+
borderRadius: theme.radius.xs,
|
|
1288
|
+
backgroundColor: theme.color.surface2
|
|
1289
|
+
},
|
|
1290
|
+
fill: { height: theme.space[8], borderRadius: theme.radius.xs },
|
|
1291
|
+
value: {
|
|
1292
|
+
width: theme.space[44],
|
|
1293
|
+
textAlign: "right",
|
|
1294
|
+
fontFamily: theme.font.sans,
|
|
1295
|
+
fontWeight: theme.fontWeight.semibold,
|
|
1296
|
+
fontVariant: ["tabular-nums"],
|
|
1297
|
+
color: theme.color.text
|
|
1298
|
+
},
|
|
1299
|
+
valueAndroid: { fontWeight: theme.fontWeight.medium },
|
|
1300
|
+
empty: { fontFamily: theme.font.sans, color: theme.color.text3, padding: theme.space.s2 }
|
|
1301
|
+
}));
|
|
1302
|
+
|
|
1303
|
+
export { BarChart, ChartFrame, DonutChart, RankedBars, RingChart, Sparkline, SplitBar, StackedBarChart, StatCard, foldDonutSlices };
|