efficient-shell 12.8.1 → 12.10.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 +30 -0
- package/dist/{Browser-DEXVIONU.js → Browser-G2HGYZVD.js} +15 -15
- package/dist/Calculator-ALPNISJT.js +29 -0
- package/dist/{CurrencyConverter-H4M35SIY.js → CurrencyConverter-KBY2OXQ2.js} +8 -8
- package/dist/Files-OY5TSWUZ.js +126 -0
- package/dist/{Notepad-PSDXZTBI.js → Notepad-CRHG5FLI.js} +9 -9
- package/dist/PdfViewer-L4FJS3M6.js +1 -0
- package/dist/{PomodoroTimer-SKAUQXPO.js → PomodoroTimer-NGQPYDI3.js} +68 -68
- package/dist/{Preview-HBB2SWJY.js → Preview-BVTWP7RW.js} +30 -30
- package/dist/Sidebar-QOGK5LJ2.js +44 -0
- package/dist/{Stock-X7GEAET7.js → Stock-O7AQ2WUN.js} +2 -2
- package/dist/{Weather-OH5PIQLU.js → Weather-WHXA5TTP.js} +21 -21
- package/dist/{WorldClock-S5NSJ7ZX.js → WorldClock-CZCIVYKB.js} +6 -6
- package/dist/ai/index.js +34 -34
- package/dist/apps/ImageAnnotator.js +1 -1
- package/dist/apps/index.d.ts +55 -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/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FlowChart.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-ROM25ZMZ.js → chunk-22LU6FKN.js} +10 -10
- package/dist/{chunk-NC36LJCA.js → chunk-2GS2VOQT.js} +10 -10
- package/dist/{chunk-UK6XNW3I.js → chunk-2NZBQOA6.js} +12 -12
- package/dist/{chunk-4ZUV6WQT.js → chunk-2WNTDGOP.js} +1 -1
- package/dist/{chunk-MZG3FS5T.js → chunk-2X4U3VX2.js} +6 -6
- package/dist/{chunk-6JDR6T4U.js → chunk-3RDJFCIZ.js} +1 -1
- package/dist/{chunk-5NDONLH5.js → chunk-42BVXJZN.js} +3 -3
- package/dist/{chunk-3KP3EIYP.js → chunk-457SK2XV.js} +5 -5
- package/dist/{chunk-Z2MNXUM6.js → chunk-4GTXRVDF.js} +2 -2
- package/dist/{chunk-G2X5YYIQ.js → chunk-4MUE4CYB.js} +2 -2
- package/dist/{chunk-3CMCGOOV.js → chunk-4UQNNA4K.js} +4 -4
- package/dist/{chunk-NEAT7BIP.js → chunk-5G4CB3E6.js} +1 -1
- package/dist/{chunk-PH3P54QQ.js → chunk-5HOXR3L4.js} +1 -1
- package/dist/{chunk-QR46K5SB.js → chunk-5MFWM6L4.js} +1 -1
- package/dist/{chunk-Y4RERPFN.js → chunk-5QVCBAK2.js} +1 -1
- package/dist/chunk-5RT5XDHG.js +6 -0
- package/dist/{chunk-3UHTHQGK.js → chunk-5S4YF5XA.js} +8 -8
- package/dist/{chunk-OGPCFMNA.js → chunk-5WCHUZ6O.js} +1 -1
- package/dist/{chunk-KUUZFLT6.js → chunk-5YPCZLBW.js} +1 -1
- package/dist/{chunk-PT77FC5X.js → chunk-5Z6XJPAX.js} +1 -1
- package/dist/{chunk-B7LNSGNR.js → chunk-63J2MBXV.js} +10 -10
- package/dist/chunk-675RYIWR.js +7 -0
- package/dist/{chunk-BDWZLMIT.js → chunk-67BWG353.js} +9 -9
- package/dist/{chunk-SCU2CWNJ.js → chunk-6BK3KRT5.js} +18 -18
- package/dist/{chunk-X7APOT53.js → chunk-6BQUSUNK.js} +7 -7
- package/dist/{chunk-NU7LUJX5.js → chunk-6ITEA6SX.js} +1 -1
- package/dist/{chunk-4KJ7MLWO.js → chunk-6JLXXX4H.js} +5 -5
- package/dist/{chunk-C37PXEEH.js → chunk-6P7SIIG4.js} +14 -14
- package/dist/{chunk-CNVYM3HP.js → chunk-6YIVKPWQ.js} +1 -1
- package/dist/{chunk-YJIFJIXV.js → chunk-7Q4DE4CT.js} +1 -1
- package/dist/chunk-7XGUX3TH.js +3 -0
- package/dist/{chunk-NKMSGZZ3.js → chunk-A2JYBUPB.js} +5 -5
- package/dist/{chunk-IYPRFUTT.js → chunk-AKTEMZOT.js} +1 -1
- package/dist/{chunk-F6QSHKUR.js → chunk-AMSE4PMQ.js} +4 -4
- package/dist/{chunk-TX5FZBPQ.js → chunk-ASOVTAIT.js} +1 -1
- package/dist/{chunk-CD7P34VC.js → chunk-AUCNJFTP.js} +7 -7
- package/dist/{chunk-BGJMDP6J.js → chunk-BJAJOIVY.js} +1 -1
- package/dist/chunk-BR7L5NE3.js +13 -0
- package/dist/{chunk-DJ2XDBAO.js → chunk-BUZ5AJLR.js} +6 -6
- package/dist/{chunk-EOGXCGQF.js → chunk-BYDSBDVS.js} +6 -6
- package/dist/{chunk-YUB3TJKO.js → chunk-C3E6XFIC.js} +3 -3
- package/dist/{chunk-45IVWLKF.js → chunk-C7M7KYNY.js} +1 -1
- package/dist/chunk-CA3OC4YY.js +9 -0
- package/dist/{chunk-H7HRYFRQ.js → chunk-CB5FQMFB.js} +9 -9
- package/dist/{chunk-UOUVHHTC.js → chunk-CINGDJPM.js} +1 -1
- package/dist/{chunk-6LYBE7LM.js → chunk-CRRC72EE.js} +9 -9
- package/dist/{chunk-NS37Y5CN.js → chunk-D4K72BHN.js} +1 -1
- package/dist/{chunk-BFO72WQB.js → chunk-EDANELWX.js} +1 -1
- package/dist/chunk-EHVBJUQI.js +28 -0
- package/dist/{chunk-ZC3TSMFK.js → chunk-EIXMUGVZ.js} +2 -2
- package/dist/{chunk-7FBAZLBX.js → chunk-EVEGK57J.js} +1 -1
- package/dist/{chunk-7HTDD37H.js → chunk-F7BXUVN4.js} +5 -5
- package/dist/{chunk-XFD4BLP7.js → chunk-FOCQEWUH.js} +1 -1
- package/dist/chunk-FQHY6DTF.js +4 -0
- package/dist/{chunk-4UGFNTZ3.js → chunk-FZWAOYAM.js} +7 -7
- package/dist/{chunk-NEYHBQLG.js → chunk-G3VRO4CK.js} +2 -2
- package/dist/{chunk-FPYABAOX.js → chunk-GB2XLSR5.js} +11 -11
- package/dist/{chunk-TS36J7RW.js → chunk-GBEDLYND.js} +2 -2
- package/dist/{chunk-4EVBKID5.js → chunk-GMJ5WOB2.js} +1 -1
- package/dist/{chunk-4JYHS4VJ.js → chunk-GMLDGXNQ.js} +1 -1
- package/dist/{chunk-PPSA3QLE.js → chunk-HD7OBASH.js} +1 -1
- package/dist/{chunk-NPIZ2Y3P.js → chunk-HE24VQMU.js} +1 -1
- package/dist/{chunk-3WFJ4PYV.js → chunk-HEX3EP5F.js} +3 -3
- package/dist/chunk-HL3V67JZ.js +2 -0
- package/dist/{chunk-5Q7VFXEO.js → chunk-HRDR56SK.js} +3 -3
- package/dist/chunk-HULQSIX5.js +8 -0
- package/dist/{chunk-OY3JH66O.js → chunk-HV4VQ5XV.js} +7 -7
- package/dist/{chunk-E227NVFX.js → chunk-IARCNQD3.js} +1 -1
- package/dist/{chunk-RJKMFIM3.js → chunk-ICNGLA5O.js} +6 -6
- package/dist/{chunk-VVQJHQW6.js → chunk-IIMFLLYT.js} +8 -8
- package/dist/{chunk-GHZ4PP62.js → chunk-INFL4YZF.js} +1 -1
- package/dist/{chunk-Y46WPTKY.js → chunk-ISU4FCEX.js} +7 -7
- package/dist/chunk-ISZOD5S6.js +2 -0
- package/dist/{chunk-H6PFTU3L.js → chunk-J4IT5C3A.js} +1 -1
- package/dist/{chunk-GLJILR2Y.js → chunk-J7BMSKOM.js} +5 -5
- package/dist/{chunk-DW45EZHA.js → chunk-JGJWPONL.js} +5 -5
- package/dist/{chunk-JY2OBPVO.js → chunk-JOD5ISTB.js} +1 -1
- package/dist/{chunk-TRWHVG3A.js → chunk-JTZVUO3I.js} +1 -1
- package/dist/{chunk-YMNWUQGV.js → chunk-JVNJCRHM.js} +4 -4
- package/dist/{chunk-N5LVUI7R.js → chunk-KFS7WSCC.js} +11 -11
- package/dist/{chunk-XZH5PEML.js → chunk-KIRLSUQT.js} +5 -5
- package/dist/{chunk-WMLBMR4E.js → chunk-KOPTKTHN.js} +3 -3
- package/dist/{chunk-3LTZ4N46.js → chunk-KPHYWZXL.js} +13 -13
- package/dist/{chunk-HQA7SPU5.js → chunk-KRUI4LVW.js} +1 -1
- package/dist/chunk-KVU5IQOZ.js +7 -0
- package/dist/{chunk-BXU3LX44.js → chunk-KWTK6TGH.js} +1 -1
- package/dist/{chunk-AXTVK6LU.js → chunk-KZ7RR7EU.js} +1 -1
- package/dist/{chunk-ZYW4KSEE.js → chunk-LFW3CQMF.js} +4 -4
- package/dist/{chunk-6HH6KNJB.js → chunk-LFWRHBTM.js} +2 -2
- package/dist/{chunk-X5ZY35KZ.js → chunk-LS6VU6F7.js} +1 -1
- package/dist/{chunk-5NONOFIV.js → chunk-M4MN2GOE.js} +1 -1
- package/dist/{chunk-GJ23UZDQ.js → chunk-MAI2DN7N.js} +1 -1
- package/dist/{chunk-7B5KFESH.js → chunk-MBXCXFQO.js} +1 -1
- package/dist/{chunk-32WEY6O5.js → chunk-MEAJGM6F.js} +1 -1
- package/dist/{chunk-DNLRUZGS.js → chunk-MPTOEXED.js} +1 -1
- package/dist/chunk-MTP3MBZA.js +22 -0
- package/dist/{chunk-EUUCNDIS.js → chunk-NAWIVFAN.js} +13 -13
- package/dist/{chunk-54K2ADBT.js → chunk-NDAZPAQL.js} +1 -1
- package/dist/{chunk-SYIJRZIS.js → chunk-NKZINXHG.js} +2 -2
- package/dist/chunk-NOCOLZ2W.js +1 -0
- package/dist/{chunk-SCGBCBXP.js → chunk-NV7QRWQJ.js} +1 -1
- package/dist/{chunk-XK4U5MAS.js → chunk-O3YCIWHF.js} +1 -1
- package/dist/{chunk-MCJ4JHLE.js → chunk-OAFFHLJ4.js} +5 -5
- package/dist/chunk-OSNHRKX6.js +5 -0
- package/dist/{chunk-BTUI3MKS.js → chunk-OSQ5NRV3.js} +1 -1
- package/dist/{chunk-GG4ZXQXG.js → chunk-OW5LQWPU.js} +3 -3
- package/dist/{chunk-3I67TIGD.js → chunk-PEIRPNXT.js} +21 -21
- package/dist/{chunk-LGK47SEN.js → chunk-PHJFGLXB.js} +12 -12
- package/dist/{chunk-7FRG5CF7.js → chunk-PICRPJBL.js} +1 -1
- package/dist/{chunk-HS6KTFW6.js → chunk-POOPWYJL.js} +10 -10
- package/dist/chunk-PY7GHIYF.js +19 -0
- package/dist/{chunk-7HIHQR3X.js → chunk-Q3RJMQYE.js} +1 -1
- package/dist/{chunk-LLUHE2ZW.js → chunk-QIMMZVWV.js} +1 -1
- package/dist/{chunk-NHWDB7R6.js → chunk-QMNDKNK2.js} +1 -1
- package/dist/{chunk-RIXX6NRV.js → chunk-QQM36CYU.js} +1 -1
- package/dist/{chunk-J33QE4J7.js → chunk-QSK2OWT3.js} +2 -2
- package/dist/{chunk-2JXGTA73.js → chunk-RAQBZUU2.js} +65 -65
- package/dist/{chunk-YMAU4EIK.js → chunk-RGKSJBXJ.js} +8 -8
- package/dist/{chunk-H6IGZWC2.js → chunk-RHD4V6CE.js} +9 -9
- package/dist/{chunk-VQJLH2BU.js → chunk-RIF6BFEH.js} +1 -1
- package/dist/{chunk-TXZR5G55.js → chunk-RLGPIJHB.js} +1 -1
- package/dist/{chunk-R3K3LVVS.js → chunk-RQKD5AAL.js} +1 -1
- package/dist/{chunk-I3QFYBOP.js → chunk-SEHKTBVM.js} +1 -1
- package/dist/{chunk-75MSXRFY.js → chunk-SFFELHLP.js} +5 -5
- package/dist/{chunk-SBZCJNNP.js → chunk-SY65V6K7.js} +10 -10
- package/dist/{chunk-UIWGVOFH.js → chunk-T3NLFOLW.js} +2 -1
- package/dist/{chunk-JYD6PSDA.js → chunk-TDMZFQRB.js} +1 -1
- package/dist/chunk-TJSJVC6P.js +1 -0
- package/dist/{chunk-MX2YRSMZ.js → chunk-TKFINWY6.js} +2 -2
- package/dist/{chunk-MM5AFQ24.js → chunk-TVVSFXWY.js} +7 -7
- package/dist/{chunk-EZWWQHD3.js → chunk-UD4NESX7.js} +1 -1
- package/dist/{chunk-NJTFI7AA.js → chunk-UG5GKEU5.js} +1 -1
- package/dist/{chunk-UZZVI7EN.js → chunk-UMZJRZFN.js} +1 -1
- package/dist/{chunk-LTESFDTF.js → chunk-V6FHZGCL.js} +1 -1
- package/dist/{chunk-2UBASCOK.js → chunk-VLCHHTX6.js} +1 -1
- package/dist/{chunk-VROBW74Y.js → chunk-VN3A43SA.js} +1 -1
- package/dist/{chunk-QQXQQPCD.js → chunk-VPZOSVDF.js} +9 -9
- package/dist/{chunk-DPUM3H5N.js → chunk-VWNHSLFY.js} +1 -1
- package/dist/{chunk-HE767CVB.js → chunk-W5B7UNMJ.js} +1 -1
- package/dist/{chunk-H27KA5IL.js → chunk-WDAOTHX5.js} +3 -3
- package/dist/{chunk-R3JKZXII.js → chunk-WJBP5SND.js} +5 -5
- package/dist/{chunk-LLAYWMYS.js → chunk-WM2BBRT6.js} +1 -1
- package/dist/{chunk-XVIDD6F3.js → chunk-Y4YXZIES.js} +8 -8
- package/dist/chunk-YMD2F3NL.js +1 -0
- package/dist/{chunk-525O4AUQ.js → chunk-YRG6XJ6M.js} +8 -8
- package/dist/chunk-YVAJ42M2.js +8 -0
- package/dist/{chunk-DZBGJ6X4.js → chunk-YVIV7SKG.js} +1 -1
- package/dist/{chunk-53EW4M5S.js → chunk-YX4MRM7A.js} +6 -6
- package/dist/{chunk-EZ6SVQSV.js → chunk-Z334LCCX.js} +1 -1
- package/dist/{chunk-QLVH66TE.js → chunk-Z6KW4WZ6.js} +18 -18
- package/dist/{chunk-7KIDOIPY.js → chunk-Z7RXWXR5.js} +1 -1
- package/dist/{chunk-23WJCEYD.js → chunk-ZC6MXV4L.js} +1 -1
- package/dist/chunk-ZPHUMLET.js +1 -0
- package/dist/{chunk-7H7U3HC6.js → chunk-ZR2UWJIR.js} +4 -4
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/UnitMenu.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +37 -37
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +665 -665
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +2 -2
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +8 -0
- 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.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-NZ2S6CAK.js +0 -29
- package/dist/Files-HDTNIXUC.js +0 -121
- package/dist/PdfViewer-GUXUWGMG.js +0 -1
- package/dist/Sidebar-XGAVJGOL.js +0 -44
- package/dist/chunk-27TJNID7.js +0 -13
- package/dist/chunk-43MCNASD.js +0 -1
- package/dist/chunk-6DZGOGB2.js +0 -1
- package/dist/chunk-6EHPEBGP.js +0 -5
- package/dist/chunk-A6WZF65N.js +0 -22
- package/dist/chunk-C3SE57NF.js +0 -3
- package/dist/chunk-GEZ45J4Z.js +0 -2
- package/dist/chunk-HEAGOZKJ.js +0 -6
- package/dist/chunk-IFIMUNID.js +0 -4
- package/dist/chunk-IHPAYSTJ.js +0 -8
- package/dist/chunk-KETGA66S.js +0 -9
- package/dist/chunk-KO74S3FL.js +0 -28
- package/dist/chunk-M54OL3YR.js +0 -2
- package/dist/chunk-P2C33RHT.js +0 -1
- package/dist/chunk-SE3S362N.js +0 -7
- package/dist/chunk-TWFD7A3K.js +0 -1
- package/dist/chunk-U5DSVCWV.js +0 -8
- package/dist/chunk-UDVQORQM.js +0 -19
- package/dist/chunk-WSRM6ZQS.js +0 -7
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-
|
|
2
|
-
/* @__PURE__ */D("button",{type:"button",onClick:()=>le("Custom"),className:
|
|
3
|
-
/* @__PURE__ */D(e,{mode:"range",min:
|
|
4
|
-
return W("div",{className:"relative"+(
|
|
5
|
-
/* @__PURE__ */W("div",{className:`relative ${
|
|
6
|
-
/* @__PURE__ */W("button",{ref:de,type:"button",onClick:()=>{
|
|
1
|
+
import{Calendar as e}from"./chunk-PHJFGLXB.js";import{toDateKey as t,fromDateKey as r,toMonthKey as n}from"./chunk-2HMNOLKX.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as o,InputEndActionButton as l}from"./chunk-HRDR56SK.js";import{FILTER_ON as i,FILTER_ON_INK as s,FILTER_OFF as c}from"./chunk-AYZY3YNC.js";import{calendarNames as d}from"./chunk-Y3JW2GW5.js";import{pad2 as m}from"./chunk-LF27WIN2.js";import{Icon as u}from"./chunk-T3NLFOLW.js";import{onOverlayOpen as h}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as p}from"./chunk-62LW225J.js";import{useDropdownPosition as f}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{buttonClasses as b}from"./chunk-UQYNPYF4.js";import{glassStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as v,useShellLocale as y}from"./chunk-TJSJVC6P.js";import{useState as w,useRef as N,useId as k,useEffect as C}from"react";import{createPortal as M}from"react-dom";import{jsxs as W,Fragment as j,jsx as D}from"react/jsx-runtime";var $=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],F=t;function Y(e,r){const n=r.getFullYear(),a=r.getMonth(),o=new Date(n,a,r.getDate()),l=new Date(n,a,0),i=e=>new Date(n,a-e,1);switch(e){case"last2Weeks":return{from:t(new Date(n,a,r.getDate()-14)),to:t(o)};case"lastMonth":return{from:t(i(1)),to:t(l)};case"last3Months":return{from:t(i(3)),to:t(l)};case"last6Months":return{from:t(i(6)),to:t(l)};case"last12Months":return{from:t(i(12)),to:t(l)}}}function S(e,t,r){const a=n(e);return t&&a<t.slice(0,7)?t.slice(0,7):r&&a>r.slice(0,7)?r.slice(0,7):a}function L(e){const t=r(e);return t?`${m(t.getDate())}/${m(t.getMonth()+1)}/${t.getFullYear()}`:e}var H=/* @__PURE__ */new Map;function O({from:t,to:n,onChange:m,formatDisplay:F,clearable:O,required:J=!1,name:T,id:B,"aria-labelledby":R,"aria-label":G,weekStartsOn:E,placeholder:P,fullWidth:U=!1,min:q,max:A,disabled:I=!1,allowOpenEnd:K=!1}){const V=v().dateRange,X=y(),Z=F??(X?function(e){let t=H.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),H.set(e,t));const n=t;return e=>{const t=r(e);return t?n.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(X):L),z=P??V.placeholder,Q=O??!J,[_,ee]=w(!1),[te,re]=w(t),[ne,ae]=w(n),[oe,le]=w(null),[ie,se]=w("from"),ce=N(null),de=N(null),me=N(null),ue=k(),he=k(),pe=k(),[fe,ge]=w(!1),be=f(ce,_,{preferredMaxWidth:520,preferredMaxHeight:fe?720:560,popupRef:me}),xe=N(null),ve=N(null),[ye,we]=w(!0);g(()=>{const e=ve.current;if(!_||!fe||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&we(a)});const Ne=N(null);g(()=>{const e=me.current;if(!_||!be||!e)return;const t=getComputedStyle(e),r=be.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(fe)null!==Ne.current&&Ne.current<=r&&ge(!1);else{const e=xe.current?.offsetWidth??0;if(0===e)return;Ne.current=e,e>r+.5&&ge(!0)}});const[ke,Ce]=w(!1);g(()=>{const e=!!B&&(de.current?.labels?.length??0)>0;e!==ke&&Ce(e)});const Me=!!G||!!R||ke,We=/* @__PURE__ */new Date,[je,De]=w(()=>t?t.slice(0,7):S(We,q,A)),$e=$.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(Y(e,We),q,A)),Fe=e=>e?Z(e):"";C(()=>{if(!_)return;const e=e=>{const t=e.target;ce.current?.contains(t)||me.current?.contains(t)||ee(!1)};document.addEventListener("mousedown",e);const t=h(()=>ee(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[_]),C(()=>{I&&ee(!1)},[I]);const Ye=()=>{m("",""),ee(!1)},Se=Q&&!I&&Boolean(t||n),Le=t&&n?`${Fe(t)} — ${Fe(n)}`:t?V.fromOnly(Fe(t)):n?V.toOnly(Fe(n)):"",He=d(X),Oe=e=>{const t=r(e);return t?He.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Je=t&&n?V.range(Oe(t),Oe(n)):t?V.fromOnly(Oe(t)):n?V.toOnly(Oe(n)):z,Te=e=>fe?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(oe===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(oe===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Be=/* @__PURE__ */W(j,{children:[$e.map(e=>/* @__PURE__ */D("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=Y(e,We);re(t.from),ae(t.to),le(e),De(t.from.slice(0,7))})(e),className:Te(e),"aria-label":fe?V[e]:void 0,children:fe?ye?V[e]:V[`${e}Short`]:V[e]},e)),
|
|
2
|
+
/* @__PURE__ */D("button",{type:"button",onClick:()=>le("Custom"),className:Te("Custom"),children:V.custom})]}),Re=(e,t)=>K?/* @__PURE__ */D("button",{type:"button","data-range-end":e,"aria-pressed":ie===e,onClick:()=>se(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */D("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Ge=e=>K&&ie===e?" ring-1 ring-blue-400":"",Ee=
|
|
3
|
+
/* @__PURE__ */D(e,{mode:"range",min:q,max:A,value:te||null,endValue:ne||null,month:je,onMonthChange:De,onSelect:e=>{le("Custom"),K?"from"===ie?(ne&&e>ne?(re(ne),ae(e)):re(e),se("to")):te&&e<te?(ae(te),re(e)):ae(e):!te||te&&ne?(re(e),ae("")):e<te?(ae(te),re(e)):ae(e)},weekStartsOn:E,"aria-label":V.dialog});/* @__PURE__ */
|
|
4
|
+
return W("div",{className:"relative"+(U?" w-full":""),ref:ce,children:[
|
|
5
|
+
/* @__PURE__ */W("div",{className:`relative ${U?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Se?a[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${t||n?`${i} ${s}`:c}${I?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
+
/* @__PURE__ */W("button",{ref:de,type:"button",onClick:()=>{I||(re(t),ae(n),le(null),se(t&&!n?"to":"from"),De(t?t.slice(0,7):S(We,q,A)),ee(!0))},"aria-haspopup":"dialog","aria-expanded":_,id:B,disabled:I||void 0,"aria-label":G,"aria-labelledby":R,"aria-describedby":[Me?he:void 0,J?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":_?ue:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(U?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
7
|
/* @__PURE__ */D(u,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
-
/* @__PURE__ */D("span",{className:"truncate",children:
|
|
9
|
-
/* @__PURE__ */D("input",{type:"hidden",name:
|
|
10
|
-
/* @__PURE__ */D("input",{type:"hidden",name:
|
|
11
|
-
/* @__PURE__ */W("div",{ref:me,id:ue,role:"dialog","aria-label":
|
|
12
|
-
/* @__PURE__ */W("div",{className:fe?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
|
|
13
|
-
/* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:
|
|
14
|
-
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${te?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${
|
|
15
|
-
/* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:
|
|
16
|
-
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${
|
|
17
|
-
/* @__PURE__ */W("div",{ref:ve,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Be,$e.map(e=>/* @__PURE__ */D("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:
|
|
18
|
-
/* @__PURE__ */D("div",{className:"w-full",children:
|
|
8
|
+
/* @__PURE__ */D("span",{className:"truncate",children:Le||z})]}),Se&&/* @__PURE__ */D(o,{children:/* @__PURE__ */D(l,{action:{label:V.clearRange,icon:/* @__PURE__ */D(u,{name:"close"}),onClick:Ye}})})]}),Me&&/* @__PURE__ */D("span",{id:he,className:"sr-only",children:Je}),J&&/* @__PURE__ */D("span",{id:pe,className:"sr-only",children:V.required}),T&&/* @__PURE__ */W(j,{children:[
|
|
9
|
+
/* @__PURE__ */D("input",{type:"hidden",name:T.from,value:t,disabled:I||void 0}),
|
|
10
|
+
/* @__PURE__ */D("input",{type:"hidden",name:T.to,value:n,disabled:I||void 0})]}),_&&M(
|
|
11
|
+
/* @__PURE__ */W("div",{ref:me,id:ue,role:"dialog","aria-label":V.dialog,"data-layout":fe?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:p.popup,left:be?.left,right:be?.right,top:be?.top,bottom:be?.bottom,width:fe&&be?be.maxWidth:"max-content",maxWidth:be?.maxWidth,maxHeight:be?.maxHeight,overflowY:"auto",visibility:be?void 0:"hidden",...x()},children:[
|
|
12
|
+
/* @__PURE__ */W("div",{className:fe?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Re("from",/* @__PURE__ */W(j,{children:[
|
|
13
|
+
/* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:V.from}),
|
|
14
|
+
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${te?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ge("from")}`,children:te?Fe(te):V.start})]})),!fe&&/* @__PURE__ */D("span",{className:"text-gray-300",children:"—"}),Re("to",/* @__PURE__ */W(j,{children:[
|
|
15
|
+
/* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:V.to}),
|
|
16
|
+
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ge("to")}`,children:ne?Fe(ne):V.end})]}))]}),fe?/* @__PURE__ */W(j,{children:[$e.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */D("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:V.lastHeading}),
|
|
17
|
+
/* @__PURE__ */W("div",{ref:ve,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Be,$e.map(e=>/* @__PURE__ */D("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:V[e]},e))]})]}),
|
|
18
|
+
/* @__PURE__ */D("div",{className:"w-full",children:Ee})]}):
|
|
19
19
|
/* @__PURE__ */W("div",{ref:xe,className:"flex w-max gap-4",children:[
|
|
20
|
-
/* @__PURE__ */D("div",{className:"w-64",children:
|
|
21
|
-
/* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[
|
|
22
|
-
/* @__PURE__ */D("button",{type:"button",onClick:()=>ee(!1),className:b({variant:"secondary"}),children:
|
|
23
|
-
/* @__PURE__ */D("button",{type:"button",onClick:()=>{m(te,ne),ee(!1)},disabled:K?!te&&!ne:!te||!ne,className:b({variant:"primary"}),children:
|
|
20
|
+
/* @__PURE__ */D("div",{className:"w-64",children:Ee}),$e.length>0&&/* @__PURE__ */D("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Be})]}),
|
|
21
|
+
/* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[Q&&/* @__PURE__ */D("button",{type:"button",onClick:Ye,className:b({variant:"ghost"}),children:V.clear}),
|
|
22
|
+
/* @__PURE__ */D("button",{type:"button",onClick:()=>ee(!1),className:b({variant:"secondary"}),children:V.cancel}),
|
|
23
|
+
/* @__PURE__ */D("button",{type:"button",onClick:()=>{m(te,ne),ee(!1)},disabled:K?!te&&!ne:!te||!ne,className:b({variant:"primary"}),children:V.apply})]})]}),document.body)]})}export{O as DateRangePicker,Y as presetRange,F as toISODate};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{fromDateKey as e,toMonthKey as t,toDateKey as r,fromMonthKey as a}from"./chunk-2HMNOLKX.js";import{calendarNames as n,firstDayOfWeek as o}from"./chunk-Y3JW2GW5.js";import{Icon as l}from"./chunk-
|
|
2
|
-
return m("div",{className:
|
|
1
|
+
import{fromDateKey as e,toMonthKey as t,toDateKey as r,fromMonthKey as a}from"./chunk-2HMNOLKX.js";import{calendarNames as n,firstDayOfWeek as o}from"./chunk-Y3JW2GW5.js";import{Icon as l}from"./chunk-T3NLFOLW.js";import{useBrowserValue as i}from"./chunk-D65T4H6J.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-TJSJVC6P.js";import{useMemo as g,useState as u,useRef as d,useEffect as h}from"react";import{jsxs as m,jsx as f,Fragment as b}from"react/jsx-runtime";var y="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";var v=()=>r(/* @__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 w({value:w,endValue:D,mode:M="single",onSelect:N,min:Y,max:k,month:F,defaultMonth:j,onMonthChange:A,weekStartsOn:C,quickJump:S=!0,markedDates:J,readOnly:P=!1,"aria-label":W,className:q=""}){const K=g(()=>new Set(J??[]),[J]),L=e(w),O=i(v,null),H=e(O),T=s().calendar,$=c(),E=n($),U=i(()=>o($),0),V=C??U,B=()=>{if(!H)return null;const e=t(H);return Y&&e<Y.slice(0,7)?Y.slice(0,7):k&&e>k.slice(0,7)?k.slice(0,7):e},[G,I]=u(()=>j||(L?t(L):B())),R=F??G??B(),X=null===R?null:function(e,t){return a(e)??t}(R,H),[z,Q]=u(()=>w??O),Z=d(null),_=d(!1),[ee,te]=u("days"),re=g(()=>X?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))}(X,V):[],[R,V]),ae=e=>!!Y&&e<Y||!!k&&e>k,ne=z??O,oe=re.some(e=>r(e)===ne),le=X?re.find(e=>e.getMonth()===X.getMonth())??re[0]:null,ie=oe&&ne?ne:le?r(le):"";if(h(()=>{_.current&&(_.current=!1,Z.current?.querySelector('[data-active="true"]')?.focus())},[ie,R]),!X)/* @__PURE__ */
|
|
2
|
+
return m("div",{className:q,"aria-hidden":"true","data-calendar-pending":"",children:[
|
|
3
3
|
/* @__PURE__ */f("div",{className:"mb-2 h-6"}),
|
|
4
|
-
/* @__PURE__ */f("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */f("div",0===t?{className:"py-1 text-xs",children:" "}:{className:y,children:/* @__PURE__ */f("span",{className:"aspect-square"})},t))})]});const se=e=>"years"===ee?new Date(X.getFullYear()+12*e,X.getMonth(),1):"months"===ee?new Date(X.getFullYear()+e,X.getMonth(),1):x(X,e),ce=e=>{const r=t(e);void 0===F&&
|
|
5
|
-
return m("div",{className:
|
|
4
|
+
/* @__PURE__ */f("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */f("div",0===t?{className:"py-1 text-xs",children:" "}:{className:y,children:/* @__PURE__ */f("span",{className:"aspect-square"})},t))})]});const se=e=>"years"===ee?new Date(X.getFullYear()+12*e,X.getMonth(),1):"months"===ee?new Date(X.getFullYear()+e,X.getMonth(),1):x(X,e),ce=e=>{const r=t(e);void 0===F&&I(r),A?.(r)},ge=W??E.monthYear(X.getFullYear(),X.getMonth());/* @__PURE__ */
|
|
5
|
+
return m("div",{className:q,children:[
|
|
6
6
|
/* @__PURE__ */m("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
7
|
-
/* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee
|
|
8
|
-
/* @__PURE__ */f("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:S?/* @__PURE__ */m(b,{children:["years"!==ee&&/* @__PURE__ */f("button",{type:"button","aria-label"
|
|
9
|
-
/* @__PURE__ */f("button",{type:"button","aria-label"
|
|
10
|
-
/* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee
|
|
11
|
-
/* @__PURE__ */m("div",{ref:Z,role:"grid","aria-label":ge,className:"space-y-1","aria-readonly":
|
|
12
|
-
/* @__PURE__ */f("div",{role:"row",className:`${y} text-center text-xs font-medium text-ink-faint`,children:Array.from({length:7},(e,t)=>(t+
|
|
13
|
-
/* @__PURE__ */f("div",{role:"columnheader","aria-label":
|
|
14
|
-
return f("div",{role:"gridcell","aria-selected":n,"aria-label":
|
|
7
|
+
/* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee?T.previousYears:"months"===ee?T.previousYear:T.previousMonth,onClick:()=>ce(se(-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__ */f(l,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
|
|
8
|
+
/* @__PURE__ */f("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:S?/* @__PURE__ */m(b,{children:["years"!==ee&&/* @__PURE__ */f("button",{type:"button","aria-label":T.chooseMonth(E.months[X.getMonth()]),onClick:()=>te(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[X.getMonth()]}),
|
|
9
|
+
/* @__PURE__ */f("button",{type:"button","aria-label":T.chooseYear(X.getFullYear()),onClick:()=>te(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:X.getFullYear()})]}):/* @__PURE__ */f("span",{children:E.monthYear(X.getFullYear(),X.getMonth())})}),
|
|
10
|
+
/* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee?T.nextYears:"months"===ee?T.nextYear:T.nextMonth,onClick:()=>ce(se(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__ */f(l,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===ee&&/* @__PURE__ */f("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__ */f("button",{type:"button","aria-pressed":t===X.getMonth(),onClick:()=>{ce(new Date(X.getFullYear(),t,1)),te("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===X.getMonth()?"bg-blue-600 font-semibold text-white":H&&t===H.getMonth()&&X.getFullYear()===H.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===ee&&/* @__PURE__ */f("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=X.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */f("button",{type:"button","aria-pressed":e===X.getFullYear(),onClick:()=>{ce(new Date(e,X.getMonth(),1)),te("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===X.getFullYear()?"bg-blue-600 font-semibold text-white":e===H?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
|
|
11
|
+
/* @__PURE__ */m("div",{ref:Z,role:"grid","aria-label":ge,className:"space-y-1","aria-readonly":P||void 0,onKeyDown:a=>{const n=e(ie)??H??X,o={ArrowLeft:()=>p(n,-1),ArrowRight:()=>p(n,1),ArrowUp:()=>p(n,-7),ArrowDown:()=>p(n,7),Home:()=>p(n,-(n.getDay()-V+7)%7),End:()=>p(n,6-(n.getDay()-V+7)%7),PageUp:()=>x(n,a.shiftKey?-12:-1),PageDown:()=>x(n,a.shiftKey?12:1)};if(o[a.key])return a.preventDefault(),l=o[a.key](),_.current=!0,Q(r(l)),void(t(l)!==R&&ce(l));var l;"Enter"!==a.key&&" "!==a.key||(a.preventDefault(),P||ae(ie)||N(ie))},hidden:"days"!==ee,children:[
|
|
12
|
+
/* @__PURE__ */f("div",{role:"row",className:`${y} text-center text-xs font-medium text-ink-faint`,children:Array.from({length:7},(e,t)=>(t+V)%7).map(e=>
|
|
13
|
+
/* @__PURE__ */f("div",{role:"columnheader","aria-label":E.weekdays[e],className:"py-1",children:/* @__PURE__ */f("abbr",{title:E.weekdays[e],className:"no-underline",children:E.weekdaysShort[e]})},e))}),Array.from({length:6},(e,t)=>/* @__PURE__ */f("div",{role:"row",className:`${y} text-center text-sm`,children:re.slice(7*t,7*t+7).map(e=>{const t=r(e),a=e.getMonth()!==X.getMonth(),n=t===w||"range"===M&&t===D,o=(e=>!("range"!==M||!w||!D)&&e>w&&e<D)(t),l=ae(t),i=E.longDate(e.getFullYear(),e.getMonth(),e.getDate()),s=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)]":"",l?"cursor-not-allowed text-gray-300":n?"bg-accent-fill font-semibold text-on-accent":o?"bg-accent-tint-strong text-blue-800":a?"text-ink-faint"+(e?" hover:bg-gray-100":""):"text-ink"+(e?" hover:bg-gray-100":""),t!==O||n?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),c=K.has(t)&&/* @__PURE__ */f("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(n?"bg-surface":a?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
|
|
14
|
+
return f("div",{role:"gridcell","aria-selected":n,"aria-label":P?i:void 0,children:P?/* @__PURE__ */m("span",{"aria-hidden":"true",className:`grid place-items-center ${s(!1)}`,children:[e.getDate(),c]}):/* @__PURE__ */m("button",{type:"button","data-active":t===ie,tabIndex:t===ie?0:-1,disabled:l,"aria-label":i,"aria-current":t===O?"date":void 0,onClick:()=>{Q(t),N(t)},className:s(!0),children:[e.getDate(),c]})},t)})},t))]})]})}export{w as Calendar};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-BYDSBDVS.js";import{Select_default as l}from"./chunk-PY7GHIYF.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-3RDJFCIZ.js";import{Input_default as c}from"./chunk-HRDR56SK.js";import{Button_default as s}from"./chunk-EVYD6UFQ.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
|
|
3
3
|
/* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
|
|
4
4
|
/* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveGrip as t,MoveHint as r,moveFromKey as a}from"./chunk-
|
|
1
|
+
import{MOVE_KEYS as e,MoveGrip as t,MoveHint as r,moveFromKey as a}from"./chunk-WM2BBRT6.js";import{ItemCount as n}from"./chunk-KWTK6TGH.js";import{GROUP_COLORS as o}from"./chunk-JMGDGNM7.js";import{Icon as i}from"./chunk-T3NLFOLW.js";import{OneLineLabel as s}from"./chunk-G67CJAQ2.js";import{Tooltip as l}from"./chunk-SOZCWT6I.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{useShellStrings as d}from"./chunk-TJSJVC6P.js";import{useRef as u,useCallback as p,useId as m,isValidElement as f}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";var b='[role="treeitem"]';function v(e){return[...e.querySelectorAll(b)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function y({"aria-label":e,"aria-labelledby":t,children:r,className:a="",rootProps:n}){const o=u(null);c(()=>{const e=o.current;if(!e)return;const t=[...e.querySelectorAll(b)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??v(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=p(e=>{n?.onKeyDown?.(e);const t=o.current,r=e.target.closest?.(b);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const a=v(t),i=a.indexOf(r),s=Number(r.getAttribute("aria-level")??"1"),l=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(b))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":l(a[i+1]);break;case"ArrowUp":l(a[i-1]);break;case"Home":l(a[0]);break;case"End":l(a[a.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=a[i+1];t&&Number(t.getAttribute("aria-level")??"1")>s?l(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(a[e].getAttribute("aria-level")??"1")<s){l(a[e]);break}}},[n]);/* @__PURE__ */
|
|
2
2
|
return h("div",{...n,ref:o,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${a}`.trim(),children:r})}function x({children:e,hidden:t,className:r=""}){/* @__PURE__ */
|
|
3
3
|
return h("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}var k=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal"].join(" "),w=`${k} bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600`;function N(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!f(e)&&"label"in e}function A(e){if(null==e||!1===e||"number"==typeof e)return null;const t=Array.isArray(e)&&e.length>0&&e.every(N)?e:N(e)?[e]:null;return t?t.map((e,t)=>/* @__PURE__ */h("span",{"data-tree-count":"","data-tone":e.tone,className:e.tone?`${k} ${o[e.tone]}`:w,children:e.label},t)):/* @__PURE__ */h("span",{"data-tree-count":"",className:w,children:e})}function j({children:e,count:t,countLabel:r,expanded:a,onToggle:o}){const i=void 0!==a,l=
|
|
4
4
|
/* @__PURE__ */h("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */h(s,{children:e})}),c="number"==typeof t?/* @__PURE__ */h(n,{count:t,label:r,showZero:!0}):null!=t&&!1!==t&&/* @__PURE__ */h("span",{"data-tree-count":"",className:w,children:t}),d="text-xs font-semibold uppercase tracking-wide text-ink-faint";return i?/* @__PURE__ */h("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */g("button",{type:"button","aria-expanded":a,onClick:o,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-ink-strongest","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",d].join(" "),children:[
|
|
5
5
|
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:$(!!a)}),l,c]})}):/* @__PURE__ */g("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${d}`,children:[
|
|
6
|
-
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,c]})}var $=e=>/* @__PURE__ */h(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),
|
|
7
|
-
return g("div",{...H,role:"treeitem","aria-level":i,"aria-selected":d,"aria-expanded":
|
|
8
|
-
/* @__PURE__ */h(t,{marker:"tree",hint:
|
|
9
|
-
/* @__PURE__ */h("span",
|
|
10
|
-
/* @__PURE__ */g("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[
|
|
11
|
-
/* @__PURE__ */h("span",{"data-tree-name":"",className:`flex min-w-0 ${d?"font-semibold":"font-medium"} ${v?"text-ink-faintest line-through":""}`,children:/* @__PURE__ */g(s,{children:[o,null!=c&&/* @__PURE__ */h("span",{className:"ml-2 font-normal text-ink-faint",children:c})]})}),A(y),null!=
|
|
12
|
-
/* @__PURE__ */g("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:
|
|
6
|
+
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,c]})}var $=e=>/* @__PURE__ */h(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),C={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function D({label:o,level:i=1,icon:l,preview:c,selected:d=!1,tone:u,expanded:p,onToggle:f,onSelect:b,muted:v=!1,badge:y,count:x,countLabel:k,actions:w,actionsPinned:N=!1,actionsOverlay:j=!0,rename:D,drop:P,dragging:K=!1,draggable:T=!1,dragHint:I,onMove:W,rowProps:H,className:L=""}){const S=void 0!==p,E=m(),J=x??("number"==typeof y?y:void 0),M=[H?.["aria-describedby"],W?E:void 0].filter(Boolean).join(" ")||void 0,B="shared"===u?"text-[color:var(--status-success-soft-ink)]":null,G=d?B?`bg-[var(--status-success-soft)] ${B}`:"bg-accent-tint text-blue-700":"into"===P?`bg-accent-tint ${B??"text-ink-strongest"}`:`${B??"text-ink"} hover:bg-gray-100`;/* @__PURE__ */
|
|
7
|
+
return g("div",{...H,role:"treeitem","aria-level":i,"aria-selected":d,"aria-expanded":S?p:void 0,"data-tone":u,tabIndex:d?0:-1,"aria-keyshortcuts":H?.["aria-keyshortcuts"]??(W?e:void 0),"aria-describedby":M,"data-drop":P,"data-draggable":T||void 0,onKeyDown:e=>{if(H?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=a(e);t&&W?(e.preventDefault(),W(t)):"Enter"!==e.key&&" "!==e.key||!b?("ArrowRight"===e.key&&S&&!p&&f||"ArrowLeft"===e.key&&S&&p&&f)&&(e.preventDefault(),f()):(e.preventDefault(),b())},onClick:e=>{H?.onClick?.(e),e.defaultPrevented||b?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",T?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",G,"into"===P?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",K?"opacity-40":"",L].filter(Boolean).join(" "),children:["before"===P&&/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===P&&/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),T&&
|
|
8
|
+
/* @__PURE__ */h(t,{marker:"tree",hint:I,dragging:K,revealClassName:"group-hover/treerow:opacity-100"}),
|
|
9
|
+
/* @__PURE__ */h("span",S?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),f?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:$(!!p)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=l&&/* @__PURE__ */h("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(v?"text-ink-faintest":""),children:l}),
|
|
10
|
+
/* @__PURE__ */g("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[D??
|
|
11
|
+
/* @__PURE__ */h("span",{"data-tree-name":"",className:`flex min-w-0 ${d?"font-semibold":"font-medium"} ${v?"text-ink-faintest line-through":""}`,children:/* @__PURE__ */g(s,{children:[o,null!=c&&/* @__PURE__ */h("span",{className:"ml-2 font-normal text-ink-faint",children:c})]})}),A(y),null!=J&&/* @__PURE__ */h(n,{count:J,label:k,active:d,showZero:!0,className:"ml-auto"}),null!=w&&!j&&/* @__PURE__ */h("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:`${null!=J?"":"ml-auto "}flex shrink-0 items-center gap-0.5 transition-opacity ${N||v?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"}`,children:w})]}),null!=w&&j&&
|
|
12
|
+
/* @__PURE__ */g("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:C,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(N||v||d?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
|
|
13
13
|
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
14
14
|
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
15
|
-
/* @__PURE__ */h("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:w})]}),
|
|
15
|
+
/* @__PURE__ */h("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:w})]}),W&&/* @__PURE__ */h(r,{id:E})]})}function P({onAdd:e,label:t,drop:r=!1,slotProps:a}){const n=d().tree,o=r?n.dropHere:t??n.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
|
|
16
16
|
return h("div",{...a,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */g("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
|
|
17
17
|
/* @__PURE__ */h("span",{"aria-hidden":"true",children:"+"}),o]}):/* @__PURE__ */h("span",{className:i,children:o})})}function K({onInsert:e,label:t,drop:r=!1,seamProps:a}){const n=d().tree,o=t??n.insertHere,s=r?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
|
|
18
18
|
return g("div",{...a,role:"presentation","data-tree-seam":"","data-drop":r||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${a?.className??""}`.trim(),children:[
|
|
19
19
|
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
|
|
20
|
-
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${s}`}),e&&/* @__PURE__ */h(l,{content:o,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */h("button",{type:"button","aria-label":o,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */h(i,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}export{y as Tree,P as TreeEmptySlot,x as TreeGroup,j as TreeGroupLabel,
|
|
20
|
+
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${s}`}),e&&/* @__PURE__ */h(l,{content:o,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */h("button",{type:"button","aria-label":o,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */h(i,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}export{y as Tree,P as TreeEmptySlot,x as TreeGroup,j as TreeGroupLabel,D as TreeRow,K as TreeSeam};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-Q3RJMQYE.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-T3NLFOLW.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as k}from"./chunk-TJSJVC6P.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as j,useCallback as S,useEffect as H}from"react";import{createPortal as T}from"react-dom";import{jsxs as C,jsx as E,Fragment as O}from"react/jsx-runtime";var I=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=N(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},x){const N=t,$=k(),D=d(),j=f??D,S=w(),H=/* @__PURE__ */C("select",{ref:x,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,j?S:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:i}),
|
|
2
|
+
/* @__PURE__ */E(A,{items:r})]});return j?/* @__PURE__ */C(O,{children:[H,
|
|
3
|
+
/* @__PURE__ */E("span",{id:S,hidden:!0,children:$.settingView.auto})]}):H});function A({items:e}){const t=e=>/* @__PURE__ */E("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
4
|
+
return E(O,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */E("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var R=N(function({value:l,onChange:u,options:N,placeholder:z,invalid:R,className:U="",id:V,disabled:B,size:K,touchSize:L,title:P,multiple:W,renderOption:Y,renderValue:F,valueText:J,readOnly:M=!1,footer:G,changed:Q=!1,auto:q,"aria-describedby":X,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=$(!1),[ne,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!G?.length,me="sm"===K,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=$(null),ge=k(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),ke=w(),Ne=`${ke}-listbox`,we=V??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,je=d(),Se=q??je,He=`${ke}-auto`,Te=[X,Q?De:void 0,Se?He:void 0].filter(Boolean).join(" ")||void 0,Ce=j(()=>n(N),[N]),Ee=W?l:[],Oe=u,Ie=f(oe,re,{matchTriggerWidth:!0,...G?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze=`${re}|${Ie?.top}|${Ie?.bottom}|${Ie?.maxHeight}|${N.length}`;g(()=>{be(null)},[ze]),g(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,ze]);const Ae=W?Ce.findIndex(e=>Ee.includes(e.value)):Ce.findIndex(e=>e.value===l),Re=W?Ce.filter(e=>Ee.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ae>=0?Ce[Ae].label:void 0,Ue=!W&&Ae>=0?Ce[Ae].lang:void 0,Ve=W?Ce.filter(e=>Ee.includes(e.value)):Ae>=0?[Ce[Ae]]:[],Be=F&&Ve.length?F(Ve):void 0,Ke=void 0!==Be&&J?J(Ve):void 0,Le=S((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Pe=S(()=>{B||M||(ae(Ae>=0?Ae:e(Ce)),ie(!0))},[B,M,Ce,Ae]),We=S(e=>{const t=Ce[e];if(t&&!t.disabled){if(W){const r=l;return Oe(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Oe(t.value),Le()}},[Ce,W,l,Oe,Le]);H(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Le(),!0),ue)},[re,Le]),H(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Le(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Le(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Le]),H(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const Ye=S(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:Ae,n=t(Ce,r.buffer,i);n<0||(re?ae(n):W?(ae(n),ie(!0)):We(n))},[re,ne,Ae,Ce,We,W]),Fe=re?a(N,(e,t)=>{const r=(i=e.value,W?Ee.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
|
|
5
|
+
return C("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||Y?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>We(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${W?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":n?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[W&&/* @__PURE__ */E(o,{selected:r}),Y?/* @__PURE__ */E("span",{className:"block min-w-0 flex-1 truncate",children:Y(e,{selected:r,active:n})}):W?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1",children:[
|
|
6
|
+
/* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:I(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
|
|
7
|
+
/* @__PURE__ */C(O,{children:[
|
|
8
|
+
/* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:I(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Je=void 0!==Be?
|
|
9
|
+
/* @__PURE__ */C("span",{className:"relative block min-w-0 truncate",children:[
|
|
10
|
+
/* @__PURE__ */E("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Be}),
|
|
11
|
+
/* @__PURE__ */E("span",{lang:void 0===Ke?Ue:void 0,className:"sr-only",children:Ke??Re})]}):/* @__PURE__ */E("span",{lang:Ue,className:`block truncate ${void 0===Re?c:""}`,children:Re??z??" "}),Me={zIndex:h.popup,left:Ie?.left,top:Ie?.top,bottom:Ie?.bottom,width:Ie?.width,maxHeight:Ie?.maxHeight??b,visibility:Ie?void 0:"hidden",...x()},Ge=/* @__PURE__ */E("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":W||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Me,maxHeight:fe}:Me,children:Fe}),Qe=pe?/* @__PURE__ */C("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Me,children:[Ge,
|
|
12
|
+
/* @__PURE__ */E("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:G.map((e,t)=>/* @__PURE__ */C("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Le(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(G?.length??0)-1,i=t=>{e.preventDefault(),ce.current[t]?.focus()},n=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void i(Math.min(t+1,r));case"ArrowUp":return void(0===t?n():i(t-1));case"Home":return void i(0);case"End":return void i(r);case"Tab":return e.shiftKey?void(0===t?n():i(t-1)):t<r?void i(t+1):(e.preventDefault(),void Le());case"Escape":return e.preventDefault(),e.stopPropagation(),void Le()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */E(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
13
|
+
/* @__PURE__ */E("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Ge;/* @__PURE__ */
|
|
14
|
+
return C("div",{ref:le,className:"relative",children:[
|
|
15
|
+
/* @__PURE__ */E("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?Ne:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":R||void 0,"aria-describedby":Te,"aria-label":Z,"aria-labelledby":_,title:P,disabled:B,"aria-readonly":M||void 0,onClick:()=>re?Le():Pe(),onKeyDown:t=>{if(!B&&!M)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(Ce,e,1)):Pe());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(Ce,e,-1)):Pe());case"Home":return void(re&&(t.preventDefault(),ae(e(Ce))));case"End":return void(re&&(t.preventDefault(),ae(r(Ce))));case"Enter":return void(re&&(t.preventDefault(),We(ne)));case" ":return t.preventDefault(),void(re?We(ne):Pe());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Le()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Le(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Ye(t.key))}},className:s({invalid:R,size:K,readOnly:M,auto:Se,className:`${M?"":"pr-8 "}text-left ${U}`.trim()}),children:Q?
|
|
16
|
+
/* @__PURE__ */C("span",{className:"flex min-w-0 items-center gap-1",children:[Je,
|
|
17
|
+
/* @__PURE__ */E("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Je}),Q&&/* @__PURE__ */E("span",{id:De,hidden:!0,children:ge.select.changed}),Se&&/* @__PURE__ */E("span",{id:He,hidden:!0,children:ge.settingView.auto}),!M&&/* @__PURE__ */E(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
|
|
18
|
+
/* @__PURE__ */C("select",{ref:te,value:l,multiple:W||void 0,onChange:e=>Oe(W?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:B,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==z&&!W&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:z}),
|
|
19
|
+
/* @__PURE__ */E(A,{items:N})]}),re&&T(Qe,document.body)]})}),U=N(function({touchSize:e,...t},r){const i=u(),n=e??"touch";return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */E(z,{ref:r,...t,size:n}):/* @__PURE__ */E(R,{ref:r,...t}):/* @__PURE__ */E(R,{ref:r,...t,size:n})});export{z as NativeSelect,U as Select_default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as t}from"./chunk-
|
|
1
|
+
import{Icon as t}from"./chunk-T3NLFOLW.js";import{jsxs as n,jsx as e}from"react/jsx-runtime";var r=t=>Array.isArray(t.options);function o(t){const n=[];for(const e of t)r(e)?n.push(...e.options):n.push(e);return n}function i(t,n){const e=[];for(const o of t){if(!r(o)){n(o)&&e.push(o);continue}const t=o.options.filter(n);t.length&&e.push({...o,options:t})}return e}function s(t,o,i,s=""){const a=[];let c=0;return t.forEach((t,u)=>{if(!r(t))return a.push(o(t,c)),void(c+=1);const l=`${i}-group-${u}`,p=c;c+=t.options.length,a.push(
|
|
2
2
|
/* @__PURE__ */n("div",{role:"group","aria-labelledby":l,children:[
|
|
3
3
|
/* @__PURE__ */e("div",{id:l,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${s}`.trim(),children:t.label}),t.options.map((t,n)=>o(t,p+n))]},l))}),a}function a({selected:n}){/* @__PURE__ */
|
|
4
4
|
return e(t,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(n?"":"invisible"),strokeWidth:2.5})}function c(t,n){return t.label.toLowerCase().includes(n)||(t.sublabel?.toLowerCase().includes(n)??!1)}function u({children:t,grows:n=!1}){/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-2X4U3VX2.js";import{Avatar as t}from"./chunk-QMNDKNK2.js";import{Input_default as a}from"./chunk-HRDR56SK.js";import{Button_default as i}from"./chunk-EVYD6UFQ.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
|
|
3
3
|
/* @__PURE__ */n(t,{name:e.name,status:e.status}),
|
|
4
4
|
/* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellLocale as e}from"./chunk-
|
|
1
|
+
import{useShellLocale as e}from"./chunk-TJSJVC6P.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{useState as r,useEffect as n,Children as i}from"react";import{jsxs as l,jsx as a}from"react/jsx-runtime";var s={xs:24,sm:32,md:40,lg:56},o={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function m(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function c({src:e,name:t,size:i="md",status:c,className:u=""}){const h=s[i],f=Math.max(8,Math.round(.28*h)),[d,g]=r(!1);n(()=>{g(!1)},[e]);const y=Boolean(e)&&!d;
|
|
2
2
|
/* @__PURE__ */
|
|
3
3
|
return l("span",{className:`relative inline-flex shrink-0 ${u}`.trim(),style:{width:h,height:h},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[y?/* @__PURE__ */a("img",{src:e,alt:"",onError:()=>g(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */a("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",style:{fontSize:Math.round(.4*h)},children:m(t)}),c&&/* @__PURE__ */a("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${o[c]}`,style:{width:f,height:f}})]})}function u({children:r,max:n,size:o="md",className:m=""}){const c=i.toArray(r),u=n?c.slice(0,n):c,h=n?c.length-u.length:0,f=s[o],d=Math.round(.3*f),g=e();/* @__PURE__ */
|
|
4
4
|
return l("div",{className:`flex items-center ${m}`.trim(),children:[u.map((e,t)=>/* @__PURE__ */a("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-d},children:e},t)),h>0&&/* @__PURE__ */l("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:f,height:f,marginLeft:-d,fontSize:Math.round(.36*f)},children:["+",t(h,g)]})]})}export{c as Avatar,u as AvatarGroup};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellStrings as e,useShellLocale as a}from"./chunk-
|
|
1
|
+
import{useShellStrings as e,useShellLocale as a}from"./chunk-TJSJVC6P.js";import{formatPlain as n}from"./chunk-C3QOHMR6.js";import{useState as i,useId as d}from"react";import{jsx as r,jsxs as c,Fragment as s}from"react/jsx-runtime";var o={band:"es-group-head",row:"es-group-sub"},l=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("");function t({items:t,defaultOpenIds:u=[],openIds:p,onOpenChange:m,allowMultiple:h=!1,level:N=3,tier:g="band",keepMounted:b=!1,className:$=""}){const v=e(),f=a(),[x,y]=i(u),I=d(),j=`h${N}`,k=p??x;/* @__PURE__ */
|
|
2
2
|
return r("div",{"data-accordion":g,className:$||void 0,children:t.map(e=>{const a=k.includes(e.id),i=e.headId??`${I}-${l(e.id)}-head`,d=e.headId?`${e.headId}-body`:`${I}-${l(e.id)}-panel`,t=a||b;/* @__PURE__ */
|
|
3
3
|
return c("div",{className:e.className?`es-group ${e.className}`:"es-group",children:[
|
|
4
4
|
/* @__PURE__ */r(j,{className:"es-group-title",children:/* @__PURE__ */c("button",{type:"button",id:i,disabled:e.disabled,"aria-expanded":a,"aria-controls":t?d:void 0,onClick:()=>(e=>{const a=k.includes(e)?k.filter(a=>a!==e):h?[...k,e]:[e];void 0===p&&y(a),m?.(a)})(e.id),className:o[g],children:[null!=e.icon&&/* @__PURE__ */r("span",{"aria-hidden":"true",className:"es-group-icon",children:e.icon}),e.title,"number"==typeof e.count&&e.count>0&&
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-
|
|
2
|
-
return p(n,{portal:!0,minWidth:x,style:
|
|
1
|
+
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-JOD5ISTB.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-CRRC72EE.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:D="",autoFocus:H=!0}){const L=s(null),S=a(),[j,A]=d(null),C=s(w);C.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});A(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const U=s(null),T=s(!1);m(()=>(U.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||U.current?.focus?.({preventScroll:!0})}),[]),m(()=>{j&&!T.current&&H&&(T.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[j,H]),m(()=>{if(H)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[H]),m(()=>u(e=>"Escape"===e.key&&(C.current(),!0),()=>L.current),[]),m(()=>{const e=()=>C.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const W=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void C.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),B=j?{left:j.left,top:j.top,maxHeight:j.maxHeight,...j.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
|
|
2
|
+
return p(n,{portal:!0,minWidth:x,style:B,onClose:w,className:D,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:S,role:"menu","aria-label":b,"aria-describedby":y?t(y,S):void 0,"data-context-menu":"",onKeyDown:W,children:[y&&e(y,{menuId:S,choose:e=>{e.disabled||(C.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>C.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
|