efficient-shell 8.1.0 → 8.6.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 +7 -6
- package/dist/{Browser-DPZW525X.js → Browser-DWCAT7YU.js} +14 -14
- package/dist/Calculator-B44SNFGQ.js +29 -0
- package/dist/{CurrencyConverter-QGJGHF7D.js → CurrencyConverter-QCXULYMM.js} +8 -8
- package/dist/{Documents-JXWMWUYA.js → Documents-TJGLPXWF.js} +24 -24
- package/dist/Files-6A6VPSMP.js +87 -0
- package/dist/{Notepad-HTD5I4TI.js → Notepad-F42I5BFB.js} +9 -9
- package/dist/{PdfViewer-A4YQDCER.js → PdfViewer-IQQM7DOH.js} +1 -1
- package/dist/{PomodoroTimer-42AKGGPS.js → PomodoroTimer-KUB3JUJO.js} +4 -4
- package/dist/{Preview-KQLFA2TJ.js → Preview-D535MRVA.js} +35 -35
- package/dist/Sidebar-EIGME7VA.js +43 -0
- package/dist/{Spreadsheet-FRU2PYVZ.js → Spreadsheet-PUAIM4ZN.js} +14 -14
- package/dist/{Stock-6YBJY53A.js → Stock-DCQEYEND.js} +3 -3
- package/dist/{Weather-CQIK7FA7.js → Weather-UYCFOHGQ.js} +17 -17
- package/dist/{WorldClock-BR7QFSTH.js → WorldClock-WKMFOBKT.js} +6 -6
- package/dist/ai/index.js +12 -12
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/StatTile.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/chunk-26DGOAPH.js +14 -0
- package/dist/{chunk-G4FMVIJT.js → chunk-2DGTGJYJ.js} +9 -9
- package/dist/{chunk-AMTFUUOM.js → chunk-2K76HRXS.js} +1 -1
- package/dist/{chunk-RUTL7QGV.js → chunk-2LKH6JM5.js} +1 -1
- package/dist/{chunk-4AXCIQB2.js → chunk-2M5JD52X.js} +2 -2
- package/dist/{chunk-7ZL7SQCN.js → chunk-2QI3QFX6.js} +1 -1
- package/dist/{chunk-3ACF3KU7.js → chunk-2TPUNCT7.js} +9 -9
- package/dist/{chunk-3ATZYGAU.js → chunk-2VLQECPC.js} +10 -10
- package/dist/{chunk-RERVHKA6.js → chunk-332V47ID.js} +2 -2
- package/dist/{chunk-KPF7K32G.js → chunk-3GMHX3WX.js} +4 -4
- package/dist/{chunk-NDMFITDJ.js → chunk-3OKD2ZZV.js} +11 -11
- package/dist/{chunk-QMIPMPCY.js → chunk-3XLVARRX.js} +6 -6
- package/dist/{chunk-DMZL7OH6.js → chunk-42U4LJT7.js} +9 -9
- package/dist/{chunk-A34WQDNB.js → chunk-4A2X6KLQ.js} +1 -1
- package/dist/{chunk-EWQY4JAO.js → chunk-4AFNDOPF.js} +1 -1
- package/dist/{chunk-VAIO7Q4E.js → chunk-4B7ZRWDA.js} +1 -1
- package/dist/{chunk-GNWSAZRJ.js → chunk-4CXQX5AX.js} +14 -14
- package/dist/{chunk-QRAXICBI.js → chunk-4OYSTWMQ.js} +1 -1
- package/dist/{chunk-4VSM4HUV.js → chunk-53XMYVJO.js} +1 -1
- package/dist/{chunk-BDCNHMRN.js → chunk-5J6IC25E.js} +1 -1
- package/dist/{chunk-CKECXOYL.js → chunk-5J6Y5TOO.js} +1 -1
- package/dist/{chunk-PGWITSJM.js → chunk-5K3QLWUX.js} +1 -1
- package/dist/chunk-6L7MMUMP.js +2 -0
- package/dist/{chunk-TB653ATX.js → chunk-6L7V25YL.js} +5 -5
- package/dist/{chunk-EHPSP6M4.js → chunk-7A7HRAC6.js} +11 -11
- package/dist/chunk-7GU3LUMW.js +11 -0
- package/dist/{chunk-GS7EYBPO.js → chunk-7KYFOYC7.js} +5 -5
- package/dist/{chunk-S2WTV2JH.js → chunk-7MX6CMMN.js} +1 -1
- package/dist/chunk-7NEIYFM2.js +8 -0
- package/dist/chunk-7OLYHD4V.js +5 -0
- package/dist/{chunk-ZNEZO35H.js → chunk-7PCV65OU.js} +5 -5
- package/dist/{chunk-VOAVONPN.js → chunk-7UEFFCQV.js} +8 -8
- package/dist/{chunk-JIBCYZE3.js → chunk-AP67GBSX.js} +8 -8
- package/dist/{chunk-TUR6CTGT.js → chunk-B4LK7WL6.js} +2 -2
- package/dist/{chunk-5FWXYW5W.js → chunk-B7IHOBK6.js} +15 -15
- package/dist/{chunk-EHV7LRGU.js → chunk-BGVN7HOZ.js} +2 -2
- package/dist/{chunk-AZSLR5FC.js → chunk-BHGMJBJ2.js} +1 -1
- package/dist/{chunk-X5W2SHXX.js → chunk-BKV6PH3R.js} +1 -1
- package/dist/{chunk-PO7ELC4X.js → chunk-BULQOYV6.js} +4 -4
- package/dist/{chunk-LEMQKX7D.js → chunk-BXRWPGAT.js} +1 -1
- package/dist/{chunk-GDCUF6V4.js → chunk-C4D4L2E5.js} +1 -1
- package/dist/{chunk-UMYEVQSH.js → chunk-CASSD64W.js} +5 -5
- package/dist/{chunk-CCQLM73G.js → chunk-CJUN2VOD.js} +1 -1
- package/dist/{chunk-X3FLNEKK.js → chunk-CP6FITHO.js} +17 -17
- package/dist/{chunk-IRRF3PRX.js → chunk-CP6Q24MP.js} +7 -7
- package/dist/{chunk-4FMMKKAO.js → chunk-CTB634WT.js} +1 -1
- package/dist/{chunk-IFXAQO67.js → chunk-CXDJXNPZ.js} +1 -1
- package/dist/{chunk-MNY3Y4QD.js → chunk-DSBLBBES.js} +6 -6
- package/dist/chunk-DYSUTUH3.js +15 -0
- package/dist/{chunk-BZMFVAOL.js → chunk-EDEQRSJC.js} +1 -1
- package/dist/chunk-EDYCBXWD.js +8 -0
- package/dist/chunk-EKHT4PDR.js +4 -0
- package/dist/chunk-ELVFPH7Y.js +5 -0
- package/dist/{chunk-IU645JAM.js → chunk-ENSA3NAS.js} +1 -1
- package/dist/{chunk-IXPMFIAS.js → chunk-EPHQ7UQV.js} +1 -1
- package/dist/{chunk-6LLCKIV6.js → chunk-EVKBV6IV.js} +1 -1
- package/dist/{chunk-REWKCHIU.js → chunk-EY74CLGD.js} +11 -11
- package/dist/{chunk-OOUVBV2Q.js → chunk-EZQXLIG3.js} +1 -1
- package/dist/chunk-FQEALPZJ.js +1 -0
- package/dist/chunk-GJDK54K6.js +13 -0
- package/dist/{chunk-GM5QZMZH.js → chunk-GVTWQBRU.js} +8 -8
- package/dist/{chunk-P2HKX4VB.js → chunk-H7BP5LLG.js} +1 -1
- package/dist/{chunk-WZZKQJUJ.js → chunk-HFEYQVKD.js} +1 -1
- package/dist/{chunk-SSS5BYD5.js → chunk-IJMV4F2Q.js} +1 -1
- package/dist/{chunk-OXALEGWD.js → chunk-IQDIWKES.js} +1 -1
- package/dist/{chunk-AEIQP73W.js → chunk-JGZWAEOJ.js} +1 -1
- package/dist/{chunk-DM2BSQ26.js → chunk-JK3QY266.js} +6 -6
- package/dist/{chunk-K2CJGZPQ.js → chunk-JWMQEWCV.js} +19 -19
- package/dist/{chunk-IY56TA4R.js → chunk-KFMRV3MK.js} +3 -3
- package/dist/chunk-KXTR2RPB.js +12 -0
- package/dist/{chunk-NYJC7I7T.js → chunk-L42Q6GVA.js} +1 -1
- package/dist/chunk-LPYFS4RV.js +19 -0
- package/dist/{chunk-PDQJIJ2G.js → chunk-M3DZDBS6.js} +9 -9
- package/dist/chunk-MH4EUGAB.js +11 -0
- package/dist/{chunk-4B33A5LV.js → chunk-MXDW5IFQ.js} +1 -1
- package/dist/chunk-MXMBQS75.js +20 -0
- package/dist/{chunk-STC63JLD.js → chunk-N7LV32EQ.js} +1 -1
- package/dist/{chunk-2PT2CDTN.js → chunk-NIULZZAI.js} +4 -4
- package/dist/{chunk-6ZH6RUZN.js → chunk-O6TKI4F5.js} +1 -1
- package/dist/{chunk-V7T3FV6K.js → chunk-OCBAIXM2.js} +5 -5
- package/dist/chunk-OVNRVFWS.js +1 -0
- package/dist/{chunk-MYCBGGOC.js → chunk-OZ2ALRKX.js} +2 -2
- package/dist/{chunk-KWJY7YLC.js → chunk-P25GL5BQ.js} +1 -1
- package/dist/{chunk-4VTZQT4O.js → chunk-PMJMPYLQ.js} +6 -6
- package/dist/{chunk-YH2TXBGF.js → chunk-PPROO6JU.js} +6 -6
- package/dist/{chunk-7BSBTDKK.js → chunk-PPSIMRJM.js} +8 -8
- package/dist/{chunk-M44R4OFV.js → chunk-PZ6D5DYB.js} +1 -1
- package/dist/{chunk-K3WHR66I.js → chunk-QGU24ERZ.js} +1 -1
- package/dist/chunk-QKIVMRK5.js +5 -0
- package/dist/{chunk-LXV7ANUQ.js → chunk-QQVLFDX6.js} +4 -4
- package/dist/chunk-RA2HF3VC.js +10 -0
- package/dist/{chunk-2D7G2OYC.js → chunk-RD5UPROC.js} +6 -6
- package/dist/{chunk-JVQG3EFU.js → chunk-RFNU5AIH.js} +1 -1
- package/dist/{chunk-AZ7SYI4D.js → chunk-SBHLTCGU.js} +1 -1
- package/dist/{chunk-3I4DYCQK.js → chunk-SDIGC5NU.js} +1 -1
- package/dist/{chunk-VCSHT4SZ.js → chunk-SFNLRK5J.js} +7 -7
- package/dist/{chunk-ZXZMSNJN.js → chunk-TAGZV46K.js} +1 -1
- package/dist/chunk-TKLH7V2R.js +9 -0
- package/dist/{chunk-UDX6UJHN.js → chunk-TLZVEW34.js} +4 -4
- package/dist/{chunk-USG3EG2Y.js → chunk-TTE3GZWH.js} +1 -1
- package/dist/{chunk-LLBP42IT.js → chunk-TWWJLFTD.js} +4 -4
- package/dist/{chunk-VXRW6BIC.js → chunk-TYEXEETI.js} +5 -5
- package/dist/chunk-U5PXB4UW.js +9 -0
- package/dist/{chunk-ECX6BCQG.js → chunk-UHW2CFLV.js} +1 -1
- package/dist/{chunk-KJDEW5MD.js → chunk-UL4WB3VH.js} +1 -1
- package/dist/chunk-URBCGEXG.js +1 -0
- package/dist/{chunk-J7I7R5XZ.js → chunk-US5B4QYS.js} +11 -11
- package/dist/{chunk-KTXEQFVQ.js → chunk-US5YOYS3.js} +1 -1
- package/dist/chunk-UWHGJTAL.js +8 -0
- package/dist/{chunk-PZRKVGML.js → chunk-VAACOJ2H.js} +1 -1
- package/dist/{chunk-AZ6UPURX.js → chunk-VH3IMIS2.js} +6 -6
- package/dist/chunk-VJ56YZY6.js +14 -0
- package/dist/chunk-VLOJ4XJC.js +8 -0
- package/dist/{chunk-UU73FP3I.js → chunk-VUYWYMZZ.js} +2 -2
- package/dist/{chunk-IFA3PKKA.js → chunk-WNJLY7CM.js} +11 -11
- package/dist/chunk-X4KIXGW5.js +1 -0
- package/dist/{chunk-NQJJRKUK.js → chunk-XKCEVZZB.js} +1 -1
- package/dist/chunk-XMGXVMVS.js +6 -0
- package/dist/{chunk-7BIMXRDE.js → chunk-XSY22PWH.js} +2 -2
- package/dist/{chunk-R2R7IVKO.js → chunk-XW7KN6HW.js} +12 -12
- package/dist/{chunk-YFBGRCP2.js → chunk-XYA7NPSZ.js} +6 -6
- package/dist/{chunk-OWUVCQG7.js → chunk-Y3XH4HJQ.js} +2 -2
- package/dist/chunk-YEY6YPTM.js +2 -0
- package/dist/chunk-YT32RSS6.js +7 -0
- package/dist/chunk-YUMPKSS4.js +1 -0
- package/dist/{chunk-XOGC427S.js → chunk-YVOGWINT.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaUploadField.d.ts +13 -2
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/NumericKeypad.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/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/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/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +263 -263
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +6 -6
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.d.ts +35 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.d.ts +7 -3
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.d.ts +18 -0
- package/dist/shell/MetricBarLegend.js +2 -0
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.d.ts +10 -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/Tabs.d.ts +32 -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/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +8 -0
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +2 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +4 -4
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-6XA52RW2.js +0 -29
- package/dist/Files-U7VDQLXQ.js +0 -87
- package/dist/Sidebar-VP27XAG3.js +0 -43
- package/dist/chunk-3CLJLMGC.js +0 -14
- package/dist/chunk-3CORTJSX.js +0 -5
- package/dist/chunk-54LYZJKD.js +0 -4
- package/dist/chunk-5H4ZKLNG.js +0 -8
- package/dist/chunk-5LHPDU6X.js +0 -1
- package/dist/chunk-64KMJHVU.js +0 -2
- package/dist/chunk-CAVMIKH4.js +0 -10
- package/dist/chunk-DHI24QY6.js +0 -10
- package/dist/chunk-DLQHQ2MW.js +0 -10
- package/dist/chunk-HXQ2DB32.js +0 -8
- package/dist/chunk-IQDJ76DD.js +0 -9
- package/dist/chunk-JS34LPLL.js +0 -11
- package/dist/chunk-K4K3YDW6.js +0 -14
- package/dist/chunk-K5Q5RIQT.js +0 -6
- package/dist/chunk-K62MSU6T.js +0 -8
- package/dist/chunk-KVNWMSXP.js +0 -2
- package/dist/chunk-MFUGVAP5.js +0 -2
- package/dist/chunk-OLASMUGT.js +0 -8
- package/dist/chunk-QAVNMU6V.js +0 -9
- package/dist/chunk-QBYVXYN3.js +0 -5
- package/dist/chunk-QBZXN2U2.js +0 -1
- package/dist/chunk-QUHQCJ5P.js +0 -15
- package/dist/chunk-SRCPFYYU.js +0 -19
- package/dist/chunk-SRFFFPTS.js +0 -20
- package/dist/chunk-XPEUKDPT.js +0 -9
- package/dist/chunk-Y2G5KXA6.js +0 -1
- /package/dist/{chunk-RTRWAKFO.js → chunk-2CGVDBNO.js} +0 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{useCopyText as e,CopyGlyph as n}from"./chunk-
|
|
1
|
+
import{useCopyText as e,CopyGlyph as n}from"./chunk-4A2X6KLQ.js";import{PopupMenu as t,PopupMenuItem as r,PopupMenuDivider as l}from"./chunk-RAHIWTPJ.js";import{Icon as i}from"./chunk-C2HHGLLR.js";import{useShellStrings as a}from"./chunk-OVNRVFWS.js";import{useState as o,useEffect as s,Fragment as c,useRef as d,useLayoutEffect as m}from"react";import{jsxs as u,jsx as p,Fragment as h}from"react/jsx-runtime";var f="flex-[0_1_15rem]",y=f,b="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function x(){/* @__PURE__ */
|
|
2
2
|
return p(i,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function g({text:t,label:r,copiedLabel:l}){const{copied:i,copy:a}=e(t);/* @__PURE__ */
|
|
3
|
-
return p("button",{type:"button",tabIndex:-1,"aria-label":i?l:r,title:i?l:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */p(n,{copied:i,className:"size-3.5"})})}function k({node:e}){const n=d(null);return m(()=>{const t=n.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),/* @__PURE__ */p("span",{ref:n,className:"ml-1 flex shrink-0 items-center"})}function v({tabs:e,activeKey:n,idFor:d,panelMounted:m,onActivate:v,onClose:N,onCloseMany:w,label:C,className:$,activeClassName:j,end:z,afterPinned:I,onIconMenu:
|
|
3
|
+
return p("button",{type:"button",tabIndex:-1,"aria-label":i?l:r,title:i?l:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */p(n,{copied:i,className:"size-3.5"})})}function k({node:e}){const n=d(null);return m(()=>{const t=n.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),/* @__PURE__ */p("span",{ref:n,className:"ml-1 flex shrink-0 items-center"})}function v({tabs:e,activeKey:n,idFor:d,panelMounted:m,onActivate:v,onClose:N,onCloseMany:w,label:C,className:$,activeClassName:j,end:z,afterPinned:I,onIconMenu:A,menuItems:D,sizing:M="even"}){const L=a().pageTabs,[R,_]=o(null),B=e.length;s(()=>{if(!n)return;const e=document.getElementById(d(n,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[d,n,B]);const E=I?e.findIndex(e=>!e.pinned):-1,H=e.some(e=>e.key===n)?n:e[0]?.key,T=n=>{const t=e[(n+e.length)%e.length];t&&document.getElementById(d(t.key,"tab"))?.focus()},F=R?e.find(e=>e.key===R.key):void 0,K=F&&D?D(F.key):[],O=F?e.indexOf(F):-1,V=e=>e.some(e=>!e.pinned),W=e=>()=>{_(null),e()};/* @__PURE__ */
|
|
4
4
|
return u("div",{className:$??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
|
|
5
5
|
/* @__PURE__ */p("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
|
|
6
|
-
/* @__PURE__ */u("div",{role:"tablist","aria-label":C,onKeyDown:n=>{const t=e.findIndex(e=>document.getElementById(d(e.key,"tab"))===n.target);if(!(t<0)){if("ArrowRight"===n.key)T(t+1);else if("ArrowLeft"===n.key)T(t-1);else if("Home"===n.key)T(0);else if("End"===n.key)T(e.length-1);else{if("Delete"!==n.key||e[t].pinned)return;N(e[t].key)}n.preventDefault()}},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[e.map((t,r)=>{const l=t.key===n,a=!!t.dirty,o=t.icon,s=l?j??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",h=r>0&&r!==
|
|
6
|
+
/* @__PURE__ */u("div",{role:"tablist","aria-label":C,onKeyDown:n=>{const t=e.findIndex(e=>document.getElementById(d(e.key,"tab"))===n.target);if(!(t<0)){if("ArrowRight"===n.key)T(t+1);else if("ArrowLeft"===n.key)T(t-1);else if("Home"===n.key)T(0);else if("End"===n.key)T(e.length-1);else{if("Delete"!==n.key||e[t].pinned)return;N(e[t].key)}n.preventDefault()}},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[e.map((t,r)=>{const l=t.key===n,a=!!t.dirty,o=t.icon,s=l?j??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",h=r>0&&r!==E&&!l&&e[r-1].key!==n,w={type:"button",role:"tab",id:d(t.key,"tab"),"aria-selected":l,"aria-controls":m?.(t.key)?d(t.key,"panel"):void 0,tabIndex:t.key===H?0:-1,title:t.title,onClick:()=>v(t.key)},C={onContextMenu:e=>((e,n)=>{e.preventDefault(),_({x:e.clientX,y:e.clientY,key:n.key})})(e,t),onAuxClick:e=>((e,n)=>{1!==e.button||n.pinned||(e.preventDefault(),N(n.key))})(e,t),onMouseDown:e=>{1===e.button&&e.preventDefault()}},$=o&&
|
|
7
7
|
/* @__PURE__ */u("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[o,a&&!l&&!t.pinned&&
|
|
8
|
-
/* @__PURE__ */p("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),z=l&&!!
|
|
9
|
-
/* @__PURE__ */p("span",{className:o?"sr-only":"whitespace-nowrap text-sm",children:t.title})]})},t.key):/* @__PURE__ */u(c,{children:[r===
|
|
8
|
+
/* @__PURE__ */p("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),z=l&&!!A&&!!o;return t.pinned?/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex h-8 flex-none items-center justify-center rounded-t-md border border-b-0 transition-colors ${o?"w-10":""} ${s}`,...C,children:/* @__PURE__ */u("button",{...w,className:`flex h-full items-center justify-center rounded-t-md ${o?"w-full":"px-3"} ${b}`,children:[$,
|
|
9
|
+
/* @__PURE__ */p("span",{className:o?"sr-only":"whitespace-nowrap text-sm",children:t.title})]})},t.key):/* @__PURE__ */u(c,{children:[r===E&&I,h&&/* @__PURE__ */p("span",{"aria-hidden":"true",className:"mb-3 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
|
|
10
10
|
/* @__PURE__ */u("div",{role:"presentation",className:`group relative flex h-8 items-center rounded-t-md border border-b-0 text-sm transition-colors ${"active-full"===M&&l?"":"@container"} ${"active-full"===M?l?"flex-none min-w-[12rem] max-w-[40rem]":y:l&&(t.copy||z)?"flex-[0_1_20rem]":f} ${l?"active-full"===M?"":"min-w-[4.25rem]":"min-w-[2.75rem]"} ${s}`,...C,children:[z&&
|
|
11
|
-
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":L.tabMenu,title:L.tabMenu,onClick:e=>{const n=e.currentTarget.getBoundingClientRect();
|
|
11
|
+
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":L.tabMenu,title:L.tabMenu,onClick:e=>{const n=e.currentTarget.getBoundingClientRect();A?.(t.key,n.left,n.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-2 ${b}`,children:$}),
|
|
12
12
|
/* @__PURE__ */u("button",{...w,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-md pr-1 text-left ${z?"pl-2":"pl-3"} ${b} ${l?z?"":"@max-[5rem]:pl-3":"@max-[6.5rem]:pr-3 @max-[6.5rem]:group-hover:pr-1 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-2"}`,children:[!z&&$,
|
|
13
13
|
/* @__PURE__ */u("span",{className:`min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] ${"active-full"===M&&l?"pr-4":""} ${o?l?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""}`,children:[t.title,t.favorite&&
|
|
14
14
|
/* @__PURE__ */p("span",{role:"img","aria-label":L.favorite,title:L.favorite,className:"ml-1 inline-flex align-[-0.125em] text-yellow-500",children:/* @__PURE__ */p(i,{name:"star","aria-hidden":"true",className:"size-3.5",fill:"currentColor",strokeWidth:1.5})})]})]}),l&&t.actions&&/* @__PURE__ */p(k,{node:t.actions}),l&&t.copy&&/* @__PURE__ */p(g,{text:t.copy,label:L.copy(t.copy),copiedLabel:L.copied}),
|
|
15
15
|
/* @__PURE__ */u("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(l?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[a&&/* @__PURE__ */p("span",{role:"img","aria-label":L.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
|
|
16
|
-
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-label":L.closeTab?.(t.title)??`${L.close} ${t.title}`,onClick:()=>N(t.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(a?"hidden group-hover:flex":l?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */p(x,{})})]})]})]},t.key)}),I&&
|
|
16
|
+
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-label":L.closeTab?.(t.title)??`${L.close} ${t.title}`,onClick:()=>N(t.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(a?"hidden group-hover:flex":l?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */p(x,{})})]})]})]},t.key)}),I&&E<0&&I]}),z&&/* @__PURE__ */p("div",{className:"flex shrink-0 items-center gap-2 self-center",children:z}),R&&F&&/* @__PURE__ */u(t,{portal:!0,style:{left:R.x,top:R.y},onClose:()=>_(null),children:[K.length>0&&/* @__PURE__ */u(h,{children:[K.map((e,n)=>/* @__PURE__ */u(r,{onClick:W(e.onSelect),children:[e.icon,e.label]},n)),
|
|
17
17
|
/* @__PURE__ */p(l,{})]}),
|
|
18
|
-
/* @__PURE__ */p(r,{disabled:
|
|
18
|
+
/* @__PURE__ */p(r,{disabled:F.pinned,onClick:W(()=>N(F.key)),children:L.close}),
|
|
19
19
|
/* @__PURE__ */p(l,{}),
|
|
20
|
-
/* @__PURE__ */p(r,{disabled:!
|
|
21
|
-
/* @__PURE__ */p(r,{disabled:!
|
|
22
|
-
/* @__PURE__ */p(r,{disabled:!
|
|
20
|
+
/* @__PURE__ */p(r,{disabled:!V(e.filter(e=>e.key!==F.key)),onClick:W(()=>w("others",F.key)),children:L.closeOthers}),
|
|
21
|
+
/* @__PURE__ */p(r,{disabled:!V(e.slice(O+1)),onClick:W(()=>w("right",F.key)),children:L.closeRight}),
|
|
22
|
+
/* @__PURE__ */p(r,{disabled:!V(e),onClick:W(()=>w("all",null)),children:L.closeAll})]})]})}export{v as TabStrip};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-RD5UPROC.js";import{Radio_default as a}from"./chunk-NI5FXWK5.js";import{Select_default as l}from"./chunk-MXMBQS75.js";import{Input_default as r}from"./chunk-UNEJ2ABD.js";import{FormField as n}from"./chunk-MVQBVPWP.js";import{Checkbox_default as i}from"./chunk-CGZBDI6C.js";import{Textarea_default as c}from"./chunk-AWY3F6PV.js";import{Button_default as o}from"./chunk-FSP63GKK.js";import{useState as t}from"react";import{jsx as m,jsxs as d}from"react/jsx-runtime";function s(){const[s,h]=t("pro"),[u,p]=t(!0),[f,g]=t("us");/* @__PURE__ */
|
|
2
2
|
return m("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */d("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
|
|
3
3
|
/* @__PURE__ */d("div",{children:[
|
|
4
4
|
/* @__PURE__ */m("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{ChartDefs as t,MOTION as e,stagger as a,glowId as n}from"./chunk-465RRWBY.js";import{ChartSkeleton as i}from"./chunk-EVKBV6IV.js";import{useHighlight as r,autoHighlightIndex as l,highlightOpacity as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as m}from"./chunk-P5BOTIJU.js";import{CartesianPlot as s}from"./chunk-PPSIMRJM.js";import{CHART_INK as u,STATUS_VARS as h,resolveSeriesColor as c}from"./chunk-TZFACUMR.js";import{useShellStrings as d,useShellLocale as f}from"./chunk-OVNRVFWS.js";import{formatPercent as b,formatPlain as p}from"./chunk-C3QOHMR6.js";import{useId as x}from"react";import{jsx as y,jsxs as M}from"react/jsx-runtime";function g({series:g,labels:v,stacked:k=!1,stackMode:N="value",height:$=220,width:w,max:F,formatValue:V,yAxisLabel:j,className:L,emptyLabel:A,radius:S=3,loading:C=!1,animate:R=!0,glow:O=!1,emphasise:z=!1,activeKey:B,highlight:E="none",valueLabels:T=!1,onSelect:I,min:P,formatTooltipValue:W,tooltipLabels:Y,barGap:H=4,seriesLabels:J=!1}){const K=x(),{highlighted:U}=r(),G=d().charts,Q=f(),Z=V??(t=>p(t,Q)),q=W??Z;if(C)/* @__PURE__ */return y(i,{height:$,width:w,variant:"bars",className:L});const D=(t,e)=>{const a=t.pointColors?.[e];if(a)return a;const n=t.pointTones?.[e];return n?h[n]:c(t.slot,t.color,t.tone)},X=g.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(t=>Number.isFinite(t))),_=(t,e)=>{const a=t.data[e];return"number"==typeof a&&Number.isFinite(a)?a:0},tt=v.map((t,e)=>X.reduce((t,a)=>t+_(a,e),0)),et=v.map((t,e)=>X.reduce((t,a)=>t+Math.max(0,_(a,e)),0)),at=v.map((t,e)=>X.reduce((t,a)=>t+Math.min(0,_(a,e)),0)),nt=k&&"percent"===N,it=(t,e)=>tt[e]>0?t/tt[e]:null,rt=nt?[1]:k?[...et,...at]:X.flatMap(t=>t.data.filter(Number.isFinite)),lt=(t,e)=>{const a=t.bandwidth/Math.max(1,X.length),n=X.length>1?Math.min(H,.25*a):0;return{offset:e*a+n/2,width:Math.max(1,a-n)}},ot=J&&!k?({x:t,y:e})=>{const a=Math.min(e.domain[1],Math.max(e.domain[0],0));return v.map((n,i)=>X.map((n,r)=>{const l=n.data[i];if(!Number.isFinite(l))return null;const o=Math.min(e.domain[1],Math.max(e.domain[0],l)),{offset:m,width:s}=lt(t,r),h=t(i)+m+s/2,c=Math.min(e(o),e(a)),d=Math.max(e(o),e(a));if(s<13)return null;const f=Math.floor((d-c-12)/6.6),b=f>=Math.min(4,n.label.length),p=b&&n.label.length>f?`${n.label.slice(0,f-1).trimEnd()}…`:n.label,x=b?d-6:c-4;/* @__PURE__ */
|
|
2
|
+
return y("text",{"data-series-label":"true",x:h,y:x,transform:`rotate(-90 ${h} ${x})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:b?u.surface:u.label,children:p},`n${n.key}-${i}`)}))}:null;/* @__PURE__ */
|
|
3
|
+
return y(s,{labels:v,values:rt,height:$,width:w,max:nt?1:F,min:nt?void 0:P,formatValue:nt?t=>b(Math.round(100*t),0,Q):Z,yAxisLabel:j,className:L,emptyLabel:A,onSelect:I,ariaLabel:G.acrossCategories(X.map(t=>t.label),v.length),tooltip:t=>/* @__PURE__ */y(m,{title:Y?.[t]??v[t],rows:X.map(e=>({key:e.key,label:e.label,color:D(e,t),value:Number.isFinite(e.data[t])?nt?`${b(100*(it(e.data[t],t)??0),1,Q)} · ${q(e.data[t])}`:q(e.data[t]):void 0})),footnote:nt?G.inCategory(q(tt[t])):void 0}),overlay:T&&!nt||ot?({x:t,y:e})=>/* @__PURE__ */M("g",{pointerEvents:"none",children:[ot?.({x:t,y:e}),T&&!nt&&v.map((a,n)=>{if(k){if(!X.some(t=>Number.isFinite(t.data[n])))return null;const a=X.reduce((t,e)=>t+_(e,n),0),i=a>=0?et[n]:at[n];/* @__PURE__ */
|
|
4
|
+
return y("text",{"data-value-label":"true",x:t.center(n),y:a>=0?e(i)-4:e(i)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:Z(a)},`v${n}`)}return X.map((a,i)=>{const r=a.data[n];if(!Number.isFinite(r))return null;const l=r,{offset:o,width:m}=lt(t,i);/* @__PURE__ */
|
|
5
|
+
return y("text",{"data-value-label":"true",x:t(n)+o+m/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:Z(l)},`v${a.key}-${n}`)})})]}):void 0,children:({x:i,y:r,bottom:m,active:s})=>{const h=B?v.indexOf(B):-1,c=l(k?tt:X[0]?.data??[],E),d=s??(h>=0?h:c);/* @__PURE__ */
|
|
6
|
+
return M("g",{children:[
|
|
7
|
+
/* @__PURE__ */y(t,{id:K,glow:O}),v.map((t,l)=>{let m=0,s=0;const h=r(Math.min(r.domain[1],Math.max(r.domain[0],0)));return X.map((t,c)=>{const f=t.data[l];if(!Number.isFinite(f))return null;const b=nt?it(f,l):f;if(null===b)return null;const p=D(t,l),x=lt(i,c),M=k?i(l):i(l)+x.offset,g=k?Math.max(1,i.bandwidth):x.width;let v,N,$=!0;if(k){const t=b>=0?m:s,e=t+b;b>=0?m=e:s=e,v=r(Math.max(t,e)),N=r(Math.min(t,e)),$=0===t}else v=Math.min(r(b),h),N=Math.max(r(b),h);const w=Math.max(0,N-v-(k&&!$?2:0)),F=null===d||d===l,V=F?p:z?u.muted:p,j=o(t.key,U);/* @__PURE__ */
|
|
8
|
+
return y("rect",{x:M,y:v,width:g,height:w,rx:S,fill:V,fillOpacity:j??(F?1:z?.32:.45),filter:O&&d===l?`url(#${n(K)})`:void 0,className:"rosh-viz-mark"+(R?` ${e.rise}`:""),style:R?a(l*(k?1:X.length)+c,26):void 0},`${t.key}-${l}`)})}),null!==s&&!z&&/* @__PURE__ */y("line",{x1:i.center(s),y1:r(r.domain[1]),x2:i.center(s),y2:m,stroke:u.axis,strokeWidth:1})]})}})}export{g as ColumnChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-
|
|
1
|
+
import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-OVNRVFWS.js";import{useRef as r,useState as n,useCallback as s}from"react";import{jsx as a}from"react/jsx-runtime";function o(e,t){const r=(t??"").split(",").map(e=>e.trim().toLocaleLowerCase()).filter(Boolean);if(0===r.length||r.includes("*")||r.includes("*/*"))return!0;const n=e.name.toLocaleLowerCase(),s=e.type.toLocaleLowerCase();return r.some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?s.startsWith(e.slice(0,-1)):s===e)}var l=(t,r=e.files)=>t<1024?r.bytes(t):t<1048576?r.kilobytes(Math.round(t/1024)):r.megabytes(t/1048576),i=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function c(e){const t=e.clipboardData;if(!t)return[];if(t.files&&t.files.length>0)return Array.from(t.files);const r=[];for(const e of Array.from(t.items??[]))if("file"===e.kind){const t=e.getAsFile();t&&r.push(t)}return r}function u({onAccept:e,accept:a,maxSizeBytes:u,maxFiles:f,multiple:p=!0,currentCount:m=0,acceptHint:d,disabled:h=!1}){const g=t().files,y=r(null),[x,v]=n(!1),[D,L]=n([]),b=r(0),A="string"==typeof d?d:"",j=s(t=>{if(h||!t)return;const r=Array.from(t);if(0===r.length)return;const n=[],s=[];for(const e of p?r:r.slice(0,1))o(e,a)?null!=u&&e.size>u?s.push({file:e,reason:"size",message:g.tooLarge(e.name,l(e.size,g),l(u,g))}):p&&null!=f&&m+n.length>=f?s.push({file:e,reason:"count",message:g.tooMany(e.name,f)}):n.push(e):s.push({file:e,reason:"type",message:g.notAccepted(e.name,A)});L(s),n.length&&e(n),y.current&&(y.current.value="")},[h,p,a,A,u,f,m,e,g]),k=s(()=>{h||y.current?.click()},[h]),z=s(()=>L([]),[]);return{inputRef:y,inputProps:{ref:y,type:"file",accept:a||void 0,multiple:p,disabled:h,tabIndex:-1,"aria-hidden":!0,className:"hidden",onChange:e=>j(e.target.files)},zoneProps:h?{}:{onDragEnter:e=>{i(e)&&(e.preventDefault(),b.current+=1,v(!0))},onDragOver:e=>{i(e)&&(e.preventDefault(),x||v(!0))},onDragLeave:e=>{i(e)&&(b.current=Math.max(0,b.current-1),0===b.current&&v(!1))},onDrop:e=>{i(e)&&(e.preventDefault(),b.current=0,v(!1),j(e.dataTransfer.files))}},pasteProps:h?{}:{onPaste:e=>{const t=c(e);0!==t.length&&(e.preventDefault(),j(t))}},open:k,take:j,dragOver:x,rejections:D,clearRejections:z}}function f({rejections:e,className:t="mt-2"}){return 0===e.length?null:/* @__PURE__ */a("ul",{role:"alert",className:`${t} flex flex-col gap-0.5`,children:e.map(({file:e,message:t},r)=>/* @__PURE__ */a("li",{className:"text-xs text-red-600",children:t},`${e.name}-${r}`))})}export{f as FileIntakeAlert,o as acceptsFile,l as humanSize,i as isFileDrag,c as pastedFiles,u as useFileIntake};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-
|
|
2
|
-
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:
|
|
1
|
+
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-JGZWAEOJ.js";import{Icon as i}from"./chunk-C2HHGLLR.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
|
|
2
|
+
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:D,rowRef:P,className:A=""}){const B=x||!!p,H=n(u),J=l(null),$=s(),C=[D?.["aria-describedby"],j?$:void 0].filter(Boolean).join(" ")||void 0,G=D?.tabIndex;a(()=>{const e=J.current;if(!e||void 0!==G)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const I="comfortable"===H?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},K=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
|
|
3
3
|
/* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
|
|
4
|
-
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":B||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-white transition-colors duration-(--motion-fast)",w?"":B?"border-blue-300":"border-gray-200 hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${
|
|
5
|
-
/* @__PURE__ */c("div",{...
|
|
6
|
-
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[
|
|
7
|
-
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:
|
|
4
|
+
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":B||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-white transition-colors duration-(--motion-fast)",w?"":B?"border-blue-300":"border-gray-200 hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${I[k]}`}),
|
|
5
|
+
/* @__PURE__ */c("div",{...D,ref:e=>{var r,t;J.current=e,t=e,"function"==typeof(r=P)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":D?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":C,onKeyDown:e=>{if(D?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",A].filter(Boolean).join(" "),children:[
|
|
6
|
+
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[K&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[K,
|
|
7
|
+
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:K})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:$})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{SearchableSelect as e}from"./chunk-3OKD2ZZV.js";import{Select_default as a}from"./chunk-MXMBQS75.js";import{Input_default as l}from"./chunk-UNEJ2ABD.js";import{labelClasses as t}from"./chunk-EQKUFYX6.js";import{isSafeLinkHref as r}from"./chunk-PJPK2ADX.js";import{INPUT_SIZES as n}from"./chunk-JFSYWEHD.js";import{Button_default as i}from"./chunk-FSP63GKK.js";import{Icon as o}from"./chunk-C2HHGLLR.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-OVNRVFWS.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},y=e=>r(e.trim());function k(r){const{value:n,kinds:o,rules:k=x,filtersFor:w,label:N,readOnly:C,placeholder:F,className:O=""}=r,j=void 0!==r.onApply,$=u().link,D=k.isSafe??y,E=d(),z=c(null),K=c(null),[P,S]=p({url:n}),A=j?P.url:n,[U,W]=p(!1),[H,L]=p(null),[M,R]=p(null),V=c(()=>{});V.current=j?r.onCancel:()=>{},m(()=>{if(j)return s(e=>{const a=z.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(V.current(),!0)},()=>z.current)},[j]),m(()=>{if(!j)return;const e=K.current;e?(e.focus(),e.select()):z.current?.querySelector("button, input")?.focus()},[]);const J=o??[{value:b,label:$.address,target:{type:"text"}}],Q=H&&H.against===A?H.kind:k.kindOf(A),T=J.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===Q),X=T.find(e=>"text"===e.target.type),B=T.find(e=>e.value===Q)??X??T[0];if(!B)return null;const G="text"!==B.target.type,Y=G?k.targetOf(A):A,Z=h(B.target),q=Z.find(e=>e.value===Y),I=e=>({value:e,label:$.unavailable(e)}),_="select"===B.target.type&&Y&&w?w(Y):null,ee=_?k.readFilter(A):null,ae=ee?_?.find(e=>e.param===ee.param):void 0,le=M&&M.against===A?M.text:A,te=!G&&""!==le.trim()&&!D(le),re=te&&(!j||U),ne=(e,a)=>{j?S({url:e,name:a}):void 0===a?r.onChange(e):r.onChange(e,a)},ie=(e,a)=>{L(a=>a?{...a,against:e}:a),ne(e,a)},oe=e=>{if(!e)return ie("");const a=Z.find(a=>a.value===e);ie(e,a?.label)},se=G?A:le.trim(),ue=()=>{if(!j||!se)return;if(!G&&te)return void W(!0);const e=G&&P.url===se?P.name:void 0,a=r.onApply;void 0===e?a(se):a(se,e)},de=(e,a)=>a&&!e.some(e=>e.value===a)?[I(a),...e]:[...e],ce=(l,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const a=r.some(e=>""===e.value);/* @__PURE__ */
|
|
2
|
+
return f(e,{"aria-label":l,value:t,options:o,disabled:C,clearable:a,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
3
|
+
return f(a,{size:"sm","aria-label":l,value:t,options:o,readOnly:C,onChange:n})};let pe;if("text"===B.target.type)pe=/* @__PURE__ */f(l,{ref:K,id:`${E}-address`,size:"sm",type:"text",invalid:re,"aria-label":$.address,"aria-describedby":re?`${E}-why`:void 0,placeholder:F??$.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:le,readOnly:C,onChange:e=>(e=>{W(!1);const a=e.trim();a?D(e)?(R({text:e,against:a}),ie(a)):R({text:e,against:A}):(R({text:e,against:""}),ie(""))})(e.target.value)});else{const e="groups"===B.target.type?B.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):B.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:B.target.placeholder},...de(e,Y)];pe=ce(B.label,Y,a,oe,e.length>10)}const me=/* @__PURE__ */v(g,{children:[o&&ce($.linkType,B.value,T.map(e=>({value:e.value,label:e.label})),e=>{R(null),W(!1);const a=T.find(a=>a.value===e);if(!a||"text"===a.target.type)return void L({kind:e,against:A});const l=h(a.target)[0];L({kind:e,against:l?l.value:""}),l?ne(l.value,l.label):ne("")},!1),pe,_&&ce($.filter,ee?.param??"",[{value:"",label:$.noFilter},...ee&&!ae?[I(ee.param)]:[],..._.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return ie(Y,q?.label);const a=_?.find(a=>a.param===e),l=a?.values[0];l&&ie(k.withFilter(Y,{param:e,value:l.value}),l.label)},!1),_&&ee&&ce($.value,ee.value,de((ae?.values??[]).map(e=>({value:e.value,label:e.label})),ee.value),e=>{if(!ee)return;const a=ae?.values.find(a=>a.value===e);ie(k.withFilter(Y,{param:ee.param,value:e}),a?.label)},(ae?.values.length??0)>10),re&&/* @__PURE__ */f("p",{id:`${E}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:$.unsafe}),B.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-gray-400",children:B.hint}),_&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-gray-400",children:$.filterHint})]});if(!j)/* @__PURE__ */
|
|
4
|
+
return f("div",{ref:z,className:`flex min-w-0 flex-auto flex-col gap-2 ${O}`.trim(),role:N?"group":void 0,"aria-label":N,children:me});const fe=r.onRemove;/* @__PURE__ */
|
|
5
|
+
return v("div",{ref:z,role:"dialog","aria-label":N??$.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${O}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),ue())},children:[G?/* @__PURE__ */f("span",{className:t({inline:!0}),children:$.title}):/* @__PURE__ */f("label",{htmlFor:`${E}-address`,className:t({inline:!0}),children:$.title}),me,
|
|
6
|
+
/* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[fe?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:fe,children:$.remove}):null,
|
|
7
|
+
/* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
|
|
8
|
+
/* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>V.current(),children:$.cancel}),
|
|
9
|
+
/* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:ue,disabled:C||""===se,children:$.apply})]})]})]})}function w({label:e,text:a,onTextChange:t,link:r,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const y=u().link,[w,N]=p(!1),C=c(null),F=d(),O=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
|
|
10
|
+
return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
|
|
11
|
+
/* @__PURE__ */f(l,{size:"sm",type:"text",className:"rounded-b-none","aria-label":y.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>t(e.target.value)}),
|
|
12
|
+
/* @__PURE__ */v("button",{ref:C,type:"button","aria-label":y.linkOf(e,r),"aria-expanded":w,"aria-controls":w?F:void 0,disabled:b,onClick:()=>N(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-gray-300 bg-gray-50 ${n.sm} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
13
|
+
/* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(r?"text-blue-600":"text-gray-400")}),
|
|
14
|
+
/* @__PURE__ */f("span",{className:"min-w-0 truncate "+(r?"text-blue-600":"text-gray-400"),children:r||y.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(k,{value:r,label:y.linkOf(e,r),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),O()},onRemove:r?()=>{i(""),O()}:void 0,onCancel:O})})]})}export{k as LinkPicker,w as TextLinkField};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{optionMatches as e,OptionSublabel as t}from"./chunk-C7PQJOGD.js";import{inputClasses as n}from"./chunk-JFSYWEHD.js";import{GROUP_COLORS as r}from"./chunk-BOGBLZKS.js";import{Tooltip as o}from"./chunk-Z3WKHMVB.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-T53TXXOC.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as d}from"./chunk-OVNRVFWS.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:C,disabled:D,id:W,className:L="",tone:E,tooltip:B,split:F}){const[M,S]=m(!1),[T,$]=m(""),H=d(),J=h(null),O=h(null),G=h(null),I=a(J,M),K=e=>k.find(t=>t.value===e)?.label??e,R=p(()=>{const t=new Set(r),n=[],o=T.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,T]),V=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)},P=e=>{e&&!r.includes(e)?(y([...r,e]),$("")):$("")},X=e=>y(r.filter(t=>t!==e)),Z=()=>{const e=T.trim();if(F&&e)return V(e.split(F)),void $("");j&&e?P(e):$("")},z=h(()=>{});z.current=()=>{Z(),S(!1)},f(()=>{if(!M)return;const e=e=>{const t=e.target;J.current?.contains(t)||G.current?.contains(t)||(Z(),S(!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:J,className:"relative",children:[
|
|
3
|
+
/* @__PURE__ */v("div",{onMouseDown:e=>{D||e.target.closest("button")||(e.preventDefault(),O.current?.focus())},className:n({invalid:C,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${D?"bg-gray-50 cursor-not-allowed":""} ${L}`}),children:[r.map(e=>{const t=E?.(e),n=w[t??"accent"],r=/* @__PURE__ */v("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
+
/* @__PURE__ */x("span",{className:"truncate",children:K(e)}),!D&&/* @__PURE__ */x("button",{type:"button","aria-label":H.select.removeItem?.(K(e))??`${H.select.remove} ${K(e)}`,onClick:()=>X(e),className:n.remove,children:"×"})]},e),l=B?.(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:W,ref:O,type:"text",autoComplete:"off",role:"combobox","aria-expanded":M&&Q,"aria-invalid":C||void 0,disabled:D,value:T,placeholder:0===r.length?N:void 0,onChange:e=>{(e=>{if(F){const t=e.split(F);if(t.length>1)return V(t.slice(0,-1)),void $(t[t.length-1])}$(e)})(e.target.value),S(!0)},onFocus:()=>{!D&&Q&&S(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=T.trim(),r=n?R.filter(t=>e(t,n.toLowerCase())):[];1===r.length?P(r[0].value):Z()}else"Backspace"===t.key&&""===T&&r.length>0?X(r[r.length-1]):"Escape"===t.key?(S(!1),$(""),O.current?.blur()):"Tab"===t.key&&(Z(),S(!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"})]}),M&&Q&&g(
|
|
6
|
+
/* @__PURE__ */x("div",{ref:G,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:I?.left,right:I?.right,top:I?.top,bottom:I?.bottom,minWidth:I?.minWidth,maxWidth:I?.maxWidth??s,width:"max-content",visibility:I?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:I?.maxHeight??c},children:0===R.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&r.length>=k.length?H.select.allSelected:H.select.noMatches}):R.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),P(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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Segmented as e}from"./chunk-BF2G42QU.js";import{ColorPicker as t}from"./chunk-
|
|
2
|
-
return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[C("left",b.sides.left,h.left,O("left"),String(u.sides.left),e=>k("left",e)),C("top",b.sides.top,h.top,O("top"),String(u.sides.top),e=>k("top",e)),C("right",b.sides.right,h.right,O("right"),String(u.sides.right),e=>k("right",e)),C("bottom",b.sides.bottom,h.bottom,O("bottom"),String(u.sides.bottom),e=>k("bottom",e))]}):C("all",b.width,h.all,
|
|
1
|
+
import{Segmented as e}from"./chunk-BF2G42QU.js";import{ColorPicker as t}from"./chunk-EY74CLGD.js";import{InputNumber_default as l}from"./chunk-332V47ID.js";import{Icon as r}from"./chunk-C2HHGLLR.js";import{jsxs as a,Fragment as o,jsx as s}from"react/jsx-runtime";var i=["solid","dashed","dotted"],n=["top","right","bottom","left"];function d(e){const t=e??{},l="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:l]))}function m(e,t){const l=e??{},r=d(t),a=n.some(e=>"number"==typeof l[e]),o=n.map(e=>"number"==typeof l[e]?l[e]:"number"==typeof l.width?l.width:a?0:r[e]);return!o.every(e=>e===o[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */s(r,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */s(r,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */s(r,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */s(r,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */s(r,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */s(r,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */s(r,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */s(r,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:r,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:y=!0,min:g=0,max:v=20,step:N=1,readOnly:x}){const j=e=>"number"==typeof d[e]?d[e]:null,k=(e,t)=>{const l={...d};if("number"==typeof d.width)for(const e of n)null===j(e)&&(l[e]=d.width);l[e]=t,delete l.width,m(l)},C=(e,t,r,a,o,i)=>/* @__PURE__ */s("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */s(l,{value:a,onChange:i,min:g,max:v,step:N,precision:0,steppers:"compact",readOnly:x,placeholder:o,prefix:r,suffix:b.unit,"aria-label":t})}),S=n.map(j),G="number"==typeof d.width?d.width:S.every(e=>null!==e&&e===S[0])?S[0]:null,H=null===G&&S.some(e=>null!==e),L=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",O=e=>j(e)??("number"==typeof d.width?d.width:null),z=d.style??u.style;/* @__PURE__ */
|
|
2
|
+
return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[C("left",b.sides.left,h.left,O("left"),String(u.sides.left),e=>k("left",e)),C("top",b.sides.top,h.top,O("top"),String(u.sides.top),e=>k("top",e)),C("right",b.sides.right,h.right,O("right"),String(u.sides.right),e=>k("right",e)),C("bottom",b.sides.bottom,h.bottom,O("bottom"),String(u.sides.bottom),e=>k("bottom",e))]}):C("all",b.width,h.all,G,H?"–":L,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,y&&/* @__PURE__ */s("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */s(e,{block:!0,size:"sm",label:b.style,value:z,onChange:e=>{x||m({...d,style:e})},options:i.map(e=>({value:e,label:/* @__PURE__ */a(o,{children:[p[e],
|
|
3
3
|
/* @__PURE__ */s("span",{className:"sr-only",children:b.styles[e]})]}),title:b.styles[e]}))})}),
|
|
4
4
|
/* @__PURE__ */s("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */s(t,{value:d.color??"",onChange:e=>{x||m({...d,color:e})},label:b.color,presets:f,fallback:u.color,showHexInput:!0,size:"sm",disabled:x})})]})}export{i as BORDER_LINE_STYLES,u as BorderInput,d as borderSides,m as borderStartEach};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-
|
|
2
|
-
return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:S,markers:
|
|
3
|
-
/* @__PURE__ */h("button",{type:"button",onClick:
|
|
4
|
-
/* @__PURE__ */b("span",{children:
|
|
5
|
-
/* @__PURE__ */b("b",{className:"font-medium",children:N(
|
|
6
|
-
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",
|
|
1
|
+
import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-4CXQX5AX.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-C2HHGLLR.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-OVNRVFWS.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:o,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),_=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[v,M]=u(!1),w=g(null),N=()=>{null!=w.current&&(cancelAnimationFrame(w.current),w.current=null),M(!1)};m(()=>()=>N(),[]),m(()=>{N()},[d]);const S=t.map(e=>a(e.date)).filter(e=>null!=e),x=l(Date.now,null)??Math.max(0,...S,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),C=S.length?Math.min(...S):x,R=S.length?Math.max(...S):x,D=a(r??null)??C,P=a(n??null)??0,O=k.has((o||"").toLowerCase()),q=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),A=(()=>{const e=[P,R,q,D+i];return O||e.push(x),Math.max(...e)})(),T=Math.max(1,Math.round((A-D)/i)),I=a(p??null)??R??D,L=Math.min(Math.max(y??I,D),A),j=t.find(e=>{const t=a(e.date);return null!=t&&t<=L})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>L){$=t[e];break}}const F=(()=>{if(j||!$||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:_.start,date:r||new Date(D).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),X=j??F,H=j?a(j.date):F?D:null,V=$?a($.date):null,z=!!(X&&$&&null!=H&&null!=V&&L>H&&L<V);let E,G;if(z&&null!=H&&null!=V){const e=(L-H)/Math.max(V-H,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of X?.items??[])r[e.part_number]=e;const n={};for(const e of $?.items??[])n[e.part_number]=e;const o=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const o=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:o.description??i.description??"",order_qty:s(o.order_qty??i.order_qty??0),casting:t(s(o.casting),s(i.casting)),cnc:t(s(o.cnc),s(i.cnc)),painting:t(s(o.painting),s(i.painting)),packing:t(s(o.packing),s(i.packing)),finished_goods:t(s(o.finished_goods),s(i.finished_goods)),stock_qty:t(s(o.stock_qty),s(i.stock_qty))}}),i=a(X?.est_completion_date),s=a($?.est_completion_date);let l;l=null!=i&&null!=s?new Date(Math.round(i+(s-i)*e)).toISOString().slice(0,10):X?.est_completion_date||$?.est_completion_date||null,E={id:`interp-${L}`,progress_number:_.estimated,date:new Date(L).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},G=X}else if(E=X??t[t.length-1]??null,E){const e=t.findIndex(e=>e.id===E.id);G=e>=0&&e<t.length-1?t[e+1]:null}else G=null;const J={};for(const e of G?.items??[])J[e.part_number]=e;const B=!(!d||E?.id===d),K=d?Math.min(a(p??null)??A,A):A,Q=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:D,endMs:A,totalLeadDays:T,scrubMs:L,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:B,beforeAnchor:X,nextAfter:$,displayed:E,prevReport:G,prevByPN:J,isInterpolated:z,playing:v,startPlay:()=>{if(v)return void N();if(K<=D)return void f(K);M(!0),f(D);let e=performance.now(),t=D;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=K)return f(K),w.current=null,void M(!1);f(t),w.current=requestAnimationFrame(r)};w.current=requestAnimationFrame(r)},stopPlay:N,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:Q,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:i,activeId:s,onChange:l,onPickReport:p,onOpenReport:u,onOpenMarker:m,onDragStart:g,renderReportPreview:h,reportLabel:y,playback:k,edgeCaptions:f,bare:_=!1,endMark:v=null}){const M=c().production,w=d(),N=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),S=N.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:y(e),preview:e.preview??h?.(e),onOpen:u?()=>u(e.id):void 0})),x=new Map(N.map(({report:e,ms:t})=>[e.id,t])),C=N.map(({ms:e})=>e),R=m?a.map(e=>({...e,onOpen:m})):a;/* @__PURE__ */
|
|
2
|
+
return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:S,markers:R,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=x.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:C,ariaLabel:M.scrub,valueText:e=>{const t=(e=>N.find(t=>t.ms===e)?.report)(e);return t?`${y(t)} · ${o(e,w)}`:o(e,w)}},ariaLabel:M.label(o(e,w),o(t,w))})})}function N({snapshot:n,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:N=e=>e.progress_number,resetLabel:S,variant:x="card",onPlayStart:C}){const{reports:R,markers:D,poNumber:P,startMs:O,endMs:q,totalLeadDays:A,scrubMs:T,setScrubMs:I,displayed:L,scrubbedAway:j,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:X,estCompletionMs:H}=n,V=function(e,t,r){const[n,a]=u(!1),o=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),o.current||(o.current=!0,t(e[0])),a(!0))},stop:()=>{o.current=!1,a(!1)}}}(R.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),I,C),z=c().production,E=d(),G=_??z.heading,J=e=>o(e,E);if(0===R.length&&0===D.length)return null;const B=D.filter(e=>"shipment"===e.kind),K=D.filter(e=>"inspection"===e.kind),Q=D.filter(e=>"invoice"===e.kind),U=(L?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),W=L?v(L):0,Y=R.find(e=>e.id===F),Z=Y?N(Y):X,ee=
|
|
3
|
+
/* @__PURE__ */h("button",{type:"button",onClick:V.toggle,"aria-pressed":V.playing,title:V.playing?z.pause:z.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[V.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
|
|
4
|
+
/* @__PURE__ */b("span",{children:V.playing?z.pause:z.play})]}),te=j&&(S??Z)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{V.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:S??z.backTo(String(Z))}):null,[re,ne]=p(z.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:L?/* @__PURE__ */h(y,{children:[e&&re,
|
|
5
|
+
/* @__PURE__ */b("b",{className:"font-medium",children:N(L)}),e&&ne,
|
|
6
|
+
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",J(new Date(L.date).getTime())," · ",z.overall(Math.round(W))," · ",z.inStock(U)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:z.noReport})});if("rail"===x){const e=null!=H&&H>=q&&q>O,t=e?{key:"__estimate__",label:z.estimatedCompletion,dateText:J(H)}:null;/* @__PURE__ */
|
|
7
7
|
return h("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
|
|
8
|
-
/* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:
|
|
8
|
+
/* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:R,markers:D,valueMs:T,activeId:L?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??z.start,end:M?.end??(e?z.estDone:void 0)},onDragStart:V.stop,playback:{playing:V.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:V.stop}}),
|
|
9
9
|
/* @__PURE__ */h("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[ee,te,ae(!1)]})]})}/* @__PURE__ */
|
|
10
|
-
return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:
|
|
11
|
-
/* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[
|
|
10
|
+
return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:G,subject:P,meta:[`${J(O)} → ${J(q)}`,z.leadTime(A)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
|
|
11
|
+
/* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[R.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
12
12
|
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),z.report]}),B.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
13
13
|
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),z.shipment]}),K.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
14
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),z.inspection]}),
|
|
15
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),z.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:
|
|
14
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),z.inspection]}),Q.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
15
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),z.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:R,markers:D,valueMs:T,activeId:L?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:V.stop,playback:{playing:V.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:V.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="8.6.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellStrings as t,useShellLocale as e}from"./chunk-
|
|
1
|
+
import{useShellStrings as t,useShellLocale as e}from"./chunk-OVNRVFWS.js";import{formatPlain as a}from"./chunk-C3QOHMR6.js";import{jsxs as n,jsx as r}from"react/jsx-runtime";var o="inline-flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-40";function l({page:l,pageCount:i,onPageChange:s,siblingCount:c=1,showEdges:b=!1,className:u=""}){const d=t().pagination,g=e();if(i<=1)return null;const m=function(t,e,a){const n=/* @__PURE__ */new Set([1,e]);for(let r=t-a;r<=t+a;r++)r>=1&&r<=e&&n.add(r);const r=[...n].sort((t,e)=>t-e),o=[];let l=0;for(const t of r)l&&t-l>1&&o.push("…"),o.push(t),l=t;return o}(l,i,c),p=t=>{t>=1&&t<=i&&t!==l&&s(t)};/* @__PURE__ */
|
|
2
2
|
return n("nav",{"aria-label":d.label,className:`flex items-center gap-1 ${u}`.trim(),children:[b&&/* @__PURE__ */r("button",{type:"button","aria-label":d.first,disabled:1===l,onClick:()=>p(1),className:`${o} text-gray-600 hover:bg-gray-100`,children:"«"}),
|
|
3
3
|
/* @__PURE__ */r("button",{type:"button","aria-label":d.previous,disabled:1===l,onClick:()=>p(l-1),className:`${o} text-gray-600 hover:bg-gray-100`,children:"‹"}),m.map((t,e)=>"…"===t?/* @__PURE__ */r("span",{className:"px-1 text-gray-400",children:"…"},`gap-${e}`):/* @__PURE__ */r("button",{type:"button","aria-current":t===l?"page":void 0,onClick:()=>p(t),className:`${o} ${t===l?"bg-blue-600 font-medium text-white":"text-gray-700 hover:bg-gray-100"}`,children:a(t,g)},t)),
|
|
4
4
|
/* @__PURE__ */r("button",{type:"button","aria-label":d.next,disabled:l===i,onClick:()=>p(l+1),className:`${o} text-gray-600 hover:bg-gray-100`,children:"›"}),b&&/* @__PURE__ */r("button",{type:"button","aria-label":d.last,disabled:l===i,onClick:()=>p(i),className:`${o} text-gray-600 hover:bg-gray-100`,children:"»"})]})}export{l as Pagination};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{ChartTooltip as l}from"./chunk-P5BOTIJU.js";import{CartesianPlot as t}from"./chunk-PPSIMRJM.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as n}from"./chunk-OVNRVFWS.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{jsx as s,jsxs as m,Fragment as c}from"react/jsx-runtime";function u({rows:u,labels:d,variant:p="area",curve:f="linear",height:k=220,width:g,max:b,min:x,formatValue:w,yAxisLabel:y,color:j,tone:v,label:L,className:M,emptyLabel:O,radius:N=3}){const V=o().charts,F=n(),P=w??(e=>h(e,F)),R=L??V.range,W=u.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),A=r(0,j,v);/* @__PURE__ */
|
|
2
|
+
return s(t,{labels:d,values:W,height:k,width:g,max:b,min:x,formatValue:P,yAxisLabel:y,className:M,emptyLabel:O,bandPadding:"bar"===p?.34:0,ariaLabel:V.rangeLabel(R,d.length),tooltip:e=>/* @__PURE__ */s(l,{title:d[e],rows:[{key:"high",label:V.high,color:A,value:null==u[e]?void 0:P(u[e].high)},{key:"low",label:V.low,color:A,value:null==u[e]?void 0:P(u[e].low)}]}),children:({x:l,y:t,active:r})=>"bar"===p?/* @__PURE__ */s("g",{children:u.map((e,i)=>/* @__PURE__ */s("rect",{x:l(i),y:t(e.high),width:Math.max(1,l.bandwidth),height:Math.max(1,t(e.low)-t(e.high)),rx:N,fill:A,fillOpacity:null===r||r===i?.85:.4},i))}):/* @__PURE__ */m("g",{children:[(()=>{const r=u.map((e,i)=>[l.center(i),t(e.high)]),a=u.map((e,i)=>[l.center(i),t(e.low)]);/* @__PURE__ */
|
|
3
|
+
return m(c,{children:[
|
|
4
|
+
/* @__PURE__ */s("path",{d:e(i(r,f),a),fill:A,fillOpacity:.2,stroke:"none"}),
|
|
5
|
+
/* @__PURE__ */s("path",{d:i(r,f),fill:"none",stroke:A,strokeWidth:2,strokeLinejoin:"round"}),
|
|
6
|
+
/* @__PURE__ */s("path",{d:i(a,f),fill:"none",stroke:A,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==r&&/* @__PURE__ */s("line",{x1:l.center(r),y1:t(u[r].high),x2:l.center(r),y2:t(u[r].low),stroke:a.axis,strokeWidth:1})]})})}export{u as RangeChart};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Tooltip as e}from"./chunk-Z3WKHMVB.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as t}from"./chunk-
|
|
2
|
-
return s(e,{content:z??
|
|
1
|
+
import{Tooltip as e}from"./chunk-Z3WKHMVB.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as t}from"./chunk-OVNRVFWS.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const N="horizontal"===h,P=t().resizeHandle,k=o(null),M=o({onResize:d,min:f,max:p,side:m});M.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const D=i(()=>{k.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>D,[D]);const C=e=>{k.current&&(e.currentTarget.hasPointerCapture?.(k.current.pointer)&&e.currentTarget.releasePointerCapture(k.current.pointer),D())},I="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",R="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",T=N?`absolute inset-x-0 ${I} z-10 flex h-2`:`absolute inset-y-0 ${I} z-10 flex w-2`;/* @__PURE__ */
|
|
2
|
+
return s(e,{content:z??P.hint,side:R,delay:600,className:`${T} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??P.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),k.current={x:N?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=N?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=k.current;if(!r)return;if(0===e.buttons)return void D();const t=(N?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=M.current;o(l(r.width,t,s,n,i))},onPointerUp:C,onPointerCancel:C,onLostPointerCapture:()=>{k.current&&D()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=N?"ArrowDown":"ArrowRight",t=N?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:N?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:N?`absolute inset-x-0 ${I} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${I} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{calendarNames as e,firstDayOfWeek as t}from"./chunk-5OTS2G3M.js";import{Icon as r}from"./chunk-C2HHGLLR.js";import{useBrowserValue as a}from"./chunk-D65T4H6J.js";import{useShellStrings as n,useShellLocale as o}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-C2HHGLLR.js";import{useBrowserValue as a}from"./chunk-D65T4H6J.js";import{useShellStrings as n,useShellLocale as o}from"./chunk-OVNRVFWS.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":q,className:H=""}){const O=l(()=>new Set(A??[]),[A]),P=f(h),K=a(v,null),L=f(K),R=n().calendar,T=o(),V=e(T),W=a(()=>t(T),0),E=S??W,G=()=>{if(!L)return null;const e=y(L);return M&&e<M.slice(0,7)?M.slice(0,7):Y&&e>Y.slice(0,7)?Y.slice(0,7):e},[J,U]=i(()=>F||(P?y(P):G())),B=k??J??G(),I=null===B?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(B,L),[z,Q]=i(()=>h??K),X=s(null),Z=s(!1),[_,ee]=i("days"),te=l(()=>I?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))}(I,E):[],[B,E]),re=e=>!!M&&e<M||!!Y&&e>Y,ae=z??K,ne=te.some(e=>b(e)===ae),oe=I?te.find(e=>e.getMonth()===I.getMonth())??te[0]:null,le=ne&&ae?ae:oe?b(oe):"";if(c(()=>{Z.current&&(Z.current=!1,X.current?.querySelector('[data-active="true"]')?.focus())},[le,B]),!I)/* @__PURE__ */
|
|
2
|
+
return u("div",{className:H,"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(I.getFullYear()+12*e,I.getMonth(),1):"months"===_?new Date(I.getFullYear()+e,I.getMonth(),1):x(I,e),se=e=>{const t=y(e);void 0===k&&U(t),j?.(t)},ce=q??V.monthYear(I.getFullYear(),I.getMonth());/* @__PURE__ */
|
|
5
|
+
return u("div",{className:H,children:[
|
|
6
6
|
/* @__PURE__ */u("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
7
|
-
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?
|
|
8
|
-
/* @__PURE__ */g("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children
|
|
9
|
-
/* @__PURE__ */g("button",{type:"button","aria-label":
|
|
10
|
-
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?
|
|
11
|
-
/* @__PURE__ */u("div",{ref:
|
|
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":
|
|
14
|
-
return g("div",{role:"gridcell","aria-selected":a,"aria-label":
|
|
7
|
+
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?R.previousYears:"months"===_?R.previousYear:R.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":R.chooseMonth(V.months[I.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:V.months[I.getMonth()]}),
|
|
9
|
+
/* @__PURE__ */g("button",{type:"button","aria-label":R.chooseYear(I.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:I.getFullYear()})]}):/* @__PURE__ */g("span",{children:V.monthYear(I.getFullYear(),I.getMonth())})}),
|
|
10
|
+
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?R.nextYears:"months"===_?R.nextYear:R.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":R.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:V.monthsShort.map((e,t)=>/* @__PURE__ */g("button",{type:"button","aria-pressed":t===I.getMonth(),onClick:()=>{se(new Date(I.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===I.getMonth()?"bg-blue-600 font-semibold text-white":L&&t===L.getMonth()&&I.getFullYear()===L.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":R.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=I.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */g("button",{type:"button","aria-pressed":e===I.getFullYear(),onClick:()=>{se(new Date(e,I.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===I.getFullYear()?"bg-blue-600 font-semibold text-white":e===L?.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)??L??I,r={ArrowLeft:()=>p(t,-1),ArrowRight:()=>p(t,1),ArrowUp:()=>p(t,-7),ArrowDown:()=>p(t,7),Home:()=>p(t,-(t.getDay()-E+7)%7),End:()=>p(t,6-(t.getDay()-E+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)!==B&&se(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),C||re(le)||D(le))},hidden:"days"!==_,children:[
|
|
12
|
+
/* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-xs font-medium text-gray-500`,children:Array.from({length:7},(e,t)=>(t+E)%7).map(e=>
|
|
13
|
+
/* @__PURE__ */g("div",{role:"columnheader","aria-label":V.weekdays[e],className:"py-1",children:/* @__PURE__ */g("abbr",{title:V.weekdays[e],className:"no-underline",children:V.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()!==I.getMonth(),a=t===h||"range"===N&&t===w,n=(e=>!("range"!==N||!h||!w)&&e>h&&e<w)(t),o=re(t),l=V.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!==K||a?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),s=O.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===K?"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,8 +1,8 @@
|
|
|
1
|
-
import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as o}from"./chunk-C2HHGLLR.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as a}from"./chunk-
|
|
2
|
-
return h("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */h(o,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function p({open:o,onClose:a,side:p="right",size:x="md",title:g,description:y,footer:v,children:
|
|
1
|
+
import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as o}from"./chunk-C2HHGLLR.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as a}from"./chunk-OVNRVFWS.js";import{useRef as n,useId as d,useEffect as c}from"react";import{jsxs as m,jsx as h}from"react/jsx-runtime";var f={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},u={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function b({onClose:e}){const r=a().dialog;/* @__PURE__ */
|
|
2
|
+
return h("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */h(o,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function p({open:o,onClose:a,side:p="right",size:x="md",title:g,description:y,footer:v,children:N,blocking:k=!1,initialFocus:j,"aria-label":w,"aria-labelledby":C,"aria-describedby":L,className:W=""}){const V=n(null),z=d(),D=d(),G=d();if(r(o),i(V,o,j),t(o),c(()=>{if(o)return s(()=>(k||a(),!0),()=>V.current)},[o,k,a]),!o)return null;const H="bottom"===p,R=H?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
|
|
3
3
|
return m("div",{className:"fixed inset-0",style:{zIndex:l.overlay},role:"presentation",children:[
|
|
4
|
-
/* @__PURE__ */h("div",{className:"fixed inset-0 bg-black/30",onClick:
|
|
5
|
-
/* @__PURE__ */m("div",{ref:
|
|
4
|
+
/* @__PURE__ */h("div",{className:"fixed inset-0 bg-black/30",onClick:k?void 0:a,"aria-hidden":"true"}),
|
|
5
|
+
/* @__PURE__ */m("div",{ref:V,...e({modal:!0,titleId:g?G:void 0,labelledBy:C,label:w}),"aria-describedby":L??(y?D:N?z:void 0),style:R,className:["fixed flex flex-col bg-white shadow-xl",H?"":`w-full max-w-full ${f[x]}`,u[p],H?"rounded-t-xl":"",W].filter(Boolean).join(" "),children:[g?/* @__PURE__ */m("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
6
6
|
/* @__PURE__ */m("div",{className:"min-w-0",children:[
|
|
7
|
-
/* @__PURE__ */h("h2",{id:
|
|
8
|
-
/* @__PURE__ */m("div",{id:
|
|
7
|
+
/* @__PURE__ */h("h2",{id:G,className:"text-base font-semibold text-gray-900",children:g}),y&&/* @__PURE__ */h("p",{id:D,className:"mt-0.5 text-sm text-gray-500",children:y})]}),!k&&/* @__PURE__ */h(b,{onClose:a})]}):!k&&/* @__PURE__ */h("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */h(b,{onClose:a})}),
|
|
8
|
+
/* @__PURE__ */m("div",{id:z,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[y&&!g&&/* @__PURE__ */h("p",{id:D,className:("mb-3 text-sm text-gray-500 "+(k?"":"pr-8")).trim(),children:y}),N]}),v&&/* @__PURE__ */h("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:v})]})]})}export{p as Drawer};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{MOTION as e,stagger as a}from"./chunk-465RRWBY.js";import{autoHighlightIndex as t}from"./chunk-CNYAHYE6.js";import{seriesColor as s,STATUS_VARS as l,CHART_INK as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as r}from"./chunk-
|
|
2
|
-
return o("p",{className:`text-sm text-gray-500 ${k??""}`,children:
|
|
1
|
+
import{MOTION as e,stagger as a}from"./chunk-465RRWBY.js";import{autoHighlightIndex as t}from"./chunk-CNYAHYE6.js";import{seriesColor as s,STATUS_VARS as l,CHART_INK as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as r}from"./chunk-OVNRVFWS.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{jsx as o,jsxs as h}from"react/jsx-runtime";function c({rows:c,max:u,formatValue:d,emphasisKey:p,highlight:g="none",emphasisTone:x,barHeight:f=12,rowGap:y=30,animate:b=!0,labelFont:N="sans",className:k,emptyLabel:v}){const $=i().charts,j=r(),w=d??(e=>m(e,j)),F=v??$.nothingToRank;if(0===c.length)/* @__PURE__ */
|
|
2
|
+
return o("p",{className:`text-sm text-gray-500 ${k??""}`,children:F});const M=t(c.map(e=>e.value),g),R=p??(null===M?void 0:c[M]?.key),C=u??Math.max(...c.map(e=>e.value).filter(Number.isFinite),0),H=s(0);/* @__PURE__ */
|
|
3
3
|
return o("ol",{className:`m-0 list-none p-0 ${k??""}`,style:{display:"grid",rowGap:`${Math.max(4,y-f)}px`},children:c.map((t,i)=>{const r=t.key===R,m=r?x?l[x]:s(1):R?n.muted:H,c=Number.isFinite(t.value)?t.value:null,u=null!==c&&C>0?Math.max(0,Math.min(1,c/C)):0;/* @__PURE__ */
|
|
4
4
|
return h("li",{className:"grid gap-1",children:[
|
|
5
5
|
/* @__PURE__ */h("div",{className:"flex items-baseline justify-between gap-3",children:[
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ChartTooltip as t}from"./chunk-P5BOTIJU.js";import{CartesianPlot as o}from"./chunk-PPSIMRJM.js";import{binValues as r}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as e,useShellLocale as i}from"./chunk-OVNRVFWS.js";import{formatPlain as m,formatFixed as n}from"./chunk-C3QOHMR6.js";import{jsx as l}from"react/jsx-runtime";function c({values:c,bins:s=10,precomputed:h,height:u=220,width:p,color:b,tone:f,formatBound:d,formatCount:x,yAxisLabel:g,label:k,className:y,emptyLabel:j}){const M=e().charts,v=i(),w=d??(t=>Number.isInteger(t)?m(t,v):n(t,1,v)),A=x??(t=>m(t,v)),L=g??M.countAxis,N=k??M.distribution,P=h??r(c??[],s),R=a(0,b,f),O=P.map(t=>w(t.from)),C=P.map(t=>t.count);/* @__PURE__ */
|
|
2
|
+
return l(o,{labels:O,values:C,height:u,width:p,bandPadding:0,xTickAnchor:"start",formatValue:A,yAxisLabel:L,className:y,emptyLabel:j,ariaLabel:M.histogram(N,P.length,(c??[]).length),tooltip:o=>/* @__PURE__ */l(t,{title:`${w(P[o].from)} – ${w(P[o].to)}`,rows:[{key:"count",label:M.observations,color:R,value:A(P[o].count)}]}),children:({x:t,y:o,bottom:r,active:a})=>/* @__PURE__ */l("g",{children:P.map((e,i)=>/* @__PURE__ */l("rect",{x:t(i)+.5,y:o(e.count),width:Math.max(1,t.bandwidth-1),height:Math.max(0,r-o(e.count)),fill:R,fillOpacity:null===a||a===i?.85:.42},i))})})}export{c as HistogramChart};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{TICK_INK as e}from"./chunk-URBCGEXG.js";import{useShellStrings as n}from"./chunk-OVNRVFWS.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";function a({ink:e}){/* @__PURE__ */
|
|
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
|
+
return r("div",{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-gray-500 ${l}`.trim(),children:[
|
|
4
|
+
/* @__PURE__ */r("span",{className:"inline-flex items-center gap-1",children:[
|
|
5
|
+
/* @__PURE__ */i(a,{ink:e.warning}),c.legendWarning]}),
|
|
6
|
+
/* @__PURE__ */r("span",{className:"inline-flex items-center gap-1",children:[
|
|
7
|
+
/* @__PURE__ */i(a,{ink:e.critical}),c.legendCritical]}),t&&/* @__PURE__ */i("a",{href:t.href,onClick:t.onClick,className:"text-blue-600 hover:underline",children:t.label})]})}export{t as MetricBarLegend};
|