efficient-shell 12.2.0 → 12.3.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 +23 -0
- package/dist/{Browser-UK645CZ3.js → Browser-OE7IMID6.js} +14 -14
- package/dist/Calculator-W6YA44OY.js +29 -0
- package/dist/{CurrencyConverter-XNWE5MQW.js → CurrencyConverter-TLI6PVRE.js} +8 -8
- package/dist/Files-5WRVSC5R.js +121 -0
- package/dist/{Notepad-JP52QKUC.js → Notepad-TUW4JP7M.js} +10 -10
- package/dist/PdfViewer-GFQAIHDP.js +1 -0
- package/dist/{PomodoroTimer-SBV43YX6.js → PomodoroTimer-FPGRFPNT.js} +68 -68
- package/dist/{Preview-TKEDKVNI.js → Preview-BJRRRU4N.js} +23 -23
- package/dist/Sidebar-ROMFJHCD.js +44 -0
- package/dist/{Stock-GODZPUR3.js → Stock-P7D5WNKC.js} +3 -3
- package/dist/{Weather-2IIV4CFT.js → Weather-OUHUYBZ6.js} +18 -18
- package/dist/{WorldClock-JW4MLMCB.js → WorldClock-WXIV2KC6.js} +7 -7
- package/dist/ai/index.d.ts +9 -1
- package/dist/ai/index.js +79 -79
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FlowChart.d.ts +25 -0
- package/dist/charts/FlowChart.js +2 -0
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/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/charts/flowSpec.d.ts +94 -0
- package/dist/charts/flowSpec.js +1 -0
- package/dist/{chunk-CTW2OKYS.js → chunk-2B4EKAZL.js} +2 -2
- package/dist/{chunk-YRZP7JN4.js → chunk-2KNVUOWJ.js} +16 -16
- package/dist/{chunk-VGWYAYHB.js → chunk-3QYAYBJE.js} +3 -3
- package/dist/{chunk-FOTDGSY5.js → chunk-45IVWLKF.js} +1 -1
- package/dist/chunk-4DZVWK7U.js +7 -0
- package/dist/{chunk-5V6SA77P.js → chunk-53WYJ5LZ.js} +11 -11
- package/dist/{chunk-CC42UKIT.js → chunk-54K2ADBT.js} +1 -1
- package/dist/{chunk-VFBBGLRA.js → chunk-5BV2WW74.js} +13 -13
- package/dist/{chunk-LUSIZ2BK.js → chunk-5LZTYOYD.js} +7 -7
- package/dist/{chunk-GJJKWGBX.js → chunk-67JHJO6V.js} +10 -10
- package/dist/{chunk-VZLYB5LX.js → chunk-6DZGOGB2.js} +1 -1
- package/dist/chunk-6GDZUW3L.js +6 -0
- package/dist/{chunk-JCUG572K.js → chunk-6JDR6T4U.js} +1 -1
- package/dist/{chunk-PKNHSZWK.js → chunk-6JKSRXZM.js} +3 -3
- package/dist/{chunk-BXZNMSTZ.js → chunk-6NHPL5JL.js} +1 -1
- package/dist/{chunk-7EK7JNR4.js → chunk-6TLSXBKC.js} +1 -1
- package/dist/{chunk-NHBDLW52.js → chunk-6Y2BQI44.js} +1 -1
- package/dist/{chunk-XQUXL75F.js → chunk-74LZVJND.js} +1 -1
- package/dist/{chunk-GFBQ53WN.js → chunk-7HIHQR3X.js} +1 -1
- package/dist/{chunk-56ESGDIC.js → chunk-7JY3YYN4.js} +4 -4
- package/dist/{chunk-VQPZDZ3R.js → chunk-7TZRICMH.js} +4 -4
- package/dist/{chunk-EEVKJJ5S.js → chunk-AANXPLMA.js} +4 -4
- package/dist/{chunk-YKHAI5IZ.js → chunk-ASQX3GXB.js} +5 -5
- package/dist/chunk-AUZKIL62.js +23 -0
- package/dist/{chunk-4RTDZSGH.js → chunk-B3PNZBZM.js} +18 -18
- package/dist/{chunk-7ZYEDXZX.js → chunk-BGJMDP6J.js} +1 -1
- package/dist/{chunk-DSHEOC2O.js → chunk-CVLWJBR5.js} +1 -1
- package/dist/chunk-DCICBH2L.js +3 -0
- package/dist/chunk-DICWZEGH.js +2 -0
- package/dist/{chunk-UDJLRTQB.js → chunk-DNLRUZGS.js} +1 -1
- package/dist/{chunk-ACNDPAAT.js → chunk-DONZDILI.js} +1 -1
- package/dist/{chunk-J5ISQYVM.js → chunk-DPUM3H5N.js} +1 -1
- package/dist/{chunk-ZACNIKIQ.js → chunk-DULMOL3I.js} +1 -1
- package/dist/{chunk-CQCMJHDM.js → chunk-F245EG2A.js} +5 -5
- package/dist/{chunk-BFA5U5JF.js → chunk-F44E76EC.js} +11 -11
- package/dist/chunk-FAERBT6Y.js +1 -0
- package/dist/{chunk-Z43XVU2P.js → chunk-FGCIEJPP.js} +1 -1
- package/dist/{chunk-AQULCKKZ.js → chunk-FPRQB5W6.js} +11 -11
- package/dist/{chunk-KHVECW4M.js → chunk-FPZBHNZU.js} +6 -6
- package/dist/{chunk-27XV4TAU.js → chunk-GR43CABV.js} +2 -2
- package/dist/{chunk-LLBH6PHE.js → chunk-GYDCXCJT.js} +1 -1
- package/dist/{chunk-VW7W6LCV.js → chunk-H6PFTU3L.js} +1 -1
- package/dist/{chunk-SCCAMJB4.js → chunk-HE767CVB.js} +1 -1
- package/dist/{chunk-M7DFM2N7.js → chunk-HRMG2WMW.js} +63 -63
- package/dist/{chunk-L75RBQFH.js → chunk-IL56C56I.js} +2 -2
- package/dist/{chunk-VPYD7UJM.js → chunk-IMRGGJIJ.js} +3 -3
- package/dist/chunk-IWFWPFYQ.js +13 -0
- package/dist/chunk-IXAYZNOZ.js +11 -0
- package/dist/{chunk-DU5IBIZQ.js → chunk-JYGUTY6R.js} +1 -1
- package/dist/{chunk-DKUF7BD5.js → chunk-KDWK5WGU.js} +1 -1
- package/dist/{chunk-CKURTHGW.js → chunk-KT5LLPUV.js} +1 -1
- package/dist/chunk-KZD2AFH2.js +13 -0
- package/dist/{chunk-MKP2HSWX.js → chunk-KZNJXV5I.js} +3 -3
- package/dist/{chunk-QBD7V4TK.js → chunk-LBMC6GR5.js} +1 -1
- package/dist/{chunk-XARBHOEZ.js → chunk-LDEFEPPL.js} +1 -1
- package/dist/{chunk-ONYPN3JY.js → chunk-LGK47SEN.js} +11 -11
- package/dist/{chunk-ESDWHHQY.js → chunk-LKVS4WCZ.js} +1 -1
- package/dist/chunk-M3OEWPXZ.js +1 -0
- package/dist/chunk-M3PUAGXJ.js +9 -0
- package/dist/{chunk-BXZSLRNO.js → chunk-MQKUGIN7.js} +12 -12
- package/dist/{chunk-63QLZYMN.js → chunk-NDLXD4EY.js} +5 -5
- package/dist/{chunk-2OMM2AG3.js → chunk-NEAT7BIP.js} +1 -1
- package/dist/{chunk-HS4EWT6L.js → chunk-NHNRNT4T.js} +2 -2
- package/dist/{chunk-NZYI4XV5.js → chunk-NRLTGGCS.js} +5 -5
- package/dist/chunk-NSOAHIQZ.js +11 -0
- package/dist/{chunk-TTSZSLQL.js → chunk-O6H2ZD32.js} +7 -7
- package/dist/{chunk-XBDHRMQI.js → chunk-OR5HUQSB.js} +9 -9
- package/dist/{chunk-FWUXYNWF.js → chunk-OY3JH66O.js} +4 -4
- package/dist/chunk-P3BLJCTQ.js +19 -0
- package/dist/{chunk-SX5CSXZO.js → chunk-P4L74UA5.js} +2 -2
- package/dist/chunk-PA273FZF.js +9 -0
- package/dist/{chunk-5THF6BJS.js → chunk-PFMZL3ZG.js} +2 -2
- package/dist/{chunk-PXIP246B.js → chunk-PT77FC5X.js} +1 -1
- package/dist/{chunk-AJ5NU7UH.js → chunk-Q2MW334M.js} +1 -1
- package/dist/{chunk-ORLQUGIN.js → chunk-QA33EHHO.js} +4 -4
- package/dist/{chunk-GRB4LKZC.js → chunk-QOQ6GXVA.js} +5 -5
- package/dist/{chunk-4UGFNTZ3.js → chunk-RQ4UIWWD.js} +11 -11
- package/dist/{chunk-2DOMIOYR.js → chunk-RYBYTUGZ.js} +1 -1
- package/dist/{chunk-JCTOQOVO.js → chunk-S6BGMLXI.js} +1 -1
- package/dist/chunk-SEJAT3UE.js +1 -0
- package/dist/{chunk-7F4U43YN.js → chunk-SGNJ7I7P.js} +4 -4
- package/dist/{chunk-ZYFBV4C7.js → chunk-SKFFBBAG.js} +2 -2
- package/dist/{chunk-FEJFGFPF.js → chunk-SPJIFRNY.js} +6 -6
- package/dist/{chunk-QN56R4V4.js → chunk-SSUZAOGI.js} +10 -10
- package/dist/{chunk-CENTHUBD.js → chunk-SYDGCECZ.js} +8 -8
- package/dist/{chunk-5F6KJAF3.js → chunk-THASH6OO.js} +13 -13
- package/dist/{chunk-I7H3OIYX.js → chunk-TKXUDCOI.js} +1 -1
- package/dist/{chunk-ZG3RF2VE.js → chunk-U7PXMVIY.js} +1 -1
- package/dist/chunk-UCIOCS4X.js +2 -0
- package/dist/{chunk-MRFNJZRR.js → chunk-UIWGVOFH.js} +8 -4
- package/dist/{chunk-HB2XXIQG.js → chunk-UMQLDWSS.js} +6 -6
- package/dist/chunk-VF53GD6D.js +5 -0
- package/dist/{chunk-CRU2BNEM.js → chunk-XGVMOV3O.js} +7 -7
- package/dist/{chunk-LOEOCZCN.js → chunk-Y4RERPFN.js} +1 -1
- package/dist/{chunk-ZUBTNUVE.js → chunk-Y7ANTS5W.js} +1 -1
- package/dist/chunk-YAQ5RF3H.js +28 -0
- package/dist/{chunk-ANSQT5ZS.js → chunk-ZATTQ3FX.js} +1 -1
- package/dist/{chunk-CRB5GM4W.js → chunk-ZDO62V4I.js} +1 -1
- package/dist/{chunk-HICNRXYB.js → chunk-ZICLAMMR.js} +1 -1
- package/dist/{chunk-IRZ6XM5A.js → chunk-ZXNJSSRV.js} +1 -1
- package/dist/{chunk-6XC3XX7F.js → chunk-ZZ67Q5HJ.js} +6 -6
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/payment.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +516 -516
- package/dist/map/index.js +3 -3
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/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/TimelineTrack.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-6XGTP5OQ.js +0 -29
- package/dist/Files-LVZNO6EQ.js +0 -121
- package/dist/PdfViewer-ZI3QOG4G.js +0 -1
- package/dist/Sidebar-XVVZJ7PR.js +0 -44
- package/dist/chunk-2T7MZ77B.js +0 -3
- package/dist/chunk-A2ZEGD2S.js +0 -11
- package/dist/chunk-AJO55X66.js +0 -6
- package/dist/chunk-BD4OHYQB.js +0 -13
- package/dist/chunk-BPECY7I7.js +0 -13
- package/dist/chunk-CWTY4GTU.js +0 -5
- package/dist/chunk-FUUJJ7OH.js +0 -7
- package/dist/chunk-GEZ45J4Z.js +0 -2
- package/dist/chunk-GGSPY3Q4.js +0 -23
- package/dist/chunk-HFDSKCPL.js +0 -1
- package/dist/chunk-HGZZXA2N.js +0 -9
- package/dist/chunk-HTDZ3XAJ.js +0 -9
- package/dist/chunk-HY3JYAUH.js +0 -19
- package/dist/chunk-UE54EN4C.js +0 -2
- package/dist/chunk-UVEHJRPE.js +0 -1
- package/dist/chunk-YAD7TML2.js +0 -28
- /package/dist/{chunk-MXK7A6ZM.js → chunk-K5A62ZS5.js} +0 -0
- /package/dist/{chunk-C4XV42QP.js → chunk-R3K2BNFF.js} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as r,OverlayLayerProvider as t}from"./chunk-3DVNXNTF.js";import{useDiscardGuard as i}from"./chunk-R3K2BNFF.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as l}from"./chunk-7QSDPSXP.js";import{useFocusTrap as n,useScrollLock as a}from"./chunk-CDAJKLGL.js";import{Icon as s}from"./chunk-UIWGVOFH.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useHydrated as c}from"./chunk-D65T4H6J.js";import{useShellStrings as m}from"./chunk-43MCNASD.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{useRef as f,useId as u,useState as p,useEffect as b}from"react";import{createPortal as g}from"react-dom";import{jsxs as x,Fragment as y,jsx as v}from"react/jsx-runtime";var w={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},k={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function N(e,r){const t=window.innerHeight-(r.top+r.height);if("bottom"===e)return{left:r.left,width:r.width,bottom:t};const i={top:r.top,height:r.height};return"left"===e?{...i,left:r.left}:{...i,right:window.innerWidth-(r.left+r.width)}}function j({onClose:e}){const r=m().dialog;/* @__PURE__ */
|
|
2
|
+
return v("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */v(s,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function C({open:s,onClose:m,side:C="right",size:W="md",title:D,description:F,footer:H,children:L,blocking:U=!1,dirty:V=!1,initialFocus:z,"aria-label":A,"aria-labelledby":B,"aria-describedby":G,className:I=""}){const J=f(null),S=u(),T=u(),K=u(),P=e(c()),[Q,X]=p(null),M=i({open:s,dirty:V,onClose:m,title:D,layer:Q}),O=f(null),R=r(s&&null!==P,O);if(l(s),n(J,s&&null!==P,z),a(s),b(()=>{if(s)return h(()=>(U||M(),!0),()=>J.current)},[s,U,M]),!s||!P)return null;const Y="bottom"===C,Z={...Y?{maxHeight:"85vh"}:{},...R?N(C,R):{}};/* @__PURE__ */
|
|
3
|
+
return x(y,{children:[/* @__PURE__ */v("span",{ref:O,hidden:!0,"data-popup-anchor":""}),g(
|
|
4
|
+
/* @__PURE__ */v(t,{value:Q,children:/* @__PURE__ */x("div",{ref:X,className:"fixed inset-0",style:{zIndex:d.overlay},role:"presentation","data-overlay-layer":"",children:[
|
|
5
|
+
/* @__PURE__ */v("div",{className:"fixed inset-0 bg-black/30",onClick:U?void 0:M,"aria-hidden":"true"}),
|
|
6
|
+
/* @__PURE__ */x("div",{ref:J,...o({modal:!0,titleId:D?K:void 0,labelledBy:B,label:A}),"aria-describedby":G??(F?T:L?S:void 0),"data-drawer-side":C,"data-popup-panel":"",style:Z,className:["fixed flex flex-col bg-white shadow-xl",Y?"":`w-full max-w-full ${w[W]}`,R?"":k[C],Y?"rounded-t-xl":"",I].filter(Boolean).join(" "),children:[D?/* @__PURE__ */x("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
7
|
+
/* @__PURE__ */x("div",{className:"min-w-0",children:[
|
|
8
|
+
/* @__PURE__ */v("h2",{id:K,className:"text-base font-semibold text-gray-900",children:D}),F&&/* @__PURE__ */v("p",{id:T,className:"mt-0.5 text-sm text-gray-500",children:F})]}),!U&&/* @__PURE__ */v(j,{onClose:M})]}):!U&&/* @__PURE__ */v("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */v(j,{onClose:M})}),
|
|
9
|
+
/* @__PURE__ */x("div",{id:S,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[F&&!D&&/* @__PURE__ */v("p",{id:T,className:("mb-3 text-sm text-gray-500 "+(U?"":"pr-8")).trim(),children:F}),L]}),H&&/* @__PURE__ */v("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:H})]})]})}),P)]})}export{C as Drawer};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-UKBXQXDZ.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{
|
|
1
|
+
import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-UKBXQXDZ.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{TH_ONE_LINE as l}from"./chunk-WGLHB6WE.js";import{Icon as n}from"./chunk-UIWGVOFH.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-43MCNASD.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,j]=c(!1),S=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:_,onResizeStart:z,onDragStart:W,onDragOver:$,onDrop:I,onDragEnd:L,toggleColumn:A,resetColumns:B,draggedIdx:E,dropGap:G}=t(f,S),{hasAnyPerm:P}=r(),R=i().columns,[T,U]=c(!1),[F,H]=c(!1),[K,O]=c(!1),Y=m(null),J=k.length>0&&P(k);e(Y,h(()=>{T&&U(!1)},[T]));const M=C.reduce((e,t)=>e+t.width,0),Q=C.map(e=>`${e.width}px`),V={tableLayout:"fixed",width:M,minWidth:"100%"},X=m(null),Z=h(e=>{const t=X.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),q=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
|
|
2
2
|
return u("div",{className:"flex flex-col flex-1 min-h-0 "+(w?"-mx-4":""),children:[
|
|
3
|
-
/* @__PURE__ */p("div",{ref:
|
|
3
|
+
/* @__PURE__ */p("div",{ref:X,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:V,children:[
|
|
4
4
|
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:Q[t]}},e.key))}),
|
|
5
|
-
/* @__PURE__ */p("thead",{className:"bg-gray-50",children:/* @__PURE__ */p("tr",{children:C.map((e,t)=>{const r=g.find(t=>t.key===e.key),o=r?.sortField??("_select"!==e.key?e.key:void 0),
|
|
6
|
-
return u("th",{className:`${
|
|
7
|
-
/* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&y?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&y?e=>{e.stopPropagation(),y(o)}:void 0,children:[e.headerNode??e.label,
|
|
8
|
-
/* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:
|
|
9
|
-
/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:
|
|
5
|
+
/* @__PURE__ */p("thead",{className:"bg-gray-50",children:/* @__PURE__ */p("tr",{children:C.map((e,t)=>{const r=g.find(t=>t.key===e.key),o=r?.sortField??("_select"!==e.key?e.key:void 0),n=x&&o&&x.field===o,a="_select"===e.key;/* @__PURE__ */
|
|
6
|
+
return u("th",{className:`${l} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${E===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>W(t),onDragOver:a?void 0:e=>$(t,e),onDrop:a?void 0:e=>I(t,e),onDragEnd:a?void 0:L,style:a?void 0:{cursor:"grab"},children:[
|
|
7
|
+
/* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&y?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&y?e=>{e.stopPropagation(),y(o)}:void 0,children:[e.headerNode??e.label,n&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===x.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),G===t&&/* @__PURE__ */p("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"}),t===C.length-1&&G===C.length&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"})]},e.key)})})})]})}),
|
|
8
|
+
/* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:Z,children:[
|
|
9
|
+
/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:V,children:[
|
|
10
10
|
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:Q[t]}},e.key))}),N(C)]}),v]}),void 0!==b&&/* @__PURE__ */u("div",{className:"border-t border-gray-200 px-4 py-2 text-sm text-gray-500 shrink-0 flex items-center justify-between",children:[
|
|
11
11
|
/* @__PURE__ */p("span",{children:b}),
|
|
12
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:Y,children:[w&&q&&/* @__PURE__ */p("button",{onClick:()=>j(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?
|
|
13
|
-
/* @__PURE__ */p("button",{onClick:B,className:"text-2xs text-ink-faintest hover:text-gray-600",children:
|
|
14
|
-
/* @__PURE__ */p("button",{onClick:()=>
|
|
15
|
-
/* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:
|
|
16
|
-
/* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>A(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),
|
|
12
|
+
/* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:Y,children:[w&&q&&/* @__PURE__ */p("button",{onClick:()=>j(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?R.hideSelection:R.showSelection,children:D?R.selectDone:R.select}),
|
|
13
|
+
/* @__PURE__ */p("button",{onClick:B,className:"text-2xs text-ink-faintest hover:text-gray-600",children:R.reset}),
|
|
14
|
+
/* @__PURE__ */p("button",{onClick:()=>U(!T),className:"text-gray-400 hover:text-gray-600",title:R.choose,children:/* @__PURE__ */p(n,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),T&&/* @__PURE__ */u("div",{className:"absolute bottom-full right-0 mb-1 w-52 rounded-(--radius-popup) z-(--z-popup) py-1 max-h-80 overflow-y-auto",style:s(),children:[
|
|
15
|
+
/* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:R.heading}),_.filter(e=>"_select"!==e.key).map(e=>/* @__PURE__ */u("label",{className:"flex items-center gap-2 px-3 py-1 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer",children:[
|
|
16
|
+
/* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>A(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),J&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{H(!0);const e=_.filter(e=>!e.hidden).map(e=>e.key),t=w?"mobile":"desktop",r={visible_columns:e};x&&(r.sort=x);try{await a.patch(`/auth/default-columns/${f}/`,r,{params:{viewport:t}}).catch(()=>a.post("/auth/default-columns/",{table_id:f,viewport:t,...r})),O(!0),setTimeout(()=>O(!1),2e3)}catch{}H(!1)},disabled:F,className:"text-2xs w-full text-center py-1 rounded "+(K?"text-green-600":"text-ink-faint hover:text-blue-600"),children:F?"...":K?R.savedDefault:R.saveDefault})})]})]})]})]})}export{f as ResizableTable};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-RXHTIJ64.js";import{Icon as l}from"./chunk-
|
|
1
|
+
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-RXHTIJ64.js";import{Icon as l}from"./chunk-UIWGVOFH.js";import{useBrowserState as a}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-43MCNASD.js";import{useId as o,useRef as c,useEffect as s,Children as u,isValidElement as d}from"react";import{jsx as m,jsxs as h,Fragment as p}from"react/jsx-runtime";function f({children:e,count:t,countLabel:n}){return null==t?/* @__PURE__ */m("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */h("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:[
|
|
2
2
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",children:e}),
|
|
3
|
-
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),
|
|
4
|
-
/* @__PURE__ */m("span",{"aria-hidden":"true",title:
|
|
5
|
-
/* @__PURE__ */m("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof l?l:void 0,children:l}),y&&/* @__PURE__ */m("span",{className:"sr-only",children:
|
|
6
|
-
return m("button",1===k?{ref:
|
|
3
|
+
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),I=o(),S=c(null),C=c(l);C.current=l,s(()=>{if(j&&d)return j.report(I,()=>C.current,S.current)},[j,d,I]);const W=/* @__PURE__ */h(p,{children:[null!=x&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:x}),y&&
|
|
4
|
+
/* @__PURE__ */m("span",{"aria-hidden":"true",title:N,className:`shrink-0 h-1.5 w-1.5 rounded-full ${y.fill}`}),
|
|
5
|
+
/* @__PURE__ */m("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof l?l:void 0,children:l}),y&&/* @__PURE__ */m("span",{className:"sr-only",children:N}),null!=a&&/* @__PURE__ */m(r,{count:a,label:u,active:d}),null!=g&&/* @__PURE__ */m("span",{className:"shrink-0",children:g})]});/* @__PURE__ */
|
|
6
|
+
return m("button",1===k?{ref:S,type:"button",onClick:f,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */m("span",{className:b(d),children:W})}:{ref:S,type:"button",onClick:f,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(d?"bg-accent-tint font-medium text-blue-700":"text-ink hover:bg-gray-100"),children:W})}function g({label:e,count:t,countLabel:n,children:i,defaultExpanded:c=!0,storageKey:s}){const p=o(),[f,b]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return c},c),x=!f&&u.toArray(i).some(e=>d(e)&&!0===e.props.active);/* @__PURE__ */
|
|
7
7
|
return h("div",{children:[
|
|
8
8
|
/* @__PURE__ */h("button",{type:"button",onClick:()=>{const e=!f;if(b(e),s)try{window.localStorage.setItem(s,e?"1":"0")}catch{}},"aria-expanded":f,"aria-controls":p,className:"flex w-full items-center gap-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(x?"bg-accent-tint text-blue-700":"text-ink-strong hover:bg-gray-100"),children:[
|
|
9
9
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-UIWGVOFH.js";import{useShellStrings as t}from"./chunk-43MCNASD.js";import{jsxs as r,jsx as a}from"react/jsx-runtime";function n({title:n,message:s,description:d,hint:i,variant:m,frameless:c,icon:o,children:l}){const h=c?"none":m??"dashed",x="boolean"!=typeof o&&null!=o?o:null,p=!x&&(o??"card"!==h),u=t().emptyState,y=s??(n?void 0:u.message),f=d??i;/* @__PURE__ */
|
|
2
2
|
return r("div",{className:`flex flex-col items-center justify-center text-center ${"card"===h?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===h?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[x&&/* @__PURE__ */a("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:x}),p&&/* @__PURE__ */a(e,{name:"inbox",className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",strokeWidth:1}),n&&/* @__PURE__ */a("h3",{className:"text-sm font-medium text-gray-900",children:n}),y&&/* @__PURE__ */a("p",{className:"text-sm text-gray-500 "+(n?"mt-2":""),children:y}),f&&/* @__PURE__ */a("p",{className:"text-xs text-gray-400 mt-1",children:f}),l&&/* @__PURE__ */a("div",{className:"mt-4",children:l})]})}export{n as EmptyState};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-
|
|
2
|
-
return p(n,{portal:!0,minWidth:x,style:
|
|
1
|
+
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-GYDCXCJT.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-F44E76EC.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:D="",autoFocus:H=!0}){const L=s(null),C=a(),[j,A]=d(null),S=s(w);S.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});A(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const U=s(null),T=s(!1);m(()=>(U.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||U.current?.focus?.({preventScroll:!0})}),[]),m(()=>{j&&!T.current&&H&&(T.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[j,H]),m(()=>{if(H)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[H]),m(()=>u(e=>"Escape"===e.key&&(S.current(),!0),()=>L.current),[]),m(()=>{const e=()=>S.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const F=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void S.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),W=j?{left:j.left,top:j.top,maxHeight:j.maxHeight,...j.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
|
|
2
|
+
return p(n,{portal:!0,minWidth:x,style:W,onClose:w,className:D,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:C,role:"menu","aria-label":b,"aria-describedby":y?t(y,C):void 0,"data-context-menu":"",onKeyDown:F,children:[y&&e(y,{menuId:C,choose:e=>{e.disabled||(S.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>S.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CloseGlyph as e}from"./chunk-
|
|
1
|
+
import{CloseGlyph as e}from"./chunk-LBMC6GR5.js";import{IconButton_default as t}from"./chunk-LE5LWALR.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-7KIDOIPY.js";import{Button_default as s}from"./chunk-EOVXFXVV.js";import{Icon as i}from"./chunk-UIWGVOFH.js";import{useShellStrings as c}from"./chunk-43MCNASD.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
2
2
|
return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
3
3
|
return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
|
|
4
4
|
return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
|
|
@@ -6,8 +6,8 @@ return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,childre
|
|
|
6
6
|
return u("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-line bg-surface-sunken py-1 pl-2 pr-1 text-xs text-ink",children:[c?/* @__PURE__ */d("img",{src:c,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */d("span",{className:"text-gray-400",children:/* @__PURE__ */d(p,{})}),
|
|
7
7
|
/* @__PURE__ */d("span",{className:"min-w-0 truncate",title:t.name,children:t.name}),
|
|
8
8
|
/* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:n(t.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(t.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */d(e,{className:"h-3.5 w-3.5"})})]},`${t.name}-${t.size}-${s}`)})})}function b({onClick:e,count:n=0,variant:r="button",label:a,disabled:i=!1}){const l=c().files,o=a??l.attach,p=n>0?`${o} (${n})`:o;return"icon"===r?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
|
|
9
|
-
/* @__PURE__ */d(t,{"aria-label":p,onClick:e,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:
|
|
10
|
-
/* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{
|
|
9
|
+
/* @__PURE__ */d(t,{"aria-label":p,onClick:e,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:L}){const v=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),y=l([]);return o(()=>{j&&v.rejections.length>0&&v.rejections!==y.current&&(y.current=v.rejections,j(v.rejections))},[v.rejections,j]),/* @__PURE__ */u(h,{intake:v,dropLabel:p,className:N,children:[L,
|
|
10
|
+
/* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{v.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
|
|
11
11
|
/* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
|
|
12
|
-
/* @__PURE__ */d(b,{onClick:
|
|
13
|
-
/* @__PURE__ */d(a,{rejections:
|
|
12
|
+
/* @__PURE__ */d(b,{onClick:v.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
|
|
13
|
+
/* @__PURE__ */d(a,{rejections:v.rejections})]})}export{b as AttachButton,h as AttachmentDropZone,f as AttachmentList,x as ComposerAttachments,m as PaperclipGlyph};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-LBMC6GR5.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-7QSDPSXP.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-CDAJKLGL.js";import{Button_default as c}from"./chunk-EOVXFXVV.js";import{buttonClasses as s}from"./chunk-UQYNPYF4.js";import{Icon as m}from"./chunk-UIWGVOFH.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{useHydrated as d}from"./chunk-D65T4H6J.js";import{useShellStrings as f}from"./chunk-43MCNASD.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{useRef as p,useState as x,useCallback as b,useEffect as k}from"react";import{createPortal as g}from"react-dom";import{jsx as v,jsxs as w,Fragment as N}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function j(e){return e.kind?e.kind:r(e.url)?"video":y.test(e.url)?"file":"image"}var C="flex items-center justify-center rounded-full bg-black/60 text-on-accent hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",L=e=>e.stopPropagation();function U({images:r,startIndex:y=0,onClose:U,onIndexChange:A,onOpenFile:D}){const F=f().lightbox,V=d(),$=p(null),z=p(null),[G,I]=x(y),W=r.length,J=V&&W>0,M=b(e=>{if(W<2)return;const t=((G+e)%W+W)%W;I(t),A?.(t)},[G,W,A]);if(a(J),l($,J,z),i(J),k(()=>{if(J)return h(()=>(U(),!0),()=>$.current)},[J,U]),k(()=>{if(!J)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),M("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[J,M]),!J)return null;const O=r[Math.min(G,W-1)],P=j(O),E=O.caption||n(O.url);let Q;return Q="video"===P?/* @__PURE__ */v("video",{src:O.url,controls:!0,playsInline:!0,"aria-label":E,onClick:L,className:`${e} rounded-lg bg-black`}):"file"===P?/* @__PURE__ */w("div",{onClick:L,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-surface px-10 py-8 text-center text-ink-faint",children:[
|
|
2
|
+
/* @__PURE__ */v(m,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
|
|
3
|
+
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:E}),D?/* @__PURE__ */v(c,{size:"sm",onClick:()=>D(O),children:F.openFile}):/* @__PURE__ */v("a",{href:O.url,target:"_blank",rel:"noopener noreferrer",className:s({size:"sm"}),children:F.openFile})]}):/* @__PURE__ */v(t,{src:O.url,alt:E,className:`${e} object-contain`,frameClassName:"rounded-lg"}),g(
|
|
4
|
+
/* @__PURE__ */w("div",{ref:$,...o({role:"dialog",modal:!0,label:F.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:u.overlay},onClick:U,children:[Q,
|
|
5
|
+
/* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:L,children:[
|
|
6
|
+
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:F.counter(G+1,W)}),
|
|
7
|
+
/* @__PURE__ */v("button",{ref:z,type:"button",onClick:U,"aria-label":F.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(m,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),W>1&&/* @__PURE__ */w(N,{children:[
|
|
8
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{L(e),M(-1)},"aria-label":F.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(m,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
|
|
9
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{L(e),M(1)},"aria-label":F.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(m,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
|
|
10
|
+
/* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:L,children:[
|
|
11
|
+
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:E}),"file"!==P&&/* @__PURE__ */v("a",{href:O.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-on-accent/70 underline decoration-on-accent/30 underline-offset-2 hover:text-on-accent",children:F.openOriginal})]})]}),document.body)}export{U as ImageLightbox,j as lightboxKind};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{StatCard as e,Card as a}from"./chunk-EOGXCGQF.js";import{Avatar as t}from"./chunk-NHWDB7R6.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-
|
|
1
|
+
import{StatCard as e,Card as a}from"./chunk-EOGXCGQF.js";import{Avatar as t}from"./chunk-NHWDB7R6.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-Q2MW334M.js";import{ColumnChart as l}from"./chunk-QOQ6GXVA.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-FZM3ZPW3.js";import{TH_ONE_LINE as c}from"./chunk-WGLHB6WE.js";import{Button_default as n}from"./chunk-EOVXFXVV.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
|
|
2
2
|
return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */m("div",{className:"mx-auto max-w-6xl space-y-6",children:[
|
|
3
3
|
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */m("div",{children:[
|
|
5
5
|
/* @__PURE__ */o("h1",{className:"text-xl font-semibold text-gray-900",children:"Dashboard"}),
|
|
6
6
|
/* @__PURE__ */o("p",{className:"text-sm text-gray-500",children:"Overview of your store this month"})]}),
|
|
7
7
|
/* @__PURE__ */m("div",{className:"flex items-center gap-2",children:[
|
|
8
|
-
/* @__PURE__ */o(
|
|
9
|
-
/* @__PURE__ */o(
|
|
8
|
+
/* @__PURE__ */o(n,{variant:"secondary",size:"sm",children:"Export"}),
|
|
9
|
+
/* @__PURE__ */o(n,{size:"sm",children:"New report"})]})]}),
|
|
10
10
|
/* @__PURE__ */m("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[
|
|
11
11
|
/* @__PURE__ */o(e,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
|
|
12
12
|
/* @__PURE__ */o(e,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
|
|
@@ -17,10 +17,10 @@ return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow
|
|
|
17
17
|
/* @__PURE__ */o(a,{header:"Traffic sources",children:/* @__PURE__ */o(s,{variant:"ring",size:180,segments:g,centerLabel:"100%"})})]}),
|
|
18
18
|
/* @__PURE__ */o(a,{header:"Recent orders",padded:!1,children:/* @__PURE__ */m("table",{className:"w-full text-sm",children:[
|
|
19
19
|
/* @__PURE__ */o("thead",{children:/* @__PURE__ */m("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
|
|
20
|
-
/* @__PURE__ */o("th",{className:`${
|
|
21
|
-
/* @__PURE__ */o("th",{className:`${
|
|
22
|
-
/* @__PURE__ */o("th",{className:`${
|
|
23
|
-
/* @__PURE__ */o("th",{className:`${
|
|
20
|
+
/* @__PURE__ */o("th",{className:`${c} px-4 py-2 font-medium`,children:"Order"}),
|
|
21
|
+
/* @__PURE__ */o("th",{className:`${c} px-4 py-2 font-medium`,children:"Customer"}),
|
|
22
|
+
/* @__PURE__ */o("th",{className:`${c} px-4 py-2 font-medium`,children:"Total"}),
|
|
23
|
+
/* @__PURE__ */o("th",{className:`${c} px-4 py-2 font-medium`,children:"Status"})]})}),
|
|
24
24
|
/* @__PURE__ */o("tbody",{className:"divide-y divide-gray-100",children:x.map(e=>/* @__PURE__ */m("tr",{className:"text-gray-700",children:[
|
|
25
25
|
/* @__PURE__ */o("td",{className:"px-4 py-2 font-mono text-xs text-gray-500",children:e.id}),
|
|
26
26
|
/* @__PURE__ */o("td",{className:"px-4 py-2",children:/* @__PURE__ */m("span",{className:"flex items-center gap-2",children:[
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-
|
|
2
|
-
return v("div",{...
|
|
3
|
-
/* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:
|
|
1
|
+
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-LBMC6GR5.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-7KIDOIPY.js";import{ColoredBadge as u}from"./chunk-IL56C56I.js";import{MENU_ON_MEDIA_ATTR as m}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-UIWGVOFH.js";import{Tooltip as f}from"./chunk-NJN5IKWO.js";import{useShellStrings as h}from"./chunk-43MCNASD.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function N({items:p,onPick:k,onFiles:N,onRemove:w,onReorder:j,dragType:K,onDragOutChange:C,dropType:I,onDropData:T,label:A,hint:O,error:F,required:L,className:P,accept:S="image/*",maxSizeBytes:z,maxFiles:M,fit:$="cover",thumbSize:E=96,placeholder:H,cta:R,acceptHint:W,showCover:B=!1,coverLabel:q,busy:G=!1,busyLabel:Q,progress:U,disabled:Y=!1,readOnly:J=!1,selected:V,onItemClick:X,onItemDoubleClick:Z,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=R??te.cta,ae=q??te.cover,ne=Q??te.uploading,le=g(),[ie,oe]=b(null),se=Y||G,de=!(!k&&!N||se||J),ce=!!w&&!se&&!J,ue=!!j&&!se&&!J,me=!!K&&!Y&&!ue,pe=!(!I||!T||se||J),fe=t(se),he=H??r(S,te),ge=d({accept:S,maxSizeBytes:z,maxFiles:M,acceptHint:W,multiple:!0,disabled:!de,currentCount:p.length,onAccept:e=>{if(N)N(e);else for(const t of e)k(t)}}),[be,ye]=b(!1),ve=y(0),xe=e=>pe&&Array.from(e.dataTransfer?.types??[]).includes(I),ke=ge.zoneProps,De={onDragEnter:e=>{if(!xe(e))return ke.onDragEnter?.(e);e.preventDefault(),ve.current+=1,ye(!0)},onDragOver:e=>{if(!xe(e))return ke.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",be||ye(!0)},onDragLeave:e=>{if(!xe(e))return ke.onDragLeave?.(e);ve.current=Math.max(0,ve.current-1),0===ve.current&&ye(!1)},onDrop:e=>{if(!xe(e))return ke.onDrop?.(e);e.preventDefault(),ve.current=0,ye(!1);const t=e.dataTransfer.getData(I);t&&T(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:E,height:E},Ke=null==V?null:new Set(V),Ce=!!X,Ie=E<112,Te=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,S),a=e.name??o(e.url),n=B&&(e.cover??0===t);/* @__PURE__ */
|
|
2
|
+
return v("div",{...Ce?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Ke?Ke.has(e.id):void 0,onClick:Ce?t=>{t.target.closest?.("button")||X(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:Z?()=>Z(e.id):void 0,onContextMenu:_?t=>_(e.id,t):void 0,draggable:ue||me&&!!e.dragData||void 0,onDragStart:ue?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(t)),oe(t)}:me&&e.dragData?t=>{t.dataTransfer.effectAllowed=e.dragAlso?"all":"link",t.dataTransfer.setData(K,e.dragData);for(const[r,a]of Object.entries(e.dragAlso??{}))t.dataTransfer.setData(r,a);C?.("start",e.id)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&C?t=>C("none"===t.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onDragOver:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation(),ie!==t&&j(ie,t),oe(null))}:void 0,tabIndex:ue||Ce?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Ce?a:void 0,onKeyDown:Ce&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),X(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}))}:ue?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),j(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<p.length-1&&(e.preventDefault(),j(t,t+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-line bg-gray-100",fe,ie===t?"opacity-50":"",Ke?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Ce?"cursor-pointer":""].join(" "),style:{...je,cursor:ue?"move":void 0},children:[r?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:$}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:$}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-accent-fill px-2 py-0.5 text-xs font-medium text-on-accent",children:ae}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
|
|
3
|
+
/* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:Ie?
|
|
4
4
|
/* @__PURE__ */x(f,{content:e.label,children:/* @__PURE__ */x("span",{tabIndex:0,"aria-label":e.label,className:`flex rounded-full ${fe}`,children:/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"inline-flex items-center gap-0.5",children:[
|
|
5
|
-
/* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},
|
|
5
|
+
/* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},Ae=de&&/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":te.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${fe}`,style:je,children:[
|
|
6
6
|
/* @__PURE__ */x(a,{className:"h-5 w-5"}),
|
|
7
|
-
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),
|
|
7
|
+
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),Oe=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight:E+32},children:[
|
|
8
8
|
/* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(a,{})}),
|
|
9
9
|
/* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:he}),
|
|
10
|
-
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),
|
|
11
|
-
return v(e,{label:
|
|
12
|
-
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":
|
|
13
|
-
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ke||void 0,"aria-label":"string"==typeof
|
|
10
|
+
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),W&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:W})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:E+32},children:/* @__PURE__ */x("span",{className:G?"invisible":void 0,children:te.empty})});/* @__PURE__ */
|
|
11
|
+
return v(e,{label:A,labelId:A?`${le}-label`:void 0,htmlFor:le,hint:O,error:F,required:L,className:P,children:[
|
|
12
|
+
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":A?`${le}-label`:void 0,"aria-describedby":F?`${le}-error`:O?`${le}-hint`:void 0,"aria-busy":G||void 0,...ge.zoneProps,...pe?De:{},className:"relative rounded-lg transition-colors",style:{...se?{opacity:.6}:{},...Ne?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Oe:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Ce?
|
|
13
|
+
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ke||void 0,"aria-label":"string"==typeof A?A:te.files,className:"contents",children:p.map(Te)}):p.map(Te),Ae]}),G&&/* @__PURE__ */x(l,{label:ne,progress:U})]}),!k&&N&&/* @__PURE__ */x("input",{...ge.inputProps}),
|
|
14
14
|
/* @__PURE__ */x(c,{rejections:ge.rejections})]})}export{k as FULL_BADGE_TILE_PX,N as MediaUploadGrid};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{navIcons as e}from"./chunk-4LXCCZDM.js";import{Icon as t}from"./chunk-
|
|
2
|
-
return o(t,{name:"folder",look:"solid",className:e})}function j(t,n){return n&&e[n]||(t?e[t]:void 0)}var T=/* @__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
|
|
1
|
+
import{navIcons as e}from"./chunk-4LXCCZDM.js";import{Icon as t}from"./chunk-UIWGVOFH.js";import{isValidElement as n,cloneElement as r}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var a="react-os-shell:spreadsheet-preview-update",s=null,l=0;function d(e){const t=++l,n={token:t,data:e};return s=n,{update(e){s===n&&(n.data=e),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(a,{detail:{token:t,data:e}}))}}}function c(){return s}function p(e){s===e&&(s=null)}var u=class extends Error{limit;used;attempted;constructor(e,t,n){super("Not enough space"),this.name="FilesQuotaError",this.limit=e,this.used=t,this.attempted=n}};function f(e,t){return e&&"/"!==e?e.replace(/\/$/,"")+"/"+t:"/"+t}async function h(e,t){const n=await e.json().catch(()=>({}));return new Error(n.error||`${t} failed (${e.status})`)}function w(e){const t=()=>(e??(("undefined"!=typeof window?window.__REACT_OS_SHELL_FILE_SERVER__:void 0)||"http://localhost:4000").replace(/\/$/,"")).replace(/\/$/,""),n=(e,n={})=>fetch(`${t()}${e}`,{...n,credentials:"include"}),r=e=>({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{async quota(){const e=await n("/api/quota");if(!e.ok)throw await h(e,"Quota");const t=await e.json();return{used:t.used,limit:t.limit}},async list(e){const t=e??"/",r=await n(`/api/files?path=${encodeURIComponent(t)}`);if(!r.ok)throw await h(r,"Listing");const o=await r.json(),i=o.path||t,a=i.split("/").filter(Boolean);return{folder:{id:"/"===i?null:i,name:a[a.length-1]??"",role:"owner",path:[{id:null,name:""},...a.map((e,t)=>({id:"/"+a.slice(0,t+1).join("/"),name:e}))]},entries:(o.entries||[]).map(e=>({id:f(i,e.name),name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modifiedAt}))}},async upload(e,t){const r=new FormData;r.append("file",t);const o=await n(`/api/upload?path=${encodeURIComponent(e??"/")}`,{method:"POST",body:r});if(413===o.status){const e=await o.json().catch(()=>({}));throw new u(e.limit||0,e.used||0,e.attempted||t.size)}if(!o.ok)throw await h(o,"Upload")},async createFolder(e,t){const o=await n("/api/folder",r({path:f(e,t)}));if(!o.ok)throw await h(o,"Create folder")},async rename(e,t){const o=e.replace(/\/[^/]*$/,"")||"/",i=await n("/api/rename",r({from:e,to:f(o,t)}));if(!i.ok)throw await h(i,"Rename")},async remove(e){const t=await n(`/api/files?path=${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await h(t,"Delete")},async read(e){const t=await n(`/api/file?path=${encodeURIComponent(e)}`);if(!t.ok)throw await h(t,"Download");return t.blob()},async trash(){const e=await n("/api/trash");if(!e.ok)throw await h(e,"Listing trash");return(await e.json()).entries||[]},async restore(e){const t=await n("/api/trash/restore",r({id:e}));if(!t.ok)throw await h(t,"Restore")},async purge(e){const t=await n(`/api/trash/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await h(t,"Delete")},async emptyTrash(){const e=await n("/api/trash",{method:"DELETE"});if(!e.ok)throw await h(e,"Empty trash")}}}var m=null;function y(e){m=e}function g(){return m??w()}function x(){return null!==m}var b=["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 v(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return b[Math.abs(t)%b.length]}var _={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"},k={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"},E={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},C={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function N({className:e}){/* @__PURE__ */
|
|
2
|
+
return o(t,{name:"folder",look:"solid",className:e})}function j(t,n){return n&&e[n]||(t?e[t]:void 0)}var T=/* @__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 I({entityType:e,isSelected:t,entityId:a,label:s,fileKind:l}){const d="preview-file"===e&&l,c=d?C[l]:null,p=d?E[l]: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(N,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=j(a,s),i=v(a||s||"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&&n(e)?r(e,{className:"h-7 w-7 text-white"}):T})})}/* @__PURE__ */
|
|
5
5
|
return i("div",{className:"w-12 h-12 relative flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:[
|
|
@@ -7,7 +7,7 @@ return i("div",{className:"w-12 h-12 relative flex items-center justify-center "
|
|
|
7
7
|
/* @__PURE__ */o("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",fill:"white",fillOpacity:"0.92"}),
|
|
8
8
|
/* @__PURE__ */o("path",{d:"M26 0l10 10H30a4 4 0 01-4-4V0z",fill:"currentColor",fillOpacity:"0.2"}),
|
|
9
9
|
/* @__PURE__ */o("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",stroke:"currentColor",strokeWidth:"1.5",strokeOpacity:"0.5"})]}),
|
|
10
|
-
/* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${c??_[e]??"text-gray-600"}`,children:p??k[e]??e.slice(0,3).toUpperCase()})]})}function
|
|
10
|
+
/* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${c??_[e]??"text-gray-600"}`,children:p??k[e]??e.slice(0,3).toUpperCase()})]})}function L({item:e}){if("folder"===e.entityType)/* @__PURE__ */
|
|
11
11
|
return o(N,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=j(e.entityId,e.label);/* @__PURE__ */
|
|
12
12
|
return o("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${v(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&n(t)?r(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?C[e.fileKind]:_[e.entityType])??"text-gray-400";/* @__PURE__ */
|
|
13
|
-
return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function
|
|
13
|
+
return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function $(e){return"preview-file"===e.entityType&&e.fileKind?E[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":k[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var S=null,R=/* @__PURE__ */new Set;function D(e){S=e,R.forEach(e=>e())}function P(e){return R.add(e),()=>{R.delete(e)}}function F(){return S}var V="__REACT_OS_SHELL_FILES_VIEW__",O="react-os-shell:files-show-trash",A="react-os-shell:files-open-desktop-folder";function M(){"undefined"!=typeof window&&(window[V]="trash",window.dispatchEvent(new CustomEvent(O)))}function U(e){"undefined"!=typeof window&&(window[V]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(A,{detail:{folderId:e}})))}function W(){if("undefined"==typeof window)return null;const e=window[V];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function z(){const e=W();return"undefined"!=typeof window&&(window[V]=null),e}export{L as DesktopItemMiniIcon,A as FILES_OPEN_DESKTOP_FOLDER_EVENT,O as FILES_SHOW_TRASH_EVENT,I as FileIconTile,u as FilesQuotaError,N as FolderGlyph,a as SPREADSHEET_PREVIEW_UPDATE_EVENT,p as claimSpreadsheetPreviewStage,z as consumeFilesViewRequest,w as createFileServerStore,$ as desktopItemTypeLabel,F as getDesktopFoldersSnapshot,g as getFilesStore,x as hasHostFilesStore,W as peekFilesViewRequest,c as peekSpreadsheetPreviewStage,D as publishDesktopFolders,U as requestFilesDesktopFolderView,M as requestFilesTrashView,y as setFilesStore,d as setSpreadsheetPreview,P as subscribeDesktopFolders};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-7HIHQR3X.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-UIWGVOFH.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as y}from"./chunk-5FYDNH4Y.js";import{useShellStrings as x}from"./chunk-43MCNASD.js";import{registerModalEscapeInterceptor as k}from"./chunk-TWVUQUUD.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as H,useCallback as j,useEffect as S}from"react";import{createPortal as T}from"react-dom";import{jsxs as C,jsx as I,Fragment as E}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=N(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},k){const N=t,$=x(),D=d(),H=f??D,j=w(),S=/* @__PURE__ */C("select",{ref:k,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,H?j:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:H,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */I("option",{value:"",disabled:!0,children:i}),
|
|
2
|
+
/* @__PURE__ */I(A,{items:r})]});return H?/* @__PURE__ */C(E,{children:[S,
|
|
3
|
+
/* @__PURE__ */I("span",{id:j,hidden:!0,children:$.settingView.auto})]}):S});function A({items:e}){const t=e=>/* @__PURE__ */I("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
4
|
+
return I(E,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */I("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var U=N(function({value:l,onChange:u,options:N,placeholder:z,invalid:U,className:R="",id:V,disabled:B,size:K,touchSize:W,title:F,multiple:M,renderOption:P,renderValue:Y,valueText:G,readOnly:L=!1,footer:J,changed:X=!1,auto:q,"aria-describedby":Q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=$(!1),[ne,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!J?.length,me="sm"===K,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=$(null),ge=x(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),ke=w(),Ne=`${ke}-listbox`,we=V??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,He=d(),je=q??He,Se=`${ke}-auto`,Te=[Q,X?De:void 0,je?Se:void 0].filter(Boolean).join(" ")||void 0,Ce=H(()=>n(N),[N]),Ie=M?l:[],Ee=u,Oe=f(oe,re,{matchTriggerWidth:!0,...J?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze=`${re}|${Oe?.top}|${Oe?.bottom}|${Oe?.maxHeight}|${N.length}`;g(()=>{be(null)},[ze]),g(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,ze]);const Ae=M?Ce.findIndex(e=>Ie.includes(e.value)):Ce.findIndex(e=>e.value===l),Ue=M?Ce.filter(e=>Ie.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ae>=0?Ce[Ae].label:void 0,Re=!M&&Ae>=0?Ce[Ae].lang:void 0,Ve=M?Ce.filter(e=>Ie.includes(e.value)):Ae>=0?[Ce[Ae]]:[],Be=Y&&Ve.length?Y(Ve):void 0,Ke=void 0!==Be&&G?G(Ve):void 0,We=j((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Fe=j(()=>{B||L||(ae(Ae>=0?Ae:e(Ce)),ie(!0))},[B,L,Ce,Ae]),Me=j(e=>{const t=Ce[e];if(t&&!t.disabled){if(M){const r=l;return Ee(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ee(t.value),We()}},[Ce,M,l,Ee,We]);S(()=>{if(!re)return;return k(e=>!("Escape"!==e.key||!ye.current)&&(We(),!0),ue)},[re,We]),S(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||We(!1)};document.addEventListener("pointerdown",e);const t=v(()=>We(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,We]),S(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const Pe=j(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:Ae,n=t(Ce,r.buffer,i);n<0||(re?ae(n):M?(ae(n),ie(!0)):Me(n))},[re,ne,Ae,Ce,Me,M]),Ye=re?a(N,(e,t)=>{const r=(i=e.value,M?Ie.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
|
|
5
|
+
return C("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||P?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Me(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${M?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":n?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[M&&/* @__PURE__ */I(o,{selected:r}),P?/* @__PURE__ */I("span",{className:"block min-w-0 flex-1 truncate",children:P(e,{selected:r,active:n})}):M?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1",children:[
|
|
6
|
+
/* @__PURE__ */I("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */I("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
|
|
7
|
+
/* @__PURE__ */C(E,{children:[
|
|
8
|
+
/* @__PURE__ */I("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */I("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Ge=void 0!==Be?
|
|
9
|
+
/* @__PURE__ */C("span",{className:"relative block min-w-0 truncate",children:[
|
|
10
|
+
/* @__PURE__ */I("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Be}),
|
|
11
|
+
/* @__PURE__ */I("span",{lang:void 0===Ke?Re:void 0,className:"sr-only",children:Ke??Ue})]}):/* @__PURE__ */I("span",{lang:Re,className:`block truncate ${void 0===Ue?c:""}`,children:Ue??z??" "}),Le={zIndex:h.popup,left:Oe?.left,top:Oe?.top,bottom:Oe?.bottom,width:Oe?.width,maxHeight:Oe?.maxHeight??b,visibility:Oe?void 0:"hidden",...y()},Je=/* @__PURE__ */I("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":M||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Le,maxHeight:fe}:Le,children:Ye}),Xe=pe?/* @__PURE__ */C("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Le,children:[Je,
|
|
12
|
+
/* @__PURE__ */I("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:J.map((e,t)=>/* @__PURE__ */C("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(We(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(J?.length??0)-1,i=t=>{e.preventDefault(),ce.current[t]?.focus()},n=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void i(Math.min(t+1,r));case"ArrowUp":return void(0===t?n():i(t-1));case"Home":return void i(0);case"End":return void i(r);case"Tab":return e.shiftKey?void(0===t?n():i(t-1)):t<r?void i(t+1):(e.preventDefault(),void We());case"Escape":return e.preventDefault(),e.stopPropagation(),void We()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */I(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
13
|
+
/* @__PURE__ */I("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Je;/* @__PURE__ */
|
|
14
|
+
return C("div",{ref:le,className:"relative",children:[
|
|
15
|
+
/* @__PURE__ */I("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?Ne:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":U||void 0,"aria-describedby":Te,"aria-label":Z,"aria-labelledby":_,title:F,disabled:B,"aria-readonly":L||void 0,onClick:()=>re?We():Fe(),onKeyDown:t=>{if(!B&&!L)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(Ce,e,1)):Fe());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(Ce,e,-1)):Fe());case"Home":return void(re&&(t.preventDefault(),ae(e(Ce))));case"End":return void(re&&(t.preventDefault(),ae(r(Ce))));case"Enter":return void(re&&(t.preventDefault(),Me(ne)));case" ":return t.preventDefault(),void(re?Me(ne):Fe());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),We()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&We(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Pe(t.key))}},className:s({invalid:U,size:K,readOnly:L,auto:je,className:`${L?"":"pr-8 "}text-left ${R}`.trim()}),children:X?
|
|
16
|
+
/* @__PURE__ */C("span",{className:"flex min-w-0 items-center gap-1",children:[Ge,
|
|
17
|
+
/* @__PURE__ */I("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ge}),X&&/* @__PURE__ */I("span",{id:De,hidden:!0,children:ge.select.changed}),je&&/* @__PURE__ */I("span",{id:Se,hidden:!0,children:ge.settingView.auto}),!L&&/* @__PURE__ */I(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
|
|
18
|
+
/* @__PURE__ */C("select",{ref:te,value:l,multiple:M||void 0,onChange:e=>Ee(M?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:B,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==z&&!M&&/* @__PURE__ */I("option",{value:"",disabled:!0,children:z}),
|
|
19
|
+
/* @__PURE__ */I(A,{items:N})]}),re&&T(Xe,document.body)]})}),R=N(function({touchSize:e,...t},r){const i=u(),n=e??"touch";return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */I(z,{ref:r,...t,size:n}):/* @__PURE__ */I(U,{ref:r,...t}):/* @__PURE__ */I(U,{ref:r,...t,size:n})});export{z as NativeSelect,R as Select_default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{DragBand as e,tooltipBesideBand as t}from"./chunk-BFO72WQB.js";import{
|
|
2
|
-
return x("div",{className:F,ref:V,children:/* @__PURE__ */x("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:T})});const K=b.filter(Number.isFinite),X=K.every(Number.isInteger),q=void 0===N&&void 0===A?
|
|
1
|
+
import{DragBand as e,tooltipBesideBand as t}from"./chunk-BFO72WQB.js";import{usePlotWidth as r}from"./chunk-MAFUXCPZ.js";import{niceAxis as i,niceMax as n,linearScale as o,axisGutter as l,bandScale as a}from"./chunk-2JWPNR2U.js";import{CHART_INK as h}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-43MCNASD.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{registerModalEscapeInterceptor as d}from"./chunk-TWVUQUUD.js";import{useRef as u,useState as f,useId as g,useEffect as p}from"react";import{jsx as x,jsxs as y}from"react/jsx-runtime";function v({labels:v,values:b,height:k=220,width:M,bandPadding:w=.24,min:N,max:A,yTickCount:$=4,formatValue:j,yAxisLabel:P,xTickAnchor:D="center",children:E,overlay:R,tooltip:U,onSelect:z,zoom:C,ariaLabel:S,className:F,emptyLabel:L}){const W=s().charts,B=c(),I=j??(e=>m(e,B)),T=L??W.noData,V=u(null),Q=r(V),O=M??Q,[Z,H]=f(null),J=g();if(p(()=>{if(null!==Z)return d(e=>"Escape"===e.key&&(H(null),!0))},[Z]),0===v.length||!b.some(Number.isFinite))/* @__PURE__ */
|
|
2
|
+
return x("div",{className:F,ref:V,children:/* @__PURE__ */x("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:T})});const K=b.filter(Number.isFinite),X=K.every(Number.isInteger),q=void 0===N&&void 0===A?i(Math.min(0,...K),Math.max(0,...K),{intervals:$+1,integer:X}):null,G=void 0!==N&&void 0===A?i(N,Math.max(N,...K),{intervals:$+1,integer:X,zero:!1}):null,Y=q?q.lo:N??Math.min(0,...K),_=q?q.hi:G?G.hi:A??n(Math.max(...K,0)),ee=q?q.ticks:G?[Y,...G.ticks.filter(e=>e>Y)]:o([Y,_],{from:0,to:1}).ticks($+1),te={top:12,right:16,bottom:26,left:l(ee.map(I),48)+(P?10:0)},re=te.left,ie=Math.max(re+1,O-te.right),ne=te.top,oe=k-te.bottom,le=o([Y,_],{from:oe,to:ne}),ae=a(v.length,{from:re,to:ie},w),he=(ie-re)/Math.max(1,v.length),se=he>=48,ce=se?1:Math.max(1,Math.ceil(v.length/Math.max(1,Math.floor(O/84)))),me=Math.max(2,Math.floor((he-6)/6.6)),de=e=>se&&e.length>me?`${e.slice(0,me-1).trimEnd()}…`:e;/* @__PURE__ */
|
|
3
3
|
return y("div",{className:`relative ${F??""}`,ref:V,children:[
|
|
4
4
|
/* @__PURE__ */y("svg",{width:"100%",height:k,viewBox:`0 0 ${O} ${k}`,role:"img","aria-label":S,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>H(null),onBlur:()=>H(null),onKeyDown:e=>{if(z&&null!==Z&&("Enter"===e.key||" "===e.key))return e.preventDefault(),void z(Z);if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1;H(e=>Math.min(v.length-1,Math.max(0,(e??0)+t)))},style:C?{userSelect:"none",touchAction:"pan-y"}:void 0,children:[
|
|
5
5
|
/* @__PURE__ */x("defs",{children:/* @__PURE__ */x("clipPath",{id:J,children:/* @__PURE__ */x("rect",{x:re,y:ne,width:ie-re,height:oe-ne})})}),ee.map(e=>/* @__PURE__ */x("line",{x1:re,y1:le(e),x2:ie,y2:le(e),stroke:h.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{Calendar as e}from"./chunk-LGK47SEN.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-UIWGVOFH.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{useShellStrings as c,useShellLocale as m}from"./chunk-43MCNASD.js";import{registerModalEscapeInterceptor as b}from"./chunk-TWVUQUUD.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 F(e,r){const a=t(e);return a?r.longDate(a.getFullYear(),a.getMonth(),a.getDate()):""}var W=f(function({value:f,onChange:k,min:W,max:C,invalid:S,size:B,native:E,weekStartsOn:L,className:O="","aria-label":$,"aria-describedby":q,"aria-labelledby":G,id:I,name:U,disabled:Y,placeholder:z,required:J,clearable:M,form:T,title:H,tabIndex:A,autoFocus:K,onFocus:P,onBlur:V,...Q},R){const X=M??!J,Z=D(f),_=D(W),ee=D(C),te=c().datePicker,re=m(),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=!!I&&(le.current?.labels?.length??0)>0;e!==be&&fe(e)});const pe=!$&&(!!G||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 b(e=>"Escape"===e.key&&(ie(!1),le.current?.focus(),!0),()=>se.current)},[ne]),E)/* @__PURE__ */
|
|
2
|
+
return x("input",{ref:R,type:"date",lang:re,id:I,name:U,disabled:Y,"aria-label":$,"aria-describedby":q,"aria-invalid":S||void 0,value:Z,min:_||void 0,max:ee||void 0,onChange:e=>k?.(t(e.target.value)),className:a({invalid:S,size:B,className:O}),"aria-labelledby":G,required:J,form:T,title:H,tabIndex:A,autoFocus:K,onFocus:P,onBlur:V,...Q});const he=Object.fromEntries(Object.entries(Q).filter(([e])=>j.test(e)&&!w.has(e))),ve=Q["aria-required"],ge=!!J||!0===ve||"true"===ve,ye=[pe?ue:void 0,ge?ce:void 0,q].filter(Boolean).join(" ")||void 0,xe=r(/* @__PURE__ */new Date),Ne=(!_||xe>=_)&&(!ee||xe<=ee),ke=z??te.placeholder;/* @__PURE__ */
|
|
3
|
+
return N("div",{ref:oe,className:"relative",children:[
|
|
4
|
+
/* @__PURE__ */x("input",{ref:R,type:"hidden",name:U,form:T,value:Z}),
|
|
5
|
+
/* @__PURE__ */N("button",{ref:le,type:"button",...he,id:I,disabled:Y,title:H,tabIndex:A,autoFocus:K,onFocus:P,onBlur:V,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?de:void 0,"aria-labelledby":G,"aria-describedby":ye,"aria-label":$?`${$}${Z?`, ${F(Z,ae)}`:""}`:void 0,onClick:()=>ie(e=>!e),className:`${a({invalid:S,size:B,className:O})} flex items-center justify-between text-left`,children:[
|
|
6
|
+
/* @__PURE__ */x("span",{className:Z?"text-ink-strongest":n,children:Z?F(Z,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:Z?F(Z,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":$??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:Z||null,min:_||null,max:ee||null,weekStartsOn:L,onSelect:e=>{ie(!1),le.current?.focus(),k?.(t(e))}}),(X||Ne)&&/* @__PURE__ */N("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[X&&/* @__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{W as DatePicker_default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{ChartTooltip as l}from"./chunk-36VIGB6J.js";import{CartesianPlot as t}from"./chunk-
|
|
2
|
-
return s(t,{labels:d,values:
|
|
1
|
+
import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{ChartTooltip as l}from"./chunk-36VIGB6J.js";import{CartesianPlot as t}from"./chunk-P4L74UA5.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as n}from"./chunk-43MCNASD.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{jsx as s,jsxs as m,Fragment as c}from"react/jsx-runtime";function u({rows:u,labels:d,variant:p="area",curve:f="linear",height:k=220,width:g,max:b,min:x,formatValue:w,yAxisLabel:y,color:j,tone:L,label:v,className:M,emptyLabel:A,radius:N=3}){const C=o().charts,O=n(),V=w??(e=>h(e,O)),F=v??C.range,U=u.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),W=r(0,j,L);/* @__PURE__ */
|
|
2
|
+
return s(t,{labels:d,values:U,height:k,width:g,max:b,min:x,formatValue:V,yAxisLabel:y,className:M,emptyLabel:A,bandPadding:"bar"===p?.34:0,ariaLabel:C.rangeLabel(F,d.length),tooltip:e=>/* @__PURE__ */s(l,{title:d[e],rows:[{key:"high",label:C.high,color:W,value:null==u[e]?void 0:V(u[e].high)},{key:"low",label:C.low,color:W,value:null==u[e]?void 0:V(u[e].low)}]}),children:({x:l,y:t,active:r})=>"bar"===p?/* @__PURE__ */s("g",{children:u.map((e,i)=>/* @__PURE__ */s("rect",{x:l(i),y:t(e.high),width:Math.max(1,l.bandwidth),height:Math.max(1,t(e.low)-t(e.high)),rx:N,fill:W,fillOpacity:null===r||r===i?.85:.4},i))}):/* @__PURE__ */m("g",{children:[(()=>{const r=u.map((e,i)=>[l.center(i),t(e.high)]),a=u.map((e,i)=>[l.center(i),t(e.low)]);/* @__PURE__ */
|
|
3
3
|
return m(c,{children:[
|
|
4
4
|
/* @__PURE__ */s("path",{d:e(i(r,f),a),fill:W,fillOpacity:.2,stroke:"none"}),
|
|
5
5
|
/* @__PURE__ */s("path",{d:i(r,f),fill:"none",stroke:W,strokeWidth:2,strokeLinejoin:"round"}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-UIWGVOFH.js";import{useShellStrings as i}from"./chunk-43MCNASD.js";import{Fragment as t}from"react";import{jsx as n,jsxs as a}from"react/jsx-runtime";var s=/* @__PURE__ */n(e,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 text-gray-300","aria-hidden":!0}),r="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function l({items:e,separator:l,maxItems:c=0,className:m}){const o=i().breadcrumbs;if(0===e.length)return null;const h=l??s,d=[],u=e.length-1;if(c>0&&e.length>c&&c>=2){const i=Math.max(1,c-1);d.push({kind:"item",item:e[0],isLast:!1}),d.push({kind:"ellipsis"});for(let t=e.length-i;t<=u;t++)d.push({kind:"item",item:e[t],isLast:t===u})}else e.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
|
|
2
2
|
return n("nav",{"aria-label":o.label,className:`min-w-0 ${m??""}`,children:/* @__PURE__ */n("ol",{className:"flex items-center gap-2 text-sm",children:d.map((e,i)=>/* @__PURE__ */a(t,{children:[i>0&&/* @__PURE__ */n("li",{"aria-hidden":!0,className:"flex items-center",children:h}),
|
|
3
3
|
/* @__PURE__ */n("li",{className:"flex min-w-0 items-center",children:"ellipsis"===e.kind?/* @__PURE__ */n("span",{className:"px-0.5 text-gray-400 select-none","aria-label":o.hidden,children:"…"}):e.isLast||!e.item.href&&!e.item.onClick?/* @__PURE__ */a("span",{"aria-current":e.isLast?"page":void 0,className:"inline-flex min-w-0 items-center gap-1 truncate "+(e.isLast?"font-medium text-gray-900":"text-gray-500"),children:[e.item.icon,
|
|
4
4
|
/* @__PURE__ */n("span",{className:"truncate",children:e.item.label})]}):e.item.href?/* @__PURE__ */a("a",{href:e.item.href,onClick:e.item.onClick,className:r,children:[e.item.icon,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-36VIGB6J.js";import{
|
|
1
|
+
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-36VIGB6J.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{angleScale as o}from"./chunk-2JWPNR2U.js";import{CHART_INK as s,resolveSeriesColor as i}from"./chunk-TZFACUMR.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-43MCNASD.js";import{formatPercent as m,formatPlain as u}from"./chunk-C3QOHMR6.js";import{useId as d,useState as f,useRef as y}from"react";import{jsx as p,jsxs as g}from"react/jsx-runtime";function x({segments:x,variant:v="pie",size:k=280,innerRadius:M,padAngle:b=.012,maxSegments:N=6,otherLabel:I,formatValue:$,centerLabel:j,animate:S=!0,labels:w="none",labelMinShare:A=.04,className:C,emptyLabel:F}){const P=h().charts,R=c(),W=$??(e=>u(e,R)),z=I??P.other,E=F??P.nothingToBreakDown,T=d(),[V,_]=f(null),{highlighted:B}=a(),L=y(null),U=n(L,Number.POSITIVE_INFINITY),Y=x.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===Y.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${C??""}`,children:E});const O=[...Y].sort((e,t)=>t.value-e.value),D=O.slice(0,N),H=O.slice(N),J=H.length>0?[...D,{key:"__other__",label:z,value:H.reduce((e,t)=>e+t.value,0),slot:-1,color:s.muted}]:D,Q=e=>i(e.slot,e.color,e.tone),Z=J.reduce((e,t)=>e+t.value,0),q=Math.ceil(.62*Math.max(...J.map(e=>String(e.label).length),4)*11)+24,G="outside"===w&&U>=120+2*q,X=G?q:0,K=G?Math.max(120,Math.min(k,U-2*X)):k,ee=K+2*X,te=X+K/2,le=K/2,ae=K/2-12,re=M??("ring"===v?.58*ae:0),ne=o(J.length,b),oe=Math.max(...J.map(e=>e.value)),se=e=>re+(ae-re)*Math.sqrt(Math.max(0,e)/oe);let ie=-Math.PI/2;const he=(()=>{if(!G)return[];let e=-Math.PI/2;const t=J.map((t,l)=>{const a="rose"===v?o(J.length,b).step:t.value/Z*Math.PI*2,r="rose"===v?o(J.length,b).center(l):e+a/2;e+=a;const n="rose"===v?se(t.value):ae;return{key:t.key,label:t.label,share:t.value/Z,right:Math.cos(r)>=0,anchor:[te+n*Math.cos(r),le+n*Math.sin(r)],y:le+(n+14)*Math.sin(r),index:l}}).filter(e=>e.share>=A),l=Math.max(1,Math.floor((K-11-13)/26)+1),a=/* @__PURE__ */new Set;for(const e of[!0,!1]){const r=t.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,l).sort((e,t)=>e.y-t.y);for(let e=1;e<r.length;e+=1)r[e].y-r[e-1].y<26&&(r[e].y=r[e-1].y+26);for(let e=r.length-1;e>=0;e-=1){const t=e===r.length-1?K-13:r[e+1].y-26;r[e].y=Math.min(r[e].y,t)}r.forEach((e,t)=>{e.y=Math.max(e.y,0===t?11:r[t-1].y+26),a.add(e.key)})}return t.filter(e=>a.has(e.key))})(),ce=(e,t)=>null!==V?V!==e:null!==B&&B!==t,me=null!==V?J[V]:void 0;/* @__PURE__ */
|
|
2
2
|
return g("div",{className:`relative ${C??""}`,ref:L,children:[
|
|
3
3
|
/* @__PURE__ */g("svg",{width:"100%",height:K,viewBox:`0 0 ${ee} ${K}`,role:"img","aria-labelledby":T,onMouseLeave:()=>_(null),children:[
|
|
4
4
|
/* @__PURE__ */p("title",{id:T,children:P.breakdown(W(Z),J.length)}),J.map((a,r)=>{const n=Q(a),o="rose"===v?ne(r):ie,i="rose"===v?ne.step:a.value/Z*Math.PI*2-b;"rose"!==v&&(ie+=a.value/Z*Math.PI*2);const h=o+Math.max(.001,i),c="rose"===v?se(a.value):ae;/* @__PURE__ */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{MediaUploadField as e}from"./chunk-
|
|
1
|
+
import{MediaUploadField as e}from"./chunk-F245EG2A.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-EOVXFXVV.js";import{useShellStrings as t}from"./chunk-43MCNASD.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[L,R]=l(null),[U,A]=l(""),[C,F]=l(""),[E,H]=l(!1),[I,O]=l(!1),G=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),S=t().brandAsset,V=U||d||g||"",B=L?null:d?o:h,P=L?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const $=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
|
|
2
2
|
return n("section",{"aria-label":S.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
3
3
|
/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
4
|
-
/* @__PURE__ */c(e,{value:V,onChange:()=>{},onFile:e=>{if(k)return
|
|
4
|
+
/* @__PURE__ */c(e,{value:V,onChange:()=>{},onFile:e=>{if(k)return;$();const r=URL.createObjectURL(e);j.current=r,R(e),A(r),F("")},label:p,hint:C||S.usedFor(b),error:C||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:E||I,disabled:k}),
|
|
5
5
|
/* @__PURE__ */n("div",{className:"mt-3 flex flex-wrap gap-2",children:[
|
|
6
|
-
/* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!
|
|
6
|
+
/* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!E){H(!0),F("");try{await x(L),$(),R(null),A("")}catch(e){F(e instanceof Error?e.message:S.saveFailed(G,p))}finally{H(!1)}}},disabled:!L||k,loading:E,children:S.save(G,p)}),(L||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!I){if(L)return $(),R(null),A(""),void F("");if(d){O(!0),F("");try{await f()}catch(e){F(e instanceof Error?e.message:S.removeFailed(G,p))}finally{O(!1)}}}},disabled:k,loading:I,children:L?S.discard:S.remove(G,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":S.previews(p),children:[
|
|
7
7
|
/* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:S.preview}),
|
|
8
|
-
/* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:V,alt:S.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:B,isLight:
|
|
8
|
+
/* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:V,alt:S.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:B,isLight:P,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
|
|
9
9
|
return n("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
|
|
10
10
|
/* @__PURE__ */c("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */n("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
|
|
11
11
|
/* @__PURE__ */n("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[a,
|