efficient-shell 9.14.0 → 10.1.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 -20
- package/dist/{Browser-42NYVAPR.js → Browser-2S5V2RRU.js} +14 -14
- package/dist/Calculator-N2NLSDTW.js +29 -0
- package/dist/{CurrencyConverter-OIXAMDP7.js → CurrencyConverter-HW5HW3RH.js} +8 -8
- package/dist/{Documents-V2OKP6JZ.js → Documents-JTURYN4D.js} +19 -19
- package/dist/{Files-OAMTKHYK.js → Files-GP2LAGME.js} +88 -88
- package/dist/Notepad-OV66ANUO.js +24 -0
- package/dist/PdfViewer-WNKGFJD6.js +1 -0
- package/dist/{PomodoroTimer-AYGPGA6Q.js → PomodoroTimer-TGUTV47T.js} +25 -25
- package/dist/{Preview-BBQWQ4DG.js → Preview-76A4GKGI.js} +45 -45
- package/dist/{Sidebar-RHGWTAPS.js → Sidebar-4OI4LP6G.js} +36 -36
- package/dist/{Spreadsheet-MS5FU7ET.js → Spreadsheet-FU5QIZA3.js} +14 -14
- package/dist/{Stock-GSQNTV7E.js → Stock-FEVMKWMS.js} +3 -3
- package/dist/{Weather-5XLO2GLO.js → Weather-2EGADOTH.js} +14 -14
- package/dist/{WorldClock-CG3NF4GA.js → WorldClock-U5DIGLOY.js} +6 -6
- package/dist/ai/index.js +33 -33
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/RadarChart.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-2NMW66P5.js +1 -0
- package/dist/{chunk-PUIQFTCO.js → chunk-2OJ3HGFY.js} +5 -5
- package/dist/{chunk-PKIDVVAE.js → chunk-2SLQD57V.js} +5 -5
- package/dist/{chunk-NDEIZUMG.js → chunk-3V6ZERBS.js} +1 -1
- package/dist/{chunk-QO35WRYA.js → chunk-3V74SUZO.js} +17 -17
- package/dist/{chunk-DL6QIWVR.js → chunk-42XMT5JN.js} +1 -1
- package/dist/{chunk-VG5NGCMQ.js → chunk-44PGFMSX.js} +6 -6
- package/dist/{chunk-NU2YQSOP.js → chunk-45XXERGA.js} +2 -2
- package/dist/{chunk-A4HA7EXR.js → chunk-4UX6ET7G.js} +1 -1
- package/dist/{chunk-GXGBBMGV.js → chunk-4VDGVF5T.js} +1 -1
- package/dist/{chunk-VXP5L6DI.js → chunk-5EX6XXUX.js} +1 -1
- package/dist/chunk-5VDT4762.js +3 -0
- package/dist/{chunk-O25B75XX.js → chunk-5VSP3TYU.js} +1 -1
- package/dist/{chunk-R2QDO7NY.js → chunk-6B4F5DWV.js} +3 -3
- package/dist/{chunk-66JYKX4T.js → chunk-6FPDOEOX.js} +1 -1
- package/dist/{chunk-3AZBI76O.js → chunk-7ILNRFEV.js} +1 -1
- package/dist/{chunk-GQK3U2IO.js → chunk-7TONF2PM.js} +1 -1
- package/dist/{chunk-LKW3YAZN.js → chunk-A3VJ4PRU.js} +6 -6
- package/dist/chunk-ACVKU6YW.js +7 -0
- package/dist/{chunk-ELUTQZGP.js → chunk-AEQFFD5I.js} +1 -1
- package/dist/{chunk-QRJRGP2K.js → chunk-AGLBDT7X.js} +8 -8
- package/dist/chunk-AKVB5TQD.js +29 -0
- package/dist/{chunk-M7H3OCIL.js → chunk-ANTH2FBS.js} +57 -57
- package/dist/chunk-AXL7VTNM.js +11 -0
- package/dist/{chunk-7BDZZANS.js → chunk-B7HW6XZD.js} +1 -1
- package/dist/{chunk-XILZGSMX.js → chunk-BDFZNLFQ.js} +1 -1
- package/dist/{chunk-C6MV6IAX.js → chunk-BMXMSAQE.js} +8 -8
- package/dist/{chunk-PUCPFBYO.js → chunk-BNQRPLBW.js} +1 -1
- package/dist/{chunk-JWX7QRGE.js → chunk-BZPPDYEE.js} +1 -1
- package/dist/{chunk-DPDRFLBY.js → chunk-CLQFP42I.js} +3 -3
- package/dist/{chunk-C45OKLRM.js → chunk-CUA6CREW.js} +8 -8
- package/dist/{chunk-RYS3URDC.js → chunk-DY2M6BIG.js} +10 -10
- package/dist/{chunk-EGEWU776.js → chunk-E3RHEEA6.js} +1 -1
- package/dist/{chunk-WFANOFHG.js → chunk-F7A6K3D5.js} +5 -5
- package/dist/{chunk-IKQVK3I3.js → chunk-FFASZGNZ.js} +2 -2
- package/dist/{chunk-MPALY3CL.js → chunk-FMC2XNSP.js} +6 -6
- package/dist/{chunk-D7X2HMMA.js → chunk-FS2KWQJW.js} +10 -10
- package/dist/{chunk-MRUJRFIX.js → chunk-GGIFS34Z.js} +1 -1
- package/dist/chunk-GY67Y5SN.js +10 -0
- package/dist/{chunk-HJPCHES5.js → chunk-GZYTCHPX.js} +4 -4
- package/dist/{chunk-ZREDCRTL.js → chunk-J7CIBRDS.js} +1 -1
- package/dist/{chunk-ZOBLEXIU.js → chunk-JJYAYMY7.js} +1 -1
- package/dist/{chunk-ZPCADTM5.js → chunk-JRBQLRAZ.js} +1 -1
- package/dist/{chunk-YFUMK2E7.js → chunk-JZK3UDOT.js} +1 -1
- package/dist/{chunk-SVQJZF66.js → chunk-K64JRGNE.js} +5 -5
- package/dist/{chunk-2TQ6BLSN.js → chunk-K7PCBUDC.js} +6 -6
- package/dist/{chunk-FSPFV4MI.js → chunk-KKSVRIMP.js} +2 -4
- package/dist/{chunk-D46AP6U5.js → chunk-KZQAGXME.js} +1 -1
- package/dist/{chunk-KTKMM2XW.js → chunk-LFVUDFVU.js} +1 -1
- package/dist/{chunk-FTWWJHFX.js → chunk-LOYCPZUB.js} +1 -1
- package/dist/chunk-LPDI5NL6.js +5 -0
- package/dist/{chunk-BWIX3YIH.js → chunk-M3R4C3A6.js} +2 -2
- package/dist/{chunk-HAFB45DT.js → chunk-MH6DI6YY.js} +11 -11
- package/dist/{chunk-VVVWVOG7.js → chunk-MLKY5ESV.js} +1 -1
- package/dist/{chunk-TGLHJS3M.js → chunk-MUMQ6PW7.js} +1 -1
- package/dist/chunk-N6VP75F5.js +3 -0
- package/dist/{chunk-KAVFW5CU.js → chunk-NNOA7AVG.js} +5 -5
- package/dist/{chunk-6YQPLI5M.js → chunk-NQJKANUP.js} +11 -11
- package/dist/chunk-NW7Z3G7P.js +15 -0
- package/dist/chunk-O6ABVKHU.js +15 -0
- package/dist/{chunk-25STFYV3.js → chunk-OPB3I4JH.js} +4 -4
- package/dist/{chunk-RBD7SB6M.js → chunk-P5YFQ4IQ.js} +1 -1
- package/dist/chunk-PYQ6DD3F.js +1 -0
- package/dist/{chunk-NDKQDIWN.js → chunk-Q4LBBFLO.js} +5 -5
- package/dist/{chunk-X6TJR6M2.js → chunk-Q5YM65DZ.js} +8 -8
- package/dist/{chunk-XOKANFQD.js → chunk-QASKQDUR.js} +16 -16
- package/dist/{chunk-5F7HMNCX.js → chunk-QODTON7V.js} +1 -1
- package/dist/{chunk-7KDGW6BR.js → chunk-QXRRAADR.js} +1 -1
- package/dist/{chunk-VSAI5TH7.js → chunk-R4Q5653D.js} +20 -20
- package/dist/{chunk-DXHLUB36.js → chunk-RKFEJ5CX.js} +1 -1
- package/dist/{chunk-GKZUAT3K.js → chunk-RSIGTZMU.js} +1 -1
- package/dist/{chunk-GNU3U2TP.js → chunk-RZR3OAKV.js} +1 -1
- package/dist/chunk-SKY2NBTQ.js +6 -0
- package/dist/chunk-TDLU6GF5.js +4 -0
- package/dist/{chunk-4E4GWE4L.js → chunk-TYK7VN73.js} +15 -15
- package/dist/{chunk-PKHZTFBK.js → chunk-UDKOJB2B.js} +2 -2
- package/dist/chunk-UP442DPT.js +9 -0
- package/dist/{chunk-OUKDGO4N.js → chunk-V4RYE6KA.js} +8 -8
- package/dist/{chunk-E7WY4GZ3.js → chunk-VMDBVXDJ.js} +1 -1
- package/dist/{chunk-F24QTMTY.js → chunk-VP63OOO4.js} +3 -3
- package/dist/{chunk-GRBBQ3VF.js → chunk-WKSNTMEJ.js} +1 -1
- package/dist/{chunk-M5YG57UP.js → chunk-X6YT3I5F.js} +1 -1
- package/dist/{chunk-76IDLFXI.js → chunk-XABYSSXW.js} +1 -1
- package/dist/{chunk-GSBIJLTD.js → chunk-XAROKI7X.js} +1 -1
- package/dist/{chunk-ZMVCN4OA.js → chunk-XHMIJ7S3.js} +7 -7
- package/dist/{chunk-Q7HN6T3H.js → chunk-XNKIDGZW.js} +1 -1
- package/dist/{chunk-B4DR72FR.js → chunk-XQQNA246.js} +1 -1
- package/dist/{chunk-M33225G6.js → chunk-XZBQ3XXD.js} +1 -1
- package/dist/{chunk-UX5L3MOB.js → chunk-Y23TGQFN.js} +4 -4
- package/dist/chunk-ZLHPCPXS.js +19 -0
- package/dist/{chunk-LPUGK2MC.js → chunk-ZN2BFSQR.js} +2 -2
- package/dist/{chunk-TXMAWCR7.js → chunk-ZRZ5LOW3.js} +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.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/PositionInput.js +1 -1
- package/dist/forms/Select.d.ts +0 -6
- 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/Switch.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/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/settingRowContext.d.ts +1 -3
- package/dist/forms/settingRowContext.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.js +90 -91
- package/dist/map/index.js +3 -3
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.d.ts +22 -12
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.d.ts +23 -5
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.d.ts +9 -14
- 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/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/telemetry/index.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/FormLayoutPage.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +247 -32
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-PCTFUS5O.js +0 -29
- package/dist/Notepad-3LG227K2.js +0 -25
- package/dist/PdfViewer-DFBPEUY5.js +0 -1
- package/dist/chunk-6TCJOVFX.js +0 -3
- package/dist/chunk-A7CCSRPB.js +0 -12
- package/dist/chunk-AEJNFA2K.js +0 -6
- package/dist/chunk-AVAYZK3Z.js +0 -3
- package/dist/chunk-BGNJQMAZ.js +0 -1
- package/dist/chunk-EXJZUNNW.js +0 -29
- package/dist/chunk-KJXF5WAJ.js +0 -5
- package/dist/chunk-L65BESIE.js +0 -1
- package/dist/chunk-ME4VRJMK.js +0 -16
- package/dist/chunk-MNIULUQY.js +0 -14
- package/dist/chunk-NFJDLIRM.js +0 -5
- package/dist/chunk-TIUFFVP5.js +0 -9
- package/dist/chunk-UXPZQID4.js +0 -20
- package/dist/chunk-VVZE27M4.js +0 -7
- package/dist/chunk-XSJJPACH.js +0 -11
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{DragBand as e,tooltipBesideBand as t}from"./chunk-7VCAMNCH.js";import{niceAxis as r,niceMax as i,linearScale as n,axisGutter as o,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{
|
|
1
|
+
import{DragBand as e,tooltipBesideBand as t}from"./chunk-7VCAMNCH.js";import{niceAxis as r,niceMax as i,linearScale as n,axisGutter as o,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{CHART_INK as h}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-X2PZMXDP.js";import{formatPlain as d}from"./chunk-C3QOHMR6.js";import{useRef as u,useState as f,useId as g,useEffect as p}from"react";import{jsx as x,jsxs as y}from"react/jsx-runtime";function v({labels:v,values:b,height:M=220,width:k,bandPadding:w=.24,min:N,max:A,yTickCount:P=4,formatValue:$,yAxisLabel:j,xTickAnchor:C="center",children:D,overlay:E,tooltip:R,onSelect:U,zoom:z,ariaLabel:L,className:S,emptyLabel:V}){const F=c().charts,I=m(),T=$??(e=>d(e,I)),W=V??F.noData,X=u(null),Z=a(X),B=k??Z,[H,Q]=f(null),J=g();if(p(()=>{if(null!==H)return s(e=>"Escape"===e.key&&(Q(null),!0))},[H]),0===v.length||!b.some(Number.isFinite))/* @__PURE__ */
|
|
2
2
|
return x("div",{className:S,ref:X,children:/* @__PURE__ */x("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:M},children:W})});const K=b.filter(Number.isFinite),O=K.every(Number.isInteger),q=void 0===N&&void 0===A?r(Math.min(0,...K),Math.max(0,...K),{intervals:P+1,integer:O}):null,G=void 0!==N&&void 0===A?r(N,Math.max(N,...K),{intervals:P+1,integer:O,zero:!1}):null,Y=q?q.lo:N??Math.min(0,...K),_=q?q.hi:G?G.hi:A??i(Math.max(...K,0)),ee=q?q.ticks:G?[Y,...G.ticks.filter(e=>e>Y)]:n([Y,_],{from:0,to:1}).ticks(P+1),te={top:12,right:16,bottom:26,left:o(ee.map(T),48)+(j?10:0)},re=te.left,ie=Math.max(re+1,B-te.right),ne=te.top,oe=M-te.bottom,le=n([Y,_],{from:oe,to:ne}),ae=l(v.length,{from:re,to:ie},w),he=(ie-re)/Math.max(1,v.length),se=he>=48,ce=se?1:Math.max(1,Math.ceil(v.length/Math.max(1,Math.floor(B/84)))),me=Math.max(2,Math.floor((he-6)/6.6)),de=e=>se&&e.length>me?`${e.slice(0,me-1).trimEnd()}…`:e;/* @__PURE__ */
|
|
3
3
|
return y("div",{className:`relative ${S??""}`,ref:X,children:[
|
|
4
4
|
/* @__PURE__ */y("svg",{width:"100%",height:M,viewBox:`0 0 ${B} ${M}`,role:"img","aria-label":L,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Q(null),onBlur:()=>Q(null),onKeyDown:e=>{if(U&&null!==H&&("Enter"===e.key||" "===e.key))return e.preventDefault(),void U(H);if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1;Q(e=>Math.min(v.length-1,Math.max(0,(e??0)+t)))},style:z?{userSelect:"none",touchAction:"pan-y"}:void 0,children:[
|
|
5
|
-
/* @__PURE__ */x("defs",{children:/* @__PURE__ */x("clipPath",{id:J,children:/* @__PURE__ */x("rect",{x:re,y:ne,width:ie-re,height:oe-ne})})}),ee.map(e=>/* @__PURE__ */x("line",{x1:re,y1:le(e),x2:ie,y2:le(e),stroke:
|
|
6
|
-
/* @__PURE__ */x("line",{x1:re,y1:le(Math.max(Y,0)),x2:ie,y2:le(Math.max(Y,0)),stroke:
|
|
7
|
-
/* @__PURE__ */x("g",{clipPath:`url(#${J})`,children:D({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:B,height:M,clipId:J,active:H})}),E?.({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:B,height:M,clipId:J,active:H}),v.map((e,t)=>t%ce===0?/* @__PURE__ */x("text",{x:"start"===C?ae(t):ae.center(t),y:M-8,textAnchor:"middle",fontSize:11,fill:
|
|
5
|
+
/* @__PURE__ */x("defs",{children:/* @__PURE__ */x("clipPath",{id:J,children:/* @__PURE__ */x("rect",{x:re,y:ne,width:ie-re,height:oe-ne})})}),ee.map(e=>/* @__PURE__ */x("line",{x1:re,y1:le(e),x2:ie,y2:le(e),stroke:h.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
|
|
6
|
+
/* @__PURE__ */x("line",{x1:re,y1:le(Math.max(Y,0)),x2:ie,y2:le(Math.max(Y,0)),stroke:h.axis,strokeWidth:1,shapeRendering:"crispEdges"}),ee.map(e=>/* @__PURE__ */x("text",{x:re-8,y:le(e)+4,textAnchor:"end",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:T(e)},`t${e}`)),j&&/* @__PURE__ */x("text",{x:14,y:(ne+oe)/2,transform:`rotate(-90 14 ${(ne+oe)/2})`,textAnchor:"middle",fontSize:11,fill:h.label,children:j}),
|
|
7
|
+
/* @__PURE__ */x("g",{clipPath:`url(#${J})`,children:D({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:B,height:M,clipId:J,active:H})}),E?.({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:B,height:M,clipId:J,active:H}),v.map((e,t)=>t%ce===0?/* @__PURE__ */x("text",{x:"start"===C?ae(t):ae.center(t),y:M-8,textAnchor:"middle",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:de(e)},`x${t}`):null),z?.drag&&/* @__PURE__ */x(e,{x0:ae.center(z.drag[0])-(ie-re)/v.length/2,x1:ae.center(z.drag[1])+(ie-re)/v.length/2,top:ne,bottom:oe}),v.map((e,t)=>/* @__PURE__ */x("rect",{x:ae.center(t)-(ie-re)/v.length/2,y:ne,width:(ie-re)/v.length,height:oe-ne,fill:"transparent",onMouseEnter:()=>Q(t),onPointerDown:z?()=>z.press(t):void 0,onPointerEnter:z?()=>z.over(t):void 0,onPointerUp:z?.release,onClick:U?()=>U(t):void 0,style:U?{cursor:"pointer"}:void 0},`h${t}`))]}),R&&null!==H&&
|
|
8
8
|
/* @__PURE__ */x("div",{className:"pointer-events-none absolute top-2 z-10",style:t(ae.center(H),ae.bandwidth,B),children:R(H)})]})}export{v as CartesianPlot};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-KKSVRIMP.js";import{SpinnerRing as t}from"./chunk-R2VKEMZH.js";import{useState as a,useId as r,Children as s,isValidElement as i}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";function c({summary:t,busy:c=!1,open:o,onOpenChange:d,label:m="Steps",className:u="",children:p}){const[f,h]=a(null),g=r(),x=o??f??c;return 1===s.toArray(p).filter(i).length?/* @__PURE__ */n("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:/* @__PURE__ */n("ol",{"aria-label":m,children:p})}):/* @__PURE__ */l("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:[
|
|
2
2
|
/* @__PURE__ */l("button",{type:"button",onClick:()=>{h(!x),d?.(!x)},"aria-expanded":x,"aria-controls":x?g:void 0,className:"flex w-full items-center gap-2 rounded text-left hover:text-gray-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600",children:[
|
|
3
3
|
/* @__PURE__ */n(e,{name:"chevron-right",size:12,className:"shrink-0 motion-safe:transition-transform "+(x?"rotate-90":"")}),
|
|
4
4
|
/* @__PURE__ */n("span",{"aria-live":"polite",className:"min-w-0 flex-1 truncate",children:t})]}),x&&/* @__PURE__ */n("ol",{id:g,"aria-label":m,className:"mt-2 ml-2 space-y-2 border-l border-gray-200 pl-3",children:p})]})}var o={pending:"text-gray-400",active:"text-gray-800",complete:"text-gray-600",failed:"text-red-600",stopped:"text-gray-500",waiting:"text-amber-700",skipped:"text-gray-400"},d={pending:"Pending",active:"In progress",complete:"Done",failed:"Failed",stopped:"Stopped",waiting:"Waiting for you",skipped:"Skipped"};function m({status:a}){switch(a){case"active":/* @__PURE__ */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="10.1.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{optionMatches as e,OptionSublabel as t}from"./chunk-
|
|
1
|
+
import{optionMatches as e,OptionSublabel as t}from"./chunk-QODTON7V.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-LNARMEEZ.js";import{Tooltip as r}from"./chunk-BCDG4N6L.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-DTJRIWFR.js";import{useShellStrings as d}from"./chunk-X2PZMXDP.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:D,id:L,className:E="",tone:M,tooltip:W,split:$}){const[B,T]=m(!1),[F,G]=m(""),I=d(),J=h(null),P=h(null),R=h(null),S=s(J,B),Y=e=>k.find(t=>t.value===e)?.label??e,Z=p(()=>{const t=new Set(o),n=[],r=F.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,F]),A=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)},H=e=>{e&&!o.includes(e)?(y([...o,e]),G("")):G("")},O=e=>y(o.filter(t=>t!==e)),X=()=>{const e=F.trim();if($&&e)return A(e.split($)),void G("");j&&e?H(e):G("")},z=h(()=>{});z.current=()=>{X(),T(!1)},f(()=>{if(!B)return;const e=e=>{const t=e.target;J.current?.contains(t)||R.current?.contains(t)||(X(),T(!1))};document.addEventListener("mousedown",e);const t=l(()=>z.current());return()=>{document.removeEventListener("mousedown",e),t()}});const K=k.length>0;/* @__PURE__ */
|
|
2
2
|
return g("div",{ref:J,className:"relative",children:[
|
|
3
|
-
/* @__PURE__ */g("div",{onMouseDown:e=>{
|
|
4
|
-
/* @__PURE__ */x("span",{className:"truncate",children:
|
|
5
|
-
/* @__PURE__ */x("input",{id:
|
|
6
|
-
/* @__PURE__ */x("div",{ref:R,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:S?.left,right:S?.right,top:S?.top,bottom:S?.bottom,minWidth:S?.minWidth,maxWidth:S?.maxWidth??a,width:"max-content",visibility:S?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:S?.maxHeight??c},children:0===
|
|
3
|
+
/* @__PURE__ */g("div",{onMouseDown:e=>{D||e.target.closest("button")||(e.preventDefault(),P.current?.focus())},className:n({invalid:C,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${D?"bg-gray-50 cursor-not-allowed":""} ${E}`}),children:[o.map(e=>{const t=M?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
+
/* @__PURE__ */x("span",{className:"truncate",children:Y(e)}),!D&&/* @__PURE__ */x("button",{type:"button","aria-label":I.select.removeItem?.(Y(e))??`${I.select.remove} ${Y(e)}`,onClick:()=>O(e),className:n.remove,children:"×"})]},e),l=W?.(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:L,ref:P,type:"text",autoComplete:"off",role:"combobox","aria-expanded":B&&K,"aria-invalid":C||void 0,disabled:D,value:F,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if($){const t=e.split($);if(t.length>1)return A(t.slice(0,-1)),void G(t[t.length-1])}G(e)})(e.target.value),T(!0)},onFocus:()=>{!D&&K&&T(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=F.trim(),o=n?Z.filter(t=>e(t,n.toLowerCase())):[];1===o.length?H(o[0].value):X()}else"Backspace"===t.key&&""===F&&o.length>0?O(o[o.length-1]):"Escape"===t.key?(T(!1),G(""),P.current?.blur()):"Tab"===t.key&&(X(),T(!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"})]}),B&&K&&v(
|
|
6
|
+
/* @__PURE__ */x("div",{ref:R,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:S?.left,right:S?.right,top:S?.top,bottom:S?.bottom,minWidth:S?.minWidth,maxWidth:S?.maxWidth??a,width:"max-content",visibility:S?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:S?.maxHeight??c},children:0===Z.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?I.select.allSelected:I.select.noMatches}):Z.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),H(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,9 +1,9 @@
|
|
|
1
|
-
import{toISODate as e}from"./chunk-
|
|
2
|
-
return y("input",{ref:
|
|
1
|
+
import{toISODate as e}from"./chunk-R4Q5653D.js";import{Calendar as t}from"./chunk-FS2KWQJW.js";import{inputClasses as r,PLACEHOLDER_INK as a}from"./chunk-AYZY3YNC.js";import{calendarNames as n}from"./chunk-5OTS2G3M.js";import{Icon as i}from"./chunk-KKSVRIMP.js";import{onOverlayOpen as o}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{useDropdownPosition as s}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as d}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-X2PZMXDP.js";import{forwardRef as f,useState as b,useRef as p,useId as h,useEffect as v}from"react";import{createPortal as g}from"react-dom";import{jsx as y,jsxs as x}from"react/jsx-runtime";var N=/^\d{4}-\d{2}-\d{2}$/,k=/^(aria|data)-/,j=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function w(t){if(null==t||""===t)return"";if(t instanceof Date)return Number.isNaN(t.getTime())?"":e(t);if(N.test(t))return t;const r=new Date(t);return Number.isNaN(r.getTime())?"":e(r)}function D(e){if(!N.test(e))return null;const[t,r,a]=e.split("-").map(Number),n=new Date(t,r-1,a);return n.getMonth()===r-1&&n.getDate()===a?n:null}function F(e,t){const r=D(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var S=f(function({value:f,onChange:N,min:S,max:W,invalid:B,size:C,native:M,weekStartsOn:$,className:q="","aria-label":E,"aria-describedby":I,"aria-labelledby":O,id:P,name:T,disabled:z,placeholder:J,required:L,clearable:U,form:Y,title:G,tabIndex:K,autoFocus:Q,onFocus:R,onBlur:V,...X},Z){const A=U??!L,H=w(f),_=w(S),ee=w(W),te=c().datePicker,re=m(),ae=n(re),[ne,ie]=b(!1),oe=p(null),le=p(null),se=p(null),de=h(),ue=h(),ce=h(),me=s(le,ne,{popupRef:se}),[fe,be]=b(!1);d(()=>{const e=!!P&&(le.current?.labels?.length??0)>0;e!==fe&&be(e)});const pe=!E&&(!!O||fe);if(v(()=>{if(!ne)return;const e=e=>{const t=e.target;oe.current?.contains(t)||se.current?.contains(t)||ie(!1)};document.addEventListener("pointerdown",e,!0);const t=o(()=>ie(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[ne]),v(()=>{if(ne)return u(e=>"Escape"===e.key&&(ie(!1),le.current?.focus(),!0),()=>se.current)},[ne]),M)/* @__PURE__ */
|
|
2
|
+
return y("input",{ref:Z,type:"date",lang:re,id:P,name:T,disabled:z,"aria-label":E,"aria-describedby":I,"aria-invalid":B||void 0,value:H,min:_||void 0,max:ee||void 0,onChange:e=>N?.(D(e.target.value)),className:r({invalid:B,size:C,className:q}),"aria-labelledby":O,required:L,form:Y,title:G,tabIndex:K,autoFocus:Q,onFocus:R,onBlur:V,...X});const he=Object.fromEntries(Object.entries(X).filter(([e])=>k.test(e)&&!j.has(e))),ve=X["aria-required"],ge=!!L||!0===ve||"true"===ve,ye=[pe?ue:void 0,ge?ce:void 0,I].filter(Boolean).join(" ")||void 0,xe=e(/* @__PURE__ */new Date),Ne=(!_||xe>=_)&&(!ee||xe<=ee),ke=J??te.placeholder;/* @__PURE__ */
|
|
3
3
|
return x("div",{ref:oe,className:"relative",children:[
|
|
4
|
-
/* @__PURE__ */y("input",{ref:
|
|
5
|
-
/* @__PURE__ */x("button",{ref:le,type:"button",...he,id:P,disabled:z,title:G,tabIndex:
|
|
6
|
-
/* @__PURE__ */y("span",{className:
|
|
7
|
-
/* @__PURE__ */y(i,{name:"date",className:`h-4 w-4 shrink-0 ${a}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */y("span",{id:ue,className:"sr-only",children:
|
|
8
|
-
/* @__PURE__ */x("div",{ref:se,id:de,role:"dialog","aria-label":
|
|
9
|
-
/* @__PURE__ */y(t,{value:
|
|
4
|
+
/* @__PURE__ */y("input",{ref:Z,type:"hidden",name:T,form:Y,value:H}),
|
|
5
|
+
/* @__PURE__ */x("button",{ref:le,type:"button",...he,id:P,disabled:z,title:G,tabIndex:K,autoFocus:Q,onFocus:R,onBlur:V,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?de:void 0,"aria-labelledby":O,"aria-describedby":ye,"aria-label":E?`${E}${H?`, ${F(H,ae)}`:""}`:void 0,onClick:()=>ie(e=>!e),className:`${r({invalid:B,size:C,className:q})} flex items-center justify-between text-left`,children:[
|
|
6
|
+
/* @__PURE__ */y("span",{className:H?"text-ink-strongest":a,children:H?F(H,ae):ke}),
|
|
7
|
+
/* @__PURE__ */y(i,{name:"date",className:`h-4 w-4 shrink-0 ${a}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */y("span",{id:ue,className:"sr-only",children:H?F(H,ae):ke}),ge&&/* @__PURE__ */y("span",{id:ce,className:"sr-only",children:te.required}),ne&&g(
|
|
8
|
+
/* @__PURE__ */x("div",{ref:se,id:de,role:"dialog","aria-label":E??te.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:l.popup,left:me?.left,right:me?.right,top:me?.top,bottom:me?.bottom,maxWidth:me?.maxWidth,visibility:me?void 0:"hidden"},children:[
|
|
9
|
+
/* @__PURE__ */y(t,{value:H||null,min:_||null,max:ee||null,weekStartsOn:$,onSelect:e=>{ie(!1),le.current?.focus(),N?.(D(e))}}),(A||Ne)&&/* @__PURE__ */x("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[A&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),N?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:te.clear}),Ne&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),N?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:te.today})]})]}),document.body)]})});export{S as DatePicker_default};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return I("div",{className:wt,ref:Rt,children:/* @__PURE__ */I(
|
|
3
|
-
return I("div",{className:wt,ref:Rt,children:/* @__PURE__ */I("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:K},children:At})});const Gt=X.map((t,e)=>Xt.reduce((t,a)=>t+(Y(a.data[e])?a.data[e]:0),0)),Jt=(t,e)=>Gt[e]>0?t/Gt[e]:null,qt=[];if(G){let t=X.map(()=>0);for(const e of Xt)t=t.map((t,a)=>t+(Y(e.data[a])?e.data[a]:0)),qt.push("percent"===J?t.map((t,e)=>Jt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!G&&!_t&&void 0===et&&Xt.some(te)&&Xt.some(t=>!te(t)),ae=gt&&!G?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Xt.filter(t=>!te(t)):Xt).filter(t=>!re(t)),le=ee?Xt.filter(te).flatMap(t=>t.data.filter(Y)):[],ne=G?(qt.at(-1)??[]).filter(Y):oe.flatMap(t=>t.data.filter(Y)),ie=ee?
|
|
1
|
+
import{ChartBrush as t}from"./chunk-RQNZ2PVW.js";import{ChartDot as e}from"./chunk-CK2YOGUS.js";import{stepPath as a,curvePath as r,areaBetween as o,areaFrom as l}from"./chunk-VFC6QUEN.js";import{ChartDefs as n,MOTION as i,stagger as s,fillFor as c,dashFor as d,maskId as m}from"./chunk-465RRWBY.js";import{ChartSkeleton as h}from"./chunk-BMQCUHSD.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{ChartTooltip as p}from"./chunk-TLRCTNUF.js";import{useDragZoom as g,DragBand as y,ChartZoomSummary as k,tooltipBesideBand as x}from"./chunk-7VCAMNCH.js";import{pairedAxes as v,niceAxis as b,niceMax as M,linearScale as N,axisGutter as w,bandScale as j,ladderScale as $}from"./chunk-2JWPNR2U.js";import{usePlotWidth as V}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as C,CHART_INK as z,STATUS_VARS as A}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as R}from"./chunk-TWVUQUUD.js";import{useShellStrings as L,useShellLocale as S}from"./chunk-X2PZMXDP.js";import{formatPercent as W,formatPlain as D}from"./chunk-C3QOHMR6.js";import{useRef as E,useState as T,useId as U,useEffect as P}from"react";import{jsx as I,jsxs as F}from"react/jsx-runtime";var B=12,O=16,Q=26,H=52,Y=t=>"number"==typeof t&&Number.isFinite(t);function Z({series:Z,labels:X,height:K=200,stacked:G=!1,stackMode:J="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=L().charts,Vt=S(),Ct=rt??(t=>D(t,Vt)),zt=ot??Ct,At=jt??$t.noData,Rt=E(null),Lt=V(Rt),St=Nt??Lt,[Wt,Dt]=T(null),[Et,Tt]=T(null),{highlighted:Ut}=u(),Pt=U(),It=ut??Et,Ft=g(ht&&It?It[1]-It[0]+1:X.length,pt);if(P(()=>{if(null!==Wt)return R(t=>"Escape"===t.key&&(Dt(null),!0))},[Wt]),kt)/* @__PURE__ */
|
|
2
|
+
return I("div",{className:wt,ref:Rt,children:/* @__PURE__ */I(h,{height:K,width:Nt??Lt})});const Bt=X,Ot=ut??Et??[0,Math.max(0,Bt.length-1)],[Qt,Ht]=Ot,Yt=t=>Ft.slice(ht?t.slice(Qt,Ht+1):t),Zt=lt?Yt(lt):void 0,Xt=Z.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(Y)).map(t=>({...t,data:Yt(t.data),pointTones:t.pointTones?Yt(t.pointTones):void 0})),Kt=t=>(ht?Qt:0)+(Ft.view?.[0]??0)+t;if(X=Yt(Bt),0===Xt.length||0===X.length)/* @__PURE__ */
|
|
3
|
+
return I("div",{className:wt,ref:Rt,children:/* @__PURE__ */I("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:K},children:At})});const Gt=X.map((t,e)=>Xt.reduce((t,a)=>t+(Y(a.data[e])?a.data[e]:0),0)),Jt=(t,e)=>Gt[e]>0?t/Gt[e]:null,qt=[];if(G){let t=X.map(()=>0);for(const e of Xt)t=t.map((t,a)=>t+(Y(e.data[a])?e.data[a]:0)),qt.push("percent"===J?t.map((t,e)=>Jt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!G&&!_t&&void 0===et&&Xt.some(te)&&Xt.some(t=>!te(t)),ae=gt&&!G?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Xt.filter(t=>!te(t)):Xt).filter(t=>!re(t)),le=ee?Xt.filter(te).flatMap(t=>t.data.filter(Y)):[],ne=G?(qt.at(-1)??[]).filter(Y):oe.flatMap(t=>t.data.filter(Y)),ie=ee?v([Math.min(0,...ne),Math.max(0,...ne)],[Math.min(0,...le),Math.max(0,...le)],{intervals:at+1,integerLeft:ne.every(Number.isInteger),integerRight:le.every(Number.isInteger)}):null,se=ie?ie.left:G&&"percent"===J||_t||void 0!==et?null:b(G?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=G&&"percent"===J?1:se?se.hi:et??M(Math.max(...ne,0)),me=G&&"percent"===J?t=>W(Math.round(100*t),0,Vt):Ct,he=_t?q:se?se.ticks:N([ce,de],{from:0,to:1}).ticks(at+1),ue=w(he.map(me),H),fe=ie?w(ie.right.ticks.map(Ct),O):O,pe={left:ue,right:Math.max(ue+1,St-fe),top:B,bottom:K-Q},ge=j(X.length,{from:pe.left,to:pe.right}),ye=_t?$(q,{from:pe.bottom,to:pe.top}):null,ke=N([ce,de],{from:pe.bottom,to:pe.top}),xe=ke(Math.max(ce,0)),ve=t=>ye?ye(t):ke(t),be=Xt.filter(re),Me=Math.max(0,...X.map((t,e)=>be.reduce((t,a)=>t+Math.max(0,Y(a.data[e])?a.data[e]:0),0))),Ne=t=>xe-(Me>0?t/Me:0)*(pe.bottom-pe.top)*(ae??0),we=ie?N([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,je=t=>we&&te(t)?we:ve,$e=ye?ye.levels.map(t=>({value:t,y:ye(t)})):he.map(t=>({value:t,y:ke(t)})),Ve=t=>e=>{e.preventDefault(),Dt(e=>{const a=(e??0)+t;return Math.min(X.length-1,Math.max(0,a))})},Ce=Math.max(1,Math.ceil(X.length/Math.max(1,Math.floor(St/96))));/* @__PURE__ */
|
|
4
4
|
return F("div",{className:`relative ${wt??""}`,ref:Rt,children:[
|
|
5
5
|
/* @__PURE__ */F("svg",{width:"100%",height:K,viewBox:`0 0 ${St} ${K}`,role:"img","aria-label":$t.overIntervals(Xt.map(t=>t.label),X.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Dt(null),onBlur:()=>Dt(null),style:pt?{userSelect:"none",touchAction:"pan-y"}:void 0,onKeyDown:t=>{if(yt&&null!==Wt&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void yt(Kt(Wt));"ArrowRight"===t.key&&Ve(1)(t),"ArrowLeft"===t.key&&Ve(-1)(t)},children:[
|
|
6
6
|
/* @__PURE__ */I("defs",{children:/* @__PURE__ */I("clipPath",{id:Pt,children:/* @__PURE__ */I("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
|
|
7
|
-
/* @__PURE__ */I(
|
|
8
|
-
/* @__PURE__ */I("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:
|
|
9
|
-
/* @__PURE__ */I("g",{clipPath:`url(#${Pt})`,mask:xt&&vt?`url(#${
|
|
10
|
-
return I("path",{d:e
|
|
11
|
-
return I("rect",{x:ge.center(
|
|
12
|
-
return I("rect",{x:ge.center(
|
|
7
|
+
/* @__PURE__ */I(n,{id:Pt,fills:Xt.map((t,e)=>({color:C(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:G?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */I("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:z.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
|
|
8
|
+
/* @__PURE__ */I("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:z.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */I("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */I("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:Ct(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */I("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:z.label,children:nt}),
|
|
9
|
+
/* @__PURE__ */I("g",{clipPath:`url(#${Pt})`,mask:xt&&vt?`url(#${m(Pt)})`:void 0,children:Xt.map((t,e)=>{const n=C(t.slot,t.color,t.tone),m=t.mode??(G?"area":"line"),h=f(t.key,Ut);if("step"===m){const e=X.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>Y(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
|
|
10
|
+
return I("path",{d:a(e),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:h??void 0,className:"rosh-viz-mark"},t.key)}const u=X.map((a,r)=>{const o=G?qt[e]?.[r]:t.data[r];return Y(o)?[ge.center(r),je(t)(o)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===m){const a=Math.max(1,.62*ge.bandwidth),r="solid"===t.fillVariant,o=je(t);return re(t)?/* @__PURE__ */I("g",{opacity:h??void 0,className:"rosh-viz-mark",children:X.map((o,l)=>{const i=t.data[l];if(!Y(i)||i<=0)return null;const s=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Xt[t]?.key)).reduce((t,a)=>t+Math.max(0,Y(a.data[e])?a.data[e]:0),0))(e,l),c=Ne(s+i),d=Ne(s)-(s>0?1:0);/* @__PURE__ */
|
|
11
|
+
return I("rect",{x:ge.center(l)-a/2,y:c,width:a,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[l]?A[t.pointTones[l]]:n,fillOpacity:r?1:.55},l)})},t.key):/* @__PURE__ */I("g",{opacity:h??void 0,className:"rosh-viz-mark",children:X.map((l,c)=>{const d=G?qt[e]?.[c]:t.data[c];if(!Y(d))return null;const m=o(d);/* @__PURE__ */
|
|
12
|
+
return I("rect",{x:ge.center(c)-a/2,y:Math.min(m,xe),width:a,height:Math.abs(xe-m),rx:2,fill:n,fillOpacity:r?1:.35,className:xt?i.rise:void 0,style:xt?s(c,26):void 0},c)})},t.key)}const p=r(u,_,tt),g=G&&e>0?X.map((t,a)=>[ge.center(a),ve(qt[e-1]?.[a]??0)-2]):null,y=g?o(p,g):l(p,u,xe);/* @__PURE__ */
|
|
13
13
|
return F("g",{opacity:h??void 0,className:"rosh-viz-mark",children:[("area"===m||G)&&
|
|
14
|
-
/* @__PURE__ */I("path",{d:y,fill:
|
|
15
|
-
/* @__PURE__ */I("path",{d:p,fill:"none",stroke:
|
|
14
|
+
/* @__PURE__ */I("path",{d:y,fill:c(Pt,e,t.fillVariant??bt,n),stroke:"none"}),
|
|
15
|
+
/* @__PURE__ */I("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:d(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?i.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??A[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
|
|
16
16
|
return F("g",{children:[
|
|
17
|
-
/* @__PURE__ */I("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */I("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Xt.map((
|
|
18
|
-
return F("g",{children:[n.map(r=>{const n=G?qt[a]?.[r]:
|
|
17
|
+
/* @__PURE__ */I("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */I("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Xt.map((t,a)=>{if("column"===t.mode)return null;const r=ct??(st?"last":"none"),o=C(t.slot,t.color,t.tone),l=[...t.data].map(Y).lastIndexOf(!0),n="all"===r?X.map((t,e)=>e).filter(e=>Y(G?qt[a]?.[e]:t.data[e])):l>=0?[l]:[];/* @__PURE__ */
|
|
18
|
+
return F("g",{children:[n.map(r=>{const n=G?qt[a]?.[r]:t.data[r];return Y(n)?/* @__PURE__ */I(e,{cx:ge.center(r),cy:je(t)(n),color:o,variant:dt,pulse:mt&&r===l,title:`${X[r]}: ${t.label} ${Ct(n)}`},r):null}),st&&l>=0&&Y(G?qt[a]?.[l]:t.data[l])&&/* @__PURE__ */I("text",{x:ge.center(l)-10,y:je(t)(G?qt[a]?.[l]:t.data[l])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:Ct(G?qt[a]?.[l]:t.data[l])})]},`dots-${t.key}`)}),X.map((t,e)=>e%Ce===0?/* @__PURE__ */I("text",{x:ge.center(e),y:K-8,textAnchor:"middle",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Wt&&/* @__PURE__ */I("line",{x1:ge.center(Wt),y1:pe.top,x2:ge.center(Wt),y2:pe.bottom,stroke:z.axis,strokeWidth:1}),ae&&Me>0&&
|
|
19
19
|
/* @__PURE__ */F("g",{pointerEvents:"none","data-column-strip":"true",children:[
|
|
20
|
-
/* @__PURE__ */I("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:
|
|
21
|
-
/* @__PURE__ */I("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:
|
|
22
|
-
/* @__PURE__ */I("div",{className:"pointer-events-none absolute top-2 z-10",style:
|
|
20
|
+
/* @__PURE__ */I("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:z.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
|
|
21
|
+
/* @__PURE__ */I("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:Ct(Me)})]}),Ft.drag&&/* @__PURE__ */I(y,{x0:ge(Ft.drag[0]),x1:ge(Ft.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),X.map((t,e)=>/* @__PURE__ */I("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Dt(e),onPointerDown:()=>Ft.press(e),onPointerEnter:()=>Ft.over(e),onPointerUp:Ft.release,onClick:yt?()=>yt(Kt(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Ft.view&&/* @__PURE__ */I(k,{from:Zt?.[0]??X[0],to:Zt?.at(-1)??X[X.length-1],count:X.length,total:G&&"percent"!==J?zt(Gt.reduce((t,e)=>t+e,0)):ae?zt(be.reduce((t,e)=>t+e.data.filter(Y).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Xt).filter(t=>t.data.some(Y)).map(t=>{const e=t.data.filter(Y),a=C(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=G||"column"===t.mode?zt(r):$t.zoomLevel(zt(r/e.length),zt(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Ft.clear}),ht&&Bt.length>2&&/* @__PURE__ */I(t,{className:"mt-1",labels:Bt,width:St,data:Z[0]?.data??[],range:Ot,onRangeChange:t=>{ft?ft(t):Tt(t)}}),null!==Wt&&
|
|
22
|
+
/* @__PURE__ */I("div",{className:"pointer-events-none absolute top-2 z-10",style:x(ge.center(Wt),ge.bandwidth,St),children:/* @__PURE__ */I(p,{title:Zt?.[Wt]??X[Wt],rows:Xt.map((t,e)=>({key:t.key,label:t.label,color:C(t.slot,t.color,t.tone),value:Y(t.data[Wt])?G&&"percent"===J?`${W(100*(Jt(t.data[Wt],Wt)??0),1,Vt)} · ${zt(t.data[Wt])}`:zt(t.data[Wt]):void 0})),footnote:G&&"percent"===J?$t.inBucket(zt(Gt[Wt])):void 0})})]})}export{Z as TimeSeriesChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as t}from"./chunk-
|
|
1
|
+
import{Icon as t}from"./chunk-KKSVRIMP.js";import{jsxs as n,jsx as e}from"react/jsx-runtime";var r=t=>Array.isArray(t.options);function o(t){const n=[];for(const e of t)r(e)?n.push(...e.options):n.push(e);return n}function i(t,n){const e=[];for(const o of t){if(!r(o)){n(o)&&e.push(o);continue}const t=o.options.filter(n);t.length&&e.push({...o,options:t})}return e}function s(t,o,i,s=""){const a=[];let c=0;return t.forEach((t,u)=>{if(!r(t))return a.push(o(t,c)),void(c+=1);const l=`${i}-group-${u}`,p=c;c+=t.options.length,a.push(
|
|
2
2
|
/* @__PURE__ */n("div",{role:"group","aria-labelledby":l,children:[
|
|
3
3
|
/* @__PURE__ */e("div",{id:l,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${s}`.trim(),children:t.label}),t.options.map((t,n)=>o(t,p+n))]},l))}),a}function a({selected:n}){/* @__PURE__ */
|
|
4
4
|
return e(t,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(n?"":"invisible"),strokeWidth:2.5})}function c(t,n){return t.label.toLowerCase().includes(n)||(t.sublabel?.toLowerCase().includes(n)??!1)}function u({children:t,grows:n=!1}){/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ChartTooltip as t}from"./chunk-TLRCTNUF.js";import{CartesianPlot as a}from"./chunk-
|
|
1
|
+
import{ChartTooltip as t}from"./chunk-TLRCTNUF.js";import{CartesianPlot as a}from"./chunk-OPB3I4JH.js";import{CHART_INK as e,STATUS_VARS as l}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-X2PZMXDP.js";import{formatPlain as n}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as s}from"react/jsx-runtime";function c({steps:c,height:u=240,width:m,formatValue:h,yAxisLabel:f,className:p,emptyLabel:d,radius:b=3,connectors:g=!0}){const v=o().charts,x=r(),y=h??(t=>n(t,x));let k=0;const M=c.map(t=>{if(t.total){const a={from:0,to:k,value:k,total:!0};return{...t,...a}}const a=k;return k+=t.value,{...t,from:a,to:k,value:t.value,total:!1}}),j=M.flatMap(t=>[t.from,t.to]);/* @__PURE__ */
|
|
2
2
|
return i(a,{labels:c.map(t=>t.label),values:j,height:u,width:m,formatValue:y,yAxisLabel:f,className:p,emptyLabel:d,bandPadding:.36,ariaLabel:v.waterfall(c.length,y(M[0]?.from??0),y(k)),tooltip:a=>{const e=M[a],o=e?.total?l.neutral:e.value>=0?l.good:l.critical;/* @__PURE__ */
|
|
3
3
|
return i(t,{title:e?.label,rows:[{key:"step",color:o,label:e?.total?v.balance:e.value>=0?v.increase:v.decrease,value:e?.total?y(e.to):`${e.value>=0?"+":"−"}${y(Math.abs(e.value))}`},...e?.total?[]:[{key:"running",label:v.runningTotal,color:l.neutral,value:y(e.to)}]]})},children:({x:t,y:a,active:o})=>/* @__PURE__ */s("g",{children:[g&&M.slice(0,-1).map((l,o)=>
|
|
4
4
|
/* @__PURE__ */i("line",{x1:t.end(o),y1:a(l.to),x2:t(o+1),y2:a(l.to),stroke:e.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${o}`)),M.map((e,r)=>{const n=e.total?l.neutral:e.value>=0?l.good:l.critical,s=Math.min(a(e.from),a(e.to)),c=Math.max(1,Math.abs(a(e.to)-a(e.from)));/* @__PURE__ */
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Calendar as e,fromKey as t}from"./chunk-
|
|
2
|
-
/* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:
|
|
3
|
-
/* @__PURE__ */N(e,{mode:"range",min:I,max:
|
|
1
|
+
import{Calendar as e,fromKey as t}from"./chunk-FS2KWQJW.js";import{FILTER_ON as r,FILTER_ON_INK as n,FILTER_OFF as a}from"./chunk-AYZY3YNC.js";import{calendarNames as o}from"./chunk-5OTS2G3M.js";import{buttonClasses as i}from"./chunk-UQYNPYF4.js";import{Icon as l}from"./chunk-KKSVRIMP.js";import{onOverlayOpen as s}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as c}from"./chunk-62LW225J.js";import{useDropdownPosition as d}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as m}from"./chunk-D65T4H6J.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as p,useShellLocale as h}from"./chunk-X2PZMXDP.js";import{useState as f,useRef as g,useId as b,useEffect as x}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,Fragment as w,jsx as N}from"react/jsx-runtime";var k=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],C=e=>`${e.getFullYear()}-${M(e.getMonth()+1)}`,M=e=>String(e).padStart(2,"0");function $(e){return`${e.getFullYear()}-${M(e.getMonth()+1)}-${M(e.getDate())}`}function D(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:$(new Date(r,n,t.getDate()-14)),to:$(a)};case"lastMonth":return{from:$(i(1)),to:$(o)};case"last3Months":return{from:$(i(3)),to:$(o)};case"last6Months":return{from:$(i(6)),to:$(o)};case"last12Months":return{from:$(i(12)),to:$(o)}}}function W(e,t,r){const n=C(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function j(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function S(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var F=/* @__PURE__ */new Map;function Y({from:M,to:$,onChange:Y,formatDisplay:O,clearable:R,required:T=!1,name:H,id:J,"aria-labelledby":L,"aria-label":P,weekStartsOn:B,placeholder:E,fullWidth:G=!1,min:I,max:U,disabled:q=!1,allowOpenEnd:A=!1}){const K=p().dateRange,Z=h(),Q=O??(Z?function(e){let t=F.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),F.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(Z):S),V=E??K.placeholder,X=R??!T,[z,_]=f(!1),[ee,te]=f(M),[re,ne]=f($),[ae,oe]=f(null),[ie,le]=f("from"),se=g(null),ce=g(null),de=g(null),me=b(),ue=b(),pe=b(),[he,fe]=f(!1),ge=d(se,z,{preferredMaxWidth:520,preferredMaxHeight:he?720:560,popupRef:de}),be=g(null),xe=g(null),[ve,ye]=f(!0);m(()=>{const e=xe.current;if(!z||!he||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ve&&ye(a)});const we=g(null);m(()=>{const e=de.current;if(!z||!ge||!e)return;const t=getComputedStyle(e),r=ge.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(he)null!==we.current&&we.current<=r&&fe(!1);else{const e=be.current?.offsetWidth??0;if(0===e)return;we.current=e,e>r+.5&&fe(!0)}});const[Ne,ke]=f(!1);m(()=>{const e=!!J&&(ce.current?.labels?.length??0)>0;e!==Ne&&ke(e)});const Ce=!!P||!!L||Ne,Me=/* @__PURE__ */new Date,[$e,De]=f(()=>M?C(j(M)):W(Me,I,U)),We=k.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(D(e,Me),I,U)),je=e=>e?Q(e):"";x(()=>{if(!z)return;const e=e=>{const t=e.target;se.current?.contains(t)||de.current?.contains(t)||_(!1)};document.addEventListener("mousedown",e);const t=s(()=>_(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[z]),x(()=>{q&&_(!1)},[q]);const Se=()=>{Y("",""),_(!1)},Fe=M&&$?`${je(M)} — ${je($)}`:M?K.fromOnly(je(M)):$?K.toOnly(je($)):"",Ye=o(Z),Oe=e=>{const r=t(e);return r?Ye.longDate(r.getFullYear(),r.getMonth(),r.getDate()):e},Re=M&&$?K.range(Oe(M),Oe($)):M?K.fromOnly(Oe(M)):$?K.toOnly(Oe($)):V,Te=e=>he?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(ae===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(ae===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),He=/* @__PURE__ */y(w,{children:[We.map(e=>/* @__PURE__ */N("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=D(e,Me);te(t.from),ne(t.to),oe(e),De(t.from.slice(0,7))})(e),className:Te(e),"aria-label":he?K[e]:void 0,children:he?ve?K[e]:K[`${e}Short`]:K[e]},e)),
|
|
2
|
+
/* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:Te("Custom"),children:K.custom})]}),Je=(e,t)=>A?/* @__PURE__ */N("button",{type:"button","data-range-end":e,"aria-pressed":ie===e,onClick:()=>le(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */N("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Le=e=>A&&ie===e?" ring-1 ring-blue-400":"",Pe=
|
|
3
|
+
/* @__PURE__ */N(e,{mode:"range",min:I,max:U,value:ee||null,endValue:re||null,month:$e,onMonthChange:De,onSelect:e=>{oe("Custom"),A?"from"===ie?(re&&e>re?(te(re),ne(e)):te(e),le("to")):ee&&e<ee?(ne(ee),te(e)):ne(e):!ee||ee&&re?(te(e),ne("")):e<ee?(ne(ee),te(e)):ne(e)},weekStartsOn:B,"aria-label":K.dialog});/* @__PURE__ */
|
|
4
4
|
return y("div",{className:"relative"+(G?" w-full":""),ref:se,children:[
|
|
5
|
-
/* @__PURE__ */y("div",{className:`${G?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${
|
|
6
|
-
/* @__PURE__ */y("button",{ref:ce,type:"button",onClick:()=>{
|
|
5
|
+
/* @__PURE__ */y("div",{className:`${G?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${M||$?`${r} ${n}`:a}${q?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
+
/* @__PURE__ */y("button",{ref:ce,type:"button",onClick:()=>{q||(te(M),ne($),oe(null),le(M&&!$?"to":"from"),De(M?C(j(M)):W(Me,I,U)),_(!0))},"aria-haspopup":"dialog","aria-expanded":z,id:J,disabled:q||void 0,"aria-label":P,"aria-labelledby":L,"aria-describedby":[Ce?ue:void 0,T?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":z?me:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(G?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
7
|
/* @__PURE__ */N(l,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
-
/* @__PURE__ */N("span",{className:"truncate",children:Fe||
|
|
9
|
-
/* @__PURE__ */N("input",{type:"hidden",name:
|
|
10
|
-
/* @__PURE__ */N("input",{type:"hidden",name:
|
|
11
|
-
/* @__PURE__ */y("div",{ref:de,id:me,role:"dialog","aria-label":
|
|
12
|
-
/* @__PURE__ */y("div",{className:he?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
|
|
13
|
-
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:
|
|
14
|
-
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${
|
|
15
|
-
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:
|
|
16
|
-
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${
|
|
17
|
-
/* @__PURE__ */y("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[
|
|
18
|
-
/* @__PURE__ */N("div",{className:"w-full",children:
|
|
8
|
+
/* @__PURE__ */N("span",{className:"truncate",children:Fe||V})]}),X&&!q&&(M||$)&&/* @__PURE__ */N("button",{type:"button",onClick:Se,"aria-label":K.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Ce&&/* @__PURE__ */N("span",{id:ue,className:"sr-only",children:Re}),T&&/* @__PURE__ */N("span",{id:pe,className:"sr-only",children:K.required}),H&&/* @__PURE__ */y(w,{children:[
|
|
9
|
+
/* @__PURE__ */N("input",{type:"hidden",name:H.from,value:M,disabled:q||void 0}),
|
|
10
|
+
/* @__PURE__ */N("input",{type:"hidden",name:H.to,value:$,disabled:q||void 0})]}),z&&v(
|
|
11
|
+
/* @__PURE__ */y("div",{ref:de,id:me,role:"dialog","aria-label":K.dialog,"data-layout":he?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:c.popup,left:ge?.left,right:ge?.right,top:ge?.top,bottom:ge?.bottom,width:he&&ge?ge.maxWidth:"max-content",maxWidth:ge?.maxWidth,maxHeight:ge?.maxHeight,overflowY:"auto",visibility:ge?void 0:"hidden",...u()},children:[
|
|
12
|
+
/* @__PURE__ */y("div",{className:he?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Je("from",/* @__PURE__ */y(w,{children:[
|
|
13
|
+
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:K.from}),
|
|
14
|
+
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Le("from")}`,children:ee?je(ee):K.start})]})),!he&&/* @__PURE__ */N("span",{className:"text-gray-300",children:"—"}),Je("to",/* @__PURE__ */y(w,{children:[
|
|
15
|
+
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:K.to}),
|
|
16
|
+
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Le("to")}`,children:re?je(re):K.end})]}))]}),he?/* @__PURE__ */y(w,{children:[We.length>0&&/* @__PURE__ */y("div",{className:"mb-3 @container",children:[!ve&&/* @__PURE__ */N("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:K.lastHeading}),
|
|
17
|
+
/* @__PURE__ */y("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[He,We.map(e=>/* @__PURE__ */N("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:K[e]},e))]})]}),
|
|
18
|
+
/* @__PURE__ */N("div",{className:"w-full",children:Pe})]}):
|
|
19
19
|
/* @__PURE__ */y("div",{ref:be,className:"flex w-max gap-4",children:[
|
|
20
|
-
/* @__PURE__ */N("div",{className:"w-64",children:
|
|
21
|
-
/* @__PURE__ */y("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[
|
|
22
|
-
/* @__PURE__ */N("button",{type:"button",onClick:()=>_(!1),className:i({variant:"secondary"}),children:
|
|
23
|
-
/* @__PURE__ */N("button",{type:"button",onClick:()=>{Y(ee,re),_(!1)},disabled:
|
|
20
|
+
/* @__PURE__ */N("div",{className:"w-64",children:Pe}),We.length>0&&/* @__PURE__ */N("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:He})]}),
|
|
21
|
+
/* @__PURE__ */y("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[X&&/* @__PURE__ */N("button",{type:"button",onClick:Se,className:i({variant:"ghost"}),children:K.clear}),
|
|
22
|
+
/* @__PURE__ */N("button",{type:"button",onClick:()=>_(!1),className:i({variant:"secondary"}),children:K.cancel}),
|
|
23
|
+
/* @__PURE__ */N("button",{type:"button",onClick:()=>{Y(ee,re),_(!1)},disabled:A?!ee&&!re:!ee||!re,className:i({variant:"primary"}),children:K.apply})]})]}),document.body)]})}export{Y as DateRangePicker,D as presetRange,$ as toISODate};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-LNARMEEZ.js";import{Icon as i}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-LNARMEEZ.js";import{Icon as i}from"./chunk-KKSVRIMP.js";import{OneLineLabel as r}from"./chunk-OZAAIE4E.js";import{useShellStrings as s}from"./chunk-X2PZMXDP.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
2
2
|
return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
|
|
3
3
|
/* @__PURE__ */n(r,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(i,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-KKSVRIMP.js";import{useShellStrings as i}from"./chunk-X2PZMXDP.js";import{Fragment as t}from"react";import{jsx as n,jsxs as a}from"react/jsx-runtime";var s=/* @__PURE__ */n(e,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 text-gray-300","aria-hidden":!0}),r="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function l({items:e,separator:l,maxItems:c=0,className:m}){const o=i().breadcrumbs;if(0===e.length)return null;const h=l??s,d=[],u=e.length-1;if(c>0&&e.length>c&&c>=2){const i=Math.max(1,c-1);d.push({kind:"item",item:e[0],isLast:!1}),d.push({kind:"ellipsis"});for(let t=e.length-i;t<=u;t++)d.push({kind:"item",item:e[t],isLast:t===u})}else e.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
|
|
2
2
|
return n("nav",{"aria-label":o.label,className:`min-w-0 ${m??""}`,children:/* @__PURE__ */n("ol",{className:"flex items-center gap-2 text-sm",children:d.map((e,i)=>/* @__PURE__ */a(t,{children:[i>0&&/* @__PURE__ */n("li",{"aria-hidden":!0,className:"flex items-center",children:h}),
|
|
3
3
|
/* @__PURE__ */n("li",{className:"flex min-w-0 items-center",children:"ellipsis"===e.kind?/* @__PURE__ */n("span",{className:"px-0.5 text-gray-400 select-none","aria-label":o.hidden,children:"…"}):e.isLast||!e.item.href&&!e.item.onClick?/* @__PURE__ */a("span",{"aria-current":e.isLast?"page":void 0,className:"inline-flex min-w-0 items-center gap-1 truncate "+(e.isLast?"font-medium text-gray-900":"text-gray-500"),children:[e.item.icon,
|
|
4
4
|
/* @__PURE__ */n("span",{className:"truncate",children:e.item.label})]}):e.item.href?/* @__PURE__ */a("a",{href:e.item.href,onClick:e.item.onClick,className:r,children:[e.item.icon,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{formatMoney as e}from"./chunk-X2S2XDZI.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-
|
|
1
|
+
import{formatMoney as e}from"./chunk-X2S2XDZI.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-QASKQDUR.js";import{ChartFrame as a}from"./chunk-IWEL2ZCV.js";import{ColumnChart as l}from"./chunk-F7A6K3D5.js";import{TH_ONE_LINE as s}from"./chunk-OZAAIE4E.js";import{jsxs as o,jsx as i}from"react/jsx-runtime";function n({spec:n,height:c=200,width:m,animate:d=!0,className:h}){const u=function(r){if(r.currency)return t=>e(t,r.currency);const t=r.unit?` ${r.unit}`:"";return e=>`${e.toLocaleString("en-US",{maximumFractionDigits:2})}${t}`}(n),p=n.currency?r=>e(r,n.currency,{whole:!0}):u,b=n.series.map((e,r)=>({key:`s${r}`,label:e.name,data:e.values})),y=n.title??n.series.map(e=>e.name).join(", "),f=/* @__PURE__ */o("table",{className:"w-full border-collapse text-sm",children:[
|
|
2
2
|
/* @__PURE__ */i("thead",{children:/* @__PURE__ */o("tr",{children:[
|
|
3
3
|
/* @__PURE__ */i("td",{className:"border-b border-gray-200"}),n.series.map((e,r)=>/* @__PURE__ */i("th",{scope:"col",className:`${s} border-b border-gray-200 px-2 py-1 text-right font-semibold text-gray-700`,children:e.name},r))]})}),
|
|
4
4
|
/* @__PURE__ */i("tbody",{children:n.x.map((e,t)=>/* @__PURE__ */o("tr",{children:[
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-AEQFFD5I.js";import{IconButton_default as a}from"./chunk-RUTUVS4H.js";import{Icon as o}from"./chunk-KKSVRIMP.js";import{Tooltip as n}from"./chunk-BCDG4N6L.js";import{useShellStrings as s}from"./chunk-X2PZMXDP.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":j,windows:A,className:I="",layout:R="grid"}){const S=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 B=m(n,k,x,q.cells.paragraph),K=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,L=(e,l,r,o)=>n.has(e)?g(l,/* @__PURE__ */i(a,"link"===e?{pressed:v,className:K(v),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":v,"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r}:{className:K(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,U=l(S),$=e.map(e=>[e,U[e],r(e)]),T=C?e.filter(e=>C.allow.includes(e)):[],P=C&&T.includes(C.value)?C.value:T[0],E=[["none",S.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",S.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",S.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],F=x&&B?g(S.clear,/* @__PURE__ */i(a,{className:K(!1),"aria-label":S.clear,disabled:y,onMouseDown:c,onClick:x.onClear,children:/* @__PURE__ */i(o,{name:"revert"})},"clear")):null,H=/* @__PURE__ */t(d,{children:[L("bold",S.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),L("italic",S.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),L("underline",S.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),L("strike",S.strike,/* @__PURE__ */i(o,{name:"strike"})),k?g(S.color,/* @__PURE__ */i(a,{pressed:k.open,className:K(k.open,"rosh-tb-color"),"aria-label":S.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,L("link",S.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),L("sup",S.sup,/* @__PURE__ */i(o,{name:"superscript"})),L("sub",S.sub,/* @__PURE__ */i(o,{name:"subscript"})),L("code",S.code,/* @__PURE__ */i(o,{name:"code"})),u(N)?N:null,"words"===B?F:null]}),V=/* @__PURE__ */t(d,{children:[C&&T.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":S.alignment,onKeyDown:e=>p(e,T,e=>C.onChange(e)),children:$.map(([e,l,r])=>C.allow.includes(e)?g(l,/* @__PURE__ */i(a,{role:"radio",pressed:C.value===e,className:K(C.value===e),"aria-checked":C.value===e,"aria-label":l,tabIndex:e===P?0:-1,disabled:y||C.disabled,onMouseDown:c,onClick:()=>C.onChange(e),children:r},e)):null)}):null,D&&n.has("bullet")?g(S.bullet,/* @__PURE__ */i(a,{className:K("bullet"===D.pressed),"aria-label":S.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(S.number,/* @__PURE__ */i(a,{className:K("number"===D.pressed),"aria-label":S.number,"aria-pressed":"number"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,L("quote",S.quote,/* @__PURE__ */i(o,{name:"quote"})),M?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":S.letterCase,onKeyDown:e=>p(e,E.map(([e])=>e),e=>M.onChange(e)),children:E.map(([e,l,r])=>g(l,/* @__PURE__ */i(a,{role:"radio",pressed:M.value===e,className:K(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"===B?F:null]}),X="row"===R,G=X?" is-row":q.flow?" is-flow":q.oneRow?" is-one-row":q.words&&void 0===N&&"words"!==B?" is-eight":"",O=b(n,Boolean(k)),Q={"--rosh-tb-color-col":String(O.color),"--rosh-tb-link-col":String(O.link),...X?{"--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=X?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:H}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:V}):null]}):q.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[H,
|
|
3
|
+
/* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),V]}):q.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
|
|
4
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-words",children:H}),
|
|
5
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-para",children:V})]}):/* @__PURE__ */t(d,{children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===N&&"words"!==B?" is-eight":""),children:H}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:V}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${G} ${I}`.trim(),style:Q,children:[
|
|
6
|
+
/* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":j??S.formatting,children:Z}),A]})}export{f as TextToolbar,w as textToolbarRows,b as textToolbarWindowColumns};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-5VDT4762.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{useShellStrings as i}from"./chunk-X2PZMXDP.js";import{createContext as n,useState as r,useMemo as l,useId as a,useRef as o,useContext as d,useEffect as u,useLayoutEffect as s}from"react";import{jsx as c,jsxs as m}from"react/jsx-runtime";var f=(e,t,i)=>Math.min(i,Math.max(t,e));function p(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var h=8,v=40;function x(e){return Math.max(1,...e.map(e=>(e??"").length))}var b="undefined"==typeof window?u:s;function w(e,t,i,n){return Number(f(e,t,i).toFixed(n))}var y=n(null);function g({children:e}){const[t,i]=r({}),n=l(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),a=l(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
|
|
2
|
+
return c(y.Provider,{value:a,children:e})}function S({value:n,onChange:l,min:s,max:g,step:S=1,shiftStep:z,precision:F,inputMin:k,inputMax:N,suffix:M,showInput:$=!0,emptyLabel:j,placeholderValue:L,stepFrom:D,label:K,"aria-labelledby":A,valueText:C,id:P,disabled:E,size:R="md",boxSize:V="sm",className:W="",auto:T}){const X=i(),q=a(),B=t(),I=T??B,O=a(),U=P??q,Z=F??p(S),G=k??s,H=N??g,J=void 0!==j||void 0!==L,Q=D??L,Y=f(n??L??s,s,g),_=o(null),[ee,te]=r(null),ie=Boolean(M);b(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,$]);const ne=e=>C?C(e):"string"==typeof M?`${e.toFixed(Z)} ${M}`:void 0,re=null==n?j??(null!=L?ne(L)??String(L):void 0):ne(n),le=`calc(${x([s.toFixed(Z),g.toFixed(Z),n?.toFixed(Z),j,L?.toFixed(Z)])}ch + ${(ee?.frame??10+(ie?v:h))+2}px)`,ae=d(y),oe=a(),de=ae?.set;return b(()=>{de&&de(oe,$?le:null)},[de,oe,le,$]),u(()=>()=>de?.(oe,null),[de,oe]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-3 ${W}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */c("input",{id:U,type:"range",min:s,max:g,step:S,value:Y,disabled:E,"aria-label":A?void 0:K,"aria-labelledby":A,"aria-valuetext":re,"aria-describedby":I?O:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=z;if(!i&&!(null==n&&null!=Q))return;e.preventDefault();l(w((n??Q??Y)+t*(i?z??S:S),s,g,Z))},onChange:e=>l(w(Number(e.target.value),s,g,Z)),className:"min-w-24 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===R?"h-1":"h-1.5")}),$&&
|
|
4
|
+
/* @__PURE__ */c("div",{ref:_,"data-slider-box":"",className:"shrink-0 text-xs",style:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */c(e,{value:n,onChange:e=>{null!=e?e<G||e>H||l(e):J&&l(null)},min:G,max:H,step:S,shiftStep:z,stepFrom:Q,precision:Z,snap:!0,allowEmpty:J,suffix:M,disabled:E,placeholder:j??(null!=L?L.toFixed(Z):void 0),size:V,auto:I,"aria-label":K?X.slider.value(K):void 0,"aria-labelledby":K?void 0:A})}),I&&/* @__PURE__ */c("span",{id:O,hidden:!0,children:X.settingView.auto})]})}export{S as Slider,g as SliderGroup,w as settleSliderValue,x as sliderBoxChars,p as stepDecimals};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import{Dialog as e}from"./chunk-
|
|
2
|
-
return m(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function
|
|
3
|
-
return m(r,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function
|
|
4
|
-
return d(f.Provider,{value
|
|
5
|
-
/* @__PURE__ */m(e,{open:r,onClose:()=>
|
|
6
|
-
/* @__PURE__ */m("button",{ref:
|
|
7
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>
|
|
1
|
+
import{Dialog as e}from"./chunk-6B4F5DWV.js";import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-KKSVRIMP.js";import{useShellStrings as n,splitAround as o}from"./chunk-X2PZMXDP.js";import{createContext as l,useContext as i,useState as s,useRef as a,useCallback as c,useEffect as u}from"react";import{jsxs as d,jsx as m,Fragment as h}from"react/jsx-runtime";var f=l(()=>Promise.resolve(!1)),b=()=>i(f),g=()=>Promise.resolve(!1),p=e=>g(e),v=()=>Promise.resolve(!1),y=e=>v(e),x=()=>Promise.resolve(null),N=e=>x(e),k={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:t({variant:"primary"})}},w=t({variant:"secondary"}),C=t({variant:"primary"}),P="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function L(){/* @__PURE__ */
|
|
2
|
+
return m(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function j(){/* @__PURE__ */
|
|
3
|
+
return m(r,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F({children:t}){const[r,l]=s(!1),[i,b]=s({message:""}),[p,y]=s(0),N=a(),F=a(null),E=a(0),D=a([]),K=a(null),T=a(null),W=c(e=>{F.current=e.id,N.current=e.resolve,y(e.id),b(e.options),l(!0)},[]),$=c(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const r={id:++E.current,options:t,resolve:e};null===F.current?W(r):D.current.push(r)})},[W]),[V,M]=s(!1),[X,Y]=s({message:""}),[B,I]=s(""),Q=a(),R=c(e=>(Y(e),I(""),M(!0),new Promise(e=>{Q.current=e})),[]),[S,U]=s(!1),[Z,q]=s({}),[z,A]=s(""),G=a(),H=c(e=>{const t="string"==typeof e?{message:e}:e;return q(t),A(t.defaultValue??""),U(!0),new Promise(e=>{G.current=e})},[]);u(()=>{g=$,v=R,x=H},[$,R,H]);const J=(e,t)=>{if(F.current!==e)return;const r=N.current,n=D.current.shift();n?W(n):(F.current=null,N.current=void 0,l(!1)),r?.(t)},O=e=>{M(!1),I(""),Q.current?.(e)},_=e=>{if(e){const e=z.trim();if(!e&&!Z.allowEmpty)return U(!1),void G.current?.(null);U(!1),G.current?.(e)}else U(!1),G.current?.(null)},ee=i.variant||(i.confirmLabel?.toLowerCase().includes("delete")||i.message.toLowerCase().includes("delete")?"danger":"info"),te=k[ee],re=k["warning"===X.variant?"warning":"danger"],ne=X.confirmWord,oe=null==ne||B===ne,le=n().dialog,[ie,se]=o(le.typeToConfirm);/* @__PURE__ */
|
|
4
|
+
return d(f.Provider,{value:$,children:[t,
|
|
5
|
+
/* @__PURE__ */m(e,{open:r,onClose:()=>J(p,!1),initialFocus:K,footer:/* @__PURE__ */d(h,{children:[
|
|
6
|
+
/* @__PURE__ */m("button",{ref:K,type:"button",onClick:()=>J(p,!1),className:w,children:i.cancelLabel||le.cancel}),
|
|
7
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>J(p,!0),className:te.button,children:i.confirmLabel||le.ok})]}),children:/* @__PURE__ */d("div",{className:"flex gap-4",children:[
|
|
8
8
|
/* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */m(L,{})}),
|
|
9
9
|
/* @__PURE__ */d("div",{className:"flex-1",children:[
|
|
10
10
|
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900",children:i.title||le.confirmTitle}),
|
|
11
11
|
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:i.message})]})]})}),
|
|
12
|
-
/* @__PURE__ */d(e,{open:
|
|
13
|
-
/* @__PURE__ */m("button",{ref
|
|
14
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>
|
|
15
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>
|
|
12
|
+
/* @__PURE__ */d(e,{open:V,onClose:()=>O(!1),initialFocus:null!=ne?void 0:T,footer:/* @__PURE__ */d(h,{children:[
|
|
13
|
+
/* @__PURE__ */m("button",{ref:T,type:"button",onClick:()=>O(!1),className:w,children:X.cancelLabel||le.destructiveCancel}),
|
|
14
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>O(!0),disabled:!oe,className:re.button,children:ne??X.confirmLabel??le.destructiveConfirm})]}),children:[
|
|
15
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>O(!1),"aria-label":le.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */m(j,{})}),
|
|
16
16
|
/* @__PURE__ */d("div",{className:"flex gap-4",children:[
|
|
17
17
|
/* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */m(L,{})}),
|
|
18
18
|
/* @__PURE__ */d("div",{className:"flex-1",children:[
|
|
19
|
-
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:
|
|
20
|
-
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:
|
|
19
|
+
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:X.title||le.destructiveTitle}),
|
|
20
|
+
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:X.message}),null!=ne&&/* @__PURE__ */d(h,{children:[
|
|
21
21
|
/* @__PURE__ */d("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
|
|
22
22
|
/* @__PURE__ */m("kbd",{className:"rounded border border-line-strong bg-surface-sunken px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:ne}),se]}),
|
|
23
|
-
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:
|
|
23
|
+
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:B,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key&&B===ne&&O(!0)},placeholder:ne,className:`mt-2 ${P} focus:border-red-500`})]})]})]})]}),
|
|
24
24
|
/* @__PURE__ */d(e,{open:S,onClose:()=>_(!1),title:Z.title||le.promptTitle,footer:/* @__PURE__ */d(h,{children:[
|
|
25
25
|
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:Z.cancelLabel||le.cancel}),
|
|
26
26
|
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!Z.allowEmpty&&!z.trim(),className:C,children:Z.confirmLabel||le.ok})]}),children:[Z.message&&/* @__PURE__ */m("p",{className:"text-sm text-gray-600",children:Z.message}),
|
|
27
|
-
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:z,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:Z.placeholder,className:`mt-3 ${P} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{
|
|
27
|
+
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:z,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:Z.placeholder,className:`mt-3 ${P} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{F as ConfirmProvider,p as confirm,y as confirmDestructive,N as prompt,b as useConfirm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useWindowMenuItem as e,Modal as t}from"./chunk-
|
|
1
|
+
import{useWindowMenuItem as e,Modal as t}from"./chunk-ANTH2FBS.js";import{navIcons as r}from"./chunk-CY5N5OA3.js";import{VERSION as s}from"./chunk-PYQ6DD3F.js";import{Icon as n}from"./chunk-KKSVRIMP.js";import{DEFAULT_SHELL_STRINGS as o,useShellStrings as i,splitAround as a}from"./chunk-X2PZMXDP.js";import{useState as m,useCallback as c,isValidElement as l,cloneElement as d}from"react";import{jsx as p,jsxs as h}from"react/jsx-runtime";var f=o.aboutApp,u={spreadsheet:{name:"Spreadsheets",version:"1.2.0",route:"/spreadsheet",description:f.spreadsheet},notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:f.notepad},documents:{name:"Documents",version:"1.1.1",route:"/documents",description:f.documents},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:f.preview},files:{name:"Files",version:"1.1.4",route:"/files",description:f.files},browser:{name:"Browser",version:"1.0.2",route:"/browser",description:f.browser}},x=/* @__PURE__ */p(n,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),v=/* @__PURE__ */p(n,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function w({app:n}){const o=u[n],[f,w]=m(!1),N=c(()=>w(!0),[]),b=i().aboutApp,k=b.title(o.name);if(e(k,N,x),!f)return null;const g=r[o.route],y=l(g)?d(g,{className:"h-9 w-9"}):v,[j,P]=a(b.partOf);/* @__PURE__ */
|
|
2
2
|
return p(t,{open:!0,onClose:()=>w(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */h("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
|
|
3
3
|
/* @__PURE__ */p("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
|
|
4
4
|
/* @__PURE__ */p("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:o.name}),
|
|
@@ -6,4 +6,4 @@ return p(t,{open:!0,onClose:()=>w(!1),title:k,size:"sm",compact:!0,bodyScroll:!1
|
|
|
6
6
|
/* @__PURE__ */p("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[n]}),
|
|
7
7
|
/* @__PURE__ */h("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
|
|
8
8
|
/* @__PURE__ */h("p",{className:"text-2xs text-ink-faint",children:[j,
|
|
9
|
-
/* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),
|
|
9
|
+
/* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),P]}),s&&/* @__PURE__ */p("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(s)})]})]})})}export{w as AboutApp,u as BUILTIN_APP_INFO};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{ImageFocusPoint as e}from"./chunk-QSW3YHPK.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Segmented as i}from"./chunk-CKPVXDKX.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-B7HW6XZD.js";import{TransferProgress as u}from"./chunk-EQN65XOO.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-P6LB3I3D.js";import{Icon as p}from"./chunk-KKSVRIMP.js";import{useShellStrings as b}from"./chunk-X2PZMXDP.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:P,label:C,hint:F,error:U,required:K,className:O,accept:X="image/*",maxSizeBytes:$,fit:z="cover",height:B=112,placeholder:D,cta:H,acceptHint:I,showFilename:S=!0,allowReplace:W=!0,allowRemove:q=!0,replaceLabel:V,removeLabel:M,busy:Q=!1,busyLabel:Y,choosingLabel:Z,pickFailedLabel:_,progress:A,disabled:E=!1,kind:G,onKindChange:J,focus:T,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=H??ie.cta,oe=G??(/video/.test(X)&&!/image/.test(X)?"video":"image"),re="string"==typeof M&&M?M:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=Q||ne,me=ne&&!Q?Z??ie.choosing:Y??ie.uploading,he=U??(se?_??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=E||ue,ke=!!w&&(t(w,X)||w===ve),je=D??o(X,ie),xe=V??(ke||"video"===oe?ie.changeVideo:ie.changeImage),Ne=e=>{R?pe(e):P?P(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:X,maxSizeBytes:$,acceptHint:I,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:Le}=we,Re=()=>{ye||(R?pe():we.open())},Pe=w?r(w):"",Ce=!ke&&!!ee,Fe=E||!W&&!q?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[W&&/* @__PURE__ */k("button",{id:Ce?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
|
|
2
|
+
/* @__PURE__ */j(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
3
|
+
/* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),q&&/* @__PURE__ */j("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Ue=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Ce?"":"bg-gray-100",Le?"border-blue-500":"border-line"].join(" "),style:Ce?void 0:{height:B},children:[Ce?
|
|
4
|
+
/* @__PURE__ */j(e,{value:T??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Pe||void 0,className:"h-full w-full",style:{objectFit:z}}):/* @__PURE__ */j("img",{src:w??void 0,alt:Pe,className:"h-full w-full",style:{objectFit:z,objectPosition:T||void 0}}),S&&w&&/* @__PURE__ */j(n,{children:Pe}),Fe,ue&&/* @__PURE__ */j(l,{label:me,progress:A,rounded:"rounded-md"})]}),Ke=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":K||void 0,"aria-describedby":he?`${be}-error`:F?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:B},children:ue?/* @__PURE__ */j(u,{state:"busy",verb:me,pct:A}):/* @__PURE__ */k(x,{children:[
|
|
5
|
+
/* @__PURE__ */j("span",{className:"text-ink-faintest",children:/* @__PURE__ */j(s,{})}),
|
|
6
|
+
/* @__PURE__ */j("span",{className:"px-3 text-xs text-ink-faint",children:je}),
|
|
7
|
+
/* @__PURE__ */j("span",{className:"text-sm font-medium text-blue-600",children:te}),I&&/* @__PURE__ */j("span",{className:"text-xs text-ink-faintest",children:I})]})});/* @__PURE__ */
|
|
8
|
+
return k(a,{label:C,htmlFor:be,hint:F,error:he,required:K,className:O,children:[J&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(i,{value:oe,onChange:e=>J(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof C&&C?C:ie.upload})}),w?Ue:Ke,!R&&/* @__PURE__ */j("input",{...we.inputProps}),
|
|
9
|
+
/* @__PURE__ */j(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
|