efficient-shell 10.17.1 → 10.18.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/dist/{Browser-4B76MFTG.js → Browser-UWCA2UQO.js} +13 -13
- package/dist/Calculator-6NJNSIRN.js +29 -0
- package/dist/{CurrencyConverter-36BFSFRS.js → CurrencyConverter-42IHLJVV.js} +8 -8
- package/dist/{Documents-VKAMBKSP.js → Documents-NRS6FCCD.js} +25 -25
- package/dist/{Files-NRYZG4KY.js → Files-OGBZKSHI.js} +88 -88
- package/dist/{Notepad-AQXGH6VP.js → Notepad-CMLPGGRI.js} +9 -9
- package/dist/{PomodoroTimer-RHDLKJBY.js → PomodoroTimer-PD7POYX5.js} +20 -20
- package/dist/{Preview-DEBTZQP5.js → Preview-XPSNRIYM.js} +51 -51
- package/dist/Sidebar-2HHICMZZ.js +44 -0
- package/dist/{Spreadsheet-FSHLWXYP.js → Spreadsheet-WLRVB7LK.js} +11 -11
- package/dist/{Stock-CV53A432.js → Stock-IABQRSXZ.js} +3 -3
- package/dist/{Weather-R4MCLH7F.js → Weather-4QPYOENN.js} +22 -22
- package/dist/{WorldClock-CSFPCZHU.js → WorldClock-3ZVRBLEW.js} +6 -6
- package/dist/ai/index.d.ts +19 -3
- package/dist/ai/index.js +91 -81
- package/dist/ai.css +1 -1
- 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/ChartTooltip.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/chunk-22RQC4EW.js +20 -0
- package/dist/chunk-2H6YNMBE.js +14 -0
- package/dist/{chunk-XTV3CAV7.js → chunk-2VGQS6CW.js} +1 -1
- package/dist/{chunk-5VAIVRK6.js → chunk-2YSGXZOL.js} +48 -48
- package/dist/{chunk-SQCUN2DX.js → chunk-34URULVW.js} +1 -1
- package/dist/{chunk-5LCDCO46.js → chunk-3ELLBQPS.js} +1 -1
- package/dist/{chunk-NZQCDFDG.js → chunk-3NW5LD7D.js} +3 -3
- package/dist/{chunk-IX7QXMNJ.js → chunk-3PR5YMWZ.js} +1 -1
- package/dist/{chunk-ILP7QVW5.js → chunk-3UXXA2CS.js} +8 -8
- package/dist/{chunk-NRI26RYC.js → chunk-4HBSQGRI.js} +2 -2
- package/dist/{chunk-BZUA5F33.js → chunk-4UKGVLFP.js} +1 -1
- package/dist/{chunk-3VLG6LR3.js → chunk-4WEFGKJL.js} +4 -4
- package/dist/{chunk-UABVKJK7.js → chunk-54NMFQMW.js} +1 -1
- package/dist/{chunk-IDV32UV7.js → chunk-5HO53ZE7.js} +26 -26
- package/dist/{chunk-U32J7D4Q.js → chunk-5QGBVTGS.js} +2 -2
- package/dist/{chunk-BE777IO7.js → chunk-5SIOCKCK.js} +2 -2
- package/dist/{chunk-D6OYQM4V.js → chunk-5TDQPZDB.js} +5 -5
- package/dist/chunk-5TQLUPZD.js +6 -0
- package/dist/{chunk-AEJYSUVQ.js → chunk-5WYRAJ5F.js} +1 -1
- package/dist/chunk-67MQ5S32.js +8 -0
- package/dist/chunk-6JSXIEH2.js +4 -0
- package/dist/{chunk-Q3IR5SKD.js → chunk-6XBWM453.js} +1 -1
- package/dist/{chunk-L2RS2UQM.js → chunk-77AQNJE2.js} +1 -1
- package/dist/chunk-77MOYIQW.js +15 -0
- package/dist/chunk-7INZ7O3A.js +5 -0
- package/dist/{chunk-G4JTO5PB.js → chunk-7JGR7WPD.js} +1 -1
- package/dist/{chunk-3PR7FLTZ.js → chunk-7VBXIIEC.js} +2 -2
- package/dist/{chunk-MAFSELZK.js → chunk-A42MKJA3.js} +1 -1
- package/dist/{chunk-SOJEQHZ2.js → chunk-AYDW63LV.js} +1 -1
- package/dist/{chunk-XCAO2F3H.js → chunk-C6Y7B73Q.js} +1 -1
- package/dist/{chunk-EC527NE3.js → chunk-DCRLJMQ6.js} +1 -1
- package/dist/chunk-DESWIPOZ.js +3 -0
- package/dist/{chunk-WWLKVGV7.js → chunk-DGZAQXTW.js} +4 -4
- package/dist/{chunk-TLWGOQI3.js → chunk-DHIQ46C5.js} +3 -3
- package/dist/chunk-DYNJ2H6R.js +8 -0
- package/dist/chunk-EJUNGVK2.js +22 -0
- package/dist/{chunk-CNUHLJYD.js → chunk-EPY34L26.js} +1 -1
- package/dist/{chunk-XKJ7GEVA.js → chunk-FACWYKL6.js} +6 -6
- package/dist/{chunk-ZI3DGOW6.js → chunk-FKRPQDFX.js} +16 -16
- package/dist/{chunk-HS2E7DVI.js → chunk-FOFZI62F.js} +1 -1
- package/dist/{chunk-Q5QS5MFX.js → chunk-FS6EOU4G.js} +1 -1
- package/dist/{chunk-RBEI4CKX.js → chunk-FTF6JKD5.js} +5 -5
- package/dist/{chunk-WZ5QSSUM.js → chunk-G4GVLK44.js} +6 -6
- package/dist/{chunk-K7L3ZCPB.js → chunk-GEP4FROW.js} +3 -3
- package/dist/{chunk-5N5AAYQV.js → chunk-GISDIVFK.js} +1 -1
- package/dist/{chunk-NZGNOMWX.js → chunk-GMOEYB4X.js} +11 -11
- package/dist/{chunk-5IPFQV34.js → chunk-GNNY35U6.js} +1 -1
- package/dist/{chunk-VHPT7ZS5.js → chunk-HV47GP2C.js} +5 -5
- package/dist/{chunk-TIGTIT3L.js → chunk-I33SVQ7P.js} +6 -6
- package/dist/chunk-I4VIEGCX.js +2 -0
- package/dist/chunk-JIGFR7Z3.js +11 -0
- package/dist/{chunk-YG6Y5X7S.js → chunk-JNQKBN5M.js} +5 -5
- package/dist/{chunk-QEB2UTHO.js → chunk-JYIH2EBG.js} +7 -7
- package/dist/{chunk-2EVTN26H.js → chunk-K4JQ3FQI.js} +2 -2
- package/dist/{chunk-BVIOCAEU.js → chunk-KDXH6FLQ.js} +1 -1
- package/dist/chunk-LAO5ZHQ6.js +14 -0
- package/dist/{chunk-QJLBBDX2.js → chunk-LYHJHUQH.js} +1 -1
- package/dist/chunk-MJGK6QTO.js +7 -0
- package/dist/{chunk-LAMRQE2P.js → chunk-MNNZGO2E.js} +1 -1
- package/dist/{chunk-S5SRXI4V.js → chunk-MVZRZTQP.js} +1 -1
- package/dist/{chunk-MMQ6ETRD.js → chunk-N67QX3WW.js} +2 -2
- package/dist/{chunk-3TKMH5VR.js → chunk-N6CS2FO2.js} +1 -1
- package/dist/{chunk-FEATDGFD.js → chunk-NFB7PARJ.js} +1 -1
- package/dist/{chunk-WON5GBJY.js → chunk-NU5HN3FZ.js} +7 -7
- package/dist/{chunk-AFINCNY3.js → chunk-NVD4AI5Y.js} +1 -1
- package/dist/{chunk-QLVJ5W4G.js → chunk-O47HKK6E.js} +1 -1
- package/dist/{chunk-M5LR7ZZX.js → chunk-O6JJIR4H.js} +1 -1
- package/dist/{chunk-EZUQ5NXE.js → chunk-OORL6BIG.js} +1 -1
- package/dist/{chunk-SDATPJM2.js → chunk-OP5DOO3K.js} +4 -4
- package/dist/{chunk-XQMPLXGG.js → chunk-PLK2WHZG.js} +16 -16
- package/dist/chunk-PN5FQVMB.js +7 -0
- package/dist/chunk-PUF75SMJ.js +1 -0
- package/dist/{chunk-NYEMGKAE.js → chunk-PW52RXPI.js} +1 -1
- package/dist/chunk-QDKAA3HR.js +2 -0
- package/dist/{chunk-CCIGAU5Y.js → chunk-QHPVAXHR.js} +3 -3
- package/dist/{chunk-NVFYLTJ6.js → chunk-QRYSL6QU.js} +2 -2
- package/dist/{chunk-HLQVB7FG.js → chunk-RBBIAIPH.js} +8 -8
- package/dist/{chunk-G4PGEQOX.js → chunk-RUGQO7YF.js} +9 -9
- package/dist/{chunk-ENDCV7B3.js → chunk-RVRDDTEG.js} +9 -9
- package/dist/{chunk-WS7XIJS6.js → chunk-RXCGE2AY.js} +1 -1
- package/dist/{chunk-SOBGCIPF.js → chunk-S74LKSUB.js} +1 -1
- package/dist/{chunk-CF7BMDU3.js → chunk-SDDV3UCN.js} +3 -3
- package/dist/{chunk-CUKDQPEN.js → chunk-SLU45G5J.js} +3 -3
- package/dist/{chunk-ZMRGHVKS.js → chunk-TKJBZIHT.js} +1 -1
- package/dist/chunk-TLMFVEMC.js +9 -0
- package/dist/{chunk-EQZZ4V5X.js → chunk-TXDA7TTP.js} +1 -1
- package/dist/{chunk-B4HSNEBK.js → chunk-UDKTAG57.js} +1 -1
- package/dist/{chunk-4D66DUU5.js → chunk-UYRMW5MO.js} +5 -5
- package/dist/{chunk-5W2OEDUD.js → chunk-V6Y4OC6K.js} +8 -8
- package/dist/{chunk-H7BKSATJ.js → chunk-VDUXPMOQ.js} +1 -1
- package/dist/{chunk-4V73LGZG.js → chunk-VIQ6OME2.js} +8 -8
- package/dist/{chunk-ZF2MNQXY.js → chunk-VN4KSRZ5.js} +1 -1
- package/dist/chunk-VNKAIEJ6.js +1 -0
- package/dist/{chunk-HLVOHOBC.js → chunk-VQCSHJEF.js} +5 -5
- package/dist/{chunk-7AZAMDGG.js → chunk-VWIYC2NB.js} +7 -7
- package/dist/{chunk-GD7ILVPF.js → chunk-W3OWPBQL.js} +2 -2
- package/dist/{chunk-N4ZEB4UD.js → chunk-WYFMSL4Q.js} +9 -9
- package/dist/{chunk-OUIE2N2Z.js → chunk-XCHAU2UN.js} +5 -5
- package/dist/{chunk-HJ2BDUO6.js → chunk-XK42AQOJ.js} +4 -4
- package/dist/{chunk-7X4QNWA7.js → chunk-XLWMM53L.js} +2 -2
- package/dist/chunk-XYBI57KO.js +12 -0
- package/dist/{chunk-X2KMUHBB.js → chunk-Y62TTKSY.js} +3 -3
- package/dist/{chunk-TXDBOSSB.js → chunk-YILGAEW3.js} +1 -1
- package/dist/{chunk-4MJA2SPJ.js → chunk-YJXS7BR5.js} +13 -13
- package/dist/{chunk-EQCFPRKJ.js → chunk-YSDPFDAG.js} +1 -1
- package/dist/{chunk-UG6RI525.js → chunk-Z5A4EY2R.js} +1 -1
- package/dist/{chunk-JFH5HW2G.js → chunk-ZQKA2XKH.js} +7 -7
- package/dist/{chunk-HYDVHGVT.js → chunk-ZWMODDVE.js} +2 -2
- package/dist/data/DataTable.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/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/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/index.js +222 -222
- package/dist/map/index.js +7 -7
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/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/EditableGrid.js +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-AXFKAC7G.js +0 -29
- package/dist/Sidebar-CB6KRPW2.js +0 -44
- package/dist/chunk-4Q25UHWB.js +0 -22
- package/dist/chunk-6ACS4S4P.js +0 -15
- package/dist/chunk-7RPYVQEV.js +0 -2
- package/dist/chunk-DOC52JBV.js +0 -20
- package/dist/chunk-EDMDKQNO.js +0 -4
- package/dist/chunk-F7Z47OIF.js +0 -12
- package/dist/chunk-FX6DBXXD.js +0 -1
- package/dist/chunk-GLBLKHYA.js +0 -5
- package/dist/chunk-HXNMRJQ4.js +0 -2
- package/dist/chunk-HXZ5XPBS.js +0 -3
- package/dist/chunk-IHFZ7OXO.js +0 -14
- package/dist/chunk-KLBJ646Z.js +0 -8
- package/dist/chunk-NXVFY22L.js +0 -9
- package/dist/chunk-RAAH4TQU.js +0 -1
- package/dist/chunk-SRWZE3WA.js +0 -6
- package/dist/chunk-TNDRHHKN.js +0 -14
- package/dist/chunk-UXPBVRSE.js +0 -7
- package/dist/chunk-XPTOKPUM.js +0 -11
- package/dist/chunk-YUECA3XB.js +0 -8
- package/dist/chunk-YYZ73H64.js +0 -7
- /package/dist/{chunk-3J2PO3KW.js → chunk-ECJKIPWU.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{buildQuerySections as e,buildEmptySections as t,flattenRows as r,DEFAULT_MAGNIFIER as n,stepIndex as a,nextGroupIndex as s,SEE_ALL_ICON as l,resultTypeKey as o}from"./chunk-WGRS6QBT.js";import{useDismissPopupsOnOpen as i}from"./chunk-7QSDPSXP.js";import{
|
|
1
|
+
import{buildQuerySections as e,buildEmptySections as t,flattenRows as r,DEFAULT_MAGNIFIER as n,stepIndex as a,nextGroupIndex as s,SEE_ALL_ICON as l,resultTypeKey as o}from"./chunk-WGRS6QBT.js";import{useDismissPopupsOnOpen as i}from"./chunk-7QSDPSXP.js";import{SpinnerRing as c,LoadingSpinner as d}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{glassStyle as p}from"./chunk-F27JJHNJ.js";import{useShellStrings as m}from"./chunk-GDQJBQ5B.js";import{useState as h,useRef as f,useEffect as y,useMemo as g,useId as x,useCallback as b}from"react";import{createPortal as k}from"react-dom";import{jsxs as v,jsx as w}from"react/jsx-runtime";function N(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:r}=e;return{results:t,truncatedTypes:Array.isArray(r)?r:[]}}return{results:[],truncatedTypes:[]}}var A=[];function L(e,t,r){const[n,a]=h([]),[s,l]=h(A),[o,i]=h(!1),[c,d]=h("none"),u=f(function(){let e=0,t=null;const r=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{r();const n=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>n===e}},cancel:r}}());y(()=>{const n=u.current;if(e.length<r||!t||0===t.length)return n.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),void i(!1);i(!0);const s=setTimeout(async()=>{const r=n.begin(),s=await async function(e,t,r){const n=await Promise.all(e.map(async e=>{try{return{failed:!1,...N(await e(t,{signal:r}))}}catch(e){const t=r.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:r}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===r}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:n.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(n.flatMap(e=>e.truncatedTypes))),failed:n.filter(e=>e.failed).length}}(t,e,r.signal);r.isCurrent()&&(a(s.results),l(s.truncatedTypes),d(0===s.failed?"none":s.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(s),n.cancel()}},[e,t,r]);return{results:n,truncatedTypes:s,loading:o,failure:c,reset:b(()=>{u.current.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),i(!1)},[])}}var C=(e,t)=>`${e}-opt-${t}`;function E(e,t){if("seeAll"===e.kind)return l;if("action"===e.kind)return e.icon??n;if(e.icon)return e.icon;const r=t?.[o(e.result)];return r||n}function T({sections:e,activeIdx:t,listId:r,label:n,typeIcons:a,groupCount:s,groupLabel:l,onHover:o,onPick:i}){let c=0;/* @__PURE__ */
|
|
2
2
|
return w("div",{id:r,role:"listbox","aria-label":n,className:"py-1",children:e.map(e=>/* @__PURE__ */v("div",{role:"group","aria-label":l(e.title,e.count,!!e.truncated),children:[
|
|
3
3
|
/* @__PURE__ */v("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:[
|
|
4
4
|
/* @__PURE__ */w("span",{children:e.title}),
|
|
@@ -7,14 +7,14 @@ return v("div",{id:C(r,n),role:"option","aria-selected":s,className:"flex items-
|
|
|
7
7
|
/* @__PURE__ */w("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:E(e,a)})}),
|
|
8
8
|
/* @__PURE__ */v("div",{className:"flex-1 min-w-0",children:[
|
|
9
9
|
/* @__PURE__ */w("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */w("p",{className:"text-xs text-gray-400 truncate",children:d})]}),l&&/* @__PURE__ */w("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-ink-faint",children:l})]},e.key)})]},e.key))})}var j="react-os-shell:open-global-search";function D(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(j))}function I({providers:l,typeIcons:o,typeLabels:N,listRoutes:A,placeholder:E,quickActions:D,onSelect:I,recent:K,onRecord:R,favorites:B,hotkey:M=!0}={}){const P=m().search,S=E??P.placeholder,[$,J]=h(!1),[H,Q]=h(""),[W,z]=h(0),F=f(null),{results:G,truncatedTypes:V,loading:q,failure:U,reset:X}=L(H,l,2);y(()=>{const e=e=>{M&&!e.defaultPrevented&&(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),J(e=>!e)),"Escape"===e.key&&$&&J(!1)},t=()=>J(!0);return window.addEventListener("keydown",e),window.addEventListener(j,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(j,t)}},[$,M]),i($);const[Z,_]=h(!1);$!==Z&&(_($),$&&(Q(""),z(0),X())),y(()=>{$?setTimeout(()=>F.current?.focus(),50):Q("")},[$]),y(()=>{z(0)},[G]);const O=H.length>=2,Y=g(()=>O?e(G,D,H,P.actions,{truncatedTypes:V,listRoutes:A,typeLabels:N,seeAllLabel:P.seeAll}):t({recent:K,favorites:B,actions:D,typeLabels:N},P),[O,G,V,A,N,D,H,K,B,P]),ee=g(()=>r(Y),[Y]),te=Math.min(W,Math.max(ee.length-1,0)),re=x(),ne=ee.length>0;y(()=>{$&&0!==ee.length&&document.getElementById(C(re,te))?.scrollIntoView?.({block:"nearest"})},[$,te,ee.length,re]);const ae=b(e=>{J(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||R?.(e.result),I?.(e.result)):e.action.onSelect()},[I,R]);return $?k(
|
|
10
|
-
/* @__PURE__ */v("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:
|
|
10
|
+
/* @__PURE__ */v("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:u.overlay},onClick:()=>J(!1),children:[
|
|
11
11
|
/* @__PURE__ */w("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
|
|
12
|
-
/* @__PURE__ */v("div",{className:"relative z-10 w-full max-w-xl rounded-(--radius-popup) overflow-hidden",onClick:e=>e.stopPropagation(),style:
|
|
12
|
+
/* @__PURE__ */v("div",{className:"relative z-10 w-full max-w-xl rounded-(--radius-popup) overflow-hidden",onClick:e=>e.stopPropagation(),style:p(),children:[
|
|
13
13
|
/* @__PURE__ */v("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
|
|
14
14
|
/* @__PURE__ */w("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:n})}),
|
|
15
|
-
/* @__PURE__ */w("input",{ref:F,type:"text",value:H,onChange:e=>{Q(e.target.value),z(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),z(a(te,1,ee.length))):"ArrowUp"===e.key?(e.preventDefault(),z(a(te,-1,ee.length))):"Tab"===e.key&&ee.length>0?(e.preventDefault(),z(s(Y.map(e=>e.rows.length),te,e.shiftKey?-1:1))):"Enter"===e.key&&ee[te]&&ae(ee[te])},placeholder:S,role:"combobox","aria-expanded":ne,"aria-controls":ne?re:void 0,"aria-activedescendant":ne?C(re,te):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),q&&/* @__PURE__ */w("span",{"data-global-search-spinner":"",role:"status","aria-label":P.searching,className:"flex shrink-0",children:/* @__PURE__ */w(
|
|
15
|
+
/* @__PURE__ */w("input",{ref:F,type:"text",value:H,onChange:e=>{Q(e.target.value),z(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),z(a(te,1,ee.length))):"ArrowUp"===e.key?(e.preventDefault(),z(a(te,-1,ee.length))):"Tab"===e.key&&ee.length>0?(e.preventDefault(),z(s(Y.map(e=>e.rows.length),te,e.shiftKey?-1:1))):"Enter"===e.key&&ee[te]&&ae(ee[te])},placeholder:S,role:"combobox","aria-expanded":ne,"aria-controls":ne?re:void 0,"aria-activedescendant":ne?C(re,te):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),q&&/* @__PURE__ */w("span",{"data-global-search-spinner":"",role:"status","aria-label":P.searching,className:"flex shrink-0",children:/* @__PURE__ */w(c,{className:"h-4 w-4",ink:"text-ink-faint"})}),
|
|
16
16
|
/* @__PURE__ */w("kbd",{className:"hidden sm:inline-flex items-center rounded border border-line-strong px-2 py-0.5 text-2xs font-medium text-ink-faintest",children:P.escBadge})]}),
|
|
17
|
-
/* @__PURE__ */v("div",{className:"max-h-[50vh] overflow-y-auto",children:[q&&0===ee.length&&/* @__PURE__ */w(
|
|
17
|
+
/* @__PURE__ */v("div",{className:"max-h-[50vh] overflow-y-auto",children:[q&&0===ee.length&&/* @__PURE__ */w(d,{size:"sm",padding:"py-6",label:P.searching}),!q&&"all"===U&&O&&/* @__PURE__ */w("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:P.searchFailed}),!q&&O&&0===ee.length&&"all"!==U&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:P.noResults}),ne&&/* @__PURE__ */w(T,{sections:Y,activeIdx:te,listId:re,label:P.listLabel,typeIcons:o,groupCount:P.groupCount,groupLabel:P.groupLabel,onHover:z,onPick:ae}),!q&&"some"===U&&O&&/* @__PURE__ */w("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:P.partialFailure}),!q&&!O&&0===ee.length&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:P.minChars(2)})]}),
|
|
18
18
|
/* @__PURE__ */v("div",{className:"flex items-center justify-between px-4 py-2 border-t border-line-subtle bg-surface-sunken text-2xs text-ink-faintest",children:[
|
|
19
19
|
/* @__PURE__ */v("div",{className:"flex items-center gap-3",children:[
|
|
20
20
|
/* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-4EZIWLJJ.js";import{IconButton_default as a}from"./chunk-PUF75SMJ.js";import{Icon as o}from"./chunk-2UO47XB4.js";import{Tooltip as n}from"./chunk-6XBWM453.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m(e,l,r,a){const o=h.filter(l=>"link"!==l&&e.has(l)).length+(l?1:0);return r&&0!==o?a>0?"paragraph":"words":null}function w({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s,clear:i}){let t=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),d=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);const c=m(l,r,i,d);return"paragraph"===c&&(d+=1),"words"===c&&(t+=1),{words:t>0,paragraph:d>0,oneRow:t>0&&d>0&&t+1+d<=9,flow:t>0&&d>0&&t+1+d>9&&t<=7,cells:{words:t,paragraph:d}}}function g(e,l){/* @__PURE__ */
|
|
2
|
+
return i(n,{content:e,children:l},l.key??void 0)}function f({offered:n,pressed:h,onMark:f,color:k,linkOpen:v=!1,last:N,alignment:C,list:M,letterCase:D,clear:x,disabled:y=!1,"aria-label":B,windows:j,className:q="",layout:A="grid"}){const I=s().textToolbar,L=w({offered:n,color:k,last:N,alignment:C,list:M,letterCase:D,clear:x});if(!L.words&&!L.paragraph)return null;const S=m(n,k,x,L.cells.paragraph),U=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,$=(e,l,r,o)=>n.has(e)?g(l,/* @__PURE__ */i(a,"link"===e?{pressed:v,className:U(v),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":v,"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r}:{className:U(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,J=l(I),R=e.map(e=>[e,J[e],r(e)]),K=C?e.filter(e=>C.allow.includes(e)):[],T=C&&K.includes(C.value)?C.value:K[0],E=[["none",I.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",I.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",I.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],O=x&&S?g(I.clear,/* @__PURE__ */i(a,{className:U(!1),"aria-label":I.clear,disabled:y,onMouseDown:c,onClick:x.onClear,children:/* @__PURE__ */i(o,{name:"revert"})},"clear")):null,Q=/* @__PURE__ */t(d,{children:[$("bold",I.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),$("italic",I.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),$("underline",I.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),$("strike",I.strike,/* @__PURE__ */i(o,{name:"strike"})),k?g(I.color,/* @__PURE__ */i(a,{pressed:k.open,className:U(k.open,"rosh-tb-color"),"aria-label":I.color,"aria-haspopup":"dialog","aria-expanded":k.open,disabled:y,style:k.run?{"--rosh-tb-run":k.run}:void 0,onMouseDown:c,onClick:k.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,$("link",I.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),$("sup",I.sup,/* @__PURE__ */i(o,{name:"superscript"})),$("sub",I.sub,/* @__PURE__ */i(o,{name:"subscript"})),$("code",I.code,/* @__PURE__ */i(o,{name:"code"})),u(N)?N:null,"words"===S?O:null]}),W=/* @__PURE__ */t(d,{children:[C&&K.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":I.alignment,onKeyDown:e=>p(e,K,e=>C.onChange(e)),children:R.map(([e,l,r])=>C.allow.includes(e)?g(l,/* @__PURE__ */i(a,{role:"radio",pressed:C.value===e,className:U(C.value===e),"aria-checked":C.value===e,"aria-label":l,tabIndex:e===T?0:-1,disabled:y||C.disabled,onMouseDown:c,onClick:()=>C.onChange(e),children:r},e)):null)}):null,M&&n.has("bullet")?g(I.bullet,/* @__PURE__ */i(a,{className:U("bullet"===M.pressed),"aria-label":I.bullet,"aria-pressed":"bullet"===M.pressed,disabled:y,onMouseDown:c,onClick:()=>M.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,M&&n.has("number")?g(I.number,/* @__PURE__ */i(a,{className:U("number"===M.pressed),"aria-label":I.number,"aria-pressed":"number"===M.pressed,disabled:y,onMouseDown:c,onClick:()=>M.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,$("quote",I.quote,/* @__PURE__ */i(o,{name:"quote"})),D?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":I.letterCase,onKeyDown:e=>p(e,E.map(([e])=>e),e=>D.onChange(e)),children:E.map(([e,l,r])=>g(l,/* @__PURE__ */i(a,{role:"radio",pressed:D.value===e,className:U(D.value===e),"aria-checked":D.value===e,"aria-label":l,tabIndex:e===(D.value||"none")?0:-1,disabled:y||D.disabled,onMouseDown:c,onClick:()=>D.onChange(D.value===e?"":e),children:r},e)))}):null,"paragraph"===S?O:null]}),X="row"===A,F=X?" is-row":L.flow?" is-flow":L.oneRow?" is-one-row":L.words&&void 0===N&&"words"!==S?" is-eight":"",G=b(n,Boolean(k)),H={"--rosh-tb-color-col":String(G.color),"--rosh-tb-link-col":String(G.link),...X?{"--rosh-tb-cells":String(L.cells.words+L.cells.paragraph),"--rosh-tb-groupgap":L.words&&L.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let P;return P=X?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[L.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:Q}):null,L.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:W}):null]}):L.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[Q,
|
|
3
|
+
/* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),W]}):L.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
|
|
4
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-words",children:Q}),
|
|
5
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-para",children:W})]}):/* @__PURE__ */t(d,{children:[L.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===N&&"words"!==S?" is-eight":""),children:Q}):null,L.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:W}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${F} ${q}`.trim(),style:H,children:[
|
|
6
|
+
/* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":B??I.formatting,children:P}),j]})}export{f as TextToolbar,w as textToolbarRows,b as textToolbarWindowColumns};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{CountBadge as t}from"./chunk-CLTRQ7AQ.js";import{Tooltip as n}from"./chunk-
|
|
1
|
+
import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{CountBadge as t}from"./chunk-CLTRQ7AQ.js";import{Tooltip as n}from"./chunk-6XBWM453.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{createContext as o,useRef as a,useState as i,useEffect as l,useContext as s}from"react";import{jsx as c,jsxs as d,Fragment as u}from"react/jsx-runtime";var h=o({labels:"none",shown:"none"}),f="button[data-icon-rail-button]:not([disabled])";function b(e,t,n){const r=getComputedStyle(e),o=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a="horizontal"===t?(parseFloat(r.columnGap)||0)*Math.max(0,n-1):0,i=e.parentElement;let l=1/0;if(i){const e=getComputedStyle(i);l=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:o+a,room:l}}function m({"aria-label":t,orientation:n="vertical",children:o,className:s="",labels:d="none",labelsFit:u=!1,onLabelsShown:m}){const p=a(null),g="none"!==d&&u,[v,y]=i(null),w="none"===d?"none":g?v??"none":"all",x=a(()=>{});x.current=()=>{const t=p.current;if(!t||!g)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=parseFloat(n.minWidth)||0,a=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(o,r+a),worded:"below"===t?Math.max(o,r+Math.max(a,i)):Math.max(o,r+a+8+i),active:"true"===e.getAttribute("aria-pressed")}})}(t,d);y(e({buttons:r,orientation:n,...b(t,n,r.length)}))},r(()=>{x.current()}),l(()=>{const e=p.current?.parentElement;if(!g||!e)return;let t=!0;const n=()=>{t&&x.current()},r="undefined"==typeof ResizeObserver?void 0:ResizeObserver,o=r?new r(n):null;return o?.observe(e),document.fonts?.ready.then(n,()=>{}),()=>{t=!1,o?.disconnect()}},[g]);const F=a(null),k=a(m);k.current=m,l(()=>{g&&null!==v&&F.current!==v&&(F.current=v,k.current?.(v))},[g,v]),r(()=>{const e=p.current;if(!e)return;const t=[...e.querySelectorAll(f)];if(0===t.length)return;const n=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===n?0:-1});/* @__PURE__ */
|
|
2
2
|
return c("div",{ref:p,role:"toolbar","aria-label":t,"aria-orientation":n,"data-orientation":n,onKeyDown:e=>{const t=p.current;if(!t)return;const r=[...t.querySelectorAll(f)],o=r.indexOf(e.target);if(o<0)return;const a="vertical"===n?"ArrowUp":"ArrowLeft",i="vertical"===n?"ArrowDown":"ArrowRight",l=e.key===i?(o+1)%r.length:e.key===a?(o-1+r.length)%r.length:"Home"===e.key?0:"End"===e.key?r.length-1:-1;if(!(l<0)){e.preventDefault();for(const e of r)e.tabIndex=e===r[l]?0:-1;r[l].focus()}},"data-labels":"none"===d?void 0:d,"data-labels-shown":"none"===d?void 0:w,className:`flex gap-1 ${"vertical"===n?"flex-col items-center":"flex-row items-center"} ${s}`.trim(),children:/* @__PURE__ */c(h.Provider,{value:{labels:d,shown:w},children:o})})}function p({label:e,icon:r,active:o,disabled:a,onClick:i,badge:l,tooltipSide:f="right",className:b=""}){const m=!0===o,{labels:p,shown:g}=s(h),v=void 0===l||!1===l||0===l?r:/* @__PURE__ */c(t,{count:"number"==typeof l?l:void 0,dot:!0===l,max:99,children:r}),y="none"!==p,w=y&&("all"===g||"chosen"===g&&m),x=/* @__PURE__ */c("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof o?o:void 0,disabled:a,onClick:a?void 0:i,className:[`relative inline-flex ${y?"beside"===p?"h-9 min-w-9 justify-center px-2":"min-h-9 min-w-9 flex-col justify-center px-1 py-1":"h-9 w-9 justify-center"} shrink-0 items-center rounded-lg transition-colors`,"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",m?"bg-accent-tint text-blue-700":"text-gray-600 not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest",b].filter(Boolean).join(" "),children:y?/* @__PURE__ */d(u,{children:[
|
|
3
3
|
/* @__PURE__ */c("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:v}),
|
|
4
4
|
/* @__PURE__ */c("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",w?"beside"===p?"ml-2":"mt-1":"max-h-0 max-w-0"].join(" "),children:e})]}):v});/* @__PURE__ */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{AccessibleTable as t}from"./chunk-TKJBZIHT.js";import{arcPath as e}from"./chunk-VFC6QUEN.js";import{useHighlight as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as n}from"./chunk-G4GVLK44.js";import{CHART_INK as r,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as l,useShellLocale as i}from"./chunk-GDQJBQ5B.js";import{formatPlain as s}from"./chunk-C3QOHMR6.js";import{useState as c}from"react";import{jsx as d,jsxs as m}from"react/jsx-runtime";function h(t,e,o,n){const r=(t,o)=>{const n=e[t]?.[o];return"number"==typeof n&&Number.isFinite(n)?n:0},a=t.map((e,o)=>t.reduce((t,e,n)=>t+r(o,n)+r(n,o),0)),l=Math.max(2,o),i=t.length>l,s=i?t.map((t,e)=>e).sort((t,e)=>a[e]-a[t]).slice(0,l-1).sort((t,e)=>t-e):t.map((t,e)=>e),c=new Map(s.map((t,e)=>[t,e])),d=i?s.length:-1,m=i?[...s.map(e=>t[e]),n]:[...t],h=m.map(()=>m.map(()=>0));let u=0;t.forEach((e,o)=>t.forEach((t,e)=>{const n=c.get(o)??d,a=c.get(e)??d;n!==d||a!==d?h[n][a]+=r(o,e):u+=r(o,e)}));const f=m.map((t,e)=>m.reduce((t,o,n)=>t+h[e][n]+h[n][e],0));return d>=0&&(f[d]+=u),{labels:m,matrix:h,totals:f,otherIndex:d,foldedCount:i?t.length-s.length:0}}function u({labels:u,matrix:f,size:p=340,maxNodes:x=8,padAngle:g=.04,arcWidth:b=12,formatValue:k,className:v,emptyLabel:M}){const $=l().charts,w=i(),N=k??(t=>s(t,w)),j=M??$.noFlows,[y,E]=c(null),{highlighted:F}=o(),C=h(u,f,x,$.other),{labels:I,matrix:Q,otherIndex:z,foldedCount:A}=C,B=(t,e)=>Q[t]?.[e]??0,L=t=>t===z?r.muted:a(t),T=C.totals,G=I.map((t,e)=>e).sort((t,e)=>T[e]-T[t]),H=G.reduce((t,e)=>t+T[e],0);if(H<=0)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${v??""}`,children:j});const O=p/2,V=p/2,J=p/2-44,K=J-b,P=g*G.length,R=/* @__PURE__ */new Map;let U=-Math.PI/2;G.forEach((t,e)=>{const o=T[t]/H*(2*Math.PI-P);R.set(t,{start:U,end:U+o,slot:e}),U+=o+g});const W=/* @__PURE__ */new Map,Y=[];for(const t of G)for(const e of G){const o=B(t,e);if(o<=0)continue;const n=R.get(t),r=o/Math.max(1,T[t])*(n.end-n.start),a=W.get(t)??0;W.set(t,a+r),Y.push({from:t,to:e,value:o,a:n.start+a+r/2,b:R.get(e).start+(R.get(e).end-R.get(e).start)/2})}const Z=(t,e)=>[O+e*Math.cos(t),V+e*Math.sin(t)],D="arc"===y?.kind?y.index:void 0,S="ribbon"===y?.kind?Y[y.index]:void 0;/* @__PURE__ */
|
|
2
|
+
return m("div",{className:`relative ${v??""}`,children:[
|
|
3
|
+
/* @__PURE__ */m("svg",{width:"100%",height:p,viewBox:`0 0 ${p} ${p}`,role:"img","aria-label":$.chord(G.length),onMouseLeave:()=>E(null),children:[Y.map((t,e)=>{const[o,n]=Z(t.a,K),[r,a]=Z(t.b,K),l=L(t.from),i=((t,e)=>y?"ribbon"===y.kind?y.index===e:y.index===t.from||y.index===t.to:null!==F?I[t.from]===F||I[t.to]===F:null)(t,e);/* @__PURE__ */
|
|
4
|
+
return d("path",{d:`M${o},${n} Q${O},${V} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/H*p*.9),strokeOpacity:null===i||i?.34:.07,strokeLinecap:"round",onMouseEnter:()=>E({kind:"ribbon",index:e})},`${I[t.from]}→${I[t.to]}`)}),G.map(t=>{const o=R.get(t),n=(o.start+o.end)/2,[a,l]=Z(n,J+16),i=(t=>y?"arc"===y.kind?y.index===t:Y[y.index].from===t||Y[y.index].to===t:null!==F?I[t]===F:null)(t);/* @__PURE__ */
|
|
5
|
+
return m("g",{onMouseEnter:()=>E({kind:"arc",index:t}),children:[
|
|
6
|
+
/* @__PURE__ */d("path",{d:e(O,V,K,J,o.start,o.end),fill:L(t),fillOpacity:null===i||i?1:.45}),
|
|
7
|
+
/* @__PURE__ */d("text",{x:a,y:l+4,fontSize:11,fill:r.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:I[t]})]},t)})]}),A>0&&/* @__PURE__ */d("p",{className:"mt-1 text-xs text-ink-faint",children:$.chordFolded(A)}),void 0!==D&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:I[D],rows:[{key:"total",label:$.totalFlow,color:L(D),value:N(T[D])}]})}),S&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:`${I[S.from]} → ${I[S.to]}`,rows:[{key:"value",label:$.flow,color:L(S.from),value:N(S.value)}]})}),
|
|
8
|
+
/* @__PURE__ */d(t,{caption:$.chord(G.length),head:[$.tableFrom,$.tableTo,$.value],rows:Y.map(t=>[I[t.from],I[t.to],N(t.value)])})]})}export{u as ChordChart,h as foldChord};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-TKJBZIHT.js";import{arcPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as l}from"./chunk-G4GVLK44.js";import{CHART_INK as a,resolveSeriesColor as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as o}from"./chunk-GDQJBQ5B.js";import{formatPlain as h,formatPercent as c}from"./chunk-C3QOHMR6.js";import{useState as u}from"react";import{jsx as s,jsxs as d}from"react/jsx-runtime";function m(e,t,r,l,a,n,i,o){if(l>=8)return;const h=e.reduce((e,t)=>e+p(t,8-l),0);if(h<=0)return;let c=t;e.forEach((e,t)=>{const u=p(e,8-l),s=u/h*r,d=`${i}/${e.key}`,f=0===l?t:a,b=0===l?e.key:n;o.push({id:d,label:e.label,value:u,depth:l,start:c,end:c+s,branch:f,branchKey:b}),e.children?.length&&m(e.children,c,s,l+1,f,b,d,o),c+=s})}function p(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+p(r,t-1),0):Math.max(0,e.value??0)}function f({nodes:p,size:f=320,innerRadius:b=44,ringGap:v=2,formatValue:k,centerLabel:x,className:g,emptyLabel:y}){const M=i().charts,$=o(),j=k??(e=>h(e,$)),N=y??M.nothingToBreakDown,[w,B]=u(null),{highlighted:L}=r(),C=[];if(m(p,-Math.PI/2,2*Math.PI,0,0,"","",C),0===C.length)/* @__PURE__ */return s("p",{className:`text-sm text-gray-500 ${g??""}`,children:N});const E=Math.max(...C.map(e=>e.depth))+1,G=f/2,I=f/2,K=(f/2-8-b)/E,Q=C.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),T=e=>`color-mix(in oklab, ${n(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${a.surface})`,z=e=>null!==w?e.id===w:null===L||e.branchKey===L,A=w?C.find(e=>e.id===w):void 0,F=e=>c(e.value/Q*100,1,$);/* @__PURE__ */
|
|
2
|
+
return d("div",{className:`relative ${g??""}`,children:[
|
|
3
|
+
/* @__PURE__ */d("svg",{width:"100%",height:f,viewBox:`0 0 ${f} ${f}`,role:"img","aria-label":M.sunburst(j(Q),E),onMouseLeave:()=>B(null),children:[C.map(e=>/* @__PURE__ */s("path",{d:t(G,I,b+e.depth*K+v/2,b+(e.depth+1)*K-v/2,e.start,e.end),fill:T(e),fillOpacity:z(e)?1:.45,stroke:a.surface,strokeWidth:1,onMouseEnter:()=>B(e.id)},e.id)),x&&/* @__PURE__ */s("text",{x:G,y:I+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:a.label,children:x})]}),A&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(l,{title:A.label,rows:[{key:"value",label:M.value,color:T(A),value:j(A.value)},{key:"share",label:M.share,color:a.muted,value:F(A)}]})}),
|
|
4
|
+
/* @__PURE__ */s(e,{caption:M.sunburst(j(Q),E),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:C.map(e=>[e.depth+1,e.label,j(e.value),F(e)])})]})}export{f as SunburstChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{onOverlayOpen as t}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{followAnchor as r,popupBounds as o,VIEWPORT_MARGIN as n,showingBox as i,placeBeside as a,placeArrow as l}from"./chunk-GLUJS42B.js";import{
|
|
1
|
+
import{onOverlayOpen as t}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{followAnchor as r,popupBounds as o,VIEWPORT_MARGIN as n,showingBox as i,placeBeside as a,placeArrow as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as s}from"./chunk-F27JJHNJ.js";import{registerModalEscapeInterceptor as d,escapeSurfaceAbove as h}from"./chunk-TWVUQUUD.js";import{createContext as m,useContext as u,useState as p,useRef as f,useId as x,useEffect as w,isValidElement as g,cloneElement as b}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,jsx as k}from"react/jsx-runtime";var j=m(!1),H=()=>u(j),W={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function N({content:m,side:u="top",delay:H=200,children:N,className:B="relative inline-flex",describe:J=!0,open:T}){const[M,U]=p(!1),z=(T??M)&&!(null==m||!1===m||""===m),[C,D]=p(null),E=f(void 0),L=f(null),P=f(null),$=x(),F=f(!1),G=()=>{window.clearTimeout(E.current),F.current||(E.current=window.setTimeout(()=>U(!0),H))},R=()=>{window.clearTimeout(E.current),U(!1)},I=()=>{F.current=!0,R()},Q=()=>{F.current=!1,R()};w(()=>()=>window.clearTimeout(E.current),[]),c(()=>{if(!z)return void D(null);const t=()=>{const t=L.current,e=P.current;if(!t||!e)return;const r=o(t),c=Math.max(0,r.right-r.left-2*n),s=Math.max(0,r.bottom-r.top-2*n);e.style.maxWidth=`${c}px`,e.style.maxHeight=`${s}px`;const d=e.getBoundingClientRect();if(d.width<=0||d.height<=0)return;const h=t.getBoundingClientRect();if(!i(t))return void R();const m=a(h,d,u,r,12),p=l(h,m,d,16,6),f={anchor:{left:h.left,top:h.top,width:h.width,height:h.height},left:m.left-h.left,top:m.top-h.top,maxWidth:c,maxHeight:s,side:m.side,arrow:p&&{left:p.x-h.left,top:p.y-h.top}};D(t=>{return t&&(r=f,(e=t).anchor.left===r.anchor.left&&e.anchor.top===r.anchor.top&&e.anchor.width===r.anchor.width&&e.anchor.height===r.anchor.height&&e.left===r.left&&e.top===r.top&&e.maxWidth===r.maxWidth&&e.maxHeight===r.maxHeight&&e.side===r.side&&e.arrow?.left===r.arrow?.left&&e.arrow?.top===r.arrow?.top)?t:f;var e,r})};return t(),r(()=>L.current,t)},[z,u,m]),w(()=>{if(!z)return;const e=d(t=>"Escape"===t.key&&(R(),!h(L.current))),r=t(R);return()=>{e(),r()}},[z]);const S=z&&J?$:void 0,V=g(N)?b(N,{"aria-describedby":[N.props["aria-describedby"],S].filter(Boolean).join(" ")||void 0}):N,q=z?s():void 0;/* @__PURE__ */
|
|
2
2
|
return y("span",{ref:L,className:B,"aria-describedby":g(N)?void 0:S,onMouseEnter:G,onMouseLeave:Q,onFocus:t=>{let e=!0;try{e=t.target.matches(":focus-visible")}catch{}e&&G()},onBlur:Q,onPointerDown:I,onClick:I,children:[
|
|
3
3
|
/* @__PURE__ */k(j.Provider,{value:!0,children:V}),z&&v(
|
|
4
4
|
/* @__PURE__ */y("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:e.hint,...C?.anchor},children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-JH4ZCPHW.js";import{fromDateKey as t,toDateKey as r}from"./chunk-2HMNOLKX.js";import{inputClasses as a,PLACEHOLDER_INK as n}from"./chunk-AYZY3YNC.js";import{calendarNames as i}from"./chunk-Y3JW2GW5.js";import{Icon as o}from"./chunk-2UO47XB4.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{useDropdownPosition as d}from"./chunk-GLUJS42B.js";import{
|
|
1
|
+
import{Calendar as e}from"./chunk-JH4ZCPHW.js";import{fromDateKey as t,toDateKey as r}from"./chunk-2HMNOLKX.js";import{inputClasses as a,PLACEHOLDER_INK as n}from"./chunk-AYZY3YNC.js";import{calendarNames as i}from"./chunk-Y3JW2GW5.js";import{Icon as o}from"./chunk-2UO47XB4.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{useDropdownPosition as d}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as u}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as b}from"./chunk-GDQJBQ5B.js";import{forwardRef as f,useState as p,useRef as h,useId as v,useEffect as g}from"react";import{createPortal as y}from"react-dom";import{jsx as x,jsxs as N}from"react/jsx-runtime";var k=/^\d{4}-\d{2}-\d{2}$/,j=/^(aria|data)-/,w=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function B(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":r(e);if(k.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":r(t)}function D(e,r){const a=t(e);return a?r.longDate(a.getFullYear(),a.getMonth(),a.getDate()):""}var W=f(function({value:f,onChange:k,min:W,max:C,invalid:F,size:J,native:O,weekStartsOn:$,className:q="","aria-label":E,"aria-describedby":L,"aria-labelledby":S,id:U,name:Y,disabled:z,placeholder:G,required:H,clearable:I,form:T,title:M,tabIndex:P,autoFocus:Q,onFocus:X,onBlur:Z,...A},K){const R=I??!H,V=B(f),_=B(W),ee=B(C),te=m().datePicker,re=b(),ae=i(re),[ne,ie]=p(!1),oe=h(null),le=h(null),se=h(null),de=v(),ue=v(),ce=v(),me=d(le,ne,{popupRef:se}),[be,fe]=p(!1);u(()=>{const e=!!U&&(le.current?.labels?.length??0)>0;e!==be&&fe(e)});const pe=!E&&(!!S||be);if(g(()=>{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=l(()=>ie(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[ne]),g(()=>{if(ne)return c(e=>"Escape"===e.key&&(ie(!1),le.current?.focus(),!0),()=>se.current)},[ne]),O)/* @__PURE__ */
|
|
2
2
|
return x("input",{ref:K,type:"date",lang:re,id:U,name:Y,disabled:z,"aria-label":E,"aria-describedby":L,"aria-invalid":F||void 0,value:V,min:_||void 0,max:ee||void 0,onChange:e=>k?.(t(e.target.value)),className:a({invalid:F,size:J,className:q}),"aria-labelledby":S,required:H,form:T,title:M,tabIndex:P,autoFocus:Q,onFocus:X,onBlur:Z,...A});const he=Object.fromEntries(Object.entries(A).filter(([e])=>j.test(e)&&!w.has(e))),ve=A["aria-required"],ge=!!H||!0===ve||"true"===ve,ye=[pe?ue:void 0,ge?ce:void 0,L].filter(Boolean).join(" ")||void 0,xe=r(/* @__PURE__ */new Date),Ne=(!_||xe>=_)&&(!ee||xe<=ee),ke=G??te.placeholder;/* @__PURE__ */
|
|
3
3
|
return N("div",{ref:oe,className:"relative",children:[
|
|
4
4
|
/* @__PURE__ */x("input",{ref:K,type:"hidden",name:Y,form:T,value:V}),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-TKJBZIHT.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-G4GVLK44.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-GDQJBQ5B.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:M=4,formatValue:N,animate:j=!0,className:$,emptyLabel:C}){const W=m().charts,F=c(),w=N??(e=>h(e,F)),B=C??W.nothingToCompare,L=p(),[R,T]=u(null),{highlighted:A}=a(),Q=x;if(k.length<3||0===Q.length)/* @__PURE__ */
|
|
2
|
+
return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:B});const z=y/2,E=y/2,G=y/2-46,H=n(k.length),J=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...Q.map(e=>e.values[t]??0).filter(Number.isFinite))),U=(e,t)=>{const r=Math.max(0,Math.min(1,t/J[e])),l=H.center(e)-H.step/2;return[z+G*r*Math.cos(l),E+G*r*Math.sin(l)]},V=(e,t)=>null!==R?R!==e:null!==A&&A!==t,Y=null!==R?Q[R]:void 0;/* @__PURE__ */
|
|
3
|
+
return f("div",{className:`relative ${$??""}`,children:[
|
|
4
|
+
/* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":L,onMouseLeave:()=>T(null),children:[
|
|
5
|
+
/* @__PURE__ */d("title",{id:L,children:W.acrossMeasures(Q.map(e=>e.label),k.length)}),Array.from({length:M},(e,r)=>{const l=G*(r+1)/M;return"circle"===v?/* @__PURE__ */d("circle",{cx:z,cy:E,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(z,E,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=U(t,J[t]);/* @__PURE__ */
|
|
6
|
+
return f("g",{children:[
|
|
7
|
+
/* @__PURE__ */d("line",{x1:z,y1:E,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
|
|
8
|
+
/* @__PURE__ */d("text",{x:z+(G+18)*Math.cos(H.center(t)-H.step/2),y:E+(G+18)*Math.sin(H.center(t)-H.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
|
|
9
|
+
/* @__PURE__ */d(r,{id:L,reveal:!!j&&"center-out"}),Q.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>U(r,e.values[r]??0));/* @__PURE__ */
|
|
10
|
+
return f("g",{opacity:V(t,e.key)?.3:1,onMouseEnter:()=>T(t),mask:j?`url(#${l(L)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
|
|
11
|
+
/* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),Y&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:Y.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(R,3,Y.color,Y.tone),value:w(Y.values[t]??0)}))})}),
|
|
12
|
+
/* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:Q.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
13
|
+
/* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
|
|
14
|
+
/* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
15
|
+
/* @__PURE__ */d(e,{caption:W.acrossMeasures(Q.map(e=>e.label),k.length),head:[W.tableSeries,...k.map(e=>e.label)],rows:Q.map(e=>[e.label,...k.map((t,r)=>w(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as i,OverlayLayerProvider as t}from"./chunk-3DVNXNTF.js";import{useDiscardGuard as l}from"./chunk-ECJKIPWU.js";import{dialogA11y as a}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as o}from"./chunk-7QSDPSXP.js";import{useFocusTrap as n,useScrollLock as s}from"./chunk-CDAJKLGL.js";import{Icon as d}from"./chunk-2UO47XB4.js";import{Z_LAYERS as c}from"./chunk-62LW225J.js";import{useHydrated as m}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as p}from"./chunk-GDQJBQ5B.js";import{useRef as f,useId as h,useState as x,useEffect as v}from"react";import{createPortal as b}from"react-dom";import{jsxs as y,Fragment as g,jsx as k}from"react/jsx-runtime";var j={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl"};function N({open:N,onClose:w,title:C,description:D,role:W="dialog",children:J,footer:U,blocking:B=!1,size:L="md",aside:Q=!1,dirty:T=!1,initialFocus:G,"aria-label":I,"aria-labelledby":P,"aria-describedby":V,className:X=""}){const $=f(null),z=h(),A=h(),F=!B,K=h(),S=p().dialog,E=e(m()),[H,O]=x(null),Y=l({open:N,dirty:T,onClose:w,title:C,layer:H}),Z=f(null),q=r(N&&null!==E,Z),M=i(q,$);if(o(N),n($,N&&null!==E,G),s(N),v(()=>{if(N)return u(()=>(B||Y(),!0),()=>$.current)},[N,B,Y]),!N||!E)return null;/* @__PURE__ */
|
|
2
|
+
return y(g,{children:[/* @__PURE__ */k("span",{ref:Z,hidden:!0,"data-popup-anchor":""}),b(
|
|
3
|
+
/* @__PURE__ */k(t,{value:H,children:/* @__PURE__ */y("div",{ref:O,className:"fixed inset-0"+(Q?" pointer-events-none opacity-0":""),style:{zIndex:c.overlay},role:"presentation","data-overlay-layer":"","data-aside":Q?"":void 0,children:[
|
|
4
|
+
/* @__PURE__ */k("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
|
|
5
|
+
/* @__PURE__ */k("div",{className:q?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:B?void 0:e=>{e.target===e.currentTarget&&Y()},children:/* @__PURE__ */y("div",{ref:$,"data-popup-panel":"",style:q?{left:M?.left??0,top:M?.top??0,visibility:M?void 0:"hidden"}:void 0,...a({role:W,modal:!0,titleId:C?K:void 0,labelledBy:P,label:I}),"aria-describedby":V??(D?A:J?z:void 0),className:`${q?"absolute max-h-[calc(100%-2rem)] w-[calc(100%-2rem)]":"relative max-h-full w-full"} ${j[L]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${X}`.trim(),children:[C&&/* @__PURE__ */k("h2",{id:K,className:(F?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:C}),D&&/* @__PURE__ */k("p",{id:A,className:((C?"mt-1":F?"pr-8":"")+" text-sm text-gray-500").trim(),children:D}),J&&/* @__PURE__ */k("div",{id:z,className:"mt-2 text-sm text-gray-600",children:J}),U&&/* @__PURE__ */k("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:U}),F&&/* @__PURE__ */k("button",{type:"button",onClick:Y,"aria-label":S.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */k(d,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]})}),E)]})}export{N as Dialog};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useTabLayer as e,focusableIn as t,stopAfter as r}from"./chunk-CDAJKLGL.js";import{buttonClasses as n}from"./chunk-UQYNPYF4.js";import{onOverlayOpen as i}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as o}from"./chunk-62LW225J.js";import{popupBounds as a,VIEWPORT_MARGIN as c,placeMenu as s,followAnchor as l}from"./chunk-GLUJS42B.js";import{
|
|
1
|
+
import{useTabLayer as e,focusableIn as t,stopAfter as r}from"./chunk-CDAJKLGL.js";import{buttonClasses as n}from"./chunk-UQYNPYF4.js";import{onOverlayOpen as i}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as o}from"./chunk-62LW225J.js";import{popupBounds as a,VIEWPORT_MARGIN as c,placeMenu as s,followAnchor as l}from"./chunk-GLUJS42B.js";import{useHydrated as u,useBrowserLayoutEffect as d}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as m}from"./chunk-TWVUQUUD.js";import{useState as p,useRef as f,useId as h,useCallback as g,useEffect as v}from"react";import{createPortal as b}from"react-dom";import{jsxs as x,jsx as w}from"react/jsx-runtime";var y=/(^|[\s:])!?z-/;function k({trigger:k,children:C,title:N,description:D,"aria-label":E,align:L="start",side:j="bottom",open:T,defaultOpen:O=!1,onOpenChange:$,matchTriggerWidth:H=!1,maxHeight:P,initialFocus:S,id:K,triggerLabel:M,"aria-describedby":U,disabled:W,className:z="",triggerClassName:J,panelClassName:B=""}){const[F,G]=p(O),R=(T??F)&&!W,Y=u(),I=f(null),Q=f(null),A=f(null),V=f(null),q=h(),X=K??q,Z=h(),_=h(),ee=h(),te=f(null),re=f(!1),ne=f({openProp:T,onOpenChange:$});ne.current={openProp:T,onOpenChange:$};const ie=g(e=>{void 0===ne.current.openProp&&G(e),ne.current.onOpenChange?.(e)},[]),oe=g((e=!1)=>{re.current=e,ie(!1)},[ie]),ae=e=>{te.current=e.nativeEvent},ce=g(()=>{const e=A.current,t=Q.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=a(t),i=Math.max(0,n.right-n.left-2*c),o=e.style;o.left="0px",o.top="0px",o.maxWidth=`${i}px`,o.maxHeight="none",o.width=H?`${Math.min(r.width,i)}px`:"";const l={width:e.offsetWidth,height:e.offsetHeight},u=P??1/0,d=s({trigger:r,menu:{width:l.width,height:Math.min(l.height,u)},bounds:n,align:L,side:j}),m=Math.min(d.maxHeight,u);o.left=`${d.left}px`,o.top=`${d.top}px`,o.maxHeight=`${m}px`,o.overflowY=l.height>m?"auto":"",e.dataset.side=d.side,e.dataset.align=L},[L,j,H,P]);d(()=>{R&&Y&&ce()}),v(()=>{if(!R||!Y)return;const e=l(()=>Q.current,ce),t=V.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>ce());return r.observe(t),()=>{e(),r.disconnect()}},[R,Y,ce]),v(()=>{if(!R)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(te.current===e)return!1;const t=e.target;return!(t&&(I.current?.contains(t)||A.current?.contains(t)))})(e)&&oe(!0))},i=e=>{t=e,r=window.setTimeout(()=>n(e),0)},o=e=>n(e);return document.addEventListener(e,i,!0),window.addEventListener(e,o),()=>{window.clearTimeout(r),document.removeEventListener(e,i,!0),window.removeEventListener(e,o)}},t=e("pointerdown"),r=e("focusin"),n=i(()=>oe()),o=m(e=>"Escape"===e.key&&(oe(),Q.current?.focus(),!0),()=>A.current);return()=>{t(),r(),n(),o()}},[R,oe]),e(A,R&&Y),d(()=>{if(!R||!Y)return;const e=A.current;return()=>{if(re.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||Q.current?.focus({preventScroll:!0})}},[R,Y]),v(()=>{if(!R||!Y)return;const e=A.current;e&&(re.current=!1,(S?.current??t(e)[0]??e).focus({preventScroll:!0}))},[R,Y]);const se="function"==typeof C?C({close:()=>oe()}):C,le=N?{"aria-labelledby":_}:E?{"aria-label":E}:{"aria-labelledby":X};/* @__PURE__ */
|
|
2
2
|
return x("div",{ref:I,className:`relative inline-flex ${z}`.trim(),children:[
|
|
3
3
|
/* @__PURE__ */w("button",{ref:Q,id:X,type:"button","aria-haspopup":"dialog","aria-expanded":R,"aria-controls":R&&Y?Z:void 0,"aria-label":M,"aria-describedby":U,disabled:W,onClick:()=>R?oe():ie(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!R)return;const r=(()=>{const e=A.current;return e?t(e)[0]??e:null})();r&&(e.preventDefault(),r.focus({preventScroll:!0}))},className:J??n({variant:"secondary"}),children:k}),R&&Y&&b(
|
|
4
4
|
/* @__PURE__ */w("div",{ref:A,id:Z,role:"dialog",...le,"aria-describedby":D?ee:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:ae,onFocusCapture:ae,onKeyDown:e=>{const n=A.current,i=Q.current;if("Tab"!==e.key||!n||!i||!n.contains(e.target))return;const o=t(n),a=document.activeElement;if(e.shiftKey){if(o.length>0&&a!==o[0]&&a!==n)return;return e.preventDefault(),void i.focus({preventScroll:!0})}if(o.length>0&&a!==o[o.length-1])return;e.preventDefault();const c=r(i,n);oe(!!c),(c??i).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${B}`.trim(),style:y.test(B)?void 0:{zIndex:o.popup},children:/* @__PURE__ */x("div",{ref:V,children:[N&&/* @__PURE__ */w("h2",{id:_,className:"text-sm font-semibold text-gray-900",children:N}),D&&/* @__PURE__ */w("p",{id:ee,className:"mt-1 text-sm text-gray-500",children:D}),N||D?/* @__PURE__ */w("div",{className:"mt-3",children:se}):se]})}),document.body)]})}export{k as Popover};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-2UO47XB4.js";import{Tooltip as t}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2UO47XB4.js";import{Tooltip as t}from"./chunk-6XBWM453.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{useId as i}from"react";import{jsx as a,jsxs as r}from"react/jsx-runtime";var l=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.es-default-reset)",'[tabindex]:not([tabindex="-1"])'].join(", "),s=e=>l.split(", ").map(t=>`${e} ${t}`).join(", ");function o({label:o,onReset:d,changed:c=!0,view:u="desktop",detail:b,name:p,tip:m,defaultAction:h,disabled:f,className:k}){const j=n().settingView,y=i(),N=["es-default-reset"];if(c&&N.push("is-changed"),k&&N.push(k),!c&&h)return N.push("is-pressable"),/* @__PURE__ */a(t,{content:h.title,children:/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":h.title,disabled:f,onClick:h.onPress,children:h.icon})});if(!c)/* @__PURE__ */return a("span",{className:N.join(" "),"aria-hidden":"true"});const x="desktop"===u,g=p??(x?j.resetName(o):j.inheritName(o)),B=b?j.backTo(b):x?j.backToDefault:j.backToAuto,T=m??(b?j.tip(g,B):g);
|
|
2
2
|
/* @__PURE__ */
|
|
3
3
|
return r(t,{content:T,describe:!1,children:[
|
|
4
4
|
/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":g,"aria-describedby":y,disabled:f,onClick:e=>{d(),function(e){const t=e.currentTarget,n=t.closest(".es-field");let i=n?.querySelector(s(".es-field-ctl"))??n?.querySelector(s(".es-field-head"))??null,a=n?null:t.parentElement;for(let e=0;!i&&a&&e<4;e+=1,a=a.parentElement)i=[...a.querySelectorAll(l)].find(e=>e!==t&&!e.closest('[aria-hidden="true"]'))??null;i?.focus()}(e)},children:/* @__PURE__ */a(e,{name:"revert",size:15,"aria-hidden":"true"})}),
|
|
5
|
-
/* @__PURE__ */a("span",{id:y,hidden:!0,children:
|
|
5
|
+
/* @__PURE__ */a("span",{id:y,hidden:!0,children:B})]})}export{o as SettingReset};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-
|
|
1
|
+
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-I4VIEGCX.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
|
|
2
2
|
return i("div",{className:`grid grid-cols-3 gap-3 ${h}`.trim(),children:[o.map(a=>/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary",onClick:()=>u(r(l,a)),children:a},a)),
|
|
3
3
|
/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary","aria-label":p.backspace,onClick:()=>u(a(l)),children:"⌫"}),t&&/* @__PURE__ */c(e,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:d,onClick:t,children:m??p.enter})]})}export{l as NumericKeypad};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{FormField as e}from"./chunk-6KBDNYRW.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-
|
|
1
|
+
import{FormField as e}from"./chunk-6KBDNYRW.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-Z5A4EY2R.js";import{useFileIntake as n,humanSize as i,FileIntakeAlert as s}from"./chunk-JTMEFXRL.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{forwardRef as c,useId as m}from"react";import{jsxs as o,jsx as d}from"react/jsx-runtime";var p=c(function({files:c,onChange:p,accept:u,acceptHint:h,multiple:x=!0,maxSizeBytes:b,maxFiles:f,disabled:y=!1,label:g,hint:N,error:j,required:k,className:v=""},B){const $=m(),z=l().files,C=n({accept:u,acceptHint:h,maxSizeBytes:b,maxFiles:f,multiple:x,disabled:y,currentCount:c.length,onAccept:e=>p(x?[...c,...e]:e.slice(0,1))}),F=j?`${$}-error`:N?`${$}-hint`:void 0;/* @__PURE__ */
|
|
2
2
|
return o(e,{label:g,htmlFor:$,hint:N,error:j,required:k,className:v,children:[
|
|
3
3
|
/* @__PURE__ */o("button",{ref:B,type:"button",id:$,disabled:y,onClick:C.open,"aria-invalid":!!j||void 0,"aria-required":k||void 0,"aria-describedby":F,...C.zoneProps,className:t(C.dragOver,y,a(y),"px-4 py-6"),children:[
|
|
4
4
|
/* @__PURE__ */o("span",{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ErrorPage as r}from"./chunk-ORIXCEKO.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{ErrorPage as r}from"./chunk-ORIXCEKO.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-I4VIEGCX.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.js";import{Component as o}from"react";import{jsxs as i,jsx as a,Fragment as n}from"react/jsx-runtime";function c({pick:r}){/* @__PURE__ */
|
|
2
2
|
return a(n,{children:r(s().errors)})}var l=class extends o{state={error:null};static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,t){console.error("ErrorBoundary caught an error:",r,t),e(r),this.props.onError?.(r,t)}componentDidUpdate(r){if(!this.state.error)return;const e=r.resetKeys??[],t=this.props.resetKeys??[];(e.length!==t.length||e.some((r,e)=>!Object.is(r,t[e])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
|
|
3
3
|
/* @__PURE__ */i("div",{className:"flex h-full flex-col",children:[
|
|
4
4
|
/* @__PURE__ */a("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */a(r,{code:500,actions:/* @__PURE__ */i(n,{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-2YSGXZOL.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
|
|
2
2
|
return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
|
|
3
3
|
/* @__PURE__ */n("div",{children:[
|
|
4
4
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-PN5FQVMB.js";import{Button_default as i}from"./chunk-I4VIEGCX.js";import{iconButtonClasses as n}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-2UO47XB4.js";import{Tooltip as a}from"./chunk-6XBWM453.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:g=!1,disabledReason:N,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:C,menuFooterLabel:W,align:z="end",side:B="bottom",menuMinWidth:F,linkAs:I,block:M=!1,className:L=""},O){const R=g&&(null!=N&&""!==N&&!1!==N)&&!v,X=x&&null!=j&&""!==j&&!1!==j,$=o(),A=/* @__PURE__ */t(i,{ref:O,type:b,variant:f,size:p,loading:v,leftIcon:k,block:M,disabled:g&&!R,"aria-disabled":!!R||void 0,disabledReason:R?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),D=M?"relative flex min-w-0 flex-1":"relative inline-flex",P=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
2
|
+
return s("div",{className:[M?"flex w-full":"inline-flex","items-stretch",L].filter(Boolean).join(" "),children:[null==w||""===w||R?A:/* @__PURE__ */t(a,{content:w,className:D,children:A}),
|
|
3
|
+
/* @__PURE__ */t(a,{content:X?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":X?$:void 0,items:h,align:z,side:B,minWidth:F,linkAs:I,disabled:x&&!X,"aria-disabled":X,onOpenChange:y,footer:C,footerLabel:W,triggerClassName:n({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(r,{name:"chevron-down",className:P,strokeWidth:2,"aria-hidden":"true"})})}),X&&/* @__PURE__ */t("span",{id:$,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return c(y.Provider,{value:r,children:e})}function g({value:r,onChange:a,min:w,max:g,step:S=1,shiftStep:z,precision:F,inputMin:k,inputMax:N,suffix:j,showInput
|
|
3
|
-
/* @__PURE__ */c("input",{id:q,type:"range",min:w,max:g,step:S,value:Z,disabled:E,"aria-label":
|
|
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:r,onChange:e=>{null!=e?e<H||e>U||a(e):X&&a(null)},min:H,max:U,step:S,shiftStep:z,stepFrom:Y,precision:G,snap:!0,allowEmpty:X,suffix:j,disabled:E,placeholder
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-5SIOCKCK.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as u,useEffect 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))}function b(e,t,i,n){return Number(f(e,t,i).toFixed(n))}var y=r(null);function w({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
|
|
2
|
+
return c(y.Provider,{value:r,children:e})}function g({value:r,onChange:a,min:w,max:g,step:S=1,shiftStep:z,precision:F,inputMin:k,inputMax:N,suffix:j,showInput:K=!0,emptyLabel:$,placeholderValue:C,stepFrom:L,label:M,"aria-labelledby":D,valueText:A,id:B,disabled:E,size:R="md",boxSize:W="sm",className:I="",auto:J}){const O=n(),P=o(),Q=t(),T=J??Q,V=o(),q=B??P,G=F??p(S),H=k??w,U=N??g,X=void 0!==$||void 0!==C,Y=L??C,Z=f(r??C??w,w,g),_=d(null),[ee,te]=l(null),ie=Boolean(j);i(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,K]);const ne=e=>A?A(e):"string"==typeof j?`${e.toFixed(G)} ${j}`:void 0,re=null==r?$??(null!=C?ne(C)??String(C):void 0):ne(r),le=`calc(${x([w.toFixed(G),g.toFixed(G),r?.toFixed(G),$,C?.toFixed(G)])}ch + ${(ee?.frame??10+(ie?v:h))+2}px)`,ae=u(y),oe=o(),de=ae?.set;return i(()=>{de&&de(oe,K?le:null)},[de,oe,le,K]),s(()=>()=>de?.(oe,null),[de,oe]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-3 ${I}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */c("input",{id:q,type:"range",min:w,max:g,step:S,value:Z,disabled:E,"aria-label":D?void 0:M,"aria-labelledby":D,"aria-valuetext":re,"aria-describedby":T?V:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=z;if(!i&&!(null==r&&null!=Y))return;e.preventDefault();a(b((r??Y??Z)+t*(i?z??S:S),w,g,G))},onChange:e=>a(b(Number(e.target.value),w,g,G)),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")}),K&&
|
|
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:r,onChange:e=>{null!=e?e<H||e>U||a(e):X&&a(null)},min:H,max:U,step:S,shiftStep:z,stepFrom:Y,precision:G,snap:!0,allowEmpty:X,suffix:j,disabled:E,placeholder:$??(null!=C?C.toFixed(G):void 0),size:W,auto:T,"aria-label":M?O.slider.value(M):void 0,"aria-labelledby":M?void 0:D})}),T&&/* @__PURE__ */c("span",{id:V,hidden:!0,children:O.settingView.auto})]})}export{g as Slider,w as SliderGroup,b as settleSliderValue,x as sliderBoxChars,p as stepDecimals};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{GROUP_COLORS as e}from"./chunk-
|
|
2
|
-
return t(
|
|
1
|
+
import{GROUP_COLORS as e}from"./chunk-TXDA7TTP.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-6XBWM453.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{jsx as t,jsxs as i,Fragment as a}from"react/jsx-runtime";var s="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium";function o({label:e,glyph:r,onClick:l}){/* @__PURE__ */
|
|
2
|
+
return t(n,{content:e,describe:!1,children:/* @__PURE__ */t("button",{type:"button",onClick:l,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */t("span",{"aria-hidden":"true",children:r})})})}function c({state:n,label:c,verb:u,subject:m,pct:p,onCancel:d,onRetry:h,onDismiss:f,className:b=""}){const g=l().transfer;if("idle"===n)return null==c?null:/* @__PURE__ */t("span",{className:`${s} ${e.neutral} pr-2 ${b}`.trim(),children:c});if("error"===n)/* @__PURE__ */
|
|
3
3
|
return i("span",{role:"status",className:`${s} ${e.danger} ${b}`.trim(),children:[
|
|
4
4
|
/* @__PURE__ */t("span",{children:g.error}),h&&/* @__PURE__ */t(o,{label:g.retry,glyph:"↻",onClick:h}),f&&/* @__PURE__ */t(o,{label:g.dismiss,glyph:"×",onClick:f})]});const y=u??g.uploading,$=null==p||Number.isNaN(p)?null:Math.max(0,Math.min(100,Math.round(p))),k="string"==typeof y?g.cancelVerb(y.toLowerCase()):g.cancel,N=e=>[e,m,null==$?"":`${$}%`].filter(Boolean).join(" ");/* @__PURE__ */
|
|
5
|
-
return i("span",{role:"status","aria-live":"polite",className:`${s} ${e.info} ${b}`.trim(),children:[null==$&&/* @__PURE__ */t(
|
|
5
|
+
return i("span",{role:"status","aria-live":"polite",className:`${s} ${e.info} ${b}`.trim(),children:[null==$&&/* @__PURE__ */t(r,{ink:""}),
|
|
6
6
|
/* @__PURE__ */t("span",{className:"tabular-nums",children:"string"==typeof y?N(y):/* @__PURE__ */i(a,{children:[y,N("")&&` ${N("")}`]})}),d&&/* @__PURE__ */t(o,{label:k,glyph:"×",onClick:d})]})}export{c as TransferProgress};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{axisGutter as t,radiusScale as i,niceMax as l,logScale as r,linearScale as o}from"./chunk-2JWPNR2U.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{CHART_INK as a,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as h}from"./chunk-GDQJBQ5B.js";import{formatPlain as f}from"./chunk-C3QOHMR6.js";import{useRef as u,useId as p,useState as d,useEffect as x}from"react";import{jsx as y,jsxs as g}from"react/jsx-runtime";var b=3;function k({series:b,height:k=260,width:v,xLabel:M,yLabel:A,formatX:z,formatY:$,xDomain:j,yDomain:w,xScale:N="linear",yScale:R="linear",radiusRange:D=[4,22],className:L,emptyLabel:S}){const U=m().charts,B=h(),P=z??(e=>f(e,B)),Q=$??(e=>f(e,B)),V=S??U.noObservations,W=u(null),C=n(W),E=v??C,G=p(),[O,F]=d(null);x(()=>{if(null!==O)return c(e=>"Escape"===e.key&&(F(null),!0))},[O]);const I=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),J=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),K=j||w?J.map(e=>({...e,points:e.points.filter(e=>I(e.x,j)&&I(e.y,w))})).filter(e=>e.points.length>0):J,T=J.reduce((e,t)=>e+t.points.length,0)-K.reduce((e,t)=>e+t.points.length,0);if(0===K.length)/* @__PURE__ */
|
|
2
|
+
return y("div",{className:L,ref:W,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:V})});const X=K.flatMap(e=>e.points),Z=X.some(e=>null!=e.size),H=14,Y=20,q=34,_=52,ee=(e,t,i,n)=>{const a=e.filter(e=>e>0),s="log"===i?a.length>0?Math.min(...a):0:Math.min(0,...e),c=t??[s,l(Math.max(...e))];return"log"===i?r(c,n):o(c,n)},te=ee(X.map(e=>e.y),w,R,{from:k-q,to:H}),ie=t(te.ticks(5).map(Q),_),le=Math.max(ie+1,E-Y),re=ee(X.map(e=>e.x),j,N,{from:ie,to:le}),oe=i([0,Math.max(...X.map(e=>e.size??1))],{from:D[0],to:D[1]}),ne=O?K[O.s]:void 0,ae=O&&ne?ne.points[O.i]:void 0,se=K.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
|
|
3
|
+
return g("div",{className:`relative ${L??""}`,ref:W,children:[
|
|
4
|
+
/* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${E} ${k}`,role:"img","aria-label":U.scatter(K.map(e=>e.label),A??U.yAxis,M??U.xAxis)+(T>0?`. ${U.outsideRange(T)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>F(null),onBlur:()=>F(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,i=O?se.findIndex(e=>e.s===O.s&&e.i===O.i):0;F(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
|
|
5
|
+
/* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:G,children:/* @__PURE__ */y("rect",{x:ie-D[1],y:H-D[1],width:le-ie+2*D[1],height:k-q-H+2*D[1]})})}),te.ticks(5).map(e=>/* @__PURE__ */g("g",{children:[
|
|
6
|
+
/* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:a.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
7
|
+
/* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:Q(e)})]},`y${e}`)),re.ticks(5).map(e=>/* @__PURE__ */y("text",{x:re(e),y:k-12,textAnchor:"middle",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:P(e)},`x${e}`)),M&&/* @__PURE__ */y("text",{x:(ie+le)/2,y:k-.5,textAnchor:"middle",fontSize:11,fill:a.label,children:M}),A&&/* @__PURE__ */y("text",{x:12,y:k/2,transform:`rotate(-90 12 ${k/2})`,textAnchor:"middle",fontSize:11,fill:a.label,children:A}),
|
|
8
|
+
/* @__PURE__ */y("g",{clipPath:`url(#${G})`,children:K.map((e,t)=>{const i=s(e.slot,3,e.color,e.tone);return e.points.map((l,r)=>/* @__PURE__ */y("circle",{cx:re(l.x),cy:te(l.y),r:Z?oe(l.size??0):D[0]+1,fill:i,fillOpacity:O&&O.s!==t?.25:.62,stroke:a.surface,strokeWidth:2,onMouseEnter:()=>F({s:t,i:r})},`${e.key}-${r}`))})})]}),O&&ne&&ae&&/* @__PURE__ */y("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */y(e,{title:ae.label??ne.label,rows:[{key:"x",label:M??U.xAxis,color:s(ne.slot,3,ne.color,ne.tone),value:P(ae.x)},{key:"y",label:A??U.yAxis,color:s(ne.slot,3,ne.color,ne.tone),value:Q(ae.y)},...null!=ae.size?[{key:"size",label:U.size,color:a.muted,value:f(ae.size,B)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{ChartBrush as t}from"./chunk-E6GDAV5R.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-3IUPYCW3.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{ChartTooltip as p}from"./chunk-G4GVLK44.js";import{useDragZoom as g,DragBand as y,ChartZoomSummary as k,tooltipBesideBand as x}from"./chunk-C764JODK.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 z,CHART_INK as A,STATUS_VARS as C}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as D}from"./chunk-TWVUQUUD.js";import{useShellStrings as L,useShellLocale as R}from"./chunk-GDQJBQ5B.js";import{formatPercent as W,formatPlain as E}from"./chunk-C3QOHMR6.js";import{useRef as S,useState as U,useId as T,useEffect as I}from"react";import{jsx as P,jsxs as B}from"react/jsx-runtime";var O=12,F=16,G=26,Q=52,Y=t=>"number"==typeof t&&Number.isFinite(t);function K({series:K,labels:J,height:H=200,stacked:Z=!1,stackMode:X="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=R(),zt=rt??(t=>E(t,Vt)),At=ot??zt,Ct=jt??$t.noData,Dt=S(null),Lt=V(Dt),Rt=Nt??Lt,[Wt,Et]=U(null),[St,Ut]=U(null),{highlighted:Tt}=u(),It=T(),Pt=ut??St,Bt=g(ht&&Pt?Pt[1]-Pt[0]+1:J.length,pt);if(I(()=>{if(null!==Wt)return D(t=>"Escape"===t.key&&(Et(null),!0))},[Wt]),kt)/* @__PURE__ */
|
|
2
|
+
return P("div",{className:wt,ref:Dt,children:/* @__PURE__ */P(h,{height:H,width:Nt??Lt})});const Ot=J,Ft=ut??St??[0,Math.max(0,Ot.length-1)],[Gt,Qt]=Ft,Yt=t=>Bt.slice(ht?t.slice(Gt,Qt+1):t),Kt=lt?Yt(lt):void 0,Jt=K.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})),Ht=t=>(ht?Gt:0)+(Bt.view?.[0]??0)+t;if(J=Yt(Ot),0===Jt.length||0===J.length)/* @__PURE__ */
|
|
3
|
+
return P("div",{className:wt,ref:Dt,children:/* @__PURE__ */P("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:H},children:Ct})});const Zt=J.map((t,e)=>Jt.reduce((t,a)=>t+(Y(a.data[e])?a.data[e]:0),0)),Xt=(t,e)=>Zt[e]>0?t/Zt[e]:null,qt=[];if(Z){let t=J.map(()=>0);for(const e of Jt)t=t.map((t,a)=>t+(Y(e.data[a])?e.data[a]:0)),qt.push("percent"===X?t.map((t,e)=>Xt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!Z&&!_t&&void 0===et&&Jt.some(te)&&Jt.some(t=>!te(t)),ae=gt&&!Z?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Jt.filter(t=>!te(t)):Jt).filter(t=>!re(t)),le=ee?Jt.filter(te).flatMap(t=>t.data.filter(Y)):[],ne=Z?(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:Z&&"percent"===X||_t||void 0!==et?null:b(Z?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=Z&&"percent"===X?1:se?se.hi:et??M(Math.max(...ne,0)),me=Z&&"percent"===X?t=>W(Math.round(100*t),0,Vt):zt,he=_t?q:se?se.ticks:N([ce,de],{from:0,to:1}).ticks(at+1),ue=w(he.map(me),Q),fe=ie?w(ie.right.ticks.map(zt),F):F,pe={left:ue,right:Math.max(ue+1,Rt-fe),top:O,bottom:H-G},ge=j(J.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=Jt.filter(re),Me=Math.max(0,...J.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(),Et(e=>{const a=(e??0)+t;return Math.min(J.length-1,Math.max(0,a))})},ze=Math.max(1,Math.ceil(J.length/Math.max(1,Math.floor(Rt/96))));/* @__PURE__ */
|
|
4
|
+
return B("div",{className:`relative ${wt??""}`,ref:Dt,children:[
|
|
5
|
+
/* @__PURE__ */B("svg",{width:"100%",height:H,viewBox:`0 0 ${Rt} ${H}`,role:"img","aria-label":$t.overIntervals(Jt.map(t=>t.label),J.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Et(null),onBlur:()=>Et(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(Ht(Wt));"ArrowRight"===t.key&&Ve(1)(t),"ArrowLeft"===t.key&&Ve(-1)(t)},children:[
|
|
6
|
+
/* @__PURE__ */P("defs",{children:/* @__PURE__ */P("clipPath",{id:It,children:/* @__PURE__ */P("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
|
|
7
|
+
/* @__PURE__ */P(n,{id:It,fills:Jt.map((t,e)=>({color:z(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:Z?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */P("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:A.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
|
|
8
|
+
/* @__PURE__ */P("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:A.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */P("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */P("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */P("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:A.label,children:nt}),
|
|
9
|
+
/* @__PURE__ */P("g",{clipPath:`url(#${It})`,mask:xt&&vt?`url(#${m(It)})`:void 0,children:Jt.map((t,e)=>{const n=z(t.slot,t.color,t.tone),m=t.mode??(Z?"area":"line"),h=f(t.key,Tt);if("step"===m){const e=J.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 P("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=J.map((a,r)=>{const o=Z?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__ */P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:J.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===Jt[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 P("rect",{x:ge.center(l)-a/2,y:c,width:a,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[l]?C[t.pointTones[l]]:n,fillOpacity:r?1:.55},l)})},t.key):/* @__PURE__ */P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:J.map((l,c)=>{const d=Z?qt[e]?.[c]:t.data[c];if(!Y(d))return null;const m=o(d);/* @__PURE__ */
|
|
12
|
+
return P("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=Z&&e>0?J.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
|
+
return B("g",{opacity:h??void 0,className:"rosh-viz-mark",children:[("area"===m||Z)&&
|
|
14
|
+
/* @__PURE__ */P("path",{d:y,fill:c(It,e,t.fillVariant??bt,n),stroke:"none"}),
|
|
15
|
+
/* @__PURE__ */P("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??C[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
|
|
16
|
+
return B("g",{children:[
|
|
17
|
+
/* @__PURE__ */P("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */P("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"))&&Jt.map((t,a)=>{if("column"===t.mode)return null;const r=ct??(st?"last":"none"),o=z(t.slot,t.color,t.tone),l=[...t.data].map(Y).lastIndexOf(!0),n="all"===r?J.map((t,e)=>e).filter(e=>Y(Z?qt[a]?.[e]:t.data[e])):l>=0?[l]:[];/* @__PURE__ */
|
|
18
|
+
return B("g",{children:[n.map(r=>{const n=Z?qt[a]?.[r]:t.data[r];return Y(n)?/* @__PURE__ */P(e,{cx:ge.center(r),cy:je(t)(n),color:o,variant:dt,pulse:mt&&r===l,title:`${J[r]}: ${t.label} ${zt(n)}`},r):null}),st&&l>=0&&Y(Z?qt[a]?.[l]:t.data[l])&&/* @__PURE__ */P("text",{x:ge.center(l)-10,y:je(t)(Z?qt[a]?.[l]:t.data[l])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(Z?qt[a]?.[l]:t.data[l])})]},`dots-${t.key}`)}),J.map((t,e)=>e%ze===0?/* @__PURE__ */P("text",{x:ge.center(e),y:H-8,textAnchor:"middle",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Wt&&/* @__PURE__ */P("line",{x1:ge.center(Wt),y1:pe.top,x2:ge.center(Wt),y2:pe.bottom,stroke:A.axis,strokeWidth:1}),ae&&Me>0&&
|
|
19
|
+
/* @__PURE__ */B("g",{pointerEvents:"none","data-column-strip":"true",children:[
|
|
20
|
+
/* @__PURE__ */P("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:A.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
|
|
21
|
+
/* @__PURE__ */P("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(Me)})]}),Bt.drag&&/* @__PURE__ */P(y,{x0:ge(Bt.drag[0]),x1:ge(Bt.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),J.map((t,e)=>/* @__PURE__ */P("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Et(e),onPointerDown:()=>Bt.press(e),onPointerEnter:()=>Bt.over(e),onPointerUp:Bt.release,onClick:yt?()=>yt(Ht(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Bt.view&&/* @__PURE__ */P(k,{from:Kt?.[0]??J[0],to:Kt?.at(-1)??J[J.length-1],count:J.length,total:Z&&"percent"!==X?At(Zt.reduce((t,e)=>t+e,0)):ae?At(be.reduce((t,e)=>t+e.data.filter(Y).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Jt).filter(t=>t.data.some(Y)).map(t=>{const e=t.data.filter(Y),a=z(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=Z||"column"===t.mode?At(r):$t.zoomLevel(At(r/e.length),At(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Bt.clear}),ht&&Ot.length>2&&/* @__PURE__ */P(t,{className:"mt-1",labels:Ot,width:Rt,data:K[0]?.data??[],range:Ft,onRangeChange:t=>{ft?ft(t):Ut(t)}}),null!==Wt&&
|
|
22
|
+
/* @__PURE__ */P("div",{className:"pointer-events-none absolute top-2 z-10",style:x(ge.center(Wt),ge.bandwidth,Rt),children:/* @__PURE__ */P(p,{title:Kt?.[Wt]??J[Wt],rows:Jt.map((t,e)=>({key:t.key,label:t.label,color:z(t.slot,t.color,t.tone),value:Y(t.data[Wt])?Z&&"percent"===X?`${W(100*(Xt(t.data[Wt],Wt)??0),1,Vt)} · ${At(t.data[Wt])}`:At(t.data[Wt]):void 0})),footnote:Z&&"percent"===X?$t.inBucket(At(Zt[Wt])):void 0})})]})}export{K as TimeSeriesChart};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-TXDA7TTP.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{OneLineLabel as r}from"./chunk-MVZRZTQP.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.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,7 +1,7 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-
|
|
2
|
-
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:B,rowRef:D,className:
|
|
1
|
+
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-LYHJHUQH.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
|
|
2
|
+
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:B,rowRef:D,className:H=""}){const P=x||!!p,$=n(u),A=l(null),I=s(),J=[B?.["aria-describedby"],j?I:void 0].filter(Boolean).join(" ")||void 0,K=B?.tabIndex;a(()=>{const e=A.current;if(!e||void 0!==K)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const T="comfortable"===$?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},U=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
|
|
3
3
|
/* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
|
|
4
|
-
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open"
|
|
5
|
-
/* @__PURE__ */c("div",{...B,ref:e=>{var r,t;
|
|
6
|
-
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[
|
|
7
|
-
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:
|
|
4
|
+
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":P||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":P?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${T[k]}`}),
|
|
5
|
+
/* @__PURE__ */c("div",{...B,ref:e=>{var r,t;A.current=e,t=e,"function"==typeof(r=D)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":B?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":J,onKeyDown:e=>{if(B?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",H].filter(Boolean).join(" "),children:[
|
|
6
|
+
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[U&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[U,
|
|
7
|
+
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:U})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:I})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
|