efficient-shell 11.12.0 → 12.1.0
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/README.md +52 -11
- package/dist/{Browser-LPGSKKLU.js → Browser-U3SO6PSV.js} +14 -14
- package/dist/Calculator-6XGTP5OQ.js +29 -0
- package/dist/{CurrencyConverter-N2HQT7IR.js → CurrencyConverter-XNWE5MQW.js} +7 -7
- package/dist/Files-S4AFZX4N.js +121 -0
- package/dist/{Notepad-JCWNOQET.js → Notepad-YYNH67EN.js} +9 -9
- package/dist/PdfViewer-ZI3QOG4G.js +1 -0
- package/dist/{PomodoroTimer-356JUEM3.js → PomodoroTimer-SBV43YX6.js} +63 -63
- package/dist/{Preview-X7XNDI6X.js → Preview-KV3L22LT.js} +20 -20
- package/dist/Sidebar-XVVZJ7PR.js +44 -0
- package/dist/{Stock-2XOOZNRR.js → Stock-GODZPUR3.js} +3 -3
- package/dist/{Weather-ZDU2722T.js → Weather-2IIV4CFT.js} +19 -19
- package/dist/{WorldClock-PQGERFCH.js → WorldClock-JW4MLMCB.js} +7 -7
- package/dist/ai/index.js +30 -30
- package/dist/apps/index.d.ts +133 -27
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/StatTile.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-SSM6P43S.js → chunk-27XV4TAU.js} +5 -5
- package/dist/{chunk-HJM4LSMM.js → chunk-2DOMIOYR.js} +1 -1
- package/dist/{chunk-YQLKZ5UQ.js → chunk-2OMM2AG3.js} +1 -1
- package/dist/chunk-2T7MZ77B.js +3 -0
- package/dist/{chunk-UEWB6IOD.js → chunk-2XQOK3CT.js} +2 -2
- package/dist/{chunk-7A2Y3W55.js → chunk-2YBJQUYQ.js} +1 -1
- package/dist/{chunk-UTITWGVW.js → chunk-32WEY6O5.js} +1 -1
- package/dist/{chunk-RMSF4UCJ.js → chunk-3CMCGOOV.js} +4 -4
- package/dist/{chunk-KYHDDVTR.js → chunk-3WFJ4PYV.js} +4 -4
- package/dist/chunk-43MCNASD.js +1 -0
- package/dist/{chunk-D4RVWSUT.js → chunk-4H5NTMOF.js} +1 -1
- package/dist/{chunk-L2IPWMLI.js → chunk-4KJ7MLWO.js} +6 -6
- package/dist/chunk-4RTDZSGH.js +27 -0
- package/dist/{chunk-HDABS36W.js → chunk-4UGFNTZ3.js} +12 -12
- package/dist/{chunk-VZ52KKNA.js → chunk-53EW4M5S.js} +5 -5
- package/dist/{chunk-GS74BABV.js → chunk-56ESGDIC.js} +1 -1
- package/dist/{chunk-PETBAYS5.js → chunk-5F6KJAF3.js} +14 -14
- package/dist/{chunk-AQ7CNPEE.js → chunk-5N6AC3LN.js} +11 -11
- package/dist/{chunk-PDFV3YQB.js → chunk-5NDONLH5.js} +3 -3
- package/dist/{chunk-LJJ7FDAQ.js → chunk-5THF6BJS.js} +5 -5
- package/dist/{chunk-6S6FJJKP.js → chunk-5V6SA77P.js} +6 -6
- package/dist/{chunk-5IESW4PM.js → chunk-63QLZYMN.js} +3 -3
- package/dist/{chunk-DMBA6KYQ.js → chunk-6XC3XX7F.js} +6 -6
- package/dist/{chunk-LWFH5QTJ.js → chunk-7EK7JNR4.js} +1 -1
- package/dist/{chunk-NPT6EXHK.js → chunk-7F4U43YN.js} +4 -4
- package/dist/{chunk-225LCPO7.js → chunk-7FBAZLBX.js} +1 -1
- package/dist/{chunk-NTUZT37J.js → chunk-7H7U3HC6.js} +4 -4
- package/dist/{chunk-ZKBGUDNB.js → chunk-7KIDOIPY.js} +1 -1
- package/dist/{chunk-R6TDZ7T5.js → chunk-7ZYEDXZX.js} +1 -1
- package/dist/{chunk-MD6EPKOR.js → chunk-A2ZEGD2S.js} +10 -10
- package/dist/{chunk-LLSLY6BT.js → chunk-ACNDPAAT.js} +1 -1
- package/dist/{chunk-XOH6QERF.js → chunk-AJ5NU7UH.js} +9 -9
- package/dist/{chunk-L74WV4RJ.js → chunk-AJO55X66.js} +6 -6
- package/dist/{chunk-ZMC25LRC.js → chunk-ANSQT5ZS.js} +1 -1
- package/dist/{chunk-HT7SOOMD.js → chunk-AQULCKKZ.js} +11 -11
- package/dist/{chunk-LP45EML2.js → chunk-B5OYS65L.js} +1 -1
- package/dist/chunk-BD4OHYQB.js +13 -0
- package/dist/{chunk-4TB4CSLB.js → chunk-BFA5U5JF.js} +11 -11
- package/dist/{chunk-Y4RHGLXB.js → chunk-BFO72WQB.js} +1 -1
- package/dist/{chunk-HOEEFFE3.js → chunk-BPECY7I7.js} +9 -9
- package/dist/{chunk-IFWXC323.js → chunk-BXZNMSTZ.js} +1 -1
- package/dist/{chunk-6ETRVCMH.js → chunk-BXZSLRNO.js} +10 -10
- package/dist/{chunk-YOXR3VKO.js → chunk-C4XV42QP.js} +1 -1
- package/dist/chunk-CC42UKIT.js +1 -0
- package/dist/{chunk-GRC46C4V.js → chunk-CD7P34VC.js} +7 -7
- package/dist/{chunk-4EVYK6DR.js → chunk-CENTHUBD.js} +7 -7
- package/dist/{chunk-TTQJQKCE.js → chunk-CF4YOJUQ.js} +10 -10
- package/dist/{chunk-O6VIHWYU.js → chunk-CNVYM3HP.js} +1 -1
- package/dist/{chunk-IJ6HZXZY.js → chunk-COMV3Z2U.js} +1 -1
- package/dist/chunk-CQCMJHDM.js +9 -0
- package/dist/{chunk-FD6XZRWA.js → chunk-CRB5GM4W.js} +1 -1
- package/dist/{chunk-JJLAI6GL.js → chunk-CRU2BNEM.js} +7 -7
- package/dist/{chunk-4APQHXLI.js → chunk-CTW2OKYS.js} +2 -2
- package/dist/chunk-CWTY4GTU.js +5 -0
- package/dist/{chunk-FEUTN4GK.js → chunk-DKUF7BD5.js} +1 -1
- package/dist/{chunk-HGMQOHMK.js → chunk-DSHEOC2O.js} +1 -1
- package/dist/{chunk-LXBBJNBQ.js → chunk-DU5IBIZQ.js} +1 -1
- package/dist/{chunk-5KKJAYKT.js → chunk-DZBGJ6X4.js} +1 -1
- package/dist/{chunk-FRH2AHPI.js → chunk-E227NVFX.js} +1 -1
- package/dist/{chunk-RBAC26J7.js → chunk-EEVKJJ5S.js} +4 -4
- package/dist/{chunk-WEEQDPU3.js → chunk-EOGXCGQF.js} +6 -6
- package/dist/{chunk-P75N466Z.js → chunk-ESDWHHQY.js} +2 -2
- package/dist/{chunk-AO7XAAGG.js → chunk-FAIHSCOG.js} +1 -1
- package/dist/chunk-FEJFGFPF.js +8 -0
- package/dist/{chunk-ZA2RBNRA.js → chunk-FLYOI6EW.js} +1 -1
- package/dist/{chunk-WOOKUEED.js → chunk-FOTDGSY5.js} +1 -1
- package/dist/{chunk-UBQUXUD2.js → chunk-FUUJJ7OH.js} +5 -5
- package/dist/chunk-FWUXYNWF.js +13 -0
- package/dist/{chunk-2ZAFRGRF.js → chunk-G2X5YYIQ.js} +2 -2
- package/dist/{chunk-KU4IWX6F.js → chunk-GEZ45J4Z.js} +2 -2
- package/dist/{chunk-HJBR73GS.js → chunk-GFBQ53WN.js} +1 -1
- package/dist/chunk-GGSPY3Q4.js +23 -0
- package/dist/chunk-GIUX7WUS.js +7 -0
- package/dist/{chunk-PVVHWLNX.js → chunk-GJ23UZDQ.js} +1 -1
- package/dist/{chunk-BPJ3CQH7.js → chunk-GJJKWGBX.js} +11 -11
- package/dist/chunk-GMLGR4R6.js +8 -0
- package/dist/{chunk-IKKR2TYY.js → chunk-GRB4LKZC.js} +5 -5
- package/dist/{chunk-K3IUUZO5.js → chunk-GZJ5F7SB.js} +8 -8
- package/dist/{chunk-WZJPASST.js → chunk-HB2XXIQG.js} +5 -5
- package/dist/chunk-HGZZXA2N.js +9 -0
- package/dist/{chunk-Q7UTGO73.js → chunk-HICNRXYB.js} +10 -10
- package/dist/{chunk-PTVTNCD6.js → chunk-HNQKXOFU.js} +4 -4
- package/dist/{chunk-OCWWEHNR.js → chunk-HS4EWT6L.js} +2 -2
- package/dist/{chunk-2NRNKF46.js → chunk-HTDZ3XAJ.js} +7 -7
- package/dist/chunk-HY3JYAUH.js +19 -0
- package/dist/{chunk-UVMM7AYO.js → chunk-I3QFYBOP.js} +1 -1
- package/dist/{chunk-GJFTO7D4.js → chunk-I7H3OIYX.js} +1 -1
- package/dist/{chunk-7FCIFHO7.js → chunk-IRZ6XM5A.js} +1 -1
- package/dist/{chunk-PL4HKGYP.js → chunk-IYPRFUTT.js} +1 -1
- package/dist/{chunk-TZXAW32T.js → chunk-J5ISQYVM.js} +1 -1
- package/dist/{chunk-DXKXETTT.js → chunk-JCTOQOVO.js} +1 -1
- package/dist/{chunk-IIKPM3F4.js → chunk-JCUG572K.js} +1 -1
- package/dist/{chunk-CXZ7PHHF.js → chunk-KHVECW4M.js} +6 -6
- package/dist/{chunk-CR3YDABU.js → chunk-L75RBQFH.js} +1 -1
- package/dist/{chunk-6CK44QWU.js → chunk-LJJSFJA2.js} +26 -26
- package/dist/{chunk-34AHNPW7.js → chunk-LLBH6PHE.js} +1 -1
- package/dist/{chunk-PMKBWDXO.js → chunk-LOEOCZCN.js} +1 -1
- package/dist/{chunk-VVDK7XPH.js → chunk-LTESFDTF.js} +1 -1
- package/dist/{chunk-6WPKLF6G.js → chunk-LUSIZ2BK.js} +15 -15
- package/dist/{chunk-JGWUSJDD.js → chunk-M7DFM2N7.js} +60 -60
- package/dist/{chunk-7V32O5NF.js → chunk-MRFNJZRR.js} +16 -31
- package/dist/{chunk-FFNPAJLS.js → chunk-NC36LJCA.js} +9 -9
- package/dist/{chunk-N75MPMLD.js → chunk-NHBDLW52.js} +1 -1
- package/dist/{chunk-SEP35R2E.js → chunk-NHWDB7R6.js} +1 -1
- package/dist/{chunk-NMQGAP3H.js → chunk-NJTFI7AA.js} +1 -1
- package/dist/chunk-NPQBJJLP.js +9 -0
- package/dist/{chunk-UHGAT5MH.js → chunk-NZYI4XV5.js} +2 -2
- package/dist/{chunk-SKRFI6WB.js → chunk-ONYPN3JY.js} +11 -11
- package/dist/{chunk-F33L4J3P.js → chunk-ORLQUGIN.js} +6 -6
- package/dist/{chunk-JJZAYAVL.js → chunk-PH3P54QQ.js} +1 -1
- package/dist/chunk-PKNHSZWK.js +8 -0
- package/dist/{chunk-IUG4Z2ND.js → chunk-PXIP246B.js} +1 -1
- package/dist/{chunk-GJVGGYQ2.js → chunk-QBD7V4TK.js} +1 -1
- package/dist/{chunk-OMROEVOP.js → chunk-QN56R4V4.js} +1 -1
- package/dist/{chunk-6UJYRGWY.js → chunk-QTMRW6DK.js} +1 -1
- package/dist/{chunk-LXQHTY3A.js → chunk-R3JKZXII.js} +5 -5
- package/dist/{chunk-6C6M3QXL.js → chunk-R3K3LVVS.js} +1 -1
- package/dist/{chunk-AWQ5SOC5.js → chunk-RIXX6NRV.js} +1 -1
- package/dist/{chunk-CAIKDX2M.js → chunk-RM74EAMV.js} +2 -2
- package/dist/{chunk-3N2MNOV5.js → chunk-RXHTIJ64.js} +1 -1
- package/dist/chunk-S3C3XJG7.js +1 -0
- package/dist/{chunk-OLJUPBY4.js → chunk-SCCAMJB4.js} +1 -1
- package/dist/{chunk-3PZI2C4R.js → chunk-SCGBCBXP.js} +1 -1
- package/dist/chunk-SX5CSXZO.js +8 -0
- package/dist/chunk-TBBG2AWY.js +9 -0
- package/dist/{chunk-KVVZLEUG.js → chunk-TRWHVG3A.js} +1 -1
- package/dist/{chunk-VIDT4JLR.js → chunk-TTSZSLQL.js} +1 -1
- package/dist/{chunk-SAASFWKB.js → chunk-UDJLRTQB.js} +1 -1
- package/dist/{chunk-G3FHFWC2.js → chunk-UDL2A2GT.js} +3 -3
- package/dist/chunk-UE54EN4C.js +2 -0
- package/dist/{chunk-VU5P4ZM5.js → chunk-VFBBGLRA.js} +12 -12
- package/dist/{chunk-ZHS2VQU7.js → chunk-VGWYAYHB.js} +3 -3
- package/dist/chunk-VPYD7UJM.js +22 -0
- package/dist/{chunk-UCAMOW53.js → chunk-VQPZDZ3R.js} +4 -4
- package/dist/{chunk-2XORVHF2.js → chunk-VW7W6LCV.js} +1 -1
- package/dist/{chunk-FUHURDBL.js → chunk-VZLYB5LX.js} +1 -1
- package/dist/{chunk-BOJEZKYS.js → chunk-WD3I7AEZ.js} +11 -11
- package/dist/{chunk-JRCFOZEU.js → chunk-WMLBMR4E.js} +3 -3
- package/dist/{chunk-UOGF37Z4.js → chunk-XARBHOEZ.js} +1 -1
- package/dist/{chunk-ELIWGIR7.js → chunk-XBDHRMQI.js} +9 -9
- package/dist/{chunk-RXVFAFEB.js → chunk-XQUXL75F.js} +1 -1
- package/dist/{chunk-5UCRYSQJ.js → chunk-XZH5PEML.js} +5 -5
- package/dist/{chunk-T74FGTLW.js → chunk-Y46WPTKY.js} +6 -6
- package/dist/chunk-YAD7TML2.js +28 -0
- package/dist/{chunk-M4AOQYSP.js → chunk-YKHAI5IZ.js} +1 -1
- package/dist/{chunk-D5MN3LXC.js → chunk-YRZP7JN4.js} +17 -17
- package/dist/{chunk-EQ72AP5E.js → chunk-Z43XVU2P.js} +1 -1
- package/dist/{chunk-4JJ5WT4D.js → chunk-ZACNIKIQ.js} +1 -1
- package/dist/{chunk-VEATEVMV.js → chunk-ZG3RF2VE.js} +1 -1
- package/dist/{chunk-JFCCI5L2.js → chunk-ZUBTNUVE.js} +1 -1
- package/dist/{chunk-I5GDAQYL.js → chunk-ZYFBV4C7.js} +2 -2
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +666 -666
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +3 -3
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +0 -265
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/shell.css +1 -12
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -8
- package/dist/Calculator-XUV5JV3O.js +0 -29
- package/dist/Documents-IRPS3N5T.js +0 -84
- package/dist/Files-VN2IOPHX.js +0 -88
- package/dist/PdfViewer-M4RTCNNE.js +0 -1
- package/dist/Sidebar-OZMJNAXN.js +0 -44
- package/dist/Spreadsheet-YQOVGIU7.js +0 -75
- package/dist/chunk-2E3K4FSQ.js +0 -13
- package/dist/chunk-2XOH3NJZ.js +0 -27
- package/dist/chunk-5W3U3EVG.js +0 -7
- package/dist/chunk-5YP7MFPK.js +0 -1
- package/dist/chunk-64KZ74CS.js +0 -8
- package/dist/chunk-7TVGP2SX.js +0 -8
- package/dist/chunk-AD27M3ZH.js +0 -9
- package/dist/chunk-B2AYI45X.js +0 -9
- package/dist/chunk-CGA6RTVI.js +0 -9
- package/dist/chunk-CR42APAY.js +0 -8
- package/dist/chunk-DHMOJX2Z.js +0 -1
- package/dist/chunk-EBGOENC3.js +0 -3
- package/dist/chunk-ES2LUEPN.js +0 -22
- package/dist/chunk-FZWSP7KJ.js +0 -28
- package/dist/chunk-KV4QPU6U.js +0 -23
- package/dist/chunk-MFP5KOQW.js +0 -9
- package/dist/chunk-QDL2FNP7.js +0 -8
- package/dist/chunk-R7KRBKFH.js +0 -5
- package/dist/chunk-SI33IE7G.js +0 -2
- package/dist/chunk-SPMD7UZO.js +0 -19
- package/dist/chunk-UZTKBA7Z.js +0 -13
- package/dist/chunk-VTVSMRFX.js +0 -1
- package/dist/chunk-YXSGMPNW.js +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{optionMatches as e,OptionSublabel as t}from"./chunk-GFBQ53WN.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-FZM3ZPW3.js";import{Tooltip as r}from"./chunk-NJN5IKWO.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as s,POPUP_MAX_WIDTH as a,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-5FYDNH4Y.js";import{useShellStrings as d}from"./chunk-43MCNASD.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as v}from"react-dom";import{jsxs as g,jsx as x,Fragment as b}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-accent-tint px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${o.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:o,onChange:y,options:N=[],placeholder:k,allowFreeText:j=!1,invalid:C,disabled:D,id:L,className:W="",tone:M,tooltip:E,split:F}){const[Y,$]=m(!1),[B,S]=m(""),G=d(),H=h(null),I=h(null),J=h(null),Z=s(H,Y),A=e=>N.find(t=>t.value===e)?.label??e,K=p(()=>{const t=new Set(o),n=[],r=B.trim().toLowerCase();for(const o of N)t.has(o.value)||(t.add(o.value),r&&!e(o,r)||n.push(o));return n},[N,o,B]),P=e=>{const t=[...o];for(const n of e){const e=n.trim();if(!e)continue;const o=e.toLowerCase(),r=N.find(t=>t.value===e||t.label.toLowerCase()===o)?.value,l=r??(j?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==o.length&&y(t)},T=e=>{e&&!o.includes(e)?(y([...o,e]),S("")):S("")},z=e=>y(o.filter(t=>t!==e)),O=()=>{const e=B.trim();if(F&&e)return P(e.split(F)),void S("");j&&e?T(e):S("")},Q=h(()=>{});Q.current=()=>{O(),$(!1)},f(()=>{if(!Y)return;const e=e=>{const t=e.target;H.current?.contains(t)||J.current?.contains(t)||(O(),$(!1))};document.addEventListener("mousedown",e);const t=l(()=>Q.current());return()=>{document.removeEventListener("mousedown",e),t()}});const U=N.length>0;/* @__PURE__ */
|
|
2
|
+
return g("div",{ref:H,className:"relative",children:[
|
|
3
|
+
/* @__PURE__ */g("div",{onMouseDown:e=>{D||e.target.closest("button")||(e.preventDefault(),I.current?.focus())},className:n({invalid:C,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${D?"bg-gray-50 cursor-not-allowed":""} ${W}`}),children:[o.map(e=>{const t=M?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
+
/* @__PURE__ */x("span",{className:"truncate",children:A(e)}),!D&&/* @__PURE__ */x("button",{type:"button","aria-label":G.select.removeItem?.(A(e))??`${G.select.remove} ${A(e)}`,onClick:()=>z(e),className:n.remove,children:"×"})]},e),l=E?.(e);return null==l?o:/* @__PURE__ */x(r,{content:l,className:"relative inline-flex max-w-full",children:o},e)}),
|
|
5
|
+
/* @__PURE__ */x("input",{id:L,ref:I,type:"text",autoComplete:"off",role:"combobox","aria-expanded":Y&&U,"aria-invalid":C||void 0,disabled:D,value:B,placeholder:0===o.length?k:void 0,onChange:e=>{(e=>{if(F){const t=e.split(F);if(t.length>1)return P(t.slice(0,-1)),void S(t[t.length-1])}S(e)})(e.target.value),$(!0)},onFocus:()=>{!D&&U&&$(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=B.trim(),o=n?K.filter(t=>e(t,n.toLowerCase())):[];1===o.length?T(o[0].value):O()}else"Backspace"===t.key&&""===B&&o.length>0?z(o[o.length-1]):"Escape"===t.key?($(!1),S(""),I.current?.blur()):"Tab"===t.key&&(O(),$(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-ink-strong placeholder:text-[color:var(--ink-placeholder)] rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),Y&&U&&v(
|
|
6
|
+
/* @__PURE__ */x("div",{ref:J,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:Z?.left,right:Z?.right,top:Z?.top,bottom:Z?.bottom,minWidth:Z?.minWidth,maxWidth:Z?.maxWidth??a,width:"max-content",visibility:Z?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:Z?.maxHeight??c},children:0===K.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:N.length>0&&o.length>=N.length?G.select.allSelected:G.select.noMatches}):K.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),T(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-row-hover text-ink whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-row-hover text-ink whitespace-nowrap",children:e.sublabel?/* @__PURE__ */g(b,{children:[
|
|
7
|
+
/* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
|
|
8
|
+
/* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-EOVXFXVV.js";import{useShellStrings as n}from"./chunk-
|
|
1
|
+
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-EOVXFXVV.js";import{useShellStrings as n}from"./chunk-43MCNASD.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
|
|
2
2
|
return i("div",{className:`grid grid-cols-3 gap-3 ${h}`.trim(),children:[o.map(a=>/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary",onClick:()=>u(r(l,a)),children:a},a)),
|
|
3
3
|
/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary","aria-label":p.backspace,onClick:()=>u(a(l)),children:"⌫"}),t&&/* @__PURE__ */c(e,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:d,onClick:t,children:m??p.enter})]})}export{l as NumericKeypad};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-
|
|
1
|
+
import{Breadcrumbs as e}from"./chunk-PXIP246B.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";function i({title:i,description:r,subtitle:c,actions:a,children:n,icon:l,breadcrumbs:m}){const d=r??c,h=a??n;/* @__PURE__ */
|
|
2
2
|
return t("div",{className:"mb-6",children:[m&&m.length>0&&/* @__PURE__ */s(e,{items:m,className:"mb-3"}),
|
|
3
3
|
/* @__PURE__ */t("div",{className:"flex items-start justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */t("div",{children:[
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-
|
|
2
|
-
return y("div",{ref:z,className:`relative inline-flex ${
|
|
3
|
-
/* @__PURE__ */x("button",{ref:
|
|
4
|
-
/* @__PURE__ */x(i,{portal:!0,className:
|
|
5
|
-
/* @__PURE__ */x("div",{ref:
|
|
1
|
+
import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-LLBH6PHE.js";import{useTabLayer as n,focusableIn as o}from"./chunk-CDAJKLGL.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-BFA5U5JF.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k=/(^|[\s:])!?z-/,w={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function D({trigger:D,items:L,align:j="end",side:A="bottom","aria-label":E,className:C="",triggerClassName:H,menuClassName:K="",minWidth:S=180,linkAs:W,disabled:$,id:N,"aria-describedby":U,"aria-disabled":B=!1,onOpenChange:T,footer:J,footerLabel:I}){const[q,G]=m(!1),[M,P]=m(-1),z=h(null),F=h(null),R=h(null),O=h(null),Q=h(null),V=null!=J&&!1!==J,Y=h({text:"",at:0}),X=g(),Z=g(),_=N??Z,ee=h(T);ee.current=T;const te=h(q);te.current=q;const re=v(e=>{G(!1),te.current&&(te.current=!1,ee.current?.(!1)),e&&F.current?.focus()},[]),ne=(t,r)=>{const n=L.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(L[i]))return i}return-1},oe=()=>R.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!q)return;const e=e=>{const t=e.target;if(z.current?.contains(t)||oe()?.contains(t))return;const r=oe()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||re(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>re(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[q,re]);const ie=v(()=>{const e=oe(),t=F.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:j,side:A});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=j},[j,A]);p(()=>{q&&ie()}),b(()=>{if(q)return u(()=>F.current,ie)},[q,ie]),b(()=>{if(!q)return;const t=R.current,r=e(L[M])?t?.querySelector(`[data-dropdown-index="${M}"]`):null;(r??t)?.focus({preventScroll:!0})},[q,M]),b(()=>{if(q)return f(e=>"Escape"===e.key&&(re(!0),!0),()=>O.current)},[q,re]),n(O,q&&V);const ae=h(null),le=e=>"first"===e?ne(0,1):ne(L.length-1,-1),se=e=>{P(le(e)),G(!0),te.current||(te.current=!0,ae.current=e,T?.(!0))};p(()=>{const e=ae.current;if(!q||!e)return;ae.current=null;const t=le(e);t!==M&&P(t)});const de=t(L,X),ce="function"==typeof J?J({close:()=>re(!0)}):J,ue={...k.test(K)?{}:{zIndex:s.popup},minWidth:S};/* @__PURE__ */
|
|
2
|
+
return y("div",{ref:z,className:`relative inline-flex ${C}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */x("button",{ref:F,id:_,type:"button","aria-haspopup":"menu","aria-expanded":q,"aria-controls":q?X:void 0,"aria-label":E,"aria-describedby":U,"aria-disabled":B||void 0,disabled:$,onClick:()=>{B||(q?re(!1):se("first"))},onKeyDown:e=>{B||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),se("first")):"ArrowUp"===e.key&&(e.preventDefault(),se("last")))},className:H??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60 "+(E?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:D}),q&&
|
|
4
|
+
/* @__PURE__ */x(i,{portal:!0,className:K,style:ue,children:/* @__PURE__ */y("div",{ref:O,children:[
|
|
5
|
+
/* @__PURE__ */x("div",{ref:R,id:X,role:"menu","aria-orientation":"vertical","aria-label":E,"aria-labelledby":E?void 0:_,"aria-describedby":de,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),P(ne(M+1,1));else if("ArrowUp"===t.key)t.preventDefault(),P(ne(M-1,-1));else if("Home"===t.key)t.preventDefault(),P(ne(0,1));else if("End"===t.key)t.preventDefault(),P(ne(L.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&Q.current?o(Q.current)[0]:void 0;e?e.focus({preventScroll:!0}):re(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-Y.current.at<500?Y.current.text+n:n;Y.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?M+1:Math.max(M,0),s=R.current,d=L.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(L[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void P(n)}})(t)},children:r(L,{menuId:X,choose:e=>{e.disabled||(re(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>re(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===M?0:-1,onMouseEnter:()=>{t.disabled||Q.current?.contains(document.activeElement)||P(e)}}),linkAs:W})}),V&&/* @__PURE__ */y("div",{ref:Q,role:"group","aria-label":I,"data-dropdown-footer":"",onKeyDown:e=>{const t=Q.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=R.current?.querySelector(`[data-dropdown-index="${M}"]`);return void(t??R.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),re(!0))},children:[
|
|
6
6
|
/* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
|
|
7
7
|
/* @__PURE__ */x("div",{style:w,children:ce})]})]})})]})}export{D as DropdownMenu};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{navIcons as e}from"./chunk-4LXCCZDM.js";import{Icon as t}from"./chunk-MRFNJZRR.js";import{isValidElement as n,cloneElement as r}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var a="react-os-shell:spreadsheet-preview-update",s=null,l=0;function d(e){const t=++l,n={token:t,data:e};return s=n,{update(e){s===n&&(n.data=e),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(a,{detail:{token:t,data:e}}))}}}function c(){return s}function p(e){s===e&&(s=null)}var u=class extends Error{limit;used;attempted;constructor(e,t,n){super("Not enough space"),this.name="FilesQuotaError",this.limit=e,this.used=t,this.attempted=n}};function f(e,t){return e&&"/"!==e?e.replace(/\/$/,"")+"/"+t:"/"+t}async function h(e,t){const n=await e.json().catch(()=>({}));return new Error(n.error||`${t} failed (${e.status})`)}function w(e){const t=()=>(e??(("undefined"!=typeof window?window.__REACT_OS_SHELL_FILE_SERVER__:void 0)||"http://localhost:4000").replace(/\/$/,"")).replace(/\/$/,""),n=(e,n={})=>fetch(`${t()}${e}`,{...n,credentials:"include"}),r=e=>({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{async quota(){const e=await n("/api/quota");if(!e.ok)throw await h(e,"Quota");const t=await e.json();return{used:t.used,limit:t.limit}},async list(e){const t=e??"/",r=await n(`/api/files?path=${encodeURIComponent(t)}`);if(!r.ok)throw await h(r,"Listing");const o=await r.json(),i=o.path||t,a=i.split("/").filter(Boolean);return{folder:{id:"/"===i?null:i,name:a[a.length-1]??"",role:"owner",path:[{id:null,name:""},...a.map((e,t)=>({id:"/"+a.slice(0,t+1).join("/"),name:e}))]},entries:(o.entries||[]).map(e=>({id:f(i,e.name),name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modifiedAt}))}},async upload(e,t){const r=new FormData;r.append("file",t);const o=await n(`/api/upload?path=${encodeURIComponent(e??"/")}`,{method:"POST",body:r});if(413===o.status){const e=await o.json().catch(()=>({}));throw new u(e.limit||0,e.used||0,e.attempted||t.size)}if(!o.ok)throw await h(o,"Upload")},async createFolder(e,t){const o=await n("/api/folder",r({path:f(e,t)}));if(!o.ok)throw await h(o,"Create folder")},async rename(e,t){const o=e.replace(/\/[^/]*$/,"")||"/",i=await n("/api/rename",r({from:e,to:f(o,t)}));if(!i.ok)throw await h(i,"Rename")},async remove(e){const t=await n(`/api/files?path=${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await h(t,"Delete")},async read(e){const t=await n(`/api/file?path=${encodeURIComponent(e)}`);if(!t.ok)throw await h(t,"Download");return t.blob()},async trash(){const e=await n("/api/trash");if(!e.ok)throw await h(e,"Listing trash");return(await e.json()).entries||[]},async restore(e){const t=await n("/api/trash/restore",r({id:e}));if(!t.ok)throw await h(t,"Restore")},async purge(e){const t=await n(`/api/trash/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await h(t,"Delete")},async emptyTrash(){const e=await n("/api/trash",{method:"DELETE"});if(!e.ok)throw await h(e,"Empty trash")}}}var m=null;function y(e){m=e}function g(){return m??w()}function x(){return null!==m}var b=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function v(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return b[Math.abs(t)%b.length]}var _={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},k={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},E={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},C={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function N({className:e}){/* @__PURE__ */
|
|
2
|
+
return o(t,{name:"folder",look:"solid",className:e})}function j(t,n){return n&&e[n]||(t?e[t]:void 0)}var T=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function R({entityType:e,isSelected:t,entityId:a,label:s,fileKind:l}){const d="preview-file"===e&&l,c=d?C[l]:null,p=d?E[l]:null;if("folder"===e)/* @__PURE__ */
|
|
3
|
+
return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o(N,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=j(a,s),i=v(a||s||"page");/* @__PURE__ */
|
|
4
|
+
return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${i} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&n(e)?r(e,{className:"h-7 w-7 text-white"}):T})})}/* @__PURE__ */
|
|
5
|
+
return i("div",{className:"w-12 h-12 relative flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:[
|
|
6
|
+
/* @__PURE__ */i("svg",{className:`w-10 h-12 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)] ${c??_[e]??"text-gray-500"}`,viewBox:"0 0 40 48",fill:"none",children:[
|
|
7
|
+
/* @__PURE__ */o("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",fill:"white",fillOpacity:"0.92"}),
|
|
8
|
+
/* @__PURE__ */o("path",{d:"M26 0l10 10H30a4 4 0 01-4-4V0z",fill:"currentColor",fillOpacity:"0.2"}),
|
|
9
|
+
/* @__PURE__ */o("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",stroke:"currentColor",strokeWidth:"1.5",strokeOpacity:"0.5"})]}),
|
|
10
|
+
/* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${c??_[e]??"text-gray-600"}`,children:p??k[e]??e.slice(0,3).toUpperCase()})]})}function I({item:e}){if("folder"===e.entityType)/* @__PURE__ */
|
|
11
|
+
return o(N,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=j(e.entityId,e.label);/* @__PURE__ */
|
|
12
|
+
return o("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${v(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&n(t)?r(t,{className:"h-3 w-3 text-white"}):/* @__PURE__ */o("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const i=("preview-file"===e.entityType&&e.fileKind?C[e.fileKind]:_[e.entityType])??"text-gray-400";/* @__PURE__ */
|
|
13
|
+
return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function L(e){return"preview-file"===e.entityType&&e.fileKind?E[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":k[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var $=null,S=/* @__PURE__ */new Set;function D(e){$=e,S.forEach(e=>e())}function P(e){return S.add(e),()=>{S.delete(e)}}function F(){return $}var V="__REACT_OS_SHELL_FILES_VIEW__",M="react-os-shell:files-show-trash",O="react-os-shell:files-open-desktop-folder";function A(){"undefined"!=typeof window&&(window[V]="trash",window.dispatchEvent(new CustomEvent(M)))}function U(e){"undefined"!=typeof window&&(window[V]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(O,{detail:{folderId:e}})))}function z(){if("undefined"==typeof window)return null;const e=window[V];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function W(){const e=z();return"undefined"!=typeof window&&(window[V]=null),e}export{I as DesktopItemMiniIcon,O as FILES_OPEN_DESKTOP_FOLDER_EVENT,M as FILES_SHOW_TRASH_EVENT,R as FileIconTile,u as FilesQuotaError,N as FolderGlyph,a as SPREADSHEET_PREVIEW_UPDATE_EVENT,p as claimSpreadsheetPreviewStage,W as consumeFilesViewRequest,w as createFileServerStore,L as desktopItemTypeLabel,F as getDesktopFoldersSnapshot,g as getFilesStore,x as hasHostFilesStore,z as peekFilesViewRequest,c as peekSpreadsheetPreviewStage,D as publishDesktopFolders,U as requestFilesDesktopFolderView,A as requestFilesTrashView,y as setFilesStore,d as setSpreadsheetPreview,P as subscribeDesktopFolders};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{inputClasses as e}from"./chunk-AYZY3YNC.js";import{pad2 as t}from"./chunk-LF27WIN2.js";import{useShellLocale as n}from"./chunk-
|
|
2
|
-
return i("input",{ref:d,type:"time",lang:
|
|
1
|
+
import{inputClasses as e}from"./chunk-AYZY3YNC.js";import{pad2 as t}from"./chunk-LF27WIN2.js";import{useShellLocale as n}from"./chunk-43MCNASD.js";import{forwardRef as r}from"react";import{jsx as i}from"react/jsx-runtime";var a=/^\d{2}:\d{2}(:\d{2})?$/;function o(e,n){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${t(e.getHours())}:${t(e.getMinutes())}`;return n?`${r}:${t(e.getSeconds())}`:r}return a.test(e)?e:""}var s=r(function({value:t,onChange:r,min:s,max:u,invalid:m,size:l,className:c="",step:f,...v},d){const p=null!=f&&Number(f)<60,N=n();/* @__PURE__ */
|
|
2
|
+
return i("input",{ref:d,type:"time",lang:N,step:f,"aria-invalid":m||void 0,value:o(t,p),min:o(s,p)||void 0,max:o(u,p)||void 0,onChange:e=>r?.(a.test(e.target.value)?e.target.value:null),className:e({invalid:m,size:l,className:c}),...v})});export{s as TimePicker_default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineTrack as n,TimelineMilestoneIcon as s}from"./chunk-
|
|
2
|
-
return h("div",A?{className:"shrink-0","data-timeline-variant":"rail",children:
|
|
1
|
+
import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineTrack as n,TimelineMilestoneIcon as s}from"./chunk-4UGFNTZ3.js";import{toDayMs as i,fmtSliderDate as t,DAY_MS as a}from"./chunk-7TC3LJQM.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-43MCNASD.js";import{jsx as h}from"react/jsx-runtime";function m({title:m,heading:d,subject:c,milestones:p,summary:u,endDate:g,phaseLabels:k,variant:v="card",edgeCaptions:f,highlightKeys:y=null,onHoverChange:b}){const M=l(Date.now,null),j=[],C=[],x=o().timeline,N=r();for(const e of p){const n=i(e.date??null);null===n?C.push({key:e.key,label:e.label,kind:e.kind}):j.push({...e,ms:n})}j.sort((e,n)=>e.ms-n.ms);const D=i(g??null);let L,w,H=!0;0===j.length?(w=D??M??0,L=w-30*a,H=null!==D||null!==M):(L=j[0].ms,w=D??j[j.length-1].ms,w-L<a&&(w=L+a));const O=j.length>0?Math.max(0,Math.round((w-L)/a)):0,T=u??(O>0?x.duration(O):void 0),J=[j.length>0?x.started(t(j[0].ms,N)):void 0,T,C.length>0?x.reached(j.length,p.length):void 0],K=j.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(n=e.kind,"dfm"===n?1:0),caption:e.caption,provisional:e.provisional};var n}),S={};for(const e of j)e.phase&&(S[e.phase]=S[e.phase]||[]).push(e.ms);const Z=Object.entries(S).filter(([,e])=>e.length>=2).map(([e,n])=>({key:e,label:k?.[e]??e,minMs:Math.min(...n),maxMs:Math.max(...n)})),A="rail"===v,F=H&&/* @__PURE__ */h("div",{className:"select-none",children:/* @__PURE__ */h(n,{axis:A?"spread":"compressed",labels:A?"none":"lanes",items:K,pending:C,phases:Z,startMs:L,endMs:w,todayMs:M??void 0,edgeCaptions:f,highlightKeys:y,onHoverChange:b,ariaLabel:x.milestones(m)})});/* @__PURE__ */
|
|
2
|
+
return h("div",A?{className:"shrink-0","data-timeline-variant":"rail",children:F}:{className:"shrink-0",children:/* @__PURE__ */h(e,{icon:/* @__PURE__ */h(s,{}),heading:d??m,subject:c,meta:J,children:F})})}export{m as MilestoneTimeline};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as t}from"./chunk-
|
|
1
|
+
import{Icon as t}from"./chunk-MRFNJZRR.js";import{jsxs as n,jsx as e}from"react/jsx-runtime";var r=t=>Array.isArray(t.options);function o(t){const n=[];for(const e of t)r(e)?n.push(...e.options):n.push(e);return n}function i(t,n){const e=[];for(const o of t){if(!r(o)){n(o)&&e.push(o);continue}const t=o.options.filter(n);t.length&&e.push({...o,options:t})}return e}function s(t,o,i,s=""){const a=[];let c=0;return t.forEach((t,u)=>{if(!r(t))return a.push(o(t,c)),void(c+=1);const l=`${i}-group-${u}`,p=c;c+=t.options.length,a.push(
|
|
2
2
|
/* @__PURE__ */n("div",{role:"group","aria-labelledby":l,children:[
|
|
3
3
|
/* @__PURE__ */e("div",{id:l,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${s}`.trim(),children:t.label}),t.options.map((t,n)=>o(t,p+n))]},l))}),a}function a({selected:n}){/* @__PURE__ */
|
|
4
4
|
return e(t,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(n?"":"invisible"),strokeWidth:2.5})}function c(t,n){return t.label.toLowerCase().includes(n)||(t.sublabel?.toLowerCase().includes(n)??!1)}function u({children:t,grows:n=!1}){/* @__PURE__ */
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{Calendar as e}from"./chunk-ONYPN3JY.js";import{toDateKey as t,fromDateKey as r,toMonthKey as n}from"./chunk-2HMNOLKX.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as o,InputEndActionButton as l}from"./chunk-56ESGDIC.js";import{FILTER_ON as i,FILTER_ON_INK as s,FILTER_OFF as c}from"./chunk-AYZY3YNC.js";import{calendarNames as d}from"./chunk-Y3JW2GW5.js";import{pad2 as m}from"./chunk-LF27WIN2.js";import{buttonClasses as u}from"./chunk-UQYNPYF4.js";import{Icon as h}from"./chunk-MRFNJZRR.js";import{onOverlayOpen as p}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as f}from"./chunk-62LW225J.js";import{useDropdownPosition as g}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as b}from"./chunk-D65T4H6J.js";import{glassStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as v,useShellLocale as y}from"./chunk-43MCNASD.js";import{useState as w,useRef as N,useId as k,useEffect as C}from"react";import{createPortal as M}from"react-dom";import{jsxs as D,Fragment as j,jsx as W}from"react/jsx-runtime";var $=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Y=t;function F(e,r){const n=r.getFullYear(),a=r.getMonth(),o=new Date(n,a,r.getDate()),l=new Date(n,a,0),i=e=>new Date(n,a-e,1);switch(e){case"last2Weeks":return{from:t(new Date(n,a,r.getDate()-14)),to:t(o)};case"lastMonth":return{from:t(i(1)),to:t(l)};case"last3Months":return{from:t(i(3)),to:t(l)};case"last6Months":return{from:t(i(6)),to:t(l)};case"last12Months":return{from:t(i(12)),to:t(l)}}}function S(e,t,r){const a=n(e);return t&&a<t.slice(0,7)?t.slice(0,7):r&&a>r.slice(0,7)?r.slice(0,7):a}function O(e){const t=r(e);return t?`${m(t.getDate())}/${m(t.getMonth()+1)}/${t.getFullYear()}`:e}var H=/* @__PURE__ */new Map;function L({from:t,to:n,onChange:m,formatDisplay:Y,clearable:L,required:R=!1,name:J,id:B,"aria-labelledby":E,"aria-label":G,weekStartsOn:T,placeholder:A,fullWidth:I=!1,min:U,max:q,disabled:P=!1,allowOpenEnd:Z=!1}){const z=v().dateRange,K=y(),Q=Y??(K?function(e){let t=H.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),H.set(e,t));const n=t;return e=>{const t=r(e);return t?n.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(K):O),V=A??z.placeholder,X=L??!R,[_,ee]=w(!1),[te,re]=w(t),[ne,ae]=w(n),[oe,le]=w(null),[ie,se]=w("from"),ce=N(null),de=N(null),me=N(null),ue=k(),he=k(),pe=k(),[fe,ge]=w(!1),be=g(ce,_,{preferredMaxWidth:520,preferredMaxHeight:fe?720:560,popupRef:me}),xe=N(null),ve=N(null),[ye,we]=w(!0);b(()=>{const e=ve.current;if(!_||!fe||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&we(a)});const Ne=N(null);b(()=>{const e=me.current;if(!_||!be||!e)return;const t=getComputedStyle(e),r=be.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(fe)null!==Ne.current&&Ne.current<=r&&ge(!1);else{const e=xe.current?.offsetWidth??0;if(0===e)return;Ne.current=e,e>r+.5&&ge(!0)}});const[ke,Ce]=w(!1);b(()=>{const e=!!B&&(de.current?.labels?.length??0)>0;e!==ke&&Ce(e)});const Me=!!G||!!E||ke,De=/* @__PURE__ */new Date,[je,We]=w(()=>t?t.slice(0,7):S(De,U,q)),$e=$.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(F(e,De),U,q)),Ye=e=>e?Q(e):"";C(()=>{if(!_)return;const e=e=>{const t=e.target;ce.current?.contains(t)||me.current?.contains(t)||ee(!1)};document.addEventListener("mousedown",e);const t=p(()=>ee(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[_]),C(()=>{P&&ee(!1)},[P]);const Fe=()=>{m("",""),ee(!1)},Se=X&&!P&&Boolean(t||n),Oe=t&&n?`${Ye(t)} — ${Ye(n)}`:t?z.fromOnly(Ye(t)):n?z.toOnly(Ye(n)):"",He=d(K),Le=e=>{const t=r(e);return t?He.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Re=t&&n?z.range(Le(t),Le(n)):t?z.fromOnly(Le(t)):n?z.toOnly(Le(n)):V,Je=e=>fe?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(oe===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(oe===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Be=/* @__PURE__ */D(j,{children:[$e.map(e=>/* @__PURE__ */W("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=F(e,De);re(t.from),ae(t.to),le(e),We(t.from.slice(0,7))})(e),className:Je(e),"aria-label":fe?z[e]:void 0,children:fe?ye?z[e]:z[`${e}Short`]:z[e]},e)),
|
|
2
|
+
/* @__PURE__ */W("button",{type:"button",onClick:()=>le("Custom"),className:Je("Custom"),children:z.custom})]}),Ee=(e,t)=>Z?/* @__PURE__ */W("button",{type:"button","data-range-end":e,"aria-pressed":ie===e,onClick:()=>se(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */W("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Ge=e=>Z&&ie===e?" ring-1 ring-blue-400":"",Te=
|
|
3
|
+
/* @__PURE__ */W(e,{mode:"range",min:U,max:q,value:te||null,endValue:ne||null,month:je,onMonthChange:We,onSelect:e=>{le("Custom"),Z?"from"===ie?(ne&&e>ne?(re(ne),ae(e)):re(e),se("to")):te&&e<te?(ae(te),re(e)):ae(e):!te||te&&ne?(re(e),ae("")):e<te?(ae(te),re(e)):ae(e)},weekStartsOn:T,"aria-label":z.dialog});/* @__PURE__ */
|
|
4
|
+
return D("div",{className:"relative"+(I?" w-full":""),ref:ce,children:[
|
|
5
|
+
/* @__PURE__ */D("div",{className:`relative ${I?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Se?a[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${t||n?`${i} ${s}`:c}${P?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
+
/* @__PURE__ */D("button",{ref:de,type:"button",onClick:()=>{P||(re(t),ae(n),le(null),se(t&&!n?"to":"from"),We(t?t.slice(0,7):S(De,U,q)),ee(!0))},"aria-haspopup":"dialog","aria-expanded":_,id:B,disabled:P||void 0,"aria-label":G,"aria-labelledby":E,"aria-describedby":[Me?he:void 0,R?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":_?ue:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(I?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
|
+
/* @__PURE__ */W(h,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
+
/* @__PURE__ */W("span",{className:"truncate",children:Oe||V})]}),Se&&/* @__PURE__ */W(o,{children:/* @__PURE__ */W(l,{action:{label:z.clearRange,icon:/* @__PURE__ */W(h,{name:"close"}),onClick:Fe}})})]}),Me&&/* @__PURE__ */W("span",{id:he,className:"sr-only",children:Re}),R&&/* @__PURE__ */W("span",{id:pe,className:"sr-only",children:z.required}),J&&/* @__PURE__ */D(j,{children:[
|
|
9
|
+
/* @__PURE__ */W("input",{type:"hidden",name:J.from,value:t,disabled:P||void 0}),
|
|
10
|
+
/* @__PURE__ */W("input",{type:"hidden",name:J.to,value:n,disabled:P||void 0})]}),_&&M(
|
|
11
|
+
/* @__PURE__ */D("div",{ref:me,id:ue,role:"dialog","aria-label":z.dialog,"data-layout":fe?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:f.popup,left:be?.left,right:be?.right,top:be?.top,bottom:be?.bottom,width:fe&&be?be.maxWidth:"max-content",maxWidth:be?.maxWidth,maxHeight:be?.maxHeight,overflowY:"auto",visibility:be?void 0:"hidden",...x()},children:[
|
|
12
|
+
/* @__PURE__ */D("div",{className:fe?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Ee("from",/* @__PURE__ */D(j,{children:[
|
|
13
|
+
/* @__PURE__ */W("span",{className:"text-xs font-medium text-gray-500",children:z.from}),
|
|
14
|
+
/* @__PURE__ */W("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${te?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ge("from")}`,children:te?Ye(te):z.start})]})),!fe&&/* @__PURE__ */W("span",{className:"text-gray-300",children:"—"}),Ee("to",/* @__PURE__ */D(j,{children:[
|
|
15
|
+
/* @__PURE__ */W("span",{className:"text-xs font-medium text-gray-500",children:z.to}),
|
|
16
|
+
/* @__PURE__ */W("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ge("to")}`,children:ne?Ye(ne):z.end})]}))]}),fe?/* @__PURE__ */D(j,{children:[$e.length>0&&/* @__PURE__ */D("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */W("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:z.lastHeading}),
|
|
17
|
+
/* @__PURE__ */D("div",{ref:ve,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Be,$e.map(e=>/* @__PURE__ */W("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:z[e]},e))]})]}),
|
|
18
|
+
/* @__PURE__ */W("div",{className:"w-full",children:Te})]}):
|
|
19
|
+
/* @__PURE__ */D("div",{ref:xe,className:"flex w-max gap-4",children:[
|
|
20
|
+
/* @__PURE__ */W("div",{className:"w-64",children:Te}),$e.length>0&&/* @__PURE__ */W("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Be})]}),
|
|
21
|
+
/* @__PURE__ */D("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[X&&/* @__PURE__ */W("button",{type:"button",onClick:Fe,className:u({variant:"ghost"}),children:z.clear}),
|
|
22
|
+
/* @__PURE__ */W("button",{type:"button",onClick:()=>ee(!1),className:u({variant:"secondary"}),children:z.cancel}),
|
|
23
|
+
/* @__PURE__ */W("button",{type:"button",onClick:()=>{m(te,ne),ee(!1)},disabled:Z?!te&&!ne:!te||!ne,className:u({variant:"primary"}),children:z.apply})]})]}),document.body)]})}export{L as DateRangePicker,F as presetRange,Y as toISODate};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{squarify as e}from"./chunk-46BYGPGD.js";import{AccessibleTable as t}from"./chunk-5PP435FL.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as a}from"./chunk-36VIGB6J.js";import{usePlotWidth as r}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as i,CHART_INK as o}from"./chunk-TZFACUMR.js";import{useShellStrings as n,useShellLocale as m}from"./chunk-43MCNASD.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as u}from"react";import{jsx as s,jsxs as f}from"react/jsx-runtime";function p({items:p,height:d=320,width:v,gap:x=2,radius:g=3,formatValue:y,color:k,className:b,emptyLabel:j}){const M=n().charts,w=m(),N=y??(e=>h(e,w)),$=j??M.nothingToBreakDown,C=c(null),A=r(C),B=v??A,[F,P]=u(null),{highlighted:z}=l(),D=e(p,B,d);if(0===D.length)/* @__PURE__ */
|
|
2
|
+
return s("div",{className:b,ref:C,children:/* @__PURE__ */s("p",{className:"py-8 text-center text-sm text-gray-500",children:$})});const G=k??i(0),L=Math.max(...D.map(e=>e.value),1),S=e=>34+e/L*62,V=e=>`color-mix(in oklab, ${G} ${S(e).toFixed(0)}%, ${o.surface})`,Y=e=>S(e)>=55?o.surface:o.label,E=F??z,H=F?D.find(e=>e.key===F):void 0;/* @__PURE__ */
|
|
3
|
+
return f("div",{className:`relative ${b??""}`,ref:C,children:[
|
|
4
|
+
/* @__PURE__ */s("svg",{width:"100%",height:d,viewBox:`0 0 ${B} ${d}`,role:"img","aria-label":M.treemap(p.length),onMouseLeave:()=>P(null),children:D.map(e=>{const t=Math.max(0,e.width-x),l=Math.max(0,e.height-x),a=t>6.2*e.label.length+12&&l>30,r=a&&l>44;/* @__PURE__ */
|
|
5
|
+
return f("g",{opacity:E&&E!==e.key?.55:1,onMouseEnter:()=>P(e.key),children:[
|
|
6
|
+
/* @__PURE__ */s("rect",{x:e.x+x/2,y:e.y+x/2,width:t,height:l,rx:g,fill:V(e.value)}),a&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+18,fontSize:12,fontWeight:600,fill:Y(e.value),children:e.label}),r&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+34,fontSize:11,fill:Y(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:N(e.value)})]},e.key)})}),H&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(a,{title:H.label,rows:[{key:"value",label:M.value,color:V(H.value),value:N(H.value)}]})}),
|
|
7
|
+
/* @__PURE__ */s(t,{caption:M.treemap(p.length),head:[M.tableItem,M.value],rows:D.map(e=>[e.label,N(e.value)])})]})}export{p as TreemapChart};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{fromDateKey as t,toDateKey as e}from"./chunk-2HMNOLKX.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{pad2 as r}from"./chunk-LF27WIN2.js";import{useShellLocale as i}from"./chunk-
|
|
1
|
+
import{fromDateKey as t,toDateKey as e}from"./chunk-2HMNOLKX.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{pad2 as r}from"./chunk-LF27WIN2.js";import{useShellLocale as i}from"./chunk-43MCNASD.js";import{forwardRef as a}from"react";import{jsx as o}from"react/jsx-runtime";var m=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/;function s(t){return null==t||""===t?"":t instanceof Date?Number.isNaN(t.getTime())?"":`${e(n=t)}T${r(n.getHours())}:${r(n.getMinutes())}`:m.test(t)?t:"";var n}var u=a(function({value:e,onChange:r,min:a,max:u,invalid:l,size:c,className:d="",...f},p){const v=i();/* @__PURE__ */
|
|
2
2
|
return o("input",{ref:p,type:"datetime-local",lang:v,"aria-invalid":l||void 0,value:s(e),min:s(a)||void 0,max:s(u)||void 0,onChange:e=>r?.(function(e){if(!m.test(e))return null;const[n,r]=e.split("T"),i=t(n),[a,o,s=0]=r.split(":").map(Number);return!i||a>23||o>59||s>59?null:(i.setHours(a,o,s),i)}(e.target.value)),className:n({invalid:l,size:c,className:d}),...f})});export{u as DateTimePicker_default};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveGrip as t,MoveHint as r,moveFromKey as a}from"./chunk-
|
|
1
|
+
import{MOVE_KEYS as e,MoveGrip as t,MoveHint as r,moveFromKey as a}from"./chunk-B5OYS65L.js";import{ItemCount as n}from"./chunk-RXHTIJ64.js";import{GROUP_COLORS as o}from"./chunk-FZM3ZPW3.js";import{Icon as i}from"./chunk-MRFNJZRR.js";import{OneLineLabel as s}from"./chunk-WGLHB6WE.js";import{Tooltip as l}from"./chunk-NJN5IKWO.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{useShellStrings as d}from"./chunk-43MCNASD.js";import{useRef as u,useCallback as p,useId as m,isValidElement as f}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";var b='[role="treeitem"]';function v(e){return[...e.querySelectorAll(b)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function y({"aria-label":e,"aria-labelledby":t,children:r,className:a="",rootProps:n}){const o=u(null);c(()=>{const e=o.current;if(!e)return;const t=[...e.querySelectorAll(b)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??v(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=p(e=>{n?.onKeyDown?.(e);const t=o.current,r=e.target.closest?.(b);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const a=v(t),i=a.indexOf(r),s=Number(r.getAttribute("aria-level")??"1"),l=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(b))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":l(a[i+1]);break;case"ArrowUp":l(a[i-1]);break;case"Home":l(a[0]);break;case"End":l(a[a.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=a[i+1];t&&Number(t.getAttribute("aria-level")??"1")>s?l(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(a[e].getAttribute("aria-level")??"1")<s){l(a[e]);break}}},[n]);/* @__PURE__ */
|
|
2
2
|
return h("div",{...n,ref:o,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${a}`.trim(),children:r})}function x({children:e,hidden:t,className:r=""}){/* @__PURE__ */
|
|
3
3
|
return h("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}var k=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal"].join(" "),w=`${k} bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600`;function N(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!f(e)&&"label"in e}function A(e){if(null==e||!1===e||"number"==typeof e)return null;const t=Array.isArray(e)&&e.length>0&&e.every(N)?e:N(e)?[e]:null;return t?t.map((e,t)=>/* @__PURE__ */h("span",{"data-tree-count":"","data-tone":e.tone,className:e.tone?`${k} ${o[e.tone]}`:w,children:e.label},t)):/* @__PURE__ */h("span",{"data-tree-count":"",className:w,children:e})}function j({children:e,count:t,countLabel:r,expanded:a,onToggle:o}){const i=void 0!==a,l=
|
|
4
4
|
/* @__PURE__ */h("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */h(s,{children:e})}),c="number"==typeof t?/* @__PURE__ */h(n,{count:t,label:r,showZero:!0}):null!=t&&!1!==t&&/* @__PURE__ */h("span",{"data-tree-count":"",className:w,children:t}),d="text-xs font-semibold uppercase tracking-wide text-ink-faint";return i?/* @__PURE__ */h("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */g("button",{type:"button","aria-expanded":a,onClick:o,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-ink-strongest","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",d].join(" "),children:[
|
|
5
|
-
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children
|
|
6
|
-
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,c]})}var
|
|
7
|
-
return g("div",{...
|
|
8
|
-
/* @__PURE__ */h(t,{marker:"tree",hint:
|
|
9
|
-
/* @__PURE__ */h("span",
|
|
10
|
-
/* @__PURE__ */g("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[
|
|
11
|
-
/* @__PURE__ */h("span",{"data-tree-name":"",className:`flex min-w-0 ${d?"font-semibold":"font-medium"} ${v?"text-ink-faintest line-through":""}`,children:/* @__PURE__ */g(s,{children:[o,null!=c&&/* @__PURE__ */h("span",{className:"ml-2 font-normal text-ink-faint",children:c})]})}),A(y),null!=
|
|
12
|
-
/* @__PURE__ */g("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style
|
|
5
|
+
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:$(!!a)}),l,c]})}):/* @__PURE__ */g("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${d}`,children:[
|
|
6
|
+
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,c]})}var $=e=>/* @__PURE__ */h(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),D={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function P({label:o,level:i=1,icon:l,preview:c,selected:d=!1,tone:u,expanded:p,onToggle:f,onSelect:b,muted:v=!1,badge:y,count:x,countLabel:k,actions:w,actionsPinned:N=!1,actionsOverlay:j=!0,rename:P,drop:C,dragging:K=!1,draggable:I=!1,dragHint:H,onMove:W,rowProps:E,className:L=""}){const R=void 0!==p,S=m(),M=x??("number"==typeof y?y:void 0),T=[E?.["aria-describedby"],W?S:void 0].filter(Boolean).join(" ")||void 0,Z="shared"===u?"text-[color:var(--status-success-soft-ink)]":null,B=d?Z?`bg-[var(--status-success-soft)] ${Z}`:"bg-accent-tint text-blue-700":"into"===C?`bg-accent-tint ${Z??"text-ink-strongest"}`:`${Z??"text-ink"} hover:bg-gray-100`;/* @__PURE__ */
|
|
7
|
+
return g("div",{...E,role:"treeitem","aria-level":i,"aria-selected":d,"aria-expanded":R?p:void 0,"data-tone":u,tabIndex:d?0:-1,"aria-keyshortcuts":E?.["aria-keyshortcuts"]??(W?e:void 0),"aria-describedby":T,"data-drop":C,"data-draggable":I||void 0,onKeyDown:e=>{if(E?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=a(e);t&&W?(e.preventDefault(),W(t)):"Enter"!==e.key&&" "!==e.key||!b?("ArrowRight"===e.key&&R&&!p&&f||"ArrowLeft"===e.key&&R&&p&&f)&&(e.preventDefault(),f()):(e.preventDefault(),b())},onClick:e=>{E?.onClick?.(e),e.defaultPrevented||b?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",I?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",B,"into"===C?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",K?"opacity-40":"",L].filter(Boolean).join(" "),children:["before"===C&&/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===C&&/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),I&&
|
|
8
|
+
/* @__PURE__ */h(t,{marker:"tree",hint:H,dragging:K,revealClassName:"group-hover/treerow:opacity-100"}),
|
|
9
|
+
/* @__PURE__ */h("span",R?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),f?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:$(!!p)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=l&&/* @__PURE__ */h("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(v?"text-ink-faintest":""),children:l}),
|
|
10
|
+
/* @__PURE__ */g("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[P??
|
|
11
|
+
/* @__PURE__ */h("span",{"data-tree-name":"",className:`flex min-w-0 ${d?"font-semibold":"font-medium"} ${v?"text-ink-faintest line-through":""}`,children:/* @__PURE__ */g(s,{children:[o,null!=c&&/* @__PURE__ */h("span",{className:"ml-2 font-normal text-ink-faint",children:c})]})}),A(y),null!=M&&/* @__PURE__ */h(n,{count:M,label:k,active:d,showZero:!0,className:"ml-auto"}),null!=w&&!j&&/* @__PURE__ */h("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:`${null!=M?"":"ml-auto "}flex shrink-0 items-center gap-0.5 transition-opacity ${N||v?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"}`,children:w})]}),null!=w&&j&&
|
|
12
|
+
/* @__PURE__ */g("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:D,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(N||v||d?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
|
|
13
13
|
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
14
14
|
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
15
|
-
/* @__PURE__ */h("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:w})]}),
|
|
15
|
+
/* @__PURE__ */h("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:w})]}),W&&/* @__PURE__ */h(r,{id:S})]})}function C({onAdd:e,label:t,drop:r=!1,slotProps:a}){const n=d().tree,o=r?n.dropHere:t??n.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
|
|
16
16
|
return h("div",{...a,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */g("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
|
|
17
17
|
/* @__PURE__ */h("span",{"aria-hidden":"true",children:"+"}),o]}):/* @__PURE__ */h("span",{className:i,children:o})})}function K({onInsert:e,label:t,drop:r=!1,seamProps:a}){const n=d().tree,o=t??n.insertHere,s=r?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
|
|
18
18
|
return g("div",{...a,role:"presentation","data-tree-seam":"","data-drop":r||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${a?.className??""}`.trim(),children:[
|
|
19
19
|
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
|
|
20
|
-
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${s}`}),e&&/* @__PURE__ */h(l,{content:o,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */h("button",{type:"button","aria-label":o,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */h(i,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}export{y as Tree,C as TreeEmptySlot,x as TreeGroup,j as TreeGroupLabel,
|
|
20
|
+
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${s}`}),e&&/* @__PURE__ */h(l,{content:o,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */h("button",{type:"button","aria-label":o,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */h(i,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}export{y as Tree,C as TreeEmptySlot,x as TreeGroup,j as TreeGroupLabel,P as TreeRow,K as TreeSeam};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{AccessibleTable as t}from"./chunk-5PP435FL.js";import{arcPath as e}from"./chunk-VFC6QUEN.js";import{useHighlight as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as n}from"./chunk-36VIGB6J.js";import{CHART_INK as r,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as l,useShellLocale as i}from"./chunk-43MCNASD.js";import{formatPlain as s}from"./chunk-C3QOHMR6.js";import{useState as c}from"react";import{jsx as d,jsxs as m}from"react/jsx-runtime";function h(t,e,o,n){const r=(t,o)=>{const n=e[t]?.[o];return"number"==typeof n&&Number.isFinite(n)?n:0},a=t.map((e,o)=>t.reduce((t,e,n)=>t+r(o,n)+r(n,o),0)),l=Math.max(2,o),i=t.length>l,s=i?t.map((t,e)=>e).sort((t,e)=>a[e]-a[t]).slice(0,l-1).sort((t,e)=>t-e):t.map((t,e)=>e),c=new Map(s.map((t,e)=>[t,e])),d=i?s.length:-1,m=i?[...s.map(e=>t[e]),n]:[...t],h=m.map(()=>m.map(()=>0));let u=0;t.forEach((e,o)=>t.forEach((t,e)=>{const n=c.get(o)??d,a=c.get(e)??d;n!==d||a!==d?h[n][a]+=r(o,e):u+=r(o,e)}));const f=m.map((t,e)=>m.reduce((t,o,n)=>t+h[e][n]+h[n][e],0));return d>=0&&(f[d]+=u),{labels:m,matrix:h,totals:f,otherIndex:d,foldedCount:i?t.length-s.length:0}}function u({labels:u,matrix:f,size:p=340,maxNodes:x=8,padAngle:g=.04,arcWidth:b=12,formatValue:k,className:v,emptyLabel:M}){const $=l().charts,w=i(),N=k??(t=>s(t,w)),j=M??$.noFlows,[y,F]=c(null),{highlighted:C}=o(),E=h(u,f,x,$.other),{labels:A,matrix:I,otherIndex:z,foldedCount:L}=E,P=(t,e)=>I[t]?.[e]??0,O=t=>t===z?r.muted:a(t),Q=E.totals,V=A.map((t,e)=>e).sort((t,e)=>Q[e]-Q[t]),B=V.reduce((t,e)=>t+Q[e],0);if(B<=0)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${v??""}`,children:j});const H=p/2,R=p/2,S=p/2-44,T=S-b,U=g*V.length,W=/* @__PURE__ */new Map;let Y=-Math.PI/2;V.forEach((t,e)=>{const o=Q[t]/B*(2*Math.PI-U);W.set(t,{start:Y,end:Y+o,slot:e}),Y+=o+g});const D=/* @__PURE__ */new Map,G=[];for(const t of V)for(const e of V){const o=P(t,e);if(o<=0)continue;const n=W.get(t),r=o/Math.max(1,Q[t])*(n.end-n.start),a=D.get(t)??0;D.set(t,a+r),G.push({from:t,to:e,value:o,a:n.start+a+r/2,b:W.get(e).start+(W.get(e).end-W.get(e).start)/2})}const J=(t,e)=>[H+e*Math.cos(t),R+e*Math.sin(t)],Z="arc"===y?.kind?y.index:void 0,q="ribbon"===y?.kind?G[y.index]:void 0;/* @__PURE__ */
|
|
2
|
+
return m("div",{className:`relative ${v??""}`,children:[
|
|
3
|
+
/* @__PURE__ */m("svg",{width:"100%",height:p,viewBox:`0 0 ${p} ${p}`,role:"img","aria-label":$.chord(V.length),onMouseLeave:()=>F(null),children:[G.map((t,e)=>{const[o,n]=J(t.a,T),[r,a]=J(t.b,T),l=O(t.from),i=((t,e)=>y?"ribbon"===y.kind?y.index===e:y.index===t.from||y.index===t.to:null!==C?A[t.from]===C||A[t.to]===C:null)(t,e);/* @__PURE__ */
|
|
4
|
+
return d("path",{d:`M${o},${n} Q${H},${R} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/B*p*.9),strokeOpacity:null===i||i?.34:.07,strokeLinecap:"round",onMouseEnter:()=>F({kind:"ribbon",index:e})},`${A[t.from]}→${A[t.to]}`)}),V.map(t=>{const o=W.get(t),n=(o.start+o.end)/2,[a,l]=J(n,S+16),i=(t=>y?"arc"===y.kind?y.index===t:G[y.index].from===t||G[y.index].to===t:null!==C?A[t]===C:null)(t);/* @__PURE__ */
|
|
5
|
+
return m("g",{onMouseEnter:()=>F({kind:"arc",index:t}),children:[
|
|
6
|
+
/* @__PURE__ */d("path",{d:e(H,R,T,S,o.start,o.end),fill:O(t),fillOpacity:null===i||i?1:.45}),
|
|
7
|
+
/* @__PURE__ */d("text",{x:a,y:l+4,fontSize:11,fill:r.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:A[t]})]},t)})]}),L>0&&/* @__PURE__ */d("p",{className:"mt-1 text-xs text-ink-faint",children:$.chordFolded(L)}),void 0!==Z&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:A[Z],rows:[{key:"total",label:$.totalFlow,color:O(Z),value:N(Q[Z])}]})}),q&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:`${A[q.from]} → ${A[q.to]}`,rows:[{key:"value",label:$.flow,color:O(q.from),value:N(q.value)}]})}),
|
|
8
|
+
/* @__PURE__ */d(t,{caption:$.chord(V.length),head:[$.tableFrom,$.tableTo,$.value],rows:G.map(t=>[A[t.from],A[t.to],N(t.value)])})]})}export{u as ChordChart,h as foldChord};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{ChartDefs as t,MOTION as e,stagger as a,glowId as i}from"./chunk-465RRWBY.js";import{ChartSkeleton as n}from"./chunk-
|
|
1
|
+
import{ChartDefs as t,MOTION as e,stagger as a,glowId as i}from"./chunk-465RRWBY.js";import{ChartSkeleton as n}from"./chunk-DZBGJ6X4.js";import{useHighlight as o,autoHighlightIndex as l,highlightOpacity as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as s}from"./chunk-36VIGB6J.js";import{CartesianPlot as m}from"./chunk-SX5CSXZO.js";import{useDragZoom as u,ChartZoomSummary as c}from"./chunk-BFO72WQB.js";import{CHART_INK as d,resolveSeriesColor as h,STATUS_VARS as f}from"./chunk-TZFACUMR.js";import{useShellStrings as p,useShellLocale as b}from"./chunk-43MCNASD.js";import{formatPercent as x,formatPlain as y}from"./chunk-C3QOHMR6.js";import{useId as v}from"react";import{jsx as M,jsxs as g,Fragment as k}from"react/jsx-runtime";function w({stacked:w=!1,stackMode:N="value",height:$=220,width:C,max:j,formatValue:F,yAxisLabel:A,className:L,emptyLabel:S,radius:z=3,loading:B=!1,animate:T=!0,glow:V=!1,emphasise:O=!1,activeKey:R,highlight:E="none",valueLabels:G=!1,onSelect:W,min:X,formatTooltipValue:Y,tooltipLabels:Z,barGap:D=4,seriesLabels:H=!1,zoomable:J=!0,series:Q,labels:I}){const K=v(),U=u(I.length,J),q=U.view?.[0]??0,P=U.slice(I),_=Z?U.slice(Z):void 0,tt=Q.map(t=>({...t,data:U.slice(t.data),pointTones:t.pointTones?U.slice(t.pointTones):void 0,pointColors:t.pointColors?U.slice(t.pointColors):void 0})),{highlighted:et}=o(),at=p().charts,it=b(),nt=F??(t=>y(t,it)),ot=Y??nt;if(B)/* @__PURE__ */return M(n,{height:$,width:C,variant:"bars",className:L});const lt=(t,e)=>{const a=t.pointColors?.[e];if(a)return a;const i=t.pointTones?.[e];return i?f[i]:h(t.slot,t.color,t.tone)},rt=tt.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(t=>Number.isFinite(t))),st=(t,e)=>{const a=t.data[e];return"number"==typeof a&&Number.isFinite(a)?a:0},mt=P.map((t,e)=>rt.reduce((t,a)=>t+st(a,e),0)),ut=P.map((t,e)=>rt.reduce((t,a)=>t+Math.max(0,st(a,e)),0)),ct=P.map((t,e)=>rt.reduce((t,a)=>t+Math.min(0,st(a,e)),0)),dt=w&&"percent"===N,ht=(t,e)=>mt[e]>0?t/mt[e]:null,ft=dt?[1]:w?[...ut,...ct]:rt.flatMap(t=>t.data.filter(Number.isFinite)),pt=(t,e)=>{const a=t.bandwidth/Math.max(1,rt.length),i=rt.length>1?Math.min(D,.25*a):0;return{offset:e*a+i/2,width:Math.max(1,a-i)}},bt=H&&!w?({x:t,y:e})=>{const a=Math.min(e.domain[1],Math.max(e.domain[0],0));return P.map((i,n)=>rt.map((i,o)=>{const l=i.data[n];if(!Number.isFinite(l))return null;const r=Math.min(e.domain[1],Math.max(e.domain[0],l)),{offset:s,width:m}=pt(t,o),u=t(n)+s+m/2,c=Math.min(e(r),e(a)),h=Math.max(e(r),e(a));if(m<13)return null;const f=Math.floor((h-c-12)/6.6),p=f>=Math.min(4,i.label.length),b=p&&i.label.length>f?`${i.label.slice(0,f-1).trimEnd()}…`:i.label,x=p?h-6:c-4;/* @__PURE__ */
|
|
2
2
|
return M("text",{"data-series-label":"true",x:u,y:x,transform:`rotate(-90 ${u} ${x})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:p?d.surface:d.label,children:b},`n${i.key}-${n}`)}))}:null;/* @__PURE__ */
|
|
3
3
|
return g(k,{children:[
|
|
4
|
-
/* @__PURE__ */M(m,{labels:
|
|
4
|
+
/* @__PURE__ */M(m,{labels:P,values:ft,height:$,width:C,max:dt?1:j,min:dt?void 0:X,formatValue:dt?t=>x(Math.round(100*t),0,it):nt,yAxisLabel:A,className:L,emptyLabel:S,onSelect:W?t=>W(q+t):void 0,zoom:J?U:void 0,ariaLabel:at.acrossCategories(rt.map(t=>t.label),P.length),tooltip:t=>/* @__PURE__ */M(s,{title:_?.[t]??P[t],rows:rt.map(e=>({key:e.key,label:e.label,color:lt(e,t),value:Number.isFinite(e.data[t])?dt?`${x(100*(ht(e.data[t],t)??0),1,it)} · ${ot(e.data[t])}`:ot(e.data[t]):void 0})),footnote:dt?at.inCategory(ot(mt[t])):void 0}),overlay:G&&!dt||bt?({x:t,y:e})=>/* @__PURE__ */g("g",{pointerEvents:"none",children:[bt?.({x:t,y:e}),G&&!dt&&P.map((a,i)=>{if(w){if(!rt.some(t=>Number.isFinite(t.data[i])))return null;const a=rt.reduce((t,e)=>t+st(e,i),0),n=a>=0?ut[i]:ct[i];/* @__PURE__ */
|
|
5
5
|
return M("text",{"data-value-label":"true",x:t.center(i),y:a>=0?e(n)-4:e(n)+12,textAnchor:"middle",fontSize:11,fill:d.label,style:{fontVariantNumeric:"tabular-nums"},children:nt(a)},`v${i}`)}return rt.map((a,n)=>{const o=a.data[i];if(!Number.isFinite(o))return null;const l=o,{offset:r,width:s}=pt(t,n);/* @__PURE__ */
|
|
6
|
-
return M("text",{"data-value-label":"true",x:t(i)+r+s/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:d.label,style:{fontVariantNumeric:"tabular-nums"},children:nt(l)},`v${a.key}-${i}`)})})]}):void 0,children:({x:n,y:o,bottom:s,active:m})=>{const u=
|
|
6
|
+
return M("text",{"data-value-label":"true",x:t(i)+r+s/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:d.label,style:{fontVariantNumeric:"tabular-nums"},children:nt(l)},`v${a.key}-${i}`)})})]}):void 0,children:({x:n,y:o,bottom:s,active:m})=>{const u=R?P.indexOf(R):-1,c=l(w?mt:rt[0]?.data??[],E),h=m??(u>=0?u:c);/* @__PURE__ */
|
|
7
7
|
return g("g",{children:[
|
|
8
|
-
/* @__PURE__ */M(t,{id:
|
|
9
|
-
return M("rect",{x:y,y:g,width:v,height:$,rx:z,fill:j,fillOpacity:
|
|
8
|
+
/* @__PURE__ */M(t,{id:K,glow:V}),P.map((t,l)=>{let s=0,m=0;const u=o(Math.min(o.domain[1],Math.max(o.domain[0],0)));return rt.map((t,c)=>{const f=t.data[l];if(!Number.isFinite(f))return null;const p=dt?ht(f,l):f;if(null===p)return null;const b=lt(t,l),x=pt(n,c),y=w?n(l):n(l)+x.offset,v=w?Math.max(1,n.bandwidth):x.width;let g,k,N=!0;if(w){const t=p>=0?s:m,e=t+p;p>=0?s=e:m=e,g=o(Math.max(t,e)),k=o(Math.min(t,e)),N=0===t}else g=Math.min(o(p),u),k=Math.max(o(p),u);const $=Math.max(0,k-g-(w&&!N?2:0)),C=null===h||h===l,j=C?b:O?d.muted:b,F=r(t.key,et);/* @__PURE__ */
|
|
9
|
+
return M("rect",{x:y,y:g,width:v,height:$,rx:z,fill:j,fillOpacity:F??(C?1:O?.32:.45),filter:V&&h===l?`url(#${i(K)})`:void 0,className:"rosh-viz-mark"+(T?` ${e.rise}`:""),style:T?a(l*(w?1:rt.length)+c,26):void 0},`${t.key}-${l}`)})}),null!==m&&!O&&/* @__PURE__ */M("line",{x1:n.center(m),y1:o(o.domain[1]),x2:n.center(m),y2:s,stroke:d.axis,strokeWidth:1})]})}}),U.view&&/* @__PURE__ */M(c,{from:_?.[0]??P[0],to:_?.at(-1)??P[P.length-1],count:P.length,total:w?ot(mt.reduce((t,e)=>t+e,0)):void 0,rows:rt.map(t=>({s:t,sum:t.data.reduce((e,a,i)=>e+st(t,i),0)})).sort((t,e)=>e.sum-t.sum).map(({s:t,sum:e})=>({key:t.key,label:t.label,color:h(t.slot,t.color,t.tone),value:ot(e)})),onClear:U.clear})]})}export{w as ColumnChart};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-36VIGB6J.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-
|
|
1
|
+
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-36VIGB6J.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-43MCNASD.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useId as h,useState as u}from"react";import{jsx as p,jsxs as d}from"react/jsx-runtime";var f=300*Math.PI/180;function g({rows:g,variant:k="track",size:v=300,max:x,formatValue:y,animate:M=!0,className:N,emptyLabel:b,trackGap:j=6}){const C=s().charts,w=c(),R=y??(e=>m(e,w)),E=b??C.nothingToPlot,P=h(),[T,$]=u(null),{highlighted:A}=l();if(0===g.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${N??""}`,children:E});const B=v/2,I=v/2,U=v/2-10,V=x??Math.max(...g.map(e=>e.value),1),Y="track"===k?Math.max(6,(U-.16*v)/g.length):0,z=Math.max(1,Math.floor((U-.16*v)/Y||1)),F="track"===k?g.slice(0,z):g,G=Math.min(j,Math.max(1,Y-2)),H=n(F.length,.03),J=null!==T?F[T]:void 0;/* @__PURE__ */
|
|
2
2
|
return d("div",{className:`relative ${N??""}`,children:[
|
|
3
|
-
/* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":
|
|
4
|
-
/* @__PURE__ */p("title",{id:
|
|
5
|
-
return d("g",{opacity:c?.4:1,onMouseEnter:()
|
|
6
|
-
/* @__PURE__ */p("path",{d:e(B,
|
|
7
|
-
/* @__PURE__ */p("path",{d:e(B,
|
|
8
|
-
return p("g",{opacity:c?.4:1,onMouseEnter:()
|
|
3
|
+
/* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":P,onMouseLeave:()=>$(null),children:[
|
|
4
|
+
/* @__PURE__ */p("title",{id:P,children:"track"===k?C.radialTrack(F.length):C.radialCycle(F.length)}),F.map((l,r)=>{const n=o(r,l.color,l.tone),s=Math.max(0,Math.min(1,l.value/V)),c=((e,t)=>null!==T?T!==e:null!==A&&A!==t)(r,l.key);if("track"===k){const o=U-r*Y,m=o-Y+G,h=-Math.PI/2;/* @__PURE__ */
|
|
5
|
+
return d("g",{opacity:c?.4:1,onMouseEnter:()=>$(r),className:M?t.sweep:void 0,style:M?a(r,70):void 0,children:[
|
|
6
|
+
/* @__PURE__ */p("path",{d:e(B,I,m,o,h,h+f),fill:i.grid}),
|
|
7
|
+
/* @__PURE__ */p("path",{d:e(B,I,m,o,h,h+f*s),fill:n})]},l.key)}const m=.14*v;/* @__PURE__ */
|
|
8
|
+
return p("g",{opacity:c?.4:1,onMouseEnter:()=>$(r),children:/* @__PURE__ */p("path",{d:e(B,I,m,m+(U-m)*s,H(r),H(r)+H.step),fill:n})},l.key)})]}),J&&null!==T&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:J.label,rows:[{key:"value",label:C.value,color:o(T,J.color,J.tone),value:R(J.value)}]})}),
|
|
9
9
|
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:g.map((e,t)=>/* @__PURE__ */d("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
10
10
|
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:o(t,e.color,e.tone)}}),
|
|
11
11
|
/* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
|
|
12
|
-
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:
|
|
12
|
+
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:R(e.value)})]},e.key))})]})}export{g as RadialBarChart};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-
|
|
1
|
+
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-ZYFBV4C7.js";import{Tooltip as i}from"./chunk-NJN5IKWO.js";import{useShellStrings as l}from"./chunk-43MCNASD.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:j=""}){const R=l().widths,z=a(),A=m(Math.round(x)||1,1,n),B=e($,A),S=B??[...t[A]??[]],D=[...S,100-p(S)],K=P||M,O=s(null),T=s({onChange:k,shown:S,locked:K,n:A,stored:B});T.current={onChange:k,shown:S,locked:K,n:A,stored:B};const E=t=>{const{onChange:r,shown:n,locked:o,n:i}=T.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},I=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],E(i.slice(0,-1))&&(ne.current=null)},F=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=D[e]+D[e+1],i="ArrowRight"===t.key?D[e]+n:"ArrowLeft"===t.key?D[e]-n:"PageUp"===t.key?D[e]+10:"PageDown"===t.key?D[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),I(D,e,i))},H=s(null),[L,W]=c(null),G=()=>{H.current=null,W(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>G,[]);const J=e=>t=>{if(0!==t.button||K)return;t.preventDefault();const r=O.current?.getBoundingClientRect().width??0;r<=0||(H.current={i:e,x:t.clientX,width:r,from:D,moved:!1,pointer:t.pointerId},W(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},U=e=>{const t=H.current;if(!t)return;if(0===e.buttons)return void G();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}I(t.from,t.i,t.from[t.i]+r/t.width*100)},V=e=>{const t=H.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),G())},X=(e,t)=>{const{shown:n}=T.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return E(o.slice(0,-1))?o:null},[q,Y]=c(0);u(()=>{const e=O.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Y(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const Z=s(null),[Q,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=T.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=D.join(",");u(()=>{const e=null===Q?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(Z.current,Q);te(t=>v(t,e)?t:e)},[Q,ie,q]);const le=R.hint(A,r),ae=D.slice(0,-1).map((e,t)=>p(D.slice(0,t+1)));/* @__PURE__ */
|
|
2
2
|
return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":A>1?z:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${j}`.trim(),children:[
|
|
3
|
-
/* @__PURE__ */h("div",{ref:
|
|
4
|
-
/* @__PURE__ */f("div",{ref:
|
|
5
|
-
/* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),A>1&&D.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=
|
|
6
|
-
return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>q>0&&q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(A-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":R.column(t+1),"aria-describedby":z,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||
|
|
3
|
+
/* @__PURE__ */h("div",{ref:Z,"data-widths-bar":"",className:"relative h-8",children:[
|
|
4
|
+
/* @__PURE__ */f("div",{ref:O,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:D.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===A&&/* @__PURE__ */f("span",{"data-widths-label":"",children:`${e}%`})},t))}),
|
|
5
|
+
/* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),A>1&&D.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=Q===t,l=p(D.slice(0,t)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
6
|
+
return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>q>0&&q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(A-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":R.column(t+1),"aria-describedby":z,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||X(t,e)},onRevert:e=>((e,t)=>{T.current.locked||null===t||oe(e,t)||X(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:T.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<A-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:R.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":R.divider(t+1,t+2),"aria-valuenow":D[t],"aria-valuemin":r,"aria-valuemax":D[t]+D[t+1]-r,"aria-valuetext":R.dividerValue(t+1,D[t],t+2,D[t+1]),"aria-disabled":K||void 0,onKeyDown:K?void 0:F(t),onPointerDown:J(t),onPointerMove:U,onPointerUp:V,onPointerCancel:V,onLostPointerCapture:()=>{H.current&&G()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(K?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(K?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${L===t?"w-1":y}`)})})})})]},t))]}),A>1&&/* @__PURE__ */f("span",{id:z,className:"sr-only",children:le})]})}export{x as WidthsBar};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{Calendar as e}from"./chunk-ONYPN3JY.js";import{fromDateKey as t,toDateKey as r}from"./chunk-2HMNOLKX.js";import{inputClasses as a,PLACEHOLDER_INK as n}from"./chunk-AYZY3YNC.js";import{calendarNames as i}from"./chunk-Y3JW2GW5.js";import{Icon as o}from"./chunk-MRFNJZRR.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{useDropdownPosition as d}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as u}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as b}from"./chunk-43MCNASD.js";import{forwardRef as f,useState as p,useRef as h,useId as v,useEffect as g}from"react";import{createPortal as y}from"react-dom";import{jsx as N,jsxs as x}from"react/jsx-runtime";var k=/^\d{4}-\d{2}-\d{2}$/,j=/^(aria|data)-/,w=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function D(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":r(e);if(k.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":r(t)}function F(e,r){const a=t(e);return a?r.longDate(a.getFullYear(),a.getMonth(),a.getDate()):""}var C=f(function({value:f,onChange:k,min:C,max:W,invalid:Y,size:B,native:J,weekStartsOn:O,className:S="","aria-label":$,"aria-describedby":q,"aria-labelledby":E,id:L,name:M,disabled:z,placeholder:I,required:R,clearable:T,form:U,title:G,tabIndex:P,autoFocus:A,onFocus:H,onBlur:Z,...K},Q){const V=T??!R,X=D(f),_=D(C),ee=D(W),te=m().datePicker,re=b(),ae=i(re),[ne,ie]=p(!1),oe=h(null),le=h(null),se=h(null),de=v(),ue=v(),ce=v(),me=d(le,ne,{popupRef:se}),[be,fe]=p(!1);u(()=>{const e=!!L&&(le.current?.labels?.length??0)>0;e!==be&&fe(e)});const pe=!$&&(!!E||be);if(g(()=>{if(!ne)return;const e=e=>{const t=e.target;oe.current?.contains(t)||se.current?.contains(t)||ie(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>ie(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[ne]),g(()=>{if(ne)return c(e=>"Escape"===e.key&&(ie(!1),le.current?.focus(),!0),()=>se.current)},[ne]),J)/* @__PURE__ */
|
|
2
|
+
return N("input",{ref:Q,type:"date",lang:re,id:L,name:M,disabled:z,"aria-label":$,"aria-describedby":q,"aria-invalid":Y||void 0,value:X,min:_||void 0,max:ee||void 0,onChange:e=>k?.(t(e.target.value)),className:a({invalid:Y,size:B,className:S}),"aria-labelledby":E,required:R,form:U,title:G,tabIndex:P,autoFocus:A,onFocus:H,onBlur:Z,...K});const he=Object.fromEntries(Object.entries(K).filter(([e])=>j.test(e)&&!w.has(e))),ve=K["aria-required"],ge=!!R||!0===ve||"true"===ve,ye=[pe?ue:void 0,ge?ce:void 0,q].filter(Boolean).join(" ")||void 0,Ne=r(/* @__PURE__ */new Date),xe=(!_||Ne>=_)&&(!ee||Ne<=ee),ke=I??te.placeholder;/* @__PURE__ */
|
|
3
|
+
return x("div",{ref:oe,className:"relative",children:[
|
|
4
|
+
/* @__PURE__ */N("input",{ref:Q,type:"hidden",name:M,form:U,value:X}),
|
|
5
|
+
/* @__PURE__ */x("button",{ref:le,type:"button",...he,id:L,disabled:z,title:G,tabIndex:P,autoFocus:A,onFocus:H,onBlur:Z,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?de:void 0,"aria-labelledby":E,"aria-describedby":ye,"aria-label":$?`${$}${X?`, ${F(X,ae)}`:""}`:void 0,onClick:()=>ie(e=>!e),className:`${a({invalid:Y,size:B,className:S})} flex items-center justify-between text-left`,children:[
|
|
6
|
+
/* @__PURE__ */N("span",{className:X?"text-ink-strongest":n,children:X?F(X,ae):ke}),
|
|
7
|
+
/* @__PURE__ */N(o,{name:"date",className:`h-4 w-4 shrink-0 ${n}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */N("span",{id:ue,className:"sr-only",children:X?F(X,ae):ke}),ge&&/* @__PURE__ */N("span",{id:ce,className:"sr-only",children:te.required}),ne&&y(
|
|
8
|
+
/* @__PURE__ */x("div",{ref:se,id:de,role:"dialog","aria-label":$??te.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:s.popup,left:me?.left,right:me?.right,top:me?.top,bottom:me?.bottom,maxWidth:me?.maxWidth,visibility:me?void 0:"hidden"},children:[
|
|
9
|
+
/* @__PURE__ */N(e,{value:X||null,min:_||null,max:ee||null,weekStartsOn:O,onSelect:e=>{ie(!1),le.current?.focus(),k?.(t(e))}}),(V||xe)&&/* @__PURE__ */x("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[V&&/* @__PURE__ */N("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),k?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:te.clear}),xe&&/* @__PURE__ */N("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),k?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:te.today})]})]}),document.body)]})});export{C as DatePicker_default};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{usePlotWidth as t}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as l,CHART_INK as r}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as n}from"./chunk-TWVUQUUD.js";import{useShellStrings as i,useShellLocale as a}from"./chunk-
|
|
2
|
-
return f("div",{className:k,ref:
|
|
3
|
-
return u("div",{className:`relative ${k??""}`,ref:
|
|
4
|
-
/* @__PURE__ */u("svg",{width:"100%",height:
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{usePlotWidth as t}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as l,CHART_INK as r}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as n}from"./chunk-TWVUQUUD.js";import{useShellStrings as i,useShellLocale as a}from"./chunk-43MCNASD.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{useRef as h,useId as c,useState as s,useEffect as m}from"react";import{jsx as f,jsxs as u}from"react/jsx-runtime";function x({rows:x,columns:d,cells:p,height:M,width:g,color:y,max:v,formatValue:$,label:b,className:k,emptyLabel:w,cellGap:A=2,cellRadius:N=2}){const j=i().charts,C=a(),U=$??(e=>o(e,C)),z=b??j.intensity,D=w??j.noActivity,S=h(null),F=t(S),R=g??F,V=c(),[B,G]=s(null);if(m(()=>{if(null!==B)return n(e=>"Escape"===e.key&&(G(null),!0))},[B]),0===x.length||0===d.length)/* @__PURE__ */
|
|
2
|
+
return f("div",{className:k,ref:S,children:/* @__PURE__ */f("p",{className:"py-8 text-center text-sm text-gray-500",children:D})});const L=y??l(0),E=v??Math.max(1,...p.flat().filter(Number.isFinite)),I=96,Q=26*x.length,T=M??Q+26+26,Z=Math.max(2,(Math.max(97,R)-I)/d.length),H=e=>{const t=E>0?Math.max(0,Math.min(1,e/E)):0;return`color-mix(in oklab, ${L} ${(8+92*t).toFixed(1)}%, ${r.surface})`};/* @__PURE__ */
|
|
3
|
+
return u("div",{className:`relative ${k??""}`,ref:S,children:[
|
|
4
|
+
/* @__PURE__ */u("svg",{width:"100%",height:T,viewBox:`0 0 ${R} ${T}`,role:"img","aria-label":j.heatmap(z,x.length,d.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>G(null),onBlur:()=>G(null),onKeyDown:e=>{const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0,l="ArrowRight"===e.key?1:"ArrowLeft"===e.key?-1:0;0===t&&0===l||(e.preventDefault(),G(e=>({r:Math.min(x.length-1,Math.max(0,(e?.r??0)+t)),c:Math.min(d.length-1,Math.max(0,(e?.c??0)+l))})))},children:[
|
|
5
5
|
/* @__PURE__ */f("defs",{children:/* @__PURE__ */u("linearGradient",{id:V,x1:"0",x2:"1",children:[
|
|
6
|
-
/* @__PURE__ */f("stop",{offset:"0",stopColor:
|
|
7
|
-
/* @__PURE__ */f("stop",{offset:"1",stopColor:
|
|
8
|
-
return f("rect",{x:
|
|
9
|
-
/* @__PURE__ */f("rect",{x:
|
|
10
|
-
/* @__PURE__ */f("text",{x:
|
|
11
|
-
/* @__PURE__ */f("text",{x:
|
|
6
|
+
/* @__PURE__ */f("stop",{offset:"0",stopColor:H(0)}),
|
|
7
|
+
/* @__PURE__ */f("stop",{offset:"1",stopColor:H(E)})]})}),x.map((e,t)=>/* @__PURE__ */f("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:r.label,children:e},`r${t}`)),x.map((e,t)=>d.map((l,r)=>{const n=p[t]?.[r]??0,i=B&&(B.r!==t||B.c!==r);/* @__PURE__ */
|
|
8
|
+
return f("rect",{x:I+r*Z+A/2,y:26*t+A/2,width:Math.max(1,Z-A),height:26-A,rx:N,fill:H(n),opacity:i?.55:1,onMouseEnter:()=>G({r:t,c:r}),children:/* @__PURE__ */f("title",{children:`${e} · ${l}: ${U(n)}`})},`${t}-${r}`)})),d.map((e,t)=>t%Math.max(1,Math.ceil(d.length/Math.max(1,Math.floor((R-I)/56))))===0?/* @__PURE__ */f("text",{x:I+t*Z+Z/2,y:Q+15,textAnchor:"middle",fontSize:11,fill:r.label,children:e},`c${t}`):null),
|
|
9
|
+
/* @__PURE__ */f("rect",{x:I,y:Q+26,width:Math.min(180,Math.max(40,R-I)),height:8,rx:4,fill:`url(#${V})`}),
|
|
10
|
+
/* @__PURE__ */f("text",{x:I,y:Q+48,fontSize:11,fill:r.label,children:"0"}),
|
|
11
|
+
/* @__PURE__ */f("text",{x:I+Math.min(180,Math.max(40,R-I)),y:Q+48,textAnchor:"end",fontSize:11,fill:r.label,style:{fontVariantNumeric:"tabular-nums"},children:U(E)})]}),B&&/* @__PURE__ */f("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */f(e,{title:`${x[B.r]} · ${d[B.c]}`,rows:[{key:"v",label:z,color:L,value:null==p[B.r]?.[B.c]?void 0:U(p[B.r][B.c])}]})})]})}export{x as HeatmapChart};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{GROUP_COLORS as e}from"./chunk-FZM3ZPW3.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useShellStrings as l}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e}from"./chunk-FZM3ZPW3.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useShellStrings as l}from"./chunk-43MCNASD.js";import{jsx as t,jsxs as i,Fragment as a}from"react/jsx-runtime";var s="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium";function o({label:e,glyph:r,onClick:l}){/* @__PURE__ */
|
|
2
2
|
return t(n,{content:e,describe:!1,children:/* @__PURE__ */t("button",{type:"button",onClick:l,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */t("span",{"aria-hidden":"true",children:r})})})}function c({state:n,label:c,verb:u,subject:m,pct:p,onCancel:d,onRetry:h,onDismiss:f,className:b=""}){const g=l().transfer;if("idle"===n)return null==c?null:/* @__PURE__ */t("span",{className:`${s} ${e.neutral} pr-2 ${b}`.trim(),children:c});if("error"===n)/* @__PURE__ */
|
|
3
3
|
return i("span",{role:"status",className:`${s} ${e.danger} ${b}`.trim(),children:[
|
|
4
|
-
/* @__PURE__ */t("span",{children:g.error}),h&&/* @__PURE__ */t(o,{label:g.retry,glyph:"↻",onClick:h}),f&&/* @__PURE__ */t(o,{label:g.dismiss,glyph:"×",onClick:f})]});const
|
|
5
|
-
return i("span",{role:"status","aria-live":"polite",className:`${s} ${e.info} ${b}`.trim(),children:[null==
|
|
6
|
-
/* @__PURE__ */t("span",{className:"tabular-nums",children:"string"==typeof
|
|
4
|
+
/* @__PURE__ */t("span",{children:g.error}),h&&/* @__PURE__ */t(o,{label:g.retry,glyph:"↻",onClick:h}),f&&/* @__PURE__ */t(o,{label:g.dismiss,glyph:"×",onClick:f})]});const N=u??g.uploading,y=null==p||Number.isNaN(p)?null:Math.max(0,Math.min(100,Math.round(p))),$="string"==typeof N?g.cancelVerb(N.toLowerCase()):g.cancel,k=e=>[e,m,null==y?"":`${y}%`].filter(Boolean).join(" ");/* @__PURE__ */
|
|
5
|
+
return i("span",{role:"status","aria-live":"polite",className:`${s} ${e.info} ${b}`.trim(),children:[null==y&&/* @__PURE__ */t(r,{ink:""}),
|
|
6
|
+
/* @__PURE__ */t("span",{className:"tabular-nums",children:"string"==typeof N?k(N):/* @__PURE__ */i(a,{children:[N,k("")&&` ${k("")}`]})}),d&&/* @__PURE__ */t(o,{label:$,glyph:"×",onClick:d})]})}export{c as TransferProgress};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-
|
|
2
|
-
return p(n,{portal:!0,minWidth:x,style:
|
|
1
|
+
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-LLBH6PHE.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-BFA5U5JF.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:L=!0}){const D=s(null),A=a(),[j,S]=d(null),U=s(w);U.current=w,c(()=>{const e=D.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const C=s(null),F=s(!1);m(()=>(C.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!D.current?.contains(e)||C.current?.focus?.({preventScroll:!0})}),[]),m(()=>{j&&!F.current&&L&&(F.current=!0,h(D.current)[0]?.focus({preventScroll:!0}))},[j,L]),m(()=>{if(L)return;const e=e=>{if(D.current?.contains(document.activeElement))return;const t=h(D.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[L]),m(()=>u(e=>"Escape"===e.key&&(U.current(),!0),()=>D.current),[]),m(()=>{const e=()=>U.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const B=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void U.current();const t=h(D.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),T=j?{left:j.left,top:j.top,maxHeight:j.maxHeight,...j.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
|
|
2
|
+
return p(n,{portal:!0,minWidth:x,style:T,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:D,id:A,role:"menu","aria-label":b,"aria-describedby":y?t(y,A):void 0,"data-context-menu":"",onKeyDown:B,children:[y&&e(y,{menuId:A,choose:e=>{e.disabled||(U.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>U.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
|