efficient-shell 8.18.1 → 8.20.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 +25 -8
- package/dist/{Browser-EE7TUWTN.js → Browser-KK4DSPFA.js} +14 -14
- package/dist/Calculator-PH6NVEEZ.js +29 -0
- package/dist/{CurrencyConverter-NDMWLX7M.js → CurrencyConverter-PD2CEL6V.js} +8 -8
- package/dist/{Documents-XSDBD4T7.js → Documents-QRU3INP2.js} +5 -5
- package/dist/Files-NQBM46JA.js +87 -0
- package/dist/{Notepad-2SXHFPFX.js → Notepad-KU2VK5QB.js} +10 -10
- package/dist/{PdfViewer-456B27TB.js → PdfViewer-GODDA4GG.js} +1 -1
- package/dist/{PomodoroTimer-L72X22QZ.js → PomodoroTimer-JEQTTMGA.js} +57 -57
- package/dist/{Preview-DJHBCRKW.js → Preview-C6VU5P3N.js} +49 -49
- package/dist/Sidebar-SJMMY2Y2.js +43 -0
- package/dist/{Spreadsheet-VHFYYFLK.js → Spreadsheet-HLH3EHCX.js} +14 -14
- package/dist/{Stock-C3DDF3V3.js → Stock-VCMJMUCW.js} +7 -7
- package/dist/{Weather-2XG5AIW2.js → Weather-HF3E3N3M.js} +16 -16
- package/dist/{WorldClock-2MU5CFUN.js → WorldClock-PM5CJQSL.js} +6 -6
- package/dist/ai/index.js +11 -11
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/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-KH6GERFP.js → chunk-2GPXC6JX.js} +1 -1
- package/dist/{chunk-WDIFRAQM.js → chunk-2SHDXTB6.js} +4 -4
- package/dist/{chunk-QTNPOMXM.js → chunk-36DYXGQI.js} +5 -5
- package/dist/{chunk-O5PJELY7.js → chunk-3AVHOYQZ.js} +1 -1
- package/dist/{chunk-KW4VUPJV.js → chunk-3KDY6V6I.js} +8 -8
- package/dist/{chunk-Z7PS4QUO.js → chunk-3NWCVZRK.js} +6 -6
- package/dist/{chunk-JSVYN6D6.js → chunk-3P7SBAKK.js} +1 -1
- package/dist/{chunk-YFY2LSWZ.js → chunk-3RM3D2P3.js} +6 -6
- package/dist/{chunk-DQEST7MN.js → chunk-3V6UFR7M.js} +1 -1
- package/dist/{chunk-2ZIVFBJN.js → chunk-3WM23XSR.js} +6 -6
- package/dist/{chunk-TDAFCJY7.js → chunk-47MFBFIX.js} +4 -4
- package/dist/{chunk-2YZ3ITNG.js → chunk-4FOTTLL7.js} +2 -2
- package/dist/{chunk-BVDGHZ4H.js → chunk-4MTC6HA5.js} +2 -2
- package/dist/{chunk-DBBUHXRT.js → chunk-4TER5BHR.js} +1 -1
- package/dist/chunk-4YARHVZH.js +6 -0
- package/dist/{chunk-3NU2B2WM.js → chunk-55DONELU.js} +9 -9
- package/dist/{chunk-F2HM7SV4.js → chunk-5GMWOYTF.js} +1 -1
- package/dist/{chunk-EA37JL6P.js → chunk-5JQCPUEO.js} +1 -1
- package/dist/{chunk-YGITR6I5.js → chunk-5TVF4BCM.js} +1 -1
- package/dist/{chunk-XW56UIDQ.js → chunk-5VUVKP55.js} +6 -6
- package/dist/{chunk-NQ46AZ3D.js → chunk-6SBPGUSR.js} +1 -1
- package/dist/chunk-6UOMJ7E4.js +2 -0
- package/dist/{chunk-4JCNWUVZ.js → chunk-7HTURXIA.js} +2 -2
- package/dist/{chunk-A3MOA3T7.js → chunk-7RD623PT.js} +1 -1
- package/dist/{chunk-FJUFQXDS.js → chunk-7SPX7DLO.js} +21 -21
- package/dist/{chunk-DGTP6BGV.js → chunk-ABD5X73I.js} +1 -1
- package/dist/chunk-ABDT4M5L.js +19 -0
- package/dist/{chunk-UNDHDLWB.js → chunk-AILWMDWP.js} +1 -1
- package/dist/{chunk-HKAWQF7O.js → chunk-AK632G3F.js} +7 -7
- package/dist/{chunk-SACUPX6L.js → chunk-AZWEWGYG.js} +3 -3
- package/dist/chunk-B36HEVMT.js +28 -0
- package/dist/{chunk-ABD34D3N.js → chunk-B5MOPSMW.js} +3 -3
- package/dist/{chunk-R6WJ2NTT.js → chunk-BIEKHPZ5.js} +72 -72
- package/dist/chunk-BTWEZX3M.js +5 -0
- package/dist/chunk-BZWTFLQD.js +15 -0
- package/dist/{chunk-LWGNNVDA.js → chunk-CDBS47XI.js} +1 -1
- package/dist/{chunk-K2DUF2AR.js → chunk-CHOMUTLT.js} +1 -1
- package/dist/{chunk-U5YJREQJ.js → chunk-CIGHIX6Z.js} +10 -10
- package/dist/{chunk-P5ILG2DA.js → chunk-CQAXN3HN.js} +1 -1
- package/dist/{chunk-QTK5NV7L.js → chunk-CQXKO5PB.js} +1 -1
- package/dist/{chunk-6JLZMVVE.js → chunk-CVNM25BM.js} +5 -5
- package/dist/{chunk-TPDOOCFS.js → chunk-CY5N5OA3.js} +1 -1
- package/dist/{chunk-5WYCXSUM.js → chunk-D6FSZBJ5.js} +1 -1
- package/dist/chunk-DAJTVAWO.js +11 -0
- package/dist/{chunk-2MMEGCYI.js → chunk-DAV7SMCJ.js} +1 -1
- package/dist/{chunk-QCP4F6EF.js → chunk-DBDJQVQM.js} +1 -1
- package/dist/{chunk-HBBTB6RW.js → chunk-DBLJIK5J.js} +1 -1
- package/dist/{chunk-2VFRVO3N.js → chunk-DCNXCFAD.js} +28 -28
- package/dist/{chunk-TSOK3QNK.js → chunk-E2YGQAFU.js} +1 -1
- package/dist/{chunk-K5UPORAA.js → chunk-E4O2ZMXF.js} +1 -1
- package/dist/{chunk-VSQSBY2P.js → chunk-ENVCMR3M.js} +5 -5
- package/dist/{chunk-ZQGPJZY4.js → chunk-EQZAHIUG.js} +2 -2
- package/dist/{chunk-Y67ILJVG.js → chunk-EVPOZQOI.js} +1 -1
- package/dist/{chunk-WVWIRII2.js → chunk-EXVR3BWW.js} +9 -9
- package/dist/{chunk-HIDOSOI4.js → chunk-F22KWATP.js} +1 -1
- package/dist/{chunk-AAYACT5T.js → chunk-F4PESM6A.js} +4 -4
- package/dist/{chunk-KAELFRN4.js → chunk-F5VXS5JO.js} +1 -1
- package/dist/{chunk-EOPPYQIT.js → chunk-FBSQABH2.js} +1 -1
- package/dist/{chunk-BG5BCF64.js → chunk-FFZ7KPIV.js} +7 -7
- package/dist/{chunk-UB6TIA2R.js → chunk-FOSCSAJZ.js} +1 -1
- package/dist/{chunk-NU55QIUV.js → chunk-G3IG4X4Z.js} +1 -1
- package/dist/chunk-GSS4E7X3.js +1 -0
- package/dist/{chunk-ZVK74ERI.js → chunk-H5GQWWPA.js} +1 -1
- package/dist/chunk-H5VGRHNT.js +9 -0
- package/dist/chunk-HLGE6TVE.js +4 -0
- package/dist/{chunk-HNFLUVVM.js → chunk-HME2P5VX.js} +22 -22
- package/dist/chunk-HXJZ46JT.js +1 -0
- package/dist/{chunk-37DRDM4D.js → chunk-IGH6DECG.js} +13 -13
- package/dist/{chunk-EO2XHSIK.js → chunk-IH4SVMXJ.js} +2 -2
- package/dist/{chunk-CG4KTWP4.js → chunk-IM7QHAXT.js} +5 -5
- package/dist/{chunk-HQIUFRWO.js → chunk-J324R2BM.js} +1 -1
- package/dist/{chunk-I5T3A4KI.js → chunk-J67YIQEN.js} +1 -1
- package/dist/chunk-JH4W3R4Q.js +11 -0
- package/dist/{chunk-A3R6DKQ5.js → chunk-JJ6IUIYX.js} +1 -1
- package/dist/{chunk-7NOU275V.js → chunk-JSB5G2XQ.js} +2 -2
- package/dist/{chunk-LDHYCVMV.js → chunk-KATRRQD5.js} +1 -1
- package/dist/{chunk-APMBWBD7.js → chunk-KB6BGPQK.js} +1 -1
- package/dist/{chunk-MVYOBV4I.js → chunk-KE6NYTGF.js} +2 -2
- package/dist/chunk-KKZZAK76.js +1 -0
- package/dist/chunk-KS3AQKHD.js +8 -0
- package/dist/chunk-KSSIZW3C.js +6 -0
- package/dist/{chunk-DTJQHW3Q.js → chunk-KZ6P7WC6.js} +1 -1
- package/dist/chunk-LKRQXIOG.js +4 -0
- package/dist/{chunk-2QYQDCJE.js → chunk-LMOPRRQY.js} +10 -10
- package/dist/chunk-LV2YFFA6.js +6 -0
- package/dist/chunk-LYLEH25Y.js +1 -0
- package/dist/{chunk-3XLDWJDG.js → chunk-MBXTOYMX.js} +6 -6
- package/dist/{chunk-BJGD2ZWK.js → chunk-MQADQ4YF.js} +1 -1
- package/dist/{chunk-SGVIMTN6.js → chunk-MRBC7GLE.js} +17 -17
- package/dist/{chunk-CGY5RNAF.js → chunk-MVCNSGM4.js} +2 -2
- package/dist/{chunk-SLC3KT7F.js → chunk-N7KL336H.js} +6 -6
- package/dist/{chunk-NADUURUA.js → chunk-NGVODCMV.js} +1 -1
- package/dist/chunk-NI76QOA2.js +2 -0
- package/dist/{chunk-GVYJYXVH.js → chunk-NZ67C5OK.js} +10 -10
- package/dist/{chunk-2RKTVTJJ.js → chunk-O3HXASSH.js} +1 -1
- package/dist/{chunk-HQNR4JQG.js → chunk-O43QLNPL.js} +1 -1
- package/dist/{chunk-Q6BY4BME.js → chunk-OAYHU7YN.js} +1 -1
- package/dist/{chunk-QMLG5XKP.js → chunk-OHSJWKNV.js} +5 -5
- package/dist/{chunk-SS7BG7BS.js → chunk-PXCARPLZ.js} +1 -1
- package/dist/{chunk-73FD77RD.js → chunk-Q2S76TZH.js} +1 -1
- package/dist/{chunk-KIYO4U4T.js → chunk-Q6YPDR7U.js} +12 -12
- package/dist/{chunk-AG3ALTVD.js → chunk-Q75PSCZ5.js} +10 -10
- package/dist/{chunk-6EAVTBKE.js → chunk-QKHTL3FQ.js} +4 -4
- package/dist/{chunk-LJVLMM3Q.js → chunk-QSPW43OC.js} +7 -7
- package/dist/{chunk-ZXI4CWTI.js → chunk-R6L6PKQP.js} +1 -1
- package/dist/{chunk-Z3ZIVVKE.js → chunk-RC5SGXXR.js} +1 -1
- package/dist/{chunk-LAHK4WVH.js → chunk-RHYMHVFS.js} +8 -8
- package/dist/{chunk-MWGVFDEV.js → chunk-RQ5RVKRO.js} +2 -2
- package/dist/chunk-RYC3ZHXM.js +8 -0
- package/dist/{chunk-JBMGI5YX.js → chunk-RZT7QES5.js} +4 -4
- package/dist/{chunk-S2PKTGHB.js → chunk-SIQSD3QT.js} +6 -6
- package/dist/chunk-TCB2J3PS.js +9 -0
- package/dist/chunk-THPTJGV5.js +8 -0
- package/dist/{chunk-JLDGZFNY.js → chunk-TKBP5HRY.js} +12 -12
- package/dist/{chunk-RPY7FBYY.js → chunk-U62AWCZR.js} +1 -1
- package/dist/{chunk-EFUQ4KAH.js → chunk-UELYZT4T.js} +1 -1
- package/dist/{chunk-HKTU536H.js → chunk-UEMGH6EO.js} +1 -1
- package/dist/{chunk-FJ72DO6A.js → chunk-UEUCGC6G.js} +1 -1
- package/dist/{chunk-HMA4ZSCS.js → chunk-VO3HT6IK.js} +1 -1
- package/dist/{chunk-5N6VSOZV.js → chunk-VWVFKMU7.js} +1 -1
- package/dist/{chunk-PEEVPAIJ.js → chunk-VXWCX65A.js} +1 -1
- package/dist/chunk-VYKITRFG.js +12 -0
- package/dist/{chunk-56CQPUIJ.js → chunk-WGSIYW63.js} +14 -14
- package/dist/chunk-WMO2JQNL.js +8 -0
- package/dist/chunk-X7ZBGXUU.js +1 -0
- package/dist/{chunk-WVSLFX37.js → chunk-XBXEK6XP.js} +7 -7
- package/dist/{chunk-6MN2JR25.js → chunk-XDAR2DSX.js} +10 -10
- package/dist/{chunk-V7NVQ3Z7.js → chunk-XSFQR374.js} +1 -1
- package/dist/{chunk-QAR4NYW6.js → chunk-XUK35DKG.js} +1 -1
- package/dist/{chunk-USE4HNZ2.js → chunk-XXBGWT7L.js} +1 -1
- package/dist/chunk-Y2P5HTP5.js +4 -0
- package/dist/{chunk-I74FRKHQ.js → chunk-Y65MPP3M.js} +1 -1
- package/dist/chunk-YKDKVSAL.js +4 -0
- package/dist/{chunk-4NB3WHWK.js → chunk-YUIWG2QT.js} +1 -1
- package/dist/{chunk-4S724CEA.js → chunk-YZCRHDOB.js} +1 -1
- package/dist/{chunk-V5GDA4I6.js → chunk-Z6V3EY6F.js} +3 -3
- package/dist/{chunk-UJULZQM2.js → chunk-ZDJNTOUS.js} +1 -1
- package/dist/{chunk-ZVY4J3PU.js → chunk-ZLHF5XRR.js} +7 -7
- package/dist/{chunk-MPN267PR.js → chunk-ZNZDV6SN.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/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/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.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/Select.d.ts +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/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/efficient-glyphs.d.ts +2 -0
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.d.ts +4 -0
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +2 -0
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.d.ts +2 -0
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/glyphs/DetachIcon.d.ts +8 -0
- package/dist/icons/glyphs/DetachIcon.js +1 -0
- package/dist/icons/glyphs/SharedIcon.d.ts +8 -0
- package/dist/icons/glyphs/SharedIcon.js +1 -0
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/DetachMiniIcon.d.ts +8 -0
- package/dist/icons/looks/DetachMiniIcon.js +1 -0
- package/dist/icons/looks/DetachSolidIcon.d.ts +8 -0
- package/dist/icons/looks/DetachSolidIcon.js +1 -0
- package/dist/icons/looks/SharedMiniIcon.d.ts +8 -0
- package/dist/icons/looks/SharedMiniIcon.js +1 -0
- package/dist/icons/looks/SharedSolidIcon.d.ts +8 -0
- package/dist/icons/looks/SharedSolidIcon.js +1 -0
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +17 -2
- package/dist/index.js +695 -695
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +2 -2
- package/dist/{names-DcR-HlYV.d.ts → names-DYWfNBkN.d.ts} +1 -1
- package/dist/page-tabs/index.js +4 -4
- 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/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.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/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/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/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.d.ts +10 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +3 -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.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-YTIRFXXR.js +0 -29
- package/dist/Files-B5HKRQN3.js +0 -87
- package/dist/Sidebar-YCSGGCLW.js +0 -43
- package/dist/chunk-7GCBMTP2.js +0 -4
- package/dist/chunk-B6BE4WSP.js +0 -8
- package/dist/chunk-BE4APEUI.js +0 -2
- package/dist/chunk-CKDFXYYY.js +0 -8
- package/dist/chunk-EUFALBK3.js +0 -1
- package/dist/chunk-F6RM7RLQ.js +0 -1
- package/dist/chunk-FNQJO3HZ.js +0 -11
- package/dist/chunk-FTQ5DH5U.js +0 -8
- package/dist/chunk-GTRUBA2R.js +0 -1
- package/dist/chunk-GVKFLNRP.js +0 -12
- package/dist/chunk-MNQ6EPAR.js +0 -9
- package/dist/chunk-QSVKEONU.js +0 -2
- package/dist/chunk-QYGBWH5J.js +0 -15
- package/dist/chunk-R362N2RJ.js +0 -1
- package/dist/chunk-SXPBOX32.js +0 -1
- package/dist/chunk-VKLVHULL.js +0 -22
- package/dist/chunk-W4YNYZDQ.js +0 -6
- package/dist/chunk-WEJFTUS7.js +0 -9
- package/dist/chunk-YULJ7F6Z.js +0 -19
- package/dist/chunk-ZGCLFQS5.js +0 -8
- package/dist/chunk-ZWQRFYE6.js +0 -11
- /package/dist/{chunk-A6L6FYG4.js → chunk-WYHRPXEX.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{SearchableSelect as e}from"./chunk-
|
|
1
|
+
import{SearchableSelect as e}from"./chunk-NZ67C5OK.js";import{Select_default as a}from"./chunk-Q75PSCZ5.js";import{Input_default as l}from"./chunk-UNEJ2ABD.js";import{labelClasses as t}from"./chunk-EQKUFYX6.js";import{isSafeLinkHref as r}from"./chunk-PJPK2ADX.js";import{INPUT_SIZES as n}from"./chunk-JFSYWEHD.js";import{Button_default as i}from"./chunk-UDD7GB4F.js";import{Icon as o}from"./chunk-42BBJJDP.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-KKZZAK76.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},y=e=>r(e.trim());function k(r){const{value:n,kinds:o,rules:k=x,filtersFor:w,label:N,readOnly:C,placeholder:F,className:j=""}=r,O=void 0!==r.onApply,D=u().link,$=k.isSafe??y,E=d(),K=c(null),P=c(null),[z,A]=p({url:n}),U=O?z.url:n,[J,B]=p(!1),[S,W]=p(null),[Z,Q]=p(null),T=c(()=>{});T.current=O?r.onCancel:()=>{},m(()=>{if(O)return s(e=>{const a=K.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(T.current(),!0)},()=>K.current)},[O]),m(()=>{if(!O)return;const e=P.current;e?(e.focus(),e.select()):K.current?.querySelector("button, input")?.focus()},[]);const H=o??[{value:b,label:D.address,target:{type:"text"}}],L=S&&S.against===U?S.kind:k.kindOf(U),M=H.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===L),R=M.find(e=>"text"===e.target.type),X=M.find(e=>e.value===L)??R??M[0];if(!X)return null;const Y="text"!==X.target.type,q=Y?k.targetOf(U):U,G=h(X.target),V=G.find(e=>e.value===q),I=e=>({value:e,label:D.unavailable(e)}),_="select"===X.target.type&&q&&w?w(q):null,ee=_?k.readFilter(U):null,ae=ee?_?.find(e=>e.param===ee.param):void 0,le=Z&&Z.against===U?Z.text:U,te=!Y&&""!==le.trim()&&!$(le),re=te&&(!O||J),ne=(e,a)=>{O?A({url:e,name:a}):void 0===a?r.onChange(e):r.onChange(e,a)},ie=(e,a)=>{W(a=>a?{...a,against:e}:a),ne(e,a)},oe=e=>{if(!e)return ie("");const a=G.find(a=>a.value===e);ie(e,a?.label)},se=Y?U:le.trim(),ue=()=>{if(!O||!se)return;if(!Y&&te)return void B(!0);const e=Y&&z.url===se?z.name:void 0,a=r.onApply;void 0===e?a(se):a(se,e)},de=(e,a)=>a&&!e.some(e=>e.value===a)?[I(a),...e]:[...e],ce=(l,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const a=r.some(e=>""===e.value);/* @__PURE__ */
|
|
2
2
|
return f(e,{"aria-label":l,value:t,options:o,disabled:C,clearable:a,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
3
|
-
return f(a,{size:"sm","aria-label":l,value:t,options:o,readOnly:C,onChange:n})};let pe;if("text"===X.target.type)pe=/* @__PURE__ */f(l,{ref:
|
|
4
|
-
return f("div",{ref:
|
|
5
|
-
return v("div",{ref:
|
|
3
|
+
return f(a,{size:"sm","aria-label":l,value:t,options:o,readOnly:C,onChange:n})};let pe;if("text"===X.target.type)pe=/* @__PURE__ */f(l,{ref:P,id:`${E}-address`,size:"sm",type:"text",invalid:re,"aria-label":D.address,"aria-describedby":re?`${E}-why`:void 0,placeholder:F??D.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:le,readOnly:C,onChange:e=>(e=>{B(!1);const a=e.trim();a?$(e)?(Q({text:e,against:a}),ie(a)):Q({text:e,against:U}):(Q({text:e,against:""}),ie(""))})(e.target.value)});else{const e="groups"===X.target.type?X.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):X.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:X.target.placeholder},...de(e,q)];pe=ce(X.label,q,a,oe,e.length>10)}const me=/* @__PURE__ */v(g,{children:[o&&ce(D.linkType,X.value,M.map(e=>({value:e.value,label:e.label})),e=>{Q(null),B(!1);const a=M.find(a=>a.value===e);if(!a||"text"===a.target.type)return void W({kind:e,against:U});const l=h(a.target)[0];W({kind:e,against:l?l.value:""}),l?ne(l.value,l.label):ne("")},!1),pe,_&&ce(D.filter,ee?.param??"",[{value:"",label:D.noFilter},...ee&&!ae?[I(ee.param)]:[],..._.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return ie(q,V?.label);const a=_?.find(a=>a.param===e),l=a?.values[0];l&&ie(k.withFilter(q,{param:e,value:l.value}),l.label)},!1),_&&ee&&ce(D.value,ee.value,de((ae?.values??[]).map(e=>({value:e.value,label:e.label})),ee.value),e=>{if(!ee)return;const a=ae?.values.find(a=>a.value===e);ie(k.withFilter(q,{param:ee.param,value:e}),a?.label)},(ae?.values.length??0)>10),re&&/* @__PURE__ */f("p",{id:`${E}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:D.unsafe}),X.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-gray-400",children:X.hint}),_&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-gray-400",children:D.filterHint})]});if(!O)/* @__PURE__ */
|
|
4
|
+
return f("div",{ref:K,className:`flex min-w-0 flex-auto flex-col gap-2 ${j}`.trim(),role:N?"group":void 0,"aria-label":N,children:me});const fe=r.onRemove;/* @__PURE__ */
|
|
5
|
+
return v("div",{ref:K,role:"dialog","aria-label":N??D.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${j}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),ue())},children:[Y?/* @__PURE__ */f("span",{className:t({inline:!0}),children:D.title}):/* @__PURE__ */f("label",{htmlFor:`${E}-address`,className:t({inline:!0}),children:D.title}),me,
|
|
6
6
|
/* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[fe?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:fe,children:D.remove}):null,
|
|
7
7
|
/* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
|
|
8
|
-
/* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>
|
|
8
|
+
/* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>T.current(),children:D.cancel}),
|
|
9
9
|
/* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:ue,disabled:C||""===se,children:D.apply})]})]})]})}function w({label:e,text:a,onTextChange:t,link:r,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const y=u().link,[w,N]=p(!1),C=c(null),F=d(),j=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
|
|
10
10
|
return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
|
|
11
11
|
/* @__PURE__ */f(l,{size:"sm",type:"text",className:"rounded-b-none","aria-label":y.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>t(e.target.value)}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-42BBJJDP.js";import{useShellStrings as r}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-42BBJJDP.js";import{useShellStrings as r}from"./chunk-KKZZAK76.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";var s={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},c={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},a={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function i({tone:r}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
|
|
2
2
|
return n(e,{name:"check",...t});case"error":/* @__PURE__ */
|
|
3
3
|
return n(e,{name:"close",...t});case"warning":/* @__PURE__ */
|
|
4
4
|
return n(e,{name:"error",...t});default:/* @__PURE__ */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ShellStringsProvider as t}from"./chunk-
|
|
1
|
+
import{ShellStringsProvider as t}from"./chunk-KKZZAK76.js";import{createContext as e,useEffect as a,useCallback as n,useMemo as r,useContext as l}from"react";import{jsx as o}from"react/jsx-runtime";var g={tag:"en",name:"English",locale:null},c="react-os-shell:language",u=t=>"string"==typeof t?t:t.tag;function i(t){try{const e=new Intl.Locale(t).maximize();return{language:e.language,script:e.script}}catch{return null}}function s(t,e){const a=e.map(u),n=t.toLowerCase(),r=a.find(t=>t.toLowerCase()===n);if(r)return r;const l=i(t);if(!l)return;const o=a.map(t=>({tag:t,parts:i(t)})).filter(t=>t.parts?.language===l.language);return(o.find(t=>t.parts?.script===l.script)??o[0])?.tag}function f(){try{return globalThis.localStorage?.getItem(c)??null}catch{return null}}function m(t){try{return globalThis.localStorage?.setItem(c,t),globalThis.localStorage?.getItem(c)===t}catch{return!1}}function h({offered:t,fallback:e,saved:a=f(),preferred:n=globalThis.navigator?.languages??[]}){const r=e??(t.length>0?u(t[0]):g.tag);if(a){const e=s(a,t);if(e)return e}for(const e of n){const a=s(e,t);if(a)return a}return r}var d=e({language:g.tag,languages:[g],setLanguage:async()=>{}}),p=()=>globalThis.location?.reload();function b({languages:e,language:l,strings:g,onChange:c,reload:u=p,children:i}){const s=e.find(t=>t.tag===l),f=s?void 0===s.locale?s.tag:s.locale??void 0:void 0;a(()=>{const t=globalThis.document?.documentElement;if(!t)return;const e=t.getAttribute("lang");return t.setAttribute("lang",l),()=>{null===e?t.removeAttribute("lang"):t.setAttribute("lang",e)}},[l]);const h=n(async t=>{if(t!==l&&e.some(e=>e.tag===t)){m(t);try{await(c?.(t))}catch{}u&&u()}},[l,e,c,u]),b=r(()=>({language:l,languages:e,setLanguage:h}),[l,e,h]);/* @__PURE__ */
|
|
2
2
|
return o(d.Provider,{value:b,children:/* @__PURE__ */o(t,{value:g,locale:f,children:i})})}function v(){return l(d)}export{g as ENGLISH,c as SHELL_LANGUAGE_STORAGE_KEY,b as ShellLanguageProvider,s as matchShellLanguage,f as readSavedShellLanguage,h as resolveShellLanguage,m as saveShellLanguage,v as useShellLanguage};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{parseHexColor as e,hexToHsv as r,hsvToHex as a,hexReadout as n,HUE_GRADIENT as o,HEX_MAX_LENGTH as t,svFromPoint as l,hueFromPoint as i}from"./chunk-H245LLX4.js";import{Popover as s}from"./chunk-RNBM5JZI.js";import{InputNumber_default as c}from"./chunk-
|
|
2
|
-
return w("button",{ref:l,type:o,"aria-pressed":a,className:$({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(e)})})}),D=(e,r,a)=>Math.min(a,Math.max(r,e)),I=e=>"string"==typeof e?{value:e}:e;function
|
|
1
|
+
import{parseHexColor as e,hexToHsv as r,hsvToHex as a,hexReadout as n,HUE_GRADIENT as o,HEX_MAX_LENGTH as t,svFromPoint as l,hueFromPoint as i}from"./chunk-H245LLX4.js";import{Popover as s}from"./chunk-RNBM5JZI.js";import{InputNumber_default as c}from"./chunk-IH4SVMXJ.js";import{InSettingRowContext as u}from"./chunk-E4Z5OXBI.js";import{inputClasses as d}from"./chunk-JFSYWEHD.js";import{Tooltip as h}from"./chunk-2LXTJXWC.js";import{useShellStrings as g}from"./chunk-KKZZAK76.js";import{forwardRef as p,useState as b,useRef as m,useEffect as f,useId as v}from"react";import{jsx as w,jsxs as x}from"react/jsx-runtime";var y={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},k={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function C(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function N(e,r){if(!e)return k;const a=C(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${k.backgroundImage}`,backgroundSize:`auto, ${k.backgroundSize}`}}function $({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",y[e],a].filter(Boolean).join(" ")}var z=p(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
|
|
2
|
+
return w("button",{ref:l,type:o,"aria-pressed":a,className:$({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(e)})})}),D=(e,r,a)=>Math.min(a,Math.max(r,e)),I=e=>"string"==typeof e?{value:e}:e;function M(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:D(e.s+o[0],0,1),v:D(e.v+o[1],0,1)}:null}function A(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,359);case"ArrowRight":case"ArrowUp":return D(e+n,0,359);case"PageDown":return D(e-10,0,359);case"PageUp":return D(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var P={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function j(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,100);case"ArrowRight":case"ArrowUp":return D(e+n,0,100);case"PageDown":return D(e-10,0,100);case"PageUp":return D(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function K({value:t,onChange:s,label:c,presets:d,clearable:p=!1,fallback:v,dragWrites:y="live",disabled:$=!1,opacity:D,onOpacityChange:K,onClose:S,id:T,className:L=""}){const R=g().color,E=C(D),H=e=>{const r=C(e);$||r===E||K?.(r)},O=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:E},U=e(v??""),[W,J]=b(()=>r(t||U||"")),Z=m(t);f(()=>{t!==Z.current&&(Z.current=t,t?J(r(t)):U&&J(r(U)))},[t]);const q=e=>{$||e===t||(Z.current=e,s(e))},F=a=>{const n=e(a);n&&(J(r(n)),q(n))},V=e=>{J(e),q(a(e))},[Y,G]=b(!1),Q=m(W);Q.current=W;const _=e=>({onPointerDown:r=>{if($||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,Q.current);"end"===y?(G(!0),J(a)):V(a)},onPointerMove:r=>{if($||!(1&r.buttons))return;const a=e(r,Q.current);"end"===y?J(a):V(a)},onPointerUp:r=>{"end"===y&&Y&&(G(!1),V(e(r,Q.current)))}}),ee=_((e,r)=>({...r,...l(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),re=_((e,r)=>({...r,h:i(e.clientX,e.currentTarget.getBoundingClientRect())})),ae=Y?a(W):t,ne=e=>`${Math.round(100*e)}%`,oe=(d??[]).map(I),te=e(t),le=ae||U||"";
|
|
3
3
|
/* @__PURE__ */
|
|
4
|
-
return w(u.Provider,{value:!1,children:/* @__PURE__ */x("div",{id:
|
|
5
|
-
return w(h,{content:o,children:/* @__PURE__ */w(z,{color:a??r.value,size:"sm","aria-label":o,selected:null!==a&&a===te,disabled:$,onClick:()=>
|
|
6
|
-
/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":
|
|
7
|
-
/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":
|
|
4
|
+
return w(u.Provider,{value:!1,children:/* @__PURE__ */x("div",{id:T,className:`flex w-56 flex-col gap-3 ${$?"opacity-60":""} ${L}`.trim(),onKeyDown:e=>{"Escape"===e.key&&S&&(e.preventDefault(),e.stopPropagation(),S())},children:[(oe.length>0||p)&&/* @__PURE__ */x("div",{role:"group","aria-label":R.presets,className:"flex flex-wrap gap-2",children:[p&&/* @__PURE__ */w(h,{content:R.clear,children:/* @__PURE__ */w(z,{color:"",size:"sm","aria-label":R.clear,selected:""===t,disabled:$,onClick:()=>{$||""===t||(Z.current="",s(""))}})}),oe.map(r=>{const a=e(r.value),o=r.label?`${r.label} · ${n(a??r.value)}`:n(a??r.value);/* @__PURE__ */
|
|
5
|
+
return w(h,{content:o,children:/* @__PURE__ */w(z,{color:a??r.value,size:"sm","aria-label":o,selected:null!==a&&a===te,disabled:$,onClick:()=>F(r.value)})},`${r.label??""}:${r.value}`)})]}),
|
|
6
|
+
/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":R.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*W.v),"aria-valuetext":R.squareValue(Math.round(100*W.s),Math.round(100*W.v)),"aria-disabled":$||void 0,"data-color-square":"",onKeyDown:e=>{if($)return;const r=M(W,e.key,e.shiftKey);r&&(e.preventDefault(),V(r))},...ee,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:a({h:W.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ne(W.s),top:ne(1-W.v),...P}})}),
|
|
7
|
+
/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":R.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(W.h),"aria-orientation":"horizontal","aria-disabled":$||void 0,"data-color-hue":"",onKeyDown:e=>{if($)return;const r=A(W.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),V({...W,h:r}))},...re,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:o},children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:W.h/360*100+"%",background:a({h:W.h,s:1,v:1}),...P}})}),K&&/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":R.opacity(c),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":E,"aria-valuetext":`${E}%`,"aria-orientation":"horizontal","aria-disabled":$||void 0,"data-color-opacity":"",onKeyDown:e=>{if($)return;const r=j(E,e.key,e.shiftKey);null!==r&&(e.preventDefault(),H(r))},onPointerDown:e=>{$||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),H(O(e)))},onPointerMove:e=>{!$&&1&e.buttons&&H(O(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${le||"black"}), ${k.backgroundImage}`,backgroundSize:`auto, ${k.backgroundSize}`},children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${E}%`,...N(le||"black",E),...P}})}),
|
|
8
8
|
/* @__PURE__ */x("div",{className:"flex items-center gap-2",children:[
|
|
9
|
-
/* @__PURE__ */w("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-gray-300",style:N(le,
|
|
10
|
-
/* @__PURE__ */w(
|
|
11
|
-
return w("input",{id:s,type:"text",value:g??(r?n(r):""),"aria-label":o,placeholder:l,maxLength:t,spellCheck:!1,autoComplete:"off",disabled:i,onChange:n=>{p(n.target.value);const o=e(n.target.value);null!==o&&o!==r&&a(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(null),"data-hex-look":u,className:m})}function
|
|
12
|
-
return w("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */w(c,{value:e,onChange:e=>{null!==e&&r(e)},min:0,max:100,precision:0,suffix:"%",size:o,"aria-label":a,disabled:n})})}function
|
|
9
|
+
/* @__PURE__ */w("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-gray-300",style:N(le,K?E:null)}),
|
|
10
|
+
/* @__PURE__ */w(X,{value:ae,placeholder:!t&&U?n(U):void 0,onChange:F,label:R.hex(c),disabled:$}),K&&/* @__PURE__ */w(B,{value:E,onChange:H,label:R.opacity(c),disabled:$})]})]})})}var S={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},T={sm:"h-6",md:"h-8",lg:"h-10"},L=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-gray-800 placeholder:text-gray-400 hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function X({value:r,onChange:a,label:o,placeholder:l,disabled:i,id:s,size:c="md",look:u="box",className:h=""}){const[g,p]=b(null),m="text"===u?`${L} ${T[c]} ${h}`.trim():d({size:c,className:`${S[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
|
|
11
|
+
return w("input",{id:s,type:"text",value:g??(r?n(r):""),"aria-label":o,placeholder:l,maxLength:t,spellCheck:!1,autoComplete:"off",disabled:i,onChange:n=>{p(n.target.value);const o=e(n.target.value);null!==o&&o!==r&&a(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(null),"data-hex-look":u,className:m})}function B({value:e,onChange:r,label:a,disabled:n,size:o="md"}){/* @__PURE__ */
|
|
12
|
+
return w("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */w(c,{value:e,onChange:e=>{null!==e&&r(e)},min:0,max:100,precision:0,suffix:"%",size:o,"aria-label":a,disabled:n})})}function R({value:r,onChange:a,label:o,presets:t,clearable:l,fallback:i,dragWrites:c,disabled:u,id:d,showHexInput:h=!1,opacity:p,onOpacityChange:b,size:m="md",align:f="start",open:y,onOpenChange:k,className:z=""}){const D=g().color,I=C(p),M=v(),A=e(i??""),P=r||A||"",j=r?n(r):A?n(A):D.none;
|
|
13
13
|
/* @__PURE__ */
|
|
14
14
|
return x("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":h?"gap-1":"gap-2"} ${z}`.trim(),children:[
|
|
15
|
-
/* @__PURE__ */w(s,{id:d,trigger:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(P,b?I:null)}),triggerLabel:D.swatch(o,j),triggerClassName:$({size:m}),"aria-label":D.panel(o),align:f,open:y,onOpenChange:k,disabled:u,children:/* @__PURE__ */w(
|
|
16
|
-
/* @__PURE__ */w(
|
|
15
|
+
/* @__PURE__ */w(s,{id:d,trigger:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(P,b?I:null)}),triggerLabel:D.swatch(o,j),triggerClassName:$({size:m}),"aria-label":D.panel(o),align:f,open:y,onOpenChange:k,disabled:u,children:/* @__PURE__ */w(K,{id:M,value:r,onChange:a,label:o,presets:t,clearable:l,fallback:i,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),h&&
|
|
16
|
+
/* @__PURE__ */w(X,{value:r,placeholder:!r&&A?n(A):void 0,onChange:e=>{u||e===r||a(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */w(B,{value:I,onChange:e=>{u||e===I||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{R as ColorPicker,K as ColorPickerPanel,z as ColorSwatch,X as HexInput,k as NO_COLOR_FILL,C as clampOpacity,N as colorFill,$ as colorSwatchClasses,A as stepHue,j as stepOpacity,M as stepSquare};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as n}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as i,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-QSW26NAH.js";import{useSettingAuto as d}from"./chunk-E4Z5OXBI.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-JFSYWEHD.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-QR4RM7PO.js";import{Icon as m}from"./chunk-42BBJJDP.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{solidSurfaceStyle as g}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-
|
|
2
|
-
/* @__PURE__ */I(
|
|
3
|
-
/* @__PURE__ */I("span",{id:
|
|
4
|
-
return I(O,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */I("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var
|
|
1
|
+
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as n}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as i,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-QSW26NAH.js";import{useSettingAuto as d}from"./chunk-E4Z5OXBI.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-JFSYWEHD.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-QR4RM7PO.js";import{Icon as m}from"./chunk-42BBJJDP.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{solidSurfaceStyle as g}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-KKZZAK76.js";import{forwardRef as w,useId as k,useState as N,useRef as $,useMemo as D,useCallback as j,useEffect as E,useLayoutEffect as S}from"react";import{createPortal as T}from"react-dom";import{jsxs as H,jsx as I,Fragment as O}from"react/jsx-runtime";var C=w(function({value:e,onChange:t,options:r,placeholder:n,invalid:i,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},w){const N=t,$=x(),D=d(),j=f??D,E=k(),S=/* @__PURE__ */H("select",{ref:w,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":i||void 0,"aria-describedby":[g,j?E:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:i,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==n&&!b&&/* @__PURE__ */I("option",{value:"",disabled:!0,children:n}),
|
|
2
|
+
/* @__PURE__ */I(z,{items:r})]});return j?/* @__PURE__ */H(O,{children:[S,
|
|
3
|
+
/* @__PURE__ */I("span",{id:E,hidden:!0,children:$.settingView.auto})]}):S});function z({items:e}){const t=e=>/* @__PURE__ */I("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
4
|
+
return I(O,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */I("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var B=w(function({value:l,onChange:u,options:w,placeholder:C,invalid:B,className:K="",id:R,disabled:A,size:W,touchSize:P,title:U,multiple:V,renderOption:F,renderValue:J,valueText:L,readOnly:M=!1,footer:G,changed:Q=!1,auto:Z,"aria-describedby":q,"aria-label":X,"aria-labelledby":Y,..._},ee){const[te,re]=N(!1),[ne,ie]=N(-1),ae=$(null),le=$(null),oe=$(null),de=$(null),se=$([]),ce=()=>de.current??oe.current,ue=!!G?.length,pe="sm"===W,me=pe?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",ve=p(pe),[he,fe]=N(null),be=x(),ge=$(te);ge.current=te;const ye=$({buffer:"",timer:null}),xe=k(),we=`${xe}-listbox`,ke=R??`${xe}-trigger`,Ne=e=>`${xe}-opt-${e}`,$e=`${xe}-changed`,De=d(),je=Z??De,Ee=`${xe}-auto`,Se=[q,Q?$e:void 0,je?Ee:void 0].filter(Boolean).join(" ")||void 0,Te=D(()=>i(w),[w]),He=V?l:[],Ie=u,Oe=f(le,te,{matchTriggerWidth:!0,...G?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Ce="undefined"==typeof window?E:S,ze=`${te}|${Oe?.top}|${Oe?.bottom}|${Oe?.maxHeight}|${w.length}`;Ce(()=>{fe(null)},[ze]),Ce(()=>{const e=oe.current;if(!te||!e||null!==he)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let i=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;i=r}i>r&&fe(Math.floor(i))},[te,he,ze]);const Be=V?Te.findIndex(e=>He.includes(e.value)):Te.findIndex(e=>e.value===l),Ke=V?Te.filter(e=>He.includes(e.value)).map(e=>e.label).join(", ")||void 0:Be>=0?Te[Be].label:void 0,Re=!V&&Be>=0?Te[Be].lang:void 0,Ae=V?Te.filter(e=>He.includes(e.value)):Be>=0?[Te[Be]]:[],We=J&&Ae.length?J(Ae):void 0,Pe=void 0!==We&&L?L(Ae):void 0,Ue=j((e=!0)=>{re(!1),ie(-1),e&&le.current?.focus()},[]),Ve=j(()=>{A||M||(ie(Be>=0?Be:e(Te)),re(!0))},[A,M,Te,Be]),Fe=j(e=>{const t=Te[e];if(t&&!t.disabled){if(V){const r=l;return Ie(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ie(e)}Ie(t.value),Ue()}},[Te,V,l,Ie,Ue]);E(()=>{if(!te)return;return y(e=>!("Escape"!==e.key||!ge.current)&&(Ue(),!0),ce)},[te,Ue]),E(()=>{if(!te)return;const e=e=>{const t=e.target;ae.current?.contains(t)||ce()?.contains(t)||Ue(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Ue(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[te,Ue]),E(()=>{!te||ne<0||oe.current?.querySelector(`#${CSS.escape(Ne(ne))}`)?.scrollIntoView({block:"nearest"})},[te,ne]);const Je=j(e=>{const r=ye.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const n=te?ne:Be,i=t(Te,r.buffer,n);i<0||(te?ie(i):V?(ie(i),re(!0)):Fe(i))},[te,ne,Be,Te,Fe,V]),Le=te?a(w,(e,t)=>{const r=(n=e.value,V?He.includes(n):l===n);var n;const i=t===ne;/* @__PURE__ */
|
|
5
5
|
return H("div",{id:Ne(t),role:"option",lang:e.description||F?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ie(t)},onClick:()=>Fe(t),className:`mx-1 cursor-pointer truncate rounded-lg ${me}${V?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":i?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[V&&/* @__PURE__ */I(o,{selected:r}),F?/* @__PURE__ */I("span",{className:"block min-w-0 flex-1 truncate",children:F(e,{selected:r,active:i})}):V?/* @__PURE__ */H("span",{className:"block min-w-0 flex-1",children:[
|
|
6
6
|
/* @__PURE__ */I("span",{lang:e.lang,className:"block truncate",children:e.label}),e.description&&/* @__PURE__ */I("span",{className:ve,children:e.description})]}):e.description?
|
|
7
7
|
/* @__PURE__ */H(O,{children:[
|
|
@@ -9,12 +9,12 @@ return H("div",{id:Ne(t),role:"option",lang:e.description||F?void 0:e.lang,"aria
|
|
|
9
9
|
/* @__PURE__ */I("span",{className:ve,children:e.description})]}):e.label]},e.value)},xe,"mx-1"):null,Me=void 0!==We?
|
|
10
10
|
/* @__PURE__ */H("span",{className:"relative block min-w-0 truncate",children:[
|
|
11
11
|
/* @__PURE__ */I("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:We}),
|
|
12
|
-
/* @__PURE__ */I("span",{lang:void 0===
|
|
13
|
-
/* @__PURE__ */I("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:G.map((e,t)=>/* @__PURE__ */H("button",{ref:e=>{se.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(
|
|
12
|
+
/* @__PURE__ */I("span",{lang:void 0===Pe?Re:void 0,className:"sr-only",children:Pe??Ke})]}):/* @__PURE__ */I("span",{lang:Re,className:"block truncate "+(void 0===Ke?"text-gray-400":""),children:Ke??C??" "}),Ge={zIndex:h.popup,left:Oe?.left,top:Oe?.top,bottom:Oe?.bottom,width:Oe?.width,maxHeight:Oe?.maxHeight??b,visibility:Oe?void 0:"hidden",...g()},Qe=/* @__PURE__ */I("div",{ref:oe,id:we,role:"listbox","aria-labelledby":Y??(X?void 0:ke),"aria-label":Y?void 0:X,"aria-multiselectable":V||void 0,className:ue?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:ue?null!==he?{maxHeight:he}:void 0:null!==he?{...Ge,maxHeight:he}:Ge,children:Le}),Ze=ue?/* @__PURE__ */H("div",{ref:de,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Ge,children:[Qe,
|
|
13
|
+
/* @__PURE__ */I("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:G.map((e,t)=>/* @__PURE__ */H("button",{ref:e=>{se.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Ue(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(G?.length??0)-1,n=t=>{e.preventDefault(),se.current[t]?.focus()},i=()=>{e.preventDefault(),le.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?i():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?i():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void Ue());case"Escape":return e.preventDefault(),e.stopPropagation(),void Ue()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${me} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-gray-400":"cursor-pointer text-gray-700 hover:bg-blue-50 hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */I(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
14
14
|
/* @__PURE__ */I("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Qe;/* @__PURE__ */
|
|
15
15
|
return H("div",{ref:ae,className:"relative",children:[
|
|
16
|
-
/* @__PURE__ */I("button",{ref:le,id:ke,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":te,"aria-controls":te?we:void 0,"aria-activedescendant":te&&ne>=0?Ne(ne):void 0,"aria-invalid":
|
|
16
|
+
/* @__PURE__ */I("button",{ref:le,id:ke,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":te,"aria-controls":te?we:void 0,"aria-activedescendant":te&&ne>=0?Ne(ne):void 0,"aria-invalid":B||void 0,"aria-describedby":Se,"aria-label":X,"aria-labelledby":Y,title:U,disabled:A,"aria-readonly":M||void 0,onClick:()=>te?Ue():Ve(),onKeyDown:t=>{if(!A&&!M)switch(t.key){case"ArrowDown":return t.preventDefault(),void(te?ie(e=>n(Te,e,1)):Ve());case"ArrowUp":return t.preventDefault(),void(te?ie(e=>n(Te,e,-1)):Ve());case"Home":return void(te&&(t.preventDefault(),ie(e(Te))));case"End":return void(te&&(t.preventDefault(),ie(r(Te))));case"Enter":return void(te&&(t.preventDefault(),Fe(ne)));case" ":return t.preventDefault(),void(te?Fe(ne):Ve());case"Escape":return void(te&&(t.preventDefault(),t.stopPropagation(),Ue()));case"Tab":return te&&ue&&!t.shiftKey?(t.preventDefault(),void se.current[0]?.focus()):void(te&&Ue(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Je(t.key))}},className:s({invalid:B,size:W,readOnly:M,auto:je,className:`${M?"":"pr-8 "}text-left ${K}`.trim()}),children:Q?
|
|
17
17
|
/* @__PURE__ */H("span",{className:"flex min-w-0 items-center gap-1",children:[Me,
|
|
18
|
-
/* @__PURE__ */I("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Me}),Q&&/* @__PURE__ */I("span",{id:$e,hidden:!0,children:be.select.changed}),je&&/* @__PURE__ */I("span",{id:
|
|
19
|
-
/* @__PURE__ */H("select",{ref:ee,value:l,multiple:V||void 0,onChange:e=>Ie(V?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:
|
|
20
|
-
/* @__PURE__ */I(
|
|
18
|
+
/* @__PURE__ */I("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Me}),Q&&/* @__PURE__ */I("span",{id:$e,hidden:!0,children:be.select.changed}),je&&/* @__PURE__ */I("span",{id:Ee,hidden:!0,children:be.settingView.auto}),!M&&/* @__PURE__ */I(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}),
|
|
19
|
+
/* @__PURE__ */H("select",{ref:ee,value:l,multiple:V||void 0,onChange:e=>Ie(V?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:A,"aria-hidden":"true",tabIndex:-1,className:"sr-only",..._,children:[void 0!==C&&!V&&/* @__PURE__ */I("option",{value:"",disabled:!0,children:C}),
|
|
20
|
+
/* @__PURE__ */I(z,{items:w})]}),te&&T(Ze,document.body)]})}),K=w(function({touchSize:e="touch",...t},r){const n=u();return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */I(C,{ref:r,...t,size:e}):/* @__PURE__ */I(B,{ref:r,...t}):/* @__PURE__ */I(B,{ref:r,...t,size:e})});export{C as NativeSelect,K as Select_default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ChartSkeleton as e}from"./chunk-
|
|
1
|
+
import{ChartSkeleton as e}from"./chunk-G3IG4X4Z.js";import{ChartHighlightProvider as r,useHighlight as a}from"./chunk-CNYAHYE6.js";import{CHART_INK as t,resolveSeriesColor as s}from"./chunk-TZFACUMR.js";import{useShellStrings as l}from"./chunk-KKZZAK76.js";import{jsx as n,jsxs as o,Fragment as c}from"react/jsx-runtime";function i({shape:e,colour:r}){const a="shrink-0";switch(e){case"circle":/* @__PURE__ */
|
|
2
2
|
return n("span",{className:`${a} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:r}});case"circle-outline":/* @__PURE__ */
|
|
3
3
|
return n("span",{className:`${a} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:r}});case"rounded-square-outline":/* @__PURE__ */
|
|
4
4
|
return n("span",{className:`${a} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:r}});case"square":/* @__PURE__ */
|
|
@@ -8,10 +8,10 @@ return n("span",{className:`${a} h-3.5 w-1 rounded-full`,style:{backgroundColor:
|
|
|
8
8
|
return n("span",{className:`${a} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:r}})}}function d({entries:e,interactive:r,fallbackSwatch:t,onClick:l}){const{highlighted:d,setHighlighted:u}=a();/* @__PURE__ */
|
|
9
9
|
return n("ul",{className:"m-0 flex flex-wrap items-center gap-x-4 gap-y-1 p-0",children:e.map((e,a)=>{const h=r&&null!==d&&d!==e.key,m=/* @__PURE__ */o(c,{children:[
|
|
10
10
|
/* @__PURE__ */n(i,{shape:e.swatch??t,colour:s(a,e.color,e.tone)}),e.label]});/* @__PURE__ */
|
|
11
|
-
return n("li",{className:"list-none",children:r||l?/* @__PURE__ */n("button",{type:"button",onClick:l?()=>l(e.key):void 0,"aria-pressed":l?Boolean(e.pressed):void 0,onMouseEnter:r?()=>u(e.key):void 0,onMouseLeave:r?()=>u(null):void 0,onFocus:r?()=>u(e.key):void 0,onBlur:r?()=>u(null):void 0,className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(h?"opacity-40":""),children:m}):/* @__PURE__ */n("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:m})},e.key)})})}function u({title:a,subtitle:s,legend:c,table:i,tableLabel:u,busy:h=!1,loading:m=!1,skeletonVariant:p="area",skeletonHeight:b,interactiveLegend:g=!0,legendSwatch:y="rounded-square",onLegendClick:f,actions:k,children:
|
|
12
|
-
return n(r,{children:/* @__PURE__ */o("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${
|
|
11
|
+
return n("li",{className:"list-none",children:r||l?/* @__PURE__ */n("button",{type:"button",onClick:l?()=>l(e.key):void 0,"aria-pressed":l?Boolean(e.pressed):void 0,onMouseEnter:r?()=>u(e.key):void 0,onMouseLeave:r?()=>u(null):void 0,onFocus:r?()=>u(e.key):void 0,onBlur:r?()=>u(null):void 0,className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(h?"opacity-40":""),children:m}):/* @__PURE__ */n("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:m})},e.key)})})}function u({title:a,subtitle:s,legend:c,table:i,tableLabel:u,busy:h=!1,loading:m=!1,skeletonVariant:p="area",skeletonHeight:b,interactiveLegend:g=!0,legendSwatch:y="rounded-square",onLegendClick:f,actions:k,children:x,className:N}){const w=l().charts;/* @__PURE__ */
|
|
12
|
+
return n(r,{children:/* @__PURE__ */o("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${N??""}`,"aria-busy":h||m||void 0,children:[
|
|
13
13
|
/* @__PURE__ */o("header",{className:"flex items-start justify-between gap-4",children:[
|
|
14
14
|
/* @__PURE__ */o("div",{className:"min-w-0",children:[
|
|
15
|
-
/* @__PURE__ */n("h3",{className:"text-base font-semibold text-gray-900",children:a}),s&&/* @__PURE__ */n("p",{className:"mt-0.5 text-sm text-gray-500",children:s})]}),k&&/* @__PURE__ */n("div",{className:"shrink-0",children:k})]}),m?/* @__PURE__ */n(e,{variant:p,height:b}):/* @__PURE__ */n("div",{className:h?"opacity-60 transition-opacity":"transition-opacity",children:
|
|
15
|
+
/* @__PURE__ */n("h3",{className:"text-base font-semibold text-gray-900",children:a}),s&&/* @__PURE__ */n("p",{className:"mt-0.5 text-sm text-gray-500",children:s})]}),k&&/* @__PURE__ */n("div",{className:"shrink-0",children:k})]}),m?/* @__PURE__ */n(e,{variant:p,height:b}):/* @__PURE__ */n("div",{className:h?"opacity-60 transition-opacity":"transition-opacity",children:x}),!m&&c&&c.length>1&&/* @__PURE__ */n(d,{entries:c,interactive:g,fallbackSwatch:y,onClick:f}),!m&&i&&/* @__PURE__ */o("details",{className:"border-t border-gray-100 pt-3",children:[
|
|
16
16
|
/* @__PURE__ */n("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:u??w.showTable}),
|
|
17
17
|
/* @__PURE__ */n("div",{className:"mt-3 overflow-x-auto",style:{color:t.label},children:i})]})]})})}export{u as ChartFrame};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{toISODate as e}from"./chunk-
|
|
2
|
-
return y("input",{ref:
|
|
1
|
+
import{toISODate as e}from"./chunk-7SPX7DLO.js";import{Calendar as t}from"./chunk-TKBP5HRY.js";import{calendarNames as r}from"./chunk-5OTS2G3M.js";import{inputClasses as a,PLACEHOLDER_INK as n}from"./chunk-JFSYWEHD.js";import{Icon as i}from"./chunk-42BBJJDP.js";import{onOverlayOpen as o}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{useDropdownPosition as s}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as d}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-KKZZAK76.js";import{forwardRef as f,useState as b,useRef as p,useId as h,useEffect as v}from"react";import{createPortal as g}from"react-dom";import{jsx as y,jsxs as x}from"react/jsx-runtime";var N=/^\d{4}-\d{2}-\d{2}$/,k=/^(aria|data)-/,j=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function w(t){if(null==t||""===t)return"";if(t instanceof Date)return Number.isNaN(t.getTime())?"":e(t);if(N.test(t))return t;const r=new Date(t);return Number.isNaN(r.getTime())?"":e(r)}function D(e){if(!N.test(e))return null;const[t,r,a]=e.split("-").map(Number),n=new Date(t,r-1,a);return n.getMonth()===r-1&&n.getDate()===a?n:null}function B(e,t){const r=D(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var F=f(function({value:f,onChange:N,min:F,max:S,invalid:E,size:J,native:O,weekStartsOn:T,className:W="","aria-label":$,"aria-describedby":q,"aria-labelledby":C,id:L,name:P,disabled:z,placeholder:I,required:K,clearable:M,form:U,title:G,tabIndex:H,autoFocus:Y,onFocus:R,onBlur:Z,...A},Q){const V=M??!K,X=w(f),_=w(F),ee=w(S),te=c().datePicker,re=m(),ae=r(re),[ne,ie]=b(!1),oe=p(null),le=p(null),se=p(null),de=h(),ue=h(),ce=h(),me=s(le,ne,{popupRef:se}),[fe,be]=b(!1);d(()=>{const e=!!L&&(le.current?.labels?.length??0)>0;e!==fe&&be(e)});const pe=!$&&(!!C||fe);if(v(()=>{if(!ne)return;const e=e=>{const t=e.target;oe.current?.contains(t)||se.current?.contains(t)||ie(!1)};document.addEventListener("pointerdown",e,!0);const t=o(()=>ie(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[ne]),v(()=>{if(ne)return u(e=>"Escape"===e.key&&(ie(!1),le.current?.focus(),!0),()=>se.current)},[ne]),O)/* @__PURE__ */
|
|
2
|
+
return y("input",{ref:Q,type:"date",lang:re,id:L,name:P,disabled:z,"aria-label":$,"aria-describedby":q,"aria-invalid":E||void 0,value:X,min:_||void 0,max:ee||void 0,onChange:e=>N?.(D(e.target.value)),className:a({invalid:E,size:J,className:W}),"aria-labelledby":C,required:K,form:U,title:G,tabIndex:H,autoFocus:Y,onFocus:R,onBlur:Z,...A});const he=Object.fromEntries(Object.entries(A).filter(([e])=>k.test(e)&&!j.has(e))),ve=A["aria-required"],ge=!!K||!0===ve||"true"===ve,ye=[pe?ue:void 0,ge?ce:void 0,q].filter(Boolean).join(" ")||void 0,xe=e(/* @__PURE__ */new Date),Ne=(!_||xe>=_)&&(!ee||xe<=ee),ke=I??te.placeholder;/* @__PURE__ */
|
|
3
3
|
return x("div",{ref:oe,className:"relative",children:[
|
|
4
|
-
/* @__PURE__ */y("input",{ref:
|
|
5
|
-
/* @__PURE__ */x("button",{ref:le,type:"button",...he,id:
|
|
6
|
-
/* @__PURE__ */y("span",{className:
|
|
7
|
-
/* @__PURE__ */y(i,{name:"date",className:`h-4 w-4 shrink-0 ${n}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */y("span",{id:ue,className:"sr-only",children:
|
|
4
|
+
/* @__PURE__ */y("input",{ref:Q,type:"hidden",name:P,form:U,value:X}),
|
|
5
|
+
/* @__PURE__ */x("button",{ref:le,type:"button",...he,id:L,disabled:z,title:G,tabIndex:H,autoFocus:Y,onFocus:R,onBlur:Z,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?de:void 0,"aria-labelledby":C,"aria-describedby":ye,"aria-label":$?`${$}${X?`, ${B(X,ae)}`:""}`:void 0,onClick:()=>ie(e=>!e),className:`${a({invalid:E,size:J,className:W})} flex items-center justify-between text-left`,children:[
|
|
6
|
+
/* @__PURE__ */y("span",{className:X?"text-gray-900":"text-gray-400",children:X?B(X,ae):ke}),
|
|
7
|
+
/* @__PURE__ */y(i,{name:"date",className:`h-4 w-4 shrink-0 ${n}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */y("span",{id:ue,className:"sr-only",children:X?B(X,ae):ke}),ge&&/* @__PURE__ */y("span",{id:ce,className:"sr-only",children:te.required}),ne&&g(
|
|
8
8
|
/* @__PURE__ */x("div",{ref:se,id:de,role:"dialog","aria-label":$??te.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:l.popup,left:me?.left,right:me?.right,top:me?.top,bottom:me?.bottom,maxWidth:me?.maxWidth,visibility:me?void 0:"hidden"},children:[
|
|
9
|
-
/* @__PURE__ */y(t,{value:
|
|
9
|
+
/* @__PURE__ */y(t,{value:X||null,min:_||null,max:ee||null,weekStartsOn:T,onSelect:e=>{ie(!1),le.current?.focus(),N?.(D(e))}}),(V||Ne)&&/* @__PURE__ */x("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[V&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),N?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:te.clear}),Ne&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),N?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:te.today})]})]}),document.body)]})});export{F as DatePicker_default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-BIEKHPZ5.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
|
|
2
2
|
return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
|
|
3
3
|
/* @__PURE__ */n("div",{children:[
|
|
4
4
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-3RM3D2P3.js";import{Avatar as r}from"./chunk-D6FSZBJ5.js";import{Button_default as t}from"./chunk-UDD7GB4F.js";import{useState as a}from"react";import{jsx as i,jsxs as l}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],n=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function d(){const[d,c]=a(1),o=n.find(e=>e.id===d)??n[0];/* @__PURE__ */
|
|
2
2
|
return i("div",{className:"h-full",children:/* @__PURE__ */i(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */l("div",{className:"flex h-full flex-col p-2",children:[
|
|
3
3
|
/* @__PURE__ */i(t,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,r)=>/* @__PURE__ */l("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
4
4
|
/* @__PURE__ */i("span",{children:e.label}),null!=e.count&&/* @__PURE__ */i("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */l("div",{className:"flex h-full",children:[
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-P5BOTIJU.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{CHART_INK as s,resolveSeriesColor as i}from"./chunk-TZFACUMR.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-
|
|
1
|
+
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-P5BOTIJU.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{CHART_INK as s,resolveSeriesColor as i}from"./chunk-TZFACUMR.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-KKZZAK76.js";import{formatPercent as m,formatPlain as u}from"./chunk-C3QOHMR6.js";import{useId as d,useState as f,useRef as y}from"react";import{jsx as p,jsxs as g}from"react/jsx-runtime";function x({segments:x,variant:v="pie",size:k=280,innerRadius:M,padAngle:b=.012,maxSegments:N=6,otherLabel:I,formatValue:$,centerLabel:j,animate:P=!0,labels:w="none",labelMinShare:A=.04,className:F,emptyLabel:S}){const C=h().charts,R=c(),T=$??(e=>u(e,R)),W=I??C.other,z=S??C.nothingToBreakDown,E=d(),[U,_]=f(null),{highlighted:B}=a(),L=y(null),O=o(L,Number.POSITIVE_INFINITY),V=x.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===V.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${F??""}`,children:z});const Y=[...V].sort((e,t)=>t.value-e.value),Z=Y.slice(0,N),K=Y.slice(N),H=K.length>0?[...Z,{key:"__other__",label:W,value:K.reduce((e,t)=>e+t.value,0),slot:-1,color:s.muted}]:Z,J=e=>i(e.slot,e.color,e.tone),Q=H.reduce((e,t)=>e+t.value,0),q=Math.ceil(.62*Math.max(...H.map(e=>String(e.label).length),4)*11)+24,D="outside"===w&&O>=120+2*q,X=D?q:0,G=D?Math.max(120,Math.min(k,O-2*X)):k,ee=G+2*X,te=X+G/2,le=G/2,ae=G/2-12,re=M??("ring"===v?.58*ae:0),ne=n(H.length,b),oe=Math.max(...H.map(e=>e.value)),se=e=>re+(ae-re)*Math.sqrt(Math.max(0,e)/oe);let ie=-Math.PI/2;const he=(()=>{if(!D)return[];let e=-Math.PI/2;const t=H.map((t,l)=>{const a="rose"===v?n(H.length,b).step:t.value/Q*Math.PI*2,r="rose"===v?n(H.length,b).center(l):e+a/2;e+=a;const o="rose"===v?se(t.value):ae;return{key:t.key,label:t.label,share:t.value/Q,right:Math.cos(r)>=0,anchor:[te+o*Math.cos(r),le+o*Math.sin(r)],y:le+(o+14)*Math.sin(r),index:l}}).filter(e=>e.share>=A),l=Math.max(1,Math.floor((G-11-13)/26)+1),a=/* @__PURE__ */new Set;for(const e of[!0,!1]){const r=t.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,l).sort((e,t)=>e.y-t.y);for(let e=1;e<r.length;e+=1)r[e].y-r[e-1].y<26&&(r[e].y=r[e-1].y+26);for(let e=r.length-1;e>=0;e-=1){const t=e===r.length-1?G-13:r[e+1].y-26;r[e].y=Math.min(r[e].y,t)}r.forEach((e,t)=>{e.y=Math.max(e.y,0===t?11:r[t-1].y+26),a.add(e.key)})}return t.filter(e=>a.has(e.key))})(),ce=(e,t)=>null!==U?U!==e:null!==B&&B!==t,me=null!==U?H[U]:void 0;/* @__PURE__ */
|
|
2
2
|
return g("div",{className:`relative ${F??""}`,ref:L,children:[
|
|
3
|
-
/* @__PURE__ */g("svg",{width:"100%",height:
|
|
4
|
-
/* @__PURE__ */p("title",{id:
|
|
5
|
-
return p("path",{d:e(te,le,re,c,o,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:s.surface,strokeWidth:1,className:P?t.sweep:void 0,style:P?l(r,55):void 0,onMouseEnter:()=>
|
|
3
|
+
/* @__PURE__ */g("svg",{width:"100%",height:G,viewBox:`0 0 ${ee} ${G}`,role:"img","aria-labelledby":E,onMouseLeave:()=>_(null),children:[
|
|
4
|
+
/* @__PURE__ */p("title",{id:E,children:C.breakdown(T(Q),H.length)}),H.map((a,r)=>{const n=J(a),o="rose"===v?ne(r):ie,i="rose"===v?ne.step:a.value/Q*Math.PI*2-b;"rose"!==v&&(ie+=a.value/Q*Math.PI*2);const h=o+Math.max(.001,i),c="rose"===v?se(a.value):ae;/* @__PURE__ */
|
|
5
|
+
return p("path",{d:e(te,le,re,c,o,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:s.surface,strokeWidth:1,className:P?t.sweep:void 0,style:P?l(r,55):void 0,onMouseEnter:()=>_(r)},a.key)}),he.map(e=>{const t=e.right?ee-6:6,l=e.right?te+ae+14:te-ae-14;/* @__PURE__ */
|
|
6
6
|
return g("g",{children:[
|
|
7
7
|
/* @__PURE__ */p("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${l},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:s.grid,strokeWidth:1}),
|
|
8
8
|
/* @__PURE__ */p("text",{x:t,y:e.y-2,fontSize:11,fill:s.label,textAnchor:e.right?"end":"start",children:e.label}),
|
|
9
|
-
/* @__PURE__ */p("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:s.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:m(100*e.share,1,
|
|
10
|
-
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:
|
|
11
|
-
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:
|
|
9
|
+
/* @__PURE__ */p("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:s.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:m(100*e.share,1,R)})]},`lbl-${e.key}`)}),j&&re>0&&/* @__PURE__ */p("text",{x:te,y:le+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:s.label,children:j})]}),me&&null!==U&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:me.label,rows:[{key:"value",label:C.value,color:J(me),value:T(me.value)},{key:"share",label:C.share,color:s.muted,value:m(me.value/Q*100,1,R)}]})}),
|
|
10
|
+
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:H.map((e,t)=>/* @__PURE__ */g("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
11
|
+
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:J(e)}}),
|
|
12
12
|
/* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
|
|
13
|
-
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:m(e.value/
|
|
13
|
+
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:m(e.value/Q*100,1,R)})]},e.key))})]})}export{x as PieChart};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useShellPrefs as t}from"./chunk-KC3EX26K.js";import{toast_default as e}from"./chunk-
|
|
2
|
-
return(new Date).toISOString()}var
|
|
1
|
+
import{useShellPrefs as t}from"./chunk-KC3EX26K.js";import{toast_default as e}from"./chunk-F22KWATP.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(R(),F()):"none"!==t&&0!==m||R()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&F())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),R())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);R(),P(s,{volume:u,repeat:d});const t="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(t)}catch{}try{e.info(t)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function P(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>N(t,n),2500*e)}function N(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,_={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function O(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function F(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=O(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*_[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function R(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function G(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=O(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*_[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var K="pomodoro_tasks",V="pomodoro_tasks_migrated";function W(){return Math.random().toString(36).slice(2,11)}function j(){/* @__PURE__ */
|
|
2
|
+
return(new Date).toISOString()}var E=null,q=[],J=!1,L=null,X=/* @__PURE__ */new Set;function $(){for(const t of X)t()}function z(t){q=t,$()}function H(){const t=E;return t?L=t.list().then(e=>{E===t&&(q=e,J=!0,$())}).catch(()=>{E===t&&(J=!0,$())}).finally(()=>{L=null}):(q=[],J=!0,$(),Promise.resolve())}function Q(t){E=t,q=[],J=!1,t?H():$()}function U(t){return X.add(t),!E||J||L||H(),()=>{X.delete(t)}}function Y(){return q}function Z(){const e=function(){const{prefs:e,save:n}=t(),r=a(()=>{const t=e.todo_tasks;return Array.isArray(t)?t:[]},[e.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=W(),n=j(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:j()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(U,Y,Y),i=o(t=>{const n=E;if(!n)return e.addTask(t);const o="tmp-"+W(),a=j(),r={done:!1,...t,name:t.name.trim(),id:o,createdAt:a,updatedAt:a};return z([...q,r]),n.create({...t,name:t.name.trim()}).then(t=>z(q.map(e=>e.id===o?{...r,...t}:e))).catch(()=>z(q.filter(t=>t.id!==o))),o},[e]),c=o((t,n)=>{const o=E;if(!o)return e.updateTask(t,n);z(q.map(e=>e.id===t?{...e,...n,id:t,updatedAt:j()}:e)),o.update(t,n).catch(()=>{H()})},[e]),l=o(t=>{const n=E;if(!n)return e.removeTask(t);const o=q;z(q.filter(e=>e.id!==t)),n.remove(t).catch(()=>z(o))},[e]),s=o(t=>{if(!E)return e.toggleDone(t);const n=q.find(e=>e.id===t);n&&c(t,{done:!n.done})},[e,c]),u=o(t=>{E||e.setAllTasks(t)},[e]);return null===E?e:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(V))return;const n=localStorage.getItem(K);if(!n)return void localStorage.setItem(V,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(K),void localStorage.setItem(V,"1");const a=j(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||W(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(K),localStorage.setItem(V,"1")}catch{try{localStorage.setItem(V,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,P as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,G as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,Q as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{ChartDefs as t,MOTION as e,stagger as a,glowId as n}from"./chunk-465RRWBY.js";import{ChartSkeleton as i}from"./chunk-G3IG4X4Z.js";import{useHighlight as r,autoHighlightIndex as l,highlightOpacity as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as m}from"./chunk-P5BOTIJU.js";import{CartesianPlot as s}from"./chunk-KS3AQKHD.js";import{CHART_INK as u,STATUS_VARS as h,resolveSeriesColor as c}from"./chunk-TZFACUMR.js";import{useShellStrings as d,useShellLocale as f}from"./chunk-KKZZAK76.js";import{formatPercent as b,formatPlain as p}from"./chunk-C3QOHMR6.js";import{useId as x}from"react";import{jsx as y,jsxs as M}from"react/jsx-runtime";function g({series:g,labels:v,stacked:k=!1,stackMode:N="value",height:$=220,width:w,max:j,formatValue:A,yAxisLabel:F,className:L,emptyLabel:C,radius:K=3,loading:S=!1,animate:V=!0,glow:z=!1,emphasise:O=!1,activeKey:R,highlight:T="none",valueLabels:Z=!1,onSelect:B,min:E,formatTooltipValue:G,tooltipLabels:H,barGap:Y=4,seriesLabels:I=!1}){const Q=x(),{highlighted:U}=r(),W=d().charts,D=f(),J=A??(t=>p(t,D)),P=G??J;if(S)/* @__PURE__ */return y(i,{height:$,width:w,variant:"bars",className:L});const X=(t,e)=>{const a=t.pointColors?.[e];if(a)return a;const n=t.pointTones?.[e];return n?h[n]:c(t.slot,t.color,t.tone)},q=g.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(t=>Number.isFinite(t))),_=(t,e)=>{const a=t.data[e];return"number"==typeof a&&Number.isFinite(a)?a:0},tt=v.map((t,e)=>q.reduce((t,a)=>t+_(a,e),0)),et=v.map((t,e)=>q.reduce((t,a)=>t+Math.max(0,_(a,e)),0)),at=v.map((t,e)=>q.reduce((t,a)=>t+Math.min(0,_(a,e)),0)),nt=k&&"percent"===N,it=(t,e)=>tt[e]>0?t/tt[e]:null,rt=nt?[1]:k?[...et,...at]:q.flatMap(t=>t.data.filter(Number.isFinite)),lt=(t,e)=>{const a=t.bandwidth/Math.max(1,q.length),n=q.length>1?Math.min(Y,.25*a):0;return{offset:e*a+n/2,width:Math.max(1,a-n)}},ot=I&&!k?({x:t,y:e})=>{const a=Math.min(e.domain[1],Math.max(e.domain[0],0));return v.map((n,i)=>q.map((n,r)=>{const l=n.data[i];if(!Number.isFinite(l))return null;const o=Math.min(e.domain[1],Math.max(e.domain[0],l)),{offset:m,width:s}=lt(t,r),h=t(i)+m+s/2,c=Math.min(e(o),e(a)),d=Math.max(e(o),e(a));if(s<13)return null;const f=Math.floor((d-c-12)/6.6),b=f>=Math.min(4,n.label.length),p=b&&n.label.length>f?`${n.label.slice(0,f-1).trimEnd()}…`:n.label,x=b?d-6:c-4;/* @__PURE__ */
|
|
2
|
+
return y("text",{"data-series-label":"true",x:h,y:x,transform:`rotate(-90 ${h} ${x})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:b?u.surface:u.label,children:p},`n${n.key}-${i}`)}))}:null;/* @__PURE__ */
|
|
3
|
+
return y(s,{labels:v,values:rt,height:$,width:w,max:nt?1:j,min:nt?void 0:E,formatValue:nt?t=>b(Math.round(100*t),0,D):J,yAxisLabel:F,className:L,emptyLabel:C,onSelect:B,ariaLabel:W.acrossCategories(q.map(t=>t.label),v.length),tooltip:t=>/* @__PURE__ */y(m,{title:H?.[t]??v[t],rows:q.map(e=>({key:e.key,label:e.label,color:X(e,t),value:Number.isFinite(e.data[t])?nt?`${b(100*(it(e.data[t],t)??0),1,D)} · ${P(e.data[t])}`:P(e.data[t]):void 0})),footnote:nt?W.inCategory(P(tt[t])):void 0}),overlay:Z&&!nt||ot?({x:t,y:e})=>/* @__PURE__ */M("g",{pointerEvents:"none",children:[ot?.({x:t,y:e}),Z&&!nt&&v.map((a,n)=>{if(k){if(!q.some(t=>Number.isFinite(t.data[n])))return null;const a=q.reduce((t,e)=>t+_(e,n),0),i=a>=0?et[n]:at[n];/* @__PURE__ */
|
|
4
|
+
return y("text",{"data-value-label":"true",x:t.center(n),y:a>=0?e(i)-4:e(i)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:J(a)},`v${n}`)}return q.map((a,i)=>{const r=a.data[n];if(!Number.isFinite(r))return null;const l=r,{offset:o,width:m}=lt(t,i);/* @__PURE__ */
|
|
5
|
+
return y("text",{"data-value-label":"true",x:t(n)+o+m/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:J(l)},`v${a.key}-${n}`)})})]}):void 0,children:({x:i,y:r,bottom:m,active:s})=>{const h=R?v.indexOf(R):-1,c=l(k?tt:q[0]?.data??[],T),d=s??(h>=0?h:c);/* @__PURE__ */
|
|
6
|
+
return M("g",{children:[
|
|
7
|
+
/* @__PURE__ */y(t,{id:Q,glow:z}),v.map((t,l)=>{let m=0,s=0;const h=r(Math.min(r.domain[1],Math.max(r.domain[0],0)));return q.map((t,c)=>{const f=t.data[l];if(!Number.isFinite(f))return null;const b=nt?it(f,l):f;if(null===b)return null;const p=X(t,l),x=lt(i,c),M=k?i(l):i(l)+x.offset,g=k?Math.max(1,i.bandwidth):x.width;let v,N,$=!0;if(k){const t=b>=0?m:s,e=t+b;b>=0?m=e:s=e,v=r(Math.max(t,e)),N=r(Math.min(t,e)),$=0===t}else v=Math.min(r(b),h),N=Math.max(r(b),h);const w=Math.max(0,N-v-(k&&!$?2:0)),j=null===d||d===l,A=j?p:O?u.muted:p,F=o(t.key,U);/* @__PURE__ */
|
|
8
|
+
return y("rect",{x:M,y:v,width:g,height:w,rx:K,fill:A,fillOpacity:F??(j?1:O?.32:.45),filter:z&&d===l?`url(#${n(Q)})`:void 0,className:"rosh-viz-mark"+(V?` ${e.rise}`:""),style:V?a(l*(k?1:q.length)+c,26):void 0},`${t.key}-${l}`)})}),null!==s&&!O&&/* @__PURE__ */y("line",{x1:i.center(s),y1:r(r.domain[1]),x2:i.center(s),y2:m,stroke:u.axis,strokeWidth:1})]})}})}export{g as ColumnChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return t("div",{id:j,role:"group","aria-label":u,className:`flex min-w-0 flex-wrap items-center gap-2 ${
|
|
3
|
-
/* @__PURE__ */s("div",{className:"w-30 shrink-0",children:/* @__PURE__ */s(e,{value:h,onChange:v,min:k,max:g,step:x,precision:0,placeholder:w,prefix:/* @__PURE__ */s("span",{"data-radius-mark":"","aria-hidden":"true",children:
|
|
4
|
-
/* @__PURE__ */s("div",{ref:
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-IH4SVMXJ.js";import{IconButton_default as r}from"./chunk-HMZLRXLA.js";import{Icon as a}from"./chunk-42BBJJDP.js";import{Tooltip as i}from"./chunk-2LXTJXWC.js";import{useShellStrings as n}from"./chunk-KKZZAK76.js";import{useState as l,useRef as o}from"react";import{jsxs as t,jsx as s}from"react/jsx-runtime";var d={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},c=["tl","tr","bl","br"];function u({label:u,value:m,corners:f,onChange:p,radius:h=null,onRadiusChange:v,radiusLabel:b,radiusMin:k=0,radiusMax:g,radiusStep:x=1,radiusPlaceholder:w,disabled:y=!1,disabledReason:A,id:j,className:K=""}){const M=n(),C=function(e){const r=c.map(r=>e.find(e=>e.value===r));for(const a of e){if(c.includes(a.value))continue;const e=r.findIndex(e=>void 0===e);-1===e?r.push(a):r[e]=a}return r.filter(e=>void 0!==e)}(f),[L,N]=l(0),R=o(null);/* @__PURE__ */
|
|
2
|
+
return t("div",{id:j,role:"group","aria-label":u,className:`flex min-w-0 flex-wrap items-center gap-2 ${K}`.trim(),children:[v&&
|
|
3
|
+
/* @__PURE__ */s("div",{className:"w-30 shrink-0",children:/* @__PURE__ */s(e,{value:h,onChange:v,min:k,max:g,step:x,precision:0,placeholder:w,prefix:/* @__PURE__ */s("span",{"data-radius-mark":"","aria-hidden":"true",children:M.corners.radiusMark}),suffix:M.corners.unit,steppers:"compact",disabled:y,"aria-label":b??M.corners.radius})}),
|
|
4
|
+
/* @__PURE__ */s("div",{ref:R,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const r=Array.from(R.current?.querySelectorAll("button[data-corner]")??[]),a=r.indexOf(document.activeElement);if(-1===a)return;const i=a%2,n=Math.floor(a/2),l="ArrowRight"===e.key?2*n+1:"ArrowLeft"===e.key?2*n:"ArrowDown"===e.key?2+i:"ArrowUp"===e.key?i:null;null!==l&&(e.preventDefault(),l<r.length&&r[l].focus())},children:C.map((e,n)=>{const l=m.includes(e.value),o=y||!0===e.disabled,t=o&&(!0===e.disabled&&e.title||(y?A:void 0))||void 0,c=/* @__PURE__ */s(r,{"aria-pressed":l,"aria-label":e.label,"aria-disabled":o||void 0,disabledReason:t,"data-corner":e.value,size:"sm",tabIndex:n===L?0:-1,onFocus:()=>N(n),onClick:()=>{o||p(l?m.filter(r=>r!==e.value):[...m,e.value])},children:/* @__PURE__ */s(a,{name:"corner",strokeWidth:2,className:["h-4 w-4",d[e.value]??""].filter(Boolean).join(" ")})},e.value);return t?c:/* @__PURE__ */s(i,{content:e.title??e.label,children:c},e.value)})})]})}export{u as CornersInput};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{optionMatches as e,OptionSublabel as t}from"./chunk-QSW26NAH.js";import{inputClasses as n}from"./chunk-JFSYWEHD.js";import{GROUP_COLORS as r}from"./chunk-5SULG7D5.js";import{Tooltip as o}from"./chunk-2LXTJXWC.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as a,POPUP_MAX_WIDTH as s,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as d}from"./chunk-
|
|
2
|
-
return v("div",{ref:
|
|
3
|
-
/* @__PURE__ */v("div",{onMouseDown:e=>{C||e.target.closest("button")||(e.preventDefault(),
|
|
4
|
-
/* @__PURE__ */x("span",{className:"truncate",children:
|
|
5
|
-
/* @__PURE__ */x("input",{id:D,ref:
|
|
6
|
-
/* @__PURE__ */x("div",{ref:
|
|
1
|
+
import{optionMatches as e,OptionSublabel as t}from"./chunk-QSW26NAH.js";import{inputClasses as n}from"./chunk-JFSYWEHD.js";import{GROUP_COLORS as r}from"./chunk-5SULG7D5.js";import{Tooltip as o}from"./chunk-2LXTJXWC.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as a,POPUP_MAX_WIDTH as s,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as d}from"./chunk-KKZZAK76.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as g}from"react-dom";import{jsxs as v,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-blue-50 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 ${r.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:r,onChange:y,options:k=[],placeholder:N,allowFreeText:j=!1,invalid:L,disabled:C,id:D,className:W="",tone:E,tooltip:S,split:J}){const[$,F]=m(!1),[H,K]=m(""),M=d(),T=h(null),B=h(null),G=h(null),I=a(T,$),A=e=>k.find(t=>t.value===e)?.label??e,R=p(()=>{const t=new Set(r),n=[],o=H.trim().toLowerCase();for(const r of k)t.has(r.value)||(t.add(r.value),o&&!e(r,o)||n.push(r));return n},[k,r,H]),U=e=>{const t=[...r];for(const n of e){const e=n.trim();if(!e)continue;const r=e.toLowerCase(),o=k.find(t=>t.value===e||t.label.toLowerCase()===r)?.value,l=o??(j?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==r.length&&y(t)},X=e=>{e&&!r.includes(e)?(y([...r,e]),K("")):K("")},Z=e=>y(r.filter(t=>t!==e)),z=()=>{const e=H.trim();if(J&&e)return U(e.split(J)),void K("");j&&e?X(e):K("")},P=h(()=>{});P.current=()=>{z(),F(!1)},f(()=>{if(!$)return;const e=e=>{const t=e.target;T.current?.contains(t)||G.current?.contains(t)||(z(),F(!1))};document.addEventListener("mousedown",e);const t=l(()=>P.current());return()=>{document.removeEventListener("mousedown",e),t()}});const Q=k.length>0;/* @__PURE__ */
|
|
2
|
+
return v("div",{ref:T,className:"relative",children:[
|
|
3
|
+
/* @__PURE__ */v("div",{onMouseDown:e=>{C||e.target.closest("button")||(e.preventDefault(),B.current?.focus())},className:n({invalid:L,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)] ${C?"bg-gray-50 cursor-not-allowed":""} ${W}`}),children:[r.map(e=>{const t=E?.(e),n=w[t??"accent"],r=/* @__PURE__ */v("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
+
/* @__PURE__ */x("span",{className:"truncate",children:A(e)}),!C&&/* @__PURE__ */x("button",{type:"button","aria-label":M.select.removeItem?.(A(e))??`${M.select.remove} ${A(e)}`,onClick:()=>Z(e),className:n.remove,children:"×"})]},e),l=S?.(e);return null==l?r:/* @__PURE__ */x(o,{content:l,className:"relative inline-flex max-w-full",children:r},e)}),
|
|
5
|
+
/* @__PURE__ */x("input",{id:D,ref:B,type:"text",autoComplete:"off",role:"combobox","aria-expanded":$&&Q,"aria-invalid":L||void 0,disabled:C,value:H,placeholder:0===r.length?N:void 0,onChange:e=>{(e=>{if(J){const t=e.split(J);if(t.length>1)return U(t.slice(0,-1)),void K(t[t.length-1])}K(e)})(e.target.value),F(!0)},onFocus:()=>{!C&&Q&&F(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=H.trim(),r=n?R.filter(t=>e(t,n.toLowerCase())):[];1===r.length?X(r[0].value):z()}else"Backspace"===t.key&&""===H&&r.length>0?Z(r[r.length-1]):"Escape"===t.key?(F(!1),K(""),B.current?.blur()):"Tab"===t.key&&(z(),F(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-gray-400 rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),$&&Q&&g(
|
|
6
|
+
/* @__PURE__ */x("div",{ref:G,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:I?.left,right:I?.right,top:I?.top,bottom:I?.bottom,minWidth:I?.minWidth,maxWidth:I?.maxWidth??s,width:"max-content",visibility:I?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:I?.maxHeight??c},children:0===R.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&r.length>=k.length?M.select.allSelected:M.select.noMatches}):R.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),X(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-gray-50 text-gray-700 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-gray-50 text-gray-700 whitespace-nowrap",children:e.sublabel?/* @__PURE__ */v(b,{children:[
|
|
7
7
|
/* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
|
|
8
8
|
/* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{ImageFocusPoint as e}from"./chunk-N7KL336H.js";import{FormField as a}from"./chunk-MVQBVPWP.js";import{isVideoUrl as i,mediaPromptLine as t,mediaFileName as r,FilenameBadge as o,BusyOverlay as n,UploadGlyph as l,dropzoneClass as s,zoneFocusClass as c}from"./chunk-KB6BGPQK.js";import{TransferProgress as d}from"./chunk-5TVF4BCM.js";import{Segmented as u}from"./chunk-CHNYSP6K.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-ZNZDV6SN.js";import{Icon as p}from"./chunk-42BBJJDP.js";import{useShellStrings as b}from"./chunk-KKZZAK76.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as N,jsx as k,Fragment as j}from"react/jsx-runtime";var x=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:C,onFile:P,label:R,hint:F,error:B,required:K,className:U,accept:$="image/*",maxSizeBytes:z,fit:H="cover",height:O=112,placeholder:V,cta:S,acceptHint:Z,showFilename:q=!0,allowReplace:A=!0,allowRemove:D=!0,replaceLabel:I,removeLabel:J,busy:M=!1,busyLabel:Q,choosingLabel:W,pickFailedLabel:_,progress:G,disabled:T=!1,kind:Y,onKindChange:E,focus:X,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=S??ie.cta,re=Y??(/video/.test($)&&!/image/.test($)?"video":"image"),oe="string"==typeof J&&J?J:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=M||ne,me=ne&&!M?W??ie.choosing:Q??ie.uploading,he=B??(se?_??ie.pickFailed:void 0),pe=e=>{if(!C)return;ce(!1);const a=C(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=T||ue,Ne=!!w&&(i(w,$)||w===ve),ke=V??t($,ie),je=I??(Ne||"video"===re?ie.changeVideo:ie.changeImage),xe=e=>{C?pe(e):P?P(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:$,maxSizeBytes:z,acceptHint:Z,multiple:!1,disabled:ye,onAccept:([e])=>xe(e)}),{dragOver:Le}=we,Ce=()=>{ye||(C?pe():we.open())},Pe=w?r(w):"",Re=!Ne&&!!ee,Fe=T||!A&&!D?null:/* @__PURE__ */N("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[A&&/* @__PURE__ */N("button",{id:Re?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Ce(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${x}`,children:[
|
|
2
|
+
/* @__PURE__ */k(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
3
|
+
/* @__PURE__ */k("span",{id:`${be}-change`,className:"truncate",children:je})]}),D&&/* @__PURE__ */k("button",{type:"button","aria-label":oe,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${x}`,children:/* @__PURE__ */k(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Be=/* @__PURE__ */N("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Re?"":"bg-gray-100",Le?"border-blue-500":"border-gray-200"].join(" "),style:Re?void 0:{height:O},children:[Re?
|
|
4
|
+
/* @__PURE__ */k(e,{value:X??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):Ne?/* @__PURE__ */k("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Pe||void 0,className:"h-full w-full",style:{objectFit:H}}):/* @__PURE__ */k("img",{src:w??void 0,alt:Pe,className:"h-full w-full",style:{objectFit:H,objectPosition:X||void 0}}),q&&w&&/* @__PURE__ */k(o,{children:Pe}),Fe,ue&&/* @__PURE__ */k(n,{label:me,progress:G,rounded:"rounded-md"})]}),Ke=/* @__PURE__ */k("button",{type:"button",id:be,onClick:()=>Ce(),disabled:ye,"aria-label":"string"==typeof ke?ke:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":K||void 0,"aria-describedby":he?`${be}-error`:F?`${be}-hint`:void 0,...we.zoneProps,className:s(Le,ye,c(ye)),style:{minHeight:O},children:ue?/* @__PURE__ */k(d,{state:"busy",verb:me,pct:G}):/* @__PURE__ */N(j,{children:[
|
|
5
|
+
/* @__PURE__ */k("span",{className:"text-gray-400",children:/* @__PURE__ */k(l,{})}),
|
|
6
|
+
/* @__PURE__ */k("span",{className:"px-3 text-xs text-gray-500",children:ke}),
|
|
7
|
+
/* @__PURE__ */k("span",{className:"text-sm font-medium text-blue-600",children:te}),Z&&/* @__PURE__ */k("span",{className:"text-xs text-gray-400",children:Z})]})});/* @__PURE__ */
|
|
8
|
+
return N(a,{label:R,htmlFor:be,hint:F,error:he,required:K,className:U,children:[E&&/* @__PURE__ */k("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */k(u,{value:re,onChange:e=>E(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */k(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */k(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof R&&R?R:ie.upload})}),w?Be:Ke,!C&&/* @__PURE__ */k("input",{...we.inputProps}),
|
|
9
|
+
/* @__PURE__ */k(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
|