efficient-shell 12.1.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 +27 -0
- package/dist/{Browser-U3SO6PSV.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-YYNH67EN.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-KV3L22LT.js → Preview-BJRRRU4N.js} +21 -21
- 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.d.ts +7 -0
- 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-COMV3Z2U.js → chunk-KT5LLPUV.js} +1 -1
- package/dist/chunk-KZD2AFH2.js +13 -0
- package/dist/{chunk-TBBG2AWY.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 +508 -508
- 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-S4AFZX4N.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-S3C3XJG7.js +0 -1
- package/dist/chunk-UE54EN4C.js +0 -2
- 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
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import{useCopyText as e,CopyGlyph as n}from"./chunk-
|
|
1
|
+
import{useCopyText as e,CopyGlyph as n}from"./chunk-HE767CVB.js";import{ItemCount as t}from"./chunk-RXHTIJ64.js";import{PopupMenu as r,PopupMenuItem as i,PopupMenuDivider as l}from"./chunk-F44E76EC.js";import{Icon as a}from"./chunk-UIWGVOFH.js";import{useShellStrings as o}from"./chunk-43MCNASD.js";import{useState as s,useMemo as d,useEffect as c,useRef as u,Fragment as m,useLayoutEffect as f}from"react";import{jsxs as p,jsx as y,Fragment as h}from"react/jsx-runtime";function g(e){const n=[];let t=0;for(;t<e.length;){const r=e[t].group;let i=t;for(;void 0!==r&&i+1<e.length&&e[i+1].group===r;)i++;n.push(i>t?{group:r,start:t,end:i}:{start:t,end:t}),t=i+1}return n}function k(e,n){return e.find(e=>n>=e.start&&n<=e.end)}function b(e,n,t,r){const i=e.findIndex(e=>e.key===n.key);let l=e.findIndex(e=>e.key===t);if(i<0||l<0)return null;const a=g(e),o=k(a,i),s="group"===n.kind&&void 0!==o.group?e.slice(o.start,o.end+1).map(e=>e.key):[n.key];if(s.includes(t))return null;const d=k(a,l);if("tab"===n.kind&&void 0!==o.group){if(d!==o)return null}else void 0!==d.group&&(l="before"===r?d.start:d.end);return{key:e[l].key,side:r,moving:s}}function x(e,n,t,r){const i=b(e,n,t,r);if(!i)return null;const l=e.map(e=>e.key).filter(e=>!i.moving.includes(e)),a=l.indexOf(i.key)+("after"===i.side?1:0),o=[...l.slice(0,a),...i.moving,...l.slice(a)];return o.every((n,t)=>n===e[t].key)?null:o}var v="flex-[0_1_15rem] [contain-intrinsic-inline-size:15rem]",N=v,w="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500",C="pointer-events-none absolute bottom-0 size-2 [background:inherit]";function $(){/* @__PURE__ */
|
|
2
2
|
return p(h,{children:[
|
|
3
3
|
/* @__PURE__ */y("span",{"aria-hidden":"true",className:`${C} -left-2 [mask-image:radial-gradient(circle_at_0_0,transparent_0.5rem,#000_calc(0.5rem+0.5px))]`}),
|
|
4
4
|
/* @__PURE__ */y("span",{"aria-hidden":"true",className:`${C} -right-2 [mask-image:radial-gradient(circle_at_100%_0,transparent_0.5rem,#000_calc(0.5rem+0.5px))]`})]})}function z(){/* @__PURE__ */
|
|
5
5
|
return y(a,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function I({text:t,label:r,copiedLabel:i}){const{copied:l,copy:a}=e(t);/* @__PURE__ */
|
|
6
|
-
return y("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */y(n,{copied:l,className:"size-3.5"})})}function _({node:e}){const n=u(null);return f(()=>{const t=n.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),/* @__PURE__ */y("span",{ref:n,className:"ml-1 flex shrink-0 items-center"})}function j({tabs:e,activeKey:n,idFor:f,panelMounted:k,onActivate:C,onClose:j,onCloseMany:D,label:
|
|
6
|
+
return y("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */y(n,{copied:l,className:"size-3.5"})})}function _({node:e}){const n=u(null);return f(()=>{const t=n.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),/* @__PURE__ */y("span",{ref:n,className:"ml-1 flex shrink-0 items-center"})}function j({tabs:e,activeKey:n,idFor:f,panelMounted:k,onActivate:C,onClose:j,onCloseMany:D,label:E,className:T,activeClassName:A,end:M,afterPinned:B,onIconMenu:R,menuItems:S,sizing:O="even",tall:G=!1,onReorder:K,groupInfo:F}){const H=o().pageTabs,L=o().count,[V,W]=s(null),X=G?"h-[34px]":"h-8",J=d(()=>e.map(e=>({key:e.key,group:F?e.group:void 0})),[e,F]),P=d(()=>g(J),[J]),[U,Y]=s(()=>/* @__PURE__ */new Set),q=t=>{if(!U.has(t)){const r=P.find(e=>e.group===t),i=e.findIndex(e=>e.key===n);if(r&&i>=r.start&&i<=r.end){const n=e[r.end+1]??e[r.start-1];n&&C(n.key)}}Y(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},Q=n?J.find(e=>e.key===n)?.group:void 0;c(()=>{void 0!==Q&&Y(e=>{if(!e.has(Q))return e;const n=new Set(e);return n.delete(Q),n})},[n]);const Z=d(()=>{const n=[];for(const t of P)for(let r=t.start;r<=t.end;r++)void 0!==t.group&&U.has(t.group)||n.push(e[r]);return n},[P,U,e]),ee=u(null),[ne,te]=s(null),re=(n,t)=>K?{draggable:!0,onDragStart:t=>{ee.current=n,t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.find(e=>e.key===n.key)?.title??"")},onDragOver:e=>{const r=ee.current;if(!r)return;const i=e.currentTarget.getBoundingClientRect(),l=t!==n.key||"tab"===n.kind?e.clientX<i.left+i.width/2?"before":"after":"before",a=x(J,r,t,l)?b(J,r,t,l):null;if(!a)return void(ne&&te(null));e.preventDefault(),e.dataTransfer.dropEffect="move";const o=e=>J.find(n=>n.key===e)?.group,s="tab"===r.kind&&void 0!==o(r.key)&&o(r.key)===o(a.key);ne?.key===a.key&&ne.side===a.side&&ne.inGroup===s||te({key:a.key,side:a.side,inGroup:s})},onDrop:e=>{const n=ee.current;if(!n||!ne)return;e.preventDefault();const t=x(J,n,ne.key,ne.side);ee.current=null,te(null),t&&K(t)},onDragEnd:()=>{ee.current=null,te(null)}}:{},ie=d(()=>new Set(P.filter(e=>void 0!==e.group&&F).map(n=>e[n.start].key)),[P,e,F]),le=e=>"pointer-events-none absolute inset-y-1 z-[3] w-0.5 rounded-full bg-blue-500 "+("before"===e?"-left-px":"-right-px"),ae=e=>ne?.key===e&&!("before"===ne.side&&ie.has(e)&&!ne.inGroup)&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:le(ne.side)}),oe=e.length;c(()=>{if(!n)return;const e=document.getElementById(f(n,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[f,n,oe]);const se=B?Z.findIndex(e=>!e.pinned):-1,de=Z.some(e=>e.key===n)?n:Z[0]?.key,ce=e=>{const n=Z[(e+Z.length)%Z.length];n&&document.getElementById(f(n.key,"tab"))?.focus()},ue=(e,n)=>{const t=Z[e+n];if(!K||!t)return;const r=x(J,{kind:"tab",key:Z[e].key},t.key,n<0?"before":"after");r&&(K(r),setTimeout(()=>document.getElementById(f(Z[e].key,"tab"))?.focus(),0))},me=V?e.find(e=>e.key===V.key):void 0,fe=me&&S?S(me.key):[],pe=me?e.indexOf(me):-1,ye=e=>e.some(e=>!e.pinned),he=e=>()=>{W(null),e()},ge=(e,t)=>{const r=e.key===n,i=!!e.dirty,l=e.icon,o=r?A??"z-[1] border-transparent bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",s=!!t&&!r&&t.key!==n,d={type:"button",role:"tab",id:f(e.key,"tab"),"aria-selected":r,"aria-controls":k?.(e.key)?f(e.key,"panel"):void 0,tabIndex:e.key===de?0:-1,title:e.title,onClick:()=>C(e.key)},c={onContextMenu:n=>((e,n)=>{e.preventDefault(),W({x:e.clientX,y:e.clientY,key:n.key})})(n,e),onAuxClick:n=>((e,n)=>{1!==e.button||n.pinned||(e.preventDefault(),j(n.key))})(n,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},u=l&&
|
|
7
7
|
/* @__PURE__ */p("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[l,i&&!r&&!e.pinned&&
|
|
8
|
-
/* @__PURE__ */y("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),h=r&&!!
|
|
8
|
+
/* @__PURE__ */y("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),h=r&&!!R&&!!l;return e.pinned?/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex flex-none items-center justify-center rounded-t-lg border border-b-0 transition-colors ${X} ${l?"w-10":""} ${o}`,...c,...re({kind:"tab",key:e.key},e.key),children:[ae(e.key),r&&/* @__PURE__ */y($,{}),
|
|
9
9
|
/* @__PURE__ */p("button",{...d,className:`flex h-full items-center justify-center rounded-t-lg ${l?"w-full":"px-3"} ${w}`,children:[u,
|
|
10
10
|
/* @__PURE__ */y("span",{className:l?"sr-only":"whitespace-nowrap text-sm",children:e.title})]})]},e.key):/* @__PURE__ */p(m,{children:[s&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:"mb-3 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
|
|
11
|
-
/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-lg border border-b-0 text-sm transition-colors ${
|
|
12
|
-
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":
|
|
11
|
+
/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-lg border border-b-0 text-sm transition-colors ${X} ${"active-full"===O&&r?"":"@container"} ${"active-full"===O?r?"flex-[0_0_15rem] min-w-0":N:r&&(e.copy||h)?"flex-[0_1_20rem]":v} ${r?"active-full"===O?"":"min-w-[4.25rem]":"min-w-[4rem]"} ${o}`,...c,...re({kind:"tab",key:e.key},e.key),children:[ae(e.key),r&&/* @__PURE__ */y($,{}),h&&
|
|
12
|
+
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":H.tabMenu,title:H.tabMenu,onClick:n=>{const t=n.currentTarget.getBoundingClientRect();R?.(e.key,t.left,t.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-2 ${w}`,children:u}),
|
|
13
13
|
/* @__PURE__ */p("button",{...d,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-lg pr-1 text-left ${h?"pl-2":"pl-3"} ${w} ${r?h?"":"@max-[5rem]:pl-3":"@max-[6.5rem]:pr-3 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-2 @max-[4.5rem]:group-hover:pr-3"}`,children:[!h&&u,
|
|
14
|
-
/* @__PURE__ */p("span",{className:`min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] ${"active-full"===
|
|
15
|
-
/* @__PURE__ */y("span",{role:"img","aria-label":
|
|
16
|
-
/* @__PURE__ */p("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(r?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */y("span",{role:"img","aria-label":
|
|
17
|
-
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":
|
|
14
|
+
/* @__PURE__ */p("span",{className:`min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] ${"active-full"===O&&r?"pr-4":""} ${l?r?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""}`,children:[e.title,e.favorite&&
|
|
15
|
+
/* @__PURE__ */y("span",{role:"img","aria-label":H.favorite,title:H.favorite,className:"ml-1 inline-flex align-[-0.125em] text-yellow-500",children:/* @__PURE__ */y(a,{name:"star","aria-hidden":"true",className:"size-3.5",fill:"currentColor",strokeWidth:1.5})})]})]}),r&&e.actions&&/* @__PURE__ */y(_,{node:e.actions}),r&&e.copy&&/* @__PURE__ */y(I,{text:e.copy,label:H.copy(e.copy),copiedLabel:H.copied}),
|
|
16
|
+
/* @__PURE__ */p("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(r?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */y("span",{role:"img","aria-label":H.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
|
|
17
|
+
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":H.closeTab?.(e.title)??`${H.close} ${e.title}`,onClick:()=>j(e.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(i?"hidden group-hover:flex":r?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */y(z,{})})]})]})]},e.key)},ke=[];let be,xe=0,ve=!B;for(const r of P){const i=Z.filter(n=>{const t=e.indexOf(n);return t>=r.start&&t<=r.end});if(ve||xe!==se||(ve=!0,ke.push(/* @__PURE__ */y(m,{children:B},"rosh-after-pinned")),be=void 0),xe+=i.length,void 0===r.group||!F){for(const e of i)ke.push(ge(e,be)),be=e;continue}be=void 0;const l=r.group,o=F(l),s=r.end-r.start+1,d=!U.has(l),c=e[r.start].key,u=i.some(e=>e.key===n);ke.push(
|
|
18
18
|
/* @__PURE__ */p("div",{role:"group","aria-label":o.label,"data-tab-group":l,className:"relative mx-1 flex items-end first:ml-0 min-w-0 "+(u?"shrink-[0.01]":"shrink"),children:[
|
|
19
|
-
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-expanded":d,title:
|
|
19
|
+
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-expanded":d,title:H.groupToggle(o.label,s),onClick:()=>q(l),...re({kind:"group",key:c},c),className:`relative mb-1 mr-1 flex h-6 shrink-0 items-center gap-1 rounded-full bg-blue-100 px-2 text-xs font-medium text-blue-700 hover:bg-blue-200 ${w}`,children:[
|
|
20
20
|
/* @__PURE__ */y(a,{name:d?"chevron-down":"chevron-right","aria-hidden":"true",className:"size-3",strokeWidth:2}),o.icon&&/* @__PURE__ */y("span",{className:"flex size-3.5 items-center justify-center [&>svg]:size-3.5","aria-hidden":"true",children:o.icon}),
|
|
21
21
|
/* @__PURE__ */y("span",{className:d?"sr-only":"max-w-[12rem] truncate",children:o.label}),
|
|
22
22
|
/* @__PURE__ */y(t,{count:s,label:L.tabs(s),active:!0})]}),ne?.key===c&&"before"===ne.side&&!ne.inGroup&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:le("before")}),i.map((e,n)=>ge(e,n>0?i[n-1]:void 0)),
|
|
23
|
-
/* @__PURE__ */y("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-0 h-0.5 bg-blue-500"})]},`rosh-group-${c}`))}return ve||ke.push(/* @__PURE__ */y(m,{children:B},"rosh-after-pinned")),/* @__PURE__ */p("div",{className:
|
|
23
|
+
/* @__PURE__ */y("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-0 h-0.5 bg-blue-500"})]},`rosh-group-${c}`))}return ve||ke.push(/* @__PURE__ */y(m,{children:B},"rosh-after-pinned")),/* @__PURE__ */p("div",{className:T??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
|
|
24
24
|
/* @__PURE__ */y("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
|
|
25
|
-
/* @__PURE__ */y("div",{role:"tablist","aria-label":
|
|
25
|
+
/* @__PURE__ */y("div",{role:"tablist","aria-label":E,onKeyDown:e=>{const n=Z.findIndex(n=>document.getElementById(f(n.key,"tab"))===e.target);if(n<0)return;const t=e.shiftKey&&(e.ctrlKey||e.metaKey);if(t&&"ArrowRight"===e.key)ue(n,1);else if(t&&"ArrowLeft"===e.key)ue(n,-1);else if("ArrowRight"===e.key)ce(n+1);else if("ArrowLeft"===e.key)ce(n-1);else if("Home"===e.key)ce(0);else if("End"===e.key)ce(Z.length-1);else{if("Delete"!==e.key||Z[n].pinned)return;j(Z[n].key)}e.preventDefault()},className:"flex min-w-0 flex-1 items-end -mx-2 px-2 scroll-px-2 overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:ke}),M&&/* @__PURE__ */y("div",{className:"flex shrink-0 items-center gap-2 self-center",children:M}),V&&me&&/* @__PURE__ */p(r,{portal:!0,style:{left:V.x,top:V.y},onClose:()=>W(null),children:[fe.length>0&&/* @__PURE__ */p(h,{children:[fe.map((e,n)=>/* @__PURE__ */p(i,{onClick:he(e.onSelect),children:[e.icon,e.label]},n)),
|
|
26
26
|
/* @__PURE__ */y(l,{})]}),
|
|
27
|
-
/* @__PURE__ */y(i,{disabled:me.pinned,onClick:he(()=>j(me.key)),children:
|
|
27
|
+
/* @__PURE__ */y(i,{disabled:me.pinned,onClick:he(()=>j(me.key)),children:H.close}),
|
|
28
28
|
/* @__PURE__ */y(l,{}),
|
|
29
|
-
/* @__PURE__ */y(i,{disabled:!ye(e.filter(e=>e.key!==me.key)),onClick:he(()=>D("others",me.key)),children:
|
|
30
|
-
/* @__PURE__ */y(i,{disabled:!ye(e.slice(pe+1)),onClick:he(()=>D("right",me.key)),children:
|
|
31
|
-
/* @__PURE__ */y(i,{disabled:!ye(e),onClick:he(()=>D("all",null)),children:
|
|
29
|
+
/* @__PURE__ */y(i,{disabled:!ye(e.filter(e=>e.key!==me.key)),onClick:he(()=>D("others",me.key)),children:H.closeOthers}),
|
|
30
|
+
/* @__PURE__ */y(i,{disabled:!ye(e.slice(pe+1)),onClick:he(()=>D("right",me.key)),children:H.closeRight}),
|
|
31
|
+
/* @__PURE__ */y(i,{disabled:!ye(e),onClick:he(()=>D("all",null)),children:H.closeAll})]})]})}export{j as TabStrip};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Popover as e}from"./chunk-7JGR7WPD.js";import{IconButton_default as r}from"./chunk-LE5LWALR.js";import{Icon as n}from"./chunk-
|
|
2
|
-
return l(e,{className:x,disabled:
|
|
1
|
+
import{Popover as e}from"./chunk-7JGR7WPD.js";import{IconButton_default as r}from"./chunk-LE5LWALR.js";import{Icon as n}from"./chunk-UIWGVOFH.js";import{Tooltip as t}from"./chunk-NJN5IKWO.js";import{useShellStrings as a}from"./chunk-43MCNASD.js";import{useRef as i}from"react";import{jsx as l,jsxs as o,Fragment as s}from"react/jsx-runtime";var c={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function u({value:u,onChange:m,options:d,label:h,emptyValue:p,columns:f=5,cell:v,header:g,onPreview:w,tooltips:b=!0,disabled:N=!1,className:x=""}){const k=a(),A=k.iconPicker,j=k.iconNames,y=e=>e.label??j[e.value]??e.value,C=i([]),D=Math.max(0,d.findIndex(e=>e.value===u)),L=d[D],I=L?.value===p,M=i(null);/* @__PURE__ */
|
|
2
|
+
return l(e,{className:x,disabled:N,triggerLabel:L?A.button(h,y(L)):h,"aria-label":h,initialFocus:M,panelClassName:"!p-2",trigger:/* @__PURE__ */o("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */l("span",I||!L?{className:"text-sm",children:L?y(L):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:L.icon}),
|
|
3
3
|
/* @__PURE__ */l(n,{name:"chevron-down",className:"h-4 w-4"})]}),children:({close:e})=>/* @__PURE__ */o(s,{children:["function"==typeof g?g({close:e}):g,
|
|
4
|
-
/* @__PURE__ */l("div",{role:"listbox","aria-label":h,className:"grid gap-1",style:{gridTemplateColumns:`repeat(${f}, ${v?.width??"2rem"})`},children:d.map((n,a)=>{const i=n.value===u,o=/* @__PURE__ */l(r,{ref:e=>{
|
|
4
|
+
/* @__PURE__ */l("div",{role:"listbox","aria-label":h,className:"grid gap-1",style:{gridTemplateColumns:`repeat(${f}, ${v?.width??"2rem"})`},children:d.map((n,a)=>{const i=n.value===u,o=/* @__PURE__ */l(r,{ref:e=>{C.current[a]=e,a===D&&(M.current=e)},role:"option","aria-selected":i,"aria-label":y(n),pressed:i,tabIndex:a===D?0:-1,onKeyDown:e=>((e,r)=>{const n=c[r.key];if(!n)return;r.preventDefault();const t=Math.floor(e/f)+n[0],a=e%f+n[1];if(t<0||a<0||a>=f)return;const i=t*f+a;if(!(i>=d.length)){for(const[e,r]of C.current.entries())r?.setAttribute("tabindex",e===i?"0":"-1");C.current[i]?.focus()}})(a,e),onClick:()=>{m(n.value),e()},onMouseEnter:w?e=>w(n.value,e.currentTarget):void 0,style:v?{width:v.width,height:v.height}:void 0,children:/* @__PURE__ */l("span",{"aria-hidden":"true",className:v?"inline-flex":"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})},n.value);return b?/* @__PURE__ */l(t,{content:y(n),children:o},n.value):o})})]})})}export{u as IconPicker};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-
|
|
1
|
+
import{Breadcrumbs as e}from"./chunk-PT77FC5X.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";function i({title:i,description:r,subtitle:c,actions:a,children:n,icon:l,breadcrumbs:m}){const d=r??c,h=a??n;/* @__PURE__ */
|
|
2
2
|
return t("div",{className:"mb-6",children:[m&&m.length>0&&/* @__PURE__ */s(e,{items:m,className:"mb-3"}),
|
|
3
3
|
/* @__PURE__ */t("div",{className:"flex items-start justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */t("div",{children:[
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-GYDCXCJT.js";import{useTabLayer as n,focusableIn as o}from"./chunk-CDAJKLGL.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-F44E76EC.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k=/(^|[\s:])!?z-/,w={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function D({trigger:D,items:C,align:E="end",side:L="bottom","aria-label":j,className:A="",triggerClassName:K,menuClassName:S="",minWidth:W=180,linkAs:$,disabled:H,id:N,"aria-describedby":T,"aria-disabled":U=!1,onOpenChange:J,footer:B,footerLabel:G}){const[I,q]=m(!1),[M,z]=m(-1),P=h(null),R=h(null),Y=h(null),F=h(null),O=h(null),Q=null!=B&&!1!==B,V=h({text:"",at:0}),X=g(),Z=g(),_=N??Z,ee=h(J);ee.current=J;const te=h(I);te.current=I;const re=v(e=>{q(!1),te.current&&(te.current=!1,ee.current?.(!1)),e&&R.current?.focus()},[]),ne=(t,r)=>{const n=C.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(C[i]))return i}return-1},oe=()=>Y.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!I)return;const e=e=>{const t=e.target;if(P.current?.contains(t)||oe()?.contains(t))return;const r=oe()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||re(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>re(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[I,re]);const ie=v(()=>{const e=oe(),t=R.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:E,side:L});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=E},[E,L]);p(()=>{I&&ie()}),b(()=>{if(I)return u(()=>R.current,ie)},[I,ie]),b(()=>{if(!I)return;const t=Y.current,r=e(C[M])?t?.querySelector(`[data-dropdown-index="${M}"]`):null;(r??t)?.focus({preventScroll:!0})},[I,M]),b(()=>{if(I)return f(e=>"Escape"===e.key&&(re(!0),!0),()=>F.current)},[I,re]),n(F,I&&Q);const ae=h(null),le=e=>"first"===e?ne(0,1):ne(C.length-1,-1),se=e=>{z(le(e)),q(!0),te.current||(te.current=!0,ae.current=e,J?.(!0))};p(()=>{const e=ae.current;if(!I||!e)return;ae.current=null;const t=le(e);t!==M&&z(t)});const de=t(C,X),ce="function"==typeof B?B({close:()=>re(!0)}):B,ue={...k.test(S)?{}:{zIndex:s.popup},minWidth:W};/* @__PURE__ */
|
|
2
|
+
return y("div",{ref:P,className:`relative inline-flex ${A}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */x("button",{ref:R,id:_,type:"button","aria-haspopup":"menu","aria-expanded":I,"aria-controls":I?X:void 0,"aria-label":j,"aria-describedby":T,"aria-disabled":U||void 0,disabled:H,onClick:()=>{U||(I?re(!1):se("first"))},onKeyDown:e=>{U||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),se("first")):"ArrowUp"===e.key&&(e.preventDefault(),se("last")))},className:K??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60 "+(j?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:D}),I&&
|
|
4
|
+
/* @__PURE__ */x(i,{portal:!0,className:S,style:ue,children:/* @__PURE__ */y("div",{ref:F,children:[
|
|
5
|
+
/* @__PURE__ */x("div",{ref:Y,id:X,role:"menu","aria-orientation":"vertical","aria-label":j,"aria-labelledby":j?void 0:_,"aria-describedby":de,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),z(ne(M+1,1));else if("ArrowUp"===t.key)t.preventDefault(),z(ne(M-1,-1));else if("Home"===t.key)t.preventDefault(),z(ne(0,1));else if("End"===t.key)t.preventDefault(),z(ne(C.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&O.current?o(O.current)[0]:void 0;e?e.focus({preventScroll:!0}):re(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-V.current.at<500?V.current.text+n:n;V.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?M+1:Math.max(M,0),s=Y.current,d=C.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(C[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void z(n)}})(t)},children:r(C,{menuId:X,choose:e=>{e.disabled||(re(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>re(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===M?0:-1,onMouseEnter:()=>{t.disabled||O.current?.contains(document.activeElement)||z(e)}}),linkAs:$})}),Q&&/* @__PURE__ */y("div",{ref:O,role:"group","aria-label":G,"data-dropdown-footer":"",onKeyDown:e=>{const t=O.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=Y.current?.querySelector(`[data-dropdown-index="${M}"]`);return void(t??Y.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),re(!0))},children:[
|
|
6
|
+
/* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
|
|
7
|
+
/* @__PURE__ */x("div",{style:w,children:ce})]})]})})]})}export{D as DropdownMenu};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{
|
|
2
|
-
/* @__PURE__ */f("div",{className:`flex h-full flex-col ${
|
|
3
|
-
/* @__PURE__ */p(
|
|
4
|
-
return f("div",
|
|
5
|
-
/* @__PURE__ */p(g,{phone:
|
|
6
|
-
/* @__PURE__ */p(v,{phone:
|
|
1
|
+
import{readStoredWidth as e,ResizeHandle as l}from"./chunk-2XQOK3CT.js";import{SidebarBarContext as r,SidebarSheetContext as t}from"./chunk-QWK6DRSN.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-UIWGVOFH.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-43MCNASD.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:r,sidebarTop:t,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:C=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:O="bg-white"}){const W="right"===m,j=i().sidebar,z=a(),D=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[I,P]=o(()=>(x?e(x,w,k):null)??b(N,w,k),b(N,w,k)),T=null!=t||null!=n,E=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:I},children:[
|
|
2
|
+
/* @__PURE__ */f("div",{className:`flex h-full flex-col ${T?"overflow-hidden":"overflow-y-auto"} ${C}`,children:[null!=t&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:t}),T?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:r}):r,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
|
|
3
|
+
/* @__PURE__ */p(l,{side:m,width:I,onResize:P,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:j.resize})]}),K=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${O}`,children:u});/* @__PURE__ */
|
|
4
|
+
return f("div",z?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
|
|
5
|
+
/* @__PURE__ */p(g,{phone:D,top:t,fallback:j.sections}),K,
|
|
6
|
+
/* @__PURE__ */p(v,{phone:D,bottom:n,label:j.sections,closeLabel:j.closeSections,children:r})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[W?null:E,K,W?E:null]})}function g({phone:e,top:l,fallback:t}){const a=e.current();/* @__PURE__ */
|
|
7
7
|
return f("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
|
|
8
|
-
/* @__PURE__ */f("button",{ref:
|
|
8
|
+
/* @__PURE__ */f("button",{ref:e.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":e.open,onClick:()=>e.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
|
|
9
9
|
/* @__PURE__ */p("span",{className:"min-w-0 truncate",children:0===a.length?t:a.map((e,l)=>/* @__PURE__ */f(u,{children:[l>0&&" · ",e]},l))}),
|
|
10
|
-
/* @__PURE__ */p(n,{name:"chevron-down",className:"size-4 shrink-0",strokeWidth:2,"aria-hidden":"true"})]}),null!=
|
|
11
|
-
/* @__PURE__ */f(
|
|
12
|
-
/* @__PURE__ */f("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":
|
|
10
|
+
/* @__PURE__ */p(n,{name:"chevron-down",className:"size-4 shrink-0",strokeWidth:2,"aria-hidden":"true"})]}),null!=l&&/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */p("div",{className:"flex min-w-0 max-w-[60%] shrink-0 items-center gap-2",children:l})})]})}function v({phone:e,bottom:l,label:r,closeLabel:a,children:n}){const o=c(null),{open:i,setOpen:s,trigger:d}=e,h=()=>{s(!1),o.current?.contains(document.activeElement)&&d.current?.focus()};return m(()=>{i&&o.current?.focus()},[i]),
|
|
11
|
+
/* @__PURE__ */f(t.Provider,{value:e.api,children:[i&&/* @__PURE__ */p("button",{type:"button","aria-label":a,onClick:h,className:"absolute inset-0 z-(--z-in-box) cursor-default bg-gray-900/40"}),
|
|
12
|
+
/* @__PURE__ */f("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":r,tabIndex:-1,"data-sidebar-section-sheet":!0,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),h())},onClick:e=>{const l=e.target.closest("button, a");!l||l.hasAttribute("aria-expanded")||l.closest("[data-sheet-keep-open]")||h()},className:(i?"flex":"hidden")+" absolute inset-x-0 bottom-0 z-(--z-in-box) max-h-[75%] flex-col rounded-t-2xl bg-white pt-2 shadow-(--elevation-dialog)",children:[
|
|
13
13
|
/* @__PURE__ */p("div",{className:"mx-auto mb-2 h-1 w-9 shrink-0 rounded-full bg-gray-300","aria-hidden":"true"}),
|
|
14
|
-
/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 pb-3",children:n}),null!=
|
|
14
|
+
/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 pb-3",children:n}),null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:l})]})]})}export{x as SidebarLayout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFilesStore as e,setSpreadsheetPreview as t}from"./chunk-
|
|
1
|
+
import{getFilesStore as e,setSpreadsheetPreview as t}from"./chunk-OY3JH66O.js";import{setPdfPreview as n}from"./chunk-ESL5TDNA.js";import{toast_default as i}from"./chunk-TRWHVG3A.js";var o="react-os-shell:preview-opened";async function a(a){const{filePath:r,filename:l,kind:c,onStaged:s,load:d}=a;try{const a=d?d():e().readShortcut?.(r)??null;let f;if(a)f=await a;else{const e=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(r)}`,{credentials:"include"});if(!e.ok)return i.error(`Download failed (${e.status})`),!1;f=await e.blob()}if("csv"===c){const e=await f.text();t({csv:e,filename:l}),s?.("/spreadsheet")}else{const e=URL.createObjectURL(f);n({url:e,filename:l,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(o,{detail:{filePath:r,filename:l,kind:c}})),!0}catch(e){return i.error(e?.message||"Open failed"),!1}}export{o as PREVIEW_OPENED_EVENT,a as openPreviewFile};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-
|
|
2
|
-
return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:x,markers:
|
|
3
|
-
/* @__PURE__ */h("button",{type:"button",onClick:
|
|
4
|
-
/* @__PURE__ */b("span",{children:
|
|
5
|
-
/* @__PURE__ */b("b",{className:"font-medium",children:N(
|
|
6
|
-
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",
|
|
1
|
+
import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-RQ4UIWWD.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-7TC3LJQM.js";import{Icon as s}from"./chunk-UIWGVOFH.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-43MCNASD.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:o,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),_=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[v,M]=u(!1),w=g(null),N=()=>{null!=w.current&&(cancelAnimationFrame(w.current),w.current=null),M(!1)};m(()=>()=>N(),[]),m(()=>{N()},[d]);const x=t.map(e=>a(e.date)).filter(e=>null!=e),S=l(Date.now,null)??Math.max(0,...x,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),C=x.length?Math.min(...x):S,D=x.length?Math.max(...x):S,P=a(r??null)??C,R=a(n??null)??0,O=k.has((o||"").toLowerCase()),q=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),T=(()=>{const e=[R,D,q,P+i];return O||e.push(S),Math.max(...e)})(),I=Math.max(1,Math.round((T-P)/i)),A=a(p??null)??D??P,L=Math.min(Math.max(y??A,P),T),j=t.find(e=>{const t=a(e.date);return null!=t&&t<=L})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>L){$=t[e];break}}const F=(()=>{if(j||!$||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:_.start,date:r||new Date(P).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),W=j??F,z=j?a(j.date):F?P:null,G=$?a($.date):null,H=!!(W&&$&&null!=z&&null!=G&&L>z&&L<G);let J,Q;if(H&&null!=z&&null!=G){const e=(L-z)/Math.max(G-z,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of W?.items??[])r[e.part_number]=e;const n={};for(const e of $?.items??[])n[e.part_number]=e;const o=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const o=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:o.description??i.description??"",order_qty:s(o.order_qty??i.order_qty??0),casting:t(s(o.casting),s(i.casting)),cnc:t(s(o.cnc),s(i.cnc)),painting:t(s(o.painting),s(i.painting)),packing:t(s(o.packing),s(i.packing)),finished_goods:t(s(o.finished_goods),s(i.finished_goods)),stock_qty:t(s(o.stock_qty),s(i.stock_qty))}}),i=a(W?.est_completion_date),s=a($?.est_completion_date);let l;l=null!=i&&null!=s?new Date(Math.round(i+(s-i)*e)).toISOString().slice(0,10):W?.est_completion_date||$?.est_completion_date||null,J={id:`interp-${L}`,progress_number:_.estimated,date:new Date(L).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},Q=W}else if(J=W??t[t.length-1]??null,J){const e=t.findIndex(e=>e.id===J.id);Q=e>=0&&e<t.length-1?t[e+1]:null}else Q=null;const U={};for(const e of Q?.items??[])U[e.part_number]=e;const B=!(!d||J?.id===d),E=d?Math.min(a(p??null)??T,T):T,K=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:P,endMs:T,totalLeadDays:I,scrubMs:L,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:B,beforeAnchor:W,nextAfter:$,displayed:J,prevReport:Q,prevByPN:U,isInterpolated:H,playing:v,startPlay:()=>{if(v)return void N();if(E<=P)return void f(E);M(!0),f(P);let e=performance.now(),t=P;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=E)return f(E),w.current=null,void M(!1);f(t),w.current=requestAnimationFrame(r)};w.current=requestAnimationFrame(r)},stopPlay:N,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:K,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:i,activeId:s,onChange:l,onPickReport:p,onOpenReport:u,onOpenMarker:m,onDragStart:g,renderReportPreview:h,reportLabel:y,playback:k,edgeCaptions:f,bare:_=!1,endMark:v=null}){const M=c().production,w=d(),N=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),x=N.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:y(e),preview:e.preview??h?.(e),onOpen:u?()=>u(e.id):void 0})),S=new Map(N.map(({report:e,ms:t})=>[e.id,t])),C=N.map(({ms:e})=>e),D=m?a.map(e=>({...e,onOpen:m})):a;/* @__PURE__ */
|
|
2
|
+
return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:x,markers:D,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=S.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:C,ariaLabel:M.scrub,valueText:e=>{const t=(e=>N.find(t=>t.ms===e)?.report)(e);return t?`${y(t)} · ${o(e,w)}`:o(e,w)}},ariaLabel:M.label(o(e,w),o(t,w))})})}function N({snapshot:n,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:N=e=>e.progress_number,resetLabel:x,variant:S="card",onPlayStart:C}){const{reports:D,markers:P,poNumber:R,startMs:O,endMs:q,totalLeadDays:T,scrubMs:I,setScrubMs:A,displayed:L,scrubbedAway:j,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:W,estCompletionMs:z}=n,G=function(e,t,r){const[n,a]=u(!1),o=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),o.current||(o.current=!0,t(e[0])),a(!0))},stop:()=>{o.current=!1,a(!1)}}}(D.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),A,C),H=c().production,J=d(),Q=_??H.heading,U=e=>o(e,J);if(0===D.length&&0===P.length)return null;const B=P.filter(e=>"shipment"===e.kind),E=P.filter(e=>"inspection"===e.kind),K=P.filter(e=>"invoice"===e.kind),V=(L?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),Z=L?v(L):0,X=D.find(e=>e.id===F),Y=X?N(X):W,ee=
|
|
3
|
+
/* @__PURE__ */h("button",{type:"button",onClick:G.toggle,"aria-pressed":G.playing,title:G.playing?H.pause:H.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[G.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
|
|
4
|
+
/* @__PURE__ */b("span",{children:G.playing?H.pause:H.play})]}),te=j&&(x??Y)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{G.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:x??H.backTo(String(Y))}):null,[re,ne]=p(H.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:L?/* @__PURE__ */h(y,{children:[e&&re,
|
|
5
|
+
/* @__PURE__ */b("b",{className:"font-medium",children:N(L)}),e&&ne,
|
|
6
|
+
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",U(new Date(L.date).getTime())," · ",H.overall(Math.round(Z))," · ",H.inStock(V)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:H.noReport})});if("rail"===S){const e=null!=z&&z>=q&&q>O,t=e?{key:"__estimate__",label:H.estimatedCompletion,dateText:U(z)}:null;/* @__PURE__ */
|
|
7
7
|
return h("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
|
|
8
|
-
/* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:
|
|
8
|
+
/* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:D,markers:P,valueMs:I,activeId:L?.id??"",onChange:A,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??H.start,end:M?.end??(e?H.estDone:void 0)},onDragStart:G.stop,playback:{playing:G.playing,onArrive:(e,t)=>A(t),onProgress:f,onStop:G.stop}}),
|
|
9
9
|
/* @__PURE__ */h("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[ee,te,ae(!1)]})]})}/* @__PURE__ */
|
|
10
|
-
return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:
|
|
11
|
-
/* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[
|
|
12
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),
|
|
13
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),
|
|
14
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),
|
|
15
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),
|
|
10
|
+
return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:Q,subject:R,meta:[`${U(O)} → ${U(q)}`,H.leadTime(T)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
|
|
11
|
+
/* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[D.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
12
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),H.report]}),B.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
13
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),H.shipment]}),E.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
14
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),H.inspection]}),K.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
15
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),H.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:D,markers:P,valueMs:I,activeId:L?.id??"",onChange:A,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:G.stop,playback:{playing:G.playing,onArrive:(e,t)=>A(t),onProgress:f,onStop:G.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import{Pagination as e}from"./chunk-7FBAZLBX.js";import{Checkbox_default as t}from"./chunk-CGZBDI6C.js";import{
|
|
1
|
+
import{Pagination as e}from"./chunk-7FBAZLBX.js";import{Checkbox_default as t}from"./chunk-CGZBDI6C.js";import{TH_ONE_LINE as r,OneLineLabel as o}from"./chunk-WGLHB6WE.js";import{SpinnerRing as n}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as s}from"./chunk-43MCNASD.js";import{useState as i,useRef as a}from"react";import{jsxs as c,Fragment as d,jsx as h}from"react/jsx-runtime";function u(e){const t={};if(!e)return t;for(const[r,o]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||(t[r]=o);return t}var m=e=>Array.isArray(e.columns),f=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",g="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",p={sm:"px-2 py-2",md:"px-3 py-2"},y={left:"text-left",right:"text-right",center:"text-center"};function b({direction:e}){/* @__PURE__ */
|
|
2
2
|
return c("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
3
3
|
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 0L8 5H0z"})}),
|
|
4
|
-
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:S=!1,size:$="md",minWidth:z,rowClassName:H,onRow:T,rowHref:A,onRowPress:I,linkAs:L,emptyText:D,selection:E,footer:F,virtualized:W,stackOnNarrow:O=!1,stackBelow:P,className:R=""}){const K=s(),Z=D??K.table.empty,G=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),J=O&&!W,V=J?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),X=e=>J?{role:e}:{},q=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[Q,U]=i(0),Y=W?.overscan??6,_=W?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/W.rowHeight)-Y);U(e=>e===t?e:t)}:void 0,ee=W?Math.ceil(W.height/W.rowHeight)+2*Y:v.length,te=W?Math.min(Q,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=W?te*W.rowHeight:0,ne=W?(v.length-re)*W.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!W)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=V.flatMap(e=>m(e)?e.columns:[e]),he=V.some(m),ue=/* @__PURE__ */new Map;if(J)for(const e of V)if(m(e))for(const t of e.columns)ue.set(t,q(e.title,e.label));const me=e=>{const t=q(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(E?.selected??[]),ge=E?v.map((e,t)=>G(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=E?36:0,we=de.length+(E?1:0),xe=de.some(e=>"left"===e.fixed),ve=J&&!E&&de.some(e=>e.cardCorner),ke=L??"a",Ne=`${p[$]} ${"sm"===$?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,
|
|
5
|
-
return h("th",{scope:"col",...X("columnheader"),rowSpan:
|
|
6
|
-
/* @__PURE__ */h(
|
|
7
|
-
/* @__PURE__ */h(b,{direction:s})]}):/* @__PURE__ */h(
|
|
4
|
+
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:S=!1,size:$="md",minWidth:z,rowClassName:H,onRow:T,rowHref:A,onRowPress:I,linkAs:L,emptyText:D,selection:E,footer:F,virtualized:W,stackOnNarrow:O=!1,stackBelow:P,className:R=""}){const K=s(),Z=D??K.table.empty,G=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),J=O&&!W,V=J?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),X=e=>J?{role:e}:{},q=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[Q,U]=i(0),Y=W?.overscan??6,_=W?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/W.rowHeight)-Y);U(e=>e===t?e:t)}:void 0,ee=W?Math.ceil(W.height/W.rowHeight)+2*Y:v.length,te=W?Math.min(Q,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=W?te*W.rowHeight:0,ne=W?(v.length-re)*W.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!W)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=V.flatMap(e=>m(e)?e.columns:[e]),he=V.some(m),ue=/* @__PURE__ */new Map;if(J)for(const e of V)if(m(e))for(const t of e.columns)ue.set(t,q(e.title,e.label));const me=e=>{const t=q(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(E?.selected??[]),ge=E?v.map((e,t)=>G(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=E?36:0,we=de.length+(E?1:0),xe=de.some(e=>"left"===e.fixed),ve=J&&!E&&de.some(e=>e.cardCorner),ke=L??"a",Ne=`${p[$]} ${"sm"===$?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,n,l=0)=>{const s=ce(e),i=y[e.align??(e.numeric?"right":"left")],a="left"===e.fixed,d=!(!e.sortable||!C);/* @__PURE__ */
|
|
5
|
+
return h("th",{scope:"col",...X("columnheader"),rowSpan:n>1?n:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...a?{left:(Be[t]??0)+be}:{},...W?{top:l}:{}},className:[Ne,i,r,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs",a?W?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":W?"sticky z-10 bg-gray-50":"",J&&d?"rosh-dt-sort":"",J?f(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:Ce(e,d?/* @__PURE__ */c("button",{type:"button",onClick:()=>(e=>{if(!C)return;const t=ae(e),r=ce(e),o=e.sortFirst??"asc";C(null===r?{field:t,direction:o}:r===o?{field:t,direction:"asc"===o?"desc":"asc"}:null)})(e),"data-group":J?ue.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-ink ${i}`,children:[
|
|
6
|
+
/* @__PURE__ */h(o,{children:e.title}),
|
|
7
|
+
/* @__PURE__ */h(b,{direction:s})]}):/* @__PURE__ */h(o,{children:e.title}))},e.key)};let Me=0;const Be=de.map(e=>{if("left"!==e.fixed)return null;const t=Me;return Me+=e.width??0,t}),Se=/* @__PURE__ */c(d,{children:[
|
|
8
8
|
/* @__PURE__ */c("div",{onScroll:_,style:W?{maxHeight:W.height}:void 0,className:`relative overflow-x-auto ${W?"overflow-y-auto":""} ${S?"rounded-lg border border-gray-200":""}${J?" rosh-dt-scroll":""}`.trim(),children:[B&&
|
|
9
9
|
/* @__PURE__ */c("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
|
|
10
|
-
/* @__PURE__ */h(
|
|
10
|
+
/* @__PURE__ */h(n,{className:"h-6 w-6"}),
|
|
11
11
|
/* @__PURE__ */h("span",{className:"sr-only",children:K.table.loading})]}),
|
|
12
12
|
/* @__PURE__ */c("table",{...X("table"),className:(J?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:z?{minWidth:z}:void 0,children:[M&&/* @__PURE__ */h("caption",{className:"sr-only",children:M}),
|
|
13
13
|
/* @__PURE__ */c("thead",{...X("rowgroup"),className:J?"rosh-dt-head":void 0,children:[
|
|
14
|
-
/* @__PURE__ */c("tr",{ref:le,...X("row"),className:"border-b border-gray-200 bg-gray-50",children:[E&&/* @__PURE__ */h("th",{scope:"col",...X("columnheader"),rowSpan:he?2:void 0,style:{width:36,...W?{top:0}:{}},className:[Ne,
|
|
14
|
+
/* @__PURE__ */c("tr",{ref:le,...X("row"),className:"border-b border-gray-200 bg-gray-50",children:[E&&/* @__PURE__ */h("th",{scope:"col",...X("columnheader"),rowSpan:he?2:void 0,style:{width:36,...W?{top:0}:{}},className:[Ne,r,xe||W?"sticky z-20 bg-gray-50":"",xe?"left-0":"",J?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":K.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!E)return;const e=new Set(ge);E.onChange(pe?E.selected.filter(t=>!e.has(t)):[...E.selected,...ge.filter(e=>!fe.has(e))])}})}),V.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...X("columnheader"),colSpan:e.columns.length,style:W?{top:0}:void 0,className:[Ne,"text-center",r,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs","border-b border-gray-200",W?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(o,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...X("row"),className:"border-b border-gray-200 bg-gray-50",children:V.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
|
|
15
15
|
/* @__PURE__ */h("tbody",{...X("rowgroup"),className:J?"rosh-dt-body":void 0,children:0!==v.length||B?/* @__PURE__ */c(d,{children:[oe>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:oe,padding:0,border:0}})}),v.slice(te,re).map((e,r)=>{const o=te+r,n=T?.(e,o),l=!!n?.current,s=A?.(e,o),i=void 0===s&&I?()=>I(e,o):void 0,a=void 0!==s||void 0!==i;let d=!1;const m=(e,t)=>{if(d=!0,!a)return e;const r=[g,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:i,className:r,"aria-current":o,children:e})},p=de.map(t=>t.render?t.render(e,o,m):t.dataIndex?e[t.dataIndex]:null);if(a&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
16
16
|
return c("tr",{...u(n),...X("row"),style:W?{height:W.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!a?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[J?E?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",J&&ve?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",a?"rosh-dt-linked hover:bg-gray-50":"",l?"rosh-dt-current":"",H?.(e,o)??"",n?.className??""].filter(Boolean).join(" "),children:[E&&(()=>{const r=G(e,o);/* @__PURE__ */
|
|
17
17
|
return h("td",{...X("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",J?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":K.table.selectRow,checked:fe.has(r),onChange:()=>(e=>{E&&E.onChange(fe.has(e)?E.selected.filter(t=>t!==e):[...E.selected,e])})(r)})})})(),de.map((e,t)=>{const r="left"===e.fixed,o=p[t],n=ve&&!!e.cardCorner,l=J&&!n&&"wide"!==e.only;/* @__PURE__ */
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveGrip as t,MoveHint as r,moveFromKey as a}from"./chunk-B5OYS65L.js";import{ItemCount as n}from"./chunk-RXHTIJ64.js";import{GROUP_COLORS as o}from"./chunk-FZM3ZPW3.js";import{
|
|
1
|
+
import{MOVE_KEYS as e,MoveGrip as t,MoveHint as r,moveFromKey as a}from"./chunk-B5OYS65L.js";import{ItemCount as n}from"./chunk-RXHTIJ64.js";import{GROUP_COLORS as o}from"./chunk-FZM3ZPW3.js";import{OneLineLabel as i}from"./chunk-WGLHB6WE.js";import{Icon as s}from"./chunk-UIWGVOFH.js";import{Tooltip as l}from"./chunk-NJN5IKWO.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{useShellStrings as d}from"./chunk-43MCNASD.js";import{useRef as u,useCallback as p,useId as m,isValidElement as f}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";var b='[role="treeitem"]';function v(e){return[...e.querySelectorAll(b)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function y({"aria-label":e,"aria-labelledby":t,children:r,className:a="",rootProps:n}){const o=u(null);c(()=>{const e=o.current;if(!e)return;const t=[...e.querySelectorAll(b)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??v(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=p(e=>{n?.onKeyDown?.(e);const t=o.current,r=e.target.closest?.(b);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const a=v(t),i=a.indexOf(r),s=Number(r.getAttribute("aria-level")??"1"),l=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(b))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":l(a[i+1]);break;case"ArrowUp":l(a[i-1]);break;case"Home":l(a[0]);break;case"End":l(a[a.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=a[i+1];t&&Number(t.getAttribute("aria-level")??"1")>s?l(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(a[e].getAttribute("aria-level")??"1")<s){l(a[e]);break}}},[n]);/* @__PURE__ */
|
|
2
2
|
return h("div",{...n,ref:o,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${a}`.trim(),children:r})}function x({children:e,hidden:t,className:r=""}){/* @__PURE__ */
|
|
3
|
-
return h("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}var k=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal"].join(" "),w=`${k} bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600`;function N(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!f(e)&&"label"in e}function A(e){if(null==e||!1===e||"number"==typeof e)return null;const t=Array.isArray(e)&&e.length>0&&e.every(N)?e:N(e)?[e]:null;return t?t.map((e,t)=>/* @__PURE__ */h("span",{"data-tree-count":"","data-tone":e.tone,className:e.tone?`${k} ${o[e.tone]}`:w,children:e.label},t)):/* @__PURE__ */h("span",{"data-tree-count":"",className:w,children:e})}function j({children:e,count:t,countLabel:r,expanded:a,onToggle:o}){const
|
|
4
|
-
/* @__PURE__ */h("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */h(
|
|
3
|
+
return h("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}var k=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal"].join(" "),w=`${k} bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600`;function N(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!f(e)&&"label"in e}function A(e){if(null==e||!1===e||"number"==typeof e)return null;const t=Array.isArray(e)&&e.length>0&&e.every(N)?e:N(e)?[e]:null;return t?t.map((e,t)=>/* @__PURE__ */h("span",{"data-tree-count":"","data-tone":e.tone,className:e.tone?`${k} ${o[e.tone]}`:w,children:e.label},t)):/* @__PURE__ */h("span",{"data-tree-count":"",className:w,children:e})}function j({children:e,count:t,countLabel:r,expanded:a,onToggle:o}){const s=void 0!==a,l=
|
|
4
|
+
/* @__PURE__ */h("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */h(i,{children:e})}),c="number"==typeof t?/* @__PURE__ */h(n,{count:t,label:r,showZero:!0}):null!=t&&!1!==t&&/* @__PURE__ */h("span",{"data-tree-count":"",className:w,children:t}),d="text-xs font-semibold uppercase tracking-wide text-ink-faint";return s?/* @__PURE__ */h("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */g("button",{type:"button","aria-expanded":a,onClick:o,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-ink-strongest","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",d].join(" "),children:[
|
|
5
5
|
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:$(!!a)}),l,c]})}):/* @__PURE__ */g("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${d}`,children:[
|
|
6
|
-
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,c]})}var $=e=>/* @__PURE__ */h(
|
|
7
|
-
return g("div",{...E,role:"treeitem","aria-level":
|
|
6
|
+
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,c]})}var $=e=>/* @__PURE__ */h(s,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),D={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function P({label:o,level:s=1,icon:l,preview:c,selected:d=!1,tone:u,expanded:p,onToggle:f,onSelect:b,muted:v=!1,badge:y,count:x,countLabel:k,actions:w,actionsPinned:N=!1,actionsOverlay:j=!0,rename:P,drop:C,dragging:K=!1,draggable:I=!1,dragHint:H,onMove:W,rowProps:E,className:L=""}){const S=void 0!==p,O=m(),T=x??("number"==typeof y?y:void 0),B=[E?.["aria-describedby"],W?O:void 0].filter(Boolean).join(" ")||void 0,M="shared"===u?"text-[color:var(--status-success-soft-ink)]":null,Z=d?M?`bg-[var(--status-success-soft)] ${M}`:"bg-accent-tint text-blue-700":"into"===C?`bg-accent-tint ${M??"text-ink-strongest"}`:`${M??"text-ink"} hover:bg-gray-100`;/* @__PURE__ */
|
|
7
|
+
return g("div",{...E,role:"treeitem","aria-level":s,"aria-selected":d,"aria-expanded":S?p:void 0,"data-tone":u,tabIndex:d?0:-1,"aria-keyshortcuts":E?.["aria-keyshortcuts"]??(W?e:void 0),"aria-describedby":B,"data-drop":C,"data-draggable":I||void 0,onKeyDown:e=>{if(E?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=a(e);t&&W?(e.preventDefault(),W(t)):"Enter"!==e.key&&" "!==e.key||!b?("ArrowRight"===e.key&&S&&!p&&f||"ArrowLeft"===e.key&&S&&p&&f)&&(e.preventDefault(),f()):(e.preventDefault(),b())},onClick:e=>{E?.onClick?.(e),e.defaultPrevented||b?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",I?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",Z,"into"===C?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",K?"opacity-40":"",L].filter(Boolean).join(" "),children:["before"===C&&/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===C&&/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),I&&
|
|
8
8
|
/* @__PURE__ */h(t,{marker:"tree",hint:H,dragging:K,revealClassName:"group-hover/treerow:opacity-100"}),
|
|
9
|
-
/* @__PURE__ */h("span",
|
|
9
|
+
/* @__PURE__ */h("span",S?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),f?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:$(!!p)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=l&&/* @__PURE__ */h("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(v?"text-ink-faintest":""),children:l}),
|
|
10
10
|
/* @__PURE__ */g("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[P??
|
|
11
|
-
/* @__PURE__ */h("span",{"data-tree-name":"",className:`flex min-w-0 ${d?"font-semibold":"font-medium"} ${v?"text-ink-faintest line-through":""}`,children:/* @__PURE__ */g(
|
|
11
|
+
/* @__PURE__ */h("span",{"data-tree-name":"",className:`flex min-w-0 ${d?"font-semibold":"font-medium"} ${v?"text-ink-faintest line-through":""}`,children:/* @__PURE__ */g(i,{children:[o,null!=c&&/* @__PURE__ */h("span",{className:"ml-2 font-normal text-ink-faint",children:c})]})}),A(y),null!=T&&/* @__PURE__ */h(n,{count:T,label:k,active:d,showZero:!0,className:"ml-auto"}),null!=w&&!j&&/* @__PURE__ */h("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:`${null!=T?"":"ml-auto "}flex shrink-0 items-center gap-0.5 transition-opacity ${N||v?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"}`,children:w})]}),null!=w&&j&&
|
|
12
12
|
/* @__PURE__ */g("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:D,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(N||v||d?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
|
|
13
13
|
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
14
14
|
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
15
|
-
/* @__PURE__ */h("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:w})]}),W&&/* @__PURE__ */h(r,{id:
|
|
15
|
+
/* @__PURE__ */h("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:w})]}),W&&/* @__PURE__ */h(r,{id:O})]})}function C({onAdd:e,label:t,drop:r=!1,slotProps:a}){const n=d().tree,o=r?n.dropHere:t??n.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
|
|
16
16
|
return h("div",{...a,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */g("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
|
|
17
|
-
/* @__PURE__ */h("span",{"aria-hidden":"true",children:"+"}),o]}):/* @__PURE__ */h("span",{className:i,children:o})})}function K({onInsert:e,label:t,drop:r=!1,seamProps:a}){const n=d().tree,o=t??n.insertHere,
|
|
17
|
+
/* @__PURE__ */h("span",{"aria-hidden":"true",children:"+"}),o]}):/* @__PURE__ */h("span",{className:i,children:o})})}function K({onInsert:e,label:t,drop:r=!1,seamProps:a}){const n=d().tree,o=t??n.insertHere,i=r?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
|
|
18
18
|
return g("div",{...a,role:"presentation","data-tree-seam":"","data-drop":r||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${a?.className??""}`.trim(),children:[
|
|
19
19
|
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
|
|
20
|
-
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${
|
|
20
|
+
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${i}`}),e&&/* @__PURE__ */h(l,{content:o,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */h("button",{type:"button","aria-label":o,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */h(s,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}export{y as Tree,C as TreeEmptySlot,x as TreeGroup,j as TreeGroupLabel,P as TreeRow,K as TreeSeam};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{requestFilesTrashView as n}from"./chunk-
|
|
1
|
+
import{requestFilesTrashView as n}from"./chunk-OY3JH66O.js";var o=null;function r(n){o=n}function t(){return o}function u(){n()}export{t as getFilesDemoTree,u as openFilesInTrashMode,r as setFilesDemoTree};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-H6PFTU3L.js";import{IconButton_default as a}from"./chunk-LE5LWALR.js";import{Icon as o}from"./chunk-UIWGVOFH.js";import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useShellStrings as s}from"./chunk-43MCNASD.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m(e,l,r,a){const o=h.filter(l=>"link"!==l&&e.has(l)).length+(l?1:0);return r&&0!==o?a>0?"paragraph":"words":null}function w({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s,clear:i}){let t=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),d=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);const c=m(l,r,i,d);return"paragraph"===c&&(d+=1),"words"===c&&(t+=1),{words:t>0,paragraph:d>0,oneRow:t>0&&d>0&&t+1+d<=9,flow:t>0&&d>0&&t+1+d>9&&t<=7,cells:{words:t,paragraph:d}}}function g(e,l){/* @__PURE__ */
|
|
2
|
+
return i(n,{content:e,children:l},l.key??void 0)}function f({offered:n,pressed:h,onMark:f,color:k,linkOpen:v=!1,last:N,alignment:C,list:D,letterCase:M,clear:x,disabled:y=!1,"aria-label":L,windows:A,className:j="",layout:I="grid"}){const q=s().textToolbar,R=w({offered:n,color:k,last:N,alignment:C,list:D,letterCase:M,clear:x});if(!R.words&&!R.paragraph)return null;const S=m(n,k,x,R.cells.paragraph),U=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,$=(e,l,r,o)=>n.has(e)?g(l,/* @__PURE__ */i(a,"link"===e?{pressed:v,className:U(v),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":v,"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r}:{className:U(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r},e)):null,B=l(q),K=e.map(e=>[e,B[e],r(e)]),T=C?e.filter(e=>C.allow.includes(e)):[],H=C&&T.includes(C.value)?C.value:T[0],O=[["none",q.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",q.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",q.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],W=x&&S?g(q.clear,/* @__PURE__ */i(a,{className:U(!1),"aria-label":q.clear,disabled:y,onMouseDown:c,onClick:x.onClear,children:/* @__PURE__ */i(o,{name:"revert"})},"clear")):null,E=/* @__PURE__ */t(d,{children:[$("bold",q.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),$("italic",q.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),$("underline",q.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),$("strike",q.strike,/* @__PURE__ */i(o,{name:"strike"})),k?g(q.color,/* @__PURE__ */i(a,{pressed:k.open,className:U(k.open,"rosh-tb-color"),"aria-label":q.color,"aria-haspopup":"dialog","aria-expanded":k.open,disabled:y,style:k.run?{"--rosh-tb-run":k.run}:void 0,onMouseDown:c,onClick:k.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,$("link",q.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),$("sup",q.sup,/* @__PURE__ */i(o,{name:"superscript"})),$("sub",q.sub,/* @__PURE__ */i(o,{name:"subscript"})),$("code",q.code,/* @__PURE__ */i(o,{name:"code"})),u(N)?N:null,"words"===S?W:null]}),F=/* @__PURE__ */t(d,{children:[C&&T.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":q.alignment,onKeyDown:e=>p(e,T,e=>C.onChange(e)),children:K.map(([e,l,r])=>C.allow.includes(e)?g(l,/* @__PURE__ */i(a,{role:"radio",pressed:C.value===e,className:U(C.value===e),"aria-checked":C.value===e,"aria-label":l,tabIndex:e===H?0:-1,disabled:y||C.disabled,onMouseDown:c,onClick:()=>C.onChange(e),children:r},e)):null)}):null,D&&n.has("bullet")?g(q.bullet,/* @__PURE__ */i(a,{className:U("bullet"===D.pressed),"aria-label":q.bullet,"aria-pressed":"bullet"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,D&&n.has("number")?g(q.number,/* @__PURE__ */i(a,{className:U("number"===D.pressed),"aria-label":q.number,"aria-pressed":"number"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,$("quote",q.quote,/* @__PURE__ */i(o,{name:"quote"})),M?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":q.letterCase,onKeyDown:e=>p(e,O.map(([e])=>e),e=>M.onChange(e)),children:O.map(([e,l,r])=>g(l,/* @__PURE__ */i(a,{role:"radio",pressed:M.value===e,className:U(M.value===e),"aria-checked":M.value===e,"aria-label":l,tabIndex:e===(M.value||"none")?0:-1,disabled:y||M.disabled,onMouseDown:c,onClick:()=>M.onChange(M.value===e?"":e),children:r},e)))}):null,"paragraph"===S?W:null]}),G="row"===I,J=G?" is-row":R.flow?" is-flow":R.oneRow?" is-one-row":R.words&&void 0===N&&"words"!==S?" is-eight":"",P=b(n,Boolean(k)),V={"--rosh-tb-color-col":String(P.color),"--rosh-tb-link-col":String(P.link),...G?{"--rosh-tb-cells":String(R.cells.words+R.cells.paragraph),"--rosh-tb-groupgap":R.words&&R.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let z;return z=G?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[R.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:E}):null,R.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:F}):null]}):R.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[E,
|
|
3
|
+
/* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),F]}):R.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
|
|
4
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-words",children:E}),
|
|
5
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-para",children:F})]}):/* @__PURE__ */t(d,{children:[R.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===N&&"words"!==S?" is-eight":""),children:E}):null,R.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:F}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${J} ${j}`.trim(),style:V,children:[
|
|
6
|
+
/* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":L??q.formatting,children:z}),A]})}export{f as TextToolbar,w as textToolbarRows,b as textToolbarWindowColumns};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-UIWGVOFH.js";import{useShellStrings as r}from"./chunk-43MCNASD.js";import{jsxs as t,jsx as n,Fragment as i}from"react/jsx-runtime";var a={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},s={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function o({tone:r}){const t={className:"h-5 w-5","aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
|
|
2
2
|
return n(e,{name:"check-circle",look:"mini",...t});case"warning":/* @__PURE__ */
|
|
3
3
|
return n(e,{name:"warning",look:"mini",...t});case"danger":/* @__PURE__ */
|
|
4
4
|
return n(e,{name:"close-circle",look:"mini",...t});default:/* @__PURE__ */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{
|
|
2
|
-
return y("div",{className:D,ref:B,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:W})});const G=X.flatMap(e=>e.points),H=G.some(e=>null!=e.size),K=14,Y=20,q=34,_=52,ee=(e,t,i,
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{usePlotWidth as t}from"./chunk-MAFUXCPZ.js";import{axisGutter as i,radiusScale as l,niceMax as r,logScale as o,linearScale as n}from"./chunk-2JWPNR2U.js";import{CHART_INK as a,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-43MCNASD.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useRef as u,useId as p,useState as d,useEffect as x}from"react";import{jsx as y,jsxs as g}from"react/jsx-runtime";var b=3;function k({series:b,height:k=260,width:v,xLabel:M,yLabel:A,formatX:z,formatY:N,xDomain:$,yDomain:j,xScale:w="linear",yScale:R="linear",radiusRange:S=[4,22],className:D,emptyLabel:U}){const L=c().charts,C=m(),P=z??(e=>h(e,C)),V=N??(e=>h(e,C)),W=U??L.noObservations,B=u(null),E=t(B),I=v??E,O=p(),[F,J]=d(null);x(()=>{if(null!==F)return f(e=>"Escape"===e.key&&(J(null),!0))},[F]);const Q=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),T=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),X=$||j?T.map(e=>({...e,points:e.points.filter(e=>Q(e.x,$)&&Q(e.y,j))})).filter(e=>e.points.length>0):T,Z=T.reduce((e,t)=>e+t.points.length,0)-X.reduce((e,t)=>e+t.points.length,0);if(0===X.length)/* @__PURE__ */
|
|
2
|
+
return y("div",{className:D,ref:B,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:W})});const G=X.flatMap(e=>e.points),H=G.some(e=>null!=e.size),K=14,Y=20,q=34,_=52,ee=(e,t,i,l)=>{const a=e.filter(e=>e>0),s="log"===i?a.length>0?Math.min(...a):0:Math.min(0,...e),c=t??[s,r(Math.max(...e))];return"log"===i?o(c,l):n(c,l)},te=ee(G.map(e=>e.y),j,R,{from:k-q,to:K}),ie=i(te.ticks(5).map(V),_),le=Math.max(ie+1,I-Y),re=ee(G.map(e=>e.x),$,w,{from:ie,to:le}),oe=l([0,Math.max(...G.map(e=>e.size??1))],{from:S[0],to:S[1]}),ne=F?X[F.s]:void 0,ae=F&&ne?ne.points[F.i]:void 0,se=X.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
|
|
3
3
|
return g("div",{className:`relative ${D??""}`,ref:B,children:[
|
|
4
4
|
/* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${I} ${k}`,role:"img","aria-label":L.scatter(X.map(e=>e.label),A??L.yAxis,M??L.xAxis)+(Z>0?`. ${L.outsideRange(Z)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>J(null),onBlur:()=>J(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,i=F?se.findIndex(e=>e.s===F.s&&e.i===F.i):0;J(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
|
|
5
5
|
/* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:O,children:/* @__PURE__ */y("rect",{x:ie-S[1],y:K-S[1],width:le-ie+2*S[1],height:k-q-K+2*S[1]})})}),te.ticks(5).map(e=>/* @__PURE__ */g("g",{children:[
|
|
6
6
|
/* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:a.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
7
7
|
/* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:V(e)})]},`y${e}`)),re.ticks(5).map(e=>/* @__PURE__ */y("text",{x:re(e),y:k-12,textAnchor:"middle",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:P(e)},`x${e}`)),M&&/* @__PURE__ */y("text",{x:(ie+le)/2,y:k-.5,textAnchor:"middle",fontSize:11,fill:a.label,children:M}),A&&/* @__PURE__ */y("text",{x:12,y:k/2,transform:`rotate(-90 12 ${k/2})`,textAnchor:"middle",fontSize:11,fill:a.label,children:A}),
|
|
8
|
-
/* @__PURE__ */y("g",{clipPath:`url(#${O})`,children:X.map((e,t)=>{const i=s(e.slot,3,e.color,e.tone);return e.points.map((l,r)=>/* @__PURE__ */y("circle",{cx:re(l.x),cy:te(l.y),r:H?oe(l.size??0):S[0]+1,fill:i,fillOpacity:F&&F.s!==t?.25:.62,stroke:a.surface,strokeWidth:2,onMouseEnter:()=>J({s:t,i:r})},`${e.key}-${r}`))})})]}),F&&ne&&ae&&/* @__PURE__ */y("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */y(e,{title:ae.label??ne.label,rows:[{key:"x",label:M??L.xAxis,color:s(ne.slot,3,ne.color,ne.tone),value:P(ae.x)},{key:"y",label:A??L.yAxis,color:s(ne.slot,3,ne.color,ne.tone),value:V(ae.y)},...null!=ae.size?[{key:"size",label:L.size,color:a.muted,value:
|
|
8
|
+
/* @__PURE__ */y("g",{clipPath:`url(#${O})`,children:X.map((e,t)=>{const i=s(e.slot,3,e.color,e.tone);return e.points.map((l,r)=>/* @__PURE__ */y("circle",{cx:re(l.x),cy:te(l.y),r:H?oe(l.size??0):S[0]+1,fill:i,fillOpacity:F&&F.s!==t?.25:.62,stroke:a.surface,strokeWidth:2,onMouseEnter:()=>J({s:t,i:r})},`${e.key}-${r}`))})})]}),F&&ne&&ae&&/* @__PURE__ */y("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */y(e,{title:ae.label??ne.label,rows:[{key:"x",label:M??L.xAxis,color:s(ne.slot,3,ne.color,ne.tone),value:P(ae.x)},{key:"y",label:A??L.yAxis,color:s(ne.slot,3,ne.color,ne.tone),value:V(ae.y)},...null!=ae.size?[{key:"size",label:L.size,color:a.muted,value:h(ae.size,C)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-EOGXCGQF.js";import{Select_default as l}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-EOGXCGQF.js";import{Select_default as l}from"./chunk-P3BLJCTQ.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-6JDR6T4U.js";import{Input_default as c}from"./chunk-7JY3YYN4.js";import{Button_default as s}from"./chunk-EOVXFXVV.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
|
|
3
3
|
/* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
|
|
4
4
|
/* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{formatMoney as e}from"./chunk-GEYM4WN3.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-
|
|
1
|
+
import{formatMoney as e}from"./chunk-GEYM4WN3.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-IMRGGJIJ.js";import{ChartFrame as a}from"./chunk-7H7U3HC6.js";import{ColumnChart as l}from"./chunk-QOQ6GXVA.js";import{TH_ONE_LINE as s}from"./chunk-WGLHB6WE.js";import{jsxs as o,jsx as i}from"react/jsx-runtime";function n({spec:n,height:c=200,width:m,animate:d=!0,className:h}){const u=function(r){if(r.currency)return t=>e(t,r.currency);const t=r.unit?` ${r.unit}`:"";return e=>`${e.toLocaleString("en-US",{maximumFractionDigits:2})}${t}`}(n),p=n.currency?r=>e(r,n.currency,{whole:!0}):u,b=n.series.map((e,r)=>({key:`s${r}`,label:e.name,data:e.values})),y=n.title??n.series.map(e=>e.name).join(", "),f=/* @__PURE__ */o("table",{className:"w-full border-collapse text-sm",children:[
|
|
2
2
|
/* @__PURE__ */i("thead",{children:/* @__PURE__ */o("tr",{children:[
|
|
3
3
|
/* @__PURE__ */i("td",{className:"border-b border-gray-200"}),n.series.map((e,r)=>/* @__PURE__ */i("th",{scope:"col",className:`${s} border-b border-gray-200 px-2 py-1 text-right font-semibold text-gray-700`,children:e.name},r))]})}),
|
|
4
4
|
/* @__PURE__ */i("tbody",{children:n.x.map((e,t)=>/* @__PURE__ */o("tr",{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ChartTooltip as t}from"./chunk-36VIGB6J.js";import{CartesianPlot as a}from"./chunk-
|
|
1
|
+
import{ChartTooltip as t}from"./chunk-36VIGB6J.js";import{CartesianPlot as a}from"./chunk-P4L74UA5.js";import{CHART_INK as e,STATUS_VARS as l}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-43MCNASD.js";import{formatPlain as n}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as s}from"react/jsx-runtime";function c({steps:c,height:u=240,width:m,formatValue:h,yAxisLabel:f,className:p,emptyLabel:d,radius:b=3,connectors:g=!0}){const v=o().charts,x=r(),y=h??(t=>n(t,x));let k=0;const M=c.map(t=>{if(t.total){const a={from:0,to:k,value:k,total:!0};return{...t,...a}}const a=k;return k+=t.value,{...t,from:a,to:k,value:t.value,total:!1}}),j=M.flatMap(t=>[t.from,t.to]);/* @__PURE__ */
|
|
2
2
|
return i(a,{labels:c.map(t=>t.label),values:j,height:u,width:m,formatValue:y,yAxisLabel:f,className:p,emptyLabel:d,bandPadding:.36,ariaLabel:v.waterfall(c.length,y(M[0]?.from??0),y(k)),tooltip:a=>{const e=M[a],o=e?.total?l.neutral:e.value>=0?l.good:l.critical;/* @__PURE__ */
|
|
3
3
|
return i(t,{title:e?.label,rows:[{key:"step",color:o,label:e?.total?v.balance:e.value>=0?v.increase:v.decrease,value:e?.total?y(e.to):`${e.value>=0?"+":"−"}${y(Math.abs(e.value))}`},...e?.total?[]:[{key:"running",label:v.runningTotal,color:l.neutral,value:y(e.to)}]]})},children:({x:t,y:a,active:o})=>/* @__PURE__ */s("g",{children:[g&&M.slice(0,-1).map((l,o)=>
|
|
4
4
|
/* @__PURE__ */i("line",{x1:t.end(o),y1:a(l.to),x2:t(o+1),y2:a(l.to),stroke:e.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${o}`)),M.map((e,r)=>{const n=e.total?l.neutral:e.value>=0?l.good:l.critical,s=Math.min(a(e.from),a(e.to)),c=Math.max(1,Math.abs(a(e.to)-a(e.from)));/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{isSafeLinkHref as e}from"./chunk-Q5Z3KHT2.js";import{Button_default as t}from"./chunk-EOVXFXVV.js";import{Icon as n}from"./chunk-
|
|
1
|
+
import{isSafeLinkHref as e}from"./chunk-Q5Z3KHT2.js";import{Button_default as t}from"./chunk-EOVXFXVV.js";import{Icon as n}from"./chunk-UIWGVOFH.js";import{useShellStrings as r}from"./chunk-43MCNASD.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
|
|
2
2
|
return a("a",{href:l,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",onClick:l&&r?e=>{(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&r(l)&&e.preventDefault()}:void 0,children:n})}function u(e){const t=[];let n,r=0,l=0;const s=new RegExp(c.source,"g");for(;null!==(n=s.exec(e));)n.index>r&&t.push(e.slice(r,n.index)),void 0!==n[1]?t.push(
|
|
3
3
|
/* @__PURE__ */i("span",{className:"text-gray-400",children:["[",n[1],"]"]},l++)):void 0!==n[3]?t.push(
|
|
4
4
|
/* @__PURE__ */a(d,{href:n[4],children:n[3]},l++)):void 0!==n[5]?t.push(
|