efficient-shell 10.0.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 +1 -1
- package/dist/{Browser-RFLTFP7Y.js → Browser-2S5V2RRU.js} +14 -14
- package/dist/Calculator-N2NLSDTW.js +29 -0
- package/dist/{CurrencyConverter-ELSCNMUT.js → CurrencyConverter-HW5HW3RH.js} +9 -9
- package/dist/{Documents-HKTTXLSR.js → Documents-JTURYN4D.js} +19 -19
- package/dist/{Files-ZSYGKZOV.js → Files-GP2LAGME.js} +79 -79
- package/dist/Notepad-OV66ANUO.js +24 -0
- package/dist/PdfViewer-WNKGFJD6.js +1 -0
- package/dist/{PomodoroTimer-XHNZGBDR.js → PomodoroTimer-TGUTV47T.js} +25 -25
- package/dist/{Preview-PLCASIZA.js → Preview-76A4GKGI.js} +19 -19
- package/dist/Sidebar-4OI4LP6G.js +44 -0
- package/dist/{Spreadsheet-Y7TJIBI5.js → Spreadsheet-FU5QIZA3.js} +11 -11
- package/dist/{Stock-KLYWTMMD.js → Stock-FEVMKWMS.js} +3 -3
- package/dist/{Weather-CT2IZHEW.js → Weather-2EGADOTH.js} +15 -15
- package/dist/{WorldClock-EJCUVIUW.js → WorldClock-U5DIGLOY.js} +6 -6
- package/dist/ai/index.js +38 -38
- 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-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-BXEKX4TB.js → chunk-3V74SUZO.js} +16 -16
- package/dist/{chunk-DL6QIWVR.js → chunk-42XMT5JN.js} +1 -1
- package/dist/{chunk-VG5NGCMQ.js → chunk-44PGFMSX.js} +6 -6
- package/dist/{chunk-IQWIYZB5.js → chunk-45XXERGA.js} +2 -2
- package/dist/{chunk-FRINAJU7.js → chunk-4UX6ET7G.js} +1 -1
- package/dist/{chunk-BFVL2VTS.js → chunk-4VDGVF5T.js} +1 -1
- package/dist/{chunk-D2WGDTWN.js → chunk-5EX6XXUX.js} +1 -1
- package/dist/{chunk-PA37I5ZX.js → chunk-5VDT4762.js} +2 -2
- package/dist/{chunk-EGAV5LSX.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-ZBTDMQUI.js → chunk-ANTH2FBS.js} +61 -61
- 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-XS4HFUTW.js → chunk-BZPPDYEE.js} +1 -1
- package/dist/{chunk-DPDRFLBY.js → chunk-CLQFP42I.js} +3 -3
- package/dist/{chunk-UZ43AT4O.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-QTQQKQGQ.js → chunk-FFASZGNZ.js} +3 -3
- package/dist/{chunk-MPALY3CL.js → chunk-FMC2XNSP.js} +6 -6
- package/dist/{chunk-D7X2HMMA.js → chunk-FS2KWQJW.js} +10 -10
- package/dist/{chunk-AJ3R5QPD.js → chunk-GGIFS34Z.js} +5 -5
- 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-O33CUGOI.js → chunk-K64JRGNE.js} +5 -5
- package/dist/{chunk-IU5KBQEQ.js → chunk-K7PCBUDC.js} +6 -6
- package/dist/{chunk-FSPFV4MI.js → chunk-KKSVRIMP.js} +2 -4
- package/dist/{chunk-T5V2GJ4D.js → chunk-KZQAGXME.js} +4 -4
- package/dist/{chunk-B7KD3DGY.js → chunk-LFVUDFVU.js} +1 -1
- package/dist/{chunk-FTWWJHFX.js → chunk-LOYCPZUB.js} +1 -1
- package/dist/{chunk-GBLMVFDW.js → chunk-LPDI5NL6.js} +1 -1
- package/dist/{chunk-FPGRKHUW.js → chunk-MH6DI6YY.js} +11 -11
- package/dist/{chunk-GQMS5657.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-UTQG344L.js → chunk-NW7Z3G7P.js} +11 -11
- package/dist/{chunk-LR77AS3N.js → chunk-O6ABVKHU.js} +4 -4
- package/dist/{chunk-25STFYV3.js → chunk-OPB3I4JH.js} +4 -4
- package/dist/{chunk-RBD7SB6M.js → chunk-P5YFQ4IQ.js} +1 -1
- package/dist/{chunk-JHZV4TN6.js → chunk-PF5CKD4C.js} +2 -2
- 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-MKEYXKZA.js → chunk-TDLU6GF5.js} +4 -4
- package/dist/{chunk-4E4GWE4L.js → chunk-TYK7VN73.js} +15 -15
- package/dist/{chunk-HKAQXFUR.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-UFXE363L.js → chunk-X6YT3I5F.js} +1 -1
- package/dist/{chunk-SGTZJMZ6.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-DVOQCAC2.js → chunk-XQQNA246.js} +1 -1
- package/dist/{chunk-ED3QFXBC.js → chunk-XZBQ3XXD.js} +1 -1
- package/dist/{chunk-6I6VSUKY.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/format/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/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.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/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +121 -122
- 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/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.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/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.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-DV2R65OS.js +0 -29
- package/dist/Notepad-63Q3JSCV.js +0 -25
- package/dist/PdfViewer-DFBPEUY5.js +0 -1
- package/dist/Sidebar-QFT5WPK4.js +0 -44
- package/dist/chunk-5CH2RGL6.js +0 -29
- package/dist/chunk-7YU27U3Y.js +0 -19
- package/dist/chunk-AEJNFA2K.js +0 -6
- package/dist/chunk-IEAFSVXC.js +0 -1
- package/dist/chunk-POCQ7ZL4.js +0 -3
- package/dist/chunk-PVR4KU7H.js +0 -7
- package/dist/chunk-RBXSU25O.js +0 -9
- package/dist/chunk-XSJJPACH.js +0 -11
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-
|
|
2
|
-
return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),
|
|
3
|
-
return w("div",{id:
|
|
4
|
-
return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:N,onClick:()=>
|
|
5
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":L.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*H.v),"aria-valuetext":L.squareValue(Math.round(100*H.s),Math.round(100*H.v)),"aria-disabled":N||void 0,"data-color-square":"",onKeyDown:e=>{if(N)return;const r=P(H,e.key,e.shiftKey);r&&(e.preventDefault(),
|
|
6
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":L.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(H.h),"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-hue":"",onKeyDown:e=>{if(N)return;const r=A(H.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),
|
|
1
|
+
import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-5VDT4762.js";import{parseHexColor as a,hexToHsv as n,hsvToHex as o,hexReadout as t,HUE_GRADIENT as l,HEX_MAX_LENGTH as i,svFromPoint as s,hueFromPoint as c}from"./chunk-S6OB6HJB.js";import{inputClasses as u}from"./chunk-AYZY3YNC.js";import{Tooltip as d}from"./chunk-BCDG4N6L.js";import{useShellStrings as h}from"./chunk-X2PZMXDP.js";import{forwardRef as g,useState as p,useRef as b,useEffect as m,useId as f}from"react";import{jsx as v,jsxs as w}from"react/jsx-runtime";var x={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function k(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function C(e,r){if(!e)return y;const a=k(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function N({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",x[e],a].filter(Boolean).join(" ")}var $=g(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
|
|
2
|
+
return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),D=(e,r,a)=>Math.min(a,Math.max(r,e)),z=e=>"string"==typeof e?{value:e}:e;function P(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:D(e.s+o[0],0,1),v:D(e.v+o[1],0,1)}:null}function A(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,359);case"ArrowRight":case"ArrowUp":return D(e+n,0,359);case"PageDown":return D(e-10,0,359);case"PageUp":return D(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var I={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function M(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,100);case"ArrowRight":case"ArrowUp":return D(e+n,0,100);case"PageDown":return D(e-10,0,100);case"PageUp":return D(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function j({value:e,onChange:r,label:i,presets:u,clearable:g=!1,fallback:f,dragWrites:x="live",disabled:N=!1,opacity:D,onOpacityChange:j,onClose:S,id:T,className:B=""}){const L=h().color,O=k(D),U=e=>{const r=k(e);N||r===O||j?.(r)},X=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:O},E=a(f??""),[H,W]=p(()=>n(e||E||"")),Y=b(e);m(()=>{e!==Y.current&&(Y.current=e,e?W(n(e)):E&&W(n(E)))},[e]);const q=a=>{N||a===e||(Y.current=a,r(a))},G=e=>{const r=a(e);r&&(W(n(r)),q(r))},J=e=>{W(e),q(o(e))},[V,Z]=p(!1),F=b(H);F.current=H;const Q=e=>({onPointerDown:r=>{if(N||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,F.current);"end"===x?(Z(!0),W(a)):J(a)},onPointerMove:r=>{if(N||!(1&r.buttons))return;const a=e(r,F.current);"end"===x?W(a):J(a)},onPointerUp:r=>{"end"===x&&V&&(Z(!1),J(e(r,F.current)))}}),_=Q((e,r)=>({...r,...s(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),ee=Q((e,r)=>({...r,h:c(e.clientX,e.currentTarget.getBoundingClientRect())})),re=V?o(H):e,ae=e=>`${Math.round(100*e)}%`,ne=(u??[]).map(z),oe=a(e),te=re||E||"";/* @__PURE__ */
|
|
3
|
+
return w("div",{id:T,className:`flex w-56 flex-col gap-3 ${N?"opacity-60":""} ${B}`.trim(),onKeyDown:e=>{"Escape"===e.key&&S&&(e.preventDefault(),e.stopPropagation(),S())},children:[(ne.length>0||g)&&/* @__PURE__ */w("div",{role:"group","aria-label":L.presets,className:"flex flex-wrap gap-2",children:[g&&/* @__PURE__ */v(d,{content:L.clear,children:/* @__PURE__ */v($,{color:"",size:"sm","aria-label":L.clear,selected:""===e,disabled:N,onClick:()=>{N||""===e||(Y.current="",r(""))}})}),ne.map(e=>{const r=a(e.value),n=e.label?`${e.label} · ${t(r??e.value)}`:t(r??e.value);/* @__PURE__ */
|
|
4
|
+
return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:N,onClick:()=>G(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
5
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":L.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*H.v),"aria-valuetext":L.squareValue(Math.round(100*H.s),Math.round(100*H.v)),"aria-disabled":N||void 0,"data-color-square":"",onKeyDown:e=>{if(N)return;const r=P(H,e.key,e.shiftKey);r&&(e.preventDefault(),J(r))},..._,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:o({h:H.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ae(H.s),top:ae(1-H.v),...I}})}),
|
|
6
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":L.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(H.h),"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-hue":"",onKeyDown:e=>{if(N)return;const r=A(H.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),J({...H,h:r}))},...ee,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:l},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:H.h/360*100+"%",background:o({h:H.h,s:1,v:1}),...I}})}),j&&/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":L.opacity(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":O,"aria-valuetext":`${O}%`,"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-opacity":"",onKeyDown:e=>{if(N)return;const r=M(O,e.key,e.shiftKey);null!==r&&(e.preventDefault(),U(r))},onPointerDown:e=>{N||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),U(X(e)))},onPointerMove:e=>{!N&&1&e.buttons&&U(X(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${te||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${O}%`,...C(te||"black",O),...I}})}),
|
|
7
7
|
/* @__PURE__ */w("div",{className:"flex items-center gap-2",children:[
|
|
8
8
|
/* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,j?O:null)}),
|
|
9
|
-
/* @__PURE__ */v(
|
|
9
|
+
/* @__PURE__ */v(K,{value:re,placeholder:!e&&E?t(E):void 0,onChange:G,label:L.hex(i),disabled:N}),j&&/* @__PURE__ */v(R,{value:O,onChange:U,label:L.opacity(i),disabled:N})]})]})}var S={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},T={sm:"h-6",md:"h-8",lg:"h-10"},B=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function K({value:e,onChange:r,label:n,placeholder:o,disabled:l,id:s,size:c="md",look:d="box",className:h=""}){const[g,b]=p(null),m="text"===d?`${B} ${T[c]} ${h}`.trim():u({size:c,className:`${S[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
|
|
10
10
|
return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function R({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
|
|
11
|
-
return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function L({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:
|
|
11
|
+
return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function L({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:D=""}){const z=h().color,P=k(p),A=f(),I=a(s??""),M=r||I||"",S=r?t(r):I?t(I):z.none;
|
|
12
12
|
/* @__PURE__ */
|
|
13
|
-
return w("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":g?"gap-1":"gap-2"} ${
|
|
14
|
-
/* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(M,b?P:null)}),triggerLabel:
|
|
15
|
-
/* @__PURE__ */v(
|
|
13
|
+
return w("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":g?"gap-1":"gap-2"} ${D}`.trim(),children:[
|
|
14
|
+
/* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(M,b?P:null)}),triggerLabel:z.swatch(o,S),triggerClassName:N({size:m}),"aria-label":z.panel(o),align:x,open:y,onOpenChange:$,disabled:u,children:/* @__PURE__ */v(j,{id:A,value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),g&&
|
|
15
|
+
/* @__PURE__ */v(K,{value:r,placeholder:!r&&I?t(I):void 0,onChange:e=>{u||e===r||n(e)},label:z.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */v(R,{value:P,onChange:e=>{u||e===P||b(e)},label:z.opacity(o),disabled:u,size:m})]})}export{L as ColorPicker,j as ColorPickerPanel,$ as ColorSwatch,K as HexInput,y as NO_COLOR_FILL,k as clampOpacity,C as colorFill,N as colorSwatchClasses,A as stepHue,M as stepOpacity,P as stepSquare};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{CountBadge as e}from"./chunk-MZ26SYFY.js";import{
|
|
1
|
+
import{CountBadge as e}from"./chunk-MZ26SYFY.js";import{SettingRowNameContext as i,SettingAutoContext as n}from"./chunk-2NMW66P5.js";import{isShown as a}from"./chunk-HCP7WOAL.js";import{useShellStrings as t}from"./chunk-X2PZMXDP.js";import{isValidElement as l}from"react";import{jsx as s,jsxs as r,Fragment as d}from"react/jsx-runtime";var c={pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},m=e=>Array.isArray(e)?e.some(m):l(e);function o({label:l,icon:o,action:h,value:u,readout:f,changed:p=!1,description:x,children:N,controlId:v,labelId:g,unknownText:b="—",quiet:y=!1,size:k="default",viewState:w,divider:$=!0,showWhen:j,values:P,context:A,className:F=""}){const M=t();if(!a(j,P,A))return null;const T="auto"===w?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:M.settingView.auto}):"edited"===w?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
|
|
2
2
|
/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */s(e,{dot:!0,tone:"accent"})}),
|
|
3
|
-
/* @__PURE__ */s("span",{className:"sr-only",children:M.settingView.edited})]}):null,W=null!=f&&!1!==f;if("compact"===k){const e=m(u),
|
|
4
|
-
/* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),T]}),y=e=>/* @__PURE__ */s(
|
|
3
|
+
/* @__PURE__ */s("span",{className:"sr-only",children:M.settingView.edited})]}):null,W=null!=f&&!1!==f;if("compact"===k){const e=m(u),a=m(h);if(!e&&!a)return null;const t=g,c=["es-field"];e||c.push("is-inline"),p&&c.push("is-changed"),F&&c.push(F);const b=/* @__PURE__ */r(d,{children:[null!=o&&/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:o}),
|
|
4
|
+
/* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),T]}),y=e=>/* @__PURE__ */s(i.Provider,{value:t,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:e})});/* @__PURE__ */
|
|
5
5
|
return r("div",{className:c.join(" "),children:[
|
|
6
|
-
/* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),W&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),
|
|
6
|
+
/* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),W&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),a&&y(h)]}),e&&/* @__PURE__ */s("div",{className:"es-field-ctl",children:y(u)}),x?/* @__PURE__ */s("p",{className:"es-field-hint",children:x}):null,N]})}const I=c,S=void 0!==u||void 0===N&&null==h,V=null==u||""===u,X=y?"text-gray-500":"text-gray-800",Y=V?"text-gray-400":y?"text-gray-500":"text-gray-900",Z=`${I.text} font-medium ${X}`,q=v?/* @__PURE__ */s("label",{htmlFor:v,id:g,className:Z,children:l}):/* @__PURE__ */s("span",{id:g,className:Z,children:l}),z=/* @__PURE__ */s(i.Provider,{value:g,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:V?b:u})}),B=[$?"border-t border-line-subtle first:border-t-0":"",I.pad,F].filter(Boolean).join(" "),C=null!=N&&!1!==N&&/* @__PURE__ */s("div",{className:`${I.bodyTop} border-t border-line-subtle ${I.bodyPad}`,children:N});/* @__PURE__ */
|
|
7
7
|
return r("div",W?{className:B,children:[
|
|
8
8
|
/* @__PURE__ */r("div",{"data-setting-line":"",className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-2",children:[
|
|
9
9
|
/* @__PURE__ */s("div",{className:"flex-1 basis-0",children:/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${X}`,children:[null!=o&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),q,T]})}),
|
|
@@ -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__ */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return(new Date).toISOString()}var K=null,q=[],J=!1,L=null,Q=/* @__PURE__ */new Set;function X(){for(const t of Q)t()}function $(t){q=t,X()}function z(){const t=K;return t?L=t.list().then(e=>{K===t&&(q=e,J=!0,X())}).catch(()=>{K===t&&(J=!0,X())}).finally(()=>{L=null}):(q=[],J=!0,X(),Promise.resolve())}function H(t){K=t,q=[],J=!1,t?z():X()}function U(t){return Q.add(t),!K||J||L||z(),()=>{Q.delete(t)}}function Y(){return q}function Z(){const
|
|
1
|
+
import{toast_default as t}from"./chunk-OQW42DOR.js";import{useShellPrefs as e}from"./chunk-KC3EX26K.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(F(),R()):"none"!==t&&0!==m||F()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&R())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),F())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);F(),N(s,{volume:u,repeat:d});const e="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(e)}catch{}try{t.info(e)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,O={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function _(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=_(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*O[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function F(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function G(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=_(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*O[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var V="pomodoro_tasks",W="pomodoro_tasks_migrated";function j(){return Math.random().toString(36).slice(2,11)}function E(){/* @__PURE__ */
|
|
2
|
+
return(new Date).toISOString()}var K=null,q=[],J=!1,L=null,Q=/* @__PURE__ */new Set;function X(){for(const t of Q)t()}function $(t){q=t,X()}function z(){const t=K;return t?L=t.list().then(e=>{K===t&&(q=e,J=!0,X())}).catch(()=>{K===t&&(J=!0,X())}).finally(()=>{L=null}):(q=[],J=!0,X(),Promise.resolve())}function H(t){K=t,q=[],J=!1,t?z():X()}function U(t){return Q.add(t),!K||J||L||z(),()=>{Q.delete(t)}}function Y(){return q}function Z(){const t=function(){const{prefs:t,save:n}=e(),r=a(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=j(),n=E(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:E()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(U,Y,Y),i=o(e=>{const n=K;if(!n)return t.addTask(e);const o="tmp-"+j(),a=E(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return $([...q,r]),n.create({...e,name:e.name.trim()}).then(t=>$(q.map(e=>e.id===o?{...r,...t}:e))).catch(()=>$(q.filter(t=>t.id!==o))),o},[t]),c=o((e,n)=>{const o=K;if(!o)return t.updateTask(e,n);$(q.map(t=>t.id===e?{...t,...n,id:e,updatedAt:E()}:t)),o.update(e,n).catch(()=>{z()})},[t]),l=o(e=>{const n=K;if(!n)return t.removeTask(e);const o=q;$(q.filter(t=>t.id!==e)),n.remove(e).catch(()=>$(o))},[t]),s=o(e=>{if(!K)return t.toggleDone(e);const n=q.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=o(e=>{K||t.setAllTasks(e)},[t]);return null===K?t:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(W))return;const n=localStorage.getItem(V);if(!n)return void localStorage.setItem(W,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(V),void localStorage.setItem(W,"1");const a=E(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||j(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(V),localStorage.setItem(W,"1")}catch{try{localStorage.setItem(W,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,G as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,H as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
|
|
@@ -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:[
|