efficient-shell 10.22.0 → 10.24.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 +16 -4
- package/dist/{Browser-XQ5GO3LJ.js → Browser-KUFFOGYK.js} +14 -14
- package/dist/Calculator-LENRW34X.js +29 -0
- package/dist/CurrencyConverter-7UMHQS2V.js +21 -0
- package/dist/{Documents-7GOEAIJ6.js → Documents-ODZ4AAOY.js} +20 -20
- package/dist/{Files-MMVUWO5F.js → Files-BRGTTI2J.js} +46 -46
- package/dist/Notepad-RMRDEGGU.js +24 -0
- package/dist/PomodoroTimer-4566W4F7.js +91 -0
- package/dist/{Preview-DEK7WTAU.js → Preview-7POJP7PB.js} +33 -33
- package/dist/Sidebar-TU4QCKYJ.js +44 -0
- package/dist/Spreadsheet-7T4VT5IO.js +37 -0
- package/dist/{Stock-XHMTFEOL.js → Stock-H73C4R3N.js} +4 -4
- package/dist/{Weather-X5WAHYQ3.js → Weather-WF56QCBI.js} +20 -20
- package/dist/{WorldClock-ARU7PMVZ.js → WorldClock-5QJNZYYS.js} +6 -6
- package/dist/ai/index.js +91 -91
- package/dist/api/shellHttp.d.ts +52 -0
- package/dist/api/shellHttp.js +1 -0
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/ChartTooltip.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/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/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.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-2QY5BJLA.js +2 -0
- package/dist/{chunk-3PO4D32J.js → chunk-36PJGT4W.js} +1 -1
- package/dist/{chunk-AGPPZHAH.js → chunk-36VIGB6J.js} +1 -1
- package/dist/{chunk-C4CAPG3D.js → chunk-3BFZVVAT.js} +1 -1
- package/dist/chunk-3C5NKOVF.js +1 -0
- package/dist/chunk-3FBDLIQW.js +99 -0
- package/dist/chunk-4BCFBF3C.js +9 -0
- package/dist/chunk-4EBJO7ER.js +15 -0
- package/dist/chunk-4LXCCZDM.js +1 -0
- package/dist/{chunk-YICFH5KO.js → chunk-4P3324KU.js} +1 -1
- package/dist/chunk-4P57TIFK.js +2 -0
- package/dist/{chunk-QDJQ43N4.js → chunk-4RGMRXYH.js} +1 -1
- package/dist/{chunk-6V4INP7J.js → chunk-4TYIYL56.js} +4 -4
- package/dist/{chunk-P22NWAFW.js → chunk-55AEZX6K.js} +1 -1
- package/dist/chunk-5DIGYJHD.js +1 -0
- package/dist/{chunk-BB6A5MGA.js → chunk-5FYDNH4Y.js} +1 -1
- package/dist/{chunk-U2RFKQVA.js → chunk-5H4SWQGM.js} +1 -1
- package/dist/{chunk-KABWJIY4.js → chunk-5PP435FL.js} +1 -1
- package/dist/{chunk-BWTK3NUD.js → chunk-6IOFNPR6.js} +4 -4
- package/dist/{chunk-OBNA7GF5.js → chunk-6M5O2P64.js} +9 -9
- package/dist/{chunk-P3LKCOB4.js → chunk-7FW2BQTV.js} +2 -2
- package/dist/{chunk-SRYX6AQ6.js → chunk-7JVGF555.js} +1 -1
- package/dist/{chunk-ARSOETMP.js → chunk-7KWYVQMX.js} +1 -1
- package/dist/chunk-7LU3H72S.js +7 -0
- package/dist/chunk-7RP7QTRF.js +12 -0
- package/dist/{chunk-AKBGUMLI.js → chunk-A6FR2D46.js} +5 -5
- package/dist/{chunk-RAMJFT3D.js → chunk-AFG34RBV.js} +5 -5
- package/dist/{chunk-5JCHYQYI.js → chunk-ALTBTO3Z.js} +3 -3
- package/dist/chunk-ATMJ5ZPK.js +1 -0
- package/dist/{chunk-PWUPLXSS.js → chunk-BBXFIBXB.js} +1 -1
- package/dist/{chunk-EE56C2JH.js → chunk-BMXTPJ7T.js} +5 -5
- package/dist/{chunk-O64PY7ZJ.js → chunk-BUO7XCYR.js} +11 -11
- package/dist/{chunk-LJHVEISA.js → chunk-CH3JQUDW.js} +6 -6
- package/dist/{chunk-DLOJSJWL.js → chunk-CIHR5ZKF.js} +1 -1
- package/dist/{chunk-E5H5OU3A.js → chunk-COF33H6J.js} +5 -5
- package/dist/{chunk-GGRD2JLB.js → chunk-CQEVJG43.js} +1 -1
- package/dist/{chunk-WHISJI5L.js → chunk-CX4XR4HO.js} +1 -1
- package/dist/{chunk-XDCHB6JA.js → chunk-DGWS4GTI.js} +1 -1
- package/dist/{chunk-RXO2LNIB.js → chunk-DIEH76MB.js} +1 -1
- package/dist/{chunk-PJBZ5B54.js → chunk-DOF56HTO.js} +5 -5
- package/dist/{chunk-CGP2QCIA.js → chunk-DRUQH4ZE.js} +2 -2
- package/dist/{chunk-KGVNRLWT.js → chunk-DVYIBJ3S.js} +2 -2
- package/dist/{chunk-5DIBDRB6.js → chunk-DWAA4YZV.js} +3 -3
- package/dist/{chunk-4BPIGS2D.js → chunk-DZOJQURG.js} +6 -6
- package/dist/{chunk-7SMDYBQX.js → chunk-E3EJWNNK.js} +8 -8
- package/dist/chunk-E6FDUFPH.js +1 -0
- package/dist/chunk-EH2BNSG3.js +13 -0
- package/dist/chunk-EOVXFXVV.js +2 -0
- package/dist/chunk-EXLHFM3V.js +6 -0
- package/dist/chunk-F3ZOO23R.js +1 -0
- package/dist/{chunk-L67WTASI.js → chunk-FUDUQ44A.js} +1 -1
- package/dist/{chunk-N2RIQ2OU.js → chunk-FZM3ZPW3.js} +1 -1
- package/dist/{chunk-VQIG5N6D.js → chunk-G66SG6JN.js} +9 -9
- package/dist/{chunk-GCC2OZDG.js → chunk-GC3DA6D6.js} +1 -1
- package/dist/{chunk-QA3EAJ5H.js → chunk-GOXQJCXG.js} +17 -17
- package/dist/{chunk-XAPHUSOR.js → chunk-H475WZPF.js} +16 -16
- package/dist/{chunk-53DO72B2.js → chunk-H5NIW2KS.js} +1 -1
- package/dist/chunk-HNVSVTNC.js +16 -0
- package/dist/{chunk-ET4726WV.js → chunk-IHNOWRTP.js} +2 -2
- package/dist/{chunk-QZMGWRZ4.js → chunk-IPO4LHSB.js} +6 -6
- package/dist/{chunk-E5QPXEKN.js → chunk-JFBL4PR3.js} +1 -1
- package/dist/chunk-JPOYR5AO.js +7 -0
- package/dist/{chunk-BJRJODRZ.js → chunk-LCSMBVMU.js} +1 -1
- package/dist/{chunk-WVCX2Y3S.js → chunk-LE5LWALR.js} +1 -1
- package/dist/chunk-LNXBTK7Q.js +1 -0
- package/dist/{chunk-HC2AM2DT.js → chunk-MCAPJSB6.js} +1 -1
- package/dist/{chunk-REWKL7MX.js → chunk-MDYJVXWD.js} +2 -2
- package/dist/chunk-MHPFBVDD.js +8 -0
- package/dist/{chunk-NS2HY4NL.js → chunk-N5KO2IHG.js} +4 -4
- package/dist/{chunk-22LRMKLV.js → chunk-NJN5IKWO.js} +6 -6
- package/dist/{chunk-HWKAFISI.js → chunk-NRALUW6P.js} +7 -7
- package/dist/{chunk-SETRKP7W.js → chunk-NWC6YCIJ.js} +10 -10
- package/dist/{chunk-WE3HINW3.js → chunk-NZ34BQKH.js} +1 -1
- package/dist/{chunk-H2C5SZKO.js → chunk-NZ7BFYCM.js} +1 -1
- package/dist/chunk-O3MBPAWZ.js +2 -0
- package/dist/{chunk-6XYGA252.js → chunk-O7RR2ZZ2.js} +6 -6
- package/dist/{chunk-SAGI7AWC.js → chunk-OKHKY3ZZ.js} +1 -1
- package/dist/{chunk-KLAKLVKE.js → chunk-OTITQ3IH.js} +12 -12
- package/dist/{chunk-WSMRVWWK.js → chunk-P7H2DXJB.js} +10 -10
- package/dist/chunk-PSR6SXCC.js +14 -0
- package/dist/{chunk-AFBBNGVO.js → chunk-PVDZG2U2.js} +7 -7
- package/dist/{chunk-Q5WPHBDB.js → chunk-QGWKM7C3.js} +5 -5
- package/dist/{chunk-GEDS6QO7.js → chunk-QRU55BUS.js} +2 -2
- package/dist/{chunk-A46WK67X.js → chunk-QWCEKHAP.js} +4 -4
- package/dist/{chunk-DOWE3ZQR.js → chunk-RDKIYORS.js} +1 -1
- package/dist/{chunk-D6ZXMKW2.js → chunk-RSOBUPLK.js} +1 -1
- package/dist/{chunk-F3ZH6UCW.js → chunk-RZQGPWSN.js} +1 -1
- package/dist/{chunk-NWUAATIX.js → chunk-S4FPYCUU.js} +3 -3
- package/dist/chunk-S5DYR75A.js +29 -0
- package/dist/chunk-STKJA4PV.js +1 -0
- package/dist/{chunk-OAVU46YG.js → chunk-TDAI4J27.js} +4 -4
- package/dist/{chunk-WJ6ZJVAX.js → chunk-TE6R53YD.js} +1 -1
- package/dist/{chunk-GIK62TW6.js → chunk-TFSLPAGB.js} +3 -3
- package/dist/chunk-TNJ2VCH4.js +8 -0
- package/dist/{chunk-7XNDWW3Y.js → chunk-U44DVPGB.js} +1 -1
- package/dist/{chunk-ZTV2BA3P.js → chunk-U6LKNGC6.js} +1 -1
- package/dist/chunk-UKBXQXDZ.js +1 -0
- package/dist/chunk-ULJQYXHB.js +1 -0
- package/dist/{chunk-CIYMGVZC.js → chunk-UNQ54QOF.js} +1 -1
- package/dist/chunk-UPXDDO3U.js +1 -0
- package/dist/{chunk-C2ZUYCIM.js → chunk-USVL5SLG.js} +1 -1
- package/dist/chunk-USWA6YNZ.js +3 -0
- package/dist/{chunk-CIXGYZCF.js → chunk-V2J2AHDW.js} +4 -4
- package/dist/chunk-VX4COEWP.js +4 -0
- package/dist/{chunk-VXQQQDJ3.js → chunk-VX6TKEEK.js} +1 -1
- package/dist/{chunk-NTVOQHRS.js → chunk-WDQEUNGE.js} +1 -1
- package/dist/{chunk-GLE4F5FT.js → chunk-WGLHB6WE.js} +1 -1
- package/dist/{chunk-MW3FT4WI.js → chunk-WL4U4MTQ.js} +3 -3
- package/dist/{chunk-NPGFCIHB.js → chunk-WLYYC3AP.js} +1 -1
- package/dist/{chunk-GCP3LGRG.js → chunk-WOAMPTZI.js} +14 -14
- package/dist/{chunk-FHYETY4V.js → chunk-XBHXGBJR.js} +1 -1
- package/dist/{chunk-VKP2WRJJ.js → chunk-XCAUDTCC.js} +8 -8
- package/dist/chunk-XFH64VIG.js +19 -0
- package/dist/chunk-XXL5RLNM.js +22 -0
- package/dist/{chunk-6CICYVCK.js → chunk-YQOVUH5W.js} +8 -8
- package/dist/{chunk-WUMPTKOG.js → chunk-Z3SLQKE6.js} +1 -1
- package/dist/{chunk-4UHAQMOT.js → chunk-Z44JWU75.js} +2 -2
- package/dist/{chunk-UXPKCDEF.js → chunk-Z6GQFTLJ.js} +1 -1
- package/dist/{chunk-TBQLPMW5.js → chunk-ZRLWE3JM.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.d.ts +125 -0
- package/dist/data/EntityList.js +2 -0
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ResizableTable.d.ts +31 -0
- package/dist/data/ResizableTable.js +2 -0
- package/dist/data/useColumnConfig.d.ts +68 -0
- package/dist/data/useColumnConfig.js +2 -0
- package/dist/data/useSort.d.ts +55 -0
- package/dist/data/useSort.js +2 -0
- package/dist/data/useTableNav.d.ts +28 -0
- package/dist/data/useTableNav.js +2 -0
- package/dist/format/index.d.ts +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/hooks/useRootIsDark.d.ts +3 -0
- package/dist/hooks/useRootIsDark.js +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/payment.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +13 -317
- package/dist/index.js +667 -694
- package/dist/map/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.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/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.js +2 -0
- package/dist/ui/index.d.ts +6 -0
- package/dist/ui/index.js +1 -1
- package/dist/utils/glass.js +1 -1
- package/dist/utils/rootTheme.d.ts +13 -1
- package/dist/utils/rootTheme.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -1
- package/dist/Calculator-X62IAKQY.js +0 -29
- package/dist/CurrencyConverter-PSOBQ6K2.js +0 -21
- package/dist/Notepad-FAQBAF36.js +0 -24
- package/dist/PomodoroTimer-ZLS6XCTN.js +0 -91
- package/dist/Sidebar-JF2KEJT2.js +0 -44
- package/dist/Spreadsheet-6C7Q6OQA.js +0 -37
- package/dist/chunk-4DO47TT5.js +0 -1
- package/dist/chunk-5532S4RN.js +0 -4
- package/dist/chunk-5R4X7MFQ.js +0 -1
- package/dist/chunk-5XKCOKYJ.js +0 -1
- package/dist/chunk-CY5N5OA3.js +0 -2
- package/dist/chunk-F7U5MVNH.js +0 -2
- package/dist/chunk-FX4KK5GE.js +0 -3
- package/dist/chunk-GCMCXRIN.js +0 -19
- package/dist/chunk-H43BVPNN.js +0 -7
- package/dist/chunk-IWOVB4WI.js +0 -9
- package/dist/chunk-LIULEXWE.js +0 -14
- package/dist/chunk-LQVW3SW4.js +0 -6
- package/dist/chunk-NGRTW6Y7.js +0 -2
- package/dist/chunk-PBFFKRQF.js +0 -12
- package/dist/chunk-QFJIMX4A.js +0 -15
- package/dist/chunk-QIMFBARF.js +0 -8
- package/dist/chunk-RRGMXY46.js +0 -29
- package/dist/chunk-TLJWBRLI.js +0 -8
- package/dist/chunk-URQWWOHM.js +0 -7
- package/dist/chunk-WBJ6KNUF.js +0 -1
- package/dist/chunk-WEPQU5W6.js +0 -22
- package/dist/chunk-ZT45XXIB.js +0 -100
- /package/dist/{chunk-CSA6CGXS.js → chunk-RKLZDVAO.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{optionMatches as e,OptionSublabel as t}from"./chunk-LJN77RG6.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-
|
|
2
|
-
return g("div",{ref:
|
|
3
|
-
/* @__PURE__ */g("div",{onMouseDown:e=>{
|
|
4
|
-
/* @__PURE__ */x("span",{className:"truncate",children:
|
|
5
|
-
/* @__PURE__ */x("input",{id:
|
|
6
|
-
/* @__PURE__ */x("div",{ref:S,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:
|
|
1
|
+
import{optionMatches as e,OptionSublabel as t}from"./chunk-LJN77RG6.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-FZM3ZPW3.js";import{Tooltip as r}from"./chunk-NJN5IKWO.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as s,POPUP_MAX_WIDTH as a,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-5FYDNH4Y.js";import{useShellStrings as d}from"./chunk-GDQJBQ5B.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as v}from"react-dom";import{jsxs as g,jsx as x,Fragment as b}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-accent-tint px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${o.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:o,onChange:y,options:k=[],placeholder:N,allowFreeText:j=!1,invalid:C,disabled:L,id:D,className:W="",tone:B,tooltip:E,split:J}){const[M,Y]=m(!1),[$,F]=m(""),G=d(),H=h(null),I=h(null),S=h(null),Z=s(H,M),K=e=>k.find(t=>t.value===e)?.label??e,P=p(()=>{const t=new Set(o),n=[],r=$.trim().toLowerCase();for(const o of k)t.has(o.value)||(t.add(o.value),r&&!e(o,r)||n.push(o));return n},[k,o,$]),Q=e=>{const t=[...o];for(const n of e){const e=n.trim();if(!e)continue;const o=e.toLowerCase(),r=k.find(t=>t.value===e||t.label.toLowerCase()===o)?.value,l=r??(j?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==o.length&&y(t)},T=e=>{e&&!o.includes(e)?(y([...o,e]),F("")):F("")},z=e=>y(o.filter(t=>t!==e)),A=()=>{const e=$.trim();if(J&&e)return Q(e.split(J)),void F("");j&&e?T(e):F("")},O=h(()=>{});O.current=()=>{A(),Y(!1)},f(()=>{if(!M)return;const e=e=>{const t=e.target;H.current?.contains(t)||S.current?.contains(t)||(A(),Y(!1))};document.addEventListener("mousedown",e);const t=l(()=>O.current());return()=>{document.removeEventListener("mousedown",e),t()}});const R=k.length>0;/* @__PURE__ */
|
|
2
|
+
return g("div",{ref:H,className:"relative",children:[
|
|
3
|
+
/* @__PURE__ */g("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),I.current?.focus())},className:n({invalid:C,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${L?"bg-gray-50 cursor-not-allowed":""} ${W}`}),children:[o.map(e=>{const t=B?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
+
/* @__PURE__ */x("span",{className:"truncate",children:K(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":G.select.removeItem?.(K(e))??`${G.select.remove} ${K(e)}`,onClick:()=>z(e),className:n.remove,children:"×"})]},e),l=E?.(e);return null==l?o:/* @__PURE__ */x(r,{content:l,className:"relative inline-flex max-w-full",children:o},e)}),
|
|
5
|
+
/* @__PURE__ */x("input",{id:D,ref:I,type:"text",autoComplete:"off",role:"combobox","aria-expanded":M&&R,"aria-invalid":C||void 0,disabled:L,value:$,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if(J){const t=e.split(J);if(t.length>1)return Q(t.slice(0,-1)),void F(t[t.length-1])}F(e)})(e.target.value),Y(!0)},onFocus:()=>{!L&&R&&Y(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=$.trim(),o=n?P.filter(t=>e(t,n.toLowerCase())):[];1===o.length?T(o[0].value):A()}else"Backspace"===t.key&&""===$&&o.length>0?z(o[o.length-1]):"Escape"===t.key?(Y(!1),F(""),I.current?.blur()):"Tab"===t.key&&(A(),Y(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-ink-strong placeholder:text-[color:var(--ink-placeholder)] rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),M&&R&&v(
|
|
6
|
+
/* @__PURE__ */x("div",{ref:S,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:Z?.left,right:Z?.right,top:Z?.top,bottom:Z?.bottom,minWidth:Z?.minWidth,maxWidth:Z?.maxWidth??a,width:"max-content",visibility:Z?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:Z?.maxHeight??c},children:0===P.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?G.select.allSelected:G.select.noMatches}):P.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),T(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-row-hover text-ink whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-row-hover text-ink whitespace-nowrap",children:e.sublabel?/* @__PURE__ */g(b,{children:[
|
|
7
7
|
/* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
|
|
8
8
|
/* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{PopupMenuDivider as e,PopupMenuLabel as l,menuTextRowStyle as t,PopupSubmenu as i,itemLook as a,MenuCheckMark as r}from"./chunk-
|
|
1
|
+
import{PopupMenuDivider as e,PopupMenuLabel as l,menuTextRowStyle as t,PopupSubmenu as i,itemLook as a,MenuCheckMark as r}from"./chunk-OTITQ3IH.js";import{jsx as n,jsxs as s}from"react/jsx-runtime";var d=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled,c=(e,l)=>`${e}-status-${l}`;function o(e,l){return e.flatMap((e,t)=>"status"===e.type?[c(l,t)]:[]).join(" ")||void 0}function u(d,o){const{menuId:y,choose:b,toggle:h,followLink:p,rowProps:m=()=>({}),linkAs:k}=o,f=k??"a",v=(d,k)=>{if("divider"===d.type)/* @__PURE__ */
|
|
2
2
|
return n("div",{role:"separator",children:/* @__PURE__ */n(e,{})},d.key);if("label"===d.type)/* @__PURE__ */
|
|
3
3
|
return n("div",{id:`${y}-label-${k}`,children:/* @__PURE__ */n(l,{children:d.label})},d.key);if("status"===d.type)/* @__PURE__ */
|
|
4
4
|
return n("div",{id:c(y,k),className:"text-xs",style:t(),children:d.label},d.key);if("submenu"===d.type)/* @__PURE__ */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{writeClipboard as e}from"./chunk-TMMNCXQT.js";import{IconButton_default as r}from"./chunk-
|
|
1
|
+
import{writeClipboard as e}from"./chunk-TMMNCXQT.js";import{IconButton_default as r}from"./chunk-LE5LWALR.js";import{toast_default as t}from"./chunk-7ELJQL7J.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{useShellStrings as a}from"./chunk-GDQJBQ5B.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
|
|
2
2
|
return s(n,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
|
|
3
|
-
return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:N=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":
|
|
4
|
-
return m("div",{id:
|
|
3
|
+
return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:N=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":L,className:B=""}){const[T,C]=i(!1),Q=o(null),J=a().copy;c(()=>()=>{Q.current&&clearTimeout(Q.current)},[]);const E=l(async()=>{await e(n)?(C(!0),Q.current&&clearTimeout(Q.current),Q.current=setTimeout(()=>{C(!1),Q.current=null},2e3),v?.(n)):t.error(J.failed)},[n,v,J]),{box:M,button:X}=p[g],z=!N;/* @__PURE__ */
|
|
4
|
+
return m("div",{id:z?void 0:j,"aria-describedby":z?void 0:L,className:["inline-flex max-w-full items-center rounded-md",u[k],M,B].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
|
|
5
5
|
/* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(w?"whitespace-pre-wrap break-all":"truncate"),title:w?void 0:n,children:y??n}),!N&&/* @__PURE__ */m(d,{children:[
|
|
6
|
-
/* @__PURE__ */s(r,{id:j,"aria-label":x?
|
|
7
|
-
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:T?
|
|
6
|
+
/* @__PURE__ */s(r,{id:j,"aria-label":x?J.copyLabel(x):J.copy,"aria-describedby":L,onClick:E,className:`${X} text-gray-400`,children:/* @__PURE__ */s(T?h:b,{})}),
|
|
7
|
+
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:T?J.copied:""})]})]})}export{y as Snippet};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-AFG34RBV.js";import{Avatar as t}from"./chunk-AFYLVV74.js";import{Input_default as a}from"./chunk-MAMWQCJ6.js";import{Button_default as i}from"./chunk-EOVXFXVV.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
|
|
3
3
|
/* @__PURE__ */n(t,{name:e.name,status:e.status}),
|
|
4
4
|
/* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-P3RXXWXN.js";import{Select_default as l}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-P3RXXWXN.js";import{Select_default as l}from"./chunk-XFH64VIG.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-ZGOHRLXG.js";import{Input_default as c}from"./chunk-MAMWQCJ6.js";import{Button_default as s}from"./chunk-EOVXFXVV.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
|
|
3
3
|
/* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
|
|
4
4
|
/* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-P3RXXWXN.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-MAMWQCJ6.js";import{Button_default as a}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-P3RXXWXN.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-MAMWQCJ6.js";import{Button_default as a}from"./chunk-EOVXFXVV.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
|
|
2
2
|
return c("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */n("div",{className:"w-full max-w-sm",children:[
|
|
3
3
|
/* @__PURE__ */n("div",{className:"mb-6 text-center",children:[
|
|
4
4
|
/* @__PURE__ */c("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Banner as e}from"./chunk-ZGOHRLXG.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{Banner as e}from"./chunk-ZGOHRLXG.js";import{Button_default as t}from"./chunk-EOVXFXVV.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
|
|
2
2
|
return o("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${u}`.trim(),children:/* @__PURE__ */a(e,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */o(t,{type:"button",variant:"primary",size:"md",onClick:f,children:p.update.refreshNow}),children:[
|
|
3
3
|
/* @__PURE__ */o("span",{className:"font-medium",children:l??p.update.available}),
|
|
4
4
|
/* @__PURE__ */a("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[r," → ",d]})]})})}export{s as APP_UPDATE_POLL_MS,l as AppUpdateBanner,c as useAppUpdate};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-
|
|
2
|
-
return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?
|
|
1
|
+
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-QRU55BUS.js";import{Tooltip as i}from"./chunk-NJN5IKWO.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:B=!1,className:M=""}){const R=l().widths,j=a(),z=m(Math.round(x)||1,1,n),S=e($,z),A=S??[...t[z]??[]],D=[...A,100-p(A)],K=P||B,O=s(null),T=s({onChange:k,shown:A,locked:K,n:z,stored:S});T.current={onChange:k,shown:A,locked:K,n:z,stored:S};const E=t=>{const{onChange:r,shown:n,locked:o,n:i}=T.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},I=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],E(i.slice(0,-1))&&(ne.current=null)},U=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=D[e]+D[e+1],i="ArrowRight"===t.key?D[e]+n:"ArrowLeft"===t.key?D[e]-n:"PageUp"===t.key?D[e]+10:"PageDown"===t.key?D[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),I(D,e,i))},G=s(null),[H,J]=c(null),L=()=>{G.current=null,J(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>L,[]);const Q=e=>t=>{if(0!==t.button||K)return;t.preventDefault();const r=O.current?.getBoundingClientRect().width??0;r<=0||(G.current={i:e,x:t.clientX,width:r,from:D,moved:!1,pointer:t.pointerId},J(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},W=e=>{const t=G.current;if(!t)return;if(0===e.buttons)return void L();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}I(t.from,t.i,t.from[t.i]+r/t.width*100)},F=e=>{const t=G.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),L())},X=(e,t)=>{const{shown:n}=T.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return E(o.slice(0,-1))?o:null},[q,V]=c(0);u(()=>{const e=O.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>V(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const Y=s(null),[Z,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=T.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=D.join(",");u(()=>{const e=null===Z?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(Y.current,Z);te(t=>v(t,e)?t:e)},[Z,ie,q]);const le=R.hint(z,r),ae=D.slice(0,-1).map((e,t)=>p(D.slice(0,t+1)));/* @__PURE__ */
|
|
2
|
+
return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?j:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${B?"opacity-60":""} ${M}`.trim(),children:[
|
|
3
3
|
/* @__PURE__ */h("div",{ref:Y,"data-widths-bar":"",className:"relative h-8",children:[
|
|
4
|
-
/* @__PURE__ */f("div",{ref:O,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:
|
|
5
|
-
/* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),z>1&&
|
|
6
|
-
return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>
|
|
4
|
+
/* @__PURE__ */f("div",{ref:O,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:D.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===z&&/* @__PURE__ */f("span",{"data-widths-label":"",children:`${e}%`})},t))}),
|
|
5
|
+
/* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),z>1&&D.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=Z===t,l=p(D.slice(0,t)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
6
|
+
return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>q>0&&q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(z-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:B,"aria-label":R.column(t+1),"aria-describedby":j,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||X(t,e)},onRevert:e=>((e,t)=>{T.current.locked||null===t||oe(e,t)||X(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:T.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<z-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:R.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:B?-1:0,"aria-orientation":"vertical","aria-label":R.divider(t+1,t+2),"aria-valuenow":D[t],"aria-valuemin":r,"aria-valuemax":D[t]+D[t+1]-r,"aria-valuetext":R.dividerValue(t+1,D[t],t+2,D[t+1]),"aria-disabled":K||void 0,onKeyDown:K?void 0:U(t),onPointerDown:Q(t),onPointerMove:W,onPointerUp:F,onPointerCancel:F,onLostPointerCapture:()=>{G.current&&L()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(K?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(K?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${H===t?"w-1":y}`)})})})})]},t))]}),z>1&&/* @__PURE__ */f("span",{id:j,className:"sr-only",children:le})]})}export{x as WidthsBar};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-
|
|
2
|
-
return p(n,{portal:!0,minWidth:x,style:
|
|
1
|
+
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-CIHR5ZKF.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-OTITQ3IH.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:D=!0}){const L=s(null),j=a(),[A,S]=d(null),C=s(w);C.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const T=s(null),U=s(!1);m(()=>(T.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||T.current?.focus?.({preventScroll:!0})}),[]),m(()=>{A&&!U.current&&D&&(U.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[A,D]),m(()=>{if(D)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]),m(()=>u(e=>"Escape"===e.key&&(C.current(),!0),()=>L.current),[]),m(()=>{const e=()=>C.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const F=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void C.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),I=A?{left:A.left,top:A.top,maxHeight:A.maxHeight,...A.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
|
|
2
|
+
return p(n,{portal:!0,minWidth:x,style:I,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:j,role:"menu","aria-label":b,"aria-describedby":y?t(y,j):void 0,"data-context-menu":"",onKeyDown:F,children:[y&&e(y,{menuId:j,choose:e=>{e.disabled||(C.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>C.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-
|
|
2
|
-
return c(l,{labels:h.map(e=>e.label),values:v,height:p,width:d,min:j-
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{CartesianPlot as l}from"./chunk-QO5E33DH.js";import{STATUS_VARS as o}from"./chunk-TZFACUMR.js";import{useShellStrings as t,useShellLocale as a}from"./chunk-GDQJBQ5B.js";import{formatPlain as i,formatFixed as r}from"./chunk-C3QOHMR6.js";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";function h({candles:h,variant:m="candle",height:p=260,width:d,formatValue:u,yAxisLabel:b,label:y,className:x,emptyLabel:k}){const g=t().charts,f=a(),w=u??(e=>Number.isInteger(e)?i(e,f):r(e,2,f)),M=y??g.price,v=h.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),j=Math.min(...v),L=Math.max(...v),A=.08*(L-j)||1;/* @__PURE__ */
|
|
2
|
+
return c(l,{labels:h.map(e=>e.label),values:v,height:p,width:d,min:j-A,max:L+A,bandPadding:.42,formatValue:w,yAxisLabel:b,className:x,emptyLabel:k,ariaLabel:g.ohlc(M,h.length),tooltip:l=>{const t=h[l],a=t.close>=t.open,i=a?o.good:o.critical;/* @__PURE__ */
|
|
3
3
|
return c(e,{title:t.label,rows:[{key:"open",label:g.open,color:i,value:w(t.open)},{key:"high",label:g.high,color:i,value:w(t.high)},{key:"low",label:g.low,color:i,value:w(t.low)},{key:"close",label:g.close,color:i,value:w(t.close)}],emphasisKey:"close",footnote:a?g.closedAbove:g.closedBelow})},children:({x:e,y:l,active:t})=>/* @__PURE__ */c("g",{children:h.map((a,i)=>{const r=a.close>=a.open,h=r?o.good:o.critical,p=e.center(i),d=Math.max(3,e.bandwidth),u=null!==t&&t!==i,b=l(Math.max(a.open,a.close)),y=Math.max(1,Math.abs(l(a.close)-l(a.open)));/* @__PURE__ */
|
|
4
4
|
return n("g",{opacity:u?.45:1,children:[
|
|
5
5
|
/* @__PURE__ */c("line",{x1:p,y1:l(a.high),x2:p,y2:l(a.low),stroke:h,strokeWidth:1.5}),"candle"===m?/* @__PURE__ */c("rect",{x:p-d/2,y:b,width:d,height:y,rx:1,fill:r?h:"transparent",fillOpacity:r?.85:1,stroke:h,strokeWidth:1.5}):/* @__PURE__ */n(s,{children:[
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-
|
|
1
|
+
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-55AEZX6K.js";import{Icon as l}from"./chunk-2UO47XB4.js";import{useBrowserState as a}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-GDQJBQ5B.js";import{useId as o,useRef as c,useEffect as s,Children as u,isValidElement as d}from"react";import{jsx as m,jsxs as h,Fragment as p}from"react/jsx-runtime";function f({children:e,count:t,countLabel:n}){return null==t?/* @__PURE__ */m("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */h("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:[
|
|
2
2
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",children:e}),
|
|
3
|
-
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),S=o(),
|
|
3
|
+
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),S=o(),C=c(null),I=c(l);I.current=l,s(()=>{if(j&&d)return j.report(S,()=>I.current,C.current)},[j,d,S]);const D=/* @__PURE__ */h(p,{children:[null!=x&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:x}),y&&
|
|
4
4
|
/* @__PURE__ */m("span",{"aria-hidden":"true",title:N,className:`shrink-0 h-1.5 w-1.5 rounded-full ${y.fill}`}),
|
|
5
5
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof l?l:void 0,children:l}),y&&/* @__PURE__ */m("span",{className:"sr-only",children:N}),null!=a&&/* @__PURE__ */m(r,{count:a,label:u,active:d}),null!=g&&/* @__PURE__ */m("span",{className:"shrink-0",children:g})]});/* @__PURE__ */
|
|
6
|
-
return m("button",1===k?{ref:
|
|
6
|
+
return m("button",1===k?{ref:C,type:"button",onClick:f,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */m("span",{className:b(d),children:D})}:{ref:C,type:"button",onClick:f,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(d?"bg-accent-tint font-medium text-blue-700":"text-ink hover:bg-gray-100"),children:D})}function g({label:e,count:t,countLabel:n,children:i,defaultExpanded:c=!0,storageKey:s}){const p=o(),[f,b]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return c},c),x=!f&&u.toArray(i).some(e=>d(e)&&!0===e.props.active);/* @__PURE__ */
|
|
7
7
|
return h("div",{children:[
|
|
8
8
|
/* @__PURE__ */h("button",{type:"button",onClick:()=>{const e=!f;if(b(e),s)try{window.localStorage.setItem(s,e?"1":"0")}catch{}},"aria-expanded":f,"aria-controls":p,className:"flex w-full items-center gap-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(x?"bg-accent-tint text-blue-700":"text-ink-strong hover:bg-gray-100"),children:[
|
|
9
9
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{buildQuerySections as e,buildEmptySections as t,flattenRows as r,DEFAULT_MAGNIFIER as n,stepIndex as a,nextGroupIndex as s,SEE_ALL_ICON as l,resultTypeKey as o}from"./chunk-WGRS6QBT.js";import{useDismissPopupsOnOpen as i}from"./chunk-7QSDPSXP.js";import{SpinnerRing as c,LoadingSpinner as d}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{glassStyle as p}from"./chunk-
|
|
1
|
+
import{buildQuerySections as e,buildEmptySections as t,flattenRows as r,DEFAULT_MAGNIFIER as n,stepIndex as a,nextGroupIndex as s,SEE_ALL_ICON as l,resultTypeKey as o}from"./chunk-WGRS6QBT.js";import{useDismissPopupsOnOpen as i}from"./chunk-7QSDPSXP.js";import{SpinnerRing as c,LoadingSpinner as d}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{glassStyle as p}from"./chunk-5FYDNH4Y.js";import{useShellStrings as m}from"./chunk-GDQJBQ5B.js";import{useState as h,useRef as f,useEffect as y,useMemo as g,useId as x,useCallback as b}from"react";import{createPortal as k}from"react-dom";import{jsxs as v,jsx as w}from"react/jsx-runtime";function N(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:r}=e;return{results:t,truncatedTypes:Array.isArray(r)?r:[]}}return{results:[],truncatedTypes:[]}}var A=[];function L(e,t,r){const[n,a]=h([]),[s,l]=h(A),[o,i]=h(!1),[c,d]=h("none"),u=f(function(){let e=0,t=null;const r=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{r();const n=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>n===e}},cancel:r}}());y(()=>{const n=u.current;if(e.length<r||!t||0===t.length)return n.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),void i(!1);i(!0);const s=setTimeout(async()=>{const r=n.begin(),s=await async function(e,t,r){const n=await Promise.all(e.map(async e=>{try{return{failed:!1,...N(await e(t,{signal:r}))}}catch(e){const t=r.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:r}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===r}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:n.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(n.flatMap(e=>e.truncatedTypes))),failed:n.filter(e=>e.failed).length}}(t,e,r.signal);r.isCurrent()&&(a(s.results),l(s.truncatedTypes),d(0===s.failed?"none":s.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(s),n.cancel()}},[e,t,r]);return{results:n,truncatedTypes:s,loading:o,failure:c,reset:b(()=>{u.current.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),i(!1)},[])}}var C=(e,t)=>`${e}-opt-${t}`;function E(e,t){if("seeAll"===e.kind)return l;if("action"===e.kind)return e.icon??n;if(e.icon)return e.icon;const r=t?.[o(e.result)];return r||n}function T({sections:e,activeIdx:t,listId:r,label:n,typeIcons:a,groupCount:s,groupLabel:l,onHover:o,onPick:i}){let c=0;/* @__PURE__ */
|
|
2
2
|
return w("div",{id:r,role:"listbox","aria-label":n,className:"py-1",children:e.map(e=>/* @__PURE__ */v("div",{role:"group","aria-label":l(e.title,e.count,!!e.truncated),children:[
|
|
3
3
|
/* @__PURE__ */v("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:[
|
|
4
4
|
/* @__PURE__ */w("span",{children:e.title}),
|
|
@@ -6,22 +6,22 @@ return w("div",{id:r,role:"listbox","aria-label":n,className:"py-1",children:e.m
|
|
|
6
6
|
return v("div",{id:C(r,n),role:"option","aria-selected":s,className:"flex items-center gap-3 w-full px-4 py-3 text-left cursor-pointer transition-colors "+(s?"bg-blue-50":"hover:bg-gray-50"),onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),onMouseEnter:()=>o(n),children:[
|
|
7
7
|
/* @__PURE__ */w("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:E(e,a)})}),
|
|
8
8
|
/* @__PURE__ */v("div",{className:"flex-1 min-w-0",children:[
|
|
9
|
-
/* @__PURE__ */w("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */w("p",{className:"text-xs text-gray-400 truncate",children:d})]}),l&&/* @__PURE__ */w("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-ink-faint",children:l})]},e.key)})]},e.key))})}var j="react-os-shell:open-global-search";function D(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(j))}function I({providers:l,typeIcons:o,typeLabels:N,listRoutes:A,placeholder:E,quickActions:D,onSelect:I,recent:
|
|
10
|
-
/* @__PURE__ */v("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:u.overlay},onClick:()=>
|
|
9
|
+
/* @__PURE__ */w("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */w("p",{className:"text-xs text-gray-400 truncate",children:d})]}),l&&/* @__PURE__ */w("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-ink-faint",children:l})]},e.key)})]},e.key))})}var j="react-os-shell:open-global-search";function D(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(j))}function I({providers:l,typeIcons:o,typeLabels:N,listRoutes:A,placeholder:E,quickActions:D,onSelect:I,recent:K,onRecord:R,favorites:B,hotkey:M=!0}={}){const P=m().search,S=E??P.placeholder,[$,H]=h(!1),[Q,W]=h(""),[z,F]=h(0),G=f(null),{results:J,truncatedTypes:V,loading:Y,failure:q,reset:U}=L(Q,l,2);y(()=>{const e=e=>{M&&!e.defaultPrevented&&(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),H(e=>!e)),"Escape"===e.key&&$&&H(!1)},t=()=>H(!0);return window.addEventListener("keydown",e),window.addEventListener(j,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(j,t)}},[$,M]),i($);const[X,Z]=h(!1);$!==X&&(Z($),$&&(W(""),F(0),U())),y(()=>{$?setTimeout(()=>G.current?.focus(),50):W("")},[$]),y(()=>{F(0)},[J]);const _=Q.length>=2,O=g(()=>_?e(J,D,Q,P.actions,{truncatedTypes:V,listRoutes:A,typeLabels:N,seeAllLabel:P.seeAll}):t({recent:K,favorites:B,actions:D,typeLabels:N},P),[_,J,V,A,N,D,Q,K,B,P]),ee=g(()=>r(O),[O]),te=Math.min(z,Math.max(ee.length-1,0)),re=x(),ne=ee.length>0;y(()=>{$&&0!==ee.length&&document.getElementById(C(re,te))?.scrollIntoView?.({block:"nearest"})},[$,te,ee.length,re]);const ae=b(e=>{H(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||R?.(e.result),I?.(e.result)):e.action.onSelect()},[I,R]);return $?k(
|
|
10
|
+
/* @__PURE__ */v("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:u.overlay},onClick:()=>H(!1),children:[
|
|
11
11
|
/* @__PURE__ */w("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
|
|
12
12
|
/* @__PURE__ */v("div",{className:"relative z-10 w-full max-w-xl rounded-(--radius-popup) overflow-hidden",onClick:e=>e.stopPropagation(),style:p(),children:[
|
|
13
13
|
/* @__PURE__ */v("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
|
|
14
14
|
/* @__PURE__ */w("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:n})}),
|
|
15
|
-
/* @__PURE__ */w("input",{ref:
|
|
15
|
+
/* @__PURE__ */w("input",{ref:G,type:"text",value:Q,onChange:e=>{W(e.target.value),F(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),F(a(te,1,ee.length))):"ArrowUp"===e.key?(e.preventDefault(),F(a(te,-1,ee.length))):"Tab"===e.key&&ee.length>0?(e.preventDefault(),F(s(O.map(e=>e.rows.length),te,e.shiftKey?-1:1))):"Enter"===e.key&&ee[te]&&ae(ee[te])},placeholder:S,role:"combobox","aria-expanded":ne,"aria-controls":ne?re:void 0,"aria-activedescendant":ne?C(re,te):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),Y&&/* @__PURE__ */w("span",{"data-global-search-spinner":"",role:"status","aria-label":P.searching,className:"flex shrink-0",children:/* @__PURE__ */w(c,{className:"h-4 w-4",ink:"text-ink-faint"})}),
|
|
16
16
|
/* @__PURE__ */w("kbd",{className:"hidden sm:inline-flex items-center rounded border border-line-strong px-2 py-0.5 text-2xs font-medium text-ink-faintest",children:P.escBadge})]}),
|
|
17
|
-
/* @__PURE__ */v("div",{className:"max-h-[50vh] overflow-y-auto",children:[
|
|
17
|
+
/* @__PURE__ */v("div",{className:"max-h-[50vh] overflow-y-auto",children:[Y&&0===ee.length&&/* @__PURE__ */w(d,{size:"sm",padding:"py-6",label:P.searching}),!Y&&"all"===q&&_&&/* @__PURE__ */w("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:P.searchFailed}),!Y&&_&&0===ee.length&&"all"!==q&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:P.noResults}),ne&&/* @__PURE__ */w(T,{sections:O,activeIdx:te,listId:re,label:P.listLabel,typeIcons:o,groupCount:P.groupCount,groupLabel:P.groupLabel,onHover:F,onPick:ae}),!Y&&"some"===q&&_&&/* @__PURE__ */w("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:P.partialFailure}),!Y&&!_&&0===ee.length&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:P.minChars(2)})]}),
|
|
18
18
|
/* @__PURE__ */v("div",{className:"flex items-center justify-between px-4 py-2 border-t border-line-subtle bg-surface-sunken text-2xs text-ink-faintest",children:[
|
|
19
19
|
/* @__PURE__ */v("div",{className:"flex items-center gap-3",children:[
|
|
20
20
|
/* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
|
|
21
21
|
/* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↑"}),
|
|
22
22
|
/* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↓"}),` ${P.navigate}`]}),
|
|
23
23
|
/* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
|
|
24
|
-
/* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:P.enterKey}),` ${P.open}`]}),
|
|
24
|
+
/* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:P.enterKey}),` ${P.open}`]}),O.length>1&&/* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
|
|
25
25
|
/* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:P.tabKey}),` ${P.nextGroup}`]})]}),
|
|
26
26
|
/* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
|
|
27
27
|
/* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:P.escKey}),` ${P.close}`]})]})]})]}),document.body):null}export{I as GlobalSearch,D as openGlobalSearch};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-
|
|
2
|
-
return v("div",{...Te?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Ke?Ke.has(e.id):void 0,onClick:Te?t=>{t.target.closest?.("button")||
|
|
1
|
+
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-H5NIW2KS.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-JTMEFXRL.js";import{ColoredBadge as u}from"./chunk-OKHKY3ZZ.js";import{MENU_ON_MEDIA_ATTR as m}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-2UO47XB4.js";import{Tooltip as f}from"./chunk-NJN5IKWO.js";import{useShellStrings as h}from"./chunk-GDQJBQ5B.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function N({items:p,onPick:k,onFiles:N,onRemove:w,onReorder:j,dragType:K,onDragOutChange:T,dropType:C,onDropData:O,label:A,hint:I,error:F,required:L,className:S,accept:z="image/*",maxSizeBytes:E,maxFiles:P,fit:$="cover",thumbSize:B=96,placeholder:H,cta:M,acceptHint:R,showCover:W=!1,coverLabel:Q,busy:J=!1,busyLabel:q,progress:U,disabled:X=!1,readOnly:Y=!1,selected:Z,onItemClick:G,onItemDoubleClick:V,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=M??te.cta,ae=Q??te.cover,ne=q??te.uploading,le=g(),[ie,oe]=b(null),se=X||J,de=!(!k&&!N||se||Y),ce=!!w&&!se&&!Y,ue=!!j&&!se&&!Y,me=!!K&&!X&&!ue,pe=!(!C||!O||se||Y),fe=t(se),he=H??r(z,te),ge=d({accept:z,maxSizeBytes:E,maxFiles:P,acceptHint:R,multiple:!0,disabled:!de,currentCount:p.length,onAccept:e=>{if(N)N(e);else for(const t of e)k(t)}}),[be,ye]=b(!1),ve=y(0),xe=e=>pe&&Array.from(e.dataTransfer?.types??[]).includes(C),ke=ge.zoneProps,De={onDragEnter:e=>{if(!xe(e))return ke.onDragEnter?.(e);e.preventDefault(),ve.current+=1,ye(!0)},onDragOver:e=>{if(!xe(e))return ke.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",be||ye(!0)},onDragLeave:e=>{if(!xe(e))return ke.onDragLeave?.(e);ve.current=Math.max(0,ve.current-1),0===ve.current&&ye(!1)},onDrop:e=>{if(!xe(e))return ke.onDrop?.(e);e.preventDefault(),ve.current=0,ye(!1);const t=e.dataTransfer.getData(C);t&&O(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:B,height:B},Ke=null==Z?null:new Set(Z),Te=!!G,Ce=B<112,Oe=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,z),a=e.name??o(e.url),n=W&&(e.cover??0===t);/* @__PURE__ */
|
|
2
|
+
return v("div",{...Te?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Ke?Ke.has(e.id):void 0,onClick:Te?t=>{t.target.closest?.("button")||G(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:V?()=>V(e.id):void 0,onContextMenu:_?t=>_(e.id,t):void 0,draggable:ue||me&&!!e.dragData||void 0,onDragStart:ue?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(t)),oe(t)}:me&&e.dragData?t=>{t.dataTransfer.effectAllowed=e.dragAlso?"all":"link",t.dataTransfer.setData(K,e.dragData);for(const[r,a]of Object.entries(e.dragAlso??{}))t.dataTransfer.setData(r,a);T?.("start",e.id)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&T?t=>T("none"===t.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onDragOver:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation(),ie!==t&&j(ie,t),oe(null))}:void 0,tabIndex:ue||Te?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Te?a:void 0,onKeyDown:Te&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),G(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}))}:ue?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),j(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<p.length-1&&(e.preventDefault(),j(t,t+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-line bg-gray-100",fe,ie===t?"opacity-50":"",Ke?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Te?"cursor-pointer":""].join(" "),style:{...je,cursor:ue?"move":void 0},children:[r?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:$}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:$}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-accent-fill px-2 py-0.5 text-xs font-medium text-on-accent",children:ae}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
|
|
3
3
|
/* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:Ce?
|
|
4
4
|
/* @__PURE__ */x(f,{content:e.label,children:/* @__PURE__ */x("span",{tabIndex:0,"aria-label":e.label,className:`flex rounded-full ${fe}`,children:/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"inline-flex items-center gap-0.5",children:[
|
|
5
|
-
/* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},
|
|
5
|
+
/* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},Ae=de&&/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":te.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${fe}`,style:je,children:[
|
|
6
6
|
/* @__PURE__ */x(a,{className:"h-5 w-5"}),
|
|
7
|
-
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),
|
|
7
|
+
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),Ie=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight:B+32},children:[
|
|
8
8
|
/* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(a,{})}),
|
|
9
9
|
/* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:he}),
|
|
10
|
-
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),
|
|
11
|
-
return v(e,{label:
|
|
12
|
-
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":
|
|
13
|
-
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ke||void 0,"aria-label":"string"==typeof
|
|
10
|
+
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),R&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:R})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:B+32},children:/* @__PURE__ */x("span",{className:J?"invisible":void 0,children:te.empty})});/* @__PURE__ */
|
|
11
|
+
return v(e,{label:A,labelId:A?`${le}-label`:void 0,htmlFor:le,hint:I,error:F,required:L,className:S,children:[
|
|
12
|
+
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":A?`${le}-label`:void 0,"aria-describedby":F?`${le}-error`:I?`${le}-hint`:void 0,"aria-busy":J||void 0,...ge.zoneProps,...pe?De:{},className:"relative rounded-lg transition-colors",style:{...se?{opacity:.6}:{},...Ne?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Ie:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Te?
|
|
13
|
+
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ke||void 0,"aria-label":"string"==typeof A?A:te.files,className:"contents",children:p.map(Oe)}):p.map(Oe),Ae]}),J&&/* @__PURE__ */x(l,{label:ne,progress:U})]}),!k&&N&&/* @__PURE__ */x("input",{...ge.inputProps}),
|
|
14
14
|
/* @__PURE__ */x(c,{rejections:ge.rejections})]})}export{k as FULL_BADGE_TILE_PX,N as MediaUploadGrid};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useDefaultColumnConfig as t}from"./chunk-ULJQYXHB.js";import{useShellPrefs as e}from"./chunk-KC3EX26K.js";import{useState as i,useRef as r,useEffect as o}from"react";function c(t){const e=t;return!!e&&"string"==typeof e.field&&e.field.length>0&&("asc"===e.direction||"desc"===e.direction)}function n(n,s="asc",f,d){const{prefs:l,save:a}=e(),u=f?`sort_${f}`:null,[g,m]=i(()=>{if(u){if(c(l[u]))return l[u];try{const t=JSON.parse(localStorage.getItem(`sort-config-${f}`)||"null");if(c(t))return t}catch{}}return{field:n,direction:s}}),y=r(!1),S=u?l[u]:void 0,h=r(S);h.current=S,o(()=>{if(!y.current&&c(S)){m(t=>t.field===S.field&&t.direction===S.direction?t:S);try{localStorage.setItem(`sort-config-${f}`,JSON.stringify(S))}catch{}}},[f,S?.field,S?.direction]);const{defaultConfig:p}=t(f);o(()=>{const t=p?.sort;if(!y.current&&!c(h.current)&&c(t)){m(e=>e.field===t.field&&e.direction===t.direction?e:t);try{localStorage.setItem(`sort-config-${f}`,JSON.stringify(t))}catch{}}},[f,p]);const $=d?.columns?.length?d.columns:void 0,J=!$||function(t,e){return t.some(t=>(t.sortField??("_select"!==t.key?t.key:""))===e&&""!==e)}($,g.field)?g:{field:n,direction:s},k="desc"===J.direction?`-${J.field}`:J.field;return{sort:J,onSort:t=>{y.current=!0;const e=J.field===t?{field:t,direction:"asc"===J.direction?"desc":"asc"}:{field:t,direction:"asc"};if(m(e),u){try{localStorage.setItem(`sort-config-${f}`,JSON.stringify(e))}catch{}a({[u]:e})}},ordering:k}}export{n as useSort};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{copyToClipboard as e,selectionAt as t}from"./chunk-TMMNCXQT.js";import{ResizableTable as n}from"./chunk-HNVSVTNC.js";import{useTableNav as r}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as o}from"./chunk-G6DKCCWH.js";import{Checkbox_default as l}from"./chunk-CGZBDI6C.js";import{ListFooter as i}from"./chunk-4ULRP4Y4.js";import{ListLoadError as a}from"./chunk-UNQ54QOF.js";import{LoadingSpinner as c}from"./chunk-O3MBPAWZ.js";import{toast_default as d}from"./chunk-7ELJQL7J.js";import{PopupMenu as s,PopupMenuLabel as h,PopupMenuItem as m,PopupMenuDivider as u}from"./chunk-OTITQ3IH.js";import{keepsNativeMenu as p}from"./chunk-5QFPTDQF.js";import{LoadingSpinner as f}from"./chunk-R2VKEMZH.js";import{shellHttp as g}from"./chunk-STKJA4PV.js";import{useShellStrings as y}from"./chunk-GDQJBQ5B.js";import{useState as k,useRef as b}from"react";import{jsx as x,Fragment as w,jsxs as C}from"react/jsx-runtime";function j(e){return Array.from(e.children).filter(e=>void 0!==e.dataset?.colKey&&"_select"!==e.dataset.colKey)}function v(e){return("string"==typeof e.innerText?e.innerText:e.textContent??"").replace(/\s+/g," ").trim()}function S(S){const{items:N,isLoading:R,emptyState:T,totalCount:L,isError:$,onRetry:M,errorTitle:P,errorMessage:A,tableId:E,columns:K,renderCell:Q,getRowId:F=e=>e.id,sort:I,onSort:U,selected:D,setSelected:O,onRowClick:B,onRowHover:H,getRowClassName:J,footerLabel:W,footerExtra:V,sentinelRef:Z,isFetchingNextPage:_,saveDefaultPerms:G,exportEndpoint:z,exportFilename:X="export.csv",contextActions:Y}=S,[q,ee]=k(null),te=b(null),ne=y(),re=ne.entityList,oe=e=>{O(t=>{const n=new Set(t),r=F(e);return n.has(r)?n.delete(r):n.add(r),n})},le=()=>{O(e=>{const t=N.map(F),n=new Set(e);return t.every(t=>e.has(t))?t.forEach(e=>n.delete(e)):t.forEach(e=>n.add(e)),n})},ie=r(N,B,oe,le,(e,t)=>{O(n=>{const r=new Set(n);for(let n=e;n<=t;n++)r.add(F(N[n]));return r})},te),ae=N.filter(e=>D.has(F(e))),ce=()=>{const e=[...te.current?.querySelectorAll("tr[data-row-idx]")??[]].filter(e=>{const t=N[Number(e.dataset.rowIdx)];return void 0!==t&&D.has(F(t))}),t=e.length?j(e[0]).map(e=>e.dataset.colKey??""):[],n=new Map(K.map(e=>[e.key,e.label]));return{keys:t,header:t.map(e=>n.get(e)??e),body:e.map(e=>j(e).map(v))}},de=()=>{ee(null);const{header:t,body:n}=ce();if(!n.length)return;const r=[t,...n].map(e=>e.join("\t")).join("\n"),l="<table><thead><tr>"+t.map(e=>`<th>${o(e)}</th>`).join("")+"</tr></thead><tbody>"+n.map(e=>`<tr>${e.map(e=>`<td>${o(e)}</td>`).join("")}</tr>`).join("")+"</tbody></table>";e(re.copiedRows(n.length),r,l)},se=async()=>{ee(null);const e=ae.map(F);if(!e.length||!z)return;const t=new URLSearchParams({ids:e.join(",")}),n=(()=>{const e=new Map(K.map(e=>[e.key,e.exportLabel??e.label]));try{const t=localStorage.getItem(`col-config-${E}`);if(t){const n=JSON.parse(t).filter(t=>!t.hidden&&"_select"!==t.key&&e.has(t.key)).map(t=>`${t.key}|${e.get(t.key)}`);if(n.length)return n.join(",")}}catch{}return K.filter(e=>!e.defaultHidden).map(e=>`${e.key}|${e.exportLabel??e.label}`).join(",")})();n&&t.set("cols",n);const r=z.includes("?")?"&":"?";try{const n=await g.get(`${z}${r}${t}`,{responseType:"blob"}),o=window.URL.createObjectURL(new Blob([n.data],{type:"text/csv"})),l=document.createElement("a");l.href=o,l.download=X,l.click(),window.URL.revokeObjectURL(o);const i=n.headers??{},a=Number(i["x-row-count"]);if("true"===String(i["x-truncated"]))return void d.notify(Number.isFinite(a)?re.exportTruncated(a,e.length):re.exportTruncatedUnknown(e.length));d.success(re.exported(e.length))}catch{d.error(re.exportFailed)}};if(R)/* @__PURE__ */return x(c,{});if($&&0===N.length)/* @__PURE__ */
|
|
2
|
+
return x(a,{title:P,message:A,onRetry:M});if(0===N.length)/* @__PURE__ */return x(w,{children:T});const he=N.length>0&&ae.length===N.length,me=ae.length>0&&!he,ue=D.size-ae.length,pe=[{key:"_select",label:"",defaultWidth:52,minWidth:52,headerNode:/* @__PURE__ */x(l,{"aria-label":ne.table.selectAll,checked:he,indeterminate:me,onChange:le,style:{height:14,width:14}})},...K],fe=/* @__PURE__ */x(i,{selectedCount:ae.length,hiddenSelectedCount:ue,loadedCount:N.length,totalCount:L,label:W,isFetchingMore:_,extra:V}),ge=Z?/* @__PURE__ */C(w,{children:[
|
|
3
|
+
/* @__PURE__ */x("div",{ref:Z}),_&&/* @__PURE__ */x(f,{size:"sm",padding:"py-3",label:ne.list.loadingMore})]}):void 0;let ye=null;if(q){const{x:t,y:n,item:r,text:o,firstColumn:l}=q,i=Y?Y(ae):[],a=ae.length,c=()=>ee(null),d=void 0!==L&&L>N.length;ye=/* @__PURE__ */C(s,{portal:!0,style:{left:t,top:n},onClose:c,minWidth:210,children:[
|
|
4
|
+
/* @__PURE__ */x(h,{children:ue>0?ne.list.selectedNotShown(a,ue):ne.list.selected(a)}),
|
|
5
|
+
/* @__PURE__ */x(m,{className:"font-medium",onClick:()=>{c(),B(r)},children:re.open}),
|
|
6
|
+
/* @__PURE__ */x(u,{}),o&&/* @__PURE__ */x(m,{onClick:()=>{c(),e(re.copiedText,o.text,o.html)},children:re.copy}),l&&/* @__PURE__ */x(m,{onClick:()=>(t=>{ee(null);const{keys:n,body:r}=ce(),o=n.indexOf(t.key);o<0||!r.length||e(t.label,r.map(e=>e[o]).join("\n"))})(l),children:re.copyColumn(l.label)}),
|
|
7
|
+
/* @__PURE__ */x(m,{disabled:0===a,onClick:de,children:re.copyRows(a)}),z&&/* @__PURE__ */x(m,{onClick:se,children:re.exportSelected}),i.map((e,t)=>/* @__PURE__ */C("div",{children:[(e.divider||0===t)&&/* @__PURE__ */x(u,{}),
|
|
8
|
+
/* @__PURE__ */x(m,{danger:e.danger,disabled:e.disabled,onClick:()=>{c(),e.onClick(ae)},children:e.label})]},t)),
|
|
9
|
+
/* @__PURE__ */x(u,{}),!he&&/* @__PURE__ */x(m,{onClick:()=>{c(),O(e=>/* @__PURE__ */new Set([...e,...N.map(F)]))},children:d?re.selectAllLoaded(N.length):re.selectAll}),
|
|
10
|
+
/* @__PURE__ */x(m,{onClick:()=>{c(),O(/* @__PURE__ */new Set)},children:re.clearSelection}),M&&/* @__PURE__ */x(m,{onClick:()=>{c(),M()},children:re.refresh})]})}/* @__PURE__ */
|
|
11
|
+
return C("div",{className:"flex-1 flex flex-col mb-1 bg-white rounded-lg shadow overflow-hidden",children:[
|
|
12
|
+
/* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(n,{tableId:E,columns:pe,sort:I,onSort:U,footer:fe,afterBody:ge,saveDefaultPerms:G,children:e=>/* @__PURE__ */x("tbody",{ref:te,className:"divide-y divide-gray-100",children:N.map((n,r)=>{const o=F(n);/* @__PURE__ */
|
|
13
|
+
return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ie===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":D.has(o)?"bg-blue-50 hover:bg-blue-100":"hover:bg-gray-50"} ${J?.(n)??""}`,onClick:()=>B(n),onContextMenu:e=>((e,n)=>{if(e.shiftKey||p(e.target))return;e.preventDefault();const r=F(n);D.has(r)||O(/* @__PURE__ */new Set([r]));const o=j(e.currentTarget)[0]?.dataset.colKey,l=o?K.find(e=>e.key===o)?.label:void 0;ee({x:e.clientX,y:e.clientY,item:n,text:t(e.target),firstColumn:o&&l?{key:o,label:l}:null})})(e,n),onMouseEnter:H?()=>H(n):void 0,children:e.map(e=>/* @__PURE__ */x("td",{"data-col-key":e.key,className:"px-4 py-3 whitespace-nowrap text-sm overflow-hidden",children:"_select"===e.key?/* @__PURE__ */x(l,{"aria-label":ne.table.selectRow,checked:D.has(o),onChange:()=>oe(n),onClick:e=>e.stopPropagation(),style:{height:14,width:14}}):Q(n,e.key)},e.key))},o)})})})}),ye]})}export{S as EntityList};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{buttonClasses as e}from"./chunk-UQYNPYF4.js";import{isAriaDisabled as a,swallowPress as r,describedByWith as i,OffWithReason as s}from"./chunk-TE6R53YD.js";import{SpinnerRing as l}from"./chunk-R2VKEMZH.js";import{forwardRef as d,useId as n}from"react";import{jsxs as t,jsx as c}from"react/jsx-runtime";var o=d(function({variant:d="primary",size:o="md",loading:m=!1,leftIcon:p,rightIcon:b,block:f=!1,disabled:u,type:h="button",children:k,className:x="",disabledReason:N,onClick:y,pressed:v,"aria-disabled":g,"aria-describedby":j,...R},Y){const w=n(),z=u||m,C=null!=N&&""!==N,E=z&&C,I=!z&&a(g),D=I&&C,F=E||D?w:void 0,H=/* @__PURE__ */t("button",{ref:Y,type:h,disabled:z,"aria-busy":m||void 0,"aria-disabled":!!I||g,"aria-describedby":i(j,F),onClick:I?r:y,className:e({variant:d,size:o,block:f,pressed:v??(!0===R["aria-pressed"]||"true"===R["aria-pressed"]),className:x}),...R,children:[m?/* @__PURE__ */c(l,{className:"h-3.5 w-3.5",ink:""}):p,k,!m&&b]});return D?/* @__PURE__ */c(s,{reason:N,id:w,block:f,children:H}):E?/* @__PURE__ */t("span",{className:f?"flex w-full flex-col gap-1":"inline-flex flex-col items-start gap-1",children:[H,
|
|
2
|
+
/* @__PURE__ */c("span",{id:F,className:"text-xs text-red-600",children:N})]}):H});export{o as Button_default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-4EZIWLJJ.js";import{IconButton_default as a}from"./chunk-LE5LWALR.js";import{Icon as o}from"./chunk-2UO47XB4.js";import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m(e,l,r,a){const o=h.filter(l=>"link"!==l&&e.has(l)).length+(l?1:0);return r&&0!==o?a>0?"paragraph":"words":null}function w({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s,clear:i}){let t=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),d=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);const c=m(l,r,i,d);return"paragraph"===c&&(d+=1),"words"===c&&(t+=1),{words:t>0,paragraph:d>0,oneRow:t>0&&d>0&&t+1+d<=9,flow:t>0&&d>0&&t+1+d>9&&t<=7,cells:{words:t,paragraph:d}}}function g(e,l){/* @__PURE__ */
|
|
2
|
+
return i(n,{content:e,children:l},l.key??void 0)}function f({offered:n,pressed:h,onMark:f,color:k,linkOpen:v=!1,last:N,alignment:C,list:D,letterCase:M,clear:x,disabled:y=!1,"aria-label":L,windows:B,className:j="",layout:A="grid"}){const I=s().textToolbar,q=w({offered:n,color:k,last:N,alignment:C,list:D,letterCase:M,clear:x});if(!q.words&&!q.paragraph)return null;const R=m(n,k,x,q.cells.paragraph),$=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,J=(e,l,r,o)=>n.has(e)?g(l,/* @__PURE__ */i(a,"link"===e?{pressed:v,className:$(v),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":v,"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r}:{className:$(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r},e)):null,K=l(I),S=e.map(e=>[e,K[e],r(e)]),U=C?e.filter(e=>C.allow.includes(e)):[],E=C&&U.includes(C.value)?C.value:U[0],O=[["none",I.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",I.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",I.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],T=x&&R?g(I.clear,/* @__PURE__ */i(a,{className:$(!1),"aria-label":I.clear,disabled:y,onMouseDown:c,onClick:x.onClear,children:/* @__PURE__ */i(o,{name:"revert"})},"clear")):null,W=/* @__PURE__ */t(d,{children:[J("bold",I.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),J("italic",I.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),J("underline",I.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),J("strike",I.strike,/* @__PURE__ */i(o,{name:"strike"})),k?g(I.color,/* @__PURE__ */i(a,{pressed:k.open,className:$(k.open,"rosh-tb-color"),"aria-label":I.color,"aria-haspopup":"dialog","aria-expanded":k.open,disabled:y,style:k.run?{"--rosh-tb-run":k.run}:void 0,onMouseDown:c,onClick:k.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,J("link",I.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),J("sup",I.sup,/* @__PURE__ */i(o,{name:"superscript"})),J("sub",I.sub,/* @__PURE__ */i(o,{name:"subscript"})),J("code",I.code,/* @__PURE__ */i(o,{name:"code"})),u(N)?N:null,"words"===R?T:null]}),Q=/* @__PURE__ */t(d,{children:[C&&U.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":I.alignment,onKeyDown:e=>p(e,U,e=>C.onChange(e)),children:S.map(([e,l,r])=>C.allow.includes(e)?g(l,/* @__PURE__ */i(a,{role:"radio",pressed:C.value===e,className:$(C.value===e),"aria-checked":C.value===e,"aria-label":l,tabIndex:e===E?0:-1,disabled:y||C.disabled,onMouseDown:c,onClick:()=>C.onChange(e),children:r},e)):null)}):null,D&&n.has("bullet")?g(I.bullet,/* @__PURE__ */i(a,{className:$("bullet"===D.pressed),"aria-label":I.bullet,"aria-pressed":"bullet"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,D&&n.has("number")?g(I.number,/* @__PURE__ */i(a,{className:$("number"===D.pressed),"aria-label":I.number,"aria-pressed":"number"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,J("quote",I.quote,/* @__PURE__ */i(o,{name:"quote"})),M?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":I.letterCase,onKeyDown:e=>p(e,O.map(([e])=>e),e=>M.onChange(e)),children:O.map(([e,l,r])=>g(l,/* @__PURE__ */i(a,{role:"radio",pressed:M.value===e,className:$(M.value===e),"aria-checked":M.value===e,"aria-label":l,tabIndex:e===(M.value||"none")?0:-1,disabled:y||M.disabled,onMouseDown:c,onClick:()=>M.onChange(M.value===e?"":e),children:r},e)))}):null,"paragraph"===R?T:null]}),G="row"===A,H=G?" is-row":q.flow?" is-flow":q.oneRow?" is-one-row":q.words&&void 0===N&&"words"!==R?" is-eight":"",X=b(n,Boolean(k)),Z={"--rosh-tb-color-col":String(X.color),"--rosh-tb-link-col":String(X.link),...G?{"--rosh-tb-cells":String(q.cells.words+q.cells.paragraph),"--rosh-tb-groupgap":q.words&&q.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let z;return z=G?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:W}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:Q}):null]}):q.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[W,
|
|
3
|
+
/* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),Q]}):q.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
|
|
4
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-words",children:W}),
|
|
5
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-para",children:Q})]}):/* @__PURE__ */t(d,{children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===N&&"words"!==R?" is-eight":""),children:W}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:Q}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${H} ${j}`.trim(),style:Z,children:[
|
|
6
|
+
/* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":L??I.formatting,children:z}),B]})}export{f as TextToolbar,w as textToolbarRows,b as textToolbarWindowColumns};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as e,useSyncExternalStore as n,useContext as t}from"react";var r='button, a[href], summary, [role="button"], [role="link"], [role="menuitem"], select',l=[],u=/* @__PURE__ */new Set;function o(){return l[l.length-1]||null}function a(e){return u.add(e),()=>{u.delete(e)}}var c=e(null);function i(){const e=n(a,o,()=>null),r=t(c);return r?.active??(l.length<=1||null!=e)}export{r as KEY_ACTIVATED_SELECTOR,c as ModalActionsContext,l as activationOrder,u as activeListeners,o as getActiveModalId,a as subscribeActive,i as useModalActive};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Avatar as e}from"./chunk-AFYLVV74.js";import{StatCard as a,Card as t}from"./chunk-P3RXXWXN.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-
|
|
1
|
+
import{Avatar as e}from"./chunk-AFYLVV74.js";import{StatCard as a,Card as t}from"./chunk-P3RXXWXN.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-G66SG6JN.js";import{ColumnChart as l}from"./chunk-BMXTPJ7T.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-FZM3ZPW3.js";import{Button_default as c}from"./chunk-EOVXFXVV.js";import{TH_ONE_LINE as n}from"./chunk-WGLHB6WE.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
|
|
2
2
|
return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */m("div",{className:"mx-auto max-w-6xl space-y-6",children:[
|
|
3
3
|
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */m("div",{children:[
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{OneLineLabel as t}from"./chunk-
|
|
1
|
+
import{OneLineLabel as t}from"./chunk-WGLHB6WE.js";import{createContext as s,useContext as a,useCallback as r}from"react";import{jsx as o}from"react/jsx-runtime";var e="inline-flex max-w-full items-center whitespace-nowrap rounded-full",n={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},u={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function i(t,s="subtle"){return"solid"===s?u[t]:n[t]}var l=s({}),c=s(void 0);function d(t){return t.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function v({groups:t,labelFor:s,children:a}){/* @__PURE__ */
|
|
2
2
|
return o(l.Provider,{value:t,children:/* @__PURE__ */o(c.Provider,{value:s,children:a})})}function f(){const t=a(c);return r(s=>t?.(s)??d(s),[t])}function g({status:s,label:r,emphasis:n="subtle"}){const u=i(a(l)[s]??"neutral",n),v=a(c),f=r??v?.(s)??d(s);/* @__PURE__ */
|
|
3
3
|
return o("span",{className:`${e} px-3 py-0.5 text-xs font-medium ${u}`,children:/* @__PURE__ */o(t,{children:f})})}export{e as BADGE_PILL,n as GROUP_COLORS,u as GROUP_COLORS_SOLID,g as StatusBadge,v as StatusBadgeProvider,i as groupColors,f as useStatusLabel};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-
|
|
2
|
-
return g("div",{className:`relative ${
|
|
3
|
-
/* @__PURE__ */g("svg",{width:"100%",height:K,viewBox:`0 0 ${ee} ${K}`,role:"img","aria-labelledby":E,onMouseLeave:()=>
|
|
4
|
-
/* @__PURE__ */p("title",{id:E,children:C.breakdown(
|
|
5
|
-
return p("path",{d:e(te,le,re,c,o,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:s.surface,strokeWidth:1,className:
|
|
1
|
+
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-36VIGB6J.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{CHART_INK as s,resolveSeriesColor as i}from"./chunk-TZFACUMR.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-GDQJBQ5B.js";import{formatPercent as m,formatPlain as u}from"./chunk-C3QOHMR6.js";import{useId as d,useState as f,useRef as y}from"react";import{jsx as p,jsxs as g}from"react/jsx-runtime";function x({segments:x,variant:v="pie",size:k=280,innerRadius:M,padAngle:b=.012,maxSegments:N=6,otherLabel:I,formatValue:$,centerLabel:j,animate:w=!0,labels:F="none",labelMinShare:P=.04,className:S,emptyLabel:A}){const C=h().charts,B=c(),R=$??(e=>u(e,B)),W=I??C.other,z=A??C.nothingToBreakDown,E=d(),[T,V]=f(null),{highlighted:_}=a(),L=y(null),Q=o(L,Number.POSITIVE_INFINITY),U=x.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===U.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${S??""}`,children:z});const Y=[...U].sort((e,t)=>t.value-e.value),J=Y.slice(0,N),O=Y.slice(N),D=O.length>0?[...J,{key:"__other__",label:W,value:O.reduce((e,t)=>e+t.value,0),slot:-1,color:s.muted}]:J,G=e=>i(e.slot,e.color,e.tone),H=D.reduce((e,t)=>e+t.value,0),Z=Math.ceil(.62*Math.max(...D.map(e=>String(e.label).length),4)*11)+24,q="outside"===F&&Q>=120+2*Z,X=q?Z:0,K=q?Math.max(120,Math.min(k,Q-2*X)):k,ee=K+2*X,te=X+K/2,le=K/2,ae=K/2-12,re=M??("ring"===v?.58*ae:0),ne=n(D.length,b),oe=Math.max(...D.map(e=>e.value)),se=e=>re+(ae-re)*Math.sqrt(Math.max(0,e)/oe);let ie=-Math.PI/2;const he=(()=>{if(!q)return[];let e=-Math.PI/2;const t=D.map((t,l)=>{const a="rose"===v?n(D.length,b).step:t.value/H*Math.PI*2,r="rose"===v?n(D.length,b).center(l):e+a/2;e+=a;const o="rose"===v?se(t.value):ae;return{key:t.key,label:t.label,share:t.value/H,right:Math.cos(r)>=0,anchor:[te+o*Math.cos(r),le+o*Math.sin(r)],y:le+(o+14)*Math.sin(r),index:l}}).filter(e=>e.share>=P),l=Math.max(1,Math.floor((K-11-13)/26)+1),a=/* @__PURE__ */new Set;for(const e of[!0,!1]){const r=t.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,l).sort((e,t)=>e.y-t.y);for(let e=1;e<r.length;e+=1)r[e].y-r[e-1].y<26&&(r[e].y=r[e-1].y+26);for(let e=r.length-1;e>=0;e-=1){const t=e===r.length-1?K-13:r[e+1].y-26;r[e].y=Math.min(r[e].y,t)}r.forEach((e,t)=>{e.y=Math.max(e.y,0===t?11:r[t-1].y+26),a.add(e.key)})}return t.filter(e=>a.has(e.key))})(),ce=(e,t)=>null!==T?T!==e:null!==_&&_!==t,me=null!==T?D[T]:void 0;/* @__PURE__ */
|
|
2
|
+
return g("div",{className:`relative ${S??""}`,ref:L,children:[
|
|
3
|
+
/* @__PURE__ */g("svg",{width:"100%",height:K,viewBox:`0 0 ${ee} ${K}`,role:"img","aria-labelledby":E,onMouseLeave:()=>V(null),children:[
|
|
4
|
+
/* @__PURE__ */p("title",{id:E,children:C.breakdown(R(H),D.length)}),D.map((a,r)=>{const n=G(a),o="rose"===v?ne(r):ie,i="rose"===v?ne.step:a.value/H*Math.PI*2-b;"rose"!==v&&(ie+=a.value/H*Math.PI*2);const h=o+Math.max(.001,i),c="rose"===v?se(a.value):ae;/* @__PURE__ */
|
|
5
|
+
return p("path",{d:e(te,le,re,c,o,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:s.surface,strokeWidth:1,className:w?t.sweep:void 0,style:w?l(r,55):void 0,onMouseEnter:()=>V(r)},a.key)}),he.map(e=>{const t=e.right?ee-6:6,l=e.right?te+ae+14:te-ae-14;/* @__PURE__ */
|
|
6
6
|
return g("g",{children:[
|
|
7
7
|
/* @__PURE__ */p("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${l},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:s.grid,strokeWidth:1}),
|
|
8
8
|
/* @__PURE__ */p("text",{x:t,y:e.y-2,fontSize:11,fill:s.label,textAnchor:e.right?"end":"start",children:e.label}),
|
|
9
|
-
/* @__PURE__ */p("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:s.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:m(100*e.share,1,
|
|
10
|
-
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:
|
|
11
|
-
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:
|
|
9
|
+
/* @__PURE__ */p("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:s.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:m(100*e.share,1,B)})]},`lbl-${e.key}`)}),j&&re>0&&/* @__PURE__ */p("text",{x:te,y:le+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:s.label,children:j})]}),me&&null!==T&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:me.label,rows:[{key:"value",label:C.value,color:G(me),value:R(me.value)},{key:"share",label:C.share,color:s.muted,value:m(me.value/H*100,1,B)}]})}),
|
|
10
|
+
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:D.map((e,t)=>/* @__PURE__ */g("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
11
|
+
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:G(e)}}),
|
|
12
12
|
/* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
|
|
13
|
-
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:m(e.value/
|
|
13
|
+
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:m(e.value/H*100,1,B)})]},e.key))})]})}export{x as PieChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DropdownMenu as e}from"./chunk-
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-JPOYR5AO.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
|
|
2
2
|
return r("span",{className:"my-3 w-px shrink-0 bg-gray-200","aria-hidden":!0})}function m({item:e,active:t,caret:i}){/* @__PURE__ */
|
|
3
3
|
return a(n,{children:[e.icon&&/* @__PURE__ */r("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
4
4
|
/* @__PURE__ */r("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */r("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),i&&/* @__PURE__ */r("span",{className:"-ml-1 text-xs","aria-hidden":!0,children:"▾"}),t&&/* @__PURE__ */r("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]})}function d({items:n,activeKey:d,onSelect:o,brand:u,actions:b,linkAs:h,className:g}){/* @__PURE__ */
|