efficient-shell 8.20.0 → 8.21.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 +4 -3
- package/dist/{Browser-KK4DSPFA.js → Browser-WJ7YGO3M.js} +14 -14
- package/dist/Calculator-FHN36ZE3.js +29 -0
- package/dist/{CurrencyConverter-PD2CEL6V.js → CurrencyConverter-ONCRQNI4.js} +9 -9
- package/dist/{Documents-QRU3INP2.js → Documents-YEMIR4WQ.js} +5 -5
- package/dist/{Files-NQBM46JA.js → Files-QWSOYRD4.js} +25 -25
- package/dist/{Notepad-KU2VK5QB.js → Notepad-MFVUGAGD.js} +10 -10
- package/dist/PdfViewer-ZFZ4PEAV.js +1 -0
- package/dist/{PomodoroTimer-JEQTTMGA.js → PomodoroTimer-JVQ5K7B4.js} +68 -68
- package/dist/{Preview-C6VU5P3N.js → Preview-7G2WM7DN.js} +44 -44
- package/dist/Sidebar-OFRMBB5V.js +43 -0
- package/dist/{Spreadsheet-HLH3EHCX.js → Spreadsheet-VKOS3PUA.js} +13 -13
- package/dist/{Stock-VCMJMUCW.js → Stock-TWJNCTNT.js} +3 -3
- package/dist/{Weather-HF3E3N3M.js → Weather-RM7GPLAH.js} +16 -16
- package/dist/{WorldClock-PM5CJQSL.js → WorldClock-ITJ2MO75.js} +6 -6
- package/dist/ai/index.js +17 -17
- 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/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-22S6LG6D.js +6 -0
- package/dist/{chunk-CQXKO5PB.js → chunk-24L7NLA3.js} +1 -1
- package/dist/{chunk-O3HXASSH.js → chunk-2BS74SYW.js} +1 -1
- package/dist/{chunk-THPTJGV5.js → chunk-2H6PDKTC.js} +7 -7
- package/dist/chunk-36MUTG34.js +1 -0
- package/dist/{chunk-VWVFKMU7.js → chunk-3HNK7IRJ.js} +3 -3
- package/dist/{chunk-KSSIZW3C.js → chunk-3PQHPFXP.js} +5 -5
- package/dist/{chunk-5TVF4BCM.js → chunk-3Z7LIHMB.js} +1 -1
- package/dist/chunk-4CANQ3B3.js +1 -0
- package/dist/{chunk-UEUCGC6G.js → chunk-4CWKK5HV.js} +4 -4
- package/dist/chunk-4IU5BSVE.js +2 -0
- package/dist/chunk-4PZN25MV.js +20 -0
- package/dist/{chunk-RC5SGXXR.js → chunk-4VK3GJZI.js} +1 -1
- package/dist/chunk-4XOTP5CB.js +2 -0
- package/dist/{chunk-PXCARPLZ.js → chunk-55WFJELE.js} +1 -1
- package/dist/{chunk-MRBC7GLE.js → chunk-5Z2WLSFM.js} +15 -15
- package/dist/{chunk-KB6BGPQK.js → chunk-6GVJ6IKD.js} +1 -1
- package/dist/{chunk-7T3COEQK.js → chunk-6KO5VTL7.js} +1 -1
- package/dist/{chunk-AZWEWGYG.js → chunk-6V753BUI.js} +3 -3
- package/dist/{chunk-FOSCSAJZ.js → chunk-735HKUTV.js} +1 -1
- package/dist/chunk-73DAZUJP.js +14 -0
- package/dist/{chunk-C6LV3HJW.js → chunk-7DKPJUGU.js} +1 -1
- package/dist/{chunk-IGH6DECG.js → chunk-7M7ESM5V.js} +12 -12
- package/dist/{chunk-UEMGH6EO.js → chunk-7S2I6ACG.js} +1 -1
- package/dist/{chunk-RZT7QES5.js → chunk-A4U4BTN3.js} +4 -4
- package/dist/{chunk-EQZAHIUG.js → chunk-ACZZXO5S.js} +2 -2
- package/dist/{chunk-5GMWOYTF.js → chunk-AH2AUQYM.js} +1 -1
- package/dist/{chunk-AILWMDWP.js → chunk-AJ42UE53.js} +1 -1
- package/dist/{chunk-XDG2RWUO.js → chunk-AX7KPMDV.js} +2 -2
- package/dist/{chunk-B36HEVMT.js → chunk-AXZEINMF.js} +19 -19
- package/dist/{chunk-OAYHU7YN.js → chunk-B4XPFCCQ.js} +2 -2
- package/dist/{chunk-JSOO4O5K.js → chunk-B55IXYDR.js} +2 -2
- package/dist/chunk-B5VOHZCD.js +1 -0
- package/dist/{chunk-MVCNSGM4.js → chunk-BIS5PHHV.js} +2 -2
- package/dist/{chunk-3V6UFR7M.js → chunk-BXM72C73.js} +1 -1
- package/dist/{chunk-X3II54HU.js → chunk-CDRXZBVR.js} +1 -1
- package/dist/{chunk-6SBPGUSR.js → chunk-CFLVEKSH.js} +1 -1
- package/dist/{chunk-FBSQABH2.js → chunk-CMYLTCPA.js} +1 -1
- package/dist/{chunk-YZCRHDOB.js → chunk-CU2B7G5A.js} +1 -1
- package/dist/{chunk-P5QRK7WD.js → chunk-CUT7PAXL.js} +1 -1
- package/dist/{chunk-5SULG7D5.js → chunk-D323R2FT.js} +1 -1
- package/dist/{chunk-AK632G3F.js → chunk-D5HHU5AO.js} +7 -7
- package/dist/{chunk-UELYZT4T.js → chunk-DIKOEJ2Y.js} +1 -1
- package/dist/{chunk-CVNM25BM.js → chunk-DLCIGDKC.js} +6 -6
- package/dist/chunk-DLS2VCBK.js +3 -0
- package/dist/{chunk-QSPW43OC.js → chunk-DMLJOBQS.js} +8 -8
- package/dist/chunk-DNKACLRF.js +11 -0
- package/dist/{chunk-D6FSZBJ5.js → chunk-DO6XTJ77.js} +1 -1
- package/dist/chunk-DZT2O3JD.js +11 -0
- package/dist/{chunk-KZ6P7WC6.js → chunk-EAEUSMYL.js} +1 -1
- package/dist/{chunk-XSFQR374.js → chunk-ECZT7SIE.js} +1 -1
- package/dist/{chunk-VYKITRFG.js → chunk-EDQBTPDF.js} +7 -7
- package/dist/{chunk-XBXEK6XP.js → chunk-EKWSGPJ4.js} +7 -7
- package/dist/{chunk-JJ6IUIYX.js → chunk-EL3O7ZFQ.js} +1 -1
- package/dist/chunk-ERFM5U3M.js +12 -0
- package/dist/{chunk-TLJCUUZU.js → chunk-ET32NQHX.js} +1 -1
- package/dist/chunk-ETSKG62F.js +1 -0
- package/dist/{chunk-XDAR2DSX.js → chunk-EXMFUK3A.js} +8 -8
- package/dist/chunk-F2Z6IXMM.js +2 -0
- package/dist/{chunk-KS3AQKHD.js → chunk-FPDKMCQH.js} +7 -7
- package/dist/{chunk-TF3E5J3Y.js → chunk-GI7FOLDX.js} +1 -1
- package/dist/{chunk-DCNXCFAD.js → chunk-H7ZXUGXX.js} +26 -26
- package/dist/{chunk-ZLHF5XRR.js → chunk-HJIBTA6V.js} +9 -9
- package/dist/{chunk-Z6V3EY6F.js → chunk-HVVPBAP5.js} +3 -3
- package/dist/chunk-HYFHCPNJ.js +15 -0
- package/dist/{chunk-DBLJIK5J.js → chunk-IAQC775L.js} +1 -1
- package/dist/{chunk-J67YIQEN.js → chunk-IGCXJHAK.js} +1 -1
- package/dist/{chunk-DBDJQVQM.js → chunk-IJA5ZAGL.js} +1 -1
- package/dist/{chunk-YUIWG2QT.js → chunk-IKNNHEVY.js} +1 -1
- package/dist/{chunk-EXVR3BWW.js → chunk-IMF537IJ.js} +9 -9
- package/dist/{chunk-TKBP5HRY.js → chunk-IPOSLLLU.js} +12 -12
- package/dist/{chunk-VXWCX65A.js → chunk-IURSUMDO.js} +8 -8
- package/dist/{chunk-7SPX7DLO.js → chunk-IY3CRZRH.js} +16 -16
- package/dist/chunk-JGE7S7RQ.js +29 -0
- package/dist/{chunk-H5GQWWPA.js → chunk-JYOI66DT.js} +1 -1
- package/dist/chunk-K4DZWCUP.js +8 -0
- package/dist/{chunk-42BBJJDP.js → chunk-KIBL6M3T.js} +10 -5
- package/dist/chunk-KPFOXLN4.js +5 -0
- package/dist/chunk-KZEQJVBO.js +3 -0
- package/dist/chunk-L2HZ7YXS.js +14 -0
- package/dist/chunk-L2YW3END.js +4 -0
- package/dist/{chunk-RYC3ZHXM.js → chunk-L65EQCZN.js} +5 -5
- package/dist/{chunk-KATRRQD5.js → chunk-L6FLPBU2.js} +5 -5
- package/dist/{chunk-3WM23XSR.js → chunk-LDFRVV5R.js} +8 -8
- package/dist/{chunk-3KDY6V6I.js → chunk-LMLM4KHQ.js} +8 -8
- package/dist/{chunk-LMOPRRQY.js → chunk-LQQMELJM.js} +12 -12
- package/dist/{chunk-CQAXN3HN.js → chunk-LVSPLCGG.js} +1 -1
- package/dist/{chunk-WGSIYW63.js → chunk-M5BFTFBK.js} +15 -15
- package/dist/{chunk-ZDJNTOUS.js → chunk-MEOICYR5.js} +1 -1
- package/dist/{chunk-CDBS47XI.js → chunk-MFEJ6TYE.js} +1 -1
- package/dist/{chunk-U62AWCZR.js → chunk-MHYOQMBV.js} +1 -1
- package/dist/{chunk-RHYMHVFS.js → chunk-MKITHLDU.js} +9 -9
- package/dist/chunk-MOOBUMON.js +9 -0
- package/dist/{chunk-R6L6PKQP.js → chunk-MTSZ66O4.js} +1 -1
- package/dist/{chunk-Q6YPDR7U.js → chunk-MWAYM46R.js} +12 -12
- package/dist/{chunk-CHNYSP6K.js → chunk-N6DTTOB6.js} +1 -1
- package/dist/{chunk-XXBGWT7L.js → chunk-N7VNKAXZ.js} +1 -1
- package/dist/{chunk-F5VXS5JO.js → chunk-NBVF2CXM.js} +1 -1
- package/dist/{chunk-VO3HT6IK.js → chunk-NDTMQRR2.js} +1 -1
- package/dist/{chunk-MQADQ4YF.js → chunk-NKJDOQVW.js} +1 -1
- package/dist/{chunk-QKHTL3FQ.js → chunk-NNKMEF3D.js} +1 -1
- package/dist/{chunk-3AVHOYQZ.js → chunk-NRDO5IHL.js} +1 -1
- package/dist/{chunk-Q2S76TZH.js → chunk-NSCLFAKK.js} +1 -1
- package/dist/{chunk-EVPOZQOI.js → chunk-OCCHDMEV.js} +1 -1
- package/dist/chunk-OF6TUQAL.js +7 -0
- package/dist/{chunk-DAV7SMCJ.js → chunk-OSSFYFXO.js} +1 -1
- package/dist/{chunk-F22KWATP.js → chunk-OSVN2UF7.js} +1 -1
- package/dist/{chunk-3RM3D2P3.js → chunk-OTU633XJ.js} +6 -6
- package/dist/{chunk-KE6NYTGF.js → chunk-OZF4QAJT.js} +3 -3
- package/dist/{chunk-HME2P5VX.js → chunk-OZPYTSPD.js} +23 -23
- package/dist/{chunk-MBXTOYMX.js → chunk-P7WUDHIP.js} +6 -6
- package/dist/{chunk-ZNZDV6SN.js → chunk-PG6AVBSR.js} +1 -1
- package/dist/{chunk-UPHXYWL6.js → chunk-PJCVNFWM.js} +11 -11
- package/dist/{chunk-J324R2BM.js → chunk-PTDLNTSK.js} +13 -13
- package/dist/{chunk-N7KL336H.js → chunk-PVSGQN5M.js} +6 -6
- package/dist/{chunk-47MFBFIX.js → chunk-PWOFYFMO.js} +6 -6
- package/dist/{chunk-RQ5RVKRO.js → chunk-QEVIQZIE.js} +2 -2
- package/dist/{chunk-4MTC6HA5.js → chunk-RAAUW5OZ.js} +2 -2
- package/dist/{chunk-E2YGQAFU.js → chunk-RAI3GTS6.js} +1 -1
- package/dist/chunk-RAQESAQZ.js +3 -0
- package/dist/{chunk-5JQCPUEO.js → chunk-RCRI6QZV.js} +1 -1
- package/dist/{chunk-G3IG4X4Z.js → chunk-RDPUVCXR.js} +1 -1
- package/dist/{chunk-4TER5BHR.js → chunk-RZBHO74V.js} +1 -1
- package/dist/{chunk-MKTO2FHK.js → chunk-SAKHGHF5.js} +1 -1
- package/dist/{chunk-4G5M752L.js → chunk-SXSMIMFY.js} +3 -3
- package/dist/{chunk-JSB5G2XQ.js → chunk-THDSOVEH.js} +2 -2
- package/dist/{chunk-CHOMUTLT.js → chunk-TT3S2XVQ.js} +1 -1
- package/dist/chunk-TW6WEYGO.js +8 -0
- package/dist/{chunk-XUK35DKG.js → chunk-U5I7IF72.js} +1 -1
- package/dist/{chunk-IM7QHAXT.js → chunk-UFVQ7ZBP.js} +5 -5
- package/dist/{chunk-QSW26NAH.js → chunk-UQBPKZUR.js} +1 -1
- package/dist/{chunk-F4PESM6A.js → chunk-UY47AKZU.js} +6 -6
- package/dist/{chunk-4TL3MRRE.js → chunk-VH6GB73Q.js} +1 -1
- package/dist/{chunk-2GPXC6JX.js → chunk-VHAM5TD2.js} +1 -1
- package/dist/{chunk-5VUVKP55.js → chunk-VOHZQVFK.js} +6 -6
- package/dist/chunk-VT62T6B3.js +19 -0
- package/dist/{chunk-IH4SVMXJ.js → chunk-VX4BNYH3.js} +2 -2
- package/dist/{chunk-O43QLNPL.js → chunk-VY7EPQEG.js} +1 -1
- package/dist/chunk-WBEMN4JG.js +9 -0
- package/dist/{chunk-TQP3L4OC.js → chunk-WDXJWC3Y.js} +5 -5
- package/dist/{chunk-E4O2ZMXF.js → chunk-WJEDIAG4.js} +1 -1
- package/dist/{chunk-7HTURXIA.js → chunk-WRJDHFLD.js} +3 -3
- package/dist/chunk-X4EBWJWO.js +1 -0
- package/dist/{chunk-4FOTTLL7.js → chunk-XVJCVYDI.js} +2 -2
- package/dist/{chunk-NGVODCMV.js → chunk-XWH6KVVB.js} +3 -3
- package/dist/chunk-Y5ZWPU4L.js +14 -0
- package/dist/{chunk-7RD623PT.js → chunk-YGEK2Z6P.js} +1 -1
- package/dist/{chunk-55DONELU.js → chunk-YSHS6QIY.js} +6 -6
- package/dist/{chunk-ABD5X73I.js → chunk-YTGWIMXB.js} +1 -1
- package/dist/{chunk-2SHDXTB6.js → chunk-YVBFFE4Z.js} +5 -5
- package/dist/{chunk-B5MOPSMW.js → chunk-ZBLNVAZ4.js} +3 -3
- package/dist/{chunk-BIEKHPZ5.js → chunk-ZDK2JYH5.js} +52 -52
- package/dist/{chunk-FFZ7KPIV.js → chunk-ZKOIGLRF.js} +7 -7
- package/dist/data/DataTable.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconButton.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/MediaLibrary.d.ts +157 -0
- package/dist/forms/MediaLibrary.js +2 -0
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.d.ts +54 -3
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.d.ts +64 -0
- package/dist/forms/mediaLibraryMenu.js +2 -0
- package/dist/forms/mediaMoveItems.d.ts +42 -3
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +424 -424
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +6 -6
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/Tooltip.d.ts +9 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +88 -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 +4 -2
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-PH6NVEEZ.js +0 -29
- package/dist/PdfViewer-GODDA4GG.js +0 -1
- package/dist/Sidebar-SJMMY2Y2.js +0 -43
- package/dist/chunk-2LXTJXWC.js +0 -6
- package/dist/chunk-36DYXGQI.js +0 -7
- package/dist/chunk-3NWCVZRK.js +0 -10
- package/dist/chunk-3P7SBAKK.js +0 -3
- package/dist/chunk-6UOMJ7E4.js +0 -2
- package/dist/chunk-ABDT4M5L.js +0 -19
- package/dist/chunk-BZWTFLQD.js +0 -15
- package/dist/chunk-CIGHIX6Z.js +0 -14
- package/dist/chunk-DAJTVAWO.js +0 -11
- package/dist/chunk-ENVCMR3M.js +0 -5
- package/dist/chunk-H5VGRHNT.js +0 -9
- package/dist/chunk-HLGE6TVE.js +0 -4
- package/dist/chunk-HMZLRXLA.js +0 -1
- package/dist/chunk-JH4W3R4Q.js +0 -11
- package/dist/chunk-KKZZAK76.js +0 -1
- package/dist/chunk-LYLEH25Y.js +0 -1
- package/dist/chunk-NI76QOA2.js +0 -2
- package/dist/chunk-NZ67C5OK.js +0 -12
- package/dist/chunk-OHSJWKNV.js +0 -14
- package/dist/chunk-Q75PSCZ5.js +0 -20
- package/dist/chunk-SIQSD3QT.js +0 -8
- package/dist/chunk-TCB2J3PS.js +0 -9
- package/dist/chunk-UDD7GB4F.js +0 -2
- package/dist/chunk-WMO2JQNL.js +0 -8
- package/dist/chunk-WOHOIJRZ.js +0 -3
- package/dist/chunk-X7ZBGXUU.js +0 -1
- /package/dist/{chunk-PCGZS6S4.js → chunk-276AUQNN.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{CountBadge as e}from"./chunk-
|
|
2
|
-
return o("div",{"data-accordion":$,className:`@container/acc flex flex-col ${"band"===$?"gap-0.5":""} ${g}`.trim(),children:d.map(i=>{const t=K.includes(i.id),a=`${
|
|
1
|
+
import{CountBadge as e}from"./chunk-YGEK2Z6P.js";import{Icon as n}from"./chunk-KIBL6M3T.js";import{useShellStrings as i,useShellLocale as t}from"./chunk-ETSKG62F.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useState as a,useId as s}from"react";import{jsx as o,jsxs as c,Fragment as l}from"react/jsx-runtime";var d="px-4 @max-[260px]/acc:px-3",h={band:{head:`${d} py-3 bg-(--rosh-fold-band)`,press:"hover:bg-(--rosh-fold-band-hover)",title:"text-base font-semibold text-(--ink-strongest)",chev:"text-(--ink-strongest)",body:`${d} pb-2`},row:{head:`${d} py-2`,press:"hover:bg-gray-50",title:"text-sm font-medium text-(--ink-strong)",chev:"text-(--ink-strong)",body:`${d} pb-2`}},m=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join(""),u="m-0 p-0 border-0 [font:inherit] [letter-spacing:inherit] [text-transform:inherit]";function f({items:d,defaultOpenIds:f=[],openIds:p,onOpenChange:b,allowMultiple:v=!1,level:x=3,tier:$="band",className:g=""}){const N=h[$],y=i(),k=t(),[w,j]=a(f),C=s(),I=`h${x}`,K=p??w;/* @__PURE__ */
|
|
2
|
+
return o("div",{"data-accordion":$,className:`@container/acc flex flex-col ${"band"===$?"gap-0.5":""} ${g}`.trim(),children:d.map(i=>{const t=K.includes(i.id),a=`${C}-${m(i.id)}-head`,s=`${C}-${m(i.id)}-panel`;/* @__PURE__ */
|
|
3
3
|
return c("div",{children:[
|
|
4
|
-
/* @__PURE__ */o(
|
|
4
|
+
/* @__PURE__ */o(I,{className:u,children:/* @__PURE__ */c("button",{type:"button",id:a,disabled:i.disabled,"aria-expanded":t,"aria-controls":t?s:void 0,onClick:()=>(e=>{const n=K.includes(e)?K.filter(n=>n!==e):v?[...K,e]:[e];void 0===p&&j(n),b?.(n)})(i.id),className:`flex w-full items-center gap-2 text-left transition-colors duration-(--motion-fast) disabled:cursor-not-allowed disabled:opacity-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${N.head} ${N.press}`,children:[null!=i.icon&&/* @__PURE__ */o("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${N.chev}`,children:i.icon}),
|
|
5
5
|
/* @__PURE__ */o("span",{className:`min-w-0 flex-1 ${N.title}`,children:i.title}),"number"==typeof i.count&&i.count>0&&
|
|
6
6
|
/* @__PURE__ */c(l,{children:[
|
|
7
7
|
/* @__PURE__ */o("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */o(e,{count:i.count,tone:"accent"})}),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-CDRXZBVR.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-P5BOTIJU.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-ETSKG62F.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:M=4,formatValue:N,animate:j=!0,className:$,emptyLabel:C}){const F=m().charts,R=c(),W=N??(e=>h(e,R)),w=C??F.nothingToCompare,T=p(),[A,B]=u(null),{highlighted:E}=a(),L=x;if(k.length<3||0===L.length)/* @__PURE__ */
|
|
2
|
+
return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:w});const U=y/2,z=y/2,O=y/2-46,S=n(k.length),V=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...L.map(e=>e.values[t]??0).filter(Number.isFinite))),Y=(e,t)=>{const r=Math.max(0,Math.min(1,t/V[e])),l=S.center(e)-S.step/2;return[U+O*r*Math.cos(l),z+O*r*Math.sin(l)]},Z=(e,t)=>null!==A?A!==e:null!==E&&E!==t,H=null!==A?L[A]:void 0;/* @__PURE__ */
|
|
3
|
+
return f("div",{className:`relative ${$??""}`,children:[
|
|
4
|
+
/* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":T,onMouseLeave:()=>B(null),children:[
|
|
5
|
+
/* @__PURE__ */d("title",{id:T,children:F.acrossMeasures(L.map(e=>e.label),k.length)}),Array.from({length:M},(e,r)=>{const l=O*(r+1)/M;return"circle"===v?/* @__PURE__ */d("circle",{cx:U,cy:z,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(U,z,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=Y(t,V[t]);/* @__PURE__ */
|
|
6
|
+
return f("g",{children:[
|
|
7
|
+
/* @__PURE__ */d("line",{x1:U,y1:z,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
|
|
8
|
+
/* @__PURE__ */d("text",{x:U+(O+18)*Math.cos(S.center(t)-S.step/2),y:z+(O+18)*Math.sin(S.center(t)-S.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
|
|
9
|
+
/* @__PURE__ */d(r,{id:T,reveal:!!j&&"center-out"}),L.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>Y(r,e.values[r]??0));/* @__PURE__ */
|
|
10
|
+
return f("g",{opacity:Z(t,e.key)?.3:1,onMouseEnter:()=>B(t),mask:j?`url(#${l(T)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
|
|
11
|
+
/* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),H&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:H.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(A,3,H.color,H.tone),value:W(H.values[t]??0)}))})}),
|
|
12
|
+
/* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:L.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
13
|
+
/* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
|
|
14
|
+
/* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
15
|
+
/* @__PURE__ */d(e,{caption:F.acrossMeasures(L.map(e=>e.label),k.length),head:[F.tableSeries,...k.map(e=>e.label)],rows:L.map(e=>[e.label,...k.map((t,r)=>W(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{requestFilesTrashView as n}from"./chunk-
|
|
1
|
+
import{requestFilesTrashView as n}from"./chunk-RAAUW5OZ.js";var o=null;function r(n){o=n}function t(){return o}function u(){n()}export{t as getFilesDemoTree,u as openFilesInTrashMode,r as setFilesDemoTree};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ErrorPage as r}from"./chunk-
|
|
1
|
+
import{ErrorPage as r}from"./chunk-CU2B7G5A.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-4IU5BSVE.js";import{useShellStrings as s}from"./chunk-ETSKG62F.js";import{Component as o}from"react";import{jsxs as i,jsx as a,Fragment as n}from"react/jsx-runtime";function c({pick:r}){/* @__PURE__ */
|
|
2
2
|
return a(n,{children:r(s().errors)})}var l=class extends o{state={error:null};static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,t){console.error("ErrorBoundary caught an error:",r,t),e(r),this.props.onError?.(r,t)}componentDidUpdate(r){if(!this.state.error)return;const e=r.resetKeys??[],t=this.props.resetKeys??[];(e.length!==t.length||e.some((r,e)=>!Object.is(r,t[e])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
|
|
3
3
|
/* @__PURE__ */i("div",{className:"flex h-full flex-col",children:[
|
|
4
4
|
/* @__PURE__ */a("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */a(r,{code:500,actions:/* @__PURE__ */i(n,{children:[
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{InputNumber_default as a}from"./chunk-
|
|
1
|
+
import{InputNumber_default as a}from"./chunk-VX4BNYH3.js";import{Icon as e}from"./chunk-KIBL6M3T.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";var n="h-3.5 w-3.5",l={x:/* @__PURE__ */i(e,{name:"nudge-x","aria-hidden":"true",className:n}),y:/* @__PURE__ */i(e,{name:"nudge-y","aria-hidden":"true",className:n})};function s({label:e,value:n,onChange:s,words:m,placeholder:o,min:d=-200,max:c=200,step:t=1,readOnly:p}){const u=e=>/* @__PURE__ */i("div",{"data-axis":e,className:"min-w-0",children:/* @__PURE__ */i(a,{value:n[e],onChange:a=>s({...n,[e]:a}),min:d,max:c,step:t,precision:0,steppers:"compact",readOnly:p,placeholder:o[e],prefix:l[e],suffix:m.unit,"aria-label":m[e]})});/* @__PURE__ */
|
|
2
2
|
return r("div",{role:"group","aria-label":e,className:"grid min-w-0 grid-cols-2 gap-2",children:[u("x"),u("y")]})}export{s as PositionInput};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Button_default as e}from"./chunk-
|
|
1
|
+
import{Button_default as e}from"./chunk-4IU5BSVE.js";import{Icon as r}from"./chunk-KIBL6M3T.js";import{useShellStrings as t}from"./chunk-ETSKG62F.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
|
|
2
2
|
return a("div",{className:`flex flex-col items-center justify-center text-center ${"card"===i?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===i?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
|
|
3
3
|
/* @__PURE__ */d(r,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
|
|
4
4
|
/* @__PURE__ */d("h3",{className:"text-sm font-medium text-gray-900",children:n??m.loadError}),
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{CountBadge as e}from"./chunk-
|
|
1
|
+
import{CountBadge as e}from"./chunk-YGEK2Z6P.js";import{SettingAutoContext as t,InSettingRowContext as a}from"./chunk-E4Z5OXBI.js";import{isShown as i}from"./chunk-HCP7WOAL.js";import{useShellStrings as n}from"./chunk-ETSKG62F.js";import{jsx as s,jsxs as r}from"react/jsx-runtime";var l={default:{pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},compact:{pad:"py-2",gap:"gap-2",text:"text-sm",bodyTop:"mt-2",bodyPad:"pt-2"}};function d({label:d,icon:c,action:m,value:o,readout:p,description:h,children:x,controlId:u,unknownText:g="—",quiet:f=!1,size:v="default",viewState:y,divider:N=!0,showWhen:w,values:b,context:$,className:j=""}){const k=n();if(!i(w,b,$))return null;const P=l[v],T=void 0!==o||void 0===x&&null==m,E=null==o||""===o,B=f?"text-gray-500":"text-gray-800",F=E?"text-gray-400":f?"text-gray-500":"text-gray-900",G=null!=p&&!1!==p,I=`${P.text} font-medium ${B}${"compact"===v?" whitespace-nowrap":""}`,K=u?/* @__PURE__ */s("label",{htmlFor:u,className:I,children:d}):/* @__PURE__ */s("span",{className:I,children:d}),O="auto"===y?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-gray-200 px-1 text-2xs font-normal leading-4 text-gray-500",children:k.settingView.auto}):"edited"===y?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
|
|
2
2
|
/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */s(e,{dot:!0,tone:"accent"})}),
|
|
3
|
-
/* @__PURE__ */s("span",{className:"sr-only",children:k.settingView.edited})]}):null,
|
|
4
|
-
return r("div",
|
|
3
|
+
/* @__PURE__ */s("span",{className:"sr-only",children:k.settingView.edited})]}):null,S=/* @__PURE__ */s(t.Provider,{value:"auto"===y,children:E?g:o}),V=[N?"border-t border-gray-100 first:border-t-0":"",P.pad,j].filter(Boolean).join(" "),W=null!=x&&!1!==x&&/* @__PURE__ */s("div",{className:`${P.bodyTop} border-t border-gray-100 ${P.bodyPad}`,children:x});/* @__PURE__ */
|
|
4
|
+
return r("div",G?{className:V,"data-setting-row":"compact"===v?v:void 0,children:[
|
|
5
5
|
/* @__PURE__ */r("div",{"data-setting-line":"",className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-2",children:[
|
|
6
|
-
/* @__PURE__ */s("div",{"data-setting-name":"compact"===v?"":void 0,className:"flex-1 basis-0",children:/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${
|
|
6
|
+
/* @__PURE__ */s("div",{"data-setting-name":"compact"===v?"":void 0,className:"flex-1 basis-0",children:/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${B}`,children:[null!=c&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:c}),K,O]})}),
|
|
7
7
|
/* @__PURE__ */r("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[
|
|
8
|
-
/* @__PURE__ */s("span",{"data-setting-readout":"",className:`whitespace-nowrap ${P.text} ${f?"text-gray-500":"text-gray-900"}`,children:p}),("compact"===v||null!=m)&&/* @__PURE__ */s("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:m})]})]}),h&&/* @__PURE__ */s("p",{className:"mt-0.5 text-xs text-gray-500",children:h}),void 0!==o&&/* @__PURE__ */s("div",{"data-setting-value":"",className:`mt-2 flex justify-end ${P.text} ${
|
|
8
|
+
/* @__PURE__ */s("span",{"data-setting-readout":"",className:`whitespace-nowrap ${P.text} ${f?"text-gray-500":"text-gray-900"}`,children:p}),("compact"===v||null!=m)&&/* @__PURE__ */s("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:m})]})]}),h&&/* @__PURE__ */s("p",{className:"mt-0.5 text-xs text-gray-500",children:h}),void 0!==o&&/* @__PURE__ */s("div",{"data-setting-value":"",className:`mt-2 flex justify-end ${P.text} ${F}`,children:/* @__PURE__ */s(a.Provider,{value:"compact"===v,children:S})}),W]}:{className:V,"data-setting-row":"compact"===v?v:void 0,children:[
|
|
9
9
|
/* @__PURE__ */r("div",{className:"compact"===v?"flex flex-wrap items-center justify-between gap-x-2 gap-y-2":`flex items-center justify-between ${P.gap}`,children:[
|
|
10
10
|
/* @__PURE__ */r("div",{"data-setting-name":"compact"===v?"":void 0,className:"compact"===v?"flex-1 basis-0":"min-w-0 flex-1",children:[null!=c?
|
|
11
|
-
/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${
|
|
12
|
-
/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:c}),O
|
|
13
|
-
/* @__PURE__ */r("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[T&&/* @__PURE__ */s("div",{"data-setting-value":"",className:`flex items-center justify-end ${P.text} ${
|
|
14
|
-
/* @__PURE__ */s("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:m})]}):null!=m?/* @__PURE__ */r("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[T&&/* @__PURE__ */s("div",{className:`${P.text} ${
|
|
11
|
+
/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${B}`,children:[
|
|
12
|
+
/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:c}),K,O]}):O?/* @__PURE__ */r("div",{className:"flex min-w-0 items-center gap-2",children:[K,O]}):K,h&&/* @__PURE__ */s("p",{className:"mt-0.5 text-xs text-gray-500",children:h})]}),"compact"===v?
|
|
13
|
+
/* @__PURE__ */r("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[T&&/* @__PURE__ */s("div",{"data-setting-value":"",className:`flex items-center justify-end ${P.text} ${F}`,children:/* @__PURE__ */s(a.Provider,{value:!0,children:S})}),
|
|
14
|
+
/* @__PURE__ */s("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:m})]}):null!=m?/* @__PURE__ */r("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[T&&/* @__PURE__ */s("div",{className:`${P.text} ${F}`,children:S}),m]}):T&&/* @__PURE__ */s("div",{className:`shrink-0 ${P.text} ${F}`,children:S})]}),W]})}export{d as SettingRow};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{calendarNames as e,firstDayOfWeek as t}from"./chunk-5OTS2G3M.js";import{Icon as r}from"./chunk-
|
|
2
|
-
return u("div",{className:
|
|
1
|
+
import{calendarNames as e,firstDayOfWeek as t}from"./chunk-5OTS2G3M.js";import{Icon as r}from"./chunk-KIBL6M3T.js";import{useBrowserValue as a}from"./chunk-D65T4H6J.js";import{useShellStrings as n,useShellLocale as o}from"./chunk-ETSKG62F.js";import{useMemo as l,useState as i,useRef as s,useEffect as c}from"react";import{jsxs as u,jsx as g,Fragment as d}from"react/jsx-runtime";var h=e=>String(e).padStart(2,"0"),m="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";function b(e){return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())}`}function f(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const r=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(r.getTime())?null:r}var y=e=>`${e.getFullYear()}-${h(e.getMonth()+1)}`;var v=()=>b(/* @__PURE__ */new Date);var p=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),x=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),a))};function w({value:h,endValue:w,mode:N="single",onSelect:D,min:M,max:Y,month:k,defaultMonth:F,onMonthChange:j,weekStartsOn:S,quickJump:$=!0,markedDates:A,readOnly:C=!1,"aria-label":K,className:T=""}){const q=l(()=>new Set(A??[]),[A]),P=f(h),E=a(v,null),O=f(E),B=n().calendar,G=o(),H=e(G),I=a(()=>t(G),0),J=S??I,L=()=>{if(!O)return null;const e=y(O);return M&&e<M.slice(0,7)?M.slice(0,7):Y&&e>Y.slice(0,7)?Y.slice(0,7):e},[U,W]=i(()=>F||(P?y(P):L())),R=k??U??L(),V=null===R?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(R,O),[z,Q]=i(()=>h??E),X=s(null),Z=s(!1),[_,ee]=i("days"),te=l(()=>V?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),a=(r.getDay()-t+7)%7,n=new Date(r.getFullYear(),r.getMonth(),1-a);return Array.from({length:42},(e,t)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))}(V,J):[],[R,J]),re=e=>!!M&&e<M||!!Y&&e>Y,ae=z??E,ne=te.some(e=>b(e)===ae),oe=V?te.find(e=>e.getMonth()===V.getMonth())??te[0]:null,le=ne&&ae?ae:oe?b(oe):"";if(c(()=>{Z.current&&(Z.current=!1,X.current?.querySelector('[data-active="true"]')?.focus())},[le,R]),!V)/* @__PURE__ */
|
|
2
|
+
return u("div",{className:T,"aria-hidden":"true","data-calendar-pending":"",children:[
|
|
3
3
|
/* @__PURE__ */g("div",{className:"mb-2 h-6"}),
|
|
4
|
-
/* @__PURE__ */g("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */g("div",0===t?{className:"py-1 text-xs",children:" "}:{className:m,children:/* @__PURE__ */g("span",{className:"aspect-square"})},t))})]});const ie=e=>"years"===_?new Date(
|
|
5
|
-
return u("div",{className:
|
|
4
|
+
/* @__PURE__ */g("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */g("div",0===t?{className:"py-1 text-xs",children:" "}:{className:m,children:/* @__PURE__ */g("span",{className:"aspect-square"})},t))})]});const ie=e=>"years"===_?new Date(V.getFullYear()+12*e,V.getMonth(),1):"months"===_?new Date(V.getFullYear()+e,V.getMonth(),1):x(V,e),se=e=>{const t=y(e);void 0===k&&W(t),j?.(t)},ce=K??H.monthYear(V.getFullYear(),V.getMonth());/* @__PURE__ */
|
|
5
|
+
return u("div",{className:T,children:[
|
|
6
6
|
/* @__PURE__ */u("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
7
|
-
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?
|
|
8
|
-
/* @__PURE__ */g("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:$?/* @__PURE__ */u(d,{children:["years"!==_&&/* @__PURE__ */g("button",{type:"button","aria-label":
|
|
9
|
-
/* @__PURE__ */g("button",{type:"button","aria-label":
|
|
10
|
-
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?
|
|
11
|
-
/* @__PURE__ */u("div",{ref:
|
|
12
|
-
/* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-xs font-medium text-gray-500`,children:Array.from({length:7},(e,t)=>(t+
|
|
13
|
-
/* @__PURE__ */g("div",{role:"columnheader","aria-label":H.weekdays[e],className:"py-1",children:/* @__PURE__ */g("abbr",{title:H.weekdays[e],className:"no-underline",children:H.weekdaysShort[e]})},e))}),Array.from({length:6},(e,t)=>/* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-sm`,children:te.slice(7*t,7*t+7).map(e=>{const t=b(e),r=e.getMonth()!==
|
|
14
|
-
return g("div",{role:"gridcell","aria-selected":a,"aria-label":C?l:void 0,children:C?/* @__PURE__ */u("span",{"aria-hidden":"true",className:`grid place-items-center ${i(!1)}`,children:[e.getDate(),s]}):/* @__PURE__ */u("button",{type:"button","data-active":t===le,tabIndex:t===le?0:-1,disabled:o,"aria-label":l,"aria-current":t===
|
|
7
|
+
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?B.previousYears:"months"===_?B.previousYear:B.previousMonth,onClick:()=>se(ie(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */g(r,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
|
|
8
|
+
/* @__PURE__ */g("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:$?/* @__PURE__ */u(d,{children:["years"!==_&&/* @__PURE__ */g("button",{type:"button","aria-label":B.chooseMonth(H.months[V.getMonth()]),onClick:()=>ee(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:H.months[V.getMonth()]}),
|
|
9
|
+
/* @__PURE__ */g("button",{type:"button","aria-label":B.chooseYear(V.getFullYear()),onClick:()=>ee(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:V.getFullYear()})]}):/* @__PURE__ */g("span",{children:H.monthYear(V.getFullYear(),V.getMonth())})}),
|
|
10
|
+
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?B.nextYears:"months"===_?B.nextYear:B.nextMonth,onClick:()=>se(ie(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */g(r,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===_&&/* @__PURE__ */g("div",{role:"group","aria-label":B.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:H.monthsShort.map((e,t)=>/* @__PURE__ */g("button",{type:"button","aria-pressed":t===V.getMonth(),onClick:()=>{se(new Date(V.getFullYear(),t,1)),ee("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===V.getMonth()?"bg-blue-600 font-semibold text-white":O&&t===O.getMonth()&&V.getFullYear()===O.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===_&&/* @__PURE__ */g("div",{role:"group","aria-label":B.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=V.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */g("button",{type:"button","aria-pressed":e===V.getFullYear(),onClick:()=>{se(new Date(e,V.getMonth(),1)),ee("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===V.getFullYear()?"bg-blue-600 font-semibold text-white":e===O?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
|
|
11
|
+
/* @__PURE__ */u("div",{ref:X,role:"grid","aria-label":ce,className:"space-y-1","aria-readonly":C||void 0,onKeyDown:e=>{const t=f(le)??O??V,r={ArrowLeft:()=>p(t,-1),ArrowRight:()=>p(t,1),ArrowUp:()=>p(t,-7),ArrowDown:()=>p(t,7),Home:()=>p(t,-(t.getDay()-J+7)%7),End:()=>p(t,6-(t.getDay()-J+7)%7),PageUp:()=>x(t,e.shiftKey?-12:-1),PageDown:()=>x(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),Z.current=!0,Q(b(a)),void(y(a)!==R&&se(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),C||re(le)||D(le))},hidden:"days"!==_,children:[
|
|
12
|
+
/* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-xs font-medium text-gray-500`,children:Array.from({length:7},(e,t)=>(t+J)%7).map(e=>
|
|
13
|
+
/* @__PURE__ */g("div",{role:"columnheader","aria-label":H.weekdays[e],className:"py-1",children:/* @__PURE__ */g("abbr",{title:H.weekdays[e],className:"no-underline",children:H.weekdaysShort[e]})},e))}),Array.from({length:6},(e,t)=>/* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-sm`,children:te.slice(7*t,7*t+7).map(e=>{const t=b(e),r=e.getMonth()!==V.getMonth(),a=t===h||"range"===N&&t===w,n=(e=>!("range"!==N||!h||!w)&&e>h&&e<w)(t),o=re(t),l=H.longDate(e.getFullYear(),e.getMonth(),e.getDate()),i=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",o?"cursor-not-allowed text-gray-300":a?"bg-blue-600 font-semibold text-white":n?"bg-blue-100 text-blue-800":r?"text-gray-500"+(e?" hover:bg-gray-100":""):"text-gray-700"+(e?" hover:bg-gray-100":""),t!==E||a?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),s=q.has(t)&&/* @__PURE__ */g("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(a?"bg-white":r?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
|
|
14
|
+
return g("div",{role:"gridcell","aria-selected":a,"aria-label":C?l:void 0,children:C?/* @__PURE__ */u("span",{"aria-hidden":"true",className:`grid place-items-center ${i(!1)}`,children:[e.getDate(),s]}):/* @__PURE__ */u("button",{type:"button","data-active":t===le,tabIndex:t===le?0:-1,disabled:o,"aria-label":l,"aria-current":t===E?"date":void 0,onClick:()=>{Q(t),D(t)},className:i(!0),children:[e.getDate(),s]})},t)})},t))]})]})}export{w as Calendar,f as fromKey,b as toKey};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Markdown as e}from"./chunk-
|
|
1
|
+
import{Markdown as e}from"./chunk-AH2AUQYM.js";import{PLACEHOLDER_INK as t}from"./chunk-JFSYWEHD.js";import{Icon as r}from"./chunk-KIBL6M3T.js";import{LoadingSpinner as l}from"./chunk-Q5MD3VY6.js";import{useShellStrings as a}from"./chunk-ETSKG62F.js";import{useState as s,useMemo as n}from"react";import{jsxs as o,jsx as i,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */i(r,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:y,emptyMessage:f}){const b=a(),[v,w]=s(""),[N,k]=s(null),[j,C]=s({}),M=v.trim().toLowerCase(),L=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let r=e.get(t.category);r||(r={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,r)),r.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,r)=>(t.get(e.key)??1/0)-(t.get(r.key)??1/0))},[h,p]),_=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),A=n(()=>L.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[L,M]),E=n(()=>A.flatMap(e=>e.docs),[A]),B=(N?E.find(e=>e.slug===N):void 0)??E[0]??null,Y=e=>!!M||(j[e]??e===B?.category);/* @__PURE__ */
|
|
2
2
|
return o("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
3
3
|
/* @__PURE__ */o("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
|
|
4
4
|
/* @__PURE__ */o("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
@@ -6,16 +6,16 @@ return o("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
|
6
6
|
/* @__PURE__ */i("div",{className:"px-3 py-2 border-b border-gray-100 shrink-0",children:/* @__PURE__ */o("div",{className:"relative",children:[
|
|
7
7
|
/* @__PURE__ */i(r,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
|
|
8
8
|
/* @__PURE__ */i("input",{type:"text",value:v,onChange:e=>w(e.target.value),placeholder:b.help.searchPlaceholder,className:"w-full rounded-md border border-gray-300 bg-white h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
|
|
9
|
-
/* @__PURE__ */i("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */i(l,{size:"sm",padding:"py-6",label:b.help.loading}):0===
|
|
9
|
+
/* @__PURE__ */i("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */i(l,{size:"sm",padding:"py-6",label:b.help.loading}):0===A.length?/* @__PURE__ */i("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?b.help.noResults:f??b.help.empty}):A.map(e=>{const t=Y(e.key);/* @__PURE__ */
|
|
10
10
|
return o("div",{className:"py-0.5",children:[
|
|
11
|
-
/* @__PURE__ */o("button",{type:"button",onClick:()=>{return t=e.key,C(e=>({...e,[t]:!
|
|
11
|
+
/* @__PURE__ */o("button",{type:"button",onClick:()=>{return t=e.key,C(e=>({...e,[t]:!Y(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-gray-400 hover:text-gray-600",children:[
|
|
12
12
|
/* @__PURE__ */i(d,{open:t}),
|
|
13
|
-
/* @__PURE__ */i("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=
|
|
13
|
+
/* @__PURE__ */i("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=B?.slug===e.slug;/* @__PURE__ */
|
|
14
14
|
return o("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
|
|
15
15
|
/* @__PURE__ */i("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */i("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:b.help.draft})]},e.slug)})]},e.key)})})]}),
|
|
16
|
-
/* @__PURE__ */i("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:
|
|
16
|
+
/* @__PURE__ */i("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:B?/* @__PURE__ */o(c,{children:[
|
|
17
17
|
/* @__PURE__ */o("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
18
18
|
/* @__PURE__ */o("div",{className:"min-w-0",children:[
|
|
19
|
-
/* @__PURE__ */i("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:
|
|
20
|
-
/* @__PURE__ */o("p",{className:"text-xs text-gray-500 mt-0.5",children:[
|
|
21
|
-
/* @__PURE__ */i("div",{className:"flex-1 overflow-auto px-5 py-4",children:y?y(
|
|
19
|
+
/* @__PURE__ */i("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:B.title}),
|
|
20
|
+
/* @__PURE__ */o("p",{className:"text-xs text-gray-500 mt-0.5",children:[B.category_label,!1===B.is_published&&/* @__PURE__ */o("span",{className:"ml-2 text-amber-600",children:["· ",b.help.draft]})]})]}),u&&x&&/* @__PURE__ */i("button",{type:"button",onClick:()=>x(B),className:"shrink-0 text-sm text-blue-600 hover:underline",children:b.help.edit})]}),
|
|
21
|
+
/* @__PURE__ */i("div",{className:"flex-1 overflow-auto px-5 py-4",children:y?y(B):B.body?/* @__PURE__ */i(e,{children:B.body}):/* @__PURE__ */i("p",{className:"text-sm text-gray-500 italic",children:b.help.noBody})})]}):/* @__PURE__ */i("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */i(l,{size:"sm",padding:"",label:b.help.loading}):/* @__PURE__ */i("p",{className:"text-sm text-gray-500",children:b.help.pickArticle})})})]})}export{h as HelpCenter};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Calendar as e,fromKey as t}from"./chunk-
|
|
2
|
-
/* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:
|
|
3
|
-
/* @__PURE__ */N(e,{mode:"range",min:U,max:q,value:ee||null,endValue:re||null,month
|
|
4
|
-
return v("div",{className:"relative"+(
|
|
5
|
-
/* @__PURE__ */v("div",{className:`${
|
|
6
|
-
/* @__PURE__ */v("button",{ref:de,type:"button",onClick:()=>{
|
|
1
|
+
import{Calendar as e,fromKey as t}from"./chunk-IPOSLLLU.js";import{calendarNames as r}from"./chunk-5OTS2G3M.js";import{FILTER_ON as n,FILTER_ON_INK as a,FILTER_OFF as o}from"./chunk-JFSYWEHD.js";import{buttonClasses as l}from"./chunk-K7U4RWXJ.js";import{Icon as i}from"./chunk-KIBL6M3T.js";import{onOverlayOpen as s}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useDropdownPosition as c}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as m}from"./chunk-D65T4H6J.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as p,useShellLocale as h}from"./chunk-ETSKG62F.js";import{useState as f,useRef as g,useId as b,useEffect as x}from"react";import{createPortal as y}from"react-dom";import{jsxs as v,Fragment as w,jsx as N}from"react/jsx-runtime";var k=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],C=e=>`${e.getFullYear()}-${M(e.getMonth()+1)}`,M=e=>String(e).padStart(2,"0");function $(e){return`${e.getFullYear()}-${M(e.getMonth()+1)}-${M(e.getDate())}`}function D(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),l=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:$(new Date(r,n,t.getDate()-14)),to:$(a)};case"lastMonth":return{from:$(l(1)),to:$(o)};case"last3Months":return{from:$(l(3)),to:$(o)};case"last6Months":return{from:$(l(6)),to:$(o)};case"last12Months":return{from:$(l(12)),to:$(o)}}}function W(e,t,r){const n=C(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function j(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function S(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var F=/* @__PURE__ */new Map;function L({from:M,to:$,onChange:L,formatDisplay:O,clearable:T,required:R=!1,name:E,id:H,"aria-labelledby":J,"aria-label":Y,weekStartsOn:B,placeholder:G,fullWidth:I=!1,min:U,max:q,disabled:K=!1,allowOpenEnd:A=!1}){const P=p().dateRange,z=h(),V=O??(z?function(e){let t=F.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),F.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(z):S),X=G??P.placeholder,Z=T??!R,[Q,_]=f(!1),[ee,te]=f(M),[re,ne]=f($),[ae,oe]=f(null),[le,ie]=f("from"),se=g(null),de=g(null),ce=g(null),me=b(),ue=b(),pe=b(),[he,fe]=f(!1),ge=c(se,Q,{preferredMaxWidth:520,preferredMaxHeight:he?720:560,popupRef:ce}),be=g(null),xe=g(null),[ye,ve]=f(!0);m(()=>{const e=xe.current;if(!Q||!he||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&ve(a)});const we=g(null);m(()=>{const e=ce.current;if(!Q||!ge||!e)return;const t=getComputedStyle(e),r=ge.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(he)null!==we.current&&we.current<=r&&fe(!1);else{const e=be.current?.offsetWidth??0;if(0===e)return;we.current=e,e>r+.5&&fe(!0)}});const[Ne,ke]=f(!1);m(()=>{const e=!!H&&(de.current?.labels?.length??0)>0;e!==Ne&&ke(e)});const Ce=!!Y||!!J||Ne,Me=/* @__PURE__ */new Date,[$e,De]=f(()=>M?C(j(M)):W(Me,U,q)),We=k.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(D(e,Me),U,q)),je=e=>e?V(e):"";x(()=>{if(!Q)return;const e=e=>{const t=e.target;se.current?.contains(t)||ce.current?.contains(t)||_(!1)};document.addEventListener("mousedown",e);const t=s(()=>_(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[Q]),x(()=>{K&&_(!1)},[K]);const Se=()=>{L("",""),_(!1)},Fe=M&&$?`${je(M)} — ${je($)}`:M?P.fromOnly(je(M)):$?P.toOnly(je($)):"",Le=r(z),Oe=e=>{const r=t(e);return r?Le.longDate(r.getFullYear(),r.getMonth(),r.getDate()):e},Te=M&&$?P.range(Oe(M),Oe($)):M?P.fromOnly(Oe(M)):$?P.toOnly(Oe($)):X,Re=e=>he?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(ae===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(ae===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),Ee=/* @__PURE__ */v(w,{children:[We.map(e=>/* @__PURE__ */N("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=D(e,Me);te(t.from),ne(t.to),oe(e),De(t.from.slice(0,7))})(e),className:Re(e),"aria-label":he?P[e]:void 0,children:he?ye?P[e]:P[`${e}Short`]:P[e]},e)),
|
|
2
|
+
/* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:Re("Custom"),children:P.custom})]}),He=(e,t)=>A?/* @__PURE__ */N("button",{type:"button","data-range-end":e,"aria-pressed":le===e,onClick:()=>ie(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */N("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Je=e=>A&&le===e?" ring-1 ring-blue-400":"",Ye=
|
|
3
|
+
/* @__PURE__ */N(e,{mode:"range",min:U,max:q,value:ee||null,endValue:re||null,month:$e,onMonthChange:De,onSelect:e=>{oe("Custom"),A?"from"===le?(re&&e>re?(te(re),ne(e)):te(e),ie("to")):ee&&e<ee?(ne(ee),te(e)):ne(e):!ee||ee&&re?(te(e),ne("")):e<ee?(ne(ee),te(e)):ne(e)},weekStartsOn:B,"aria-label":P.dialog});/* @__PURE__ */
|
|
4
|
+
return v("div",{className:"relative"+(I?" w-full":""),ref:se,children:[
|
|
5
|
+
/* @__PURE__ */v("div",{className:`${I?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${M||$?`${n} ${a}`:o}${K?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
+
/* @__PURE__ */v("button",{ref:de,type:"button",onClick:()=>{K||(te(M),ne($),oe(null),ie(M&&!$?"to":"from"),De(M?C(j(M)):W(Me,U,q)),_(!0))},"aria-haspopup":"dialog","aria-expanded":Q,id:H,disabled:K||void 0,"aria-label":Y,"aria-labelledby":J,"aria-describedby":[Ce?ue:void 0,R?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":Q?me:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(I?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
7
|
/* @__PURE__ */N(i,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
-
/* @__PURE__ */N("span",{className:"truncate",children:Fe||
|
|
9
|
-
/* @__PURE__ */N("input",{type:"hidden",name:
|
|
10
|
-
/* @__PURE__ */N("input",{type:"hidden",name:
|
|
8
|
+
/* @__PURE__ */N("span",{className:"truncate",children:Fe||X})]}),Z&&!K&&(M||$)&&/* @__PURE__ */N("button",{type:"button",onClick:Se,"aria-label":P.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Ce&&/* @__PURE__ */N("span",{id:ue,className:"sr-only",children:Te}),R&&/* @__PURE__ */N("span",{id:pe,className:"sr-only",children:P.required}),E&&/* @__PURE__ */v(w,{children:[
|
|
9
|
+
/* @__PURE__ */N("input",{type:"hidden",name:E.from,value:M,disabled:K||void 0}),
|
|
10
|
+
/* @__PURE__ */N("input",{type:"hidden",name:E.to,value:$,disabled:K||void 0})]}),Q&&y(
|
|
11
11
|
/* @__PURE__ */v("div",{ref:ce,id:me,role:"dialog","aria-label":P.dialog,"data-layout":he?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:d.popup,left:ge?.left,right:ge?.right,top:ge?.top,bottom:ge?.bottom,width:he&&ge?ge.maxWidth:"max-content",maxWidth:ge?.maxWidth,maxHeight:ge?.maxHeight,overflowY:"auto",visibility:ge?void 0:"hidden",...u()},children:[
|
|
12
12
|
/* @__PURE__ */v("div",{className:he?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[He("from",/* @__PURE__ */v(w,{children:[
|
|
13
13
|
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:P.from}),
|
|
14
|
-
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${
|
|
14
|
+
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Je("from")}`,children:ee?je(ee):P.start})]})),!he&&/* @__PURE__ */N("span",{className:"text-gray-300",children:"—"}),He("to",/* @__PURE__ */v(w,{children:[
|
|
15
15
|
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:P.to}),
|
|
16
|
-
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${
|
|
17
|
-
/* @__PURE__ */v("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[
|
|
18
|
-
/* @__PURE__ */N("div",{className:"w-full",children:
|
|
16
|
+
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Je("to")}`,children:re?je(re):P.end})]}))]}),he?/* @__PURE__ */v(w,{children:[We.length>0&&/* @__PURE__ */v("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */N("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:P.lastHeading}),
|
|
17
|
+
/* @__PURE__ */v("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ee,We.map(e=>/* @__PURE__ */N("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:P[e]},e))]})]}),
|
|
18
|
+
/* @__PURE__ */N("div",{className:"w-full",children:Ye})]}):
|
|
19
19
|
/* @__PURE__ */v("div",{ref:be,className:"flex w-max gap-4",children:[
|
|
20
|
-
/* @__PURE__ */N("div",{className:"w-64",children:
|
|
21
|
-
/* @__PURE__ */v("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[
|
|
20
|
+
/* @__PURE__ */N("div",{className:"w-64",children:Ye}),We.length>0&&/* @__PURE__ */N("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ee})]}),
|
|
21
|
+
/* @__PURE__ */v("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[Z&&/* @__PURE__ */N("button",{type:"button",onClick:Se,className:l({variant:"ghost"}),children:P.clear}),
|
|
22
22
|
/* @__PURE__ */N("button",{type:"button",onClick:()=>_(!1),className:l({variant:"secondary"}),children:P.cancel}),
|
|
23
|
-
/* @__PURE__ */N("button",{type:"button",onClick:()=>{
|
|
23
|
+
/* @__PURE__ */N("button",{type:"button",onClick:()=>{L(ee,re),_(!1)},disabled:A?!ee&&!re:!ee||!re,className:l({variant:"primary"}),children:P.apply})]})]}),document.body)]})}export{L as DateRangePicker,D as presetRange,$ as toISODate};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-EXMFUK3A.js";import{ImageLightbox as a}from"./chunk-DNKACLRF.js";import{MarqueeBox as r}from"./chunk-IC72MGON.js";import{Drawer as i}from"./chunk-DLCIGDKC.js";import{EmptyState as t}from"./chunk-AJ42UE53.js";import{useContextMenu as o,ContextMenu as d}from"./chunk-AX7KPMDV.js";import{DescriptionList as s}from"./chunk-SACUSHVN.js";import{Breadcrumbs as c}from"./chunk-RZBHO74V.js";import{ROOT_KEY as m,mediaLibraryMenu as u}from"./chunk-DLS2VCBK.js";import{useMediaMoveItems as h}from"./chunk-RAQESAQZ.js";import{copyToClipboard as p}from"./chunk-36MUTG34.js";import{DropdownMenu as f}from"./chunk-WDXJWC3Y.js";import{MediaUsedInList as g}from"./chunk-RCRI6QZV.js";import{NativeSelect as v}from"./chunk-4PZN25MV.js";import{Input_default as y}from"./chunk-UNEJ2ABD.js";import{MediaUploadGrid as k}from"./chunk-Y5ZWPU4L.js";import{useGridSelection as b}from"./chunk-VLKDWKVR.js";import{useMarquee as w}from"./chunk-OLFYNMTD.js";import{Segmented as x}from"./chunk-N6DTTOB6.js";import{Checkbox_default as C}from"./chunk-CGZBDI6C.js";import{useFileIntake as N,FileIntakeAlert as I}from"./chunk-PG6AVBSR.js";import{Banner as D}from"./chunk-24L7NLA3.js";import{IconButton_default as S}from"./chunk-4CANQ3B3.js";import{ColoredBadge as j}from"./chunk-MFEJ6TYE.js";import{Button_default as z}from"./chunk-4IU5BSVE.js";import{buttonClasses as T}from"./chunk-K7U4RWXJ.js";import{Icon as F}from"./chunk-KIBL6M3T.js";import{Tooltip as A}from"./chunk-22S6LG6D.js";import{usePlotWidth as L}from"./chunk-MAFUXCPZ.js";import{useShellStrings as O}from"./chunk-ETSKG62F.js";import{useRef as P,useMemo as E,useCallback as M,useState as K,useEffect as R}from"react";import{jsxs as U,Fragment as B,jsx as V}from"react/jsx-runtime";var G="application/x-efficient-media-files",W="application/x-efficient-media-folder",J={type:"all",use:"any",sort:"newest"},Z={lock:/* @__PURE__ */V(F,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */V(F,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */V(F,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */V(F,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */V(F,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */V(F,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */V(F,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */V(F,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */V(F,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */V(F,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */V(F,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */V(F,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */V(F,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */V(F,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */V(F,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */V(F,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},$={link:/* @__PURE__ */V(F,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */V(F,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */V(F,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */V(F,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function H({value:e,label:n,onDone:l}){const[a,r]=K(e),i=P(!1),t=e=>{i.current||(i.current=!0,l(e))};/* @__PURE__ */
|
|
2
|
+
return V(y,{size:"sm",autoFocus:!0,"aria-label":n,value:a,onChange:e=>r(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:n=>{n.stopPropagation(),"Enter"===n.key?(n.preventDefault(),t(a.trim()||e)):"Escape"===n.key&&(n.preventDefault(),t(null))},onBlur:()=>t(a.trim()||e),onClick:e=>e.stopPropagation()})}function Q(F){const{mode:Q="manage",layout:X="auto",location:q,onLocationChange:Y,folders:_,products:ee,allFilesCount:ne,trashCount:le,files:ae,query:re,onQueryChange:ie,filters:te=J,onFiltersChange:oe,extraFilters:de,view:se="grid",onViewChange:ce,selectedIds:me,onSelectionChange:ue,usedIn:he,denied:pe={},accept:fe="image/*,video/*",maxSizeBytes:ge,busy:ve,progress:ye,onUpload:ke,onNewFolder:be,onRename:we,onMove:xe,onTrash:Ce,onRestore:Ne,onDeleteForever:Ie,onEmptyTrash:De,onReplace:Se,onCropEdit:je,onOpenInDesign:ze,onChoose:Te,onCancel:Fe,pickNote:Ae,className:Le=""}=F,Oe=O().mediaLibrary,Pe=O().media,Ee="pick"===Q,Me=!Ee,Ke=P(null),Re=L(Ke,"phone"===X?343:1200),Ue="phone"===X||"auto"===X&&Re<640,Be=E(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,a)=>{for(const r of e){const e=[...a,r];n.set(r.id,{node:r,path:e}),r.children&&l(r.children,e)}};return l(e,[]),n}(ee),[ee]),Ve=E(()=>new Map(_.map(e=>[e.id,e])),[_]),Ge=E(()=>{const e=/* @__PURE__ */new Map;for(const n of _){const l=n.parentId&&Ve.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[_,Ve]),We=M(e=>{const n=[];for(let l=e?Ve.get(e):void 0;l&&(n.unshift(l),!(n.length>_.length));l=l.parentId?Ve.get(l.parentId):void 0);return n},[Ve,_.length]),Je=M((e,n)=>We(e).some(e=>e.id===n),[We]),[Ze,$e]=K(()=>/* @__PURE__ */new Set(["@files"])),He=e=>$e(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),Qe=M(e=>{$e(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),Xe="files"===(qe=q).place?`files:${qe.folderId??""}`:"products"===qe.place?`products:${qe.nodeId??""}`:"trash";var qe;R(()=>{if("files"===q.place)Qe(["@files",...We(q.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===q.place){const e=q.nodeId?Be.get(q.nodeId)?.path??[]:[];Qe(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[Xe]);const Ye="products"===q.place,_e="trash"===q.place,en="files"===q.place,nn=en?q.folderId:null,ln=Ye&&q.nodeId?Be.get(q.nodeId)?.path[0]:void 0,an=e=>e?.sharedFrom?`${Oe.readOnly} ${Oe.editedAtHq(e.sharedFrom)}`:Oe.readOnly,rn=E(()=>ae.map(e=>e.id),[ae]),tn=E(()=>new Map(ae.map(e=>[e.id,e])),[ae]),on=b(rn),dn=E(()=>rn.filter(e=>on.selected.has(e)),[rn,on.selected]),sn=1===dn.length?tn.get(dn[0]):void 0,cn=P(!0);R(()=>{cn.current?cn.current=!1:on.clear()},[Xe]);const mn=me?.join("\0");R(()=>{me&&on.setSelection(me)},[mn]);const un=P(mn??""),hn=dn.join("\0");R(()=>{un.current!==hn&&(un.current=hn,ue?.(dn))},[hn]);const pn=(e,n={})=>{Ee?on.select(e):on.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[fn,gn]=K(null),vn=e=>{const n=fn;if(gn(null),!n||null==e)return;e!==("folder"===n.kind?Ve.get(n.id)?.name:tn.get(n.id)?.name)&&we?.(n,e)},yn=async e=>{if(!be)return;const n=await be(e);Qe(["@files",...e?[e]:[]]),"string"==typeof n&&gn({kind:"folder",id:n})},kn=M(e=>{const n=[],l=n=>{if("files"===e.kind)return n===nn&&en?Oe.alreadyHere:void 0;const l=Ve.get(e.id);return n===e.id||n&&Je(n,e.id)?Oe.notIntoItself:(l?.parentId??null)===n?Oe.folderAlreadyHere:void 0};n.push({key:m,label:Oe.allFiles,disabledReason:l(null)});const a=(e,r)=>{for(const i of Ge.get(e)??[])n.push({key:i.id,label:i.name,depth:r,disabledReason:l(i.id)}),a(i.id,r+1)};return a(null,1),n},[Ge,Ve,en,Je,nn,Oe]),bn=M(e=>{const n=new Set(e.map(e=>tn.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[tn]),[wn,xn]=K(null),Cn={words:Oe,media:Pe,denied:pe,moveTargets:kn,kindOf:bn,urlOf:e=>tn.get(e)?.url,newSubfolder:be&&Me?e=>{yn(e)}:void 0,rename:we&&Me?e=>{"file"!==e.kind||on.isSelected(e.id)||on.select(e.id),gn(e)}:void 0,move:xe&&Me?xe:void 0,trash:Ce&&Me?Ce:void 0,replace:Se&&Me?Se:void 0,copyUrl:e=>{const n=tn.get(e)?.url;n&&p(Oe.urlLabel,n)},openInDesign:ze,restore:Ne,deleteForever:Ie},Nn=e=>u(e,Cn),In=o(),Dn=(e,n)=>{Ee||(on.isSelected(e)||on.select(e),In.open(n,(e=>{const n=on.isSelected(e)?dn:[e];return Ye?{kind:"render",id:e}:_e?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[Sn,jn]=K(null),[zn,Tn]=K(null),[Fn,An]=K(null);R(()=>{if(!zn&&!Sn)return;const e=()=>{Tn(null),jn(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[zn,Sn]);const Ln=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),On=(e,n)=>!(!xe||pe.move||Ee)&&(!!Ln(e,G)||!(!Ln(e,W)||!Fn)&&(n!==Fn&&!(n&&Je(n,Fn)))),Pn=(e,n)=>({onDragEnter:l=>{On(l,n)&&(l.preventDefault(),jn(e))},onDragOver:l=>{On(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Sn!==e&&jn(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||jn(n=>n===e?null:n)},onDrop:e=>{if(On(e,n))if(e.preventDefault(),jn(null),Ln(e,G)){let l;try{l=JSON.parse(e.dataTransfer.getData(G))}catch{l=null}Array.isArray(l)&&l.length&&xe({kind:"files",ids:l.map(String)},n)}else Fn&&(xe({kind:"folder",id:Fn},n),An(null))}}),En=e=>{const n=e=>Ln(e,G)||Ln(e,W)||Ln(e,"Files");return{onDragEnter:l=>{n(l)&&Tn(e)},onDragOver:l=>{n(l)&&zn!==e&&Tn(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Tn(n=>n===e?null:n)}}},Mn=(e,n,l)=>/* @__PURE__ */V(A,{side:"right",content:zn===e?Oe.noDropProducts:an(l),open:zn===e||!zn&&void 0,children:/* @__PURE__ */V("span",{children:n})}),Kn=e=>({onContextMenu:n=>{In.open(n,e)}}),Rn=(e,a,r)=>e.map(e=>{const i=`p:${e.id}`,t=r??e,o=Ze.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
3
|
+
return U("div",{role:"none",className:"contents",children:[
|
|
4
|
+
/* @__PURE__ */V(n,{label:Mn(i,e.name,t),level:a,icon:d&&o?Z.folderOpen:Z.folder,badge:null!=e.count?e.count:void 0,selected:Ye&&q.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>He(i):void 0,onSelect:()=>Y({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...En(i),...Me?Kn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */V(l,{children:Rn(d,a+1,t)})]},e.id)}),Un=(e,a)=>(Ge.get(e)??[]).map(e=>{const r=Ge.get(e.id),i=Ze.has(e.id),t="folder"===fn?.kind&&fn.id===e.id,o=Nn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
5
|
+
return U("div",{role:"none",className:"contents",children:[
|
|
6
|
+
/* @__PURE__ */V(n,{label:e.name,level:a,icon:r&&i?Z.folderOpen:Z.folder,badge:null!=e.count?e.count:void 0,selected:t||en&&q.folderId===e.id,expanded:r?i:void 0,onToggle:r?()=>He(e.id):void 0,onSelect:()=>Y({place:"files",folderId:e.id}),drop:Sn===e.id?"into":void 0,dragging:Fn===e.id,draggable:Me&&!!xe&&!pe.move,rename:t?/* @__PURE__ */V(H,{value:e.name,label:Oe.folderName,onDone:vn}):void 0,actions:Me&&o.length?/* @__PURE__ */V(f,{align:"end","aria-label":Oe.folderActions,trigger:Z.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Pn(e.id,e.id),...Me?Kn({kind:"folder",id:e.id}):{},...Me&&xe&&!pe.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(W,e.id),An(e.id)},onDragEnd:()=>{An(null),jn(null)}}:{}}}),r&&i&&/* @__PURE__ */V(l,{children:Un(e.id,a+1)})]},e.id)}),Bn=Ze.has("@files"),Vn=Ze.has("@products"),Gn=/* @__PURE__ */U(e,{"aria-label":Oe.folders,children:[ee&&/* @__PURE__ */U(B,{children:[
|
|
7
|
+
/* @__PURE__ */V(n,{label:Mn("@products",Oe.products),level:1,icon:Z.lock,badge:{label:Oe.readOnlyBadge,tone:"neutral"},expanded:ee.length?Vn:void 0,onToggle:()=>He("@products"),selected:Ye&&null==q.nodeId,onSelect:()=>Y({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...En("@products")}}),Vn&&ee.length>0&&/* @__PURE__ */V(l,{children:Rn(ee,2)})]}),
|
|
8
|
+
/* @__PURE__ */V(n,{label:Oe.allFiles,level:1,icon:Bn?Z.folderOpen:Z.folder,badge:null!=ne?ne:void 0,expanded:Ge.get(null)?.length?Bn:void 0,onToggle:()=>He("@files"),selected:en&&null==q.folderId,onSelect:()=>Y({place:"files",folderId:null}),drop:"@files"===Sn?"into":void 0,rowProps:{"data-media-row":"@files",...Pn("@files",null)}}),Bn&&(Ge.get(null)?.length??0)>0&&/* @__PURE__ */V(l,{children:Un(null,2)}),Me&&/* @__PURE__ */V(n,{label:Oe.trash,level:1,icon:Z.trash,badge:null!=le?le:void 0,selected:_e,onSelect:()=>Y({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Wn=(()=>{if(_e)return[{label:Oe.trash}];if(Ye){const e=q.nodeId?Be.get(q.nodeId)?.path??[]:[];return[{label:Oe.products,onClick:e.length?()=>Y({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>Y({place:"products",nodeId:n.id}):void 0}))]}const e=We(nn);return[{label:Oe.allFiles,onClick:e.length?()=>Y({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>Y({place:"files",folderId:n.id}):void 0}))]})(),Jn=Ye?Oe.readOnly:pe.upload,Zn=!!ke&&!_e&&!Jn,$n=N({accept:fe,maxSizeBytes:ge,multiple:!0,disabled:!Zn,onAccept:e=>ke?.(e,nn)}),Hn=Ye?Oe.noProductFolder:pe.newFolder,Qn=e=>e?{"aria-disabled":!0,disabledReason:e}:{},Xn=/* @__PURE__ */U("div",{className:"flex flex-wrap items-center gap-2",children:[Me&&be&&!_e&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:Z.folderPlus,onClick:()=>{yn(nn)},...Qn(Hn),children:Oe.newFolder}),ke&&!_e&&/* @__PURE__ */V(z,{variant:"primary",size:"sm",leftIcon:Z.upload,onClick:()=>$n.open(),...Qn(Jn),children:Oe.upload}),Me&&_e&&De&&ae.length>0&&/* @__PURE__ */V(z,{variant:"danger",size:"sm",onClick:De,...Qn(pe.deleteForever),children:Oe.emptyTrash})]}),qn=(e,n,l,a,r)=>/* @__PURE__ */V("div",{style:{width:Ue?void 0:r,flex:Ue?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */V(v,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),Yn=e=>n=>oe?.({...te,[e]:n}),_n=/* @__PURE__ */U("div",{className:"flex flex-wrap items-center gap-2",children:[ie&&/* @__PURE__ */V("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */V(y,{size:"sm",type:"search",leftIcon:Z.search,placeholder:Ye?Oe.searchProducts:Oe.search,"aria-label":Ye?Oe.searchProducts:Oe.search,value:re??"",onChange:e=>ie(e.target.value)})}),oe&&qn(Oe.mediaType,te.type,[{value:"all",label:Oe.allTypes},{value:"image",label:Oe.images},{value:"video",label:Oe.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],Yn("type"),130),oe&&!Ye&&!_e&&qn(Oe.use,te.use,[{value:"any",label:Oe.anyUse},{value:"email",label:Oe.emailOnly},{value:"website",label:Oe.websiteOnly},{value:"unused",label:Oe.notUsed}],Yn("use"),130),oe&&Me&&qn(Oe.sort,te.sort,[{value:"newest",label:Oe.newest},{value:"name",label:Oe.byName},{value:"size",label:Oe.bySize}],Yn("sort"),110),de?.map(e=>qn(e.label,e.value,e.options,e.onChange,120)),ce&&/* @__PURE__ */V(x,{size:"sm",label:Oe.view,value:se,onChange:ce,options:[{value:"grid",label:Oe.grid,icon:Z.grid},{value:"list",label:Oe.list,icon:Z.list}]})]}),el=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Oe.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:$.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Oe.used(e.usedCount),count:e.usedCount,icon:$.link,tone:"active"}),e.email&&n.push({key:"e",label:Oe.email,icon:$.email,tone:"queued"}),e.private&&n.push({key:"p",label:Oe.private,icon:$.lock,tone:"neutral"}),n},nl=e=>el(e).map(e=>/* @__PURE__ */V(j,{tone:e.tone,size:"xs",children:e.label},e.key)),ll=Me&&en&&!!xe&&!pe.move,al=ae.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:el(e),dragData:ll?JSON.stringify(on.isSelected(e.id)?dn:[e.id]):void 0})),rl=Ue?Math.max(72,Math.floor((Re-24-16-1)/3)):112,il=P(null),tl=w({containerRef:il,enabled:Me&&!Ue&&ae.length>0,selected:on.selected,setSelection:e=>on.setSelection(e),clearSelection:on.clear}),ol=e=>{if(Ee){const n=tn.get(e);return void(!n||n.private||n.pickDisabledReason||Te?.(n))}const n=rn.indexOf(e);n>=0&&xn(n)},dl=ae.length?null:re?/* @__PURE__ */V(t,{variant:"dashed",title:Oe.noMatches}):Ye?/* @__PURE__ */V(t,{variant:"dashed",title:Oe.emptyProducts,description:an(ln)}):_e?/* @__PURE__ */V(t,{variant:"dashed",title:Oe.trashEmpty}):!Zn||Ee?/* @__PURE__ */V(t,{variant:"dashed",title:Oe.emptyFolder}):null,sl="list"===se&&ae.length>0,cl=dl??(sl?/* @__PURE__ */V("ul",{role:"listbox","aria-multiselectable":Me||void 0,"aria-label":Oe.folders,className:"flex flex-col gap-1",children:ae.map(e=>/* @__PURE__ */U("li",{role:"option","aria-selected":on.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>pn(e.id,n),onDoubleClick:()=>ol(e.id),onContextMenu:n=>Dn(e.id,n),onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),pn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(on.isSelected(e.id)?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
9
|
+
/* @__PURE__ */V("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
10
|
+
/* @__PURE__ */V("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
11
|
+
/* @__PURE__ */V("span",{className:"flex shrink-0 items-center gap-1",children:nl(e)}),e.sizeLabel&&/* @__PURE__ */V("span",{className:"w-16 shrink-0 text-right text-xs text-gray-500",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */V(k,{items:al,readOnly:!Zn||Ee,onFiles:Zn&&!Ee?e=>ke(e,nn):void 0,accept:fe,maxSizeBytes:ge,busy:ve,progress:ye,fit:"contain",thumbSize:rl,dragType:ll?G:void 0,selected:on.selected,onItemClick:pn,onItemDoubleClick:ol,onItemContextMenu:Me?Dn:void 0,menuOnMedia:Me})),ml=h({count:dn.length,kind:bn(dn),targets:kn({kind:"files",ids:dn}),onPick:e=>xe?.({kind:"files",ids:dn},e.key===m?null:e.key)}),ul=T({variant:"secondary",size:"sm"}),hl=/* @__PURE__ */V(f,{align:"start",triggerClassName:ul,trigger:/* @__PURE__ */U(B,{children:[Z.folder,Oe.moveTo]}),items:ml,disabled:!!pe.move}),pl=Me&&dn.length>1&&!Ye?/* @__PURE__ */U("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-gray-200 px-3 py-2",children:[
|
|
12
|
+
/* @__PURE__ */V(C,{checked:dn.length===ae.length,indeterminate:dn.length<ae.length,onChange:e=>e?on.selectAll():on.clear(),label:Oe.selected(dn.length)}),/* @__PURE__ */U(B,_e?{children:[Ne&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:Z.undo,onClick:()=>Ne(dn),...Qn(pe.restore),children:Oe.restore}),Ie&&/* @__PURE__ */V(z,{variant:"secondary-danger",size:"sm",onClick:()=>Ie(dn),...Qn(pe.deleteForever),children:Oe.deleteForever})]}:{children:[xe&&hl,we&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:Z.edit,disabled:!0,children:Oe.rename}),Ce&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:Z.trash,onClick:()=>Ce({kind:"files",ids:dn}),...Qn(pe.trash),children:Oe.moveFilesToTrash(dn.length)})]}),
|
|
13
|
+
/* @__PURE__ */V(z,{variant:"ghost",size:"sm",onClick:on.clear,children:Oe.clearSelection})]}):null,fl=e=>{const n=[],l=(e,l,a)=>{null!=a&&""!==a&&n.push({key:e,label:l,value:a})},a="file"===fn?.kind&&fn.id===e.id;l("name",Oe.name,a?/* @__PURE__ */V(H,{value:e.name,label:Oe.fileName,onDone:vn}):e.name),l("type",Oe.type,e.typeLabel),l("size",Oe.size,e.sizeLabel),l("resolution",Oe.resolution,e.resolution),Ye?(l("design",Oe.design,e.design),l("finish",Oe.finish,e.finish),l("angle",Oe.angleLug,e.angleLug),l("owner",Oe.owner,e.owner)):(l("added",Oe.addedBy,e.addedBy),l("folder",Oe.folder,e.folderPath)),l("used",Oe.usedIn,null!=e.usedCount?Oe.places(e.usedCount):void 0);const r=u({kind:"files",ids:[e.id]},Cn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
14
|
+
return U("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
15
|
+
/* @__PURE__ */V("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),Ye&&/* @__PURE__ */V(D,{tone:"neutral",title:Oe.readOnlyBadge,children:an(ln)}),
|
|
16
|
+
/* @__PURE__ */V(s,{size:"sm",columns:1,items:n}),!_e&&/* @__PURE__ */U("div",{className:"flex gap-2",children:[
|
|
17
|
+
/* @__PURE__ */V("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */V(y,{size:"sm",readOnly:!0,value:e.url,"aria-label":Oe.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
18
|
+
/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:Z.copy,onClick:()=>Cn.copyUrl(e.id),children:Oe.copyUrl})]}),en&&Me&&/* @__PURE__ */U("div",{className:"flex flex-wrap gap-2",children:[Se&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:Z.swap,onClick:()=>Se(e.id),...Qn(pe.replace),children:Oe.replace}),je&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:Z.crop,onClick:()=>je(e.id),children:Oe.cropEdit}),xe&&"submenu"===r?.type&&/* @__PURE__ */V(f,{align:"start",triggerClassName:ul,trigger:/* @__PURE__ */U(B,{children:[Z.folder,Oe.moveTo]}),items:r.items,disabled:!!pe.move}),we&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:Z.edit,onClick:()=>gn({kind:"file",id:e.id}),...Qn(pe.rename),children:Oe.rename}),Ce&&/* @__PURE__ */V(S,{"aria-label":Oe.moveToTrash,size:"sm",onClick:()=>Ce({kind:"files",ids:[e.id]}),disabledReason:pe.trash,"aria-disabled":!!pe.trash||void 0,children:Z.trash})]}),_e&&Me&&/* @__PURE__ */U("div",{className:"flex flex-wrap gap-2",children:[Ne&&/* @__PURE__ */V(z,{variant:"primary",size:"sm",leftIcon:Z.undo,onClick:()=>Ne([e.id]),...Qn(pe.restore),children:Oe.restore}),Ie&&/* @__PURE__ */V(z,{variant:"danger",size:"sm",onClick:()=>Ie([e.id]),...Qn(pe.deleteForever),children:Oe.deleteForever})]}),Ye&&ze&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:Z.external,onClick:()=>ze({kind:"render",id:e.id}),children:Oe.openInDesign}),he&&/* @__PURE__ */V(g,{items:he})]})},gl=sn?sn.private?Oe.privateNoPick:sn.pickDisabledReason:void 0,vl=Ee?/* @__PURE__ */U("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-gray-200 px-3 py-2",children:[
|
|
19
|
+
/* @__PURE__ */V("span",{className:"min-w-0 truncate text-sm text-gray-500",children:sn?Oe.oneChosen(sn.name):Oe.noneChosen}),
|
|
20
|
+
/* @__PURE__ */U("div",{className:"flex gap-2",children:[Fe&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",onClick:Fe,children:Oe.cancel}),
|
|
21
|
+
/* @__PURE__ */V(z,{variant:"primary",size:"sm",disabled:!sn,...Qn(gl),onClick:()=>{sn&&!gl&&Te?.(sn)},children:Oe.chooseImage})]})]}):null,yl=Me&&!!sn,kl=/* @__PURE__ */U("div",{className:"flex min-w-0 flex-col gap-3",children:[Ae&&/* @__PURE__ */V(D,{tone:"neutral",children:Ae}),
|
|
22
|
+
/* @__PURE__ */U("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
23
|
+
/* @__PURE__ */V(c,{items:Wn}),Xn]}),_n,pl,
|
|
24
|
+
/* @__PURE__ */U("div",{ref:il,className:"relative",onPointerDown:tl.onPointerDown,onKeyDown:e=>{Me&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),on.selectAll()):"Escape"===e.key&&on.size&&on.clear()},children:[cl,
|
|
25
|
+
/* @__PURE__ */V(r,{rect:tl.rect})]}),Zn&&/* @__PURE__ */V("input",{...$n.inputProps}),
|
|
26
|
+
/* @__PURE__ */V(I,{rejections:$n.rejections})]});/* @__PURE__ */
|
|
27
|
+
return U("div",{ref:Ke,"data-media-library":"","data-layout":Ue?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Le}`.trim(),children:[/* @__PURE__ */U("div",Ue?{className:"flex flex-col gap-3 p-3",children:[Gn,kl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
28
|
+
/* @__PURE__ */V("div",{className:"shrink-0 overflow-y-auto border-r border-gray-200 p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Gn}),
|
|
29
|
+
/* @__PURE__ */V("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:kl}),yl&&/* @__PURE__ */V("div",{className:"shrink-0 overflow-y-auto border-l border-gray-200 p-3",style:{width:300},children:fl(sn)})]}),vl,Ue&&/* @__PURE__ */V(i,{open:yl,onClose:on.clear,side:"bottom",title:sn?.name,children:sn&&fl(sn)}),In.state&&/* @__PURE__ */V(d,{...In.props,items:Nn(In.state.data)}),null!=wn&&ae.length>0&&/* @__PURE__ */V(a,{images:ae.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(wn,ae.length-1),onClose:()=>xn(null)})]})}export{G as MEDIA_FILES_DRAG_TYPE,W as MEDIA_FOLDER_DRAG_TYPE,Q as MediaLibrary};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{TICK_INK as e}from"./chunk-URBCGEXG.js";import{useShellStrings as n}from"./chunk-
|
|
1
|
+
import{TICK_INK as e}from"./chunk-URBCGEXG.js";import{useShellStrings as n}from"./chunk-ETSKG62F.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";function a({ink:e}){/* @__PURE__ */
|
|
2
2
|
return i("span",{"aria-hidden":"true",className:`h-3 w-0.5 shrink-0 rounded-[1px] ${e}`})}function t({link:t,className:l=""}){const c=n().meter;/* @__PURE__ */
|
|
3
3
|
return r("div",{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-gray-500 ${l}`.trim(),children:[
|
|
4
4
|
/* @__PURE__ */r("span",{className:"inline-flex items-center gap-1",children:[
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{optionMatches as e,OptionSublabel as t}from"./chunk-UQBPKZUR.js";import{inputClasses as n}from"./chunk-JFSYWEHD.js";import{GROUP_COLORS as r}from"./chunk-D323R2FT.js";import{Tooltip as o}from"./chunk-22S6LG6D.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-ETSKG62F.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:D,disabled:L,id:C,className:E="",tone:W,tooltip:F,split:S}){const[T,$]=m(!1),[B,G]=m(""),J=d(),M=h(null),R=h(null),H=h(null),I=a(M,T),K=e=>k.find(t=>t.value===e)?.label??e,U=p(()=>{const t=new Set(r),n=[],o=B.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,B]),P=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)},z=e=>{e&&!r.includes(e)?(y([...r,e]),G("")):G("")},Q=e=>y(r.filter(t=>t!==e)),Y=()=>{const e=B.trim();if(S&&e)return P(e.split(S)),void G("");j&&e?z(e):G("")},Z=h(()=>{});Z.current=()=>{Y(),$(!1)},f(()=>{if(!T)return;const e=e=>{const t=e.target;M.current?.contains(t)||H.current?.contains(t)||(Y(),$(!1))};document.addEventListener("mousedown",e);const t=l(()=>Z.current());return()=>{document.removeEventListener("mousedown",e),t()}});const q=k.length>0;/* @__PURE__ */
|
|
2
|
+
return v("div",{ref:M,className:"relative",children:[
|
|
3
|
+
/* @__PURE__ */v("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),R.current?.focus())},className:n({invalid:D,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${L?"bg-gray-50 cursor-not-allowed":""} ${E}`}),children:[r.map(e=>{const t=W?.(e),n=w[t??"accent"],r=/* @__PURE__ */v("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
+
/* @__PURE__ */x("span",{className:"truncate",children:K(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":J.select.removeItem?.(K(e))??`${J.select.remove} ${K(e)}`,onClick:()=>Q(e),className:n.remove,children:"×"})]},e),l=F?.(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:C,ref:R,type:"text",autoComplete:"off",role:"combobox","aria-expanded":T&&q,"aria-invalid":D||void 0,disabled:L,value:B,placeholder:0===r.length?N:void 0,onChange:e=>{(e=>{if(S){const t=e.split(S);if(t.length>1)return P(t.slice(0,-1)),void G(t[t.length-1])}G(e)})(e.target.value),$(!0)},onFocus:()=>{!L&&q&&$(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=B.trim(),r=n?U.filter(t=>e(t,n.toLowerCase())):[];1===r.length?z(r[0].value):Y()}else"Backspace"===t.key&&""===B&&r.length>0?Q(r[r.length-1]):"Escape"===t.key?($(!1),G(""),R.current?.blur()):"Tab"===t.key&&(Y(),$(!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"})]}),T&&q&&g(
|
|
6
|
+
/* @__PURE__ */x("div",{ref:H,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===U.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&r.length>=k.length?J.select.allSelected:J.select.noMatches}):U.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),z(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
|
+
/* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
|
|
8
|
+
/* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
|
|
@@ -39,7 +39,8 @@ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"current
|
|
|
39
39
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})},"chevron-right:mini":function({size:e=18,...r}){/* @__PURE__ */
|
|
40
40
|
return t("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})},"chevron-up":function({size:e=18,...r}){/* @__PURE__ */
|
|
41
41
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})})},"chevron-up-down":function({size:e=18,...r}){/* @__PURE__ */
|
|
42
|
-
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"})})},
|
|
42
|
+
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"})})},clock:function({size:e=18,...r}){/* @__PURE__ */
|
|
43
|
+
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})},close:function({size:e=18,...r}){/* @__PURE__ */
|
|
43
44
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})},"close-circle":function({size:e=18,...r}){/* @__PURE__ */
|
|
44
45
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})},"close-circle:mini":function({size:e=18,...r}){/* @__PURE__ */
|
|
45
46
|
return t("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.28 7.22a.75.75 0 0 0-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 1 0 1.06 1.06L10 11.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L11.06 10l1.72-1.72a.75.75 0 0 0-1.06-1.06L10 8.94 8.28 7.22Z",clipRule:"evenodd"})})},"close:mini":function({size:e=18,...r}){/* @__PURE__ */
|
|
@@ -47,7 +48,8 @@ return t("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-h
|
|
|
47
48
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"})})},collapse:function({size:e=18,...r}){/* @__PURE__ */
|
|
48
49
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})})},copy:function({size:e=18,...r}){/* @__PURE__ */
|
|
49
50
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z"})})},corner:function({size:e=18,...r}){/* @__PURE__ */
|
|
50
|
-
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M5.25 18.75V9a3.75 3.75 0 0 1 3.75-3.75h9.75"})})},
|
|
51
|
+
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M5.25 18.75V9a3.75 3.75 0 0 1 3.75-3.75h9.75"})})},crop:function({size:e=18,...r}){/* @__PURE__ */
|
|
52
|
+
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M6.75 3v14.25h14.25M3 6.75h14.25V21"})})},"crop-bottom":function({size:e=18,...r}){/* @__PURE__ */
|
|
51
53
|
return o("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:[
|
|
52
54
|
/* @__PURE__ */t("path",{d:"M3.75 3.75L4.75 3.75M8.75 3.75L9.75 3.75M14.25 3.75L15.25 3.75M19.25 3.75L20.25 3.75L20.25 4.75M20.25 8.75L20.25 9.75M20.25 14.25L20.25 15.25M20.25 19.25L20.25 20.25M3.75 20.25L4.75 20.25M8.75 20.25L9.75 20.25M14.25 20.25L15.25 20.25M19.25 20.25L20.25 20.25M3.75 3.75L3.75 4.75M3.75 8.75L3.75 9.75M3.75 14.25L3.75 15.25M3.75 19.25L3.75 20.25"}),
|
|
53
55
|
/* @__PURE__ */t("path",{strokeWidth:"3",d:"M1.5 15.75L22.5 15.75"})]})},"crop-left":function({size:e=18,...r}){/* @__PURE__ */
|
|
@@ -99,11 +101,13 @@ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"current
|
|
|
99
101
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M3 12a0.375 0.375 0 1 0 0.75 0a0.375 0.375 0 1 0 -0.75 0ZM7.3125 12a0.375 0.375 0 1 0 0.75 0a0.375 0.375 0 1 0 -0.75 0ZM11.625 12a0.375 0.375 0 1 0 0.75 0a0.375 0.375 0 1 0 -0.75 0ZM15.9375 12a0.375 0.375 0 1 0 0.75 0a0.375 0.375 0 1 0 -0.75 0ZM20.25 12a0.375 0.375 0 1 0 0.75 0a0.375 0.375 0 1 0 -0.75 0Z"})})},"line-solid":function({size:e=18,...r}){/* @__PURE__ */
|
|
100
102
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M3 12L21 12"})})},link:function({size:e=18,...r}){/* @__PURE__ */
|
|
101
103
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})})},list:function({size:e=18,...r}){/* @__PURE__ */
|
|
102
|
-
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0ZM3.75 12h.007v.008H3.75V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm-.375 5.25h.007v.008H3.75v-.008Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})})},
|
|
104
|
+
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0ZM3.75 12h.007v.008H3.75V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm-.375 5.25h.007v.008H3.75v-.008Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})})},lock:function({size:e=18,...r}){/* @__PURE__ */
|
|
105
|
+
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"})})},logout:function({size:e=18,...r}){/* @__PURE__ */
|
|
103
106
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15m3 0 3-3m0 0-3-3m3 3H9"})})},menu:function({size:e=18,...r}){/* @__PURE__ */
|
|
104
107
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})})},moon:function({size:e=18,...r}){/* @__PURE__ */
|
|
105
108
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})})},"moon:solid":function({size:e=18,...r}){/* @__PURE__ */
|
|
106
|
-
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M9.528 1.718a.75.75 0 0 1 .162.819A8.97 8.97 0 0 0 9 6a9 9 0 0 0 9 9 8.97 8.97 0 0 0 3.463-.69.75.75 0 0 1 .981.98 10.503 10.503 0 0 1-9.694 6.46c-5.799 0-10.5-4.7-10.5-10.5 0-4.368 2.667-8.112 6.46-9.694a.75.75 0 0 1 .818.162Z",clipRule:"evenodd"})})},
|
|
109
|
+
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M9.528 1.718a.75.75 0 0 1 .162.819A8.97 8.97 0 0 0 9 6a9 9 0 0 0 9 9 8.97 8.97 0 0 0 3.463-.69.75.75 0 0 1 .981.98 10.503 10.503 0 0 1-9.694 6.46c-5.799 0-10.5-4.7-10.5-10.5 0-4.368 2.667-8.112 6.46-9.694a.75.75 0 0 1 .818.162Z",clipRule:"evenodd"})})},more:function({size:e=18,...r}){/* @__PURE__ */
|
|
110
|
+
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM18.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"})})},"more-vertical":function({size:e=18,...r}){/* @__PURE__ */
|
|
107
111
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z"})})},"more-vertical:solid":function({size:e=18,...r}){/* @__PURE__ */
|
|
108
112
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M10.5 6a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Zm0 6a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Zm0 6a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z",clipRule:"evenodd"})})},"no-symbol":function({size:e=18,...r}){/* @__PURE__ */
|
|
109
113
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"})})},note:function({size:e=18,...r}){/* @__PURE__ */
|
|
@@ -154,7 +158,8 @@ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"current
|
|
|
154
158
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"})})},"text-color":function({size:e=18,...r}){/* @__PURE__ */
|
|
155
159
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{"data-part":"swatch",d:"M10 3L14 3L21 21L17 21L15.44 17L8.56 17L7 21L3 21ZM9.92 13.5L14.08 13.5L12 8.14Z"})})},trash:function({size:e=18,...r}){/* @__PURE__ */
|
|
156
160
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})},underline:function({size:e=18,...r}){/* @__PURE__ */
|
|
157
|
-
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.995 3.744v7.5a6 6 0 1 1-12 0v-7.5m-2.25 16.502h16.5"})})},
|
|
161
|
+
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.995 3.744v7.5a6 6 0 1 1-12 0v-7.5m-2.25 16.502h16.5"})})},undo:function({size:e=18,...r}){/* @__PURE__ */
|
|
162
|
+
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 15 3 9m0 0 6-6M3 9h12a6 6 0 0 1 0 12h-3"})})},upload:function({size:e=18,...r}){/* @__PURE__ */
|
|
158
163
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"})})},warning:function({size:e=18,...r}){/* @__PURE__ */
|
|
159
164
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})},"warning:mini":function({size:e=18,...r}){/* @__PURE__ */
|
|
160
165
|
return t("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"})})},widgets:function({size:e=18,...r}){/* @__PURE__ */
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-VX4BNYH3.js";import{useSettingAuto as t,useInSettingRow as i}from"./chunk-E4Z5OXBI.js";import{useShellStrings as n}from"./chunk-ETSKG62F.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as s,useEffect as u,useLayoutEffect as c}from"react";import{jsx as m,jsxs as f}from"react/jsx-runtime";var p=(e,t,i)=>Math.min(i,Math.max(t,e));function h(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var v=8,x=40;function b(e){return Math.max(1,...e.map(e=>(e??"").length))}var w="undefined"==typeof window?u:c;function y(e,t,i,n){return Number(p(e,t,i).toFixed(n))}var g=r(null);function S({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
|
|
2
|
+
return m(g.Provider,{value:r,children:e})}function F({value:r,onChange:a,min:c,max:S,step:F=1,shiftStep:z,precision:$,inputMin:k,inputMax:N,suffix:j,showInput:K=!0,emptyLabel:L,placeholderValue:E,stepFrom:M,label:A,"aria-labelledby":C,valueText:B,id:D,disabled:R,size:V="md",className:I="",auto:O}){const T=n(),W=o(),X=t(),q=O??X,G=o(),H=D??W,P=$??h(F),U=k??c,Y=N??S,Z=void 0!==L||void 0!==E,J=M??E,Q=p(r??E??c,c,S),_=d(null),[ee,te]=l(null),ie=Boolean(j);w(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,K]);const ne=e=>B?B(e):"string"==typeof j?`${e.toFixed(P)} ${j}`:void 0,re=null==r?L??(null!=E?ne(E)??String(E):void 0):ne(r),le=`calc(${b([c.toFixed(P),S.toFixed(P),r?.toFixed(P),L,E?.toFixed(P)])}ch + ${(ee?.frame??10+(ie?x:v))+2}px)`,ae=s(g),oe=o(),de=ae?.set;w(()=>{de&&de(oe,K?le:null)},[de,oe,le,K]),u(()=>()=>de?.(oe,null),[de,oe]);const se=i();/* @__PURE__ */
|
|
3
|
+
return f("div",{"data-slider":"",className:`flex w-full min-w-0 items-center ${se?"flex-wrap gap-2":"gap-3"} ${I}`.trim(),children:[
|
|
4
|
+
/* @__PURE__ */m("input",{id:H,type:"range",min:c,max:S,step:F,value:Q,disabled:R,"aria-label":C?void 0:A,"aria-labelledby":C,"aria-valuetext":re,"aria-describedby":q?G:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=z;if(!i&&!(null==r&&null!=J))return;e.preventDefault();a(y((r??J??Q)+t*(i?z??F:F),c,S,P))},onChange:e=>a(y(Number(e.target.value),c,S,P)),className:`min-w-24 flex-1 ${se?"basis-24":""} cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 ${"sm"===V?"h-1":"h-1.5"}`}),K&&
|
|
5
|
+
/* @__PURE__ */m("div",{ref:_,"data-slider-box":"",className:se?"ml-auto shrink-0":"shrink-0 text-xs",style:se?void 0:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */m(e,{value:r,onChange:e=>{null!=e?e<U||e>Y||a(e):Z&&a(null)},min:U,max:Y,step:F,shiftStep:z,stepFrom:J,precision:P,snap:!0,allowEmpty:Z,suffix:j,disabled:R,placeholder:L??(null!=E?E.toFixed(P):void 0),size:se?void 0:"sm",auto:q,"aria-label":A?T.slider.value(A):void 0,"aria-labelledby":A?void 0:C})}),q&&/* @__PURE__ */m("span",{id:G,hidden:!0,children:T.settingView.auto})]})}export{F as Slider,S as SliderGroup,y as settleSliderValue,b as sliderBoxChars,h as stepDecimals};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-WDXJWC3Y.js";import{Button_default as i}from"./chunk-4IU5BSVE.js";import{iconButtonClasses as n}from"./chunk-K7U4RWXJ.js";import{Icon as r}from"./chunk-KIBL6M3T.js";import{Tooltip as a}from"./chunk-22S6LG6D.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:g=!1,disabledReason:N,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:W,menuFooterLabel:C,align:L="end",side:z="bottom",menuMinWidth:D,linkAs:I,block:R=!1,className:B=""},M){const $=g&&(null!=N&&""!==N&&!1!==N)&&!v,A=x&&null!=j&&""!==j&&!1!==j,F=o(),J=/* @__PURE__ */t(i,{ref:M,type:b,variant:f,size:p,loading:v,leftIcon:k,block:R,disabled:g&&!$,"aria-disabled":!!$||void 0,disabledReason:$?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),K=R?"relative flex min-w-0 flex-1":"relative inline-flex",O=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
2
|
+
return s("div",{className:[R?"flex w-full":"inline-flex","items-stretch",B].filter(Boolean).join(" "),children:[null==w||""===w||$?J:/* @__PURE__ */t(a,{content:w,className:K,children:J}),
|
|
3
|
+
/* @__PURE__ */t(a,{content:A?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":A?F:void 0,items:h,align:L,side:z,minWidth:D,linkAs:I,disabled:x&&!A,"aria-disabled":A,onOpenChange:y,footer:W,footerLabel:C,triggerClassName:n({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(r,{name:"chevron-down",className:O,strokeWidth:2,"aria-hidden":"true"})})}),A&&/* @__PURE__ */t("span",{id:F,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|