efficient-shell 8.41.0 → 9.9.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 +70 -20
- package/dist/Browser-ZPOVP4Z7.js +43 -0
- package/dist/Calculator-CSYRZAS5.js +29 -0
- package/dist/CurrencyConverter-SSR2XDIC.js +21 -0
- package/dist/{Documents-VVKKYYJS.js → Documents-T7JYO223.js} +14 -14
- package/dist/Files-HBGW3JWI.js +88 -0
- package/dist/Notepad-GO2QT55C.js +25 -0
- package/dist/PdfViewer-XSISAJZP.js +1 -0
- package/dist/{PomodoroTimer-ZVD3D357.js → PomodoroTimer-EV6D4OFU.js} +28 -28
- package/dist/{Preview-K5AJQGE7.js → Preview-Z2CRCDHA.js} +58 -58
- package/dist/Sidebar-Y4DTQYW2.js +43 -0
- package/dist/Spreadsheet-GEE77GD3.js +37 -0
- package/dist/Stock-6ZIQHGPH.js +16 -0
- package/dist/Weather-II7NFRMK.js +60 -0
- package/dist/WorldClock-NBLNO63Q.js +32 -0
- package/dist/ai/index.d.ts +35 -4
- package/dist/ai/index.js +46 -46
- package/dist/ai.css +1 -1
- 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/ChartTooltip.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-24K6GVNM.js +28 -0
- package/dist/{chunk-M2AIC7IK.js → chunk-2HEJDLPP.js} +2 -2
- package/dist/{chunk-BRHIRE4D.js → chunk-2MLRK7IO.js} +2 -2
- package/dist/chunk-2R3BVU75.js +26 -0
- package/dist/chunk-2YLG32JY.js +2 -0
- package/dist/{chunk-TZSPJIP4.js → chunk-32VV2J22.js} +1 -1
- package/dist/{chunk-QQCHLRKG.js → chunk-3APSMJPN.js} +1 -1
- package/dist/{chunk-6SMQNPWS.js → chunk-43ONX6UZ.js} +1 -1
- package/dist/{chunk-L7IKTEOC.js → chunk-442FFHQJ.js} +13 -13
- package/dist/chunk-4MVRSCQE.js +1 -0
- package/dist/{chunk-BT3XDH3L.js → chunk-56RAOI7O.js} +6 -6
- package/dist/chunk-5F7HMNCX.js +5 -0
- package/dist/chunk-5GUBNCTP.js +1 -0
- package/dist/{chunk-LGLZTJ2W.js → chunk-5JRL5LXD.js} +6 -6
- package/dist/{chunk-OFHCDTJM.js → chunk-5VOVNIOU.js} +1 -1
- package/dist/{chunk-NID6MGGC.js → chunk-5VRMQTKV.js} +8 -8
- package/dist/chunk-6453ISTQ.js +4 -0
- package/dist/chunk-6FEL5D56.js +8 -0
- package/dist/{chunk-MVQBVPWP.js → chunk-6KBDNYRW.js} +1 -1
- package/dist/{chunk-D2AUUIKG.js → chunk-6MVHRNWC.js} +1 -1
- package/dist/{chunk-TW7TA2AB.js → chunk-6ZHX56NM.js} +1 -1
- package/dist/{chunk-RNBM5JZI.js → chunk-7JGR7WPD.js} +4 -4
- package/dist/{chunk-BIJ7ADTZ.js → chunk-7WGOLPGM.js} +1 -1
- package/dist/{chunk-SXSMIMFY.js → chunk-A6RB4PIX.js} +4 -4
- package/dist/chunk-AC373WIU.js +8 -0
- package/dist/{chunk-BMPBVI7P.js → chunk-AGUA3O5O.js} +1 -1
- package/dist/{chunk-UVUBZL7K.js → chunk-ANFLQSGX.js} +5 -5
- package/dist/chunk-ARWMJSQJ.js +3 -0
- package/dist/chunk-AYZY3YNC.js +1 -0
- package/dist/{chunk-BSNWVZHW.js → chunk-B4KMHEFZ.js} +1 -1
- package/dist/chunk-B6YOP2IX.js +6 -0
- package/dist/{chunk-4VLKDANH.js → chunk-BBEOFKLY.js} +1 -1
- package/dist/{chunk-22S6LG6D.js → chunk-BCDG4N6L.js} +1 -1
- package/dist/{chunk-DFDDRKIJ.js → chunk-BCUQXILM.js} +1 -1
- package/dist/chunk-BGRT775Y.js +2 -0
- package/dist/{chunk-5TFTSYOD.js → chunk-BVTNGW5S.js} +1 -1
- package/dist/{chunk-TVJRENCQ.js → chunk-BWUU565Y.js} +9 -9
- package/dist/{chunk-BKZGI76S.js → chunk-BZBMZDLD.js} +1 -1
- package/dist/chunk-BZG5E7GF.js +6 -0
- package/dist/{chunk-SBHFEWR6.js → chunk-C4UL2UNR.js} +1 -1
- package/dist/{chunk-DOCUM3K7.js → chunk-CAG3TSV2.js} +1 -1
- package/dist/chunk-CE5BARZI.js +16 -0
- package/dist/chunk-CJB73MHF.js +2 -0
- package/dist/{chunk-N6DTTOB6.js → chunk-CKPVXDKX.js} +3 -3
- package/dist/chunk-CO5RKOVX.js +20 -0
- package/dist/chunk-CRXFSN5K.js +20 -0
- package/dist/chunk-CVNJSD2J.js +18 -0
- package/dist/{chunk-RYBJ6MMM.js → chunk-CXMTDYVI.js} +1 -1
- package/dist/chunk-D7IXMMZT.js +9 -0
- package/dist/{chunk-JUGPTBMS.js → chunk-DLNYXXNE.js} +2 -2
- package/dist/chunk-DNWV6N4P.js +5 -0
- package/dist/{chunk-KZHPX4FM.js → chunk-DWBZ3Z34.js} +2 -2
- package/dist/chunk-DZTAGMNY.js +100 -0
- package/dist/chunk-E4E7MACR.js +20 -0
- package/dist/{chunk-DZNG34DC.js → chunk-EFFF3FCS.js} +23 -23
- package/dist/{chunk-NL5G26Q7.js → chunk-EGAV5LSX.js} +1 -1
- package/dist/{chunk-M5P6A7KS.js → chunk-ENL5L6NR.js} +1 -1
- package/dist/chunk-EW3L4W2I.js +14 -0
- package/dist/{chunk-6GWZ5UPX.js → chunk-EWVOGTEX.js} +1 -1
- package/dist/{chunk-I7HDD4IM.js → chunk-EXNAAHN4.js} +2 -2
- package/dist/{chunk-YDYDR72S.js → chunk-F4DIVARP.js} +1 -1
- package/dist/{chunk-WYN5KVU4.js → chunk-F7F6Z64G.js} +3 -3
- package/dist/{chunk-5PY4H4ZJ.js → chunk-FBUUXK5G.js} +1 -1
- package/dist/chunk-FKNJSD6B.js +14 -0
- package/dist/{chunk-D7FT2PXG.js → chunk-FLEG5KP5.js} +5 -5
- package/dist/{chunk-C4YN2DNM.js → chunk-FLQZ7GQ3.js} +11 -11
- package/dist/{chunk-L5ND7FNA.js → chunk-FPGRKHUW.js} +12 -12
- package/dist/chunk-G6CTTBKE.js +9 -0
- package/dist/{chunk-N2SJNPFY.js → chunk-GS5AISRS.js} +4 -4
- package/dist/{chunk-4Y4PWKMM.js → chunk-GVC535IA.js} +3 -3
- package/dist/chunk-HEEY4TVP.js +8 -0
- package/dist/chunk-HJWTWS5E.js +8 -0
- package/dist/{chunk-VH6GB73Q.js → chunk-HL6JSDN3.js} +1 -1
- package/dist/chunk-HNQPF5QZ.js +2 -0
- package/dist/{chunk-WRORJNS5.js → chunk-HQMN5THW.js} +10 -10
- package/dist/chunk-HUF34LSW.js +15 -0
- package/dist/chunk-IB4333CI.js +14 -0
- package/dist/chunk-IGNZULKG.js +17 -0
- package/dist/chunk-IJIESSTX.js +5 -0
- package/dist/{chunk-S7VSXUKS.js → chunk-IJWFKUYA.js} +4 -4
- package/dist/chunk-IK2WXW2E.js +27 -0
- package/dist/{chunk-UZMZ2EDW.js → chunk-IMOPDLMA.js} +1 -1
- package/dist/{chunk-2FLYC6I2.js → chunk-IN4KV3SJ.js} +1 -1
- package/dist/chunk-IPTCV6CQ.js +69 -0
- package/dist/{chunk-FORJ75AU.js → chunk-IQWIYZB5.js} +2 -2
- package/dist/chunk-IX6QMUJQ.js +9 -0
- package/dist/{chunk-4G5VLI7E.js → chunk-JDQGHQ2C.js} +1 -1
- package/dist/chunk-JIW5CJXC.js +4 -0
- package/dist/{chunk-P42YNSKI.js → chunk-JKDEE35P.js} +1 -1
- package/dist/{chunk-CKZ6ZDU5.js → chunk-JS6ZSEZJ.js} +1 -1
- package/dist/chunk-K4D63NP3.js +12 -0
- package/dist/chunk-KEK47CP3.js +12 -0
- package/dist/chunk-KWT6GT4M.js +29 -0
- package/dist/chunk-L4TN4EWK.js +1 -0
- package/dist/{chunk-SR4XAYLC.js → chunk-L67VXJMF.js} +1 -1
- package/dist/chunk-LAEXWXJA.js +9 -0
- package/dist/{chunk-D323R2FT.js → chunk-LNARMEEZ.js} +1 -1
- package/dist/{chunk-CZ25A5RS.js → chunk-LNQVTH5S.js} +1 -1
- package/dist/chunk-LUWRPPJA.js +7 -0
- package/dist/chunk-M554OMPA.js +2 -0
- package/dist/{chunk-BVW5U7QQ.js → chunk-M5GMIQ47.js} +3 -3
- package/dist/{chunk-GX2GSDJP.js → chunk-MAMWQCJ6.js} +1 -1
- package/dist/{chunk-ZTB6EMC7.js → chunk-MV6WDGB6.js} +1 -1
- package/dist/chunk-MWIT4UN2.js +14 -0
- package/dist/{chunk-BX2IOAD5.js → chunk-N2K6OAFM.js} +1 -1
- package/dist/{chunk-JPRJQ6B7.js → chunk-N3JXHNID.js} +10 -10
- package/dist/{chunk-EYKUKN32.js → chunk-N7T63BVD.js} +4 -4
- package/dist/chunk-NHH2MXFU.js +2 -0
- package/dist/chunk-NHVXVHUR.js +23 -0
- package/dist/{chunk-37CCKGHU.js → chunk-NWCW22U6.js} +2 -2
- package/dist/{chunk-J47HXHSL.js → chunk-O5LQBBW2.js} +7 -7
- package/dist/{chunk-IHQX4GYD.js → chunk-OQ2EDMB2.js} +1 -1
- package/dist/chunk-OUSKOWNP.js +12 -0
- package/dist/chunk-OV2SWQPT.js +22 -0
- package/dist/chunk-OX2DOOOI.js +8 -0
- package/dist/{chunk-6KO5VTL7.js → chunk-OZAAIE4E.js} +1 -1
- package/dist/chunk-P3OBE43Q.js +8 -0
- package/dist/{chunk-2C6IG7LG.js → chunk-P3Y5RFI4.js} +2 -2
- package/dist/{chunk-2UXAI77F.js → chunk-P4XTWAKJ.js} +1 -1
- package/dist/{chunk-7PCI6AUU.js → chunk-PB7G6CJ7.js} +1 -1
- package/dist/chunk-PDB5W7VI.js +6 -0
- package/dist/chunk-PDXPMHG3.js +4 -0
- package/dist/chunk-POCQ7ZL4.js +3 -0
- package/dist/{chunk-FORUFXAN.js → chunk-PVR4KU7H.js} +5 -5
- package/dist/{chunk-2RBWQVDC.js → chunk-PYLNMN6E.js} +13 -13
- package/dist/chunk-Q7KTTDUS.js +11 -0
- package/dist/{chunk-3PGK3VFS.js → chunk-QC6OK3ED.js} +1 -1
- package/dist/{chunk-MEJK6PBN.js → chunk-QSJR7EI7.js} +3 -3
- package/dist/{chunk-5DFKPSJQ.js → chunk-QTV3Y3UT.js} +1 -1
- package/dist/chunk-QWHQJNKL.js +1 -0
- package/dist/chunk-QXWY3CJ2.js +11 -0
- package/dist/{chunk-MG7OPTLQ.js → chunk-QZKWIVZW.js} +1 -1
- package/dist/chunk-R2VKEMZH.js +3 -0
- package/dist/{chunk-EXWGPXOS.js → chunk-RBD7SB6M.js} +1 -1
- package/dist/chunk-RC6UHOAV.js +4 -0
- package/dist/{chunk-ZVEOWBXE.js → chunk-RULVWW4A.js} +6 -6
- package/dist/chunk-RUTUVS4H.js +1 -0
- package/dist/{chunk-MAOJENIB.js → chunk-RWJCKZEY.js} +1 -1
- package/dist/chunk-S4Z657L6.js +6 -0
- package/dist/{chunk-Q3OCGLW7.js → chunk-SOP447EP.js} +2 -2
- package/dist/{chunk-CDRXZBVR.js → chunk-TBPHW42V.js} +1 -1
- package/dist/chunk-TLRCTNUF.js +6 -0
- package/dist/{chunk-KWX6NAOR.js → chunk-TVL3JPMY.js} +1 -1
- package/dist/{chunk-ZX2D25LG.js → chunk-U4OGRIP6.js} +1 -1
- package/dist/chunk-U5N6PSXO.js +9 -0
- package/dist/{chunk-SZIENHKR.js → chunk-UKDJUYIV.js} +1 -1
- package/dist/chunk-UQYNPYF4.js +1 -0
- package/dist/chunk-URHGHXDN.js +1 -0
- package/dist/{chunk-6WWAQC5V.js → chunk-VG2R6PZV.js} +1 -1
- package/dist/{chunk-RWGSMZGS.js → chunk-VVAJ23SD.js} +1 -1
- package/dist/chunk-VVGL5O4F.js +8 -0
- package/dist/chunk-VVJIKS47.js +1 -0
- package/dist/chunk-WE7CYRZT.js +7 -0
- package/dist/{chunk-L3G3YHVN.js → chunk-WFHYU66E.js} +1 -1
- package/dist/chunk-WH3JHMEA.js +13 -0
- package/dist/chunk-WUKN5WUM.js +11 -0
- package/dist/{chunk-ET2EF5CI.js → chunk-X7PM7JOD.js} +1 -1
- package/dist/{chunk-4NXMMWL6.js → chunk-XD34TCRG.js} +1 -1
- package/dist/chunk-XI4HKNFI.js +19 -0
- package/dist/{chunk-Y4MI6NRI.js → chunk-XNWQ72WA.js} +1 -1
- package/dist/{chunk-3BSPSRK4.js → chunk-XS4HFUTW.js} +3 -3
- package/dist/{chunk-Y5T257HX.js → chunk-XZYAFTW4.js} +4 -4
- package/dist/{chunk-Z35NWGMT.js → chunk-Y44ABEW3.js} +2 -2
- package/dist/chunk-YWGC7J6B.js +11 -0
- package/dist/{chunk-MMFJBWJC.js → chunk-Z3JW77LH.js} +1 -1
- package/dist/chunk-ZAU2HIRH.js +21 -0
- package/dist/{chunk-Y53KNQKL.js → chunk-ZDMZM7HD.js} +2 -2
- package/dist/chunk-ZHHEMSOD.js +3 -0
- package/dist/chunk-ZOHQVSB3.js +27 -0
- package/dist/{chunk-3AKIKASU.js → chunk-ZTL2RPNY.js} +1 -1
- package/dist/{chunk-QVR4LBBW.js → chunk-ZYDZY6ED.js} +1 -1
- package/dist/data/DataTable.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/file-intake/index.js +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.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/FormField.js +1 -1
- package/dist/forms/IconButton.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.d.ts +6 -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/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RadioGroup.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.d.ts +7 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.d.ts +7 -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.d.ts +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/Textarea.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.d.ts +7 -8
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/buttonStyles.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/styles.d.ts +2 -2
- package/dist/forms/styles.js +1 -1
- package/dist/forms/textAlign.d.ts +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/icons/efficient-glyphs.d.ts +0 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +0 -1
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.d.ts +0 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/glyphs/SpinnerIcon.js +1 -1
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +695 -695
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +12 -12
- package/dist/markdown/index.js +5 -5
- package/dist/{names-mX74Rrmy.d.ts → names-C1TgIb_2.d.ts} +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/EmptyValue.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.d.ts +20 -0
- package/dist/shell/ItemCount.js +1 -0
- package/dist/shell/Kbd.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.d.ts +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/Popover.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.d.ts +19 -5
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Spinner.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.d.ts +15 -6
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +24 -2
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- 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.d.ts +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/themes.css +101 -0
- package/dist/tokens/colour.d.ts +42 -0
- package/dist/tokens/colour.js +1 -0
- package/dist/tokens/elevation.d.ts +3 -1
- package/dist/tokens/elevation.js +1 -1
- package/dist/ui/index.d.ts +3 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +266 -24
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Browser-4C26ZOKV.js +0 -43
- package/dist/Calculator-MNTQSI6M.js +0 -29
- package/dist/CurrencyConverter-5XTNXV6T.js +0 -21
- package/dist/Files-BK7OAVOI.js +0 -87
- package/dist/Notepad-Z5XVWR2N.js +0 -25
- package/dist/PdfViewer-KJCJ6EPG.js +0 -1
- package/dist/Sidebar-LYTGLTQJ.js +0 -43
- package/dist/Spreadsheet-CCTSMXEG.js +0 -37
- package/dist/Stock-53UOMBQW.js +0 -16
- package/dist/Weather-S2ZIGNSU.js +0 -60
- package/dist/WorldClock-A62SDKTE.js +0 -32
- package/dist/chunk-26AYPJSK.js +0 -5
- package/dist/chunk-2CGZX62Z.js +0 -29
- package/dist/chunk-2NMT3Y5H.js +0 -20
- package/dist/chunk-3ZHFKOFX.js +0 -14
- package/dist/chunk-454DAGYG.js +0 -19
- package/dist/chunk-4CANQ3B3.js +0 -1
- package/dist/chunk-4CFOKYVR.js +0 -12
- package/dist/chunk-4IU5BSVE.js +0 -2
- package/dist/chunk-4IVT244O.js +0 -8
- package/dist/chunk-4SZDP3JF.js +0 -12
- package/dist/chunk-5BZMSSOV.js +0 -14
- package/dist/chunk-5E3WCKWB.js +0 -3
- package/dist/chunk-63EK6S3W.js +0 -3
- package/dist/chunk-64WSMLXG.js +0 -2
- package/dist/chunk-6BCFVOG7.js +0 -22
- package/dist/chunk-6BLWURSG.js +0 -4
- package/dist/chunk-6NMDKOQA.js +0 -7
- package/dist/chunk-6NSCK3YX.js +0 -100
- package/dist/chunk-7DKPJUGU.js +0 -2
- package/dist/chunk-7OCNF4AI.js +0 -5
- package/dist/chunk-BI6ZLD4X.js +0 -11
- package/dist/chunk-BOBUSE33.js +0 -2
- package/dist/chunk-CRLSG5AY.js +0 -9
- package/dist/chunk-CWXKRYVY.js +0 -5
- package/dist/chunk-DITCVBR7.js +0 -15
- package/dist/chunk-DODH46ZQ.js +0 -8
- package/dist/chunk-DZ6B5XCG.js +0 -13
- package/dist/chunk-E5ALJIXV.js +0 -9
- package/dist/chunk-E6UCGCOC.js +0 -1
- package/dist/chunk-EGDJEY4K.js +0 -27
- package/dist/chunk-EL2RLUT6.js +0 -20
- package/dist/chunk-ET32NQHX.js +0 -2
- package/dist/chunk-ETF7LAYZ.js +0 -8
- package/dist/chunk-EZ3BQ6PK.js +0 -18
- package/dist/chunk-GATKJSGL.js +0 -8
- package/dist/chunk-GNPTNAZH.js +0 -4
- package/dist/chunk-H33Z4ZIY.js +0 -11
- package/dist/chunk-HTYRV4WU.js +0 -3
- package/dist/chunk-I4VD5D43.js +0 -8
- package/dist/chunk-IFDW5QW6.js +0 -2
- package/dist/chunk-IUMFKZY7.js +0 -4
- package/dist/chunk-JPP7UWQA.js +0 -4
- package/dist/chunk-JVIOAZHW.js +0 -14
- package/dist/chunk-K7KQDPLW.js +0 -27
- package/dist/chunk-K7U4RWXJ.js +0 -1
- package/dist/chunk-L73LI7FG.js +0 -8
- package/dist/chunk-MEYYQC43.js +0 -8
- package/dist/chunk-MVP6Q6KV.js +0 -1
- package/dist/chunk-NDO24PK6.js +0 -21
- package/dist/chunk-NMKADD77.js +0 -1
- package/dist/chunk-P5BOTIJU.js +0 -6
- package/dist/chunk-PCQPV6MS.js +0 -6
- package/dist/chunk-PF3ANJFI.js +0 -1
- package/dist/chunk-Q23EHOXW.js +0 -17
- package/dist/chunk-Q5MD3VY6.js +0 -3
- package/dist/chunk-QR4RM7PO.js +0 -1
- package/dist/chunk-REVC6YPT.js +0 -7
- package/dist/chunk-RGOUJFAO.js +0 -9
- package/dist/chunk-S2OIRC5H.js +0 -12
- package/dist/chunk-SB7OTZI4.js +0 -69
- package/dist/chunk-SRKSGUGT.js +0 -23
- package/dist/chunk-SURSVJA2.js +0 -6
- package/dist/chunk-TIQKDAON.js +0 -11
- package/dist/chunk-VFCWCGO3.js +0 -9
- package/dist/chunk-VRODVMV3.js +0 -1
- package/dist/chunk-VU6VPKM3.js +0 -11
- package/dist/chunk-W6TS6WGA.js +0 -28
- package/dist/chunk-WSPO4N72.js +0 -19
- package/dist/chunk-X6PPP6NX.js +0 -14
- package/dist/chunk-XLD53X4P.js +0 -9
- package/dist/chunk-XSPDPN5O.js +0 -26
- package/dist/chunk-ZK2SULCA.js +0 -16
- package/dist/chunk-ZNCU3UIW.js +0 -8
- package/dist/chunk-ZNXBKFV7.js +0 -6
- package/dist/icons/glyphs/QuietIcon.d.ts +0 -8
- package/dist/icons/glyphs/QuietIcon.js +0 -1
- /package/dist/{chunk-EHPZIBOL.js → chunk-DSIDJYH7.js} +0 -0
- /package/dist/{chunk-KJRYEKQP.js → chunk-KC54JQYK.js} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{calendarNames as e,firstDayOfWeek as t}from"./chunk-5OTS2G3M.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{useBrowserValue as a}from"./chunk-D65T4H6J.js";import{useShellStrings as n,useShellLocale as o}from"./chunk-
|
|
1
|
+
import{calendarNames as e,firstDayOfWeek as t}from"./chunk-5OTS2G3M.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{useBrowserValue as a}from"./chunk-D65T4H6J.js";import{useShellStrings as n,useShellLocale as o}from"./chunk-QWHQJNKL.js";import{useMemo as l,useState as i,useRef as s,useEffect as c}from"react";import{jsxs as u,jsx as g,Fragment as d}from"react/jsx-runtime";var h=e=>String(e).padStart(2,"0"),m="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";function b(e){return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())}`}function f(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const r=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(r.getTime())?null:r}var v=e=>`${e.getFullYear()}-${h(e.getMonth()+1)}`;var y=()=>b(/* @__PURE__ */new Date);var p=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),x=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),a))};function N({value:h,endValue:N,mode:w="single",onSelect:D,min:M,max:Y,month:k,defaultMonth:F,onMonthChange:j,weekStartsOn:S,quickJump:$=!0,markedDates:A,readOnly:C=!1,"aria-label":P,className:q=""}){const K=l(()=>new Set(A??[]),[A]),H=f(h),J=a(y,null),O=f(J),T=n().calendar,W=o(),E=e(W),I=a(()=>t(W),0),L=S??I,Q=()=>{if(!O)return null;const e=v(O);return M&&e<M.slice(0,7)?M.slice(0,7):Y&&e>Y.slice(0,7)?Y.slice(0,7):e},[U,V]=i(()=>F||(H?v(H):Q())),B=k??U??Q(),G=null===B?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(B,O),[R,z]=i(()=>h??J),X=s(null),Z=s(!1),[_,ee]=i("days"),te=l(()=>G?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),a=(r.getDay()-t+7)%7,n=new Date(r.getFullYear(),r.getMonth(),1-a);return Array.from({length:42},(e,t)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))}(G,L):[],[B,L]),re=e=>!!M&&e<M||!!Y&&e>Y,ae=R??J,ne=te.some(e=>b(e)===ae),oe=G?te.find(e=>e.getMonth()===G.getMonth())??te[0]:null,le=ne&&ae?ae:oe?b(oe):"";if(c(()=>{Z.current&&(Z.current=!1,X.current?.querySelector('[data-active="true"]')?.focus())},[le,B]),!G)/* @__PURE__ */
|
|
2
2
|
return u("div",{className:q,"aria-hidden":"true","data-calendar-pending":"",children:[
|
|
3
3
|
/* @__PURE__ */g("div",{className:"mb-2 h-6"}),
|
|
4
|
-
/* @__PURE__ */g("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */g("div",0===t?{className:"py-1 text-xs",children:" "}:{className:m,children:/* @__PURE__ */g("span",{className:"aspect-square"})},t))})]});const ie=e=>"years"===_?new Date(
|
|
4
|
+
/* @__PURE__ */g("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */g("div",0===t?{className:"py-1 text-xs",children:" "}:{className:m,children:/* @__PURE__ */g("span",{className:"aspect-square"})},t))})]});const ie=e=>"years"===_?new Date(G.getFullYear()+12*e,G.getMonth(),1):"months"===_?new Date(G.getFullYear()+e,G.getMonth(),1):x(G,e),se=e=>{const t=v(e);void 0===k&&V(t),j?.(t)},ce=P??E.monthYear(G.getFullYear(),G.getMonth());/* @__PURE__ */
|
|
5
5
|
return u("div",{className:q,children:[
|
|
6
6
|
/* @__PURE__ */u("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
7
|
-
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?
|
|
8
|
-
/* @__PURE__ */g("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children
|
|
9
|
-
/* @__PURE__ */g("button",{type:"button","aria-label":
|
|
10
|
-
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?
|
|
11
|
-
/* @__PURE__ */u("div",{ref:X,role:"grid","aria-label":ce,className:"space-y-1","aria-readonly":
|
|
12
|
-
/* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-xs font-medium text-
|
|
13
|
-
/* @__PURE__ */g("div",{role:"columnheader","aria-label":
|
|
14
|
-
return g("div",{role:"gridcell","aria-selected":a,"aria-label":
|
|
7
|
+
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?T.previousYears:"months"===_?T.previousYear:T.previousMonth,onClick:()=>se(ie(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */g(r,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
|
|
8
|
+
/* @__PURE__ */g("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:$?/* @__PURE__ */u(d,{children:["years"!==_&&/* @__PURE__ */g("button",{type:"button","aria-label":T.chooseMonth(E.months[G.getMonth()]),onClick:()=>ee(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:E.months[G.getMonth()]}),
|
|
9
|
+
/* @__PURE__ */g("button",{type:"button","aria-label":T.chooseYear(G.getFullYear()),onClick:()=>ee(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:G.getFullYear()})]}):/* @__PURE__ */g("span",{children:E.monthYear(G.getFullYear(),G.getMonth())})}),
|
|
10
|
+
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?T.nextYears:"months"===_?T.nextYear:T.nextMonth,onClick:()=>se(ie(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */g(r,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===_&&/* @__PURE__ */g("div",{role:"group","aria-label":T.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:E.monthsShort.map((e,t)=>/* @__PURE__ */g("button",{type:"button","aria-pressed":t===G.getMonth(),onClick:()=>{se(new Date(G.getFullYear(),t,1)),ee("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===G.getMonth()?"bg-blue-600 font-semibold text-white":O&&t===O.getMonth()&&G.getFullYear()===O.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===_&&/* @__PURE__ */g("div",{role:"group","aria-label":T.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=G.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */g("button",{type:"button","aria-pressed":e===G.getFullYear(),onClick:()=>{se(new Date(e,G.getMonth(),1)),ee("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===G.getFullYear()?"bg-blue-600 font-semibold text-white":e===O?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
|
|
11
|
+
/* @__PURE__ */u("div",{ref:X,role:"grid","aria-label":ce,className:"space-y-1","aria-readonly":C||void 0,onKeyDown:e=>{const t=f(le)??O??G,r={ArrowLeft:()=>p(t,-1),ArrowRight:()=>p(t,1),ArrowUp:()=>p(t,-7),ArrowDown:()=>p(t,7),Home:()=>p(t,-(t.getDay()-L+7)%7),End:()=>p(t,6-(t.getDay()-L+7)%7),PageUp:()=>x(t,e.shiftKey?-12:-1),PageDown:()=>x(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),Z.current=!0,z(b(a)),void(v(a)!==B&&se(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),C||re(le)||D(le))},hidden:"days"!==_,children:[
|
|
12
|
+
/* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-xs font-medium text-ink-faint`,children:Array.from({length:7},(e,t)=>(t+L)%7).map(e=>
|
|
13
|
+
/* @__PURE__ */g("div",{role:"columnheader","aria-label":E.weekdays[e],className:"py-1",children:/* @__PURE__ */g("abbr",{title:E.weekdays[e],className:"no-underline",children:E.weekdaysShort[e]})},e))}),Array.from({length:6},(e,t)=>/* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-sm`,children:te.slice(7*t,7*t+7).map(e=>{const t=b(e),r=e.getMonth()!==G.getMonth(),a=t===h||"range"===w&&t===N,n=(e=>!("range"!==w||!h||!N)&&e>h&&e<N)(t),o=re(t),l=E.longDate(e.getFullYear(),e.getMonth(),e.getDate()),i=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",o?"cursor-not-allowed text-gray-300":a?"bg-accent-fill font-semibold text-on-accent":n?"bg-accent-tint-strong text-blue-800":r?"text-ink-faint"+(e?" hover:bg-gray-100":""):"text-ink"+(e?" hover:bg-gray-100":""),t!==J||a?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),s=K.has(t)&&/* @__PURE__ */g("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(a?"bg-surface":r?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
|
|
14
|
+
return g("div",{role:"gridcell","aria-selected":a,"aria-label":C?l:void 0,children:C?/* @__PURE__ */u("span",{"aria-hidden":"true",className:`grid place-items-center ${i(!1)}`,children:[e.getDate(),s]}):/* @__PURE__ */u("button",{type:"button","data-active":t===le,tabIndex:t===le?0:-1,disabled:o,"aria-label":l,"aria-current":t===J?"date":void 0,onClick:()=>{z(t),D(t)},className:i(!0),children:[e.getDate(),s]})},t)})},t))]})]})}export{N as Calendar,f as fromKey,b as toKey};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{resolveSeriesColor as t,CHART_INK as e}from"./chunk-TZFACUMR.js";import{useShellStrings as r}from"./chunk-
|
|
2
|
-
return n("rect",{x:y(e)-4.5,y:0,width:9,height:u,rx:3,fill:v,className:"cursor-ew-resize rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",tabIndex:0,role:"slider","aria-label":"from"===t?d.windowStart:d.windowEnd,"aria-valuemin":0,"aria-valuemax":p,"aria-valuenow":e,"aria-valuetext":a[e],style:{touchAction:"none"},onKeyDown:
|
|
1
|
+
import{resolveSeriesColor as t,CHART_INK as e}from"./chunk-TZFACUMR.js";import{useShellStrings as r}from"./chunk-QWHQJNKL.js";import{useRef as o}from"react";import{jsx as n,jsxs as i}from"react/jsx-runtime";function a({labels:a,data:l,range:h,onRangeChange:c,height:u=46,width:s=720,color:f,className:m}){const d=r().charts,g=o(null),p=a.length-1,[w,x]=h,v=f??t(0),y=t=>0===p?0:t/p*s,M=t=>"number"==typeof t&&Number.isFinite(t),$=l.filter(M),b=Math.max(...$,1),k=t=>u-t/b*(u-6),D=[];a.forEach((t,e)=>{if(!M(l[e]))return;const r=D[D.length-1];r&&r.to===e-1?r.to=e:D.push({from:e,to:e})});const F=D.map(t=>{const e=[];for(let r=t.from;r<=t.to;r+=1)e.push(`${r===t.from?"M":"L"}${y(r).toFixed(2)},${k(l[r]).toFixed(2)}`);return`${e.join(" ")} L${y(t.to).toFixed(2)},${u} L${y(t.from).toFixed(2)},${u} Z`}).join(" "),j=(t,e)=>{const r=Math.max(0,Math.min(p,e));c("from"===t?[Math.min(r,x-1),x]:[w,Math.max(r,w+1)])},C=t=>e=>{const r=e.shiftKey?5:1,o="from"===t?w:x;"ArrowLeft"===e.key&&(e.preventDefault(),j(t,o-r)),"ArrowRight"===e.key&&(e.preventDefault(),j(t,o+r)),"Home"===e.key&&(e.preventDefault(),j(t,0)),"End"===e.key&&(e.preventDefault(),j(t,p))},L=o(null),N=t=>e=>{L.current=t,e.currentTarget.setPointerCapture(e.pointerId)},P=t=>e=>{L.current===t&&j(t,(t=>{const e=g.current?.getBoundingClientRect();if(!e||0===e.width)return w;const r=Math.max(0,Math.min(1,(t-e.left)/e.width));return Math.round(r*p)})(e.clientX))},A=t=>()=>{L.current===t&&(L.current=null)},R=t=>{const e="from"===t?w:x;/* @__PURE__ */
|
|
2
|
+
return n("rect",{x:y(e)-4.5,y:0,width:9,height:u,rx:3,fill:v,className:"cursor-ew-resize rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",tabIndex:0,role:"slider","aria-label":"from"===t?d.windowStart:d.windowEnd,"aria-valuemin":0,"aria-valuemax":p,"aria-valuenow":e,"aria-valuetext":a[e],style:{touchAction:"none"},onKeyDown:C(t),onPointerDown:N(t),onPointerMove:P(t),onPointerUp:A(t),onPointerCancel:A(t)},t)};/* @__PURE__ */
|
|
3
3
|
return n("div",{className:m,children:/* @__PURE__ */i("svg",{ref:g,width:"100%",height:u,viewBox:`0 0 ${s} ${u}`,role:"group","aria-label":d.window(a[w],a[x],a.length),children:[
|
|
4
|
-
/* @__PURE__ */n("path",{d:
|
|
4
|
+
/* @__PURE__ */n("path",{d:F,fill:e.grid}),
|
|
5
5
|
/* @__PURE__ */n("rect",{x:0,y:0,width:y(w),height:u,fill:e.surface,fillOpacity:.72}),
|
|
6
6
|
/* @__PURE__ */n("rect",{x:y(x),y:0,width:Math.max(0,s-y(x)),height:u,fill:e.surface,fillOpacity:.72}),
|
|
7
|
-
/* @__PURE__ */n("rect",{x:y(w),y:0,width:Math.max(1,y(x)-y(w)),height:u,fill:"none",stroke:v,strokeWidth:1}),
|
|
7
|
+
/* @__PURE__ */n("rect",{x:y(w),y:0,width:Math.max(1,y(x)-y(w)),height:u,fill:"none",stroke:v,strokeWidth:1}),R("from"),R("to")]})})}export{a as ChartBrush};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{buttonClasses as e}from"./chunk-UQYNPYF4.js";import{isAriaDisabled as a,swallowPress as r,describedByWith as i,OffWithReason as s}from"./chunk-HL6JSDN3.js";import{SpinnerRing as l}from"./chunk-R2VKEMZH.js";import{forwardRef as d,useId as n}from"react";import{jsxs as t,jsx as c}from"react/jsx-runtime";var o=d(function({variant:d="primary",size:o="md",loading:m=!1,leftIcon:p,rightIcon:b,block:f=!1,disabled:u,type:h="button",children:k,className:x="",disabledReason:N,onClick:y,pressed:v,"aria-disabled":g,"aria-describedby":j,...w},z){const C=n(),H=u||m,I=null!=N&&""!==N,R=H&&I,Y=!H&&a(g),D=Y&&I,E=R||D?C:void 0,F=/* @__PURE__ */t("button",{ref:z,type:h,disabled:H,"aria-busy":m||void 0,"aria-disabled":!!Y||g,"aria-describedby":i(j,E),onClick:Y?r:y,className:e({variant:d,size:o,block:f,pressed:v??(!0===w["aria-pressed"]||"true"===w["aria-pressed"]),className:x}),...w,children:[m?/* @__PURE__ */c(l,{className:"h-3.5 w-3.5",ink:""}):p,k,!m&&b]});return D?/* @__PURE__ */c(s,{reason:N,id:C,block:f,children:F}):R?/* @__PURE__ */t("span",{className:f?"flex w-full flex-col gap-1":"inline-flex flex-col items-start gap-1",children:[F,
|
|
2
|
+
/* @__PURE__ */c("span",{id:E,className:"text-xs text-red-600",children:N})]}):F});export{o as Button_default};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{Calendar as e,fromKey as t}from"./chunk-N3JXHNID.js";import{FILTER_ON as r,FILTER_ON_INK as n,FILTER_OFF as a}from"./chunk-AYZY3YNC.js";import{calendarNames as o}from"./chunk-5OTS2G3M.js";import{buttonClasses as i}from"./chunk-UQYNPYF4.js";import{Icon as l}from"./chunk-FSPFV4MI.js";import{onOverlayOpen as s}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as c}from"./chunk-62LW225J.js";import{useDropdownPosition as d}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as m}from"./chunk-D65T4H6J.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as p,useShellLocale as h}from"./chunk-QWHQJNKL.js";import{useState as f,useRef as g,useId as b,useEffect as x}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,Fragment as w,jsx as N}from"react/jsx-runtime";var k=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],C=e=>`${e.getFullYear()}-${M(e.getMonth()+1)}`,M=e=>String(e).padStart(2,"0");function $(e){return`${e.getFullYear()}-${M(e.getMonth()+1)}-${M(e.getDate())}`}function D(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:$(new Date(r,n,t.getDate()-14)),to:$(a)};case"lastMonth":return{from:$(i(1)),to:$(o)};case"last3Months":return{from:$(i(3)),to:$(o)};case"last6Months":return{from:$(i(6)),to:$(o)};case"last12Months":return{from:$(i(12)),to:$(o)}}}function W(e,t,r){const n=C(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function j(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function S(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var F=/* @__PURE__ */new Map;function Y({from:M,to:$,onChange:Y,formatDisplay:O,clearable:H,required:T=!1,name:J,id:L,"aria-labelledby":R,"aria-label":I,weekStartsOn:B,placeholder:E,fullWidth:G=!1,min:U,max:q,disabled:A=!1,allowOpenEnd:P=!1}){const Q=p().dateRange,V=h(),Z=O??(V?function(e){let t=F.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),F.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(V):S),z=E??Q.placeholder,K=H??!T,[X,_]=f(!1),[ee,te]=f(M),[re,ne]=f($),[ae,oe]=f(null),[ie,le]=f("from"),se=g(null),ce=g(null),de=g(null),me=b(),ue=b(),pe=b(),[he,fe]=f(!1),ge=d(se,X,{preferredMaxWidth:520,preferredMaxHeight:he?720:560,popupRef:de}),be=g(null),xe=g(null),[ve,ye]=f(!0);m(()=>{const e=xe.current;if(!X||!he||!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!==ve&&ye(a)});const we=g(null);m(()=>{const e=de.current;if(!X||!ge||!e)return;const t=getComputedStyle(e),r=ge.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(he)null!==we.current&&we.current<=r&&fe(!1);else{const e=be.current?.offsetWidth??0;if(0===e)return;we.current=e,e>r+.5&&fe(!0)}});const[Ne,ke]=f(!1);m(()=>{const e=!!L&&(ce.current?.labels?.length??0)>0;e!==Ne&&ke(e)});const Ce=!!I||!!R||Ne,Me=/* @__PURE__ */new Date,[$e,De]=f(()=>M?C(j(M)):W(Me,U,q)),We=k.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(D(e,Me),U,q)),je=e=>e?Z(e):"";x(()=>{if(!X)return;const e=e=>{const t=e.target;se.current?.contains(t)||de.current?.contains(t)||_(!1)};document.addEventListener("mousedown",e);const t=s(()=>_(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[X]),x(()=>{A&&_(!1)},[A]);const Se=()=>{Y("",""),_(!1)},Fe=M&&$?`${je(M)} — ${je($)}`:M?Q.fromOnly(je(M)):$?Q.toOnly(je($)):"",Ye=o(V),Oe=e=>{const r=t(e);return r?Ye.longDate(r.getFullYear(),r.getMonth(),r.getDate()):e},He=M&&$?Q.range(Oe(M),Oe($)):M?Q.fromOnly(Oe(M)):$?Q.toOnly(Oe($)):z,Te=e=>he?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(ae===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 "+(ae===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Je=/* @__PURE__ */y(w,{children:[We.map(e=>/* @__PURE__ */N("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=D(e,Me);te(t.from),ne(t.to),oe(e),De(t.from.slice(0,7))})(e),className:Te(e),"aria-label":he?Q[e]:void 0,children:he?ve?Q[e]:Q[`${e}Short`]:Q[e]},e)),
|
|
2
|
+
/* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:Te("Custom"),children:Q.custom})]}),Le=(e,t)=>P?/* @__PURE__ */N("button",{type:"button","data-range-end":e,"aria-pressed":ie===e,onClick:()=>le(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */N("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Re=e=>P&&ie===e?" ring-1 ring-blue-400":"",Ie=
|
|
3
|
+
/* @__PURE__ */N(e,{mode:"range",min:U,max:q,value:ee||null,endValue:re||null,month:$e,onMonthChange:De,onSelect:e=>{oe("Custom"),P?"from"===ie?(re&&e>re?(te(re),ne(e)):te(e),le("to")):ee&&e<ee?(ne(ee),te(e)):ne(e):!ee||ee&&re?(te(e),ne("")):e<ee?(ne(ee),te(e)):ne(e)},weekStartsOn:B,"aria-label":Q.dialog});/* @__PURE__ */
|
|
4
|
+
return y("div",{className:"relative"+(G?" w-full":""),ref:se,children:[
|
|
5
|
+
/* @__PURE__ */y("div",{className:`${G?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${M||$?`${r} ${n}`:a}${A?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
+
/* @__PURE__ */y("button",{ref:ce,type:"button",onClick:()=>{A||(te(M),ne($),oe(null),le(M&&!$?"to":"from"),De(M?C(j(M)):W(Me,U,q)),_(!0))},"aria-haspopup":"dialog","aria-expanded":X,id:L,disabled:A||void 0,"aria-label":I,"aria-labelledby":R,"aria-describedby":[Ce?ue:void 0,T?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":X?me:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(G?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
|
+
/* @__PURE__ */N(l,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
+
/* @__PURE__ */N("span",{className:"truncate",children:Fe||z})]}),K&&!A&&(M||$)&&/* @__PURE__ */N("button",{type:"button",onClick:Se,"aria-label":Q.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Ce&&/* @__PURE__ */N("span",{id:ue,className:"sr-only",children:He}),T&&/* @__PURE__ */N("span",{id:pe,className:"sr-only",children:Q.required}),J&&/* @__PURE__ */y(w,{children:[
|
|
9
|
+
/* @__PURE__ */N("input",{type:"hidden",name:J.from,value:M,disabled:A||void 0}),
|
|
10
|
+
/* @__PURE__ */N("input",{type:"hidden",name:J.to,value:$,disabled:A||void 0})]}),X&&v(
|
|
11
|
+
/* @__PURE__ */y("div",{ref:de,id:me,role:"dialog","aria-label":Q.dialog,"data-layout":he?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:c.popup,left:ge?.left,right:ge?.right,top:ge?.top,bottom:ge?.bottom,width:he&&ge?ge.maxWidth:"max-content",maxWidth:ge?.maxWidth,maxHeight:ge?.maxHeight,overflowY:"auto",visibility:ge?void 0:"hidden",...u()},children:[
|
|
12
|
+
/* @__PURE__ */y("div",{className:he?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Le("from",/* @__PURE__ */y(w,{children:[
|
|
13
|
+
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:Q.from}),
|
|
14
|
+
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Re("from")}`,children:ee?je(ee):Q.start})]})),!he&&/* @__PURE__ */N("span",{className:"text-gray-300",children:"—"}),Le("to",/* @__PURE__ */y(w,{children:[
|
|
15
|
+
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:Q.to}),
|
|
16
|
+
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Re("to")}`,children:re?je(re):Q.end})]}))]}),he?/* @__PURE__ */y(w,{children:[We.length>0&&/* @__PURE__ */y("div",{className:"mb-3 @container",children:[!ve&&/* @__PURE__ */N("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:Q.lastHeading}),
|
|
17
|
+
/* @__PURE__ */y("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Je,We.map(e=>/* @__PURE__ */N("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:Q[e]},e))]})]}),
|
|
18
|
+
/* @__PURE__ */N("div",{className:"w-full",children:Ie})]}):
|
|
19
|
+
/* @__PURE__ */y("div",{ref:be,className:"flex w-max gap-4",children:[
|
|
20
|
+
/* @__PURE__ */N("div",{className:"w-64",children:Ie}),We.length>0&&/* @__PURE__ */N("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Je})]}),
|
|
21
|
+
/* @__PURE__ */y("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[K&&/* @__PURE__ */N("button",{type:"button",onClick:Se,className:i({variant:"ghost"}),children:Q.clear}),
|
|
22
|
+
/* @__PURE__ */N("button",{type:"button",onClick:()=>_(!1),className:i({variant:"secondary"}),children:Q.cancel}),
|
|
23
|
+
/* @__PURE__ */N("button",{type:"button",onClick:()=>{Y(ee,re),_(!1)},disabled:P?!ee&&!re:!ee||!re,className:i({variant:"primary"}),children:Q.apply})]})]}),document.body)]})}export{Y as DateRangePicker,D as presetRange,$ as toISODate};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-
|
|
2
|
-
return m(t,{labels:s.map(e=>e.label),values:
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-TLRCTNUF.js";import{CartesianPlot as t}from"./chunk-AC373WIU.js";import{resolveSeriesColor as i,CHART_INK as l}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as a}from"./chunk-QWHQJNKL.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{jsx as m,jsxs as n}from"react/jsx-runtime";function s({boxes:s,height:c=240,width:h,color:u,tone:x,formatValue:d,yAxisLabel:y,label:k,className:b,emptyLabel:f}){const p=r().charts,q=a(),g=d??(e=>o(e,q)),v=k??p.distribution,W=i(0,u,x),L=s.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
|
|
2
|
+
return m(t,{labels:s.map(e=>e.label),values:L,height:c,width:h,bandPadding:.5,formatValue:g,yAxisLabel:y,className:b,emptyLabel:f,ariaLabel:p.fiveNumber(v,s.length),tooltip:t=>{const i=s[t];/* @__PURE__ */
|
|
3
3
|
return m(e,{title:i.label,rows:[{key:"max",label:p.maximum,color:W,value:g(i.max)},{key:"q3",label:p.q3,color:W,value:g(i.q3)},{key:"median",label:p.median,color:W,value:g(i.median)},{key:"q1",label:p.q1,color:W,value:g(i.q1)},{key:"min",label:p.minimum,color:W,value:g(i.min)}],emphasisKey:"median",footnote:i.outliers?.length?p.outliers(i.outliers.length):void 0})},children:({x:e,y:t,active:i})=>/* @__PURE__ */m("g",{children:s.map((r,a)=>{const o=e.center(a),s=Math.max(6,e.bandwidth);/* @__PURE__ */
|
|
4
4
|
return n("g",{opacity:null!==i&&i!==a?.45:1,children:[
|
|
5
5
|
/* @__PURE__ */m("line",{x1:o,y1:t(r.max),x2:o,y2:t(r.q3),stroke:W,strokeWidth:1.5}),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{useOverlayTarget as e,OverlayLayerProvider as r}from"./chunk-4AJRHTTB.js";import{dialogA11y as i}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as o}from"./chunk-PKXQDCNR.js";import{useFocusTrap as t,useScrollLock as l}from"./chunk-CDAJKLGL.js";import{Icon as s}from"./chunk-FSPFV4MI.js";import{Z_LAYERS as a}from"./chunk-62LW225J.js";import{useHydrated as n}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as d}from"./chunk-TWVUQUUD.js";import{useShellStrings as c}from"./chunk-
|
|
2
|
-
return b("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */b(s,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function k({open:s,onClose:c,side:k="right",size:N="md",title:j,description:w,footer:C,children:W,blocking:
|
|
3
|
-
/* @__PURE__ */b(r,{value:
|
|
4
|
-
/* @__PURE__ */b("div",{className:"fixed inset-0 bg-black/30",onClick:
|
|
5
|
-
/* @__PURE__ */x("div",{ref:
|
|
1
|
+
import{useOverlayTarget as e,OverlayLayerProvider as r}from"./chunk-4AJRHTTB.js";import{dialogA11y as i}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as o}from"./chunk-PKXQDCNR.js";import{useFocusTrap as t,useScrollLock as l}from"./chunk-CDAJKLGL.js";import{Icon as s}from"./chunk-FSPFV4MI.js";import{Z_LAYERS as a}from"./chunk-62LW225J.js";import{useHydrated as n}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as d}from"./chunk-TWVUQUUD.js";import{useShellStrings as c}from"./chunk-QWHQJNKL.js";import{useRef as m,useId as h,useState as u,useEffect as f}from"react";import{createPortal as p}from"react-dom";import{jsx as b,jsxs as x}from"react/jsx-runtime";var g={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},y={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function v({onClose:e}){const r=c().dialog;/* @__PURE__ */
|
|
2
|
+
return b("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */b(s,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function k({open:s,onClose:c,side:k="right",size:N="md",title:j,description:w,footer:C,children:W,blocking:J=!1,initialFocus:L,"aria-label":D,"aria-labelledby":H,"aria-describedby":Q,className:T=""}){const z=m(null),A=h(),B=h(),F=h(),I=e(n()),[K,U]=u(null);if(o(s),t(z,s&&null!==I,L),l(s),f(()=>{if(s)return d(()=>(J||c(),!0),()=>z.current)},[s,J,c]),!s||!I)return null;const V="bottom"===k,G=V?{maxHeight:"85vh"}:void 0;return p(
|
|
3
|
+
/* @__PURE__ */b(r,{value:K,children:/* @__PURE__ */x("div",{ref:U,className:"fixed inset-0",style:{zIndex:a.overlay},role:"presentation",children:[
|
|
4
|
+
/* @__PURE__ */b("div",{className:"fixed inset-0 bg-black/30",onClick:J?void 0:c,"aria-hidden":"true"}),
|
|
5
|
+
/* @__PURE__ */x("div",{ref:z,...i({modal:!0,titleId:j?F:void 0,labelledBy:H,label:D}),"aria-describedby":Q??(w?B:W?A:void 0),"data-drawer-side":k,style:G,className:["fixed flex flex-col bg-white shadow-xl",V?"":`w-full max-w-full ${g[N]}`,y[k],V?"rounded-t-xl":"",T].filter(Boolean).join(" "),children:[j?/* @__PURE__ */x("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
6
6
|
/* @__PURE__ */x("div",{className:"min-w-0",children:[
|
|
7
|
-
/* @__PURE__ */b("h2",{id:
|
|
8
|
-
/* @__PURE__ */x("div",{id:
|
|
7
|
+
/* @__PURE__ */b("h2",{id:F,className:"text-base font-semibold text-gray-900",children:j}),w&&/* @__PURE__ */b("p",{id:B,className:"mt-0.5 text-sm text-gray-500",children:w})]}),!J&&/* @__PURE__ */b(v,{onClose:c})]}):!J&&/* @__PURE__ */b("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */b(v,{onClose:c})}),
|
|
8
|
+
/* @__PURE__ */x("div",{id:A,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[w&&!j&&/* @__PURE__ */b("p",{id:B,className:("mb-3 text-sm text-gray-500 "+(J?"":"pr-8")).trim(),children:w}),W]}),C&&/* @__PURE__ */b("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:C})]})]})}),I)}export{k as Drawer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{useShellStrings as t}from"./chunk-QWHQJNKL.js";import{jsxs as e,jsx as r}from"react/jsx-runtime";var o={403:t=>({title:t.forbidden,body:t.forbiddenBody}),404:t=>({title:t.notFound,body:t.notFoundBody}),500:t=>({title:t.serverError,body:t.serverErrorBody})};function i({code:i=404,actions:n}){const d=o[i](t().errors);/* @__PURE__ */
|
|
2
2
|
return e("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center",children:[
|
|
3
3
|
/* @__PURE__ */r("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:i}),
|
|
4
4
|
/* @__PURE__ */r("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:d.title}),
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{CountBadge as e}from"./chunk-RWJCKZEY.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{useShellStrings as i,useShellLocale as t}from"./chunk-QWHQJNKL.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useState as a,useId as o}from"react";import{jsx as s,jsxs as c,Fragment as l}from"react/jsx-runtime";var d="px-4 @max-[260px]/acc:px-3",h={band:{head:`${d} py-3 bg-(--rosh-fold-band)`,press:"hover:bg-(--rosh-fold-band-hover)",title:"text-base font-semibold text-(--ink-strongest)",chev:"text-(--ink-strongest)",body:`${d} pb-2`},row:{head:`${d} py-2`,press:"hover:bg-row-hover",title:"text-sm font-medium text-(--ink-strong)",chev:"text-(--ink-strong)",body:`${d} pb-2`}},m=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join(""),u="m-0 p-0 border-0 [font:inherit] [letter-spacing:inherit] [text-transform:inherit]";function f({items:d,defaultOpenIds:f=[],openIds:p,onOpenChange:b,allowMultiple:v=!1,level:x=3,tier:$="band",className:g=""}){const N=h[$],y=i(),k=t(),[w,j]=a(f),C=o(),I=`h${x}`,M=p??w;/* @__PURE__ */
|
|
2
|
+
return s("div",{"data-accordion":$,className:`@container/acc flex flex-col ${"band"===$?"gap-0.5":""} ${g}`.trim(),children:d.map(i=>{const t=M.includes(i.id),a=`${C}-${m(i.id)}-head`,o=`${C}-${m(i.id)}-panel`;/* @__PURE__ */
|
|
3
|
+
return c("div",{children:[
|
|
4
|
+
/* @__PURE__ */s(I,{className:u,children:/* @__PURE__ */c("button",{type:"button",id:a,disabled:i.disabled,"aria-expanded":t,"aria-controls":t?o:void 0,onClick:()=>(e=>{const n=M.includes(e)?M.filter(n=>n!==e):v?[...M,e]:[e];void 0===p&&j(n),b?.(n)})(i.id),className:`flex w-full items-center gap-2 text-left transition-colors duration-(--motion-fast) disabled:cursor-not-allowed disabled:opacity-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${N.head} ${N.press}`,children:[null!=i.icon&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${N.chev}`,children:i.icon}),
|
|
5
|
+
/* @__PURE__ */s("span",{className:`min-w-0 flex-1 ${N.title}`,children:i.title}),"number"==typeof i.count&&i.count>0&&
|
|
6
|
+
/* @__PURE__ */c(l,{children:[
|
|
7
|
+
/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */s(e,{count:i.count,tone:"accent"})}),
|
|
8
|
+
/* @__PURE__ */s("span",{className:"sr-only",children:y.accordion.changed(r(i.count,k))})]}),
|
|
9
|
+
/* @__PURE__ */s("span",{"data-fold-chevron":"","aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:/* @__PURE__ */s(n,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:`h-4 w-4 transition-transform duration-(--motion-base) motion-reduce:transition-none ${N.chev} ${t?"rotate-90":""}`})})]})}),t&&/* @__PURE__ */s("div",{id:o,role:"region","aria-labelledby":a,className:N.body,children:i.content})]},i.id)})})}function p({title:e,icon:n,tier:i="band",level:t=3,id:r,className:a=""}){const o=h[i],l=`h${t}`;/* @__PURE__ */
|
|
10
|
+
return s("div",{"data-accordion-heading":i,className:`@container/acc ${a}`.trim(),children:/* @__PURE__ */c(l,{id:r,className:`${u} flex items-center gap-2 ${o.head}`,children:[null!=n&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${o.chev}`,children:n}),
|
|
11
|
+
/* @__PURE__ */s("span",{className:`min-w-0 flex-1 ${o.title}`,children:e})]})})}function b({children:e,className:n=""}){/* @__PURE__ */
|
|
12
|
+
return s("div",{className:`@container/acc ${n}`.trim(),children:/* @__PURE__ */s("div",{"data-accordion-body":"",className:d,children:e})})}export{f as Accordion,b as AccordionBody,p as AccordionHeading,m as accordionIdOf};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{isSafeLinkHref as e}from"./chunk-PJPK2ADX.js";import{Button_default as t}from"./chunk-NHH2MXFU.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{useShellStrings as r}from"./chunk-QWHQJNKL.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
|
|
2
|
+
return a("a",{href:l,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",onClick:l&&r?e=>{(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&r(l)&&e.preventDefault()}:void 0,children:n})}function u(e){const t=[];let n,r=0,l=0;const s=new RegExp(c.source,"g");for(;null!==(n=s.exec(e));)n.index>r&&t.push(e.slice(r,n.index)),void 0!==n[1]?t.push(
|
|
3
|
+
/* @__PURE__ */i("span",{className:"text-gray-400",children:["[",n[1],"]"]},l++)):void 0!==n[3]?t.push(
|
|
4
|
+
/* @__PURE__ */a(d,{href:n[4],children:n[3]},l++)):void 0!==n[5]?t.push(
|
|
5
|
+
/* @__PURE__ */a("strong",{className:"font-semibold text-gray-900",children:u(n[5])},l++)):void 0!==n[6]?t.push(
|
|
6
|
+
/* @__PURE__ */a("code",{className:"rounded bg-gray-200 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",children:n[6]},l++)):void 0!==n[7]&&t.push(/* @__PURE__ */a("em",{children:u(n[7])},l++)),r=s.lastIndex;return r<e.length&&t.push(e.slice(r)),t}function m({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),l=r().markdown;/* @__PURE__ */
|
|
7
|
+
return i("div",{className:"my-1 flex items-start gap-2 rounded-lg border border-dashed border-line-strong bg-surface-sunken px-3 py-3 text-ink-faint",children:[
|
|
8
|
+
/* @__PURE__ */a(n,{name:"camera",look:"mini",className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),
|
|
9
|
+
/* @__PURE__ */i("span",{className:"text-xs",children:[
|
|
10
|
+
/* @__PURE__ */a("span",{className:"font-medium text-gray-600",children:`${l.screenshot} — `}),t]})]})}function h(e,t){const n=[];for(const r of e){const e=t.exec(r);e?n.push(e[1]):n.length&&(n[n.length-1]+=" "+r.trim())}return n}var p=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim());function f(e){return e.length>=2&&e[0].includes("|")&&/^\s*\|?[\s:|-]*-[\s:|-]*\|?\s*$/.test(e[1])&&e[1].includes("-")}function g(e){return e.replace(c,(e,t,n,r,l,s,a,i)=>t??r??s??a??i??"").trim()}function x({header:e,rows:t}){const n=e=>/[",\r\n]/.test(e)?`"${e.replace(/"/g,'""')}"`:e;return[e,...t].map(e=>e.map(n).join(",")).join("\r\n")}function b(e,r,l){const s=p(e[0]),c=e.slice(2).map(p),o=/* @__PURE__ */a("div",{className:"my-1 overflow-x-auto rounded-lg border border-gray-200",children:/* @__PURE__ */i("table",{className:"w-full border-collapse text-sm",children:[
|
|
11
|
+
/* @__PURE__ */a("thead",{children:/* @__PURE__ */a("tr",{className:"bg-gray-50",children:s.map((e,t)=>/* @__PURE__ */a("th",{className:"border-b border-line px-3 py-2 text-left font-semibold text-ink",children:u(e)},t))})}),
|
|
12
|
+
/* @__PURE__ */a("tbody",{children:c.map((e,t)=>/* @__PURE__ */a("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */a("td",{className:"border-t border-line-subtle px-3 h-8 align-top text-ink",children:u(e)},t))},t))})]})},r);return l?.length?/* @__PURE__ */i("div",{children:[o,
|
|
13
|
+
/* @__PURE__ */a("div",{className:"flex flex-wrap justify-end gap-1",children:l.map(e=>/* @__PURE__ */a(t,{size:"sm",variant:"secondary",leftIcon:e.icon?/* @__PURE__ */a(n,{name:e.icon,look:"mini",className:"h-4 w-4","aria-hidden":"true"}):void 0,onClick:()=>e.onSelect({header:s.map(g),rows:c.map(e=>e.map(g))}),children:e.label},e.label))})]},r):o}var y=/^( {0,3})(`{3,}|~{3,})[ \t]*(.*?)[ \t]*$/,v=/^[-*]\s+/,N=/^\d+\.\s+/,k=/^#{2,4}\s+/;function $(e){const t=e.split("\n"),n=[];let r=null;for(let e=0;e<t.length;e+=1){const l=t[e];let s=null;k.test(l)?s="heading":"table"!==r&&f(t.slice(e,e+2))?s="table":"bullet"!==r&&v.test(l)?s="bullet":"ordered"!==r&&N.test(l)&&("text"!==r||/^1\./.test(l))?s="ordered":"table"!==r||l.includes("|")?"heading"===r&&(s="text"):s="text",null!==s||null===r?(n.push([l]),r=s??"text"):n[n.length-1].push(l)}return n.map(e=>e.join("\n"))}function j(e){const t=e.replace(/\r\n/g,"\n").split("\n"),n=[];let r=[];const l=()=>{for(const e of r.join("\n").split(/\n{2,}/))for(const t of $(e.replace(/\s+$/,"")))""!==t.trim()&&n.push({text:t});r=[]};for(let e=0;e<t.length;e+=1){const s=y.exec(t[e]);if(!(null!==s&&!("`"===s[2][0]&&s[3].includes("`")))){r.push(t[e]);continue}l();const[,a,i,c]=s,o=[];let d=!1;for(e+=1;e<t.length;e+=1){const n=y.exec(t[e]);if(null!==n&&n[2][0]===i[0]&&n[2].length>=i.length&&""===n[3]){d=!0;break}o.push(a?t[e].replace(new RegExp(`^ {0,${a.length}}`),""):t[e])}n.push({fence:{lang:c.split(/[ \t]/)[0],code:o.join("\n"),closed:d}})}return l(),n}function w(e,t,n){if(n){let r=null;try{r=n(e)}catch{r=null}if(null!=r)/* @__PURE__ */return a("div",{children:r},t)}return function({lang:e,code:t},n){/* @__PURE__ */
|
|
14
|
+
return a("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */a("code",{children:t})},n)}(e,t)}function K({children:e,className:t,renderFence:n,tableActions:r,onLinkClick:l}){/* @__PURE__ */
|
|
15
|
+
return a(o.Provider,{value:l,children:/* @__PURE__ */a("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:j(e??"").map((e,t)=>"fence"in e?w(e.fence,t,n):function(e,t,n){const r=e.split("\n"),l=r[0],s=/^(#{2,4})\s+(.*)$/.exec(l);if(s&&1===r.length){const e=s[1].length;/* @__PURE__ */
|
|
16
|
+
return a(`h${e}`,{className:2===e?"mt-2 text-sm font-semibold uppercase tracking-wide text-ink-faint":3===e?"mt-1 text-base font-semibold text-gray-900":"mt-1 text-sm font-semibold text-gray-900",children:u(s[2])},t)}if(1===r.length&&/^---+$/.test(l))/* @__PURE__ */
|
|
17
|
+
return a("hr",{className:"border-gray-200"},t);if(f(r))return b(r,t,n);if(/^>\s?/.test(l)){const e=r.map(e=>e.replace(/^>\s?/,"")).join(" ");/* @__PURE__ */
|
|
18
|
+
return a("div",{className:"my-1 rounded-r-lg border-l-4 border-blue-300 bg-blue-50/60 px-3 py-2 text-gray-700",children:u(e)},t)}const i=/^!\[([^\]]*)\]\(([^)]+)\)$/.exec(l);if(i&&1===r.length)/* @__PURE__ */
|
|
19
|
+
return a(m,{alt:i[1]},t);if(/^[-*]\s+/.test(l)){const e=h(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
|
|
20
|
+
return a("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */a("li",{children:u(e)},t))},t)}const c=/^(\d+)\.\s+/.exec(l);if(c){const e=h(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
|
|
21
|
+
return a("ol",{start:Number(c[1]),className:"list-decimal space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */a("li",{className:"pl-1",children:u(e)},t))},t)}/* @__PURE__ */
|
|
22
|
+
return a("p",{children:u(r.join(" "))},t)}(e.text,t,r))})})}export{K as Markdown,g as plainCell,x as tableToCsv};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{AccessibleTable as t}from"./chunk-TBPHW42V.js";import{arcPath as e}from"./chunk-VFC6QUEN.js";import{useHighlight as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as n}from"./chunk-TLRCTNUF.js";import{CHART_INK as r,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as l,useShellLocale as i}from"./chunk-QWHQJNKL.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,N=i(),w=k??(t=>s(t,N)),j=M??$.noFlows,[y,F]=c(null),{highlighted:C}=o(),E=h(u,f,x,$.other),{labels:L,matrix:Q,otherIndex:T,foldedCount:z}=E,A=(t,e)=>Q[t]?.[e]??0,H=t=>t===T?r.muted:a(t),I=E.totals,W=L.map((t,e)=>e).sort((t,e)=>I[e]-I[t]),O=W.reduce((t,e)=>t+I[e],0);if(O<=0)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${v??""}`,children:j});const P=p/2,R=p/2,U=p/2-44,V=U-b,B=g*W.length,Y=/* @__PURE__ */new Map;let J=-Math.PI/2;W.forEach((t,e)=>{const o=I[t]/O*(2*Math.PI-B);Y.set(t,{start:J,end:J+o,slot:e}),J+=o+g});const K=/* @__PURE__ */new Map,S=[];for(const t of W)for(const e of W){const o=A(t,e);if(o<=0)continue;const n=Y.get(t),r=o/Math.max(1,I[t])*(n.end-n.start),a=K.get(t)??0;K.set(t,a+r),S.push({from:t,to:e,value:o,a:n.start+a+r/2,b:Y.get(e).start+(Y.get(e).end-Y.get(e).start)/2})}const Z=(t,e)=>[P+e*Math.cos(t),R+e*Math.sin(t)],q="arc"===y?.kind?y.index:void 0,D="ribbon"===y?.kind?S[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(W.length),onMouseLeave:()=>F(null),children:[S.map((t,e)=>{const[o,n]=Z(t.a,V),[r,a]=Z(t.b,V),l=H(t.from),i=((t,e)=>y?"ribbon"===y.kind?y.index===e:y.index===t.from||y.index===t.to:null!==C?L[t.from]===C||L[t.to]===C:null)(t,e);/* @__PURE__ */
|
|
4
|
+
return d("path",{d:`M${o},${n} Q${P},${R} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/O*p*.9),strokeOpacity:null===i||i?.34:.07,strokeLinecap:"round",onMouseEnter:()=>F({kind:"ribbon",index:e})},`${L[t.from]}→${L[t.to]}`)}),W.map(t=>{const o=Y.get(t),n=(o.start+o.end)/2,[a,l]=Z(n,U+16),i=(t=>y?"arc"===y.kind?y.index===t:S[y.index].from===t||S[y.index].to===t:null!==C?L[t]===C:null)(t);/* @__PURE__ */
|
|
5
|
+
return m("g",{onMouseEnter:()=>F({kind:"arc",index:t}),children:[
|
|
6
|
+
/* @__PURE__ */d("path",{d:e(P,R,V,U,o.start,o.end),fill:H(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:L[t]})]},t)})]}),z>0&&/* @__PURE__ */d("p",{className:"mt-1 text-xs text-ink-faint",children:$.chordFolded(z)}),void 0!==q&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:L[q],rows:[{key:"total",label:$.totalFlow,color:H(q),value:w(I[q])}]})}),D&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:`${L[D.from]} → ${L[D.to]}`,rows:[{key:"value",label:$.flow,color:H(D.from),value:w(D.value)}]})}),
|
|
8
|
+
/* @__PURE__ */d(t,{caption:$.chord(W.length),head:[$.tableFrom,$.tableTo,$.value],rows:S.map(t=>[L[t.from],L[t.to],w(t.value)])})]})}export{u as ChordChart,h as foldChord};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useInsideTooltip as e,Tooltip as n}from"./chunk-
|
|
1
|
+
import{useInsideTooltip as e,Tooltip as n}from"./chunk-BCDG4N6L.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{optionMatches as e,OptionSublabel as t}from"./chunk-5F7HMNCX.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-LNARMEEZ.js";import{Tooltip as r}from"./chunk-BCDG4N6L.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-DTJRIWFR.js";import{useShellStrings as d}from"./chunk-QWHQJNKL.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:k=[],placeholder:N,allowFreeText:j=!1,invalid:C,disabled:L,id:D,className:E="",tone:W,tooltip:M,split:$}){const[B,F]=m(!1),[H,J]=m(""),G=d(),I=h(null),R=h(null),S=h(null),T=s(I,B),Y=e=>k.find(t=>t.value===e)?.label??e,A=p(()=>{const t=new Set(o),n=[],r=H.trim().toLowerCase();for(const o of k)t.has(o.value)||(t.add(o.value),r&&!e(o,r)||n.push(o));return n},[k,o,H]),K=e=>{const t=[...o];for(const n of e){const e=n.trim();if(!e)continue;const o=e.toLowerCase(),r=k.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)},Q=e=>{e&&!o.includes(e)?(y([...o,e]),J("")):J("")},Z=e=>y(o.filter(t=>t!==e)),z=()=>{const e=H.trim();if($&&e)return K(e.split($)),void J("");j&&e?Q(e):J("")},P=h(()=>{});P.current=()=>{z(),F(!1)},f(()=>{if(!B)return;const e=e=>{const t=e.target;I.current?.contains(t)||S.current?.contains(t)||(z(),F(!1))};document.addEventListener("mousedown",e);const t=l(()=>P.current());return()=>{document.removeEventListener("mousedown",e),t()}});const U=k.length>0;/* @__PURE__ */
|
|
2
|
+
return g("div",{ref:I,className:"relative",children:[
|
|
3
|
+
/* @__PURE__ */g("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),R.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)] ${L?"bg-gray-50 cursor-not-allowed":""} ${E}`}),children:[o.map(e=>{const t=W?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
+
/* @__PURE__ */x("span",{className:"truncate",children:Y(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":G.select.removeItem?.(Y(e))??`${G.select.remove} ${Y(e)}`,onClick:()=>Z(e),className:n.remove,children:"×"})]},e),l=M?.(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:D,ref:R,type:"text",autoComplete:"off",role:"combobox","aria-expanded":B&&U,"aria-invalid":C||void 0,disabled:L,value:H,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if($){const t=e.split($);if(t.length>1)return K(t.slice(0,-1)),void J(t[t.length-1])}J(e)})(e.target.value),F(!0)},onFocus:()=>{!L&&U&&F(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=H.trim(),o=n?A.filter(t=>e(t,n.toLowerCase())):[];1===o.length?Q(o[0].value):z()}else"Backspace"===t.key&&""===H&&o.length>0?Z(o[o.length-1]):"Escape"===t.key?(F(!1),J(""),R.current?.blur()):"Tab"===t.key&&(z(),F(!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"})]}),B&&U&&v(
|
|
6
|
+
/* @__PURE__ */x("div",{ref:S,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:T?.left,right:T?.right,top:T?.top,bottom:T?.bottom,minWidth:T?.minWidth,maxWidth:T?.maxWidth??a,width:"max-content",visibility:T?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:T?.maxHeight??c},children:0===A.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?G.select.allSelected:G.select.noMatches}):A.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),Q(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,5 +1,5 @@
|
|
|
1
|
-
import{ChartTooltip as t}from"./chunk-
|
|
2
|
-
return i(a,{labels:c.map(t=>t.label),values:
|
|
1
|
+
import{ChartTooltip as t}from"./chunk-TLRCTNUF.js";import{CartesianPlot as a}from"./chunk-AC373WIU.js";import{CHART_INK as e,STATUS_VARS as l}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-QWHQJNKL.js";import{formatPlain as n}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as s}from"react/jsx-runtime";function c({steps:c,height:u=240,width:m,formatValue:h,yAxisLabel:f,className:p,emptyLabel:d,radius:b=3,connectors:g=!0}){const v=o().charts,x=r(),y=h??(t=>n(t,x));let k=0;const M=c.map(t=>{if(t.total){const a={from:0,to:k,value:k,total:!0};return{...t,...a}}const a=k;return k+=t.value,{...t,from:a,to:k,value:t.value,total:!1}}),L=M.flatMap(t=>[t.from,t.to]);/* @__PURE__ */
|
|
2
|
+
return i(a,{labels:c.map(t=>t.label),values:L,height:u,width:m,formatValue:y,yAxisLabel:f,className:p,emptyLabel:d,bandPadding:.36,ariaLabel:v.waterfall(c.length,y(M[0]?.from??0),y(k)),tooltip:a=>{const e=M[a],o=e?.total?l.neutral:e.value>=0?l.good:l.critical;/* @__PURE__ */
|
|
3
3
|
return i(t,{title:e?.label,rows:[{key:"step",color:o,label:e?.total?v.balance:e.value>=0?v.increase:v.decrease,value:e?.total?y(e.to):`${e.value>=0?"+":"−"}${y(Math.abs(e.value))}`},...e?.total?[]:[{key:"running",label:v.runningTotal,color:l.neutral,value:y(e.to)}]]})},children:({x:t,y:a,active:o})=>/* @__PURE__ */s("g",{children:[g&&M.slice(0,-1).map((l,o)=>
|
|
4
4
|
/* @__PURE__ */i("line",{x1:t.end(o),y1:a(l.to),x2:t(o+1),y2:a(l.to),stroke:e.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${o}`)),M.map((e,r)=>{const n=e.total?l.neutral:e.value>=0?l.good:l.critical,s=Math.min(a(e.from),a(e.to)),c=Math.max(1,Math.abs(a(e.to)-a(e.from)));/* @__PURE__ */
|
|
5
5
|
return i("rect",{x:t(r),y:s,width:Math.max(1,t.bandwidth),height:c,rx:b,fill:n,fillOpacity:null===o||o===r?1:.45},r)})]})})}export{c as WaterfallChart};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{inputClasses as e}from"./chunk-
|
|
1
|
+
import{inputClasses as e}from"./chunk-AYZY3YNC.js";import{useShellLocale as t}from"./chunk-QWHQJNKL.js";import{forwardRef as n}from"react";import{jsx as r}from"react/jsx-runtime";var a=/^\d{2}:\d{2}(:\d{2})?$/,i=e=>String(e).padStart(2,"0");function s(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const n=`${i(e.getHours())}:${i(e.getMinutes())}`;return t?`${n}:${i(e.getSeconds())}`:n}return a.test(e)?e:""}var u=n(function({value:n,onChange:i,min:u,max:o,invalid:m,size:l,className:c="",step:v,...d},f){const g=null!=v&&Number(v)<60,p=t();/* @__PURE__ */
|
|
2
2
|
return r("input",{ref:f,type:"time",lang:p,step:v,"aria-invalid":m||void 0,value:s(n,g),min:s(u,g)||void 0,max:s(o,g)||void 0,onChange:e=>i?.(a.test(e.target.value)?e.target.value:null),className:e({invalid:m,size:l,className:c}),...d})});export{u as TimePicker_default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{inputClasses as e}from"./chunk-
|
|
1
|
+
import{inputClasses as e}from"./chunk-AYZY3YNC.js";import{forwardRef as r,useCallback as t}from"react";import{jsx as i}from"react/jsx-runtime";var a=r(function({invalid:r,autoGrow:a,className:n="",onInput:o,rows:s=3,size:l,readOnly:m,...c},u){const d=t(e=>{if(a){const r=e.currentTarget;r.style.height="auto",r.style.height=`${r.scrollHeight}px`}o?.(e)},[a,o]);/* @__PURE__ */
|
|
2
2
|
return i("textarea",{ref:u,"aria-invalid":r||void 0,rows:s,onInput:d,readOnly:m,className:e({invalid:r,size:l,readOnly:m,multiline:!0,className:`${a?"resize-none overflow-hidden":""} ${n}`.trim()}),...c})});export{a as Textarea_default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-BVTNGW5S.js";import{IconButton_default as a}from"./chunk-RUTUVS4H.js";import{Icon as o}from"./chunk-FSPFV4MI.js";import{Tooltip as n}from"./chunk-BCDG4N6L.js";import{useShellStrings as s}from"./chunk-QWHQJNKL.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s}){const i=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),t=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);return{words:i>0,paragraph:t>0,oneRow:i>0&&t>0&&i+1+t<=9,flow:i>0&&t>0&&i+1+t>9&&i<=7,cells:{words:i,paragraph:t}}}function w(e,l){/* @__PURE__ */
|
|
2
|
+
return i(n,{content:e,children:l},l.key??void 0)}function g({offered:n,pressed:h,onMark:g,color:f,linkOpen:k=!1,last:v,alignment:N,list:C,letterCase:D,disabled:M=!1,"aria-label":x,windows:y,className:S="",layout:j="grid"}){const B=s().textToolbar,L=m({offered:n,color:f,last:v,alignment:N,list:C,letterCase:D});if(!L.words&&!L.paragraph)return null;const q=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,A=(e,l,r,o)=>n.has(e)?w(l,/* @__PURE__ */i(a,"link"===e?{pressed:k,className:q(k),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":k,"aria-keyshortcuts":o,disabled:M,onMouseDown:c,onClick:()=>g(e),children:r}:{className:q(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:M,onMouseDown:c,onClick:()=>g(e),children:r},e)):null,I=l(B),R=e.map(e=>[e,I[e],r(e)]),T=N?e.filter(e=>N.allow.includes(e)):[],U=N&&T.includes(N.value)?N.value:T[0],$=[["none",B.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",B.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",B.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],K=/* @__PURE__ */t(d,{children:[A("bold",B.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),A("italic",B.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),A("underline",B.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),A("strike",B.strike,/* @__PURE__ */i(o,{name:"strike"})),f?w(B.color,/* @__PURE__ */i(a,{pressed:f.open,className:q(f.open,"rosh-tb-color"),"aria-label":B.color,"aria-haspopup":"dialog","aria-expanded":f.open,disabled:M,style:f.run?{"--rosh-tb-run":f.run}:void 0,onMouseDown:c,onClick:f.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,A("link",B.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),A("sup",B.sup,/* @__PURE__ */i(o,{name:"superscript"})),A("sub",B.sub,/* @__PURE__ */i(o,{name:"subscript"})),A("code",B.code,/* @__PURE__ */i(o,{name:"code"})),u(v)?v:null]}),H=/* @__PURE__ */t(d,{children:[N&&T.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":B.alignment,onKeyDown:e=>p(e,T,e=>N.onChange(e)),children:R.map(([e,l,r])=>N.allow.includes(e)?w(l,/* @__PURE__ */i(a,{role:"radio",pressed:N.value===e,className:q(N.value===e),"aria-checked":N.value===e,"aria-label":l,tabIndex:e===U?0:-1,disabled:M||N.disabled,onMouseDown:c,onClick:()=>N.onChange(e),children:r},e)):null)}):null,C&&n.has("bullet")?w(B.bullet,/* @__PURE__ */i(a,{className:q("bullet"===C.pressed),"aria-label":B.bullet,"aria-pressed":"bullet"===C.pressed,disabled:M,onMouseDown:c,onClick:()=>C.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,C&&n.has("number")?w(B.number,/* @__PURE__ */i(a,{className:q("number"===C.pressed),"aria-label":B.number,"aria-pressed":"number"===C.pressed,disabled:M,onMouseDown:c,onClick:()=>C.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,A("quote",B.quote,/* @__PURE__ */i(o,{name:"quote"})),D?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":B.letterCase,onKeyDown:e=>p(e,$.map(([e])=>e),e=>D.onChange(e)),children:$.map(([e,l,r])=>w(l,/* @__PURE__ */i(a,{role:"radio",pressed:D.value===e,className:q(D.value===e),"aria-checked":D.value===e,"aria-label":l,tabIndex:e===(D.value||"none")?0:-1,disabled:M||D.disabled,onMouseDown:c,onClick:()=>D.onChange(D.value===e?"":e),children:r},e)))}):null]}),V="row"===j,F=V?" is-row":L.flow?" is-flow":L.oneRow?" is-one-row":L.words&&void 0===v?" is-eight":"",G=b(n,Boolean(f)),Q={"--rosh-tb-color-col":String(G.color),"--rosh-tb-link-col":String(G.link),...V?{"--rosh-tb-cells":String(L.cells.words+L.cells.paragraph),"--rosh-tb-groupgap":L.words&&L.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let W;return W=V?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[L.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:K}):null,L.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:H}):null]}):L.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[K,
|
|
3
|
+
/* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),H]}):L.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
|
|
4
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-words",children:K}),
|
|
5
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-para",children:H})]}):/* @__PURE__ */t(d,{children:[L.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===v?" is-eight":""),children:K}):null,L.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:H}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${F} ${S}`.trim(),style:Q,children:[
|
|
6
|
+
/* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":x??B.formatting,children:W}),y]})}export{g as TextToolbar,m as textToolbarRows,b as textToolbarWindowColumns};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Tooltip as n}from"./chunk-BCDG4N6L.js";import{useShellStrings as r,useShellLocale as e}from"./chunk-QWHQJNKL.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as o}from"react/jsx-runtime";var a=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-md px-1","text-2xs font-medium normal-case leading-none tabular-nums tracking-normal","ring-1 ring-inset ring-[color:color-mix(in_srgb,currentColor_20%,transparent)]"].join(" ");function s({count:s,label:c,active:l=!1,showZero:m=!1,className:u=""}){const d=r().count,h=e();if(!(s>0||0===s&&m))return null;const f=c??d.items(s);/* @__PURE__ */
|
|
2
|
+
return i(n,{content:f,describe:!1,className:`relative inline-flex shrink-0 ${u}`.trim(),children:/* @__PURE__ */o("span",{"data-item-count":"",className:`${a} ${l?"bg-blue-100 text-blue-700":"bg-[color:color-mix(in_srgb,var(--ink-faint)_14%,transparent)] text-gray-600"}`,children:[
|
|
3
|
+
/* @__PURE__ */i("span",{"aria-hidden":"true",children:t(s,h)}),
|
|
4
|
+
/* @__PURE__ */i("span",{className:"sr-only",children:f})]})})}export{s as ItemCount};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-PVR4KU7H.js";import{Button_default as i}from"./chunk-NHH2MXFU.js";import{iconButtonClasses as n}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{Tooltip as a}from"./chunk-BCDG4N6L.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:N=!1,disabledReason:g,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:C,menuFooterLabel:F,align:z="end",side:L="bottom",menuMinWidth:M,linkAs:R,block:W=!1,className:D=""},H){const I=N&&(null!=g&&""!==g&&!1!==g)&&!v,P=x&&null!=j&&""!==j&&!1!==j,U=o(),$=/* @__PURE__ */t(i,{ref:H,type:b,variant:f,size:p,loading:v,leftIcon:k,block:W,disabled:N&&!I,"aria-disabled":!!I||void 0,disabledReason:I?g:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),A=W?"relative flex min-w-0 flex-1":"relative inline-flex",B=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
2
|
+
return s("div",{className:[W?"flex w-full":"inline-flex","items-stretch",D].filter(Boolean).join(" "),children:[null==w||""===w||I?$:/* @__PURE__ */t(a,{content:w,className:A,children:$}),
|
|
3
|
+
/* @__PURE__ */t(a,{content:P?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":P?U:void 0,items:h,align:z,side:L,minWidth:M,linkAs:R,disabled:x&&!P,"aria-disabled":P,onOpenChange:y,footer:C,footerLabel:F,triggerClassName:n({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(r,{name:"chevron-down",className:B,strokeWidth:2,"aria-hidden":"true"})})}),P&&/* @__PURE__ */t("span",{id:U,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-
|
|
2
|
-
return y("div",{ref:R,className:`relative inline-flex ${
|
|
3
|
-
/* @__PURE__ */x("button",{ref:z,id:_,type:"button","aria-haspopup":"menu","aria-expanded":
|
|
4
|
-
/* @__PURE__ */x(i,{portal:!0,className:
|
|
5
|
-
/* @__PURE__ */x("div",{ref:F,id:
|
|
1
|
+
import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-XS4HFUTW.js";import{useTabLayer as n,focusableIn as o}from"./chunk-CDAJKLGL.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-FPGRKHUW.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:W="end",side:j="bottom","aria-label":K,className:S="",triggerClassName:A,menuClassName:C="",minWidth:E=180,linkAs:H,disabled:U,id:$,"aria-describedby":N,"aria-disabled":T=!1,onOpenChange:B,footer:G,footerLabel:I}){const[J,q]=m(!1),[M,P]=m(-1),R=h(null),z=h(null),F=h(null),O=h(null),Q=h(null),V=null!=G&&!1!==G,X=h({text:"",at:0}),Y=g(),Z=g(),_=$??Z,ee=h(B);ee.current=B;const te=h(J);te.current=J;const re=v(e=>{q(!1),te.current&&(te.current=!1,ee.current?.(!1)),e&&z.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=()=>F.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!J)return;const e=e=>{const t=e.target;if(R.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()}},[J,re]);const ie=v(()=>{const e=oe(),t=z.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:W,side:j});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=W},[W,j]);p(()=>{J&&ie()}),b(()=>{if(J)return u(()=>z.current,ie)},[J,ie]),b(()=>{if(!J)return;const t=F.current,r=e(L[M])?t?.querySelector(`[data-dropdown-index="${M}"]`):null;(r??t)?.focus({preventScroll:!0})},[J,M]),b(()=>{if(J)return f(e=>"Escape"===e.key&&(re(!0),!0),()=>O.current)},[J,re]),n(O,J&&V);const ae=h(null),le=e=>"first"===e?ne(0,1):ne(L.length-1,-1),se=e=>{P(le(e)),q(!0),te.current||(te.current=!0,ae.current=e,B?.(!0))};p(()=>{const e=ae.current;if(!J||!e)return;ae.current=null;const t=le(e);t!==M&&P(t)});const de=t(L,Y),ce="function"==typeof G?G({close:()=>re(!0)}):G,ue={...k.test(C)?{}:{zIndex:s.popup},minWidth:E};/* @__PURE__ */
|
|
2
|
+
return y("div",{ref:R,className:`relative inline-flex ${S}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */x("button",{ref:z,id:_,type:"button","aria-haspopup":"menu","aria-expanded":J,"aria-controls":J?Y:void 0,"aria-label":K,"aria-describedby":N,"aria-disabled":T||void 0,disabled:U,onClick:()=>{T||(J?re(!1):se("first"))},onKeyDown:e=>{T||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),se("first")):"ArrowUp"===e.key&&(e.preventDefault(),se("last")))},className:A??"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 "+(K?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:D}),J&&
|
|
4
|
+
/* @__PURE__ */x(i,{portal:!0,className:C,style:ue,children:/* @__PURE__ */y("div",{ref:O,children:[
|
|
5
|
+
/* @__PURE__ */x("div",{ref:F,id:Y,role:"menu","aria-orientation":"vertical","aria-label":K,"aria-labelledby":K?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-X.current.at<500?X.current.text+n:n;X.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=F.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:Y,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:H})}),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=F.current?.querySelector(`[data-dropdown-index="${M}"]`);return void(t??F.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};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{TH_ONE_LINE as t}from"./chunk-
|
|
2
|
-
return h("div",{...n,dangerouslySetInnerHTML:r})}function
|
|
1
|
+
import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{TH_ONE_LINE as t}from"./chunk-OZAAIE4E.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-QWHQJNKL.js";import{useRef as o,useState as l,useEffect as c,useCallback as a,useMemo as s}from"react";import{createPortal as i}from"react-dom";import{jsxs as u,jsx as h,Fragment as d}from"react/jsx-runtime";function w(e,t){const n=e[e.length-1];return n&&!n.some(e=>e.trim())?e:[...e,Array(t).fill("")]}function m({text:t,...n}){const r=s(()=>({__html:e(t)}),[t]);/* @__PURE__ */
|
|
2
|
+
return h("div",{...n,dangerouslySetInnerHTML:r})}function g({columns:e,data:g,onChange:f,onColumnsChange:p,fixedRows:b=!1,minRows:y=15,maxHeight:v="260px",cellStyles:x,onFocusChange:M,onSelectionChange:D}){const k=o(null),C=r().grid,[E,L]=l(null);c(()=>{M?.(E)},[E,M]);const[$,S]=l({}),A=o(null),[N,z]=l({}),O=o(null),[K,T]=l(null),[R,P]=l(null),[F,H]=l(null),[I,j]=l(null),[X,Y]=l(null),W=o(null);n(()=>{const e=W.current;if(!e||e.row!==X?.row||e.col!==X?.col)return;W.current=null;const t=k.current?.querySelector(`[data-row="${e.row}"][data-col="${e.col}"]`);if(!t)return;t.focus();const n=document.createRange();n.selectNodeContents(t),n.collapse(!1);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)},[X]);const[q,B]=l(null),[J,Q]=l(null);c(()=>{D?.(q&&J?{anchor:q,end:J}:null)},[q,J,D]);const _=o(!1),[G,U]=l(null),V=o(!1),Z=o({a:null,e:null});Z.current={a:q,e:J};const ee=q&&J&&(q.row!==J.row||q.col!==J.col),te=[...g];if(!b)for(;te.length<y;)te.push(Array(e.length).fill(""));const ne=a((t,n,r)=>{const o=te.map(e=>[...e]);for(;o.length<=t;)o.push(Array(e.length).fill(""));for(;o[t].length<e.length;)o[t].push("");o[t][n]=r,f(o)},[te,e.length,f]),re=a((e,t,n)=>{if(0!==e.button)return;const r=document.activeElement;if(r?.dataset?.row&&r?.dataset?.col){const e=parseInt(r.dataset.row),t=parseInt(r.dataset.col),n=r.textContent||"";if(n!==(te[e]?.[t]||"")){const r=te.map(e=>[...e]);r[e]&&(r[e][t]=n,f(r))}}_.current=!0,e.shiftKey&&q||B({row:t,col:n}),Q({row:t,col:n})},[te,f,q]),oe=a((e,t)=>{_.current&&Q({row:e,col:t})},[]);c(()=>{const e=()=>{_.current=!1};return window.addEventListener("mouseup",e),()=>window.removeEventListener("mouseup",e)},[]),c(()=>{const e=e=>{if(!e.ctrlKey&&!e.metaKey||"c"!==e.key)return;if(!q||!J)return;const t=window.getSelection();if(t&&t.toString().length>0&&!ee)return;const n=Math.min(q.row,J.row),r=Math.max(q.row,J.row),o=Math.min(q.col,J.col),l=Math.max(q.col,J.col),c=[];for(let e=n;e<=r;e++){const t=[];for(let n=o;n<=l;n++)t.push(te[e]?.[n]||"");c.push(t.join("\t"))}const a=c.join("\n");a&&(e.preventDefault(),navigator.clipboard.writeText(a))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[q,J,te,ee]),c(()=>{const t=t=>{if(!E)return;const n=document.activeElement;if(n?.isContentEditable)return;if(!k.current?.contains(n))return;const r=t.clipboardData?.getData("text/plain");if(!r)return;t.preventDefault();const o=r.split("\n").filter(e=>e).map(e=>e.split("\t")),l=te.map(e=>[...e]);for(let t=0;t<o.length;t++){const n=E.row+t;for(;l.length<=n;)l.push(Array(e.length).fill(""));for(;l[n].length<e.length;)l[n].push("");for(let r=0;r<o[t].length;r++){const c=E.col+r;if(c>=e.length)break;e[c].readOnly||(l[n][c]=o[t][r].trim())}}f(b?l:w(l,e.length)),B({row:E.row,col:E.col}),Q({row:Math.min(E.row+o.length-1,l.length-1),col:Math.min(E.col+(o[0]?.length||1)-1,e.length-1)})};return window.addEventListener("paste",t),()=>window.removeEventListener("paste",t)},[E,te,e,f,b]);const le=a((t,n,r)=>{const o=t.clipboardData.getData("text/plain");if(!o)return;const l=o.split("\n").map(e=>e.split("\t"));if(l.length<=1&&l[0]?.length<=1)return;t.preventDefault();const c=te.map(e=>[...e]);for(let t=0;t<l.length;t++){const o=n+t;for(;c.length<=o;)c.push(Array(e.length).fill(""));for(;c[o].length<e.length;)c[o].push("");for(let n=0;n<l[t].length;n++){const a=r+n;if(a>=e.length)break;e[a].readOnly||(c[o][a]=l[t][n].trim())}}f(b?c:w(c,e.length))},[te,e,f,b]),ce=a((t,n,r)=>{let o=n,l=r;if("Tab"===t.key)t.preventDefault(),l=t.shiftKey?r-1:r+1,l>=e.length&&(l=0,o=n+1),l<0&&(l=e.length-1,o=n-1);else if("Enter"===t.key)t.preventDefault(),o=t.shiftKey?n-1:n+1;else if("ArrowDown"===t.key)t.preventDefault(),o=n+1;else if("ArrowUp"===t.key)t.preventDefault(),o=n-1;else if("ArrowLeft"===t.key)t.preventDefault(),l=r-1;else{if("ArrowRight"!==t.key){if("Delete"===t.key||"Backspace"===t.key){const o=t.target;if(o.isContentEditable)return void(o.textContent&&window.getSelection()?.toString()===o.textContent&&(t.preventDefault(),ne(n,r,"")));if(t.preventDefault(),q&&J){const t=Math.min(q.row,J.row),n=Math.max(q.row,J.row),r=Math.min(q.col,J.col),o=Math.max(q.col,J.col),l=te.map(e=>[...e]);for(let c=t;c<=n;c++)for(let t=r;t<=o;t++)l[c]&&!e[t]?.readOnly&&(l[c][t]="");f(l)}else ne(n,r,"");return}return}t.preventDefault(),l=r+1}for(;l>=0&&l<e.length&&e[l].readOnly;)l+="Tab"===t.key&&t.shiftKey?-1:1;if(o>=0&&o<te.length&&l>=0&&l<e.length){const e=k.current?.querySelector(`[data-row="${o}"][data-col="${l}"]`);e&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}),L({row:o,col:l}),Y(null),B({row:o,col:l}),Q({row:o,col:l}))}},[e,te,te.length,ne,q,J,f]),ae=a(t=>{if(!b&&t>=te.length-2){const t=te.map(e=>[...e]);for(let n=0;n<5;n++)t.push(Array(e.length).fill(""));f(t)}},[b,te,e.length,f]),[se,ie]=l(null);c(()=>{if(!se)return;const e=()=>ie(null);return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[se]);const ue=a(t=>{const n=te.map(e=>[...e]);n.splice(t,0,Array(e.length).fill("")),f(n)},[te,e.length,f]),he=a(e=>{if(te.length<=1)return;const t=te.filter((t,n)=>n!==e);f(t)},[te,f]),de=a(e=>{const t=te.map(t=>{const n=[...t];return n.splice(e,0,""),n});f(t)},[te,f]),we=a(t=>{if(e.length<=1)return;const n=te.map(e=>{const n=[...e];return n.splice(t,1),n});f(n)},[te,e.length,f]),me=a((e,t)=>{e.preventDefault(),b||ie({x:e.clientX,y:e.clientY,items:[{label:C.insertRowAbove,onClick:()=>{ue(t),ie(null)}},{label:C.insertRowBelow,onClick:()=>{ue(t+1),ie(null)}},{label:C.deleteRow(t+1),onClick:()=>{he(t),ie(null)}}]})},[b,ue,he,C]),ge=a((t,n)=>{t.preventDefault(),b||ie({x:t.clientX,y:t.clientY,items:[{label:C.insertColumnLeft,onClick:()=>{de(n),ie(null)}},{label:C.insertColumnRight,onClick:()=>{de(n+1),ie(null)}},{label:C.deleteColumn(String(e[n]?.title||n+1)),onClick:()=>{we(n),ie(null)}}]})},[b,e,de,we,C]),fe=t=>$[t]??e[t]?.width??150;c(()=>{const t=e=>{if(!A.current)return;const t=e.clientX-A.current.startX,n=Math.max(40,A.current.startW+t);S(e=>({...e,[A.current.col]:n}))},n=()=>{if(A.current&&p){const t=e.map((e,t)=>({...e,width:$[t]??e.width}));t[A.current.col]={...t[A.current.col],width:$[A.current.col]??e[A.current.col].width},p(t)}A.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",t),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)}},[e,$,p]);const pe=e=>N[e]??28;c(()=>{const e=e=>{if(!O.current)return;const t=e.clientY-O.current.startY,n=Math.max(20,O.current.startH+t);z(e=>({...e,[O.current.row]:n}))},t=()=>{O.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[]);const be=a(t=>{const n=document.createElement("canvas").getContext("2d");if(!n)return;n.font="12px ui-monospace, SFMono-Regular, Menlo, monospace";let r=0;for(const e of te){const o=String(e[t]??"").replace(/<[^>]*>/g,""),l=n.measureText(o).width;l>r&&(r=l)}const o=n.measureText(e[t]?.title??"").width;o>r&&(r=o);const l=Math.max(40,Math.ceil(r+24));if(S(e=>({...e,[t]:l})),p){const n=e.map((e,n)=>({...e,width:n===t?l:$[n]??e.width}));p(n)}},[te,e,$,p]),ye=a(e=>{z(t=>{const n={...t};return delete n[e],n})},[]),ve=a(t=>{const{a:n,e:r}=Z.current;if(!n||!r)return;const o=Math.min(n.row,r.row),l=Math.max(n.row,r.row),c=Math.min(n.col,r.col),a=Math.max(n.col,r.col);let s=o,i=l,u=c,h=a;t.row>l?i=t.row:t.row<o&&(s=t.row),t.col>a?h=t.col:t.col<c&&(u=t.col);const d=l-o+1,w=a-c+1,m=te.map(e=>[...e]);for(;m.length<=i;)m.push(Array(e.length).fill(""));for(const e of m)for(;e.length<=h;)e.push("");function g(e){const t=e.map(e=>parseFloat(e));if(t.length<2||t.some(e=>Number.isNaN(e)))return null;const n=t[1]-t[0];for(let e=2;e<t.length;e++)if(Math.abs(t[e]-t[e-1]-n)>1e-9)return null;return{step:n}}for(let e=s;e<=i;e++)for(let t=u;t<=h;t++){if(e>=o&&e<=l&&t>=c&&t<=a)continue;let n;if(1===w&&u===c&&h===a){const r=g(Array.from({length:d},(e,n)=>m[o+n]?.[t]??""));if(r){const c=parseFloat(m[l]?.[t]??"0"),a=parseFloat(m[o]?.[t]??"0"),s=e>l?e-l:-(o-e);n=String((e>l?c:a)+r.step*s)}else{const r=((e-o)%d+d)%d;n=m[o+r]?.[t]??""}}else if(1===d&&s===o&&i===l){const r=g(Array.from({length:w},(t,n)=>m[e]?.[c+n]??""));if(r){const o=parseFloat(m[e]?.[a]??"0"),l=parseFloat(m[e]?.[c]??"0"),s=t>a?t-a:-(c-t);n=String((t>a?o:l)+r.step*s)}else{const r=((t-c)%w+w)%w;n=m[e]?.[c+r]??""}}else{const r=((e-o)%d+d)%d,l=((t-c)%w+w)%w;n=m[o+r]?.[c+l]??""}m[e][t]=n}f(m),B({row:s,col:u}),Q({row:i,col:h})},[te,e.length,f]);c(()=>{const e=e=>{if(!V.current)return;const t=document.elementFromPoint(e.clientX,e.clientY),n=t?.closest?.("[data-row][data-col]");if(!n)return;const r=parseInt(n.dataset.row),o=parseInt(n.dataset.col);U({row:r,col:o})},t=()=>{V.current&&G&&ve(G),V.current=!1,U(null),document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[G,ve]);const xe=e=>{e.preventDefault(),e.stopPropagation(),V.current=!0,document.body.style.cursor="crosshair"},Me=o(null),[De,ke]=l(0),[Ce,Ee]=l(800);c(()=>{const e=Me.current;if(!e)return;const t=()=>Ee(e.clientHeight||800);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const Le=te.length>100,$e=Le?Math.max(0,Math.floor(De/28)-20):0,Se=Le?Math.min(te.length,Math.ceil((De+Ce)/28)+20):te.length,Ae=s(()=>te.slice($e,Se),[te,$e,Se]),Ne=28*$e,ze=28*(te.length-Se),Oe="px-2 h-8 text-left text-xs font-medium text-ink-faint uppercase bg-gray-100 border-b border-r border-line select-none";/* @__PURE__ */
|
|
3
3
|
return u("div",{ref:Me,className:"border border-gray-300 rounded overflow-scroll grid-scroll",style:{maxHeight:v,height:v},onScroll:e=>ke(e.target.scrollTop),children:[
|
|
4
|
-
/* @__PURE__ */u("table",{ref:k,className:"border-collapse select-none",style:{tableLayout:"fixed",minWidth:36+e.reduce((t,n)=>t+
|
|
4
|
+
/* @__PURE__ */u("table",{ref:k,className:"border-collapse select-none",style:{tableLayout:"fixed",minWidth:36+e.reduce((t,n)=>t+fe(e.indexOf(n)),0)},children:[
|
|
5
5
|
/* @__PURE__ */u("colgroup",{children:[
|
|
6
|
-
/* @__PURE__ */h("col",{style:{width:36}}),e.map((e,t)=>/* @__PURE__ */h("col",{style:{width:
|
|
6
|
+
/* @__PURE__ */h("col",{style:{width:36}}),e.map((e,t)=>/* @__PURE__ */h("col",{style:{width:fe(t)}},e.key))]}),
|
|
7
7
|
/* @__PURE__ */h("thead",{className:"sticky top-0 z-10",children:/* @__PURE__ */u("tr",{children:[
|
|
8
|
-
/* @__PURE__ */h("th",{className:`${t} ${Oe} text-center w-9 cursor-pointer hover:bg-gray-200`,onClick:()=>{B({row:0,col:0}),
|
|
9
|
-
return u("th",{className:`${t} ${Oe} cursor-pointer hover:bg-gray-200 relative${o?" !bg-blue-200":""}${I===r?" !bg-blue-100":""}`,style:{width:
|
|
10
|
-
/* @__PURE__ */h("div",{className:"absolute -right-1 top-0 bottom-0 w-2 cursor-col-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),
|
|
11
|
-
/* @__PURE__ */u("tbody",{children:[Ne>0&&/* @__PURE__ */h("tr",{style:{height:Ne}}),
|
|
12
|
-
return u("tr",{style:{height:
|
|
13
|
-
/* @__PURE__ */u("td",{className:`relative px-1 py-1 text-center text-2xs text-
|
|
14
|
-
/* @__PURE__ */h("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),O.current={row:t,startY:e.clientY,startH:
|
|
8
|
+
/* @__PURE__ */h("th",{className:`${t} ${Oe} text-center w-9 cursor-pointer hover:bg-gray-200`,onClick:()=>{B({row:0,col:0}),Q({row:te.length-1,col:e.length-1})},title:C.selectAll,children:"#"}),e.map((n,r)=>{const o=q&&J&&Math.min(q.col,J.col)<=r&&r<=Math.max(q.col,J.col)&&0===Math.min(q.row,J.row)&&Math.max(q.row,J.row)===te.length-1;/* @__PURE__ */
|
|
9
|
+
return u("th",{className:`${t} ${Oe} cursor-pointer hover:bg-gray-200 relative${o?" !bg-blue-200":""}${I===r?" !bg-blue-100":""}`,style:{width:fe(r)},draggable:!0,onDragStart:()=>(e=>H(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),j(t)})(e,r),onDrop:()=>(t=>{if(null===F||F===t)return H(null),void j(null);const n=te.map(e=>{const n=[...e],[r]=n.splice(F,1);return n.splice(t,0,r),n});if(f(n),p){const n=[...e],[r]=n.splice(F,1);n.splice(t,0,r),p(n)}H(null),j(null)})(r),onDragEnd:()=>{H(null),j(null)},onClick:e=>{e.shiftKey&&q||B({row:0,col:r}),Q({row:te.length-1,col:r})},onContextMenu:e=>ge(e,r),children:[n.title,
|
|
10
|
+
/* @__PURE__ */h("div",{className:"absolute -right-1 top-0 bottom-0 w-2 cursor-col-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),A.current={col:t,startX:e.clientX,startW:fe(t)},document.body.style.cursor="col-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),be(r)},title:C.resize})]},n.key)})]})}),
|
|
11
|
+
/* @__PURE__ */u("tbody",{children:[Ne>0&&/* @__PURE__ */h("tr",{style:{height:Ne}}),Ae.map((t,n)=>{const r=$e+n,o=q&&J&&Math.min(q.row,J.row)<=r&&r<=Math.max(q.row,J.row)&&0===Math.min(q.col,J.col)&&Math.max(q.col,J.col)===e.length-1;/* @__PURE__ */
|
|
12
|
+
return u("tr",{style:{height:pe(r)},children:[
|
|
13
|
+
/* @__PURE__ */u("td",{className:`relative px-1 py-1 text-center text-2xs text-ink-faintest border-b border-r border-line bg-surface-sunken select-none cursor-pointer hover:bg-gray-200${o?" !bg-blue-200 !text-gray-700":""}${R===r?" !bg-blue-100":""}`,draggable:!0,onDragStart:()=>(e=>T(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),P(t)})(e,r),onDrop:()=>(e=>{if(null===K||K===e)return T(null),void P(null);const t=te.map(e=>[...e]),[n]=t.splice(K,1);t.splice(e,0,n),f(t),T(null),P(null)})(r),onDragEnd:()=>{T(null),P(null)},onClick:t=>{t.shiftKey&&q||B({row:r,col:0}),Q({row:r,col:e.length-1})},onContextMenu:e=>me(e,r),children:[r+1,
|
|
14
|
+
/* @__PURE__ */h("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),O.current={row:t,startY:e.clientY,startH:pe(t)},document.body.style.cursor="row-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ye(r)},title:C.resize})]}),e.map((e,n)=>{const o=q&&J&&function(e,t,n,r){const o=Math.min(e.row,t.row),l=Math.max(e.row,t.row),c=Math.min(e.col,t.col),a=Math.max(e.col,t.col);return n>=o&&n<=l&&r>=c&&r<=a}(q,J,r,n),l=X?.row===r&&X?.col===n&&!e.readOnly,c=E?.row===r&&E?.col===n,a=x?.[`${r}:${n}`],s=q&&J?Math.max(q.row,J.row):-1,i=q&&J?Math.max(q.col,J.col):-1,d=q&&J&&r===s&&n===i,w=V.current&&G&&q&&J&&(()=>{const e=Math.min(q.row,J.row),t=Math.max(q.row,J.row),o=Math.min(q.col,J.col),l=Math.max(q.col,J.col);let c=e,a=t,s=o,i=l;return G.row>t?a=G.row:G.row<e&&(c=G.row),G.col>l?i=G.col:G.col<o&&(s=G.col),r>=c&&r<=a&&n>=s&&n<=i&&!(r>=e&&r<=t&&n>=o&&n<=l)})(),g="sm"===a?.fontSize?"text-2xs":"lg"===a?.fontSize?"text-sm":"xl"===a?.fontSize?"text-base":"text-xs",f=`${a?.bold?" font-bold":""}${a?.italic?" italic":""}${a?.underline?" underline":""}`;/* @__PURE__ */
|
|
15
15
|
return u("td",{className:`relative px-0 py-0 border-b border-r border-gray-200 text-sm${e.readOnly?" bg-gray-50 text-gray-500 cursor-default":" cursor-cell"}${o?" !bg-blue-100":""}${c&&!o?" ring-2 ring-inset ring-blue-400":""}${w?" !bg-blue-50 ring-1 ring-inset ring-blue-300":""}`,onMouseDown:e=>{if(e.target===e.currentTarget){re(e,r,n);const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onMouseEnter:()=>oe(r,n),onClick:e=>{if(e.target===e.currentTarget){const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onDoubleClick:t=>{t.target!==t.currentTarget||e.readOnly||Y({row:r,col:n})},children:[
|
|
16
|
-
/* @__PURE__ */h(
|
|
16
|
+
/* @__PURE__ */h(m,{contentEditable:l,suppressContentEditableWarning:!0,tabIndex:0,"data-row":r,"data-col":n,className:`w-full h-full px-2 py-1 rosh-focus-ring whitespace-nowrap overflow-hidden ${"right"===e.align?"text-right":"center"===e.align?"text-center":""} ${e.readOnly?"cursor-default":"cursor-cell"} font-mono ${g}${f}`,onMouseDown:e=>re(e,r,n),onMouseEnter:()=>oe(r,n),onDoubleClick:()=>{e.readOnly||Y({row:r,col:n})},onFocus:()=>{L({row:r,col:n}),_.current||(B({row:r,col:n}),Q({row:r,col:n}))},onBlur:e=>{const o=e.currentTarget.textContent||"";o!==(t[n]||"")&&ne(r,n,o),Y(null)},onInput:()=>ae(r),onPaste:e=>le(e,r,n),onKeyDown:t=>{if(!(l||e.readOnly||1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey))return t.preventDefault(),ne(r,n,t.key),W.current={row:r,col:n},void Y({row:r,col:n});ce(t,r,n)},text:t[n]||""}),d&&/* @__PURE__ */h("div",{onMouseDown:xe,title:C.fill,className:"absolute -bottom-[3px] -right-[3px] w-[7px] h-[7px] bg-blue-500 border border-white cursor-crosshair z-30 hover:bg-blue-600"})]},n)})]},r)}),ze>0&&/* @__PURE__ */h("tr",{style:{height:ze}})]})]}),se&&i(
|
|
17
17
|
/* @__PURE__ */u(d,{children:[
|
|
18
18
|
/* @__PURE__ */h("div",{className:"fixed inset-0 z-(--z-popup)",onPointerDown:()=>ie(null)}),
|
|
19
|
-
/* @__PURE__ */h("div",{className:"fixed z-(--z-popup) bg-
|
|
19
|
+
/* @__PURE__ */h("div",{className:"fixed z-(--z-popup) bg-surface rounded-lg shadow-lg border border-line py-1 min-w-[160px]",style:{left:se.x,top:se.y},children:se.items.map((e,t)=>/* @__PURE__ */h("button",{onPointerDown:t=>{t.stopPropagation(),e.onClick()},className:"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-ink hover:bg-gray-100",children:e.label},t))})]}),document.body)]})}export{g as EditableGrid,w as withSpareRow};
|