efficient-shell 10.22.0 → 10.24.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 +16 -4
- package/dist/{Browser-XQ5GO3LJ.js → Browser-KUFFOGYK.js} +14 -14
- package/dist/Calculator-LENRW34X.js +29 -0
- package/dist/CurrencyConverter-7UMHQS2V.js +21 -0
- package/dist/{Documents-7GOEAIJ6.js → Documents-ODZ4AAOY.js} +20 -20
- package/dist/{Files-MMVUWO5F.js → Files-BRGTTI2J.js} +46 -46
- package/dist/Notepad-RMRDEGGU.js +24 -0
- package/dist/PomodoroTimer-4566W4F7.js +91 -0
- package/dist/{Preview-DEK7WTAU.js → Preview-7POJP7PB.js} +33 -33
- package/dist/Sidebar-TU4QCKYJ.js +44 -0
- package/dist/Spreadsheet-7T4VT5IO.js +37 -0
- package/dist/{Stock-XHMTFEOL.js → Stock-H73C4R3N.js} +4 -4
- package/dist/{Weather-X5WAHYQ3.js → Weather-WF56QCBI.js} +20 -20
- package/dist/{WorldClock-ARU7PMVZ.js → WorldClock-5QJNZYYS.js} +6 -6
- package/dist/ai/index.js +91 -91
- package/dist/api/shellHttp.d.ts +52 -0
- package/dist/api/shellHttp.js +1 -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/ChartTooltip.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/chunk-2QY5BJLA.js +2 -0
- package/dist/{chunk-3PO4D32J.js → chunk-36PJGT4W.js} +1 -1
- package/dist/{chunk-AGPPZHAH.js → chunk-36VIGB6J.js} +1 -1
- package/dist/{chunk-C4CAPG3D.js → chunk-3BFZVVAT.js} +1 -1
- package/dist/chunk-3C5NKOVF.js +1 -0
- package/dist/chunk-3FBDLIQW.js +99 -0
- package/dist/chunk-4BCFBF3C.js +9 -0
- package/dist/chunk-4EBJO7ER.js +15 -0
- package/dist/chunk-4LXCCZDM.js +1 -0
- package/dist/{chunk-YICFH5KO.js → chunk-4P3324KU.js} +1 -1
- package/dist/chunk-4P57TIFK.js +2 -0
- package/dist/{chunk-QDJQ43N4.js → chunk-4RGMRXYH.js} +1 -1
- package/dist/{chunk-6V4INP7J.js → chunk-4TYIYL56.js} +4 -4
- package/dist/{chunk-P22NWAFW.js → chunk-55AEZX6K.js} +1 -1
- package/dist/chunk-5DIGYJHD.js +1 -0
- package/dist/{chunk-BB6A5MGA.js → chunk-5FYDNH4Y.js} +1 -1
- package/dist/{chunk-U2RFKQVA.js → chunk-5H4SWQGM.js} +1 -1
- package/dist/{chunk-KABWJIY4.js → chunk-5PP435FL.js} +1 -1
- package/dist/{chunk-BWTK3NUD.js → chunk-6IOFNPR6.js} +4 -4
- package/dist/{chunk-OBNA7GF5.js → chunk-6M5O2P64.js} +9 -9
- package/dist/{chunk-P3LKCOB4.js → chunk-7FW2BQTV.js} +2 -2
- package/dist/{chunk-SRYX6AQ6.js → chunk-7JVGF555.js} +1 -1
- package/dist/{chunk-ARSOETMP.js → chunk-7KWYVQMX.js} +1 -1
- package/dist/chunk-7LU3H72S.js +7 -0
- package/dist/chunk-7RP7QTRF.js +12 -0
- package/dist/{chunk-AKBGUMLI.js → chunk-A6FR2D46.js} +5 -5
- package/dist/{chunk-RAMJFT3D.js → chunk-AFG34RBV.js} +5 -5
- package/dist/{chunk-5JCHYQYI.js → chunk-ALTBTO3Z.js} +3 -3
- package/dist/chunk-ATMJ5ZPK.js +1 -0
- package/dist/{chunk-PWUPLXSS.js → chunk-BBXFIBXB.js} +1 -1
- package/dist/{chunk-EE56C2JH.js → chunk-BMXTPJ7T.js} +5 -5
- package/dist/{chunk-O64PY7ZJ.js → chunk-BUO7XCYR.js} +11 -11
- package/dist/{chunk-LJHVEISA.js → chunk-CH3JQUDW.js} +6 -6
- package/dist/{chunk-DLOJSJWL.js → chunk-CIHR5ZKF.js} +1 -1
- package/dist/{chunk-E5H5OU3A.js → chunk-COF33H6J.js} +5 -5
- package/dist/{chunk-GGRD2JLB.js → chunk-CQEVJG43.js} +1 -1
- package/dist/{chunk-WHISJI5L.js → chunk-CX4XR4HO.js} +1 -1
- package/dist/{chunk-XDCHB6JA.js → chunk-DGWS4GTI.js} +1 -1
- package/dist/{chunk-RXO2LNIB.js → chunk-DIEH76MB.js} +1 -1
- package/dist/{chunk-PJBZ5B54.js → chunk-DOF56HTO.js} +5 -5
- package/dist/{chunk-CGP2QCIA.js → chunk-DRUQH4ZE.js} +2 -2
- package/dist/{chunk-KGVNRLWT.js → chunk-DVYIBJ3S.js} +2 -2
- package/dist/{chunk-5DIBDRB6.js → chunk-DWAA4YZV.js} +3 -3
- package/dist/{chunk-4BPIGS2D.js → chunk-DZOJQURG.js} +6 -6
- package/dist/{chunk-7SMDYBQX.js → chunk-E3EJWNNK.js} +8 -8
- package/dist/chunk-E6FDUFPH.js +1 -0
- package/dist/chunk-EH2BNSG3.js +13 -0
- package/dist/chunk-EOVXFXVV.js +2 -0
- package/dist/chunk-EXLHFM3V.js +6 -0
- package/dist/chunk-F3ZOO23R.js +1 -0
- package/dist/{chunk-L67WTASI.js → chunk-FUDUQ44A.js} +1 -1
- package/dist/{chunk-N2RIQ2OU.js → chunk-FZM3ZPW3.js} +1 -1
- package/dist/{chunk-VQIG5N6D.js → chunk-G66SG6JN.js} +9 -9
- package/dist/{chunk-GCC2OZDG.js → chunk-GC3DA6D6.js} +1 -1
- package/dist/{chunk-QA3EAJ5H.js → chunk-GOXQJCXG.js} +17 -17
- package/dist/{chunk-XAPHUSOR.js → chunk-H475WZPF.js} +16 -16
- package/dist/{chunk-53DO72B2.js → chunk-H5NIW2KS.js} +1 -1
- package/dist/chunk-HNVSVTNC.js +16 -0
- package/dist/{chunk-ET4726WV.js → chunk-IHNOWRTP.js} +2 -2
- package/dist/{chunk-QZMGWRZ4.js → chunk-IPO4LHSB.js} +6 -6
- package/dist/{chunk-E5QPXEKN.js → chunk-JFBL4PR3.js} +1 -1
- package/dist/chunk-JPOYR5AO.js +7 -0
- package/dist/{chunk-BJRJODRZ.js → chunk-LCSMBVMU.js} +1 -1
- package/dist/{chunk-WVCX2Y3S.js → chunk-LE5LWALR.js} +1 -1
- package/dist/chunk-LNXBTK7Q.js +1 -0
- package/dist/{chunk-HC2AM2DT.js → chunk-MCAPJSB6.js} +1 -1
- package/dist/{chunk-REWKL7MX.js → chunk-MDYJVXWD.js} +2 -2
- package/dist/chunk-MHPFBVDD.js +8 -0
- package/dist/{chunk-NS2HY4NL.js → chunk-N5KO2IHG.js} +4 -4
- package/dist/{chunk-22LRMKLV.js → chunk-NJN5IKWO.js} +6 -6
- package/dist/{chunk-HWKAFISI.js → chunk-NRALUW6P.js} +7 -7
- package/dist/{chunk-SETRKP7W.js → chunk-NWC6YCIJ.js} +10 -10
- package/dist/{chunk-WE3HINW3.js → chunk-NZ34BQKH.js} +1 -1
- package/dist/{chunk-H2C5SZKO.js → chunk-NZ7BFYCM.js} +1 -1
- package/dist/chunk-O3MBPAWZ.js +2 -0
- package/dist/{chunk-6XYGA252.js → chunk-O7RR2ZZ2.js} +6 -6
- package/dist/{chunk-SAGI7AWC.js → chunk-OKHKY3ZZ.js} +1 -1
- package/dist/{chunk-KLAKLVKE.js → chunk-OTITQ3IH.js} +12 -12
- package/dist/{chunk-WSMRVWWK.js → chunk-P7H2DXJB.js} +10 -10
- package/dist/chunk-PSR6SXCC.js +14 -0
- package/dist/{chunk-AFBBNGVO.js → chunk-PVDZG2U2.js} +7 -7
- package/dist/{chunk-Q5WPHBDB.js → chunk-QGWKM7C3.js} +5 -5
- package/dist/{chunk-GEDS6QO7.js → chunk-QRU55BUS.js} +2 -2
- package/dist/{chunk-A46WK67X.js → chunk-QWCEKHAP.js} +4 -4
- package/dist/{chunk-DOWE3ZQR.js → chunk-RDKIYORS.js} +1 -1
- package/dist/{chunk-D6ZXMKW2.js → chunk-RSOBUPLK.js} +1 -1
- package/dist/{chunk-F3ZH6UCW.js → chunk-RZQGPWSN.js} +1 -1
- package/dist/{chunk-NWUAATIX.js → chunk-S4FPYCUU.js} +3 -3
- package/dist/chunk-S5DYR75A.js +29 -0
- package/dist/chunk-STKJA4PV.js +1 -0
- package/dist/{chunk-OAVU46YG.js → chunk-TDAI4J27.js} +4 -4
- package/dist/{chunk-WJ6ZJVAX.js → chunk-TE6R53YD.js} +1 -1
- package/dist/{chunk-GIK62TW6.js → chunk-TFSLPAGB.js} +3 -3
- package/dist/chunk-TNJ2VCH4.js +8 -0
- package/dist/{chunk-7XNDWW3Y.js → chunk-U44DVPGB.js} +1 -1
- package/dist/{chunk-ZTV2BA3P.js → chunk-U6LKNGC6.js} +1 -1
- package/dist/chunk-UKBXQXDZ.js +1 -0
- package/dist/chunk-ULJQYXHB.js +1 -0
- package/dist/{chunk-CIYMGVZC.js → chunk-UNQ54QOF.js} +1 -1
- package/dist/chunk-UPXDDO3U.js +1 -0
- package/dist/{chunk-C2ZUYCIM.js → chunk-USVL5SLG.js} +1 -1
- package/dist/chunk-USWA6YNZ.js +3 -0
- package/dist/{chunk-CIXGYZCF.js → chunk-V2J2AHDW.js} +4 -4
- package/dist/chunk-VX4COEWP.js +4 -0
- package/dist/{chunk-VXQQQDJ3.js → chunk-VX6TKEEK.js} +1 -1
- package/dist/{chunk-NTVOQHRS.js → chunk-WDQEUNGE.js} +1 -1
- package/dist/{chunk-GLE4F5FT.js → chunk-WGLHB6WE.js} +1 -1
- package/dist/{chunk-MW3FT4WI.js → chunk-WL4U4MTQ.js} +3 -3
- package/dist/{chunk-NPGFCIHB.js → chunk-WLYYC3AP.js} +1 -1
- package/dist/{chunk-GCP3LGRG.js → chunk-WOAMPTZI.js} +14 -14
- package/dist/{chunk-FHYETY4V.js → chunk-XBHXGBJR.js} +1 -1
- package/dist/{chunk-VKP2WRJJ.js → chunk-XCAUDTCC.js} +8 -8
- package/dist/chunk-XFH64VIG.js +19 -0
- package/dist/chunk-XXL5RLNM.js +22 -0
- package/dist/{chunk-6CICYVCK.js → chunk-YQOVUH5W.js} +8 -8
- package/dist/{chunk-WUMPTKOG.js → chunk-Z3SLQKE6.js} +1 -1
- package/dist/{chunk-4UHAQMOT.js → chunk-Z44JWU75.js} +2 -2
- package/dist/{chunk-UXPKCDEF.js → chunk-Z6GQFTLJ.js} +1 -1
- package/dist/{chunk-TBQLPMW5.js → chunk-ZRLWE3JM.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.d.ts +125 -0
- package/dist/data/EntityList.js +2 -0
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ResizableTable.d.ts +31 -0
- package/dist/data/ResizableTable.js +2 -0
- package/dist/data/useColumnConfig.d.ts +68 -0
- package/dist/data/useColumnConfig.js +2 -0
- package/dist/data/useSort.d.ts +55 -0
- package/dist/data/useSort.js +2 -0
- package/dist/data/useTableNav.d.ts +28 -0
- package/dist/data/useTableNav.js +2 -0
- package/dist/format/index.d.ts +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/hooks/useRootIsDark.d.ts +3 -0
- package/dist/hooks/useRootIsDark.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 +13 -317
- package/dist/index.js +667 -694
- package/dist/map/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/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/theme/index.d.ts +2 -0
- package/dist/theme/index.js +2 -0
- package/dist/ui/index.d.ts +6 -0
- package/dist/ui/index.js +1 -1
- package/dist/utils/glass.js +1 -1
- package/dist/utils/rootTheme.d.ts +13 -1
- package/dist/utils/rootTheme.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -1
- package/dist/Calculator-X62IAKQY.js +0 -29
- package/dist/CurrencyConverter-PSOBQ6K2.js +0 -21
- package/dist/Notepad-FAQBAF36.js +0 -24
- package/dist/PomodoroTimer-ZLS6XCTN.js +0 -91
- package/dist/Sidebar-JF2KEJT2.js +0 -44
- package/dist/Spreadsheet-6C7Q6OQA.js +0 -37
- package/dist/chunk-4DO47TT5.js +0 -1
- package/dist/chunk-5532S4RN.js +0 -4
- package/dist/chunk-5R4X7MFQ.js +0 -1
- package/dist/chunk-5XKCOKYJ.js +0 -1
- package/dist/chunk-CY5N5OA3.js +0 -2
- package/dist/chunk-F7U5MVNH.js +0 -2
- package/dist/chunk-FX4KK5GE.js +0 -3
- package/dist/chunk-GCMCXRIN.js +0 -19
- package/dist/chunk-H43BVPNN.js +0 -7
- package/dist/chunk-IWOVB4WI.js +0 -9
- package/dist/chunk-LIULEXWE.js +0 -14
- package/dist/chunk-LQVW3SW4.js +0 -6
- package/dist/chunk-NGRTW6Y7.js +0 -2
- package/dist/chunk-PBFFKRQF.js +0 -12
- package/dist/chunk-QFJIMX4A.js +0 -15
- package/dist/chunk-QIMFBARF.js +0 -8
- package/dist/chunk-RRGMXY46.js +0 -29
- package/dist/chunk-TLJWBRLI.js +0 -8
- package/dist/chunk-URQWWOHM.js +0 -7
- package/dist/chunk-WBJ6KNUF.js +0 -1
- package/dist/chunk-WEPQU5W6.js +0 -22
- package/dist/chunk-ZT45XXIB.js +0 -100
- /package/dist/{chunk-CSA6CGXS.js → chunk-RKLZDVAO.js} +0 -0
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import{useCopyText as e,CopyGlyph as t}from"./chunk-2E2SUEEE.js";import{ItemCount as n}from"./chunk-
|
|
1
|
+
import{useCopyText as e,CopyGlyph as t}from"./chunk-2E2SUEEE.js";import{ItemCount as n}from"./chunk-55AEZX6K.js";import{PopupMenu as r,PopupMenuItem as i,PopupMenuDivider as l}from"./chunk-OTITQ3IH.js";import{Icon as o}from"./chunk-2UO47XB4.js";import{useShellStrings as a}from"./chunk-GDQJBQ5B.js";import{useState as s,useMemo as d,useRef as c,useEffect 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 t=[];let n=0;for(;n<e.length;){const r=e[n].group;let i=n;for(;void 0!==r&&i+1<e.length&&e[i+1].group===r;)i++;t.push(i>n?{group:r,start:n,end:i}:{start:n,end:n}),n=i+1}return t}function b(e,t){return e.find(e=>t>=e.start&&t<=e.end)}function k(e,t,n,r){const i=e.findIndex(e=>e.key===t.key);let l=e.findIndex(e=>e.key===n);if(i<0||l<0)return null;const o=g(e),a=b(o,i),s="group"===t.kind&&void 0!==a.group?e.slice(a.start,a.end+1).map(e=>e.key):[t.key];if(s.includes(n))return null;const d=b(o,l);if("tab"===t.kind&&void 0!==a.group){if(d!==a)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,t,n,r){const i=k(e,t,n,r);if(!i)return null;const l=e.map(e=>e.key).filter(e=>!i.moving.includes(e)),o=l.indexOf(i.key)+("after"===i.side?1:0),a=[...l.slice(0,o),...i.moving,...l.slice(o)];return a.every((t,n)=>t===e[n].key)?null:a}var v="flex-[0_1_15rem]",w=v,N="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function C(){/* @__PURE__ */
|
|
2
2
|
return y(o,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function $({text:n,label:r,copiedLabel:i}){const{copied:l,copy:o}=e(n);/* @__PURE__ */
|
|
3
|
-
return y("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:o,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(t,{copied:l,className:"size-3.5"})})}function
|
|
3
|
+
return y("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:o,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(t,{copied:l,className:"size-3.5"})})}function I({node:e}){const t=c(null);return f(()=>{const n=t.current;if(n)return n.appendChild(e),()=>{e.parentNode===n&&n.removeChild(e)}},[e]),/* @__PURE__ */y("span",{ref:t,className:"ml-1 flex shrink-0 items-center"})}function z({tabs:e,activeKey:t,idFor:f,panelMounted:b,onActivate:z,onClose:j,onCloseMany:D,label:E,className:T,activeClassName:A,end:B,afterPinned:_,onIconMenu:M,menuItems:O,sizing:K="even",tall:R=!1,onReorder:S,groupInfo:L}){const X=a().pageTabs,Q=a().count,[F,H]=s(null),U=R?"h-[34px]":"h-8",W=d(()=>e.map(e=>({key:e.key,group:L?e.group:void 0})),[e,L]),G=d(()=>g(W),[W]),[J,P]=s(()=>/* @__PURE__ */new Set),V=e=>P(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),Y=d(()=>{const n=[];for(const r of G)for(let i=r.start;i<=r.end;i++)void 0!==r.group&&J.has(r.group)&&e[i].key!==t||n.push(e[i]);return n},[G,J,e,t]),Z=c(null),[q,ee]=s(null),te=(t,n)=>S?{draggable:!0,onDragStart:n=>{Z.current=t,n.dataTransfer.effectAllowed="move",n.dataTransfer.setData("text/plain",e.find(e=>e.key===t.key)?.title??"")},onDragOver:e=>{const r=Z.current;if(!r)return;const i=e.currentTarget.getBoundingClientRect(),l=n!==t.key||"tab"===t.kind?e.clientX<i.left+i.width/2?"before":"after":"before",o=x(W,r,n,l)?k(W,r,n,l):null;o?(e.preventDefault(),e.dataTransfer.dropEffect="move",q?.key===o.key&&q.side===o.side||ee({key:o.key,side:o.side})):q&&ee(null)},onDrop:e=>{const t=Z.current;if(!t||!q)return;e.preventDefault();const n=x(W,t,q.key,q.side);Z.current=null,ee(null),n&&S(n)},onDragEnd:()=>{Z.current=null,ee(null)}}:{},ne=d(()=>new Set(G.filter(e=>void 0!==e.group&&L).map(t=>e[t.start].key)),[G,e,L]),re=e=>"pointer-events-none absolute inset-y-1 z-[3] w-0.5 rounded-full bg-blue-500 "+("before"===e?"-left-px":"-right-px"),ie=e=>q?.key===e&&!("before"===q.side&&ne.has(e))&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:re(q.side)}),le=e.length;u(()=>{if(!t)return;const e=document.getElementById(f(t,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[f,t,le]);const oe=_?Y.findIndex(e=>!e.pinned):-1,ae=Y.some(e=>e.key===t)?t:Y[0]?.key,se=e=>{const t=Y[(e+Y.length)%Y.length];t&&document.getElementById(f(t.key,"tab"))?.focus()},de=(e,t)=>{const n=Y[e+t];if(!S||!n)return;const r=x(W,{kind:"tab",key:Y[e].key},n.key,t<0?"before":"after");r&&(S(r),setTimeout(()=>document.getElementById(f(Y[e].key,"tab"))?.focus(),0))},ce=F?e.find(e=>e.key===F.key):void 0,ue=ce&&O?O(ce.key):[],me=ce?e.indexOf(ce):-1,fe=e=>e.some(e=>!e.pinned),pe=e=>()=>{H(null),e()},ye=(e,n)=>{const r=e.key===t,i=!!e.dirty,l=e.icon,a=r?A??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",s=!!n&&!r&&n.key!==t,d={type:"button",role:"tab",id:f(e.key,"tab"),"aria-selected":r,"aria-controls":b?.(e.key)?f(e.key,"panel"):void 0,tabIndex:e.key===ae?0:-1,title:e.title,onClick:()=>z(e.key)},c={onContextMenu:t=>((e,t)=>{e.preventDefault(),H({x:e.clientX,y:e.clientY,key:t.key})})(t,e),onAuxClick:t=>((e,t)=>{1!==e.button||t.pinned||(e.preventDefault(),j(t.key))})(t,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},u=l&&
|
|
4
4
|
/* @__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&&
|
|
5
|
-
/* @__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&&!!
|
|
5
|
+
/* @__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&&!!M&&!!l;return e.pinned?/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex flex-none items-center justify-center rounded-t-md border border-b-0 transition-colors ${U} ${l?"w-10":""} ${a}`,...c,...te({kind:"tab",key:e.key},e.key),children:[ie(e.key),
|
|
6
6
|
/* @__PURE__ */p("button",{...d,className:`flex h-full items-center justify-center rounded-t-md ${l?"w-full":"px-3"} ${N}`,children:[u,
|
|
7
7
|
/* @__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"}),
|
|
8
|
-
/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-md border border-b-0 text-sm transition-colors ${
|
|
9
|
-
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":
|
|
8
|
+
/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-md border border-b-0 text-sm transition-colors ${U} ${"active-full"===K&&r?"":"@container"} ${"active-full"===K?r?"flex-[0_0_15rem] min-w-0":w:r&&(e.copy||h)?"flex-[0_1_20rem]":v} ${r?"active-full"===K?"":"min-w-[4.25rem]":"min-w-[4rem]"} ${a}`,...c,...te({kind:"tab",key:e.key},e.key),children:[ie(e.key),h&&
|
|
9
|
+
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":X.tabMenu,title:X.tabMenu,onClick:t=>{const n=t.currentTarget.getBoundingClientRect();M?.(e.key,n.left,n.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-2 ${N}`,children:u}),
|
|
10
10
|
/* @__PURE__ */p("button",{...d,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-md pr-1 text-left ${h?"pl-2":"pl-3"} ${N} ${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,
|
|
11
|
-
/* @__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"===
|
|
12
|
-
/* @__PURE__ */y("span",{role:"img","aria-label":
|
|
13
|
-
/* @__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":
|
|
14
|
-
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":
|
|
11
|
+
/* @__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"===K&&r?"pr-4":""} ${l?r?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""}`,children:[e.title,e.favorite&&
|
|
12
|
+
/* @__PURE__ */y("span",{role:"img","aria-label":X.favorite,title:X.favorite,className:"ml-1 inline-flex align-[-0.125em] text-yellow-500",children:/* @__PURE__ */y(o,{name:"star","aria-hidden":"true",className:"size-3.5",fill:"currentColor",strokeWidth:1.5})})]})]}),r&&e.actions&&/* @__PURE__ */y(I,{node:e.actions}),r&&e.copy&&/* @__PURE__ */y($,{text:e.copy,label:X.copy(e.copy),copiedLabel:X.copied}),
|
|
13
|
+
/* @__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":X.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
|
|
14
|
+
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":X.closeTab?.(e.title)??`${X.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(C,{})})]})]})]},e.key)},he=[];let ge,be=0,ke=!_;for(const t of G){const r=Y.filter(n=>{const r=e.indexOf(n);return r>=t.start&&r<=t.end});if(ke||be!==oe||(ke=!0,he.push(/* @__PURE__ */y(m,{children:_},"rosh-after-pinned")),ge=void 0),be+=r.length,void 0===t.group||!L){for(const e of r)he.push(ye(e,ge)),ge=e;continue}ge=void 0;const i=t.group,l=L(i),a=t.end-t.start+1,s=!J.has(i),d=e[t.start].key;he.push(
|
|
15
15
|
/* @__PURE__ */p("div",{role:"group","aria-label":l.label,"data-tab-group":i,className:"relative mx-1 flex shrink-0 items-end first:ml-0 min-w-0",children:[
|
|
16
|
-
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-expanded":s,title:
|
|
16
|
+
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-expanded":s,title:X.groupToggle(l.label,a),onClick:()=>V(i),...te({kind:"group",key:d},d),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 ${N}`,children:[
|
|
17
17
|
/* @__PURE__ */y(o,{name:s?"chevron-down":"chevron-right","aria-hidden":"true",className:"size-3",strokeWidth:2}),l.icon&&/* @__PURE__ */y("span",{className:"flex size-3.5 items-center justify-center [&>svg]:size-3.5","aria-hidden":"true",children:l.icon}),
|
|
18
18
|
/* @__PURE__ */y("span",{className:"max-w-[8rem] truncate",children:l.label}),
|
|
19
|
-
/* @__PURE__ */y(n,{count:a,label:
|
|
20
|
-
/* @__PURE__ */y("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-[2] h-0.5 bg-blue-500"})]},`rosh-group-${d}`))}return ke||he.push(/* @__PURE__ */y(m,{children:
|
|
19
|
+
/* @__PURE__ */y(n,{count:a,label:Q.tabs(a),active:!0})]}),q?.key===d&&"before"===q.side&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:re("before")}),r.map((e,t)=>ye(e,t>0?r[t-1]:void 0)),
|
|
20
|
+
/* @__PURE__ */y("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-[2] h-0.5 bg-blue-500"})]},`rosh-group-${d}`))}return ke||he.push(/* @__PURE__ */y(m,{children:_},"rosh-after-pinned")),/* @__PURE__ */p("div",{className:T??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
|
|
21
21
|
/* @__PURE__ */y("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
|
|
22
|
-
/* @__PURE__ */y("div",{role:"tablist","aria-label":E,onKeyDown:e=>{const t=Y.findIndex(t=>document.getElementById(f(t.key,"tab"))===e.target);if(t<0)return;const n=e.shiftKey&&(e.ctrlKey||e.metaKey);if(n&&"ArrowRight"===e.key)de(t,1);else if(n&&"ArrowLeft"===e.key)de(t,-1);else if("ArrowRight"===e.key)se(t+1);else if("ArrowLeft"===e.key)se(t-1);else if("Home"===e.key)se(0);else if("End"===e.key)se(Y.length-1);else{if("Delete"!==e.key||Y[t].pinned)return;j(Y[t].key)}e.preventDefault()},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:he}),
|
|
22
|
+
/* @__PURE__ */y("div",{role:"tablist","aria-label":E,onKeyDown:e=>{const t=Y.findIndex(t=>document.getElementById(f(t.key,"tab"))===e.target);if(t<0)return;const n=e.shiftKey&&(e.ctrlKey||e.metaKey);if(n&&"ArrowRight"===e.key)de(t,1);else if(n&&"ArrowLeft"===e.key)de(t,-1);else if("ArrowRight"===e.key)se(t+1);else if("ArrowLeft"===e.key)se(t-1);else if("Home"===e.key)se(0);else if("End"===e.key)se(Y.length-1);else{if("Delete"!==e.key||Y[t].pinned)return;j(Y[t].key)}e.preventDefault()},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:he}),B&&/* @__PURE__ */y("div",{className:"flex shrink-0 items-center gap-2 self-center",children:B}),F&&ce&&/* @__PURE__ */p(r,{portal:!0,style:{left:F.x,top:F.y},onClose:()=>H(null),children:[ue.length>0&&/* @__PURE__ */p(h,{children:[ue.map((e,t)=>/* @__PURE__ */p(i,{onClick:pe(e.onSelect),children:[e.icon,e.label]},t)),
|
|
23
23
|
/* @__PURE__ */y(l,{})]}),
|
|
24
|
-
/* @__PURE__ */y(i,{disabled:ce.pinned,onClick:pe(()=>j(ce.key)),children:
|
|
24
|
+
/* @__PURE__ */y(i,{disabled:ce.pinned,onClick:pe(()=>j(ce.key)),children:X.close}),
|
|
25
25
|
/* @__PURE__ */y(l,{}),
|
|
26
|
-
/* @__PURE__ */y(i,{disabled:!fe(e.filter(e=>e.key!==ce.key)),onClick:pe(()=>D("others",ce.key)),children:
|
|
27
|
-
/* @__PURE__ */y(i,{disabled:!fe(e.slice(me+1)),onClick:pe(()=>D("right",ce.key)),children:
|
|
28
|
-
/* @__PURE__ */y(i,{disabled:!fe(e),onClick:pe(()=>D("all",null)),children:
|
|
26
|
+
/* @__PURE__ */y(i,{disabled:!fe(e.filter(e=>e.key!==ce.key)),onClick:pe(()=>D("others",ce.key)),children:X.closeOthers}),
|
|
27
|
+
/* @__PURE__ */y(i,{disabled:!fe(e.slice(me+1)),onClick:pe(()=>D("right",ce.key)),children:X.closeRight}),
|
|
28
|
+
/* @__PURE__ */y(i,{disabled:!fe(e),onClick:pe(()=>D("all",null)),children:X.closeAll})]})]})}export{z as TabStrip};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-JH4ZCPHW.js";import{toDateKey as t,fromDateKey as r,toMonthKey as n}from"./chunk-2HMNOLKX.js";import{FILTER_ON as a,FILTER_ON_INK as o,FILTER_OFF as i}from"./chunk-AYZY3YNC.js";import{calendarNames as l}from"./chunk-Y3JW2GW5.js";import{pad2 as s}from"./chunk-LF27WIN2.js";import{buttonClasses as c}from"./chunk-UQYNPYF4.js";import{Icon as d}from"./chunk-2UO47XB4.js";import{onOverlayOpen as m}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{useDropdownPosition as h}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as p}from"./chunk-D65T4H6J.js";import{glassStyle as f}from"./chunk-
|
|
2
|
-
/* @__PURE__ */M("button",{type:"button",onClick:()=>ne("Custom"),className:Oe("Custom"),children:I.custom})]}),
|
|
3
|
-
/* @__PURE__ */M(e,{mode:"range",min:
|
|
4
|
-
return k("div",{className:"relative"+(
|
|
5
|
-
/* @__PURE__ */k("div",{className:`${
|
|
6
|
-
/* @__PURE__ */k("button",{ref:le,type:"button",onClick:()=>{
|
|
1
|
+
import{Calendar as e}from"./chunk-JH4ZCPHW.js";import{toDateKey as t,fromDateKey as r,toMonthKey as n}from"./chunk-2HMNOLKX.js";import{FILTER_ON as a,FILTER_ON_INK as o,FILTER_OFF as i}from"./chunk-AYZY3YNC.js";import{calendarNames as l}from"./chunk-Y3JW2GW5.js";import{pad2 as s}from"./chunk-LF27WIN2.js";import{buttonClasses as c}from"./chunk-UQYNPYF4.js";import{Icon as d}from"./chunk-2UO47XB4.js";import{onOverlayOpen as m}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{useDropdownPosition as h}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as p}from"./chunk-D65T4H6J.js";import{glassStyle as f}from"./chunk-5FYDNH4Y.js";import{useShellStrings as g,useShellLocale as b}from"./chunk-GDQJBQ5B.js";import{useState as x,useRef as v,useId as y,useEffect as w}from"react";import{createPortal as N}from"react-dom";import{jsxs as k,Fragment as C,jsx as M}from"react/jsx-runtime";var W=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],D=t;function j(e,r){const n=r.getFullYear(),a=r.getMonth(),o=new Date(n,a,r.getDate()),i=new Date(n,a,0),l=e=>new Date(n,a-e,1);switch(e){case"last2Weeks":return{from:t(new Date(n,a,r.getDate()-14)),to:t(o)};case"lastMonth":return{from:t(l(1)),to:t(i)};case"last3Months":return{from:t(l(3)),to:t(i)};case"last6Months":return{from:t(l(6)),to:t(i)};case"last12Months":return{from:t(l(12)),to:t(i)}}}function $(e,t,r){const a=n(e);return t&&a<t.slice(0,7)?t.slice(0,7):r&&a>r.slice(0,7)?r.slice(0,7):a}function Y(e){const t=r(e);return t?`${s(t.getDate())}/${s(t.getMonth()+1)}/${t.getFullYear()}`:e}var F=/* @__PURE__ */new Map;function H({from:t,to:n,onChange:s,formatDisplay:D,clearable:H,required:O=!1,name:S,id:B,"aria-labelledby":L,"aria-label":J,weekStartsOn:G,placeholder:T,fullWidth:U=!1,min:E,max:R,disabled:q=!1,allowOpenEnd:A=!1}){const I=g().dateRange,P=b(),Q=D??(P?function(e){let t=F.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),F.set(e,t));const n=t;return e=>{const t=r(e);return t?n.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(P):Y),Z=T??I.placeholder,X=H??!O,[z,K]=x(!1),[V,_]=x(t),[ee,te]=x(n),[re,ne]=x(null),[ae,oe]=x("from"),ie=v(null),le=v(null),se=v(null),ce=y(),de=y(),me=y(),[ue,he]=x(!1),pe=h(ie,z,{preferredMaxWidth:520,preferredMaxHeight:ue?720:560,popupRef:se}),fe=v(null),ge=v(null),[be,xe]=x(!0);p(()=>{const e=ge.current;if(!z||!ue||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==be&&xe(a)});const ve=v(null);p(()=>{const e=se.current;if(!z||!pe||!e)return;const t=getComputedStyle(e),r=pe.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(ue)null!==ve.current&&ve.current<=r&&he(!1);else{const e=fe.current?.offsetWidth??0;if(0===e)return;ve.current=e,e>r+.5&&he(!0)}});const[ye,we]=x(!1);p(()=>{const e=!!B&&(le.current?.labels?.length??0)>0;e!==ye&&we(e)});const Ne=!!J||!!L||ye,ke=/* @__PURE__ */new Date,[Ce,Me]=x(()=>t?t.slice(0,7):$(ke,E,R)),We=W.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(j(e,ke),E,R)),De=e=>e?Q(e):"";w(()=>{if(!z)return;const e=e=>{const t=e.target;ie.current?.contains(t)||se.current?.contains(t)||K(!1)};document.addEventListener("mousedown",e);const t=m(()=>K(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[z]),w(()=>{q&&K(!1)},[q]);const je=()=>{s("",""),K(!1)},$e=t&&n?`${De(t)} — ${De(n)}`:t?I.fromOnly(De(t)):n?I.toOnly(De(n)):"",Ye=l(P),Fe=e=>{const t=r(e);return t?Ye.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},He=t&&n?I.range(Fe(t),Fe(n)):t?I.fromOnly(Fe(t)):n?I.toOnly(Fe(n)):Z,Oe=e=>ue?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(re===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(re===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Se=/* @__PURE__ */k(C,{children:[We.map(e=>/* @__PURE__ */M("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=j(e,ke);_(t.from),te(t.to),ne(e),Me(t.from.slice(0,7))})(e),className:Oe(e),"aria-label":ue?I[e]:void 0,children:ue?be?I[e]:I[`${e}Short`]:I[e]},e)),
|
|
2
|
+
/* @__PURE__ */M("button",{type:"button",onClick:()=>ne("Custom"),className:Oe("Custom"),children:I.custom})]}),Be=(e,t)=>A?/* @__PURE__ */M("button",{type:"button","data-range-end":e,"aria-pressed":ae===e,onClick:()=>oe(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */M("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Le=e=>A&&ae===e?" ring-1 ring-blue-400":"",Je=
|
|
3
|
+
/* @__PURE__ */M(e,{mode:"range",min:E,max:R,value:V||null,endValue:ee||null,month:Ce,onMonthChange:Me,onSelect:e=>{ne("Custom"),A?"from"===ae?(ee&&e>ee?(_(ee),te(e)):_(e),oe("to")):V&&e<V?(te(V),_(e)):te(e):!V||V&&ee?(_(e),te("")):e<V?(te(V),_(e)):te(e)},weekStartsOn:G,"aria-label":I.dialog});/* @__PURE__ */
|
|
4
|
+
return k("div",{className:"relative"+(U?" w-full":""),ref:ie,children:[
|
|
5
|
+
/* @__PURE__ */k("div",{className:`${U?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${t||n?`${a} ${o}`:i}${q?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
+
/* @__PURE__ */k("button",{ref:le,type:"button",onClick:()=>{q||(_(t),te(n),ne(null),oe(t&&!n?"to":"from"),Me(t?t.slice(0,7):$(ke,E,R)),K(!0))},"aria-haspopup":"dialog","aria-expanded":z,id:B,disabled:q||void 0,"aria-label":J,"aria-labelledby":L,"aria-describedby":[Ne?de:void 0,O?me:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":z?ce:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(U?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
7
|
/* @__PURE__ */M(d,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
-
/* @__PURE__ */M("span",{className:"truncate",children:$e||Z})]}),X&&!
|
|
9
|
-
/* @__PURE__ */M("input",{type:"hidden",name:S.from,value:t,disabled:
|
|
10
|
-
/* @__PURE__ */M("input",{type:"hidden",name:S.to,value:n,disabled:
|
|
8
|
+
/* @__PURE__ */M("span",{className:"truncate",children:$e||Z})]}),X&&!q&&(t||n)&&/* @__PURE__ */M("button",{type:"button",onClick:je,"aria-label":I.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Ne&&/* @__PURE__ */M("span",{id:de,className:"sr-only",children:He}),O&&/* @__PURE__ */M("span",{id:me,className:"sr-only",children:I.required}),S&&/* @__PURE__ */k(C,{children:[
|
|
9
|
+
/* @__PURE__ */M("input",{type:"hidden",name:S.from,value:t,disabled:q||void 0}),
|
|
10
|
+
/* @__PURE__ */M("input",{type:"hidden",name:S.to,value:n,disabled:q||void 0})]}),z&&N(
|
|
11
11
|
/* @__PURE__ */k("div",{ref:se,id:ce,role:"dialog","aria-label":I.dialog,"data-layout":ue?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:u.popup,left:pe?.left,right:pe?.right,top:pe?.top,bottom:pe?.bottom,width:ue&&pe?pe.maxWidth:"max-content",maxWidth:pe?.maxWidth,maxHeight:pe?.maxHeight,overflowY:"auto",visibility:pe?void 0:"hidden",...f()},children:[
|
|
12
|
-
/* @__PURE__ */k("div",{className:ue?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
|
|
12
|
+
/* @__PURE__ */k("div",{className:ue?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Be("from",/* @__PURE__ */k(C,{children:[
|
|
13
13
|
/* @__PURE__ */M("span",{className:"text-xs font-medium text-gray-500",children:I.from}),
|
|
14
|
-
/* @__PURE__ */M("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${V?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Le("from")}`,children:V?
|
|
14
|
+
/* @__PURE__ */M("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${V?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Le("from")}`,children:V?De(V):I.start})]})),!ue&&/* @__PURE__ */M("span",{className:"text-gray-300",children:"—"}),Be("to",/* @__PURE__ */k(C,{children:[
|
|
15
15
|
/* @__PURE__ */M("span",{className:"text-xs font-medium text-gray-500",children:I.to}),
|
|
16
|
-
/* @__PURE__ */M("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Le("to")}`,children:ee?
|
|
16
|
+
/* @__PURE__ */M("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Le("to")}`,children:ee?De(ee):I.end})]}))]}),ue?/* @__PURE__ */k(C,{children:[We.length>0&&/* @__PURE__ */k("div",{className:"mb-3 @container",children:[!be&&/* @__PURE__ */M("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:I.lastHeading}),
|
|
17
17
|
/* @__PURE__ */k("div",{ref:ge,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Se,We.map(e=>/* @__PURE__ */M("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:I[e]},e))]})]}),
|
|
18
|
-
/* @__PURE__ */M("div",{className:"w-full",children:
|
|
18
|
+
/* @__PURE__ */M("div",{className:"w-full",children:Je})]}):
|
|
19
19
|
/* @__PURE__ */k("div",{ref:fe,className:"flex w-max gap-4",children:[
|
|
20
|
-
/* @__PURE__ */M("div",{className:"w-64",children:
|
|
21
|
-
/* @__PURE__ */k("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[X&&/* @__PURE__ */M("button",{type:"button",onClick:
|
|
20
|
+
/* @__PURE__ */M("div",{className:"w-64",children:Je}),We.length>0&&/* @__PURE__ */M("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Se})]}),
|
|
21
|
+
/* @__PURE__ */k("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[X&&/* @__PURE__ */M("button",{type:"button",onClick:je,className:c({variant:"ghost"}),children:I.clear}),
|
|
22
22
|
/* @__PURE__ */M("button",{type:"button",onClick:()=>K(!1),className:c({variant:"secondary"}),children:I.cancel}),
|
|
23
|
-
/* @__PURE__ */M("button",{type:"button",onClick:()=>{s(V,ee),K(!1)},disabled:
|
|
23
|
+
/* @__PURE__ */M("button",{type:"button",onClick:()=>{s(V,ee),K(!1)},disabled:A?!V&&!ee:!V||!ee,className:c({variant:"primary"}),children:I.apply})]})]}),document.body)]})}export{H as DateRangePicker,j as presetRange,D as toISODate};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{TransferProgress as e}from"./chunk-
|
|
1
|
+
import{TransferProgress as e}from"./chunk-TDAI4J27.js";import{Icon as r}from"./chunk-2UO47XB4.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-GDQJBQ5B.js";import{jsx as o}from"react/jsx-runtime";var n=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function i(e){if(/^data:/i.test(e||""))return function(e){const r=n.exec(e);if(!r)return"media";const[,t,o]=r,i=o.split("+")[0].split(".").pop().replace(/^x-/i,"");return i?`${t.toLowerCase()}.${i.toLowerCase()}`:"media"}(e);const r=(e||"").split("?")[0].split("#")[0],t=r.substring(r.lastIndexOf("/")+1);try{return decodeURIComponent(t.replace(/^[0-9a-f]{32}_/i,""))||t||"media"}catch{return t||"media"}}var s=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function a(e,r=t.media){const o=function(e){const r=e.includes("video"),t=e.includes("image")||"*"===e||""===e;return r&&!t?"video":t&&!r?"image":"file"}(e);return"image"===o?r.uploadImage:"video"===o?r.uploadVideo:r.uploadFile}function c(e,r,t="",o="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",o,r?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",t].filter(Boolean).join(" ")}function u(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function d({label:r,progress:t,rounded:n="rounded-lg"}){/* @__PURE__ */
|
|
2
2
|
return o("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${n}`,children:/* @__PURE__ */o(e,{state:"busy",verb:r,pct:t})})}function l({children:e}){/* @__PURE__ */
|
|
3
3
|
return o("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e})}function m(e,r=""){if(!e)return!1;const t=n.exec(e);if(t)return"video"===t[1].toLowerCase();const o=r.includes("video"),i=r.includes("image")||"*"===r||""===r;return s.test(e)||o&&!i}function f({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
4
4
|
return o(r,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function p({className:e="h-6 w-6"}){/* @__PURE__ */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-UKBXQXDZ.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-2UO47XB4.js";import{TH_ONE_LINE as n}from"./chunk-WGLHB6WE.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-GDQJBQ5B.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,j]=c(!1),S=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:_,onResizeStart:z,onDragStart:B,onDragOver:$,onDrop:L,onDragEnd:W,toggleColumn:E,resetColumns:G,draggedIdx:I,dropGap:P}=t(f,S),{hasAnyPerm:Q}=r(),R=i().columns,[T,U]=c(!1),[A,J]=c(!1),[K,O]=c(!1),X=m(null),Y=k.length>0&&Q(k);e(X,h(()=>{T&&U(!1)},[T]));const F=C.reduce((e,t)=>e+t.width,0),H=C.map(e=>`${e.width}px`),M={tableLayout:"fixed",width:F,minWidth:"100%"},V=m(null),Z=h(e=>{const t=V.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),q=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
|
|
2
|
+
return u("div",{className:"flex flex-col flex-1 min-h-0 "+(w?"-mx-4":""),children:[
|
|
3
|
+
/* @__PURE__ */p("div",{ref:V,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
|
|
4
|
+
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:H[t]}},e.key))}),
|
|
5
|
+
/* @__PURE__ */p("thead",{className:"bg-gray-50",children:/* @__PURE__ */p("tr",{children:C.map((e,t)=>{const r=g.find(t=>t.key===e.key),o=r?.sortField??("_select"!==e.key?e.key:void 0),l=x&&o&&x.field===o,a="_select"===e.key;/* @__PURE__ */
|
|
6
|
+
return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${I===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>B(t),onDragOver:a?void 0:e=>$(t,e),onDrop:a?void 0:e=>L(t,e),onDragEnd:a?void 0:W,style:a?void 0:{cursor:"grab"},children:[
|
|
7
|
+
/* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&y?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&y?e=>{e.stopPropagation(),y(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===x.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),P===t&&/* @__PURE__ */p("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"}),t===C.length-1&&P===C.length&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"})]},e.key)})})})]})}),
|
|
8
|
+
/* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:Z,children:[
|
|
9
|
+
/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
|
|
10
|
+
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:H[t]}},e.key))}),N(C)]}),v]}),void 0!==b&&/* @__PURE__ */u("div",{className:"border-t border-gray-200 px-4 py-2 text-sm text-gray-500 shrink-0 flex items-center justify-between",children:[
|
|
11
|
+
/* @__PURE__ */p("span",{children:b}),
|
|
12
|
+
/* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:X,children:[w&&q&&/* @__PURE__ */p("button",{onClick:()=>j(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?R.hideSelection:R.showSelection,children:D?R.selectDone:R.select}),
|
|
13
|
+
/* @__PURE__ */p("button",{onClick:G,className:"text-2xs text-ink-faintest hover:text-gray-600",children:R.reset}),
|
|
14
|
+
/* @__PURE__ */p("button",{onClick:()=>U(!T),className:"text-gray-400 hover:text-gray-600",title:R.choose,children:/* @__PURE__ */p(l,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),T&&/* @__PURE__ */u("div",{className:"absolute bottom-full right-0 mb-1 w-52 rounded-(--radius-popup) z-(--z-popup) py-1 max-h-80 overflow-y-auto",style:s(),children:[
|
|
15
|
+
/* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:R.heading}),_.filter(e=>"_select"!==e.key).map(e=>/* @__PURE__ */u("label",{className:"flex items-center gap-2 px-3 py-1 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer",children:[
|
|
16
|
+
/* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>E(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),Y&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{J(!0);const e=_.filter(e=>!e.hidden).map(e=>e.key),t=w?"mobile":"desktop",r={visible_columns:e};x&&(r.sort=x);try{await a.patch(`/auth/default-columns/${f}/`,r,{params:{viewport:t}}).catch(()=>a.post("/auth/default-columns/",{table_id:f,viewport:t,...r})),O(!0),setTimeout(()=>O(!1),2e3)}catch{}J(!1)},disabled:A,className:"text-2xs w-full text-center py-1 rounded "+(K?"text-green-600":"text-ink-faint hover:text-blue-600"),children:A?"...":K?R.savedDefault:R.saveDefault})})]})]})]})]})}export{f as ResizableTable};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useWindowMenuItem as e,Modal as t}from"./chunk-
|
|
1
|
+
import{useWindowMenuItem as e,Modal as t}from"./chunk-3FBDLIQW.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as s}from"./chunk-5DIGYJHD.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{DEFAULT_SHELL_STRINGS as o,useShellStrings as i,splitAround as a}from"./chunk-GDQJBQ5B.js";import{useState as m,useCallback as c,isValidElement as l,cloneElement as d}from"react";import{jsx as p,jsxs as h}from"react/jsx-runtime";var f=o.aboutApp,u={spreadsheet:{name:"Spreadsheets",version:"1.2.0",route:"/spreadsheet",description:f.spreadsheet},notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:f.notepad},documents:{name:"Documents",version:"1.1.1",route:"/documents",description:f.documents},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:f.preview},files:{name:"Files",version:"1.1.4",route:"/files",description:f.files},browser:{name:"Browser",version:"1.0.2",route:"/browser",description:f.browser}},x=/* @__PURE__ */p(n,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),v=/* @__PURE__ */p(n,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function w({app:n}){const o=u[n],[f,w]=m(!1),N=c(()=>w(!0),[]),b=i().aboutApp,k=b.title(o.name);if(e(k,N,x),!f)return null;const g=r[o.route],y=l(g)?d(g,{className:"h-9 w-9"}):v,[j,D]=a(b.partOf);/* @__PURE__ */
|
|
2
2
|
return p(t,{open:!0,onClose:()=>w(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */h("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
|
|
3
3
|
/* @__PURE__ */p("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
|
|
4
4
|
/* @__PURE__ */p("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:o.name}),
|
|
@@ -6,4 +6,4 @@ return p(t,{open:!0,onClose:()=>w(!1),title:k,size:"sm",compact:!0,bodyScroll:!1
|
|
|
6
6
|
/* @__PURE__ */p("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[n]}),
|
|
7
7
|
/* @__PURE__ */h("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
|
|
8
8
|
/* @__PURE__ */h("p",{className:"text-2xs text-ink-faint",children:[j,
|
|
9
|
-
/* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),
|
|
9
|
+
/* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),D]}),s&&/* @__PURE__ */p("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(s)})]})]})})}export{w as AboutApp,u as BUILTIN_APP_INFO};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-
|
|
2
|
-
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:B,rowRef:D,className:P=""}){const
|
|
1
|
+
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-7JVGF555.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
|
|
2
|
+
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:B,rowRef:D,className:P=""}){const $=x||!!p,A=n(u),I=l(null),J=s(),K=[B?.["aria-describedby"],j?J:void 0].filter(Boolean).join(" ")||void 0,T=B?.tabIndex;a(()=>{const e=I.current;if(!e||void 0!==T)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const q="comfortable"===A?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},z=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
|
|
3
3
|
/* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
|
|
4
|
-
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open"
|
|
5
|
-
/* @__PURE__ */c("div",{...B,ref:e=>{var r,t;I.current=e,t=e,"function"==typeof(r=D)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":B?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":
|
|
6
|
-
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[
|
|
7
|
-
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:
|
|
4
|
+
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":$||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":$?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${q[k]}`}),
|
|
5
|
+
/* @__PURE__ */c("div",{...B,ref:e=>{var r,t;I.current=e,t=e,"function"==typeof(r=D)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":B?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":K,onKeyDown:e=>{if(B?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",P].filter(Boolean).join(" "),children:[
|
|
6
|
+
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[z&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[z,
|
|
7
|
+
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:z})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:J})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{navIcons as e}from"./chunk-
|
|
1
|
+
import{navIcons as e}from"./chunk-4LXCCZDM.js";import{Icon as t}from"./chunk-2UO47XB4.js";import{isValidElement as r,cloneElement as n}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var l=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function a(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r);return l[Math.abs(t)%l.length]}var d={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},s={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},c={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},f={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function p({className:e}){/* @__PURE__ */
|
|
2
2
|
return o(t,{name:"folder",look:"solid",className:e})}function u(t,r){return r&&e[r]||(t?e[t]:void 0)}var m=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function h({entityType:e,isSelected:t,entityId:l,label:h,fileKind:w}){const g="preview-file"===e&&w,y=g?f[w]:null,x=g?c[w]:null;if("folder"===e)/* @__PURE__ */
|
|
3
3
|
return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o(p,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=u(l,h),i=a(l||h||"page");/* @__PURE__ */
|
|
4
4
|
return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${i} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&r(e)?n(e,{className:"h-7 w-7 text-white"}):m})})}/* @__PURE__ */
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-CIHR5ZKF.js";import{useTabLayer as n,focusableIn as o}from"./chunk-CDAJKLGL.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-OTITQ3IH.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:L,align:j="end",side:C="bottom","aria-label":K,className:A="",triggerClassName:E,menuClassName:H="",minWidth:S=180,linkAs:W,disabled:T,id:$,"aria-describedby":I,"aria-disabled":N=!1,onOpenChange:U,footer:B,footerLabel:J}){const[q,G]=m(!1),[M,R]=m(-1),z=h(null),O=h(null),P=h(null),Q=h(null),F=h(null),V=null!=B&&!1!==B,Y=h({text:"",at:0}),Z=g(),X=g(),_=$??X,ee=h(U);ee.current=U;const te=h(q);te.current=q;const re=v(e=>{G(!1),te.current&&(te.current=!1,ee.current?.(!1)),e&&O.current?.focus()},[]),ne=(t,r)=>{const n=L.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(L[i]))return i}return-1},oe=()=>P.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!q)return;const e=e=>{const t=e.target;if(z.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()}},[q,re]);const ie=v(()=>{const e=oe(),t=O.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:j,side:C});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=j},[j,C]);p(()=>{q&&ie()}),b(()=>{if(q)return u(()=>O.current,ie)},[q,ie]),b(()=>{if(!q)return;const t=P.current,r=e(L[M])?t?.querySelector(`[data-dropdown-index="${M}"]`):null;(r??t)?.focus({preventScroll:!0})},[q,M]),b(()=>{if(q)return f(e=>"Escape"===e.key&&(re(!0),!0),()=>Q.current)},[q,re]),n(Q,q&&V);const ae=h(null),le=e=>"first"===e?ne(0,1):ne(L.length-1,-1),se=e=>{R(le(e)),G(!0),te.current||(te.current=!0,ae.current=e,U?.(!0))};p(()=>{const e=ae.current;if(!q||!e)return;ae.current=null;const t=le(e);t!==M&&R(t)});const de=t(L,Z),ce="function"==typeof B?B({close:()=>re(!0)}):B,ue={...k.test(H)?{}:{zIndex:s.popup},minWidth:S};/* @__PURE__ */
|
|
2
|
+
return y("div",{ref:z,className:`relative inline-flex ${A}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */x("button",{ref:O,id:_,type:"button","aria-haspopup":"menu","aria-expanded":q,"aria-controls":q?Z:void 0,"aria-label":K,"aria-describedby":I,"aria-disabled":N||void 0,disabled:T,onClick:()=>{N||(q?re(!1):se("first"))},onKeyDown:e=>{N||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),se("first")):"ArrowUp"===e.key&&(e.preventDefault(),se("last")))},className:E??"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 "+(K?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:D}),q&&
|
|
4
|
+
/* @__PURE__ */x(i,{portal:!0,className:H,style:ue,children:/* @__PURE__ */y("div",{ref:Q,children:[
|
|
5
|
+
/* @__PURE__ */x("div",{ref:P,id:Z,role:"menu","aria-orientation":"vertical","aria-label":K,"aria-labelledby":K?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(),R(ne(M+1,1));else if("ArrowUp"===t.key)t.preventDefault(),R(ne(M-1,-1));else if("Home"===t.key)t.preventDefault(),R(ne(0,1));else if("End"===t.key)t.preventDefault(),R(ne(L.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&F.current?o(F.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-Y.current.at<500?Y.current.text+n:n;Y.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=P.current,d=L.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(L[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void R(n)}})(t)},children:r(L,{menuId:Z,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||F.current?.contains(document.activeElement)||R(e)}}),linkAs:W})}),V&&/* @__PURE__ */y("div",{ref:F,role:"group","aria-label":J,"data-dropdown-footer":"",onKeyDown:e=>{const t=F.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=P.current?.querySelector(`[data-dropdown-index="${M}"]`);return void(t??P.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,4 +1,4 @@
|
|
|
1
|
-
import{ChartTooltip as t}from"./chunk-
|
|
1
|
+
import{ChartTooltip as t}from"./chunk-36VIGB6J.js";import{CartesianPlot as a}from"./chunk-QO5E33DH.js";import{CHART_INK as e,STATUS_VARS as l}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-GDQJBQ5B.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 +1 @@
|
|
|
1
|
-
import{iconButtonClasses as e}from"./chunk-UQYNPYF4.js";import{isAriaDisabled as r,swallowPress as a,describedByWith as i,OffWithReason as s}from"./chunk-
|
|
1
|
+
import{iconButtonClasses as e}from"./chunk-UQYNPYF4.js";import{isAriaDisabled as r,swallowPress as a,describedByWith as i,OffWithReason as s}from"./chunk-TE6R53YD.js";import{forwardRef as d,useId as n}from"react";import{jsx as o}from"react/jsx-runtime";var t=d(function({children:d,variant:t="ghost",size:c="md",type:l="button",className:m="",pressed:b,disabledReason:p,ink:u,disabled:f,onClick:h,"aria-disabled":k,"aria-describedby":v,...y},N){const j=n(),Y=(Boolean(f)||r(k))&&null!=p&&""!==p,x=Y||r(k),z=/* @__PURE__ */o("button",{ref:N,type:l,className:e({variant:t,size:c,pressed:b??(!0===y["aria-pressed"]||"true"===y["aria-pressed"]),ink:u,className:m}),...y,disabled:Y?void 0:f,"aria-disabled":!!x||k,"aria-describedby":i(v,Y?j:void 0),onClick:x?a:h,children:d});return Y?/* @__PURE__ */o(s,{reason:p,id:j,children:z}):z});export{t as IconButton_default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t={}){const e=t.whenUnset??!1;try{const n=(t.doc??document).documentElement,o=n.getAttribute("data-theme");return!("dark"!==o&&!n.classList.contains("dark"))||"light"!==o&&e}catch{return e}}var e=["data-theme","class"];function n(t,n={}){const o=(n.doc??("undefined"==typeof document?void 0:document))?.documentElement;if(!o||"undefined"==typeof MutationObserver)return()=>{};const r=new MutationObserver(()=>t());return r.observe(o,{attributes:!0,attributeFilter:e}),()=>r.disconnect()}export{e as ROOT_THEME_ATTRIBUTES,t as rootIsDark,n as watchRootTheme};
|
|
@@ -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-XXL5RLNM.js";import{ChartFrame as a}from"./chunk-VAK5FQXH.js";import{ColumnChart as l}from"./chunk-BMXTPJ7T.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,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return(new Date).toISOString()}var j=null,K=[],W=!1,q=null,Q=/* @__PURE__ */new Set;function X(){for(const t of Q)t()}function $(t){K=t,X()}function z(){const t=j;return t?q=t.list().then(e=>{j===t&&(K=e,W=!0,X())}).catch(()=>{j===t&&(W=!0,X())}).finally(()=>{q=null}):(K=[],W=!0,X(),Promise.resolve())}function H(t){j=t,K=[],W=!1,t?z():X()}function U(t){return Q.add(t),!j||W||q||z(),()=>{Q.delete(t)}}function Y(){return K}function Z(){const
|
|
1
|
+
import{toast_default as t}from"./chunk-7ELJQL7J.js";import{useShellPrefs as e}from"./chunk-KC3EX26K.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(E(),R()):"none"!==t&&0!==m||E()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&R())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),E())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);E(),N(s,{volume:u,repeat:d});const e="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(e)}catch{}try{t.info(e)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,_={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function O(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=O(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*_[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function E(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function F(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=O(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*_[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var G="pomodoro_tasks",J="pomodoro_tasks_migrated";function L(){return Math.random().toString(36).slice(2,11)}function V(){/* @__PURE__ */
|
|
2
|
+
return(new Date).toISOString()}var j=null,K=[],W=!1,q=null,Q=/* @__PURE__ */new Set;function X(){for(const t of Q)t()}function $(t){K=t,X()}function z(){const t=j;return t?q=t.list().then(e=>{j===t&&(K=e,W=!0,X())}).catch(()=>{j===t&&(W=!0,X())}).finally(()=>{q=null}):(K=[],W=!0,X(),Promise.resolve())}function H(t){j=t,K=[],W=!1,t?z():X()}function U(t){return Q.add(t),!j||W||q||z(),()=>{Q.delete(t)}}function Y(){return K}function Z(){const t=function(){const{prefs:t,save:n}=e(),r=a(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=L(),n=V(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:V()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(U,Y,Y),i=o(e=>{const n=j;if(!n)return t.addTask(e);const o="tmp-"+L(),a=V(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return $([...K,r]),n.create({...e,name:e.name.trim()}).then(t=>$(K.map(e=>e.id===o?{...r,...t}:e))).catch(()=>$(K.filter(t=>t.id!==o))),o},[t]),c=o((e,n)=>{const o=j;if(!o)return t.updateTask(e,n);$(K.map(t=>t.id===e?{...t,...n,id:e,updatedAt:V()}:t)),o.update(e,n).catch(()=>{z()})},[t]),l=o(e=>{const n=j;if(!n)return t.removeTask(e);const o=K;$(K.filter(t=>t.id!==e)),n.remove(e).catch(()=>$(o))},[t]),s=o(e=>{if(!j)return t.toggleDone(e);const n=K.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=o(e=>{j||t.setAllTasks(e)},[t]);return null===j?t:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(J))return;const n=localStorage.getItem(G);if(!n)return void localStorage.setItem(J,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(G),void localStorage.setItem(J,"1");const a=V(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||L(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(G),localStorage.setItem(J,"1")}catch{try{localStorage.setItem(J,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,F as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,H as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{axisGutter as t,radiusScale as i,niceMax as l,logScale as r,linearScale as o}from"./chunk-2JWPNR2U.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{CHART_INK as a,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as h}from"./chunk-GDQJBQ5B.js";import{formatPlain as f}from"./chunk-C3QOHMR6.js";import{useRef as u,useId as p,useState as d,useEffect as x}from"react";import{jsx as y,jsxs as g}from"react/jsx-runtime";var b=3;function k({series:b,height:k=260,width:v,xLabel:M,yLabel:A,formatX:z,formatY:$,xDomain:j,yDomain:w,xScale:N="linear",yScale:R="linear",radiusRange:D=[4,22],className:S,emptyLabel:U}){const B=m().charts,L=h(),P=z??(e=>f(e,L)),Q=$??(e=>f(e,L)),V=U??B.noObservations,W=u(null),C=n(W),E=v??C,I=p(),[J,O]=d(null);x(()=>{if(null!==J)return c(e=>"Escape"===e.key&&(O(null),!0))},[J]);const F=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),G=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),T=j||w?G.map(e=>({...e,points:e.points.filter(e=>F(e.x,j)&&F(e.y,w))})).filter(e=>e.points.length>0):G,X=G.reduce((e,t)=>e+t.points.length,0)-T.reduce((e,t)=>e+t.points.length,0);if(0===T.length)/* @__PURE__ */
|
|
2
|
+
return y("div",{className:S,ref:W,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:V})});const Z=T.flatMap(e=>e.points),H=Z.some(e=>null!=e.size),K=14,Y=20,q=34,_=52,ee=(e,t,i,n)=>{const a=e.filter(e=>e>0),s="log"===i?a.length>0?Math.min(...a):0:Math.min(0,...e),c=t??[s,l(Math.max(...e))];return"log"===i?r(c,n):o(c,n)},te=ee(Z.map(e=>e.y),w,R,{from:k-q,to:K}),ie=t(te.ticks(5).map(Q),_),le=Math.max(ie+1,E-Y),re=ee(Z.map(e=>e.x),j,N,{from:ie,to:le}),oe=i([0,Math.max(...Z.map(e=>e.size??1))],{from:D[0],to:D[1]}),ne=J?T[J.s]:void 0,ae=J&&ne?ne.points[J.i]:void 0,se=T.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
|
|
3
|
+
return g("div",{className:`relative ${S??""}`,ref:W,children:[
|
|
4
|
+
/* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${E} ${k}`,role:"img","aria-label":B.scatter(T.map(e=>e.label),A??B.yAxis,M??B.xAxis)+(X>0?`. ${B.outsideRange(X)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>O(null),onBlur:()=>O(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,i=J?se.findIndex(e=>e.s===J.s&&e.i===J.i):0;O(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
|
|
5
|
+
/* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:I,children:/* @__PURE__ */y("rect",{x:ie-D[1],y:K-D[1],width:le-ie+2*D[1],height:k-q-K+2*D[1]})})}),te.ticks(5).map(e=>/* @__PURE__ */g("g",{children:[
|
|
6
|
+
/* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:a.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
7
|
+
/* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:Q(e)})]},`y${e}`)),re.ticks(5).map(e=>/* @__PURE__ */y("text",{x:re(e),y:k-12,textAnchor:"middle",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:P(e)},`x${e}`)),M&&/* @__PURE__ */y("text",{x:(ie+le)/2,y:k-.5,textAnchor:"middle",fontSize:11,fill:a.label,children:M}),A&&/* @__PURE__ */y("text",{x:12,y:k/2,transform:`rotate(-90 12 ${k/2})`,textAnchor:"middle",fontSize:11,fill:a.label,children:A}),
|
|
8
|
+
/* @__PURE__ */y("g",{clipPath:`url(#${I})`,children:T.map((e,t)=>{const i=s(e.slot,3,e.color,e.tone);return e.points.map((l,r)=>/* @__PURE__ */y("circle",{cx:re(l.x),cy:te(l.y),r:H?oe(l.size??0):D[0]+1,fill:i,fillOpacity:J&&J.s!==t?.25:.62,stroke:a.surface,strokeWidth:2,onMouseEnter:()=>O({s:t,i:r})},`${e.key}-${r}`))})})]}),J&&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??B.xAxis,color:s(ne.slot,3,ne.color,ne.tone),value:P(ae.x)},{key:"y",label:A??B.yAxis,color:s(ne.slot,3,ne.color,ne.tone),value:Q(ae.y)},...null!=ae.size?[{key:"size",label:B.size,color:a.muted,value:f(ae.size,L)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{ChoiceContent as t,choiceItemClass as n,choiceTipClass as r,choiceTrackClass as o}from"./chunk-JDQGHQ2C.js";import{Tooltip as l}from"./chunk-
|
|
2
|
-
return s("nav",{ref:v,"aria-label":m,"aria-labelledby":g,className:b(c,u),children:e.map(e=>{const o=e.id===n,a=/* @__PURE__ */s("a",{href:e.disabled?void 0:e.href,"aria-current":o?"location":void 0,"aria-disabled":e.disabled||void 0,onClick:e.disabled?void 0:t=>((e,t)=>{const n=f(t.href);n&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&(e.preventDefault(),w(t.id),n.scrollIntoView({block:"start",behavior:"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}),n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0}))})(t,e),className:`${h(o,c,"warning"===e.tone?"warning":"default")}${e.disabled?" cursor-not-allowed opacity-50":""}`,children:/* @__PURE__ */s(t,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */s(l,{content:e.tooltip,className:c?r(c):void 0,children:a},e.id):a})})}var v=(e,t)=>`${e}-tab-${t}`,w=(e,t)=>`${e}-panel-${t}`;function y(e,t){const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=(parseFloat(n.columnGap)||0)*Math.max(0,t-1),l=e.parentElement;let a=1/0;if(l){const e=getComputedStyle(l);a=l.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:r+o,room:a}}function x(e){return e.items.some(e=>null!=e.href)?/* @__PURE__ */s(g,{...e}):/* @__PURE__ */s(k,{...e})}function k({items:f,value:p,onChange:g,variant:x="underline",block:k=!1,idPrefix:C,className:F="","aria-label":E,"aria-labelledby":
|
|
3
|
-
return s("div",{ref
|
|
1
|
+
import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{ChoiceContent as t,choiceItemClass as n,choiceTipClass as r,choiceTrackClass as o}from"./chunk-JDQGHQ2C.js";import{Tooltip as l}from"./chunk-NJN5IKWO.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{useRef as i,useState as c,useEffect as d}from"react";import{jsx as s,jsxs as u,Fragment as m}from"react/jsx-runtime";var b=(e,t)=>`flex items-center border-b border-gray-200${e?"":" gap-1"} ${t}`.trim();function h(e,t,n="default"){return`-mb-px inline-flex items-center gap-2 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${t?"flex-1 justify-center ":""}${e?"border-blue-600 text-blue-600":`border-transparent ${"warning"===n?"text-amber-700":"text-gray-900"} hover:border-gray-300`}`}function f(e){if(!e||!e.startsWith("#")||e.length<2)return null;try{return document.getElementById(decodeURIComponent(e.slice(1)))}catch{return null}}function p(e,t){const n=e.filter(e=>!e.disabled).map(e=>({id:e.id,section:f(e.href)})).filter(e=>null!=e.section);if(0===n.length)return null;const r=function(e){for(let t=e.parentElement;t;t=t.parentElement){const e=getComputedStyle(t).overflowY;if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t}return document.scrollingElement??document.documentElement}(n[0].section);if(r.scrollTop>0&&r.scrollTop+r.clientHeight>=r.scrollHeight-1)return n[n.length-1].id;const o=Math.max(0,t.getBoundingClientRect().bottom)+8;let l=n[0].id;for(const e of n)e.section.getBoundingClientRect().top<=o&&(l=e.id);return l}function g({items:e,value:n,onChange:o,block:c=!1,className:u="","aria-label":m,"aria-labelledby":g}){const v=i(null),w=function(e,t,n,r){const o=i(0),l=i({items:t,value:n,onChange:r});l.current={items:t,value:n,onChange:r};const c=i(()=>{});return c.current=()=>{const t=e.current;if(!t||Date.now()<o.current)return;const n=p(l.current.items,t);null!=n&&n!==l.current.value&&l.current.onChange(n)},a(()=>{c.current()},[t]),d(()=>{let e=0;const t=()=>{e||(e=requestAnimationFrame(()=>{e=0,c.current()}))};return document.addEventListener("scroll",t,{capture:!0,passive:!0}),window.addEventListener("resize",t),()=>{document.removeEventListener("scroll",t,{capture:!0}),window.removeEventListener("resize",t),e&&cancelAnimationFrame(e)}},[]),e=>{o.current=Date.now()+800,e!==l.current.value&&l.current.onChange(e),window.setTimeout(()=>c.current(),850)}}(v,e,n,o);/* @__PURE__ */
|
|
2
|
+
return s("nav",{ref:v,"aria-label":m,"aria-labelledby":g,className:b(c,u),children:e.map(e=>{const o=e.id===n,a=/* @__PURE__ */s("a",{href:e.disabled?void 0:e.href,"aria-current":o?"location":void 0,"aria-disabled":e.disabled||void 0,onClick:e.disabled?void 0:t=>((e,t)=>{const n=f(t.href);n&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&(e.preventDefault(),w(t.id),n.scrollIntoView({block:"start",behavior:"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}),n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0}))})(t,e),className:`${h(o,c,"warning"===e.tone?"warning":"default")}${e.disabled?" cursor-not-allowed opacity-50":""}`,children:/* @__PURE__ */s(t,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */s(l,{content:e.tooltip,className:c?r(c):void 0,children:a},e.id):a})})}var v=(e,t)=>`${e}-tab-${t}`,w=(e,t)=>`${e}-panel-${t}`;function y(e,t){const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=(parseFloat(n.columnGap)||0)*Math.max(0,t-1),l=e.parentElement;let a=1/0;if(l){const e=getComputedStyle(l);a=l.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:r+o,room:a}}function x(e){return e.items.some(e=>null!=e.href)?/* @__PURE__ */s(g,{...e}):/* @__PURE__ */s(k,{...e})}function k({items:f,value:p,onChange:g,variant:x="underline",block:k=!1,idPrefix:C,className:F="","aria-label":E,"aria-labelledby":N,labelsFit:R=!1}){const A=i([]),L=i(null),$="pill"===x,[D,S]=c(null),W=D??"none",H=i(()=>{});H.current=()=>{const t=L.current;if(!t||!R)return;const n=function(e){return[...e.querySelectorAll('[role="tab"]')].map(e=>{const t=getComputedStyle(e),n=(parseFloat(t.paddingLeft)||0)+(parseFloat(t.paddingRight)||0)+(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.borderRightWidth)||0),r=e.querySelector("[data-tab-glyph]")?.getBoundingClientRect().width??0,o=e.querySelector("[data-tab-word]")?.scrollWidth??0;return{bare:n+r,worded:n+r+(r&&o?8:0)+o,active:"true"===e.getAttribute("aria-selected")}})}(t);S(function({tabs:t,block:n,chrome:r,room:o}){if(!n)return e({buttons:t,orientation:"horizontal",chrome:r,room:o});if(0===t.length)return"none";const l=e=>r+e*t.length<=o+.5;if(l(Math.max(...t.map(e=>e.worded))))return"all";const a=t.find(e=>e.active);return a&&l(Math.max(a.worded,...t.map(e=>e.bare)))?"chosen":"none"}({tabs:n,block:k,...y(t,n.length)}))},a(()=>{H.current()}),d(()=>{const e=L.current?.parentElement;if(!R||!e)return;let t=!0;const n=()=>{t&&H.current()},r="undefined"==typeof ResizeObserver?void 0:ResizeObserver,o=r?new r(n):null;return o?.observe(e),document.fonts?.ready.then(n,()=>{}),()=>{t=!1,o?.disconnect()}},[R]);const j=(e,t)=>{for(let n=1;n<=f.length;n+=1){const r=((e+t*n)%f.length+f.length)%f.length;if(!f[r]?.disabled)return r}return null},I=e=>{const t=1===e?f.map((e,t)=>t):f.map((e,t)=>f.length-1-t);for(const e of t)if(!f[e]?.disabled)return e;return null};/* @__PURE__ */
|
|
3
|
+
return s("div",{ref:L,role:"tablist","data-labels-shown":R?W:void 0,"aria-label":E,"aria-labelledby":N,onKeyDown:e=>{const t=f.findIndex(e=>e.id===p);let n=null;if("ArrowRight"===e.key||"ArrowDown"===e.key)n=j(t,1);else if("ArrowLeft"===e.key||"ArrowUp"===e.key)n=j(t,-1);else if("Home"===e.key)n=I(1);else{if("End"!==e.key)return;n=I(-1)}e.preventDefault(),null!==n&&n!==t&&(g(f[n].id),A.current[n]?.focus())},className:$?o(k,F):b(k,F),children:f.map((e,o)=>{const a=e.id===p,i=R&&null!=e.icon,c="all"===W||"chosen"===W&&a,d=/* @__PURE__ */s("button",{ref:e=>{A.current[o]=e},type:"button",role:"tab",id:C?v(C,e.id):void 0,"aria-controls":C?w(C,e.id):void 0,"aria-selected":a,tabIndex:a?0:-1,disabled:e.disabled,onClick:()=>g(e.id),className:$?n({selected:a,disabled:e.disabled,block:k}):h(a,k,"warning"===e.tone?"warning":"default"),children:i?/* @__PURE__ */u(m,{children:[
|
|
4
4
|
/* @__PURE__ */s("span",{"aria-hidden":"true","data-tab-glyph":"",className:"inline-flex shrink-0",children:e.icon}),
|
|
5
|
-
/* @__PURE__ */s("span",{"data-tab-word":c?"shown":"hidden",className:c?"whitespace-nowrap":"sr-only",children:e.label})]}):/* @__PURE__ */s(t,{icon:e.icon,label:e.label})},e.id),b=i?e.tooltip??e.label:e.tooltip;return null!=b&&!1!==b?/* @__PURE__ */s(l,{content:b,className
|
|
5
|
+
/* @__PURE__ */s("span",{"data-tab-word":c?"shown":"hidden",className:c?"whitespace-nowrap":"sr-only",children:e.label})]}):/* @__PURE__ */s(t,{icon:e.icon,label:e.label})},e.id),b=i?e.tooltip??e.label:e.tooltip;return null!=b&&!1!==b?/* @__PURE__ */s(l,{content:b,className:$||k?r(k):void 0,children:d},e.id):d})})}export{x as Tabs,v as tabButtonId,w as tabPanelId};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{onOverlayOpen as t}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{followAnchor as r,popupBounds as o,VIEWPORT_MARGIN as n,showingBox as i,placeBeside as a,placeArrow as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as s}from"./chunk-
|
|
2
|
-
return y("span",{ref:
|
|
3
|
-
/* @__PURE__ */k(j.Provider,{value:!0,children:S}),
|
|
4
|
-
/* @__PURE__ */y("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:e.hint,...
|
|
5
|
-
/* @__PURE__ */k("span",{ref:
|
|
6
|
-
/* @__PURE__ */k("span",{"aria-hidden":"true",className:"rosh-tooltip-arrow","data-side":
|
|
1
|
+
import{onOverlayOpen as t}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{followAnchor as r,popupBounds as o,VIEWPORT_MARGIN as n,showingBox as i,placeBeside as a,placeArrow as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as s}from"./chunk-5FYDNH4Y.js";import{registerModalEscapeInterceptor as d,escapeSurfaceAbove as h}from"./chunk-TWVUQUUD.js";import{createContext as m,useContext as u,useState as p,useRef as f,useId as x,useEffect as w,isValidElement as g,cloneElement as b}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,jsx as k}from"react/jsx-runtime";var j=m(!1),H=()=>u(j),W={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function N({content:m,side:u="top",delay:H=200,children:N,className:B="relative inline-flex",describe:T=!0,open:M}){const[D,U]=p(!1),z=(M??D)&&!(null==m||!1===m||""===m),[C,E]=p(null),J=f(void 0),L=f(null),P=f(null),$=x(),F=f(!1),G=()=>{window.clearTimeout(J.current),F.current||(J.current=window.setTimeout(()=>U(!0),H))},R=()=>{window.clearTimeout(J.current),U(!1)},Y=()=>{F.current=!0,R()},I=()=>{F.current=!1,R()};w(()=>()=>window.clearTimeout(J.current),[]),c(()=>{if(!z)return void E(null);const t=()=>{const t=L.current,e=P.current;if(!t||!e)return;const r=o(t),c=Math.max(0,r.right-r.left-2*n),s=Math.max(0,r.bottom-r.top-2*n);e.style.maxWidth=`${c}px`,e.style.maxHeight=`${s}px`;const d=e.getBoundingClientRect();if(d.width<=0||d.height<=0)return;const h=t.getBoundingClientRect();if(!i(t))return void R();const m=a(h,d,u,r,12),p=l(h,m,d,16,6),f={anchor:{left:h.left,top:h.top,width:h.width,height:h.height},left:m.left-h.left,top:m.top-h.top,maxWidth:c,maxHeight:s,side:m.side,arrow:p&&{left:p.x-h.left,top:p.y-h.top}};E(t=>{return t&&(r=f,(e=t).anchor.left===r.anchor.left&&e.anchor.top===r.anchor.top&&e.anchor.width===r.anchor.width&&e.anchor.height===r.anchor.height&&e.left===r.left&&e.top===r.top&&e.maxWidth===r.maxWidth&&e.maxHeight===r.maxHeight&&e.side===r.side&&e.arrow?.left===r.arrow?.left&&e.arrow?.top===r.arrow?.top)?t:f;var e,r})};return t(),r(()=>L.current,t)},[z,u,m]),w(()=>{if(!z)return;const e=d(t=>"Escape"===t.key&&(R(),!h(L.current))),r=t(R);return()=>{e(),r()}},[z]);const Q=z&&T?$:void 0,S=g(N)?b(N,{"aria-describedby":[N.props["aria-describedby"],Q].filter(Boolean).join(" ")||void 0}):N,V=z?s():void 0;/* @__PURE__ */
|
|
2
|
+
return y("span",{ref:L,className:B,"aria-describedby":g(N)?void 0:Q,onMouseEnter:G,onMouseLeave:I,onFocus:t=>{let e=!0;try{e=t.target.matches(":focus-visible")}catch{}e&&G()},onBlur:I,onPointerDown:Y,onClick:Y,children:[
|
|
3
|
+
/* @__PURE__ */k(j.Provider,{value:!0,children:S}),z&&v(
|
|
4
|
+
/* @__PURE__ */y("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:e.hint,...C?.anchor},children:[
|
|
5
|
+
/* @__PURE__ */k("span",{ref:P,id:$,role:"tooltip",className:`pointer-events-none absolute z-(--z-hint) box-border w-max overflow-hidden whitespace-normal break-words text-start rounded-md px-2 py-1 text-xs text-ink-strong ${C?"":W[u]}`,style:{...V,...C&&{left:C.left,top:C.top,maxWidth:C.maxWidth,maxHeight:C.maxHeight}},children:m}),(!C||C.arrow)&&
|
|
6
|
+
/* @__PURE__ */k("span",{"aria-hidden":"true",className:"rosh-tooltip-arrow","data-side":C?.side??u,style:{background:V?.background,"--rosh-tooltip-edge":V?.border,...C?.arrow&&{left:C.arrow.left,top:C.arrow.top}}})]}),document.body)]})}export{N as Tooltip,H as useInsideTooltip};
|