efficient-shell 10.17.0 → 10.17.1
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-Q5BYSSW3.js → Browser-4B76MFTG.js} +13 -13
- package/dist/Calculator-AXFKAC7G.js +29 -0
- package/dist/{CurrencyConverter-42IHLJVV.js → CurrencyConverter-36BFSFRS.js} +8 -8
- package/dist/{Documents-GGEPMWB5.js → Documents-VKAMBKSP.js} +23 -23
- package/dist/Files-NRYZG4KY.js +88 -0
- package/dist/{Notepad-L2LOWTSE.js → Notepad-AQXGH6VP.js} +9 -9
- package/dist/{PomodoroTimer-PD7POYX5.js → PomodoroTimer-RHDLKJBY.js} +20 -20
- package/dist/{Preview-HM2Z3EJO.js → Preview-DEBTZQP5.js} +41 -41
- package/dist/Sidebar-CB6KRPW2.js +44 -0
- package/dist/{Spreadsheet-2E4TQ64O.js → Spreadsheet-FSHLWXYP.js} +11 -11
- package/dist/{Stock-IABQRSXZ.js → Stock-CV53A432.js} +3 -3
- package/dist/{Weather-4QPYOENN.js → Weather-R4MCLH7F.js} +22 -22
- package/dist/{WorldClock-3ZVRBLEW.js → WorldClock-CSFPCZHU.js} +6 -6
- package/dist/ai/index.js +63 -62
- 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/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-K4JQ3FQI.js → chunk-2EVTN26H.js} +2 -2
- package/dist/{chunk-7VBXIIEC.js → chunk-3PR7FLTZ.js} +2 -2
- package/dist/{chunk-N6CS2FO2.js → chunk-3TKMH5VR.js} +1 -1
- package/dist/{chunk-4WEFGKJL.js → chunk-3VLG6LR3.js} +4 -4
- package/dist/{chunk-UYRMW5MO.js → chunk-4D66DUU5.js} +5 -5
- package/dist/{chunk-YJXS7BR5.js → chunk-4MJA2SPJ.js} +13 -13
- package/dist/chunk-4Q25UHWB.js +22 -0
- package/dist/{chunk-VIQ6OME2.js → chunk-4V73LGZG.js} +8 -8
- package/dist/{chunk-HJW67KA7.js → chunk-5IPFQV34.js} +1 -1
- package/dist/{chunk-3ELLBQPS.js → chunk-5LCDCO46.js} +1 -1
- package/dist/{chunk-GISDIVFK.js → chunk-5N5AAYQV.js} +1 -1
- package/dist/{chunk-2YSGXZOL.js → chunk-5VAIVRK6.js} +48 -48
- package/dist/{chunk-V6Y4OC6K.js → chunk-5W2OEDUD.js} +8 -8
- package/dist/chunk-6ACS4S4P.js +15 -0
- package/dist/{chunk-VWIYC2NB.js → chunk-7AZAMDGG.js} +7 -7
- package/dist/chunk-7RPYVQEV.js +2 -0
- package/dist/{chunk-XLWMM53L.js → chunk-7X4QNWA7.js} +2 -2
- package/dist/{chunk-5WYRAJ5F.js → chunk-AEJYSUVQ.js} +1 -1
- package/dist/{chunk-NVD4AI5Y.js → chunk-AFINCNY3.js} +1 -1
- package/dist/{chunk-UDKTAG57.js → chunk-B4HSNEBK.js} +1 -1
- package/dist/{chunk-5SIOCKCK.js → chunk-BE777IO7.js} +2 -2
- package/dist/{chunk-NNZFC4O7.js → chunk-BVIOCAEU.js} +1 -1
- package/dist/{chunk-4UKGVLFP.js → chunk-BZUA5F33.js} +1 -1
- package/dist/{chunk-QHPVAXHR.js → chunk-CCIGAU5Y.js} +3 -3
- package/dist/{chunk-SDDV3UCN.js → chunk-CF7BMDU3.js} +3 -3
- package/dist/{chunk-EPY34L26.js → chunk-CNUHLJYD.js} +1 -1
- package/dist/{chunk-SLU45G5J.js → chunk-CUKDQPEN.js} +3 -3
- package/dist/{chunk-5TDQPZDB.js → chunk-D6OYQM4V.js} +5 -5
- package/dist/chunk-DOC52JBV.js +20 -0
- package/dist/{chunk-DCRLJMQ6.js → chunk-EC527NE3.js} +1 -1
- package/dist/chunk-EDMDKQNO.js +4 -0
- package/dist/{chunk-RVRDDTEG.js → chunk-ENDCV7B3.js} +9 -9
- package/dist/{chunk-YSDPFDAG.js → chunk-EQCFPRKJ.js} +1 -1
- package/dist/{chunk-TXDA7TTP.js → chunk-EQZZ4V5X.js} +1 -1
- package/dist/{chunk-OORL6BIG.js → chunk-EZUQ5NXE.js} +1 -1
- package/dist/chunk-F7Z47OIF.js +12 -0
- package/dist/{chunk-NFB7PARJ.js → chunk-FEATDGFD.js} +1 -1
- package/dist/chunk-FX6DBXXD.js +1 -0
- package/dist/{chunk-7JGR7WPD.js → chunk-G4JTO5PB.js} +1 -1
- package/dist/{chunk-RUGQO7YF.js → chunk-G4PGEQOX.js} +9 -9
- package/dist/{chunk-W3OWPBQL.js → chunk-GD7ILVPF.js} +2 -2
- package/dist/chunk-GLBLKHYA.js +5 -0
- package/dist/{chunk-VDUXPMOQ.js → chunk-H7BKSATJ.js} +1 -1
- package/dist/{chunk-RT4WOEVS.js → chunk-HJ2BDUO6.js} +4 -4
- package/dist/{chunk-RBBIAIPH.js → chunk-HLQVB7FG.js} +8 -8
- package/dist/{chunk-VQCSHJEF.js → chunk-HLVOHOBC.js} +5 -5
- package/dist/{chunk-FOFZI62F.js → chunk-HS2E7DVI.js} +1 -1
- package/dist/chunk-HXNMRJQ4.js +2 -0
- package/dist/chunk-HXZ5XPBS.js +3 -0
- package/dist/{chunk-WTYQF7XJ.js → chunk-HYDVHGVT.js} +2 -2
- package/dist/chunk-IDV32UV7.js +29 -0
- package/dist/chunk-IHFZ7OXO.js +14 -0
- package/dist/{chunk-3UXXA2CS.js → chunk-ILP7QVW5.js} +8 -8
- package/dist/{chunk-3PR5YMWZ.js → chunk-IX7QXMNJ.js} +1 -1
- package/dist/{chunk-ZQKA2XKH.js → chunk-JFH5HW2G.js} +7 -7
- package/dist/{chunk-GEP4FROW.js → chunk-K7L3ZCPB.js} +3 -3
- package/dist/chunk-KLBJ646Z.js +8 -0
- package/dist/{chunk-77AQNJE2.js → chunk-L2RS2UQM.js} +1 -1
- package/dist/{chunk-MNNZGO2E.js → chunk-LAMRQE2P.js} +1 -1
- package/dist/{chunk-O6JJIR4H.js → chunk-M5LR7ZZX.js} +1 -1
- package/dist/{chunk-A42MKJA3.js → chunk-MAFSELZK.js} +1 -1
- package/dist/{chunk-N67QX3WW.js → chunk-MMQ6ETRD.js} +2 -2
- package/dist/{chunk-WYFMSL4Q.js → chunk-N4ZEB4UD.js} +9 -9
- package/dist/{chunk-4HBSQGRI.js → chunk-NRI26RYC.js} +2 -2
- package/dist/{chunk-QRYSL6QU.js → chunk-NVFYLTJ6.js} +2 -2
- package/dist/chunk-NXVFY22L.js +9 -0
- package/dist/{chunk-PW52RXPI.js → chunk-NYEMGKAE.js} +1 -1
- package/dist/{chunk-ZHAWOZA7.js → chunk-NZGNOMWX.js} +12 -12
- package/dist/{chunk-3NW5LD7D.js → chunk-NZQCDFDG.js} +3 -3
- package/dist/{chunk-XCHAU2UN.js → chunk-OUIE2N2Z.js} +5 -5
- package/dist/{chunk-6XBWM453.js → chunk-Q3IR5SKD.js} +1 -1
- package/dist/{chunk-FS6EOU4G.js → chunk-Q5QS5MFX.js} +1 -1
- package/dist/{chunk-JYIH2EBG.js → chunk-QEB2UTHO.js} +7 -7
- package/dist/{chunk-LYHJHUQH.js → chunk-QJLBBDX2.js} +1 -1
- package/dist/{chunk-O47HKK6E.js → chunk-QLVJ5W4G.js} +1 -1
- package/dist/chunk-RAAH4TQU.js +1 -0
- package/dist/{chunk-CXYHFGUY.js → chunk-RBEI4CKX.js} +5 -5
- package/dist/{chunk-MVZRZTQP.js → chunk-S5SRXI4V.js} +1 -1
- package/dist/{chunk-OP5DOO3K.js → chunk-SDATPJM2.js} +4 -4
- package/dist/{chunk-S74LKSUB.js → chunk-SOBGCIPF.js} +1 -1
- package/dist/{chunk-AYDW63LV.js → chunk-SOJEQHZ2.js} +1 -1
- package/dist/{chunk-34URULVW.js → chunk-SQCUN2DX.js} +1 -1
- package/dist/chunk-SRWZE3WA.js +6 -0
- package/dist/{chunk-I33SVQ7P.js → chunk-TIGTIT3L.js} +6 -6
- package/dist/{chunk-DHIQ46C5.js → chunk-TLWGOQI3.js} +3 -3
- package/dist/chunk-TNDRHHKN.js +14 -0
- package/dist/{chunk-YILGAEW3.js → chunk-TXDBOSSB.js} +1 -1
- package/dist/{chunk-5QGBVTGS.js → chunk-U32J7D4Q.js} +2 -2
- package/dist/{chunk-54NMFQMW.js → chunk-UABVKJK7.js} +1 -1
- package/dist/{chunk-Z5A4EY2R.js → chunk-UG6RI525.js} +1 -1
- package/dist/chunk-UXPBVRSE.js +7 -0
- package/dist/{chunk-HV47GP2C.js → chunk-VHPT7ZS5.js} +5 -5
- package/dist/{chunk-NU5HN3FZ.js → chunk-WON5GBJY.js} +7 -7
- package/dist/{chunk-RXCGE2AY.js → chunk-WS7XIJS6.js} +1 -1
- package/dist/{chunk-DGZAQXTW.js → chunk-WWLKVGV7.js} +4 -4
- package/dist/{chunk-G4GVLK44.js → chunk-WZ5QSSUM.js} +6 -6
- package/dist/{chunk-Y62TTKSY.js → chunk-X2KMUHBB.js} +3 -3
- package/dist/{chunk-C6Y7B73Q.js → chunk-XCAO2F3H.js} +1 -1
- package/dist/{chunk-FACWYKL6.js → chunk-XKJ7GEVA.js} +6 -6
- package/dist/chunk-XPTOKPUM.js +11 -0
- package/dist/{chunk-PLK2WHZG.js → chunk-XQMPLXGG.js} +16 -16
- package/dist/{chunk-2VGQS6CW.js → chunk-XTV3CAV7.js} +1 -1
- package/dist/{chunk-JNQKBN5M.js → chunk-YG6Y5X7S.js} +5 -5
- package/dist/chunk-YUECA3XB.js +8 -0
- package/dist/chunk-YYZ73H64.js +7 -0
- package/dist/{chunk-VN4KSRZ5.js → chunk-ZF2MNQXY.js} +1 -1
- package/dist/{chunk-FKRPQDFX.js → chunk-ZI3DGOW6.js} +16 -16
- package/dist/{chunk-TKJBZIHT.js → chunk-ZMRGHVKS.js} +1 -1
- 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 +249 -249
- 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-6NJNSIRN.js +0 -29
- package/dist/Files-OVNXUYOV.js +0 -88
- package/dist/Sidebar-2HHICMZZ.js +0 -44
- package/dist/chunk-22RQC4EW.js +0 -20
- package/dist/chunk-2H6YNMBE.js +0 -14
- package/dist/chunk-5TQLUPZD.js +0 -6
- package/dist/chunk-67MQ5S32.js +0 -8
- package/dist/chunk-6JSXIEH2.js +0 -4
- package/dist/chunk-77MOYIQW.js +0 -15
- package/dist/chunk-7INZ7O3A.js +0 -5
- package/dist/chunk-B23RG53S.js +0 -14
- package/dist/chunk-CUHUZBFH.js +0 -29
- package/dist/chunk-DESWIPOZ.js +0 -3
- package/dist/chunk-DYNJ2H6R.js +0 -8
- package/dist/chunk-EJUNGVK2.js +0 -22
- package/dist/chunk-I4VIEGCX.js +0 -2
- package/dist/chunk-JIGFR7Z3.js +0 -11
- package/dist/chunk-MJGK6QTO.js +0 -7
- package/dist/chunk-PN5FQVMB.js +0 -7
- package/dist/chunk-PUF75SMJ.js +0 -1
- package/dist/chunk-QDKAA3HR.js +0 -2
- package/dist/chunk-TLMFVEMC.js +0 -9
- package/dist/chunk-WRQ4A5QY.js +0 -1
- package/dist/chunk-XYBI57KO.js +0 -12
- /package/dist/{chunk-ECJKIPWU.js → chunk-3J2PO3KW.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{ChartTooltip as l}from"./chunk-
|
|
2
|
-
return s(t,{labels:d,values:F,height:k,width:g,max:b,min:x,formatValue:A,yAxisLabel:y,className:M,emptyLabel:
|
|
1
|
+
import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{ChartTooltip as l}from"./chunk-WZ5QSSUM.js";import{CartesianPlot as t}from"./chunk-QO5E33DH.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as n}from"./chunk-GDQJBQ5B.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{jsx as s,jsxs as m,Fragment as c}from"react/jsx-runtime";function u({rows:u,labels:d,variant:p="area",curve:f="linear",height:k=220,width:g,max:b,min:x,formatValue:w,yAxisLabel:y,color:j,tone:v,label:L,className:M,emptyLabel:Q,radius:O=3}){const N=o().charts,W=n(),A=w??(e=>h(e,W)),C=L??N.range,F=u.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),U=r(0,j,v);/* @__PURE__ */
|
|
2
|
+
return s(t,{labels:d,values:F,height:k,width:g,max:b,min:x,formatValue:A,yAxisLabel:y,className:M,emptyLabel:Q,bandPadding:"bar"===p?.34:0,ariaLabel:N.rangeLabel(C,d.length),tooltip:e=>/* @__PURE__ */s(l,{title:d[e],rows:[{key:"high",label:N.high,color:U,value:null==u[e]?void 0:A(u[e].high)},{key:"low",label:N.low,color:U,value:null==u[e]?void 0:A(u[e].low)}]}),children:({x:l,y:t,active:r})=>"bar"===p?/* @__PURE__ */s("g",{children:u.map((e,i)=>/* @__PURE__ */s("rect",{x:l(i),y:t(e.high),width:Math.max(1,l.bandwidth),height:Math.max(1,t(e.low)-t(e.high)),rx:O,fill:U,fillOpacity:null===r||r===i?.85:.4},i))}):/* @__PURE__ */m("g",{children:[(()=>{const r=u.map((e,i)=>[l.center(i),t(e.high)]),a=u.map((e,i)=>[l.center(i),t(e.low)]);/* @__PURE__ */
|
|
3
3
|
return m(c,{children:[
|
|
4
|
-
/* @__PURE__ */s("path",{d:e(i(r,f),a),fill:
|
|
5
|
-
/* @__PURE__ */s("path",{d:i(r,f),fill:"none",stroke:
|
|
6
|
-
/* @__PURE__ */s("path",{d:i(a,f),fill:"none",stroke:
|
|
4
|
+
/* @__PURE__ */s("path",{d:e(i(r,f),a),fill:U,fillOpacity:.2,stroke:"none"}),
|
|
5
|
+
/* @__PURE__ */s("path",{d:i(r,f),fill:"none",stroke:U,strokeWidth:2,strokeLinejoin:"round"}),
|
|
6
|
+
/* @__PURE__ */s("path",{d:i(a,f),fill:"none",stroke:U,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==r&&/* @__PURE__ */s("line",{x1:l.center(r),y1:t(u[r].high),x2:l.center(r),y2:t(u[r].low),stroke:a.axis,strokeWidth:1})]})})}export{u as RangeChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Tooltip as n}from"./chunk-
|
|
1
|
+
import{Tooltip as n}from"./chunk-Q3IR5SKD.js";import{useShellStrings as r,useShellLocale as e}from"./chunk-GDQJBQ5B.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as o}from"react/jsx-runtime";var a=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-md px-1","text-2xs font-medium normal-case leading-none tabular-nums tracking-normal","ring-1 ring-inset ring-[color:color-mix(in_srgb,currentColor_20%,transparent)]"].join(" ");function s({count:s,label:c,active:l=!1,showZero:m=!1,className:u=""}){const d=r().count,h=e();if(!(s>0||0===s&&m))return null;const f=c??d.items(s);/* @__PURE__ */
|
|
2
2
|
return i(n,{content:f,describe:!1,className:`relative inline-flex shrink-0 ${u}`.trim(),children:/* @__PURE__ */o("span",{"data-item-count":"",className:`${a} ${l?"bg-blue-100 text-blue-700":"bg-[color:color-mix(in_srgb,var(--ink-faint)_14%,transparent)] text-gray-600"}`,children:[
|
|
3
3
|
/* @__PURE__ */i("span",{"aria-hidden":"true",children:t(s,h)}),
|
|
4
4
|
/* @__PURE__ */i("span",{className:"sr-only",children:f})]})})}export{s as ItemCount};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{buttonClasses as e}from"./chunk-UQYNPYF4.js";import{isAriaDisabled as a,swallowPress as r,describedByWith as i,OffWithReason as s}from"./chunk-SQCUN2DX.js";import{SpinnerRing as l}from"./chunk-R2VKEMZH.js";import{forwardRef as d,useId as n}from"react";import{jsxs as t,jsx as c}from"react/jsx-runtime";var o=d(function({variant:d="primary",size:o="md",loading:m=!1,leftIcon:p,rightIcon:b,block:f=!1,disabled:u,type:h="button",children:k,className:x="",disabledReason:N,onClick:y,pressed:v,"aria-disabled":g,"aria-describedby":j,...C},w){const z=n(),I=u||m,Q=null!=N&&""!==N,R=I&&Q,U=!I&&a(g),Y=U&&Q,D=R||Y?z:void 0,E=/* @__PURE__ */t("button",{ref:w,type:h,disabled:I,"aria-busy":m||void 0,"aria-disabled":!!U||g,"aria-describedby":i(j,D),onClick:U?r:y,className:e({variant:d,size:o,block:f,pressed:v??(!0===C["aria-pressed"]||"true"===C["aria-pressed"]),className:x}),...C,children:[m?/* @__PURE__ */c(l,{className:"h-3.5 w-3.5",ink:""}):p,k,!m&&b]});return Y?/* @__PURE__ */c(s,{reason:N,id:z,block:f,children:E}):R?/* @__PURE__ */t("span",{className:f?"flex w-full flex-col gap-1":"inline-flex flex-col items-start gap-1",children:[E,
|
|
2
|
+
/* @__PURE__ */c("span",{id:D,className:"text-xs text-red-600",children:N})]}):E});export{o as Button_default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-YYZ73H64.js";import{Button_default as i}from"./chunk-HXNMRJQ4.js";import{iconButtonClasses as n}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-2UO47XB4.js";import{Tooltip as a}from"./chunk-Q3IR5SKD.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:R,align:z="end",side:W="bottom",menuMinWidth:Y,linkAs:D,block:F=!1,className:I=""},L){const M=g&&(null!=N&&""!==N&&!1!==N)&&!v,O=x&&null!=j&&""!==j&&!1!==j,Q=o(),$=/* @__PURE__ */t(i,{ref:L,type:b,variant:f,size:p,loading:v,leftIcon:k,block:F,disabled:g&&!M,"aria-disabled":!!M||void 0,disabledReason:M?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),A=F?"relative flex min-w-0 flex-1":"relative inline-flex",B=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
2
|
+
return s("div",{className:[F?"flex w-full":"inline-flex","items-stretch",I].filter(Boolean).join(" "),children:[null==w||""===w||M?$:/* @__PURE__ */t(a,{content:w,className:A,children:$}),
|
|
3
|
+
/* @__PURE__ */t(a,{content:O?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":O?Q:void 0,items:h,align:z,side:W,minWidth:Y,linkAs:D,disabled:x&&!O,"aria-disabled":O,onOpenChange:y,footer:C,footerLabel:R,triggerClassName:n({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(r,{name:"chevron-down",className:B,strokeWidth:2,"aria-hidden":"true"})})}),O&&/* @__PURE__ */t("span",{id:Q,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ColorPicker as e}from"./chunk-
|
|
2
|
-
return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[k("left",b.sides.left,h.left,
|
|
1
|
+
import{ColorPicker as e}from"./chunk-NZGNOMWX.js";import{InputNumber_default as t}from"./chunk-BE777IO7.js";import{Segmented as l}from"./chunk-5LCDCO46.js";import{Icon as r}from"./chunk-2UO47XB4.js";import{jsxs as a,Fragment as o,jsx as i}from"react/jsx-runtime";var s=["solid","dashed","dotted"],n=["top","right","bottom","left"];function d(e){const t=e??{},l="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:l]))}function m(e,t){const l=e??{},r=d(t),a=n.some(e=>"number"==typeof l[e]),o=n.map(e=>"number"==typeof l[e]?l[e]:"number"==typeof l.width?l.width:a?0:r[e]);return!o.every(e=>e===o[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */i(r,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */i(r,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */i(r,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */i(r,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */i(r,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */i(r,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */i(r,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */i(r,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:r,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:y=!0,min:g=0,max:N=20,step:v=1,readOnly:x}){const O=e=>"number"==typeof d[e]?d[e]:null,j=(e,t)=>{const l={...d};if("number"==typeof d.width)for(const e of n)null===O(e)&&(l[e]=d.width);l[e]=t,delete l.width,m(l)},k=(e,l,r,a,o,s)=>/* @__PURE__ */i("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */i(t,{value:a,onChange:s,min:g,max:N,step:v,precision:0,steppers:"compact",readOnly:x,placeholder:o,prefix:r,suffix:b.unit,"aria-label":l})}),C=n.map(O),S="number"==typeof d.width?d.width:C.every(e=>null!==e&&e===C[0])?C[0]:null,z=null===S&&C.some(e=>null!==e),B=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",E=e=>O(e)??("number"==typeof d.width?d.width:null),I=d.style??u.style;/* @__PURE__ */
|
|
2
|
+
return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[k("left",b.sides.left,h.left,E("left"),String(u.sides.left),e=>j("left",e)),k("top",b.sides.top,h.top,E("top"),String(u.sides.top),e=>j("top",e)),k("right",b.sides.right,h.right,E("right"),String(u.sides.right),e=>j("right",e)),k("bottom",b.sides.bottom,h.bottom,E("bottom"),String(u.sides.bottom),e=>j("bottom",e))]}):k("all",b.width,h.all,S,z?"–":B,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,y&&/* @__PURE__ */i("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */i(l,{block:!0,size:"sm",label:b.style,value:I,onChange:e=>{x||m({...d,style:e})},options:s.map(e=>({value:e,label:/* @__PURE__ */a(o,{children:[p[e],
|
|
3
3
|
/* @__PURE__ */i("span",{className:"sr-only",children:b.styles[e]})]}),title:b.styles[e]}))})}),
|
|
4
4
|
/* @__PURE__ */i("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */i(e,{value:d.color??"",onChange:e=>{x||m({...d,color:e})},label:b.color,presets:f,fallback:u.color,showHexInput:!0,size:"md",disabled:x})})]})}export{s as BORDER_LINE_STYLES,u as BorderInput,d as borderSides,m as borderStartEach};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-G4PGEQOX.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as i}from"./chunk-QVZKRROQ.js";import{ImageLightbox as r}from"./chunk-4V73LGZG.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-5W2OEDUD.js";import{Breadcrumbs as d}from"./chunk-XYECIBVX.js";import{useGridSelection as s}from"./chunk-VLKDWKVR.js";import{useMarquee as c}from"./chunk-OLFYNMTD.js";import{ROOT_KEY as u,mediaLibraryMenu as m}from"./chunk-MS5APD3V.js";import{useMediaMoveItems as p}from"./chunk-OPN4I565.js";import{copyToClipboard as h}from"./chunk-TMMNCXQT.js";import{DropdownMenu as f}from"./chunk-YYZ73H64.js";import{NativeSelect as g}from"./chunk-CUKDQPEN.js";import{MediaUploadGrid as v}from"./chunk-ILP7QVW5.js";import{MediaUsedInList as k}from"./chunk-B4HSNEBK.js";import{Segmented as y}from"./chunk-5LCDCO46.js";import{useContextMenu as b,ContextMenu as w}from"./chunk-GD7ILVPF.js";import{Banner as x}from"./chunk-ZGOHRLXG.js";import{Input_default as C}from"./chunk-MAMWQCJ6.js";import{IconButton_default as N}from"./chunk-FX6DBXXD.js";import{useFileIntake as I,FileIntakeAlert as D}from"./chunk-JTMEFXRL.js";import{usePlotWidth as S}from"./chunk-MAFUXCPZ.js";import{ColoredBadge as j}from"./chunk-CNUHLJYD.js";import{Button_default as z}from"./chunk-HXNMRJQ4.js";import{buttonClasses as F}from"./chunk-UQYNPYF4.js";import{Icon as O}from"./chunk-2UO47XB4.js";import{Checkbox_default as T}from"./chunk-CGZBDI6C.js";import{Tooltip as L}from"./chunk-Q3IR5SKD.js";import{useShellStrings as P}from"./chunk-GDQJBQ5B.js";import{useRef as E,useMemo as M,useCallback as A,useState as R,useEffect as B}from"react";import{jsxs as U,Fragment as K,jsx as Q}from"react/jsx-runtime";var G="application/x-efficient-media-files",X="application/x-efficient-media-folder",V="application/x-efficient-media-file";function H(e){if(!e||!Array.from(e.types).includes(V))return null;try{const n=JSON.parse(e.getData(V));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var J={type:"all",use:"any",sort:"newest"},W={lock:/* @__PURE__ */Q(O,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */Q(O,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */Q(O,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */Q(O,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */Q(O,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */Q(O,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */Q(O,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */Q(O,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */Q(O,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */Q(O,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */Q(O,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */Q(O,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */Q(O,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */Q(O,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */Q(O,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */Q(O,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},Y={link:/* @__PURE__ */Q(O,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */Q(O,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */Q(O,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */Q(O,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function $({value:e,label:n,onDone:l}){const[a,i]=R(e),r=E(!1),t=e=>{r.current||(r.current=!0,l(e))};/* @__PURE__ */
|
|
2
|
+
return Q(C,{size:"sm",autoFocus:!0,"aria-label":n,value:a,onChange:e=>i(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:n=>{n.stopPropagation(),"Enter"===n.key?(n.preventDefault(),t(a.trim()||e)):"Escape"===n.key&&(n.preventDefault(),t(null))},onBlur:()=>t(a.trim()||e),onClick:e=>e.stopPropagation()})}function Z(O){const{mode:H="manage",layout:Z="auto",location:q,onLocationChange:_,folders:ee,products:ne,allFilesCount:le,trashCount:ae,files:ie,query:re,onQueryChange:te,filters:oe=J,onFiltersChange:de,extraFilters:se,view:ce="grid",onViewChange:ue,selectedIds:me,onSelectionChange:pe,usedIn:he,denied:fe={},accept:ge="image/*,video/*",maxSizeBytes:ve,busy:ke,progress:ye,onUpload:be,onNewFolder:we,onRename:xe,onMove:Ce,onTrash:Ne,onDeleteFolder:Ie,onRestore:De,onDeleteForever:Se,onEmptyTrash:je,onReplace:ze,onCropEdit:Fe,onOpenInDesign:Oe,onChoose:Te,onCancel:Le,pickNote:Pe,onDragOut:Ee,className:Me=""}=O,Ae=P().mediaLibrary,Re=P().media,Be="pick"===H,Ue=!Be,Ke=E(null),Qe=S(Ke,"phone"===Z?343:1200),Ge="phone"===Z||"auto"===Z&&Qe<640,Xe=M(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,a)=>{for(const i of e){const e=[...a,i];n.set(i.id,{node:i,path:e}),i.children&&l(i.children,e)}};return l(e,[]),n}(ne),[ne]),Ve=M(()=>new Map(ee.map(e=>[e.id,e])),[ee]),He=M(()=>{const e=/* @__PURE__ */new Map;for(const n of ee){const l=n.parentId&&Ve.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[ee,Ve]),Je=A(e=>{const n=[];for(let l=e?Ve.get(e):void 0;l&&(n.unshift(l),!(n.length>ee.length));l=l.parentId?Ve.get(l.parentId):void 0);return n},[Ve,ee.length]),We=A((e,n)=>Je(e).some(e=>e.id===n),[Je]),[Ye,$e]=R(()=>/* @__PURE__ */new Set(["@files"])),Ze=e=>$e(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),qe=A(e=>{$e(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),_e="files"===(en=q).place?`files:${en.folderId??""}`:"products"===en.place?`products:${en.nodeId??""}`:"trash";var en;B(()=>{if("files"===q.place)qe(["@files",...Je(q.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===q.place){const e=q.nodeId?Xe.get(q.nodeId)?.path??[]:[];qe(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[_e]);const nn="products"===q.place,ln="trash"===q.place,an="files"===q.place,rn=an?q.folderId:null,tn=nn&&q.nodeId?Xe.get(q.nodeId)?.path[0]:void 0,on=e=>e?.sharedFrom?`${Ae.readOnly} ${Ae.editedAtHq(e.sharedFrom)}`:Ae.readOnly,dn=M(()=>ie.map(e=>e.id),[ie]),sn=M(()=>new Map(ie.map(e=>[e.id,e])),[ie]),cn=s(dn),un=M(()=>dn.filter(e=>cn.selected.has(e)),[dn,cn.selected]),mn=1===un.length?sn.get(un[0]):void 0,pn=E(!0);B(()=>{pn.current?pn.current=!1:cn.clear()},[_e]);const hn=me?.join("\0");B(()=>{me&&cn.setSelection(me)},[hn]);const fn=E(hn??""),gn=un.join("\0");B(()=>{fn.current!==gn&&(fn.current=gn,pe?.(un))},[gn]);const vn=(e,n={})=>{Be?cn.select(e):cn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[kn,yn]=R(null),bn=e=>{const n=kn;if(yn(null),!n||null==e)return;e!==("folder"===n.kind?Ve.get(n.id)?.name:sn.get(n.id)?.name)&&xe?.(n,e)},wn=async e=>{if(!we)return;const n=await we(e);qe(["@files",...e?[e]:[]]),"string"==typeof n&&yn({kind:"folder",id:n})},xn=A(e=>{const n=[],l=n=>{if("files"===e.kind)return n===rn&&an?Ae.alreadyHere:void 0;const l=Ve.get(e.id);return n===e.id||n&&We(n,e.id)?Ae.notIntoItself:(l?.parentId??null)===n?Ae.folderAlreadyHere:void 0};n.push({key:u,label:Ae.allFiles,disabledReason:l(null)});const a=(e,i)=>{for(const r of He.get(e)??[])n.push({key:r.id,label:r.name,depth:i,disabledReason:l(r.id)}),a(r.id,i+1)};return a(null,1),n},[He,Ve,an,We,rn,Ae]),Cn=A(e=>{const n=new Set(e.map(e=>sn.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[sn]),[Nn,In]=R(null),Dn={words:Ae,media:Re,denied:fe,moveTargets:xn,kindOf:Cn,urlOf:e=>sn.get(e)?.url,newSubfolder:we&&Ue?e=>{wn(e)}:void 0,rename:xe&&Ue?e=>{"file"!==e.kind||cn.isSelected(e.id)||cn.select(e.id),yn(e)}:void 0,move:Ce&&Ue?Ce:void 0,trash:Ne&&Ue?Ne:void 0,deleteFolder:Ie&&Ue?Ie:void 0,folderNotEmpty:e=>!!Ve.get(e)?.notEmpty,replace:ze&&Ue?ze:void 0,copyUrl:e=>{const n=sn.get(e)?.url;n&&h(Ae.urlLabel,n)},openInDesign:Oe,restore:De,deleteForever:Se},Sn=e=>m(e,Dn),jn=b(),zn=(e,n)=>{Be||(cn.isSelected(e)||cn.select(e),jn.open(n,(e=>{const n=cn.isSelected(e)?un:[e];return nn?{kind:"render",id:e}:ln?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[Fn,On]=R(null),[Tn,Ln]=R(null),[Pn,En]=R(null);B(()=>{if(!Tn&&!Fn)return;const e=()=>{Ln(null),On(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[Tn,Fn]);const Mn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),An=(e,n)=>!(!Ce||fe.move||Be)&&(!!Mn(e,G)||!(!Mn(e,X)||!Pn)&&(n!==Pn&&!(n&&We(n,Pn)))),Rn=(e,n)=>({onDragEnter:l=>{An(l,n)&&(l.preventDefault(),On(e))},onDragOver:l=>{An(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Fn!==e&&On(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||On(n=>n===e?null:n)},onDrop:e=>{if(An(e,n))if(e.preventDefault(),On(null),Mn(e,G)){let l;try{l=JSON.parse(e.dataTransfer.getData(G))}catch{l=null}Array.isArray(l)&&l.length&&Ce({kind:"files",ids:l.map(String)},n)}else Pn&&(Ce({kind:"folder",id:Pn},n),En(null))}}),Bn=e=>{const n=e=>Mn(e,G)||Mn(e,X)||Mn(e,"Files");return{onDragEnter:l=>{n(l)&&Ln(e)},onDragOver:l=>{n(l)&&Tn!==e&&Ln(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Ln(n=>n===e?null:n)}}},Un=(e,n,l)=>/* @__PURE__ */Q(L,{side:"right",content:Tn===e?Ae.noDropProducts:on(l),open:Tn===e||!Tn&&void 0,children:/* @__PURE__ */Q("span",{children:n})}),Kn=e=>({onContextMenu:n=>{jn.open(n,e)}}),Qn=(e,a,i)=>e.map(e=>{const r=`p:${e.id}`,t=i??e,o=Ye.has(r),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
3
|
+
return U("div",{role:"none",className:"contents",children:[
|
|
4
|
+
/* @__PURE__ */Q(n,{label:Un(r,e.name,t),level:a,icon:d&&o?W.folderOpen:W.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ae.fileCount(e.count):void 0,selected:nn&&q.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>Ze(r):void 0,onSelect:()=>_({place:"products",nodeId:e.id}),rowProps:{"data-media-row":r,...Bn(r),...Ue?Kn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */Q(l,{children:Qn(d,a+1,t)})]},e.id)}),Gn=(e,a)=>(He.get(e)??[]).map(e=>{const i=He.get(e.id),r=Ye.has(e.id),t="folder"===kn?.kind&&kn.id===e.id,o=Sn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
5
|
+
return U("div",{role:"none",className:"contents",children:[
|
|
6
|
+
/* @__PURE__ */Q(n,{label:e.name,level:a,icon:i&&r?W.folderOpen:W.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ae.fileCount(e.count):void 0,selected:t||an&&q.folderId===e.id,expanded:i?r:void 0,onToggle:i?()=>Ze(e.id):void 0,onSelect:()=>_({place:"files",folderId:e.id}),drop:Fn===e.id?"into":void 0,dragging:Pn===e.id,draggable:Ue&&!!Ce&&!fe.move,rename:t?/* @__PURE__ */Q($,{value:e.name,label:Ae.folderName,onDone:bn}):void 0,actions:Ue&&o.length?/* @__PURE__ */Q(f,{align:"end","aria-label":Ae.folderActions,trigger:W.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Rn(e.id,e.id),...Ue?Kn({kind:"folder",id:e.id}):{},...Ue&&Ce&&!fe.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(X,e.id),En(e.id)},onDragEnd:()=>{En(null),On(null)}}:{}}}),i&&r&&/* @__PURE__ */Q(l,{children:Gn(e.id,a+1)})]},e.id)}),Xn=Ye.has("@files"),Vn=Ye.has("@products"),Hn=/* @__PURE__ */U(e,{"aria-label":Ae.folders,children:[ne&&/* @__PURE__ */U(K,{children:[
|
|
7
|
+
/* @__PURE__ */Q(n,{label:Un("@products",Ae.products),level:1,icon:W.lock,badge:{label:Ae.readOnlyBadge,tone:"neutral"},expanded:ne.length?Vn:void 0,onToggle:()=>Ze("@products"),selected:nn&&null==q.nodeId,onSelect:()=>_({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Bn("@products")}}),Vn&&ne.length>0&&/* @__PURE__ */Q(l,{children:Qn(ne,2)})]}),
|
|
8
|
+
/* @__PURE__ */Q(n,{label:Ae.allFiles,level:1,icon:Xn?W.folderOpen:W.folder,count:le,countLabel:null!=le?Ae.fileCount(le):void 0,expanded:He.get(null)?.length?Xn:void 0,onToggle:()=>Ze("@files"),selected:an&&null==q.folderId,onSelect:()=>_({place:"files",folderId:null}),drop:"@files"===Fn?"into":void 0,rowProps:{"data-media-row":"@files",...Rn("@files",null)}}),Xn&&(He.get(null)?.length??0)>0&&/* @__PURE__ */Q(l,{children:Gn(null,2)}),Ue&&/* @__PURE__ */Q(n,{label:Ae.trash,level:1,icon:W.trash,count:ae,countLabel:null!=ae?Ae.fileCount(ae):void 0,selected:ln,onSelect:()=>_({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Jn=(()=>{if(ln)return[{label:Ae.trash}];if(nn){const e=q.nodeId?Xe.get(q.nodeId)?.path??[]:[];return[{label:Ae.products,onClick:e.length?()=>_({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"products",nodeId:n.id}):void 0}))]}const e=Je(rn);return[{label:Ae.allFiles,onClick:e.length?()=>_({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"files",folderId:n.id}):void 0}))]})(),Wn=nn?Ae.readOnly:fe.upload,Yn=!!be&&!ln&&!Wn,$n=I({accept:ge,maxSizeBytes:ve,multiple:!0,disabled:!Yn,onAccept:e=>be?.(e,rn)}),Zn=nn?Ae.noProductFolder:fe.newFolder,qn=e=>e?{"aria-disabled":!0,disabledReason:e}:{},_n=/* @__PURE__ */U("div",{className:"flex flex-wrap items-center gap-2",children:[Ue&&we&&!ln&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:W.folderPlus,onClick:()=>{wn(rn)},...qn(Zn),children:Ae.newFolder}),be&&!ln&&/* @__PURE__ */Q(z,{variant:"primary",size:"sm",leftIcon:W.upload,onClick:()=>$n.open(),...qn(Wn),children:Ae.upload}),Ue&&ln&&je&&ie.length>0&&/* @__PURE__ */Q(z,{variant:"danger",size:"sm",onClick:je,...qn(fe.deleteForever),children:Ae.emptyTrash})]}),el=(e,n,l,a,i)=>/* @__PURE__ */Q("div",{style:{width:Ge?void 0:i,flex:Ge?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */Q(g,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),nl=e=>n=>de?.({...oe,[e]:n}),ll=/* @__PURE__ */U("div",{className:"flex flex-wrap items-center gap-2",children:[te&&/* @__PURE__ */Q("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */Q(C,{size:"sm",type:"search",leftIcon:W.search,placeholder:nn?Ae.searchProducts:Ae.search,"aria-label":nn?Ae.searchProducts:Ae.search,value:re??"",onChange:e=>te(e.target.value)})}),de&&el(Ae.mediaType,oe.type,[{value:"all",label:Ae.allTypes},{value:"image",label:Ae.images},{value:"video",label:Ae.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],nl("type"),130),de&&!nn&&!ln&&el(Ae.use,oe.use,[{value:"any",label:Ae.anyUse},{value:"email",label:Ae.emailOnly},{value:"website",label:Ae.websiteOnly},{value:"unused",label:Ae.notUsed}],nl("use"),130),de&&Ue&&el(Ae.sort,oe.sort,[{value:"newest",label:Ae.newest},{value:"name",label:Ae.byName},{value:"size",label:Ae.bySize}],nl("sort"),110),se?.map(e=>el(e.label,e.value,e.options,e.onChange,120)),ue&&/* @__PURE__ */Q(y,{size:"sm",label:Ae.view,value:ce,onChange:ue,options:[{value:"grid",label:Ae.grid,icon:W.grid},{value:"list",label:Ae.list,icon:W.list}]})]}),al=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ae.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:Y.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ae.used(e.usedCount),count:e.usedCount,icon:Y.link,tone:"active"}),e.email&&n.push({key:"e",label:Ae.email,icon:Y.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ae.private,icon:Y.lock,tone:"neutral"}),n},il=e=>al(e).map(e=>/* @__PURE__ */Q(j,{tone:e.tone,size:"xs",children:e.label},e.key)),rl=Ue&&an&&!!Ce&&!fe.move,tl=!!Ee&&!ln,ol=e=>!tl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),dl=ie.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:al(e),dragData:rl?JSON.stringify(cn.isSelected(e.id)?un:[e.id]):ol(e),...rl&&ol(e)?{dragAlso:{[V]:ol(e)}}:{}})),sl=Ge?Math.max(72,Math.floor((Qe-24-16-1)/3)):112,cl=E(null),ul=c({containerRef:cl,enabled:Ue&&!Ge&&ie.length>0,selected:cn.selected,setSelection:e=>cn.setSelection(e),clearSelection:cn.clear}),ml=e=>{if(Be){const n=sn.get(e);return void(!n||n.private||n.pickDisabledReason||Te?.(n))}const n=dn.indexOf(e);n>=0&&In(n)},pl=ie.length?null:re?/* @__PURE__ */Q(i,{variant:"dashed",title:Ae.noMatches}):nn?/* @__PURE__ */Q(i,{variant:"dashed",title:Ae.emptyProducts,description:on(tn)}):ln?/* @__PURE__ */Q(i,{variant:"dashed",title:Ae.trashEmpty}):!Yn||Be?/* @__PURE__ */Q(i,{variant:"dashed",title:Ae.emptyFolder}):null,hl="list"===ce&&ie.length>0,fl=pl??(hl?/* @__PURE__ */Q("ul",{role:"listbox","aria-multiselectable":Ue||void 0,"aria-label":Ae.folders,className:"flex flex-col gap-1",children:ie.map(e=>/* @__PURE__ */U("li",{role:"option","aria-selected":cn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>vn(e.id,n),onDoubleClick:()=>ml(e.id),onContextMenu:n=>zn(e.id,n),draggable:!!ol(e)||void 0,onDragStart:ol(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(V,ol(e)),Ee("start")}:void 0,onDragEnd:ol(e)?e=>Ee("none"===e.dataTransfer.dropEffect?"cancelled":"dropped"):void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),vn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(cn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
|
|
9
|
+
/* @__PURE__ */Q("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
10
|
+
/* @__PURE__ */Q("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
11
|
+
/* @__PURE__ */Q("span",{className:"flex shrink-0 items-center gap-1",children:il(e)}),e.sizeLabel&&/* @__PURE__ */Q("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */Q(v,{items:dl,readOnly:!Yn||Be,onFiles:Yn&&!Be?e=>be(e,rn):void 0,accept:ge,maxSizeBytes:ve,busy:ke,progress:ye,fit:"contain",thumbSize:sl,dragType:rl?G:tl?V:void 0,onDragOutChange:tl?e=>Ee(e):void 0,selected:cn.selected,onItemClick:vn,onItemDoubleClick:ml,onItemContextMenu:Ue?zn:void 0,menuOnMedia:Ue})),gl=p({count:un.length,kind:Cn(un),targets:xn({kind:"files",ids:un}),onPick:e=>Ce?.({kind:"files",ids:un},e.key===u?null:e.key)}),vl=F({variant:"secondary",size:"sm"}),kl=/* @__PURE__ */Q(f,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */U(K,{children:[W.folder,Ae.moveTo]}),items:gl,disabled:!!fe.move}),yl=Ue&&un.length>1&&!nn?/* @__PURE__ */U("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
|
|
12
|
+
/* @__PURE__ */Q(T,{checked:un.length===ie.length,indeterminate:un.length<ie.length,onChange:e=>e?cn.selectAll():cn.clear(),label:Ae.selected(un.length)}),/* @__PURE__ */U(K,ln?{children:[De&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:W.undo,onClick:()=>De(un),...qn(fe.restore),children:Ae.restore}),Se&&/* @__PURE__ */Q(z,{variant:"secondary-danger",size:"sm",onClick:()=>Se(un),...qn(fe.deleteForever),children:Ae.deleteForever})]}:{children:[Ce&&kl,xe&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:W.edit,disabled:!0,children:Ae.rename}),Ne&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:W.trash,onClick:()=>Ne({kind:"files",ids:un}),...qn(fe.trash),children:Ae.moveFilesToTrash(un.length)})]}),
|
|
13
|
+
/* @__PURE__ */Q(z,{variant:"ghost",size:"sm",onClick:cn.clear,children:Ae.clearSelection})]}):null,bl=e=>{const n=[],l=(e,l,a)=>{null!=a&&""!==a&&n.push({key:e,label:l,value:a})},a="file"===kn?.kind&&kn.id===e.id;l("name",Ae.name,a?/* @__PURE__ */Q($,{value:e.name,label:Ae.fileName,onDone:bn}):e.name),l("type",Ae.type,e.typeLabel),l("size",Ae.size,e.sizeLabel),l("resolution",Ae.resolution,e.resolution),nn?(l("design",Ae.design,e.design),l("finish",Ae.finish,e.finish),l("angle",Ae.angleLug,e.angleLug),l("owner",Ae.owner,e.owner)):(l("added",Ae.addedBy,e.addedBy),l("folder",Ae.folder,e.folderPath)),l("used",Ae.usedIn,null!=e.usedCount?Ae.places(e.usedCount):void 0);const i=m({kind:"files",ids:[e.id]},Dn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
14
|
+
return U("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
15
|
+
/* @__PURE__ */Q("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),nn&&/* @__PURE__ */Q(x,{tone:"neutral",title:Ae.readOnlyBadge,children:on(tn)}),
|
|
16
|
+
/* @__PURE__ */Q(t,{size:"sm",columns:1,items:n}),!ln&&/* @__PURE__ */U("div",{className:"flex gap-2",children:[
|
|
17
|
+
/* @__PURE__ */Q("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */Q(C,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ae.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
18
|
+
/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:W.copy,onClick:()=>Dn.copyUrl(e.id),children:Ae.copyUrl})]}),an&&Ue&&/* @__PURE__ */U("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:W.swap,onClick:()=>ze(e.id),...qn(fe.replace),children:Ae.replace}),Fe&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:W.crop,onClick:()=>Fe(e.id),children:Ae.cropEdit}),Ce&&"submenu"===i?.type&&/* @__PURE__ */Q(f,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */U(K,{children:[W.folder,Ae.moveTo]}),items:i.items,disabled:!!fe.move}),xe&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:W.edit,onClick:()=>yn({kind:"file",id:e.id}),...qn(fe.rename),children:Ae.rename}),Ne&&/* @__PURE__ */Q(N,{"aria-label":Ae.moveToTrash,size:"sm",onClick:()=>Ne({kind:"files",ids:[e.id]}),disabledReason:fe.trash,"aria-disabled":!!fe.trash||void 0,children:W.trash})]}),ln&&Ue&&/* @__PURE__ */U("div",{className:"flex flex-wrap gap-2",children:[De&&/* @__PURE__ */Q(z,{variant:"primary",size:"sm",leftIcon:W.undo,onClick:()=>De([e.id]),...qn(fe.restore),children:Ae.restore}),Se&&/* @__PURE__ */Q(z,{variant:"danger",size:"sm",onClick:()=>Se([e.id]),...qn(fe.deleteForever),children:Ae.deleteForever})]}),nn&&Oe&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:W.external,onClick:()=>Oe({kind:"render",id:e.id}),children:Ae.openInDesign}),he&&/* @__PURE__ */Q(k,{items:he})]})},wl=mn?mn.private?Ae.privateNoPick:mn.pickDisabledReason:void 0,xl=Be?/* @__PURE__ */U("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
|
|
19
|
+
/* @__PURE__ */Q("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:mn?Ae.oneChosen(mn.name):Ae.noneChosen}),
|
|
20
|
+
/* @__PURE__ */U("div",{className:"flex gap-2",children:[Le&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",onClick:Le,children:Ae.cancel}),
|
|
21
|
+
/* @__PURE__ */Q(z,{variant:"primary",size:"sm",disabled:!mn,...qn(wl),onClick:()=>{mn&&!wl&&Te?.(mn)},children:Ae.chooseImage})]})]}):null,Cl=Ue&&!!mn,Nl=/* @__PURE__ */U("div",{className:"flex min-w-0 flex-col gap-3",children:[Pe&&/* @__PURE__ */Q(x,{tone:"neutral",children:Pe}),
|
|
22
|
+
/* @__PURE__ */U("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
23
|
+
/* @__PURE__ */Q(d,{items:Jn}),_n]}),ll,yl,
|
|
24
|
+
/* @__PURE__ */U("div",{ref:cl,className:"relative",onPointerDown:ul.onPointerDown,onKeyDown:e=>{Ue&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),cn.selectAll()):"Escape"===e.key&&cn.size&&cn.clear()},children:[fl,
|
|
25
|
+
/* @__PURE__ */Q(a,{rect:ul.rect})]}),Yn&&/* @__PURE__ */Q("input",{...$n.inputProps}),
|
|
26
|
+
/* @__PURE__ */Q(D,{rejections:$n.rejections})]});/* @__PURE__ */
|
|
27
|
+
return U("div",{ref:Ke,"data-media-library":"","data-layout":Ge?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Me}`.trim(),children:[/* @__PURE__ */U("div",Ge?{className:"flex flex-col gap-3 p-3",children:[Hn,Nl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
28
|
+
/* @__PURE__ */Q("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Hn}),
|
|
29
|
+
/* @__PURE__ */Q("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Nl}),Cl&&/* @__PURE__ */Q("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:bl(mn)})]}),xl,Ge&&/* @__PURE__ */Q(o,{open:Cl,onClose:cn.clear,side:"bottom",title:mn?.name,children:mn&&bl(mn)}),jn.state&&/* @__PURE__ */Q(w,{...jn.props,items:Sn(jn.state.data)}),null!=Nn&&ie.length>0&&/* @__PURE__ */Q(r,{images:ie.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Nn,ie.length-1),onClose:()=>In(null)})]})}export{G as MEDIA_FILES_DRAG_TYPE,V as MEDIA_FILE_DRAG_TYPE,X as MEDIA_FOLDER_DRAG_TYPE,Z as MediaLibrary,H as readMediaFileDrag};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{useHighlight as e}from"./chunk-CNYAHYE6.js";import{ChartTooltip as t}from"./chunk-WZ5QSSUM.js";import{usePlotWidth as l}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as a,CHART_INK as n,STATUS_VARS as r}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as i}from"./chunk-GDQJBQ5B.js";import{formatPercent as u,formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as c,useState as m,useRef as s}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";function x({stages:x,shape:v="funnel",height:p,width:$,gap:g=4,minBandWidth:M=0,formatValue:y,color:b,className:k,emptyLabel:S}){const A=o().charts,N=i(),L=y??(e=>h(e,N)),j=S??A.noStages,z=c(),[V,W]=m(null),{highlighted:Z}=e(),w=s(null),B=l(w,560),C=$??B;if(0===x.length)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${k??""}`,children:j});const F=b??a(0),Q=p??54*x.length,E=Math.max(...x.map(e=>e.value),1),H="bars"===v,U=H?Math.round(Math.min(132,Math.max(80,.24*C))):Math.round(Math.min(168,Math.max(104,.38*C))),R=e=>{const t=x[e-1]?.value;return null!=t&&t>0?100*(1-x[e].value/t):null},Y=e=>{const t=R(e);return{count:L(x[e].value),drop:null!=t?`−${u(t,1,N)}`:""}},D=H?Math.ceil(Math.max(...x.map((e,t)=>{const{count:l,drop:a}=Y(t);return.62*(l.length+(a?a.length+1:0))*12}))+16):0,G=C-U-D,J=Math.max(H?2:0,Math.min(M,G)),O=e=>Math.max(J,G*Math.max(0,e/E)),P=e=>O(e)/2,T=U+G/2,X=e=>46+e/Math.max(1,x.length-1)*54,q=e=>`color-mix(in oklab, ${F} ${X(e).toFixed(0)}%, ${n.surface})`,I=e=>X(e)>=55?n.surface:n.label,K=(e,t)=>null!==V?V!==e:null!==Z&&Z!==t,_=null!==V?x[V]:void 0;/* @__PURE__ */
|
|
2
|
+
return f("div",{className:`relative ${k??""}`,ref:w,children:[
|
|
3
|
+
/* @__PURE__ */f("svg",{width:"100%",height:Q,viewBox:`0 0 ${C} ${Q}`,role:"img","aria-labelledby":z,onMouseLeave:()=>W(null),children:[
|
|
4
|
+
/* @__PURE__ */d("title",{id:z,children:A.funnel(x.length,L(x[0].value),L(x[x.length-1].value))}),x.map((e,t)=>{const l=t*Q/x.length+g/2,a=(t+1)*Q/x.length-g/2,r=(l+a)/2,o=u(e.value/(x[0].value||1)*100,0,N),i=.62*o.length*12+12;if(H){const u=U,h=u+O(e.value),{count:c,drop:m}=Y(t);/* @__PURE__ */
|
|
5
|
+
return f("g",{opacity:K(t,e.key)?.45:1,onMouseEnter:()=>W(t),children:[
|
|
6
|
+
/* @__PURE__ */d("path",{d:`M${u},${l} L${h},${l} L${h},${a} L${u},${a} Z`,fill:q(t)}),
|
|
7
|
+
/* @__PURE__ */d("text",{x:U-12,y:r+4,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),h-u>=i&&/* @__PURE__ */d("text",{x:u+8,y:r+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:I(t),style:{fontVariantNumeric:"tabular-nums"},children:o}),
|
|
8
|
+
/* @__PURE__ */f("text",{"data-funnel-value":"true",x:h+8,y:r+4,textAnchor:"start",fontSize:12,fill:n.label,style:{fontVariantNumeric:"tabular-nums"},children:[
|
|
9
|
+
/* @__PURE__ */d("tspan",{fontWeight:600,children:c}),m&&/* @__PURE__ */d("tspan",{fill:n.muted,children:` ${m}`})]})]},e.key)}const h=P(e.value),c="cone"===v?P(x[t+1]?.value??e.value):h,m=R(t),s=2*Math.min(h,c)>=i;/* @__PURE__ */
|
|
10
|
+
return f("g",{opacity:K(t,e.key)?.45:1,onMouseEnter:()=>W(t),children:[
|
|
11
|
+
/* @__PURE__ */d("path",{d:`M${T-h},${l} L${T+h},${l} L${T+c},${a} L${T-c},${a} Z`,fill:q(t)}),
|
|
12
|
+
/* @__PURE__ */d("text",{x:U-14,y:r-2,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),
|
|
13
|
+
/* @__PURE__ */f("text",{x:U-14,y:r+14,textAnchor:"end",fontSize:11,fill:n.muted,style:{fontVariantNumeric:"tabular-nums"},children:[L(e.value),null!=m?` · −${u(m,1,N)}`:""]}),
|
|
14
|
+
/* @__PURE__ */d("text",{x:s?T:T+Math.max(h,c)+6,y:r+4,textAnchor:s?"middle":"start",fontSize:12,fontWeight:600,fill:s?I(t):n.label,style:{fontVariantNumeric:"tabular-nums"},children:o})]},e.key)})]}),_&&null!==V&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(t,{title:_.label,rows:[{key:"value",label:A.count,color:q(V),value:L(_.value)},{key:"share",label:A.ofFirstStage,color:n.muted,value:u(_.value/(x[0].value||1)*100,0,N)},...V>0&&x[V-1].value>0?[{key:"drop",label:A.droppedHere,color:r.critical,value:`−${u(100*(1-_.value/x[V-1].value),1,N)}`}]:[]]})})]})}export{x as FunnelChart};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-
|
|
2
|
-
return v("div",{...Te?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Ke?Ke.has(e.id):void 0,onClick:Te?t=>{t.target.closest?.("button")||
|
|
1
|
+
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-UG6RI525.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-JTMEFXRL.js";import{ColoredBadge as u}from"./chunk-CNUHLJYD.js";import{MENU_ON_MEDIA_ATTR as m}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-2UO47XB4.js";import{Tooltip as f}from"./chunk-Q3IR5SKD.js";import{useShellStrings as h}from"./chunk-GDQJBQ5B.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function N({items:p,onPick:k,onFiles:N,onRemove:w,onReorder:j,dragType:K,onDragOutChange:T,dropType:C,onDropData:A,label:I,hint:F,error:L,required:O,className:S,accept:z="image/*",maxSizeBytes:E,maxFiles:P,fit:R="cover",thumbSize:$=96,placeholder:B,cta:M,acceptHint:H,showCover:Q=!1,coverLabel:U,busy:J=!1,busyLabel:W,progress:q,disabled:G=!1,readOnly:X=!1,selected:Y,onItemClick:V,onItemDoubleClick:Z,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=M??te.cta,ae=U??te.cover,ne=W??te.uploading,le=g(),[ie,oe]=b(null),se=G||J,de=!(!k&&!N||se||X),ce=!!w&&!se&&!X,ue=!!j&&!se&&!X,me=!!K&&!G&&!ue,pe=!(!C||!A||se||X),fe=t(se),he=B??r(z,te),ge=d({accept:z,maxSizeBytes:E,maxFiles:P,acceptHint:H,multiple:!0,disabled:!de,currentCount:p.length,onAccept:e=>{if(N)N(e);else for(const t of e)k(t)}}),[be,ye]=b(!1),ve=y(0),xe=e=>pe&&Array.from(e.dataTransfer?.types??[]).includes(C),ke=ge.zoneProps,De={onDragEnter:e=>{if(!xe(e))return ke.onDragEnter?.(e);e.preventDefault(),ve.current+=1,ye(!0)},onDragOver:e=>{if(!xe(e))return ke.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",be||ye(!0)},onDragLeave:e=>{if(!xe(e))return ke.onDragLeave?.(e);ve.current=Math.max(0,ve.current-1),0===ve.current&&ye(!1)},onDrop:e=>{if(!xe(e))return ke.onDrop?.(e);e.preventDefault(),ve.current=0,ye(!1);const t=e.dataTransfer.getData(C);t&&A(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:$,height:$},Ke=null==Y?null:new Set(Y),Te=!!V,Ce=$<112,Ae=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,z),a=e.name??o(e.url),n=Q&&(e.cover??0===t);/* @__PURE__ */
|
|
2
|
+
return v("div",{...Te?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Ke?Ke.has(e.id):void 0,onClick:Te?t=>{t.target.closest?.("button")||V(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:Z?()=>Z(e.id):void 0,onContextMenu:_?t=>_(e.id,t):void 0,draggable:ue||me&&!!e.dragData||void 0,onDragStart:ue?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(t)),oe(t)}:me&&e.dragData?t=>{t.dataTransfer.effectAllowed=e.dragAlso?"all":"link",t.dataTransfer.setData(K,e.dragData);for(const[r,a]of Object.entries(e.dragAlso??{}))t.dataTransfer.setData(r,a);T?.("start",e.id)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&T?t=>T("none"===t.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onDragOver:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation(),ie!==t&&j(ie,t),oe(null))}:void 0,tabIndex:ue||Te?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Te?a:void 0,onKeyDown:Te&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),V(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}))}:ue?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),j(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<p.length-1&&(e.preventDefault(),j(t,t+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-line bg-gray-100",fe,ie===t?"opacity-50":"",Ke?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Te?"cursor-pointer":""].join(" "),style:{...je,cursor:ue?"move":void 0},children:[r?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:R}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:R}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-accent-fill px-2 py-0.5 text-xs font-medium text-on-accent",children:ae}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
|
|
3
3
|
/* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:Ce?
|
|
4
4
|
/* @__PURE__ */x(f,{content:e.label,children:/* @__PURE__ */x("span",{tabIndex:0,"aria-label":e.label,className:`flex rounded-full ${fe}`,children:/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"inline-flex items-center gap-0.5",children:[
|
|
5
|
-
/* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},
|
|
5
|
+
/* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},Ie=de&&/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":te.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${fe}`,style:je,children:[
|
|
6
6
|
/* @__PURE__ */x(a,{className:"h-5 w-5"}),
|
|
7
|
-
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),Fe=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight
|
|
7
|
+
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),Fe=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight:$+32},children:[
|
|
8
8
|
/* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(a,{})}),
|
|
9
9
|
/* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:he}),
|
|
10
|
-
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),H&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:H})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight
|
|
11
|
-
return v(e,{label:
|
|
12
|
-
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":
|
|
13
|
-
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ke||void 0,"aria-label":"string"==typeof
|
|
10
|
+
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),H&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:H})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:$+32},children:/* @__PURE__ */x("span",{className:J?"invisible":void 0,children:te.empty})});/* @__PURE__ */
|
|
11
|
+
return v(e,{label:I,labelId:I?`${le}-label`:void 0,htmlFor:le,hint:F,error:L,required:O,className:S,children:[
|
|
12
|
+
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":I?`${le}-label`:void 0,"aria-describedby":L?`${le}-error`:F?`${le}-hint`:void 0,"aria-busy":J||void 0,...ge.zoneProps,...pe?De:{},className:"relative rounded-lg transition-colors",style:{...se?{opacity:.6}:{},...Ne?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Fe:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Te?
|
|
13
|
+
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ke||void 0,"aria-label":"string"==typeof I?I:te.files,className:"contents",children:p.map(Ae)}):p.map(Ae),Ie]}),J&&/* @__PURE__ */x(l,{label:ne,progress:q})]}),!k&&N&&/* @__PURE__ */x("input",{...ge.inputProps}),
|
|
14
14
|
/* @__PURE__ */x(c,{rejections:ge.rejections})]})}export{k as FULL_BADGE_TILE_PX,N as MediaUploadGrid};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{isSafeLinkHref as e}from"./chunk-PJPK2ADX.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{isSafeLinkHref as e}from"./chunk-PJPK2ADX.js";import{Button_default as t}from"./chunk-HXNMRJQ4.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{useShellStrings as r}from"./chunk-GDQJBQ5B.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
|
|
2
2
|
return a("a",{href:l,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",onClick:l&&r?e=>{(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&r(l)&&e.preventDefault()}:void 0,children:n})}function u(e){const t=[];let n,r=0,l=0;const s=new RegExp(c.source,"g");for(;null!==(n=s.exec(e));)n.index>r&&t.push(e.slice(r,n.index)),void 0!==n[1]?t.push(
|
|
3
3
|
/* @__PURE__ */i("span",{className:"text-gray-400",children:["[",n[1],"]"]},l++)):void 0!==n[3]?t.push(
|
|
4
4
|
/* @__PURE__ */a(d,{href:n[4],children:n[3]},l++)):void 0!==n[5]?t.push(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-
|
|
1
|
+
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-WZ5QSSUM.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-GDQJBQ5B.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useId as h,useState as u}from"react";import{jsx as p,jsxs as d}from"react/jsx-runtime";var f=300*Math.PI/180;function g({rows:g,variant:k="track",size:v=300,max:x,formatValue:y,animate:M=!0,className:N,emptyLabel:b,trackGap:j=6}){const C=s().charts,w=c(),Q=y??(e=>m(e,w)),R=b??C.nothingToPlot,B=h(),[E,P]=u(null),{highlighted:T}=l();if(0===g.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${N??""}`,children:R});const U=v/2,$=v/2,W=v/2-10,Y=x??Math.max(...g.map(e=>e.value),1),z="track"===k?Math.max(6,(W-.16*v)/g.length):0,A=Math.max(1,Math.floor((W-.16*v)/z||1)),F="track"===k?g.slice(0,A):g,G=Math.min(j,Math.max(1,z-2)),H=n(F.length,.03),I=null!==E?F[E]:void 0;/* @__PURE__ */
|
|
2
2
|
return d("div",{className:`relative ${N??""}`,children:[
|
|
3
|
-
/* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":
|
|
4
|
-
/* @__PURE__ */p("title",{id:
|
|
3
|
+
/* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":B,onMouseLeave:()=>P(null),children:[
|
|
4
|
+
/* @__PURE__ */p("title",{id:B,children:"track"===k?C.radialTrack(F.length):C.radialCycle(F.length)}),F.map((l,r)=>{const n=o(r,l.color,l.tone),s=Math.max(0,Math.min(1,l.value/Y)),c=((e,t)=>null!==E?E!==e:null!==T&&T!==t)(r,l.key);if("track"===k){const o=W-r*z,m=o-z+G,h=-Math.PI/2;/* @__PURE__ */
|
|
5
5
|
return d("g",{opacity:c?.4:1,onMouseEnter:()=>P(r),className:M?t.sweep:void 0,style:M?a(r,70):void 0,children:[
|
|
6
|
-
/* @__PURE__ */p("path",{d:e(
|
|
7
|
-
/* @__PURE__ */p("path",{d:e(
|
|
8
|
-
return p("g",{opacity:c?.4:1,onMouseEnter:()=>P(r),children:/* @__PURE__ */p("path",{d:e(
|
|
6
|
+
/* @__PURE__ */p("path",{d:e(U,$,m,o,h,h+f),fill:i.grid}),
|
|
7
|
+
/* @__PURE__ */p("path",{d:e(U,$,m,o,h,h+f*s),fill:n})]},l.key)}const m=.14*v;/* @__PURE__ */
|
|
8
|
+
return p("g",{opacity:c?.4:1,onMouseEnter:()=>P(r),children:/* @__PURE__ */p("path",{d:e(U,$,m,m+(W-m)*s,H(r),H(r)+H.step),fill:n})},l.key)})]}),I&&null!==E&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:I.label,rows:[{key:"value",label:C.value,color:o(E,I.color,I.tone),value:Q(I.value)}]})}),
|
|
9
9
|
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:g.map((e,t)=>/* @__PURE__ */d("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
10
10
|
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:o(t,e.color,e.tone)}}),
|
|
11
11
|
/* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
|
|
12
|
-
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:
|
|
12
|
+
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:Q(e.value)})]},e.key))})]})}export{g as RadialBarChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Popover as e}from"./chunk-
|
|
2
|
-
return i(e,{className:v,disabled:f,triggerLabel:
|
|
1
|
+
import{Popover as e}from"./chunk-G4JTO5PB.js";import{IconButton_default as r}from"./chunk-FX6DBXXD.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{Tooltip as a}from"./chunk-Q3IR5SKD.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{useRef as t}from"react";import{jsx as i,jsxs as o}from"react/jsx-runtime";var s={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function c({value:c,onChange:m,options:u,label:d,emptyValue:h,columns:p=5,disabled:f=!1,className:v=""}){const g=l(),b=g.iconPicker,x=g.iconNames,w=e=>e.label??x[e.value]??e.value,N=t([]),k=Math.max(0,u.findIndex(e=>e.value===c)),D=u[k],j=D?.value===h,A=t(null);/* @__PURE__ */
|
|
2
|
+
return i(e,{className:v,disabled:f,triggerLabel:D?b.button(d,w(D)):d,"aria-label":d,initialFocus:A,panelClassName:"!p-2",trigger:/* @__PURE__ */o("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */i("span",j||!D?{className:"text-sm",children:D?w(D):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:D.icon}),
|
|
3
3
|
/* @__PURE__ */i(n,{name:"chevron-down",className:"h-4 w-4"})]}),children:({close:e})=>/* @__PURE__ */i("div",{role:"listbox","aria-label":d,className:"grid gap-1",style:{gridTemplateColumns:`repeat(${p}, 2rem)`},children:u.map((n,l)=>{const t=n.value===c;/* @__PURE__ */
|
|
4
|
-
return i(a,{content:w(n),children:/* @__PURE__ */i(r,{ref:e=>{N.current[l]=e,l===k&&(
|
|
4
|
+
return i(a,{content:w(n),children:/* @__PURE__ */i(r,{ref:e=>{N.current[l]=e,l===k&&(A.current=e)},role:"option","aria-selected":t,"aria-label":w(n),pressed:t,tabIndex:l===k?0:-1,onKeyDown:e=>((e,r)=>{const n=s[r.key];if(!n)return;r.preventDefault();const a=Math.floor(e/p)+n[0],l=e%p+n[1];if(a<0||l<0||l>=p)return;const t=a*p+l;if(!(t>=u.length)){for(const[e,r]of N.current.entries())r?.setAttribute("tabindex",e===t?"0":"-1");N.current[t]?.focus()}})(l,e),onClick:()=>{m(n.value),e()},children:/* @__PURE__ */i("span",{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})})},n.value)})})})}export{c as IconPicker};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-WZ5QSSUM.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:S=[4,22],className:U,emptyLabel:D}){const L=m().charts,Q=h(),W=z??(e=>f(e,Q)),B=$??(e=>f(e,Q)),P=D??L.noObservations,C=u(null),E=n(C),O=v??E,V=p(),[Z,F]=d(null);x(()=>{if(null!==Z)return c(e=>"Escape"===e.key&&(F(null),!0))},[Z]);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),T=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,X=J.reduce((e,t)=>e+t.points.length,0)-T.reduce((e,t)=>e+t.points.length,0);if(0===T.length)/* @__PURE__ */
|
|
2
|
+
return y("div",{className:U,ref:C,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:P})});const G=T.flatMap(e=>e.points),H=G.some(e=>null!=e.size),K=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(G.map(e=>e.y),w,R,{from:k-q,to:K}),ie=t(te.ticks(5).map(B),_),le=Math.max(ie+1,O-Y),re=ee(G.map(e=>e.x),j,N,{from:ie,to:le}),oe=i([0,Math.max(...G.map(e=>e.size??1))],{from:S[0],to:S[1]}),ne=Z?T[Z.s]:void 0,ae=Z&&ne?ne.points[Z.i]:void 0,se=T.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
|
|
3
|
+
return g("div",{className:`relative ${U??""}`,ref:C,children:[
|
|
4
|
+
/* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${O} ${k}`,role:"img","aria-label":L.scatter(T.map(e=>e.label),A??L.yAxis,M??L.xAxis)+(X>0?`. ${L.outsideRange(X)}`:""),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=Z?se.findIndex(e=>e.s===Z.s&&e.i===Z.i):0;F(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
|
|
5
|
+
/* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:V,children:/* @__PURE__ */y("rect",{x:ie-S[1],y:K-S[1],width:le-ie+2*S[1],height:k-q-K+2*S[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:B(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:W(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(#${V})`,children:T.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:H?oe(l.size??0):S[0]+1,fill:i,fillOpacity:Z&&Z.s!==t?.25:.62,stroke:a.surface,strokeWidth:2,onMouseEnter:()=>F({s:t,i:r})},`${e.key}-${r}`))})})]}),Z&&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??L.xAxis,color:s(ne.slot,3,ne.color,ne.tone),value:W(ae.x)},{key:"y",label:A??L.yAxis,color:s(ne.slot,3,ne.color,ne.tone),value:B(ae.y)},...null!=ae.size?[{key:"size",label:L.size,color:a.muted,value:f(ae.size,Q)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
|
|
@@ -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{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.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);c(()=>{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 u(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}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-OUIE2N2Z.js";import{Avatar as t}from"./chunk-AFYLVV74.js";import{ItemCount as r}from"./chunk-HS2E7DVI.js";import{Button_default as a}from"./chunk-HXNMRJQ4.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
|
|
2
2
|
return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */n("div",{className:"flex h-full flex-col p-2",children:[
|
|
3
3
|
/* @__PURE__ */l(a,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,t)=>/* @__PURE__ */n("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
4
4
|
/* @__PURE__ */l("span",{children:e.label}),null!=e.count&&/* @__PURE__ */l(r,{count:e.count,active:0===t})]},e.id))]}),children:/* @__PURE__ */n("div",{className:"flex h-full",children:[
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{swallowPress as e,describedByWith as r,OffWithReason as i}from"./chunk-
|
|
1
|
+
import{swallowPress as e,describedByWith as r,OffWithReason as i}from"./chunk-SQCUN2DX.js";import{Tooltip as o}from"./chunk-Q3IR5SKD.js";import{useId as a,useRef as n}from"react";import{jsx as t}from"react/jsx-runtime";var l={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function s({label:s,value:d,points:c,onChange:u,disabled:b=!1,disabledReason:v,id:f,className:g=""}){const h=a(),m=n([]),p=c.findIndex(e=>e.value===d),x=c.findIndex(e=>!b&&!0!==e.disabled),w=p>=0?p:Math.max(0,x);/* @__PURE__ */
|
|
2
2
|
return t("div",{id:f,role:"radiogroup","aria-label":s,className:`grid w-max grid-cols-3 gap-px overflow-hidden rounded-(--radius-control) border border-line bg-gray-200 ${g}`.trim(),children:c.map((a,n)=>{const s=d===a.value,f=b||!0===a.disabled,g=f&&(!0===a.disabled&&a.title||(b?v:void 0))||void 0,p=`${h}-${n}`,x=/* @__PURE__ */t("button",{type:"button",role:"radio","aria-checked":s,"aria-label":a.label,"aria-disabled":f||void 0,"aria-describedby":r(void 0,g?p:void 0),ref:e=>{m.current[n]=e},tabIndex:n===w?0:-1,onKeyDown:e=>((e,r)=>{const i=l[r.key];if(!i)return;r.preventDefault();const o=Math.floor(e/3)+i[0],a=e%3+i[1];if(o<0||a<0||a>=3)return;const n=3*o+a;if(n>=c.length)return;m.current[n]?.focus();const t=c[n];b||!0===t.disabled||t.value===d||u(t.value)})(n,e),onClick:f?e:()=>u(a.value),className:"group relative flex size-(--control-height-lg) items-center justify-center transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring)] aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(s?"bg-accent-tint hover:bg-blue-100":"bg-surface hover:bg-row-hover"),children:a.icon?/* @__PURE__ */t("span",{"data-icon-slot":"","aria-hidden":"true",className:"inline-flex items-center justify-center [&_svg]:h-4 [&_svg]:w-4 "+(s?"text-blue-700":"text-ink-faint group-hover:text-gray-700"),children:a.icon}):/* @__PURE__ */t("span",{"data-dot":"","aria-hidden":"true",className:s?"size-3 rounded-sm bg-accent-fill":"size-1 rounded-full bg-[color:var(--ink-faintest)] transition-colors group-hover:bg-[color:var(--ink-faint)]"})},a.value);return g?/* @__PURE__ */t(i,{reason:g,id:p,block:!0,children:x},a.value):/* @__PURE__ */t(o,{content:a.title??a.label,className:"relative flex",children:x},a.value)})})}export{s as AlignmentGrid};
|
|
@@ -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-HXNMRJQ4.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,2 +1,2 @@
|
|
|
1
|
-
import{Z_LAYERS as t}from"./chunk-62LW225J.js";import{VIEWPORT_MARGIN as e,placeMenu as r,followRect as n}from"./chunk-GLUJS42B.js";import{
|
|
2
|
-
/* @__PURE__ */l("div",{ref:J,role:"group","aria-label":g,"data-floating-bar":"",onMouseDown:t=>{const e=t.target;e?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||t.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${w}`.trim(),style:{...
|
|
1
|
+
import{Z_LAYERS as t}from"./chunk-62LW225J.js";import{VIEWPORT_MARGIN as e,placeMenu as r,followRect as n}from"./chunk-GLUJS42B.js";import{solidSurfaceStyle as o}from"./chunk-F27JJHNJ.js";import{useHydrated as i,useBrowserLayoutEffect as s}from"./chunk-D65T4H6J.js";import{useRef as c,useCallback as a,useEffect as u}from"react";import{createPortal as d}from"react-dom";import{jsx as l}from"react/jsx-runtime";var f=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function p({anchor:p,bounds:m,side:h="top",align:b="start","aria-label":g,children:x,className:w=""}){const v=i(),J=c(null),j=c(p);j.current=p;const k=c(m);k.current=m;const y=a(()=>{const t=J.current,n=j.current();if(!t||!n)return;const o=(k.current??f)(),i=t.style;i.maxWidth=`${Math.max(0,o.right-o.left-2*e)}px`;const s=r({trigger:n,menu:{width:t.offsetWidth,height:t.offsetHeight},bounds:o,align:b,side:h});i.left=`${s.left}px`,i.top=`${s.top}px`,t.dataset.side=s.side},[b,h]);s(()=>{v&&y()}),u(()=>{if(!v)return;const t=n(()=>j.current(),y),e=J.current;if(!e||"undefined"==typeof ResizeObserver)return t;const r=new ResizeObserver(()=>y());return r.observe(e),()=>{t(),r.disconnect()}},[v,y]);return v&&p()?d(
|
|
2
|
+
/* @__PURE__ */l("div",{ref:J,role:"group","aria-label":g,"data-floating-bar":"",onMouseDown:t=>{const e=t.target;e?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||t.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${w}`.trim(),style:{...o(),position:"fixed",left:0,top:0,zIndex:t.popup},children:x}),document.body):null}export{p as FloatingBar};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import{Markdown as e}from"./chunk-
|
|
1
|
+
import{Markdown as e}from"./chunk-IX7QXMNJ.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-2UO47XB4.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),M=N.trim().toLowerCase(),B=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),_=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),L=n(()=>B.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[B,M]),A=n(()=>L.flatMap(e=>e.docs),[L]),E=(w?A.find(e=>e.slug===w):void 0)??A[0]??null,Q=e=>!!M||(C[e]??e===E?.category);/* @__PURE__ */
|
|
2
2
|
return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
3
3
|
/* @__PURE__ */i("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
|
|
4
4
|
/* @__PURE__ */i("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
5
5
|
/* @__PURE__ */o("h2",{className:"text-sm font-semibold text-gray-900",children:y.help.title}),u&&g&&/* @__PURE__ */o("button",{type:"button",onClick:g,className:"text-xs text-blue-600 hover:underline",children:y.help.newArticle})]}),
|
|
6
6
|
/* @__PURE__ */o("div",{className:"px-3 py-2 border-b border-line-subtle shrink-0",children:/* @__PURE__ */i("div",{className:"relative",children:[
|
|
7
7
|
/* @__PURE__ */o(l,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
|
|
8
|
-
/* @__PURE__ */o("input",{type:"text",value:
|
|
9
|
-
/* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===L.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):L.map(e=>{const t=
|
|
8
|
+
/* @__PURE__ */o("input",{type:"text",value:N,onChange:e=>v(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
|
|
9
|
+
/* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===L.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):L.map(e=>{const t=Q(e.key);/* @__PURE__ */
|
|
10
10
|
return i("div",{className:"py-0.5",children:[
|
|
11
|
-
/* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!
|
|
11
|
+
/* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!Q(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
|
|
12
12
|
/* @__PURE__ */o(d,{open:t}),
|
|
13
|
-
/* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=
|
|
13
|
+
/* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=E?.slug===e.slug;/* @__PURE__ */
|
|
14
14
|
return i("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
|
|
15
15
|
/* @__PURE__ */o("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */o("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:y.help.draft})]},e.slug)})]},e.key)})})]}),
|
|
16
|
-
/* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:
|
|
16
|
+
/* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:E?/* @__PURE__ */i(c,{children:[
|
|
17
17
|
/* @__PURE__ */i("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
18
18
|
/* @__PURE__ */i("div",{className:"min-w-0",children:[
|
|
19
|
-
/* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:
|
|
20
|
-
/* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[
|
|
21
|
-
/* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(
|
|
19
|
+
/* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:E.title}),
|
|
20
|
+
/* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[E.category_label,!1===E.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(E),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
|
|
21
|
+
/* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(E):E.body?/* @__PURE__ */o(e,{children:E.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{IconButton_default as e}from"./chunk-
|
|
1
|
+
import{IconButton_default as e}from"./chunk-FX6DBXXD.js";import{CloseGlyph as t}from"./chunk-UG6RI525.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-JTMEFXRL.js";import{Button_default as s}from"./chunk-HXNMRJQ4.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{useShellStrings as c}from"./chunk-GDQJBQ5B.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
2
2
|
return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
3
3
|
return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
|
|
4
4
|
return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
|
|
@@ -6,7 +6,7 @@ return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,childre
|
|
|
6
6
|
return u("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-line bg-surface-sunken py-1 pl-2 pr-1 text-xs text-ink",children:[c?/* @__PURE__ */d("img",{src:c,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */d("span",{className:"text-gray-400",children:/* @__PURE__ */d(p,{})}),
|
|
7
7
|
/* @__PURE__ */d("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
|
|
8
8
|
/* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:n(e.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(e.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */d(t,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${s}`)})})}function b({onClick:t,count:n=0,variant:r="button",label:a,disabled:i=!1}){const l=c().files,o=a??l.attach,p=n>0?`${o} (${n})`:o;return"icon"===r?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
|
|
9
|
-
/* @__PURE__ */d(e,{"aria-label":p,onClick:t,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:t,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:v}){const L=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),
|
|
9
|
+
/* @__PURE__ */d(e,{"aria-label":p,onClick:t,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:t,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:v}){const L=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),R=l([]);return o(()=>{j&&L.rejections.length>0&&L.rejections!==R.current&&(R.current=L.rejections,j(L.rejections))},[L.rejections,j]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:N,children:[v,
|
|
10
10
|
/* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{L.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
|
|
11
11
|
/* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
|
|
12
12
|
/* @__PURE__ */d(b,{onClick:L.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-JH4ZCPHW.js";import{toDateKey as t,fromDateKey as r,toMonthKey as n}from"./chunk-2HMNOLKX.js";import{FILTER_ON as a,FILTER_ON_INK as o,FILTER_OFF as i}from"./chunk-AYZY3YNC.js";import{calendarNames as l}from"./chunk-Y3JW2GW5.js";import{pad2 as s}from"./chunk-LF27WIN2.js";import{buttonClasses as c}from"./chunk-UQYNPYF4.js";import{Icon as d}from"./chunk-2UO47XB4.js";import{onOverlayOpen as m}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{useDropdownPosition as h}from"./chunk-GLUJS42B.js";import{
|
|
1
|
+
import{Calendar as e}from"./chunk-JH4ZCPHW.js";import{toDateKey as t,fromDateKey as r,toMonthKey as n}from"./chunk-2HMNOLKX.js";import{FILTER_ON as a,FILTER_ON_INK as o,FILTER_OFF as i}from"./chunk-AYZY3YNC.js";import{calendarNames as l}from"./chunk-Y3JW2GW5.js";import{pad2 as s}from"./chunk-LF27WIN2.js";import{buttonClasses as c}from"./chunk-UQYNPYF4.js";import{Icon as d}from"./chunk-2UO47XB4.js";import{onOverlayOpen as m}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{useDropdownPosition as h}from"./chunk-GLUJS42B.js";import{glassStyle as p}from"./chunk-F27JJHNJ.js";import{useBrowserLayoutEffect as f}from"./chunk-D65T4H6J.js";import{useShellStrings as g,useShellLocale as b}from"./chunk-GDQJBQ5B.js";import{useState as x,useRef as v,useId as y,useEffect as w}from"react";import{createPortal as N}from"react-dom";import{jsxs as k,Fragment as C,jsx as M}from"react/jsx-runtime";var W=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],j=t;function D(e,r){const n=r.getFullYear(),a=r.getMonth(),o=new Date(n,a,r.getDate()),i=new Date(n,a,0),l=e=>new Date(n,a-e,1);switch(e){case"last2Weeks":return{from:t(new Date(n,a,r.getDate()-14)),to:t(o)};case"lastMonth":return{from:t(l(1)),to:t(i)};case"last3Months":return{from:t(l(3)),to:t(i)};case"last6Months":return{from:t(l(6)),to:t(i)};case"last12Months":return{from:t(l(12)),to:t(i)}}}function $(e,t,r){const a=n(e);return t&&a<t.slice(0,7)?t.slice(0,7):r&&a>r.slice(0,7)?r.slice(0,7):a}function F(e){const t=r(e);return t?`${s(t.getDate())}/${s(t.getMonth()+1)}/${t.getFullYear()}`:e}var Y=/* @__PURE__ */new Map;function H({from:t,to:n,onChange:s,formatDisplay:j,clearable:H,required:J=!1,name:O,id:S,"aria-labelledby":B,"aria-label":L,weekStartsOn:G,placeholder:T,fullWidth:U=!1,min:E,max:R,disabled:q=!1,allowOpenEnd:A=!1}){const I=g().dateRange,P=b(),Q=j??(P?function(e){let t=Y.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Y.set(e,t));const n=t;return e=>{const t=r(e);return t?n.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(P):F),Z=T??I.placeholder,X=H??!J,[z,K]=x(!1),[V,_]=x(t),[ee,te]=x(n),[re,ne]=x(null),[ae,oe]=x("from"),ie=v(null),le=v(null),se=v(null),ce=y(),de=y(),me=y(),[ue,he]=x(!1),pe=h(ie,z,{preferredMaxWidth:520,preferredMaxHeight:ue?720:560,popupRef:se}),fe=v(null),ge=v(null),[be,xe]=x(!0);f(()=>{const e=ge.current;if(!z||!ue||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==be&&xe(a)});const ve=v(null);f(()=>{const e=se.current;if(!z||!pe||!e)return;const t=getComputedStyle(e),r=pe.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(ue)null!==ve.current&&ve.current<=r&&he(!1);else{const e=fe.current?.offsetWidth??0;if(0===e)return;ve.current=e,e>r+.5&&he(!0)}});const[ye,we]=x(!1);f(()=>{const e=!!S&&(le.current?.labels?.length??0)>0;e!==ye&&we(e)});const Ne=!!L||!!B||ye,ke=/* @__PURE__ */new Date,[Ce,Me]=x(()=>t?t.slice(0,7):$(ke,E,R)),We=W.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(D(e,ke),E,R)),je=e=>e?Q(e):"";w(()=>{if(!z)return;const e=e=>{const t=e.target;ie.current?.contains(t)||se.current?.contains(t)||K(!1)};document.addEventListener("mousedown",e);const t=m(()=>K(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[z]),w(()=>{q&&K(!1)},[q]);const De=()=>{s("",""),K(!1)},$e=t&&n?`${je(t)} — ${je(n)}`:t?I.fromOnly(je(t)):n?I.toOnly(je(n)):"",Fe=l(P),Ye=e=>{const t=r(e);return t?Fe.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},He=t&&n?I.range(Ye(t),Ye(n)):t?I.fromOnly(Ye(t)):n?I.toOnly(Ye(n)):Z,Je=e=>ue?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(re===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(re===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Oe=/* @__PURE__ */k(C,{children:[We.map(e=>/* @__PURE__ */M("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=D(e,ke);_(t.from),te(t.to),ne(e),Me(t.from.slice(0,7))})(e),className:Je(e),"aria-label":ue?I[e]:void 0,children:ue?be?I[e]:I[`${e}Short`]:I[e]},e)),
|
|
2
2
|
/* @__PURE__ */M("button",{type:"button",onClick:()=>ne("Custom"),className:Je("Custom"),children:I.custom})]}),Se=(e,t)=>A?/* @__PURE__ */M("button",{type:"button","data-range-end":e,"aria-pressed":ae===e,onClick:()=>oe(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */M("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Be=e=>A&&ae===e?" ring-1 ring-blue-400":"",Le=
|
|
3
3
|
/* @__PURE__ */M(e,{mode:"range",min:E,max:R,value:V||null,endValue:ee||null,month:Ce,onMonthChange:Me,onSelect:e=>{ne("Custom"),A?"from"===ae?(ee&&e>ee?(_(ee),te(e)):_(e),oe("to")):V&&e<V?(te(V),_(e)):te(e):!V||V&&ee?(_(e),te("")):e<V?(te(V),_(e)):te(e)},weekStartsOn:G,"aria-label":I.dialog});/* @__PURE__ */
|
|
4
4
|
return k("div",{className:"relative"+(U?" w-full":""),ref:ie,children:[
|
|
@@ -8,7 +8,7 @@ return k("div",{className:"relative"+(U?" w-full":""),ref:ie,children:[
|
|
|
8
8
|
/* @__PURE__ */M("span",{className:"truncate",children:$e||Z})]}),X&&!q&&(t||n)&&/* @__PURE__ */M("button",{type:"button",onClick:De,"aria-label":I.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Ne&&/* @__PURE__ */M("span",{id:de,className:"sr-only",children:He}),J&&/* @__PURE__ */M("span",{id:me,className:"sr-only",children:I.required}),O&&/* @__PURE__ */k(C,{children:[
|
|
9
9
|
/* @__PURE__ */M("input",{type:"hidden",name:O.from,value:t,disabled:q||void 0}),
|
|
10
10
|
/* @__PURE__ */M("input",{type:"hidden",name:O.to,value:n,disabled:q||void 0})]}),z&&N(
|
|
11
|
-
/* @__PURE__ */k("div",{ref:se,id:ce,role:"dialog","aria-label":I.dialog,"data-layout":ue?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:u.popup,left:pe?.left,right:pe?.right,top:pe?.top,bottom:pe?.bottom,width:ue&&pe?pe.maxWidth:"max-content",maxWidth:pe?.maxWidth,maxHeight:pe?.maxHeight,overflowY:"auto",visibility:pe?void 0:"hidden",...
|
|
11
|
+
/* @__PURE__ */k("div",{ref:se,id:ce,role:"dialog","aria-label":I.dialog,"data-layout":ue?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:u.popup,left:pe?.left,right:pe?.right,top:pe?.top,bottom:pe?.bottom,width:ue&&pe?pe.maxWidth:"max-content",maxWidth:pe?.maxWidth,maxHeight:pe?.maxHeight,overflowY:"auto",visibility:pe?void 0:"hidden",...p()},children:[
|
|
12
12
|
/* @__PURE__ */k("div",{className:ue?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Se("from",/* @__PURE__ */k(C,{children:[
|
|
13
13
|
/* @__PURE__ */M("span",{className:"text-xs font-medium text-gray-500",children:I.from}),
|
|
14
14
|
/* @__PURE__ */M("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${V?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Be("from")}`,children:V?je(V):I.start})]})),!ue&&/* @__PURE__ */M("span",{className:"text-gray-300",children:"—"}),Se("to",/* @__PURE__ */k(C,{children:[
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-ZMRGHVKS.js";import{bumpPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as n}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-WZ5QSSUM.js";import{usePlotWidth as l}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as s}from"./chunk-GDQJBQ5B.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as m}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function f({nodes:f,links:k,height:p=320,width:x,nodeWidth:g=14,nodePadding:y=12,formatValue:v,className:M,emptyLabel:w}){const b=i().charts,j=s(),$=v??(e=>h(e,j)),N=w??b.noFlows,C=c(null),E=l(C),F=x??E,[Q,S]=m(null),{highlighted:A}=n();if(0===f.length||0===k.length)/* @__PURE__ */
|
|
2
|
+
return d("div",{className:M,ref:C,children:/* @__PURE__ */d("p",{className:"py-8 text-center text-sm text-gray-500",children:N})});const U=[...new Set(f.map(e=>e.depth))].sort((e,t)=>e-t),Z=e=>U.length<=1?0:U.indexOf(e)/(U.length-1)*(F-g-140)+70,z=new Map(f.map(e=>{const t=k.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=k.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(t,n,e.value??0)]})),B=/* @__PURE__ */new Map;for(const e of f)B.set(e.depth,[...B.get(e.depth)??[],e]);const H=Math.max(...[...B.values()].map(e=>e.reduce((e,t)=>e+(z.get(t.key)??0),0))),O=p-20,R=H>0?(O-y*(Math.max(...[...B.values()].map(e=>e.length))-1))/H:0,V=/* @__PURE__ */new Map;for(const[e,t]of B){const n=t.map(e=>Math.max(2,(z.get(e.key)??0)*R)),o=n.reduce((e,t)=>e+t,0)+y*(t.length-1),l=n.reduce((e,t)=>e+Math.max(0,t-2),0),r=o>O&&l>0?Math.max(0,1-(o-O)/l):1;let a=10;t.forEach((t,o)=>{const l=2+Math.max(0,n[o]-2)*r;V.set(t.key,{x:Z(e),y:a,h:l,index:o}),a+=l+y})}const W=/* @__PURE__ */new Map,G=/* @__PURE__ */new Map,L=/* @__PURE__ */new Map,P=(e,t)=>e.from===t||e.to===t,T="link"===Q?.kind?k[Q.index]:void 0,Y="node"===Q?.kind?f.find(e=>e.key===Q.key):void 0;/* @__PURE__ */
|
|
3
|
+
return u("div",{className:`relative ${M??""}`,ref:C,children:[
|
|
4
|
+
/* @__PURE__ */u("svg",{width:"100%",height:p,viewBox:`0 0 ${F} ${p}`,role:"img","aria-label":b.sankey(f.length,k.length),onMouseLeave:()=>S(null),children:[k.map((e,n)=>{const o=V.get(e.from),l=V.get(e.to);if(!o||!l)return null;const a=Math.max(1,e.value*R),i=o.y+(W.get(e.from)??0)+a/2,s=l.y+(G.get(e.to)??0)+a/2;W.set(e.from,(W.get(e.from)??0)+a),G.set(e.to,(G.get(e.to)??0)+a);const h=o.x+g,c=l.x,m=r(o.index,e.color),u=`${e.from}→${e.to}`,f=L.get(u)??0;L.set(u,f+1);const k=((e,t)=>Q?"link"===Q.kind?Q.index===t:P(e,Q.key):null!==A?P(e,A):null)(e,n);/* @__PURE__ */
|
|
5
|
+
return d("path",{d:t([[h,i],[c,s]]),fill:"none",stroke:m,strokeWidth:a,strokeOpacity:null===k||k?.42:.12,onMouseEnter:()=>S({kind:"link",index:n})},f?`${u}#${f}`:u)}),f.map(e=>{const t=V.get(e.key);if(!t)return null;const n=t.x>F/2,o=(l=e.key,Q?"node"===Q.kind?Q.key===l:P(k[Q.index],l):null!==A?A===l:null);var l;/* @__PURE__ */
|
|
6
|
+
return u("g",{opacity:null===o||o?1:.45,onMouseEnter:()=>S({kind:"node",key:e.key}),children:[
|
|
7
|
+
/* @__PURE__ */d("rect",{x:t.x,y:t.y,width:g,height:t.h,rx:2,fill:r(t.index,e.color,e.tone)}),
|
|
8
|
+
/* @__PURE__ */d("text",{x:n?t.x-8:t.x+g+8,y:t.y+t.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:a.label,children:e.label})]},e.key)})]}),T&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:`${T.from} → ${T.to}`,rows:[{key:"value",label:b.flow,color:r(V.get(T.from)?.index??0,T.color),value:$(T.value)}]})}),Y&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:Y.label,rows:[{key:"value",label:b.throughput,color:r(V.get(Y.key)?.index??0,Y.color,Y.tone),value:$(z.get(Y.key)??0)}]})}),
|
|
9
|
+
/* @__PURE__ */d(e,{caption:b.sankey(f.length,k.length),head:[b.tableFrom,b.tableTo,b.value],rows:k.map(e=>[e.from,e.to,$(e.value)])})]})}export{f as SankeyChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{formatMoney as e}from"./chunk-GEYM4WN3.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-
|
|
1
|
+
import{formatMoney as e}from"./chunk-GEYM4WN3.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-4Q25UHWB.js";import{ChartFrame as a}from"./chunk-VAK5FQXH.js";import{ColumnChart as l}from"./chunk-4D66DUU5.js";import{TH_ONE_LINE as s}from"./chunk-S5SRXI4V.js";import{jsxs as o,jsx as i}from"react/jsx-runtime";function n({spec:n,height:c=200,width:m,animate:d=!0,className:h}){const u=function(r){if(r.currency)return t=>e(t,r.currency);const t=r.unit?` ${r.unit}`:"";return e=>`${e.toLocaleString("en-US",{maximumFractionDigits:2})}${t}`}(n),p=n.currency?r=>e(r,n.currency,{whole:!0}):u,b=n.series.map((e,r)=>({key:`s${r}`,label:e.name,data:e.values})),y=n.title??n.series.map(e=>e.name).join(", "),f=/* @__PURE__ */o("table",{className:"w-full border-collapse text-sm",children:[
|
|
2
2
|
/* @__PURE__ */i("thead",{children:/* @__PURE__ */o("tr",{children:[
|
|
3
3
|
/* @__PURE__ */i("td",{className:"border-b border-gray-200"}),n.series.map((e,r)=>/* @__PURE__ */i("th",{scope:"col",className:`${s} border-b border-gray-200 px-2 py-1 text-right font-semibold text-gray-700`,children:e.name},r))]})}),
|
|
4
4
|
/* @__PURE__ */i("tbody",{children:n.x.map((e,t)=>/* @__PURE__ */o("tr",{children:[
|