efficient-shell 10.14.0 → 10.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -6
- package/dist/{Browser-LAMGXJI6.js → Browser-RI5X7GMK.js} +11 -11
- package/dist/Calculator-Y566OMJZ.js +29 -0
- package/dist/{CurrencyConverter-577XB7A3.js → CurrencyConverter-2GUEE7ZR.js} +6 -6
- package/dist/{Documents-DW7I624C.js → Documents-GI346UL5.js} +8 -8
- package/dist/{Files-VLSMINW5.js → Files-UA23KXN7.js} +51 -51
- package/dist/{Notepad-54H6KCGS.js → Notepad-HRZKLHO3.js} +10 -10
- package/dist/PdfViewer-LU5JKHSG.js +1 -0
- package/dist/{PomodoroTimer-CXJVY7U3.js → PomodoroTimer-QYCTTTPZ.js} +63 -63
- package/dist/{Preview-OWMTJFTO.js → Preview-LSGN5GN7.js} +23 -23
- package/dist/Sidebar-2P26444H.js +44 -0
- package/dist/{Spreadsheet-HWNS4TSX.js → Spreadsheet-7JBZY6KJ.js} +13 -13
- package/dist/{Stock-M4TDRNCI.js → Stock-ZVQT25IE.js} +3 -3
- package/dist/{Weather-K634BVDX.js → Weather-RAUDLLVU.js} +19 -19
- package/dist/{WorldClock-56CYOGR2.js → WorldClock-2XBWZ6SZ.js} +6 -6
- package/dist/ai/index.d.ts +77 -2
- package/dist/ai/index.js +80 -60
- package/dist/ai.css +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/chunk-26LO7XCK.js +2 -0
- package/dist/{chunk-ALWVHNUO.js → chunk-2JG5JU4M.js} +4 -4
- package/dist/{chunk-QPJQJRHZ.js → chunk-2SY76NFO.js} +4 -4
- package/dist/{chunk-KKSVRIMP.js → chunk-2UO47XB4.js} +8 -3
- package/dist/{chunk-2K2W6VIR.js → chunk-2VGQS6CW.js} +1 -1
- package/dist/{chunk-O4V5PEA3.js → chunk-3AH524CN.js} +1 -1
- package/dist/{chunk-OZBM2XFQ.js → chunk-3EJ64VKE.js} +1 -1
- package/dist/{chunk-AZ3AR7U7.js → chunk-3LDXURVU.js} +2 -2
- package/dist/{chunk-CAVADOJK.js → chunk-4G2C6J4I.js} +1 -1
- package/dist/{chunk-KZX25YEW.js → chunk-4QJOEHM6.js} +11 -11
- package/dist/{chunk-DDCMMOB4.js → chunk-4UKGVLFP.js} +1 -1
- package/dist/{chunk-37U326EL.js → chunk-4WEFGKJL.js} +9 -9
- package/dist/{chunk-JGFY54A4.js → chunk-57HN6MPC.js} +2 -2
- package/dist/{chunk-QNK2I4IH.js → chunk-5UYZ75F3.js} +9 -9
- package/dist/{chunk-ZZOBG6GP.js → chunk-6AS5PHHK.js} +17 -17
- package/dist/chunk-6C6TRDNI.js +1 -0
- package/dist/{chunk-CGQAKGPT.js → chunk-74OUAR6L.js} +6 -6
- package/dist/chunk-7HLC352T.js +23 -0
- package/dist/{chunk-UNRPRMQO.js → chunk-7HTRLRVO.js} +63 -63
- package/dist/{chunk-KOBYM5JV.js → chunk-7MSC3Z5H.js} +12 -12
- package/dist/{chunk-EDKRGYZX.js → chunk-7NBSBGLX.js} +8 -8
- package/dist/{chunk-PXQG5EIH.js → chunk-7TNAOZZ2.js} +1 -1
- package/dist/{chunk-ORIGX2H5.js → chunk-7UTPXU6K.js} +1 -1
- package/dist/chunk-7XYTJPWW.js +29 -0
- package/dist/{chunk-SCPCZCYQ.js → chunk-7ZP64SC7.js} +1 -1
- package/dist/{chunk-C2L33LDZ.js → chunk-AJO72CPB.js} +2 -2
- package/dist/chunk-ALDGSODF.js +2 -0
- package/dist/{chunk-H64JJSXC.js → chunk-AOK3BHRT.js} +4 -4
- package/dist/{chunk-67JCJ2MG.js → chunk-B7UCXROE.js} +1 -1
- package/dist/{chunk-SWN3LSQX.js → chunk-BNJWZAQE.js} +11 -11
- package/dist/{chunk-RQSVBXBV.js → chunk-CBEKJTXU.js} +5 -5
- package/dist/{chunk-PBWUEBJ5.js → chunk-CQV3VSI2.js} +1 -1
- package/dist/{chunk-XNKIDGZW.js → chunk-CRILBBSU.js} +1 -1
- package/dist/{chunk-YJLLLO5R.js → chunk-D4I3U7UE.js} +1 -1
- package/dist/chunk-DESWIPOZ.js +3 -0
- package/dist/{chunk-MXH3UPCH.js → chunk-DWR7MYQU.js} +5 -5
- package/dist/{chunk-EYZZW6SO.js → chunk-E3753CWP.js} +1 -1
- package/dist/{chunk-XAROKI7X.js → chunk-E5QPXEKN.js} +2 -2
- package/dist/{chunk-URERZUX5.js → chunk-EXJXOKUU.js} +1 -1
- package/dist/{chunk-RBQWIHYD.js → chunk-F2R3UFNQ.js} +1 -1
- package/dist/{chunk-A4HJDSRA.js → chunk-FEQDZTZ7.js} +6 -6
- package/dist/{chunk-M3OYHYIS.js → chunk-FWVC4A2O.js} +1 -1
- package/dist/{chunk-LTKXAHS3.js → chunk-GPJO34QP.js} +7 -7
- package/dist/{chunk-LOFYSLC7.js → chunk-H32EQG5Z.js} +9 -9
- package/dist/chunk-JEH5EVIG.js +1 -0
- package/dist/{chunk-MBXLROCD.js → chunk-JGTGQGHY.js} +1 -1
- package/dist/{chunk-YGSU5KCP.js → chunk-JJW43QPS.js} +5 -5
- package/dist/{chunk-KUMEDH5M.js → chunk-K4ANB6AF.js} +1 -1
- package/dist/{chunk-7PUVPDUZ.js → chunk-KTA77U3P.js} +4 -4
- package/dist/{chunk-L3QNKCXH.js → chunk-KTVXPGGB.js} +10 -10
- package/dist/{chunk-JRZ7PPVJ.js → chunk-L4IW77TD.js} +4 -4
- package/dist/{chunk-QODTON7V.js → chunk-LJN77RG6.js} +1 -1
- package/dist/{chunk-SOECV4V5.js → chunk-LO5T2K4B.js} +3 -3
- package/dist/{chunk-63L5ORRZ.js → chunk-LPXMHYTM.js} +1 -1
- package/dist/chunk-LU6NA4RU.js +5 -0
- package/dist/chunk-M4K6FLIY.js +1 -0
- package/dist/{chunk-AGG4RFXR.js → chunk-MHB52H2Y.js} +13 -13
- package/dist/{chunk-2VTO64YC.js → chunk-MNSKGMVZ.js} +9 -9
- package/dist/chunk-MNZ7MGAT.js +2 -0
- package/dist/{chunk-JBOMPD3V.js → chunk-MTEFYFUO.js} +1 -1
- package/dist/{chunk-C2P2Z6HU.js → chunk-NBVHJZVS.js} +14 -14
- package/dist/{chunk-3RORPK2J.js → chunk-PCFBDXLN.js} +1 -1
- package/dist/{chunk-7YZ5TUXE.js → chunk-PJQGYKN6.js} +6 -6
- package/dist/chunk-PN5FQVMB.js +7 -0
- package/dist/{chunk-ZNAVCHBV.js → chunk-PVZGSCCB.js} +6 -6
- package/dist/{chunk-FFIQPFUR.js → chunk-PYAJCN2Q.js} +1 -1
- package/dist/chunk-Q6YNMNUH.js +6 -0
- package/dist/{chunk-6U6WVU5F.js → chunk-QDQ347RL.js} +1 -1
- package/dist/{chunk-SMUH7NAN.js → chunk-QYSEYYV7.js} +1 -1
- package/dist/{chunk-P5YFQ4IQ.js → chunk-RDYFZHT3.js} +1 -1
- package/dist/{chunk-3BYLHJLC.js → chunk-RLJHRDDW.js} +8 -8
- package/dist/{chunk-FZO6H3ZB.js → chunk-RPYFOQM2.js} +5 -5
- package/dist/chunk-RRUHQLUY.js +14 -0
- package/dist/{chunk-NSLQ3UYJ.js → chunk-S6FBMSFU.js} +2 -2
- package/dist/{chunk-KP2THXEI.js → chunk-SG4LO2AN.js} +5 -5
- package/dist/{chunk-VZ4PBHFN.js → chunk-SHKBDFSE.js} +1 -1
- package/dist/{chunk-BS7IPLRR.js → chunk-TM33D3CE.js} +1 -1
- package/dist/{chunk-MUMQ6PW7.js → chunk-U2RFKQVA.js} +1 -1
- package/dist/{chunk-XBB6LSSB.js → chunk-UBMY23AG.js} +5 -5
- package/dist/{chunk-F5FNYNHF.js → chunk-UDRMZ22J.js} +1 -1
- package/dist/{chunk-UWK5Q3R4.js → chunk-VNACNNCJ.js} +17 -17
- package/dist/{chunk-MKQZINBW.js → chunk-VTFZ6W2D.js} +2 -2
- package/dist/{chunk-LKTBKVN6.js → chunk-W35N7SL3.js} +4 -4
- package/dist/{chunk-W6SC3ZNO.js → chunk-W3OWPBQL.js} +2 -2
- package/dist/chunk-W4OBVKN4.js +1 -0
- package/dist/{chunk-F6JDUMM7.js → chunk-WB4P4QE2.js} +1 -1
- package/dist/{chunk-E3HSZQFI.js → chunk-WMEYNKXZ.js} +16 -16
- package/dist/{chunk-SO6X4CII.js → chunk-X6BFVDB4.js} +2 -2
- package/dist/{chunk-CHBRMAJV.js → chunk-XDBG4HPV.js} +1 -1
- package/dist/{chunk-7YOQS3C6.js → chunk-XTCXX5LJ.js} +1 -1
- package/dist/{chunk-GBCH3UHD.js → chunk-XZGGJHJC.js} +17 -17
- package/dist/{chunk-YWDEFPSW.js → chunk-YOSUCCHG.js} +1 -1
- package/dist/{chunk-GSKLHUQ6.js → chunk-ZW3IDCP2.js} +1 -1
- package/dist/{chunk-JAKOZNZK.js → chunk-ZZVE64OI.js} +2 -2
- package/dist/data/ListLoadError.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Select.d.ts +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.d.ts +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/textAlign.d.ts +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/icons/efficient-glyphs.d.ts +1 -0
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.d.ts +2 -0
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +1 -0
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.d.ts +1 -0
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/glyphs/EnterIcon.d.ts +8 -0
- package/dist/icons/glyphs/EnterIcon.js +1 -0
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/EnterMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EnterMiniIcon.js +1 -0
- package/dist/icons/looks/EnterSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EnterSolidIcon.js +1 -0
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +135 -135
- package/dist/map/index.js +3 -3
- package/dist/markdown/index.js +1 -1
- package/dist/{names-CwzeaUf6.d.ts → names-Bmx_9y41.d.ts} +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.d.ts +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.d.ts +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/tokens/colour.d.ts +2 -2
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-ZFMTTDQ6.js +0 -29
- package/dist/PdfViewer-Z4YKDHIH.js +0 -1
- package/dist/Sidebar-7RR5WNIF.js +0 -44
- package/dist/chunk-3GL4OVBB.js +0 -1
- package/dist/chunk-47EYPWCB.js +0 -14
- package/dist/chunk-A5BV6NFA.js +0 -7
- package/dist/chunk-DWMOUDMX.js +0 -1
- package/dist/chunk-IKMWKOT5.js +0 -1
- package/dist/chunk-KZMJE24J.js +0 -5
- package/dist/chunk-QKWYCOMM.js +0 -23
- package/dist/chunk-R7APUBZB.js +0 -29
- package/dist/chunk-UBOP6HFI.js +0 -6
- package/dist/chunk-WTTSB4SV.js +0 -3
- package/dist/chunk-ZTPMMNAZ.js +0 -1
- /package/dist/{chunk-744BFBBV.js → chunk-6V6ANLHW.js} +0 -0
- /package/dist/{chunk-S2P74CBN.js → chunk-N3TOHWFF.js} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{fromDateKey as e,toMonthKey as t,toDateKey as r,fromMonthKey as a}from"./chunk-2HMNOLKX.js";import{calendarNames as n,firstDayOfWeek as o}from"./chunk-Y3JW2GW5.js";import{Icon as l}from"./chunk-
|
|
2
|
-
return m("div",{className:
|
|
1
|
+
import{fromDateKey as e,toMonthKey as t,toDateKey as r,fromMonthKey as a}from"./chunk-2HMNOLKX.js";import{calendarNames as n,firstDayOfWeek as o}from"./chunk-Y3JW2GW5.js";import{Icon as l}from"./chunk-2UO47XB4.js";import{useBrowserValue as i}from"./chunk-D65T4H6J.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-4PAWQEXM.js";import{useMemo as g,useState as u,useRef as d,useEffect as h}from"react";import{jsxs as m,jsx as f,Fragment as b}from"react/jsx-runtime";var y="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";var v=()=>r(/* @__PURE__ */new Date);var p=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),x=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),a))};function w({value:w,endValue:M,mode:D="single",onSelect:N,min:Y,max:k,month:F,defaultMonth:j,onMonthChange:A,weekStartsOn:C,quickJump:S=!0,markedDates:P,readOnly:W=!1,"aria-label":q,className:K=""}){const O=g(()=>new Set(P??[]),[P]),E=e(w),H=i(v,null),J=e(H),U=s().calendar,X=c(),$=n(X),B=i(()=>o(X),0),L=C??B,G=()=>{if(!J)return null;const e=t(J);return Y&&e<Y.slice(0,7)?Y.slice(0,7):k&&e>k.slice(0,7)?k.slice(0,7):e},[I,Q]=u(()=>j||(E?t(E):G())),R=F??I??G(),T=null===R?null:function(e,t){return a(e)??t}(R,J),[V,z]=u(()=>w??H),Z=d(null),_=d(!1),[ee,te]=u("days"),re=g(()=>T?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),a=(r.getDay()-t+7)%7,n=new Date(r.getFullYear(),r.getMonth(),1-a);return Array.from({length:42},(e,t)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))}(T,L):[],[R,L]),ae=e=>!!Y&&e<Y||!!k&&e>k,ne=V??H,oe=re.some(e=>r(e)===ne),le=T?re.find(e=>e.getMonth()===T.getMonth())??re[0]:null,ie=oe&&ne?ne:le?r(le):"";if(h(()=>{_.current&&(_.current=!1,Z.current?.querySelector('[data-active="true"]')?.focus())},[ie,R]),!T)/* @__PURE__ */
|
|
2
|
+
return m("div",{className:K,"aria-hidden":"true","data-calendar-pending":"",children:[
|
|
3
3
|
/* @__PURE__ */f("div",{className:"mb-2 h-6"}),
|
|
4
|
-
/* @__PURE__ */f("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */f("div",0===t?{className:"py-1 text-xs",children:" "}:{className:y,children:/* @__PURE__ */f("span",{className:"aspect-square"})},t))})]});const se=e=>"years"===ee?new Date(
|
|
5
|
-
return m("div",{className:
|
|
4
|
+
/* @__PURE__ */f("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */f("div",0===t?{className:"py-1 text-xs",children:" "}:{className:y,children:/* @__PURE__ */f("span",{className:"aspect-square"})},t))})]});const se=e=>"years"===ee?new Date(T.getFullYear()+12*e,T.getMonth(),1):"months"===ee?new Date(T.getFullYear()+e,T.getMonth(),1):x(T,e),ce=e=>{const r=t(e);void 0===F&&Q(r),A?.(r)},ge=q??$.monthYear(T.getFullYear(),T.getMonth());/* @__PURE__ */
|
|
5
|
+
return m("div",{className:K,children:[
|
|
6
6
|
/* @__PURE__ */m("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
7
|
-
/* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee
|
|
8
|
-
/* @__PURE__ */f("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:S?/* @__PURE__ */m(b,{children:["years"!==ee&&/* @__PURE__ */f("button",{type:"button","aria-label"
|
|
9
|
-
/* @__PURE__ */f("button",{type:"button","aria-label"
|
|
10
|
-
/* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee
|
|
11
|
-
/* @__PURE__ */m("div",{ref:Z,role:"grid","aria-label":ge,className:"space-y-1","aria-readonly":
|
|
12
|
-
/* @__PURE__ */f("div",{role:"row",className:`${y} text-center text-xs font-medium text-ink-faint`,children:Array.from({length:7},(e,t)=>(t+
|
|
13
|
-
/* @__PURE__ */f("div",{role:"columnheader","aria-label"
|
|
14
|
-
return f("div",{role:"gridcell","aria-selected":n,"aria-label":
|
|
7
|
+
/* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee?U.previousYears:"months"===ee?U.previousYear:U.previousMonth,onClick:()=>ce(se(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */f(l,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
|
|
8
|
+
/* @__PURE__ */f("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:S?/* @__PURE__ */m(b,{children:["years"!==ee&&/* @__PURE__ */f("button",{type:"button","aria-label":U.chooseMonth($.months[T.getMonth()]),onClick:()=>te(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:$.months[T.getMonth()]}),
|
|
9
|
+
/* @__PURE__ */f("button",{type:"button","aria-label":U.chooseYear(T.getFullYear()),onClick:()=>te(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:T.getFullYear()})]}):/* @__PURE__ */f("span",{children:$.monthYear(T.getFullYear(),T.getMonth())})}),
|
|
10
|
+
/* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee?U.nextYears:"months"===ee?U.nextYear:U.nextMonth,onClick:()=>ce(se(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */f(l,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===ee&&/* @__PURE__ */f("div",{role:"group","aria-label":U.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:$.monthsShort.map((e,t)=>/* @__PURE__ */f("button",{type:"button","aria-pressed":t===T.getMonth(),onClick:()=>{ce(new Date(T.getFullYear(),t,1)),te("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===T.getMonth()?"bg-blue-600 font-semibold text-white":J&&t===J.getMonth()&&T.getFullYear()===J.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===ee&&/* @__PURE__ */f("div",{role:"group","aria-label":U.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=T.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */f("button",{type:"button","aria-pressed":e===T.getFullYear(),onClick:()=>{ce(new Date(e,T.getMonth(),1)),te("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===T.getFullYear()?"bg-blue-600 font-semibold text-white":e===J?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
|
|
11
|
+
/* @__PURE__ */m("div",{ref:Z,role:"grid","aria-label":ge,className:"space-y-1","aria-readonly":W||void 0,onKeyDown:a=>{const n=e(ie)??J??T,o={ArrowLeft:()=>p(n,-1),ArrowRight:()=>p(n,1),ArrowUp:()=>p(n,-7),ArrowDown:()=>p(n,7),Home:()=>p(n,-(n.getDay()-L+7)%7),End:()=>p(n,6-(n.getDay()-L+7)%7),PageUp:()=>x(n,a.shiftKey?-12:-1),PageDown:()=>x(n,a.shiftKey?12:1)};if(o[a.key])return a.preventDefault(),l=o[a.key](),_.current=!0,z(r(l)),void(t(l)!==R&&ce(l));var l;"Enter"!==a.key&&" "!==a.key||(a.preventDefault(),W||ae(ie)||N(ie))},hidden:"days"!==ee,children:[
|
|
12
|
+
/* @__PURE__ */f("div",{role:"row",className:`${y} text-center text-xs font-medium text-ink-faint`,children:Array.from({length:7},(e,t)=>(t+L)%7).map(e=>
|
|
13
|
+
/* @__PURE__ */f("div",{role:"columnheader","aria-label":$.weekdays[e],className:"py-1",children:/* @__PURE__ */f("abbr",{title:$.weekdays[e],className:"no-underline",children:$.weekdaysShort[e]})},e))}),Array.from({length:6},(e,t)=>/* @__PURE__ */f("div",{role:"row",className:`${y} text-center text-sm`,children:re.slice(7*t,7*t+7).map(e=>{const t=r(e),a=e.getMonth()!==T.getMonth(),n=t===w||"range"===D&&t===M,o=(e=>!("range"!==D||!w||!M)&&e>w&&e<M)(t),l=ae(t),i=$.longDate(e.getFullYear(),e.getMonth(),e.getDate()),s=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",l?"cursor-not-allowed text-gray-300":n?"bg-accent-fill font-semibold text-on-accent":o?"bg-accent-tint-strong text-blue-800":a?"text-ink-faint"+(e?" hover:bg-gray-100":""):"text-ink"+(e?" hover:bg-gray-100":""),t!==H||n?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),c=O.has(t)&&/* @__PURE__ */f("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(n?"bg-surface":a?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
|
|
14
|
+
return f("div",{role:"gridcell","aria-selected":n,"aria-label":W?i:void 0,children:W?/* @__PURE__ */m("span",{"aria-hidden":"true",className:`grid place-items-center ${s(!1)}`,children:[e.getDate(),c]}):/* @__PURE__ */m("button",{type:"button","data-active":t===ie,tabIndex:t===ie?0:-1,disabled:l,"aria-label":i,"aria-current":t===H?"date":void 0,onClick:()=>{z(t),N(t)},className:s(!0),children:[e.getDate(),c]})},t)})},t))]})]})}export{w as Calendar};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-
|
|
2
|
-
return x("input",{ref:
|
|
1
|
+
import{Calendar as e}from"./chunk-7MSC3Z5H.js";import{fromDateKey as t,toDateKey as r}from"./chunk-2HMNOLKX.js";import{inputClasses as a,PLACEHOLDER_INK as n}from"./chunk-AYZY3YNC.js";import{calendarNames as i}from"./chunk-Y3JW2GW5.js";import{Icon as o}from"./chunk-2UO47XB4.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{useDropdownPosition as d}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as u}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as b}from"./chunk-4PAWQEXM.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 D(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 W(e,r){const a=t(e);return a?r.longDate(a.getFullYear(),a.getMonth(),a.getDate()):""}var B=f(function({value:f,onChange:k,min:B,max:C,invalid:F,size:E,native:O,weekStartsOn:S,className:$="","aria-label":q,"aria-describedby":L,"aria-labelledby":M,id:U,name:Y,disabled:z,placeholder:I,required:J,clearable:T,form:G,title:H,tabIndex:P,autoFocus:X,onFocus:A,onBlur:Q,...Z},K){const R=T??!J,V=D(f),_=D(B),ee=D(C),te=m().datePicker,re=b(),ae=i(re),[ne,ie]=p(!1),oe=h(null),le=h(null),se=h(null),de=v(),ue=v(),ce=v(),me=d(le,ne,{popupRef:se}),[be,fe]=p(!1);u(()=>{const e=!!U&&(le.current?.labels?.length??0)>0;e!==be&&fe(e)});const pe=!q&&(!!M||be);if(g(()=>{if(!ne)return;const e=e=>{const t=e.target;oe.current?.contains(t)||se.current?.contains(t)||ie(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>ie(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[ne]),g(()=>{if(ne)return c(e=>"Escape"===e.key&&(ie(!1),le.current?.focus(),!0),()=>se.current)},[ne]),O)/* @__PURE__ */
|
|
2
|
+
return x("input",{ref:K,type:"date",lang:re,id:U,name:Y,disabled:z,"aria-label":q,"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:E,className:$}),"aria-labelledby":M,required:J,form:G,title:H,tabIndex:P,autoFocus:X,onFocus:A,onBlur:Q,...Z});const he=Object.fromEntries(Object.entries(Z).filter(([e])=>j.test(e)&&!w.has(e))),ve=Z["aria-required"],ge=!!J||!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=I??te.placeholder;/* @__PURE__ */
|
|
3
3
|
return N("div",{ref:oe,className:"relative",children:[
|
|
4
|
-
/* @__PURE__ */x("input",{ref:
|
|
5
|
-
/* @__PURE__ */N("button",{ref:le,type:"button",...he,id:
|
|
6
|
-
/* @__PURE__ */x("span",{className:
|
|
7
|
-
/* @__PURE__ */x(o,{name:"date",className:`h-4 w-4 shrink-0 ${n}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */x("span",{id:ue,className:"sr-only",children:
|
|
8
|
-
/* @__PURE__ */N("div",{ref:se,id:de,role:"dialog","aria-label":
|
|
9
|
-
/* @__PURE__ */x(e,{value:
|
|
4
|
+
/* @__PURE__ */x("input",{ref:K,type:"hidden",name:Y,form:G,value:V}),
|
|
5
|
+
/* @__PURE__ */N("button",{ref:le,type:"button",...he,id:U,disabled:z,title:H,tabIndex:P,autoFocus:X,onFocus:A,onBlur:Q,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?de:void 0,"aria-labelledby":M,"aria-describedby":ye,"aria-label":q?`${q}${V?`, ${W(V,ae)}`:""}`:void 0,onClick:()=>ie(e=>!e),className:`${a({invalid:F,size:E,className:$})} flex items-center justify-between text-left`,children:[
|
|
6
|
+
/* @__PURE__ */x("span",{className:V?"text-ink-strongest":n,children:V?W(V,ae):ke}),
|
|
7
|
+
/* @__PURE__ */x(o,{name:"date",className:`h-4 w-4 shrink-0 ${n}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */x("span",{id:ue,className:"sr-only",children:V?W(V,ae):ke}),ge&&/* @__PURE__ */x("span",{id:ce,className:"sr-only",children:te.required}),ne&&y(
|
|
8
|
+
/* @__PURE__ */N("div",{ref:se,id:de,role:"dialog","aria-label":q??te.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:s.popup,left:me?.left,right:me?.right,top:me?.top,bottom:me?.bottom,maxWidth:me?.maxWidth,visibility:me?void 0:"hidden"},children:[
|
|
9
|
+
/* @__PURE__ */x(e,{value:V||null,min:_||null,max:ee||null,weekStartsOn:S,onSelect:e=>{ie(!1),le.current?.focus(),k?.(t(e))}}),(R||Ne)&&/* @__PURE__ */N("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[R&&/* @__PURE__ */x("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),k?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:te.clear}),Ne&&/* @__PURE__ */x("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),k?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:te.today})]})]}),document.body)]})});export{B as DatePicker_default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-TXDA7TTP.js";import{Icon as i}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-TXDA7TTP.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{OneLineLabel as r}from"./chunk-MVZRZTQP.js";import{useShellStrings as s}from"./chunk-4PAWQEXM.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
2
2
|
return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
|
|
3
3
|
/* @__PURE__ */n(r,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(i,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{swallowPress as e,describedByWith as i,OffWithReason as r}from"./chunk-34URULVW.js";import{Icon as a}from"./chunk-
|
|
1
|
+
import{swallowPress as e,describedByWith as i,OffWithReason as r}from"./chunk-34URULVW.js";import{Icon as a}from"./chunk-2UO47XB4.js";import{OneLineLabel as o}from"./chunk-MVZRZTQP.js";import{Tooltip as s}from"./chunk-6XBWM453.js";import{useShellStrings as n}from"./chunk-4PAWQEXM.js";import{useId as l,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":f,"aria-describedby":p}){const w=n().displayChips,g=l();/* @__PURE__ */
|
|
2
2
|
return t("div",{role:"group","aria-label":f?void 0:m,"aria-labelledby":f,"aria-describedby":p,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((n,l)=>{const b=`${g}-${l}-state`,m=`${g}-${l}-reason`,u=Boolean(n.disabled)&&null!=n.disabledReason&&""!==n.disabledReason,f=/* @__PURE__ */c("button",{type:"button","aria-pressed":n.shown,disabled:!(!n.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":i(b,u?m:void 0),onClick:u?e:()=>h(n.id,!n.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(n.shown?"border-blue-200 bg-accent-tint text-blue-700 hover:bg-blue-100":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink-strongest"),children:[
|
|
3
3
|
/* @__PURE__ */t(a,{name:n.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
|
|
4
4
|
/* @__PURE__ */t(o,{children:n.label})]}),p=/* @__PURE__ */t("span",{id:b,className:"sr-only",children:n.shown?w.shown:w.hidden});/* @__PURE__ */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-SG4LO2AN.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as i}from"./chunk-LPXMHYTM.js";import{ImageLightbox as r}from"./chunk-KTVXPGGB.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-RLJHRDDW.js";import{Breadcrumbs as d}from"./chunk-3AH524CN.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-XTCXX5LJ.js";import{useMediaMoveItems as p}from"./chunk-ZURB2DCM.js";import{copyToClipboard as h}from"./chunk-MQU3PZUS.js";import{DropdownMenu as f}from"./chunk-PN5FQVMB.js";import{NativeSelect as g}from"./chunk-VNACNNCJ.js";import{MediaUploadGrid as v}from"./chunk-MNSKGMVZ.js";import{MediaUsedInList as k}from"./chunk-CQV3VSI2.js";import{Segmented as y}from"./chunk-3ELLBQPS.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as C}from"./chunk-W3OWPBQL.js";import{Banner as x}from"./chunk-ZW3IDCP2.js";import{Input_default as N}from"./chunk-MAMWQCJ6.js";import{IconButton_default as I}from"./chunk-PUF75SMJ.js";import{useFileIntake as D,FileIntakeAlert as S}from"./chunk-6RX4PVBU.js";import{ColoredBadge as j}from"./chunk-7TNAOZZ2.js";import{Button_default as z}from"./chunk-I4VIEGCX.js";import{buttonClasses as T}from"./chunk-UQYNPYF4.js";import{Icon as F}from"./chunk-2UO47XB4.js";import{Tooltip as O}from"./chunk-6XBWM453.js";import{usePlotWidth as P}from"./chunk-MAFUXCPZ.js";import{useShellStrings as L}from"./chunk-4PAWQEXM.js";import{useRef as M,useMemo as A,useCallback as E,useState as U,useEffect as B}from"react";import{jsxs as R,Fragment as V,jsx as K}from"react/jsx-runtime";var W="application/x-efficient-media-files",X="application/x-efficient-media-folder",G="application/x-efficient-media-file";function J(e){if(!e||!Array.from(e.types).includes(G))return null;try{const n=JSON.parse(e.getData(G));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 Q={type:"all",use:"any",sort:"newest"},Z={lock:/* @__PURE__ */K(F,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */K(F,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */K(F,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */K(F,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */K(F,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */K(F,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */K(F,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */K(F,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */K(F,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */K(F,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */K(F,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */K(F,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */K(F,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */K(F,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */K(F,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */K(F,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},H={link:/* @__PURE__ */K(F,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */K(F,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */K(F,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */K(F,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function $({value:e,label:n,onDone:l}){const[a,i]=U(e),r=M(!1),t=e=>{r.current||(r.current=!0,l(e))};/* @__PURE__ */
|
|
2
|
+
return K(N,{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 q(F){const{mode:J="manage",layout:q="auto",location:Y,onLocationChange:_,folders:ee,products:ne,allFilesCount:le,trashCount:ae,files:ie,query:re,onQueryChange:te,filters:oe=Q,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:Ce,onMove:xe,onTrash:Ne,onDeleteFolder:Ie,onRestore:De,onDeleteForever:Se,onEmptyTrash:je,onReplace:ze,onCropEdit:Te,onOpenInDesign:Fe,onChoose:Oe,onCancel:Pe,pickNote:Le,onDragOut:Me,className:Ae=""}=F,Ee=L().mediaLibrary,Ue=L().media,Be="pick"===J,Re=!Be,Ve=M(null),Ke=P(Ve,"phone"===q?343:1200),We="phone"===q||"auto"===q&&Ke<640,Xe=A(()=>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]),Ge=A(()=>new Map(ee.map(e=>[e.id,e])),[ee]),Je=A(()=>{const e=/* @__PURE__ */new Map;for(const n of ee){const l=n.parentId&&Ge.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[ee,Ge]),Qe=E(e=>{const n=[];for(let l=e?Ge.get(e):void 0;l&&(n.unshift(l),!(n.length>ee.length));l=l.parentId?Ge.get(l.parentId):void 0);return n},[Ge,ee.length]),Ze=E((e,n)=>Qe(e).some(e=>e.id===n),[Qe]),[He,$e]=U(()=>/* @__PURE__ */new Set(["@files"])),qe=e=>$e(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),Ye=E(e=>{$e(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),_e="files"===(en=Y).place?`files:${en.folderId??""}`:"products"===en.place?`products:${en.nodeId??""}`:"trash";var en;B(()=>{if("files"===Y.place)Ye(["@files",...Qe(Y.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===Y.place){const e=Y.nodeId?Xe.get(Y.nodeId)?.path??[]:[];Ye(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[_e]);const nn="products"===Y.place,ln="trash"===Y.place,an="files"===Y.place,rn=an?Y.folderId:null,tn=nn&&Y.nodeId?Xe.get(Y.nodeId)?.path[0]:void 0,on=e=>e?.sharedFrom?`${Ee.readOnly} ${Ee.editedAtHq(e.sharedFrom)}`:Ee.readOnly,dn=A(()=>ie.map(e=>e.id),[ie]),sn=A(()=>new Map(ie.map(e=>[e.id,e])),[ie]),cn=s(dn),un=A(()=>dn.filter(e=>cn.selected.has(e)),[dn,cn.selected]),mn=1===un.length?sn.get(un[0]):void 0,pn=M(!0);B(()=>{pn.current?pn.current=!1:cn.clear()},[_e]);const hn=me?.join("\0");B(()=>{me&&cn.setSelection(me)},[hn]);const fn=M(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]=U(null),bn=e=>{const n=kn;if(yn(null),!n||null==e)return;e!==("folder"===n.kind?Ge.get(n.id)?.name:sn.get(n.id)?.name)&&Ce?.(n,e)},wn=async e=>{if(!we)return;const n=await we(e);Ye(["@files",...e?[e]:[]]),"string"==typeof n&&yn({kind:"folder",id:n})},Cn=E(e=>{const n=[],l=n=>{if("files"===e.kind)return n===rn&&an?Ee.alreadyHere:void 0;const l=Ge.get(e.id);return n===e.id||n&&Ze(n,e.id)?Ee.notIntoItself:(l?.parentId??null)===n?Ee.folderAlreadyHere:void 0};n.push({key:u,label:Ee.allFiles,disabledReason:l(null)});const a=(e,i)=>{for(const r of Je.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},[Je,Ge,an,Ze,rn,Ee]),xn=E(e=>{const n=new Set(e.map(e=>sn.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[sn]),[Nn,In]=U(null),Dn={words:Ee,media:Ue,denied:fe,moveTargets:Cn,kindOf:xn,urlOf:e=>sn.get(e)?.url,newSubfolder:we&&Re?e=>{wn(e)}:void 0,rename:Ce&&Re?e=>{"file"!==e.kind||cn.isSelected(e.id)||cn.select(e.id),yn(e)}:void 0,move:xe&&Re?xe:void 0,trash:Ne&&Re?Ne:void 0,deleteFolder:Ie&&Re?Ie:void 0,folderNotEmpty:e=>!!Ge.get(e)?.notEmpty,replace:ze&&Re?ze:void 0,copyUrl:e=>{const n=sn.get(e)?.url;n&&h(Ee.urlLabel,n)},openInDesign:Fe,restore:De,deleteForever:Se},Sn=e=>m(e,Dn),jn=w(),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)))},[Tn,Fn]=U(null),[On,Pn]=U(null),[Ln,Mn]=U(null);B(()=>{if(!On&&!Tn)return;const e=()=>{Pn(null),Fn(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[On,Tn]);const An=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),En=(e,n)=>!(!xe||fe.move||Be)&&(!!An(e,W)||!(!An(e,X)||!Ln)&&(n!==Ln&&!(n&&Ze(n,Ln)))),Un=(e,n)=>({onDragEnter:l=>{En(l,n)&&(l.preventDefault(),Fn(e))},onDragOver:l=>{En(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Tn!==e&&Fn(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Fn(n=>n===e?null:n)},onDrop:e=>{if(En(e,n))if(e.preventDefault(),Fn(null),An(e,W)){let l;try{l=JSON.parse(e.dataTransfer.getData(W))}catch{l=null}Array.isArray(l)&&l.length&&xe({kind:"files",ids:l.map(String)},n)}else Ln&&(xe({kind:"folder",id:Ln},n),Mn(null))}}),Bn=e=>{const n=e=>An(e,W)||An(e,X)||An(e,"Files");return{onDragEnter:l=>{n(l)&&Pn(e)},onDragOver:l=>{n(l)&&On!==e&&Pn(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Pn(n=>n===e?null:n)}}},Rn=(e,n,l)=>/* @__PURE__ */K(O,{side:"right",content:On===e?Ee.noDropProducts:on(l),open:On===e||!On&&void 0,children:/* @__PURE__ */K("span",{children:n})}),Vn=e=>({onContextMenu:n=>{jn.open(n,e)}}),Kn=(e,a,i)=>e.map(e=>{const r=`p:${e.id}`,t=i??e,o=He.has(r),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
3
|
+
return R("div",{role:"none",className:"contents",children:[
|
|
4
|
+
/* @__PURE__ */K(n,{label:Rn(r,e.name,t),level:a,icon:d&&o?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ee.fileCount(e.count):void 0,selected:nn&&Y.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>qe(r):void 0,onSelect:()=>_({place:"products",nodeId:e.id}),rowProps:{"data-media-row":r,...Bn(r),...Re?Vn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */K(l,{children:Kn(d,a+1,t)})]},e.id)}),Wn=(e,a)=>(Je.get(e)??[]).map(e=>{const i=Je.get(e.id),r=He.has(e.id),t="folder"===kn?.kind&&kn.id===e.id,o=Sn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
5
|
+
return R("div",{role:"none",className:"contents",children:[
|
|
6
|
+
/* @__PURE__ */K(n,{label:e.name,level:a,icon:i&&r?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ee.fileCount(e.count):void 0,selected:t||an&&Y.folderId===e.id,expanded:i?r:void 0,onToggle:i?()=>qe(e.id):void 0,onSelect:()=>_({place:"files",folderId:e.id}),drop:Tn===e.id?"into":void 0,dragging:Ln===e.id,draggable:Re&&!!xe&&!fe.move,rename:t?/* @__PURE__ */K($,{value:e.name,label:Ee.folderName,onDone:bn}):void 0,actions:Re&&o.length?/* @__PURE__ */K(f,{align:"end","aria-label":Ee.folderActions,trigger:Z.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Un(e.id,e.id),...Re?Vn({kind:"folder",id:e.id}):{},...Re&&xe&&!fe.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(X,e.id),Mn(e.id)},onDragEnd:()=>{Mn(null),Fn(null)}}:{}}}),i&&r&&/* @__PURE__ */K(l,{children:Wn(e.id,a+1)})]},e.id)}),Xn=He.has("@files"),Gn=He.has("@products"),Jn=/* @__PURE__ */R(e,{"aria-label":Ee.folders,children:[ne&&/* @__PURE__ */R(V,{children:[
|
|
7
|
+
/* @__PURE__ */K(n,{label:Rn("@products",Ee.products),level:1,icon:Z.lock,badge:{label:Ee.readOnlyBadge,tone:"neutral"},expanded:ne.length?Gn:void 0,onToggle:()=>qe("@products"),selected:nn&&null==Y.nodeId,onSelect:()=>_({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Bn("@products")}}),Gn&&ne.length>0&&/* @__PURE__ */K(l,{children:Kn(ne,2)})]}),
|
|
8
|
+
/* @__PURE__ */K(n,{label:Ee.allFiles,level:1,icon:Xn?Z.folderOpen:Z.folder,count:le,countLabel:null!=le?Ee.fileCount(le):void 0,expanded:Je.get(null)?.length?Xn:void 0,onToggle:()=>qe("@files"),selected:an&&null==Y.folderId,onSelect:()=>_({place:"files",folderId:null}),drop:"@files"===Tn?"into":void 0,rowProps:{"data-media-row":"@files",...Un("@files",null)}}),Xn&&(Je.get(null)?.length??0)>0&&/* @__PURE__ */K(l,{children:Wn(null,2)}),Re&&/* @__PURE__ */K(n,{label:Ee.trash,level:1,icon:Z.trash,count:ae,countLabel:null!=ae?Ee.fileCount(ae):void 0,selected:ln,onSelect:()=>_({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Qn=(()=>{if(ln)return[{label:Ee.trash}];if(nn){const e=Y.nodeId?Xe.get(Y.nodeId)?.path??[]:[];return[{label:Ee.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=Qe(rn);return[{label:Ee.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}))]})(),Zn=nn?Ee.readOnly:fe.upload,Hn=!!be&&!ln&&!Zn,$n=D({accept:ge,maxSizeBytes:ve,multiple:!0,disabled:!Hn,onAccept:e=>be?.(e,rn)}),qn=nn?Ee.noProductFolder:fe.newFolder,Yn=e=>e?{"aria-disabled":!0,disabledReason:e}:{},_n=/* @__PURE__ */R("div",{className:"flex flex-wrap items-center gap-2",children:[Re&&we&&!ln&&/* @__PURE__ */K(z,{variant:"secondary",size:"sm",leftIcon:Z.folderPlus,onClick:()=>{wn(rn)},...Yn(qn),children:Ee.newFolder}),be&&!ln&&/* @__PURE__ */K(z,{variant:"primary",size:"sm",leftIcon:Z.upload,onClick:()=>$n.open(),...Yn(Zn),children:Ee.upload}),Re&&ln&&je&&ie.length>0&&/* @__PURE__ */K(z,{variant:"danger",size:"sm",onClick:je,...Yn(fe.deleteForever),children:Ee.emptyTrash})]}),el=(e,n,l,a,i)=>/* @__PURE__ */K("div",{style:{width:We?void 0:i,flex:We?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */K(g,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),nl=e=>n=>de?.({...oe,[e]:n}),ll=/* @__PURE__ */R("div",{className:"flex flex-wrap items-center gap-2",children:[te&&/* @__PURE__ */K("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */K(N,{size:"sm",type:"search",leftIcon:Z.search,placeholder:nn?Ee.searchProducts:Ee.search,"aria-label":nn?Ee.searchProducts:Ee.search,value:re??"",onChange:e=>te(e.target.value)})}),de&&el(Ee.mediaType,oe.type,[{value:"all",label:Ee.allTypes},{value:"image",label:Ee.images},{value:"video",label:Ee.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],nl("type"),130),de&&!nn&&!ln&&el(Ee.use,oe.use,[{value:"any",label:Ee.anyUse},{value:"email",label:Ee.emailOnly},{value:"website",label:Ee.websiteOnly},{value:"unused",label:Ee.notUsed}],nl("use"),130),de&&Re&&el(Ee.sort,oe.sort,[{value:"newest",label:Ee.newest},{value:"name",label:Ee.byName},{value:"size",label:Ee.bySize}],nl("sort"),110),se?.map(e=>el(e.label,e.value,e.options,e.onChange,120)),ue&&/* @__PURE__ */K(y,{size:"sm",label:Ee.view,value:ce,onChange:ue,options:[{value:"grid",label:Ee.grid,icon:Z.grid},{value:"list",label:Ee.list,icon:Z.list}]})]}),al=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ee.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:H.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ee.used(e.usedCount),count:e.usedCount,icon:H.link,tone:"active"}),e.email&&n.push({key:"e",label:Ee.email,icon:H.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ee.private,icon:H.lock,tone:"neutral"}),n},il=e=>al(e).map(e=>/* @__PURE__ */K(j,{tone:e.tone,size:"xs",children:e.label},e.key)),rl=Re&&an&&!!xe&&!fe.move,tl=!!Me&&!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:{[G]:ol(e)}}:{}})),sl=We?Math.max(72,Math.floor((Ke-24-16-1)/3)):112,cl=M(null),ul=c({containerRef:cl,enabled:Re&&!We&&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||Oe?.(n))}const n=dn.indexOf(e);n>=0&&In(n)},pl=ie.length?null:re?/* @__PURE__ */K(i,{variant:"dashed",title:Ee.noMatches}):nn?/* @__PURE__ */K(i,{variant:"dashed",title:Ee.emptyProducts,description:on(tn)}):ln?/* @__PURE__ */K(i,{variant:"dashed",title:Ee.trashEmpty}):!Hn||Be?/* @__PURE__ */K(i,{variant:"dashed",title:Ee.emptyFolder}):null,hl="list"===ce&&ie.length>0,fl=pl??(hl?/* @__PURE__ */K("ul",{role:"listbox","aria-multiselectable":Re||void 0,"aria-label":Ee.folders,className:"flex flex-col gap-1",children:ie.map(e=>/* @__PURE__ */R("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(G,ol(e)),Me("start")}:void 0,onDragEnd:ol(e)?e=>Me("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__ */K("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
10
|
+
/* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
11
|
+
/* @__PURE__ */K("span",{className:"flex shrink-0 items-center gap-1",children:il(e)}),e.sizeLabel&&/* @__PURE__ */K("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */K(v,{items:dl,readOnly:!Hn||Be,onFiles:Hn&&!Be?e=>be(e,rn):void 0,accept:ge,maxSizeBytes:ve,busy:ke,progress:ye,fit:"contain",thumbSize:sl,dragType:rl?W:tl?G:void 0,onDragOutChange:tl?e=>Me(e):void 0,selected:cn.selected,onItemClick:vn,onItemDoubleClick:ml,onItemContextMenu:Re?zn:void 0,menuOnMedia:Re})),gl=p({count:un.length,kind:xn(un),targets:Cn({kind:"files",ids:un}),onPick:e=>xe?.({kind:"files",ids:un},e.key===u?null:e.key)}),vl=T({variant:"secondary",size:"sm"}),kl=/* @__PURE__ */K(f,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */R(V,{children:[Z.folder,Ee.moveTo]}),items:gl,disabled:!!fe.move}),yl=Re&&un.length>1&&!nn?/* @__PURE__ */R("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
|
|
12
|
+
/* @__PURE__ */K(b,{checked:un.length===ie.length,indeterminate:un.length<ie.length,onChange:e=>e?cn.selectAll():cn.clear(),label:Ee.selected(un.length)}),/* @__PURE__ */R(V,ln?{children:[De&&/* @__PURE__ */K(z,{variant:"secondary",size:"sm",leftIcon:Z.undo,onClick:()=>De(un),...Yn(fe.restore),children:Ee.restore}),Se&&/* @__PURE__ */K(z,{variant:"secondary-danger",size:"sm",onClick:()=>Se(un),...Yn(fe.deleteForever),children:Ee.deleteForever})]}:{children:[xe&&kl,Ce&&/* @__PURE__ */K(z,{variant:"secondary",size:"sm",leftIcon:Z.edit,disabled:!0,children:Ee.rename}),Ne&&/* @__PURE__ */K(z,{variant:"secondary",size:"sm",leftIcon:Z.trash,onClick:()=>Ne({kind:"files",ids:un}),...Yn(fe.trash),children:Ee.moveFilesToTrash(un.length)})]}),
|
|
13
|
+
/* @__PURE__ */K(z,{variant:"ghost",size:"sm",onClick:cn.clear,children:Ee.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",Ee.name,a?/* @__PURE__ */K($,{value:e.name,label:Ee.fileName,onDone:bn}):e.name),l("type",Ee.type,e.typeLabel),l("size",Ee.size,e.sizeLabel),l("resolution",Ee.resolution,e.resolution),nn?(l("design",Ee.design,e.design),l("finish",Ee.finish,e.finish),l("angle",Ee.angleLug,e.angleLug),l("owner",Ee.owner,e.owner)):(l("added",Ee.addedBy,e.addedBy),l("folder",Ee.folder,e.folderPath)),l("used",Ee.usedIn,null!=e.usedCount?Ee.places(e.usedCount):void 0);const i=m({kind:"files",ids:[e.id]},Dn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
14
|
+
return R("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
15
|
+
/* @__PURE__ */K("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),nn&&/* @__PURE__ */K(x,{tone:"neutral",title:Ee.readOnlyBadge,children:on(tn)}),
|
|
16
|
+
/* @__PURE__ */K(t,{size:"sm",columns:1,items:n}),!ln&&/* @__PURE__ */R("div",{className:"flex gap-2",children:[
|
|
17
|
+
/* @__PURE__ */K("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */K(N,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ee.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
18
|
+
/* @__PURE__ */K(z,{variant:"secondary",size:"sm",leftIcon:Z.copy,onClick:()=>Dn.copyUrl(e.id),children:Ee.copyUrl})]}),an&&Re&&/* @__PURE__ */R("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */K(z,{variant:"secondary",size:"sm",leftIcon:Z.swap,onClick:()=>ze(e.id),...Yn(fe.replace),children:Ee.replace}),Te&&/* @__PURE__ */K(z,{variant:"secondary",size:"sm",leftIcon:Z.crop,onClick:()=>Te(e.id),children:Ee.cropEdit}),xe&&"submenu"===i?.type&&/* @__PURE__ */K(f,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */R(V,{children:[Z.folder,Ee.moveTo]}),items:i.items,disabled:!!fe.move}),Ce&&/* @__PURE__ */K(z,{variant:"secondary",size:"sm",leftIcon:Z.edit,onClick:()=>yn({kind:"file",id:e.id}),...Yn(fe.rename),children:Ee.rename}),Ne&&/* @__PURE__ */K(I,{"aria-label":Ee.moveToTrash,size:"sm",onClick:()=>Ne({kind:"files",ids:[e.id]}),disabledReason:fe.trash,"aria-disabled":!!fe.trash||void 0,children:Z.trash})]}),ln&&Re&&/* @__PURE__ */R("div",{className:"flex flex-wrap gap-2",children:[De&&/* @__PURE__ */K(z,{variant:"primary",size:"sm",leftIcon:Z.undo,onClick:()=>De([e.id]),...Yn(fe.restore),children:Ee.restore}),Se&&/* @__PURE__ */K(z,{variant:"danger",size:"sm",onClick:()=>Se([e.id]),...Yn(fe.deleteForever),children:Ee.deleteForever})]}),nn&&Fe&&/* @__PURE__ */K(z,{variant:"secondary",size:"sm",leftIcon:Z.external,onClick:()=>Fe({kind:"render",id:e.id}),children:Ee.openInDesign}),he&&/* @__PURE__ */K(k,{items:he})]})},wl=mn?mn.private?Ee.privateNoPick:mn.pickDisabledReason:void 0,Cl=Be?/* @__PURE__ */R("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__ */K("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:mn?Ee.oneChosen(mn.name):Ee.noneChosen}),
|
|
20
|
+
/* @__PURE__ */R("div",{className:"flex gap-2",children:[Pe&&/* @__PURE__ */K(z,{variant:"secondary",size:"sm",onClick:Pe,children:Ee.cancel}),
|
|
21
|
+
/* @__PURE__ */K(z,{variant:"primary",size:"sm",disabled:!mn,...Yn(wl),onClick:()=>{mn&&!wl&&Oe?.(mn)},children:Ee.chooseImage})]})]}):null,xl=Re&&!!mn,Nl=/* @__PURE__ */R("div",{className:"flex min-w-0 flex-col gap-3",children:[Le&&/* @__PURE__ */K(x,{tone:"neutral",children:Le}),
|
|
22
|
+
/* @__PURE__ */R("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
23
|
+
/* @__PURE__ */K(d,{items:Qn}),_n]}),ll,yl,
|
|
24
|
+
/* @__PURE__ */R("div",{ref:cl,className:"relative",onPointerDown:ul.onPointerDown,onKeyDown:e=>{Re&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),cn.selectAll()):"Escape"===e.key&&cn.size&&cn.clear()},children:[fl,
|
|
25
|
+
/* @__PURE__ */K(a,{rect:ul.rect})]}),Hn&&/* @__PURE__ */K("input",{...$n.inputProps}),
|
|
26
|
+
/* @__PURE__ */K(S,{rejections:$n.rejections})]});/* @__PURE__ */
|
|
27
|
+
return R("div",{ref:Ve,"data-media-library":"","data-layout":We?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Ae}`.trim(),children:[/* @__PURE__ */R("div",We?{className:"flex flex-col gap-3 p-3",children:[Jn,Nl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
28
|
+
/* @__PURE__ */K("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Jn}),
|
|
29
|
+
/* @__PURE__ */K("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Nl}),xl&&/* @__PURE__ */K("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:bl(mn)})]}),Cl,We&&/* @__PURE__ */K(o,{open:xl,onClose:cn.clear,side:"bottom",title:mn?.name,children:mn&&bl(mn)}),jn.state&&/* @__PURE__ */K(C,{...jn.props,items:Sn(jn.state.data)}),null!=Nn&&ie.length>0&&/* @__PURE__ */K(r,{images:ie.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Nn,ie.length-1),onClose:()=>In(null)})]})}export{W as MEDIA_FILES_DRAG_TYPE,G as MEDIA_FILE_DRAG_TYPE,X as MEDIA_FOLDER_DRAG_TYPE,q as MediaLibrary,J as readMediaFileDrag};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{InputNumber_default as a}from"./chunk-
|
|
1
|
+
import{InputNumber_default as a}from"./chunk-57HN6MPC.js";import{Icon as e}from"./chunk-2UO47XB4.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";var n="h-3.5 w-3.5",l={x:/* @__PURE__ */i(e,{name:"nudge-x","aria-hidden":"true",className:n}),y:/* @__PURE__ */i(e,{name:"nudge-y","aria-hidden":"true",className:n})};function s({label:e,value:n,onChange:s,words:m,placeholder:o,min:d=-200,max:c=200,step:t=1,readOnly:p}){const u=e=>/* @__PURE__ */i("div",{"data-axis":e,className:"min-w-0",children:/* @__PURE__ */i(a,{value:n[e],onChange:a=>s({...n,[e]:a}),min:d,max:c,step:t,precision:0,steppers:"compact",readOnly:p,placeholder:o[e],prefix:l[e],suffix:m.unit,"aria-label":m[e]})});/* @__PURE__ */
|
|
2
2
|
return r("div",{role:"group","aria-label":e,className:"grid min-w-0 grid-cols-2 gap-2",children:[u("x"),u("y")]})}export{s as PositionInput};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{CartesianPlot as t}from"./chunk-
|
|
2
|
-
return m(t,{labels:s.map(e=>e.label),values:
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{CartesianPlot as t}from"./chunk-2JG5JU4M.js";import{resolveSeriesColor as i,CHART_INK as l}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as a}from"./chunk-4PAWQEXM.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{jsx as m,jsxs as n}from"react/jsx-runtime";function s({boxes:s,height:c=240,width:h,color:u,tone:x,formatValue:d,yAxisLabel:y,label:k,className:b,emptyLabel:f}){const p=r().charts,q=a(),g=d??(e=>o(e,q)),v=k??p.distribution,W=i(0,u,x),M=s.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
|
|
2
|
+
return m(t,{labels:s.map(e=>e.label),values:M,height:c,width:h,bandPadding:.5,formatValue:g,yAxisLabel:y,className:b,emptyLabel:f,ariaLabel:p.fiveNumber(v,s.length),tooltip:t=>{const i=s[t];/* @__PURE__ */
|
|
3
3
|
return m(e,{title:i.label,rows:[{key:"max",label:p.maximum,color:W,value:g(i.max)},{key:"q3",label:p.q3,color:W,value:g(i.q3)},{key:"median",label:p.median,color:W,value:g(i.median)},{key:"q1",label:p.q1,color:W,value:g(i.q1)},{key:"min",label:p.minimum,color:W,value:g(i.min)}],emphasisKey:"median",footnote:i.outliers?.length?p.outliers(i.outliers.length):void 0})},children:({x:e,y:t,active:i})=>/* @__PURE__ */m("g",{children:s.map((r,a)=>{const o=e.center(a),s=Math.max(6,e.bandwidth);/* @__PURE__ */
|
|
4
4
|
return n("g",{opacity:null!==i&&i!==a?.45:1,children:[
|
|
5
5
|
/* @__PURE__ */m("line",{x1:o,y1:t(r.max),x2:o,y2:t(r.q3),stroke:W,strokeWidth:1.5}),
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";function e({size:e=18,...r}){/* @__PURE__ */
|
|
2
|
+
return c("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */c("path",{fillRule:"evenodd",d:"M16.25,3c0.41421,0 0.75,0.33579 0.75,0.75v6.25c-0.03274,0.84359 -0.40498,1.75117 -0.9519,2.2981c-0.54692,0.54692 -1.4545,0.91917 -2.2981,0.9519l-8.18934,0l2.46967,2.46967c0.29289,0.29289 0.29289,0.76777 0,1.06066c-0.29289,0.29289 -0.76777,0.29289 -1.06066,0l-3.75,-3.75c-0.07191,-0.07191 -0.12616,-0.15478 -0.16276,-0.24324c-0.03667,-0.08843 -0.05691,-0.1854 -0.05691,-0.28709c0,-0.10169 0.02024,-0.19866 0.05691,-0.28709c0.0366,-0.08846 0.09085,-0.17134 0.16276,-0.24324l3.75,-3.75c0.29289,-0.29289 0.76777,-0.29289 1.06066,0c0.29289,0.29289 0.29289,0.76777 0,1.06066l-2.46967,2.46967h8.18934c0.53712,0.03274 0.87954,-0.15467 1.23744,-0.51256c0.3579,-0.3579 0.5453,-0.70032 0.51256,-1.23744v-6.25c0,-0.41421 0.33579,-0.75 0.75,-0.75z"})})}export{e as EnterMiniIcon};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return c(y.Provider,{value:r,children:e})}function g({value:r,onChange:a,min:w,max:g,step:S=1,shiftStep:z,precision:F,inputMin:k,inputMax:N,suffix:
|
|
3
|
-
/* @__PURE__ */c("input",{id:
|
|
4
|
-
/* @__PURE__ */c("div",{ref:_,"data-slider-box":"",className:"shrink-0 text-xs",style:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */c(e,{value:r,onChange:e=>{null!=e?e<
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-57HN6MPC.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{useShellStrings as n}from"./chunk-4PAWQEXM.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as u,useEffect as s}from"react";import{jsx as c,jsxs as m}from"react/jsx-runtime";var f=(e,t,i)=>Math.min(i,Math.max(t,e));function p(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var h=8,v=40;function x(e){return Math.max(1,...e.map(e=>(e??"").length))}function b(e,t,i,n){return Number(f(e,t,i).toFixed(n))}var y=r(null);function w({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
|
|
2
|
+
return c(y.Provider,{value:r,children:e})}function g({value:r,onChange:a,min:w,max:g,step:S=1,shiftStep:z,precision:F,inputMin:k,inputMax:N,suffix:M,showInput:j=!0,emptyLabel:$,placeholderValue:L,stepFrom:A,label:C,"aria-labelledby":K,valueText:D,id:E,disabled:P,size:W="md",boxSize:R="sm",className:H="",auto:T}){const V=n(),q=o(),B=t(),I=T??B,J=o(),O=E??q,Q=F??p(S),U=k??w,X=N??g,G=void 0!==$||void 0!==L,Y=A??L,Z=f(r??L??w,w,g),_=d(null),[ee,te]=l(null),ie=Boolean(M);i(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,j]);const ne=e=>D?D(e):"string"==typeof M?`${e.toFixed(Q)} ${M}`:void 0,re=null==r?$??(null!=L?ne(L)??String(L):void 0):ne(r),le=`calc(${x([w.toFixed(Q),g.toFixed(Q),r?.toFixed(Q),$,L?.toFixed(Q)])}ch + ${(ee?.frame??10+(ie?v:h))+2}px)`,ae=u(y),oe=o(),de=ae?.set;return i(()=>{de&&de(oe,j?le:null)},[de,oe,le,j]),s(()=>()=>de?.(oe,null),[de,oe]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-3 ${H}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */c("input",{id:O,type:"range",min:w,max:g,step:S,value:Z,disabled:P,"aria-label":K?void 0:C,"aria-labelledby":K,"aria-valuetext":re,"aria-describedby":I?J:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=z;if(!i&&!(null==r&&null!=Y))return;e.preventDefault();a(b((r??Y??Z)+t*(i?z??S:S),w,g,Q))},onChange:e=>a(b(Number(e.target.value),w,g,Q)),className:"min-w-24 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===W?"h-1":"h-1.5")}),j&&
|
|
4
|
+
/* @__PURE__ */c("div",{ref:_,"data-slider-box":"",className:"shrink-0 text-xs",style:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */c(e,{value:r,onChange:e=>{null!=e?e<U||e>X||a(e):G&&a(null)},min:U,max:X,step:S,shiftStep:z,stepFrom:Y,precision:Q,snap:!0,allowEmpty:G,suffix:M,disabled:P,placeholder:$??(null!=L?L.toFixed(Q):void 0),size:R,auto:I,"aria-label":C?V.slider.value(C):void 0,"aria-labelledby":C?void 0:K})}),I&&/* @__PURE__ */c("span",{id:J,hidden:!0,children:V.settingView.auto})]})}export{g as Slider,w as SliderGroup,b as settleSliderValue,x as sliderBoxChars,p as stepDecimals};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{TransferProgress as e}from"./chunk-UYRITNQW.js";import{Icon as r}from"./chunk-
|
|
1
|
+
import{TransferProgress as e}from"./chunk-UYRITNQW.js";import{Icon as r}from"./chunk-2UO47XB4.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-4PAWQEXM.js";import{jsx as o}from"react/jsx-runtime";var n=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function i(e){if(/^data:/i.test(e||""))return function(e){const r=n.exec(e);if(!r)return"media";const[,t,o]=r,i=o.split("+")[0].split(".").pop().replace(/^x-/i,"");return i?`${t.toLowerCase()}.${i.toLowerCase()}`:"media"}(e);const r=(e||"").split("?")[0].split("#")[0],t=r.substring(r.lastIndexOf("/")+1);try{return decodeURIComponent(t.replace(/^[0-9a-f]{32}_/i,""))||t||"media"}catch{return t||"media"}}var s=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function a(e,r=t.media){const o=function(e){const r=e.includes("video"),t=e.includes("image")||"*"===e||""===e;return r&&!t?"video":t&&!r?"image":"file"}(e);return"image"===o?r.uploadImage:"video"===o?r.uploadVideo:r.uploadFile}function c(e,r,t="",o="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",o,r?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",t].filter(Boolean).join(" ")}function u(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function d({label:r,progress:t,rounded:n="rounded-lg"}){/* @__PURE__ */
|
|
2
2
|
return o("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${n}`,children:/* @__PURE__ */o(e,{state:"busy",verb:r,pct:t})})}function l({children:e}){/* @__PURE__ */
|
|
3
3
|
return o("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e})}function m(e,r=""){if(!e)return!1;const t=n.exec(e);if(t)return"video"===t[1].toLowerCase();const o=r.includes("video"),i=r.includes("image")||"*"===r||""===r;return s.test(e)||o&&!i}function f({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
4
4
|
return o(r,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function p({className:e="h-6 w-6"}){/* @__PURE__ */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-
|
|
2
|
-
return S("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function
|
|
3
|
-
return
|
|
4
|
-
/* @__PURE__ */S("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */S("span",{ref:
|
|
5
|
-
/* @__PURE__ */
|
|
1
|
+
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-LJN77RG6.js";import{INPUT_BASE_ON as a,INPUT_BASE as s}from"./chunk-AYZY3YNC.js";import{Button_default as u}from"./chunk-I4VIEGCX.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import{Tooltip as d}from"./chunk-6XBWM453.js";import{onOverlayOpen as h}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as p}from"./chunk-62LW225J.js";import{useDropdownPosition as m,MENU_MAX_HEIGHT as f}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as b}from"./chunk-D65T4H6J.js";import{GLASS_DIVIDER as g,glassStyle as v}from"./chunk-F27JJHNJ.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as w}from"./chunk-4PAWQEXM.js";import{useState as x,useId as k,useRef as $,useMemo as j,useEffect as N}from"react";import{createPortal as C}from"react-dom";import{jsxs as D,jsx as S}from"react/jsx-runtime";function W(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}function E({onClear:e,ariaLabel:t}){/* @__PURE__ */
|
|
2
|
+
return S("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function L(L){const{options:M,placeholder:R,emptyOptionLabel:F,className:z="",disabled:T,id:A,filter:J=!1,allowFreeText:I=!1,freeTextOption:O,onSearchChange:B,loading:H=!1,error:U,onRetry:G,rightAdornment:X,renderOption:P,clearable:V=!0,"aria-label":Y,"aria-labelledby":K,"aria-describedby":Q}=L,Z=!0===L.multiple,q=L.multiple?L.value:L.value?[L.value]:[],_=L.multiple?"":L.value,ee=e=>{L.multiple?L.onChange(e):L.onChange(e[0]??"")},te=q.length>0,ne=J&&te&&!T,re=Z||J,le=null!=O,oe=I||le,[ie,ae]=x(!1),[se,ue]=x(-1),ce=k(),de=A??`${ce}-input`,he=`${ce}-listbox`,pe=e=>`${ce}-opt-${e}`,[me,fe]=x(""),be=w(),ge=F??be.select.none,ve=e=>{fe(e),ue(-1),B?.(e)},ye=$(null),we=$(null),xe=$(null),ke=$(null),$e=$(ie);$e.current=ie;const je=$(!1),Ne=e=>{$e.current&&($e.current=!1,e&&I&&!le&&Ve&&(Z?q.includes(Ve)||ee([...q,Ve]):Ve!==_&&ee([Ve])),ae(!1),ve(""))},Ce=(e,t)=>{if(!e.disabled){if(Z)return ee(q.includes(e.value)?q.filter(t=>t!==e.value):[...q,e.value]),void(e===Ye?ve(""):ue(t));ee([e.value]),Ne(!1)}},[De,Se]=x(null);b(()=>{if(!X||ie)return void Se(null);const e=ke.current?.offsetWidth??0;Se(e?e+(Fe?32:8)+6:null)});const We=m(we,ie,re?{popupRef:xe}:{matchTriggerWidth:!0}),Ee=j(()=>t(M),[M]),Le=q.join("\0"),Me=j(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Ee)q.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(oe)for(const n of q)t.has(n)||e.push(n);return e},[Ee,Le,oe]),Re=Me.join(", "),Fe=V&&te&&!T,[ze,Te]=x(null),Ae=$(null),Je=$(""),Ie=$(()=>{});Ie.current=()=>{const e=we.current,t=Ae.current;if(!Z||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Me.join("\0")}`;if(o===Je.current)return;Je.current=o;let i=null;r>0&&Me.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,i=W(Me,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),Te(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},b(()=>{Ie.current()}),N(()=>{const e=we.current;if(!Z||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Ie.current());return t.observe(e),()=>t.disconnect()},[Z]);const Oe=Me.length,Be=!Z||!ze||ze.shown>=Oe?Re:0===ze.shown?be.select.selectedCount(Oe):`${Me.slice(0,ze.shown).join(", ")} +${Oe-ze.shown}`,He=Z&&null!==ze&&(ze.shown<Oe||ze.cut),Ue=ie&&te&&re;N(()=>{if(!ie)return;const e=e=>{const t=e.target;ye.current?.contains(t)||xe.current?.contains(t)||Ne(!0)};document.addEventListener("mousedown",e);const t=h(()=>Ne(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[ie,I,me,Le,L.onChange]),N(()=>{if(ie)return y(e=>!("Escape"!==e.key||!$e.current)&&(Ne(!1),we.current?.blur(),!0),()=>xe.current)},[ie]);const Ge=j(()=>{const e=/* @__PURE__ */new Set;return n(M,t=>!e.has(t.value)&&(e.add(t.value),!0))},[M]),Xe=j(()=>{if(B)return Ge;const e=me.trim().toLowerCase();return e?n(Ge,t=>r(t,e)):Ge},[Ge,me,B]),Pe=j(()=>t(Xe),[Xe]),Ve=me.trim(),Ye=j(()=>le&&Ve?Ee.some(e=>e.label===Ve)||q.includes(Ve)?null:{value:Ve,label:Ve}:null,[le,Ve,Ee,Le]),Ke=j(()=>Ye?[...Pe,Ye]:Pe,[Pe,Ye]);/* @__PURE__ */
|
|
3
|
+
return D("div",{ref:ye,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(ye.current?.contains(t)||xe.current?.contains(t))||je.current||document.activeElement!==we.current&&Ne(!0)},children:[(Qe=/* @__PURE__ */S("input",{id:de,ref:we,type:"text",autoComplete:"off",role:"combobox","aria-expanded":ie,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":ie?he:void 0,"aria-activedescendant":ie&&se>=0&&se<Ke.length?pe(se):void 0,"aria-label":K?void 0:Y,"aria-labelledby":K,"aria-describedby":Q,value:ie?me:Be,onChange:e=>{ve(e.target.value),ae(!0)},onFocus:()=>{T||(ve(""),ae(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(T)return;if(t.preventDefault(),!ie)return void ae(!0);if(0===Ke.length)return;const n="ArrowDown"===t.key?1:-1;return void ue(t=>e(Ke,t,n))}"Enter"===t.key?(t.preventDefault(),ie&&se>=0&&se<Ke.length?Ce(Ke[se],se):1!==Pe.length||Pe[0].disabled?I&&!le&&Ve&&(Z?(q.includes(Ve)||ee([...q,Ve]),ve("")):(ee([Ve]),Ne(!1),we.current?.blur())):Ce(Pe[0],0)):"Escape"===t.key?(Ne(!1),we.current?.blur()):"Tab"===t.key&&Ne(!0)},placeholder:Ue?Be:R||ge,className:`${ne?a:s} ${z} ${Fe?"pr-8":""} ${T?"bg-surface-sunken text-ink-faintest cursor-not-allowed":""} truncate${Ue?" rosh-field-shows-choice":""}`,style:De?{paddingRight:De}:void 0,disabled:T}),Z?/* @__PURE__ */S(d,{content:!ie&&He?Re:null,className:"block",children:Qe}):Qe),Z&&
|
|
4
|
+
/* @__PURE__ */S("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */S("span",{ref:Ae,className:"whitespace-pre"})}),Fe&&/* @__PURE__ */S(E,{ariaLabel:be.select.clear,onClear:()=>{ee([]),Ne(!1)}}),X&&!ie&&/* @__PURE__ */S("div",{ref:ke,className:`absolute top-1/2 -translate-y-1/2 ${Fe?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:X}),ie&&C(
|
|
5
|
+
/* @__PURE__ */D("div",{ref:xe,onMouseDownCapture:()=>{je.current=!0,setTimeout(()=>{je.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:p.popup,left:We?.left,right:We?.right,top:We?.top,bottom:We?.bottom,minWidth:We?.minWidth,width:We?.width,...re&&{maxWidth:We?.maxWidth},visibility:We?void 0:"hidden",...v()},children:[Z&&te&&V&&!T&&
|
|
6
6
|
/* @__PURE__ */S("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ee([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-row-hover border-b ${g}`,children:be.select.clearAll}),H?
|
|
7
|
-
/* @__PURE__ */S(c,{size:"sm",padding:"py-2",label:be.search.searching}):U?/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */S("span",{className:"min-w-0 flex-1",children:U}),
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
return
|
|
11
|
-
/* @__PURE__ */S("span",{className:`min-w-0 ${re?"flex-auto":"flex-1"} truncate`,children:
|
|
12
|
-
/* @__PURE__ */S("button",{id:pe(
|
|
7
|
+
/* @__PURE__ */S(c,{size:"sm",padding:"py-2",label:be.search.searching}):U?/* @__PURE__ */D("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
8
|
+
/* @__PURE__ */S("span",{className:"min-w-0 flex-1",children:U}),G&&/* @__PURE__ */S(u,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:G,className:"shrink-0",children:be.list.retry})]}):null,
|
|
9
|
+
/* @__PURE__ */D("div",{id:he,role:Ke.length?"listbox":void 0,"aria-labelledby":Ke.length?K??(Y?void 0:de):void 0,"aria-label":Ke.length&&!K?Y:void 0,"aria-multiselectable":!(!Ke.length||!Z)||void 0,className:"overflow-y-auto",style:{maxHeight:We?.maxHeight??f},children:[0===Ke.length?H||U?null:/* @__PURE__ */S("p",{className:"px-3 py-3 text-sm text-ink-faintest text-center",children:be.select.noMatches}):0===Pe.length?null:l(Xe,(e,t)=>{const n=q.includes(e.value);/* @__PURE__ */
|
|
10
|
+
return D("button",{id:pe(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||Z)&&n.preventDefault(),Ce(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===se?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[Z&&/* @__PURE__ */S(o,{selected:n}),
|
|
11
|
+
/* @__PURE__ */S("span",{className:`min-w-0 ${re?"flex-auto":"flex-1"} truncate`,children:P?P(e,{selected:n,active:t===se}):e.label}),e.sublabel&&/* @__PURE__ */S(i,{grows:re,children:e.sublabel})]},e.value)},ce),Ye&&O&&
|
|
12
|
+
/* @__PURE__ */S("button",{id:pe(Pe.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{Z&&e.preventDefault(),Ce(Ye,Pe.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${Pe.length?`border-t ${g}`:""} ${se===Pe.length?"bg-gray-100":""}`,children:/* @__PURE__ */S("span",{className:"min-w-0 flex-1 truncate",children:O(Ye.value)})},`${ce}-typed`)]})]}),document.body)]});var Qe}export{L as SearchableSelect,W as fitChoice};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{ChartDefs as t,MOTION as e,stagger as a,glowId as i}from"./chunk-465RRWBY.js";import{ChartSkeleton as n}from"./chunk-M22B3Y5Y.js";import{useHighlight as o,autoHighlightIndex as l,highlightOpacity as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as s}from"./chunk-G4GVLK44.js";import{CartesianPlot as m}from"./chunk-
|
|
1
|
+
import{ChartDefs as t,MOTION as e,stagger as a,glowId as i}from"./chunk-465RRWBY.js";import{ChartSkeleton as n}from"./chunk-M22B3Y5Y.js";import{useHighlight as o,autoHighlightIndex as l,highlightOpacity as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as s}from"./chunk-G4GVLK44.js";import{CartesianPlot as m}from"./chunk-2JG5JU4M.js";import{useDragZoom as u,ChartZoomSummary as c}from"./chunk-QP4UPCXQ.js";import{CHART_INK as d,resolveSeriesColor as h,STATUS_VARS as f}from"./chunk-TZFACUMR.js";import{useShellStrings as p,useShellLocale as b}from"./chunk-4PAWQEXM.js";import{formatPercent as x,formatPlain as y}from"./chunk-C3QOHMR6.js";import{useId as v}from"react";import{jsx as M,jsxs as g,Fragment as k}from"react/jsx-runtime";function w({stacked:w=!1,stackMode:N="value",height:$=220,width:C,max:j,formatValue:F,yAxisLabel:L,className:A,emptyLabel:z,radius:T=3,loading:V=!1,animate:S=!0,glow:Y=!1,emphasise:E=!1,activeKey:G,highlight:Q="none",valueLabels:R=!1,onSelect:B,min:O,formatTooltipValue:P,tooltipLabels:U,barGap:W=4,seriesLabels:H=!1,zoomable:J=!0,series:K,labels:X}){const Z=v(),q=u(X.length,J),D=q.view?.[0]??0,I=q.slice(X),_=U?q.slice(U):void 0,tt=K.map(t=>({...t,data:q.slice(t.data),pointTones:t.pointTones?q.slice(t.pointTones):void 0,pointColors:t.pointColors?q.slice(t.pointColors):void 0})),{highlighted:et}=o(),at=p().charts,it=b(),nt=F??(t=>y(t,it)),ot=P??nt;if(V)/* @__PURE__ */return M(n,{height:$,width:C,variant:"bars",className:A});const lt=(t,e)=>{const a=t.pointColors?.[e];if(a)return a;const i=t.pointTones?.[e];return i?f[i]:h(t.slot,t.color,t.tone)},rt=tt.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(t=>Number.isFinite(t))),st=(t,e)=>{const a=t.data[e];return"number"==typeof a&&Number.isFinite(a)?a:0},mt=I.map((t,e)=>rt.reduce((t,a)=>t+st(a,e),0)),ut=I.map((t,e)=>rt.reduce((t,a)=>t+Math.max(0,st(a,e)),0)),ct=I.map((t,e)=>rt.reduce((t,a)=>t+Math.min(0,st(a,e)),0)),dt=w&&"percent"===N,ht=(t,e)=>mt[e]>0?t/mt[e]:null,ft=dt?[1]:w?[...ut,...ct]:rt.flatMap(t=>t.data.filter(Number.isFinite)),pt=(t,e)=>{const a=t.bandwidth/Math.max(1,rt.length),i=rt.length>1?Math.min(W,.25*a):0;return{offset:e*a+i/2,width:Math.max(1,a-i)}},bt=H&&!w?({x:t,y:e})=>{const a=Math.min(e.domain[1],Math.max(e.domain[0],0));return I.map((i,n)=>rt.map((i,o)=>{const l=i.data[n];if(!Number.isFinite(l))return null;const r=Math.min(e.domain[1],Math.max(e.domain[0],l)),{offset:s,width:m}=pt(t,o),u=t(n)+s+m/2,c=Math.min(e(r),e(a)),h=Math.max(e(r),e(a));if(m<13)return null;const f=Math.floor((h-c-12)/6.6),p=f>=Math.min(4,i.label.length),b=p&&i.label.length>f?`${i.label.slice(0,f-1).trimEnd()}…`:i.label,x=p?h-6:c-4;/* @__PURE__ */
|
|
2
2
|
return M("text",{"data-series-label":"true",x:u,y:x,transform:`rotate(-90 ${u} ${x})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:p?d.surface:d.label,children:b},`n${i.key}-${n}`)}))}:null;/* @__PURE__ */
|
|
3
3
|
return g(k,{children:[
|
|
4
|
-
/* @__PURE__ */M(m,{labels:
|
|
4
|
+
/* @__PURE__ */M(m,{labels:I,values:ft,height:$,width:C,max:dt?1:j,min:dt?void 0:O,formatValue:dt?t=>x(Math.round(100*t),0,it):nt,yAxisLabel:L,className:A,emptyLabel:z,onSelect:B?t=>B(D+t):void 0,zoom:J?q:void 0,ariaLabel:at.acrossCategories(rt.map(t=>t.label),I.length),tooltip:t=>/* @__PURE__ */M(s,{title:_?.[t]??I[t],rows:rt.map(e=>({key:e.key,label:e.label,color:lt(e,t),value:Number.isFinite(e.data[t])?dt?`${x(100*(ht(e.data[t],t)??0),1,it)} · ${ot(e.data[t])}`:ot(e.data[t]):void 0})),footnote:dt?at.inCategory(ot(mt[t])):void 0}),overlay:R&&!dt||bt?({x:t,y:e})=>/* @__PURE__ */g("g",{pointerEvents:"none",children:[bt?.({x:t,y:e}),R&&!dt&&I.map((a,i)=>{if(w){if(!rt.some(t=>Number.isFinite(t.data[i])))return null;const a=rt.reduce((t,e)=>t+st(e,i),0),n=a>=0?ut[i]:ct[i];/* @__PURE__ */
|
|
5
5
|
return M("text",{"data-value-label":"true",x:t.center(i),y:a>=0?e(n)-4:e(n)+12,textAnchor:"middle",fontSize:11,fill:d.label,style:{fontVariantNumeric:"tabular-nums"},children:nt(a)},`v${i}`)}return rt.map((a,n)=>{const o=a.data[i];if(!Number.isFinite(o))return null;const l=o,{offset:r,width:s}=pt(t,n);/* @__PURE__ */
|
|
6
|
-
return M("text",{"data-value-label":"true",x:t(i)+r+s/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:d.label,style:{fontVariantNumeric:"tabular-nums"},children:nt(l)},`v${a.key}-${i}`)})})]}):void 0,children:({x:n,y:o,bottom:s,active:m})=>{const u=
|
|
6
|
+
return M("text",{"data-value-label":"true",x:t(i)+r+s/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:d.label,style:{fontVariantNumeric:"tabular-nums"},children:nt(l)},`v${a.key}-${i}`)})})]}):void 0,children:({x:n,y:o,bottom:s,active:m})=>{const u=G?I.indexOf(G):-1,c=l(w?mt:rt[0]?.data??[],Q),h=m??(u>=0?u:c);/* @__PURE__ */
|
|
7
7
|
return g("g",{children:[
|
|
8
|
-
/* @__PURE__ */M(t,{id:
|
|
9
|
-
return M("rect",{x:y,y:g,width:v,height:$,rx:
|
|
8
|
+
/* @__PURE__ */M(t,{id:Z,glow:Y}),I.map((t,l)=>{let s=0,m=0;const u=o(Math.min(o.domain[1],Math.max(o.domain[0],0)));return rt.map((t,c)=>{const f=t.data[l];if(!Number.isFinite(f))return null;const p=dt?ht(f,l):f;if(null===p)return null;const b=lt(t,l),x=pt(n,c),y=w?n(l):n(l)+x.offset,v=w?Math.max(1,n.bandwidth):x.width;let g,k,N=!0;if(w){const t=p>=0?s:m,e=t+p;p>=0?s=e:m=e,g=o(Math.max(t,e)),k=o(Math.min(t,e)),N=0===t}else g=Math.min(o(p),u),k=Math.max(o(p),u);const $=Math.max(0,k-g-(w&&!N?2:0)),C=null===h||h===l,j=C?b:E?d.muted:b,F=r(t.key,et);/* @__PURE__ */
|
|
9
|
+
return M("rect",{x:y,y:g,width:v,height:$,rx:T,fill:j,fillOpacity:F??(C?1:E?.32:.45),filter:Y&&h===l?`url(#${i(Z)})`:void 0,className:"rosh-viz-mark"+(S?` ${e.rise}`:""),style:S?a(l*(w?1:rt.length)+c,26):void 0},`${t.key}-${l}`)})}),null!==m&&!E&&/* @__PURE__ */M("line",{x1:n.center(m),y1:o(o.domain[1]),x2:n.center(m),y2:s,stroke:d.axis,strokeWidth:1})]})}}),q.view&&/* @__PURE__ */M(c,{from:_?.[0]??I[0],to:_?.at(-1)??I[I.length-1],count:I.length,total:w?ot(mt.reduce((t,e)=>t+e,0)):void 0,rows:rt.map(t=>({s:t,sum:t.data.reduce((e,a,i)=>e+st(t,i),0)})).sort((t,e)=>e.sum-t.sum).map(({s:t,sum:e})=>({key:t.key,label:t.label,color:h(t.slot,t.color,t.tone),value:ot(e)})),onClear:q.clear})]})}export{w as ColumnChart};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ColoredBadge as e}from"./chunk-
|
|
1
|
+
import{ColoredBadge as e}from"./chunk-7TNAOZZ2.js";import{Button_default as n}from"./chunk-I4VIEGCX.js";import{useShellStrings as i}from"./chunk-4PAWQEXM.js";import{useId as t}from"react";import{jsx as m,jsxs as a}from"react/jsx-runtime";function s({items:s,heading:l,emptyText:r,className:c=""}){const o=i().media,d=t();return s.length?/* @__PURE__ */a("div",{className:c||void 0,children:[
|
|
2
2
|
/* @__PURE__ */m("p",{id:d,className:"text-xs font-medium text-ink-faint",children:l??o.usedIn(s.length)}),
|
|
3
3
|
/* @__PURE__ */m("ul",{"aria-labelledby":d,className:"mt-2 flex flex-col gap-1",children:s.map(i=>/* @__PURE__ */a("li",{className:"flex min-w-0 items-center gap-2 text-sm",children:[null!=i.kind&&/* @__PURE__ */m(e,{size:"xs",className:"flex-none",children:i.kind}),i.onOpen?/* @__PURE__ */m(n,{variant:"link",size:"sm",onClick:i.onOpen,className:"min-w-0 text-left",children:i.name}):/* @__PURE__ */m("span",{className:"min-w-0 break-words text-ink",children:i.name})]},i.key))})]}):/* @__PURE__ */m("p",{className:`text-sm text-ink-faint ${c}`.trim(),children:r??o.notUsed})}export{s as MediaUsedInList};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2UO47XB4.js";import{jsx as t,jsxs as r}from"react/jsx-runtime";var a=()=>/* @__PURE__ */t(e,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function i({items:e,value:i,onChange:n,"aria-label":l,className:s=""}){const c=Math.max(0,e.findIndex(e=>e.id===i));/* @__PURE__ */
|
|
2
2
|
return t("ol",{"aria-label":l,className:`grid items-start ${s}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((i,l)=>{const s=l<c?"complete":l===c?"current":"upcoming",o="complete"===s&&!!n,m=/* @__PURE__ */t("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===s?"bg-blue-600 text-white":"","current"===s?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===s?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===s?/* @__PURE__ */t(a,{}):l+1}),d=/* @__PURE__ */r("span",{className:"min-w-0 text-center",children:[
|
|
3
3
|
/* @__PURE__ */t("span",{className:"block text-sm font-medium "+("upcoming"===s?"text-gray-400":"text-gray-900"),children:i.label}),i.description&&/* @__PURE__ */t("span",{className:"block text-xs text-gray-500",children:i.description})]});/* @__PURE__ */
|
|
4
4
|
return r("li",{"aria-current":"current"===s?"step":void 0,className:"relative flex min-w-0 justify-center",children:[l<e.length-1&&/* @__PURE__ */t("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(l<c?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),o?/* @__PURE__ */r("button",{type:"button",onClick:()=>n?.(i.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-2 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[m,d]}):/* @__PURE__ */r("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[m,d]})]},i.id)})})}export{i as Stepper};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-FEQDZTZ7.js";import{Avatar as t}from"./chunk-DKGZPVLL.js";import{Input_default as a}from"./chunk-MAMWQCJ6.js";import{Button_default as i}from"./chunk-I4VIEGCX.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
|
|
3
3
|
/* @__PURE__ */n(t,{name:e.name,status:e.status}),
|
|
4
4
|
/* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-PN5FQVMB.js";import{Button_default as i}from"./chunk-I4VIEGCX.js";import{iconButtonClasses as n}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-2UO47XB4.js";import{Tooltip as a}from"./chunk-6XBWM453.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:g=!1,disabledReason:N,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:C,menuFooterLabel:W,align:z="end",side:B="bottom",menuMinWidth:F,linkAs:I,block:M=!1,className:L=""},O){const R=g&&(null!=N&&""!==N&&!1!==N)&&!v,X=x&&null!=j&&""!==j&&!1!==j,$=o(),A=/* @__PURE__ */t(i,{ref:O,type:b,variant:f,size:p,loading:v,leftIcon:k,block:M,disabled:g&&!R,"aria-disabled":!!R||void 0,disabledReason:R?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),D=M?"relative flex min-w-0 flex-1":"relative inline-flex",P=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
2
|
+
return s("div",{className:[M?"flex w-full":"inline-flex","items-stretch",L].filter(Boolean).join(" "),children:[null==w||""===w||R?A:/* @__PURE__ */t(a,{content:w,className:D,children:A}),
|
|
3
|
+
/* @__PURE__ */t(a,{content:X?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":X?$:void 0,items:h,align:z,side:B,minWidth:F,linkAs:I,disabled:x&&!X,"aria-disabled":X,onOpenChange:y,footer:C,footerLabel:W,triggerClassName:n({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(r,{name:"chevron-down",className:P,strokeWidth:2,"aria-hidden":"true"})})}),X&&/* @__PURE__ */t("span",{id:$,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{writeClipboard as e}from"./chunk-MQU3PZUS.js";import{IconButton_default as r}from"./chunk-PUF75SMJ.js";import{toast_default as t}from"./chunk-AKM6JBMD.js";import{Icon as n}from"./chunk-
|
|
1
|
+
import{writeClipboard as e}from"./chunk-MQU3PZUS.js";import{IconButton_default as r}from"./chunk-PUF75SMJ.js";import{toast_default as t}from"./chunk-AKM6JBMD.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{useShellStrings as a}from"./chunk-4PAWQEXM.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
|
|
2
2
|
return s(n,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
|
|
3
|
-
return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":M,className:
|
|
4
|
-
return m("div",{id:
|
|
3
|
+
return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":M,className:B=""}){const[U,C]=i(!1),P=o(null),T=a().copy;c(()=>()=>{P.current&&clearTimeout(P.current)},[]);const A=l(async()=>{await e(n)?(C(!0),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{C(!1),P.current=null},2e3),w?.(n)):t.error(T.failed)},[n,w,T]),{box:J,button:Q}=p[g],S=!v;/* @__PURE__ */
|
|
4
|
+
return m("div",{id:S?void 0:j,"aria-describedby":S?void 0:M,className:["inline-flex max-w-full items-center rounded-md",u[k],J,B].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
|
|
5
5
|
/* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(N?"whitespace-pre-wrap break-all":"truncate"),title:N?void 0:n,children:y??n}),!v&&/* @__PURE__ */m(d,{children:[
|
|
6
|
-
/* @__PURE__ */s(r,{id:j,"aria-label":x?
|
|
7
|
-
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:
|
|
6
|
+
/* @__PURE__ */s(r,{id:j,"aria-label":x?T.copyLabel(x):T.copy,"aria-describedby":M,onClick:A,className:`${Q} text-gray-400`,children:/* @__PURE__ */s(U?h:b,{})}),
|
|
7
|
+
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:U?T.copied:""})]})]})}export{y as Snippet};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{IconButton_default as e}from"./chunk-PUF75SMJ.js";import{CloseGlyph as t}from"./chunk-
|
|
1
|
+
import{IconButton_default as e}from"./chunk-PUF75SMJ.js";import{CloseGlyph as t}from"./chunk-B7UCXROE.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-6RX4PVBU.js";import{Button_default as s}from"./chunk-I4VIEGCX.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{useShellStrings as c}from"./chunk-4PAWQEXM.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,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{navIcons as e}from"./chunk-CY5N5OA3.js";import{Icon as t}from"./chunk-
|
|
1
|
+
import{navIcons as e}from"./chunk-CY5N5OA3.js";import{Icon as t}from"./chunk-2UO47XB4.js";import{isValidElement as r,cloneElement as n}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var l=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function a(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r);return l[Math.abs(t)%l.length]}var d={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},s={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},c={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},f={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function p({className:e}){/* @__PURE__ */
|
|
2
2
|
return o(t,{name:"folder",look:"solid",className:e})}function u(t,r){return r&&e[r]||(t?e[t]:void 0)}var m=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function h({entityType:e,isSelected:t,entityId:l,label:h,fileKind:w}){const g="preview-file"===e&&w,y=g?f[w]:null,x=g?c[w]:null;if("folder"===e)/* @__PURE__ */
|
|
3
3
|
return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o(p,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=u(l,h),i=a(l||h||"page");/* @__PURE__ */
|
|
4
4
|
return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${i} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&r(e)?n(e,{className:"h-7 w-7 text-white"}):m})})}/* @__PURE__ */
|
|
@@ -10,4 +10,4 @@ return i("div",{className:"w-12 h-12 relative flex items-center justify-center "
|
|
|
10
10
|
/* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${y??d[e]??"text-gray-600"}`,children:x??s[e]??e.slice(0,3).toUpperCase()})]})}function w({item:e}){if("folder"===e.entityType)/* @__PURE__ */
|
|
11
11
|
return o(p,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=u(e.entityId,e.label);/* @__PURE__ */
|
|
12
12
|
return o("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${a(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&r(t)?n(t,{className:"h-3 w-3 text-white"}):/* @__PURE__ */o("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const i=("preview-file"===e.entityType&&e.fileKind?f[e.fileKind]:d[e.entityType])??"text-gray-400";/* @__PURE__ */
|
|
13
|
-
return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function g(e){return"preview-file"===e.entityType&&e.fileKind?c[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":s[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var y=null,x=/* @__PURE__ */new Set;function b(e){y=e,x.forEach(e=>e())}function v(e){return x.add(e),()=>{x.delete(e)}}function _(){return y}var k="__REACT_OS_SHELL_FILES_VIEW__",N="react-os-shell:files-show-trash",C="react-os-shell:files-open-desktop-folder";function j(){"undefined"!=typeof window&&(window[k]="trash",window.dispatchEvent(new CustomEvent(N)))}function I(e){"undefined"!=typeof window&&(window[k]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(C,{detail:{folderId:e}})))}function
|
|
13
|
+
return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function g(e){return"preview-file"===e.entityType&&e.fileKind?c[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":s[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var y=null,x=/* @__PURE__ */new Set;function b(e){y=e,x.forEach(e=>e())}function v(e){return x.add(e),()=>{x.delete(e)}}function _(){return y}var k="__REACT_OS_SHELL_FILES_VIEW__",N="react-os-shell:files-show-trash",C="react-os-shell:files-open-desktop-folder";function j(){"undefined"!=typeof window&&(window[k]="trash",window.dispatchEvent(new CustomEvent(N)))}function I(e){"undefined"!=typeof window&&(window[k]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(C,{detail:{folderId:e}})))}function T(){if("undefined"==typeof window)return null;const e=window[k];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function P(){const e=T();return"undefined"!=typeof window&&(window[k]=null),e}export{w as DesktopItemMiniIcon,C as FILES_OPEN_DESKTOP_FOLDER_EVENT,N as FILES_SHOW_TRASH_EVENT,h as FileIconTile,p as FolderGlyph,P as consumeFilesViewRequest,g as desktopItemTypeLabel,_ as getDesktopFoldersSnapshot,T as peekFilesViewRequest,b as publishDesktopFolders,I as requestFilesDesktopFolderView,j as requestFilesTrashView,v as subscribeDesktopFolders};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2UO47XB4.js";import{useShellStrings as r}from"./chunk-4PAWQEXM.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";var s={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},c={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},a={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function i({tone:r}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
|
|
2
2
|
return n(e,{name:"check",...t});case"error":/* @__PURE__ */
|
|
3
3
|
return n(e,{name:"close",...t});case"warning":/* @__PURE__ */
|
|
4
4
|
return n(e,{name:"error",...t});default:/* @__PURE__ */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2UO47XB4.js";import{useShellStrings as t}from"./chunk-4PAWQEXM.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
|
|
2
2
|
return n(e,t?{name:"check",className:`${r} text-green-600`,"aria-hidden":"true"}:{name:"copy",className:r,"aria-hidden":"true"})}function m({text:e}){const{copied:r,copy:o}=a(e),c=t().copy;/* @__PURE__ */
|
|
3
3
|
return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(e),className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */n(u,{copied:r})})}export{m as CopyButton,u as CopyGlyph,a as useCopyText};
|