efficient-shell 10.21.0 → 10.23.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 +4 -0
- package/dist/{Browser-RMXGMX4E.js → Browser-GTQKXJQ6.js} +15 -15
- package/dist/Calculator-PM4TYWTE.js +29 -0
- package/dist/{CurrencyConverter-42IHLJVV.js → CurrencyConverter-4I2ENTSX.js} +5 -5
- package/dist/{Documents-YAKAFEDY.js → Documents-MTCJXTXY.js} +5 -5
- package/dist/{Files-FJAFKP6V.js → Files-XMZ3XBP4.js} +26 -26
- package/dist/Notepad-QIJN7VDZ.js +24 -0
- package/dist/{PomodoroTimer-PD7POYX5.js → PomodoroTimer-5ELVNJEU.js} +7 -7
- package/dist/{Preview-UEZPFGON.js → Preview-QCA6XUDU.js} +22 -22
- package/dist/Sidebar-7LN3ZEF4.js +44 -0
- package/dist/{Spreadsheet-AEFR6TFD.js → Spreadsheet-EKYP6XIX.js} +12 -12
- package/dist/Stock-TRG6CAZJ.js +16 -0
- package/dist/{Weather-4QPYOENN.js → Weather-YGTT7UWR.js} +20 -20
- package/dist/{WorldClock-3ZVRBLEW.js → WorldClock-UCX5LCJB.js} +6 -6
- package/dist/ai/index.js +32 -32
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/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-Q32Q44DX.js → chunk-36PJGT4W.js} +1 -1
- package/dist/{chunk-G4GVLK44.js → chunk-36VIGB6J.js} +1 -1
- package/dist/{chunk-YILGAEW3.js → chunk-3BFZVVAT.js} +1 -1
- package/dist/chunk-4BCFBF3C.js +9 -0
- package/dist/{chunk-77MOYIQW.js → chunk-4EBJO7ER.js} +11 -11
- package/dist/{chunk-5WYRAJ5F.js → chunk-4P3324KU.js} +1 -1
- package/dist/chunk-4P57TIFK.js +2 -0
- package/dist/{chunk-C6Y7B73Q.js → chunk-4RGMRXYH.js} +1 -1
- package/dist/{chunk-6V4INP7J.js → chunk-4TYIYL56.js} +4 -4
- package/dist/{chunk-FOFZI62F.js → chunk-55AEZX6K.js} +1 -1
- package/dist/chunk-5FYDNH4Y.js +1 -0
- package/dist/{chunk-TKJBZIHT.js → chunk-5PP435FL.js} +1 -1
- package/dist/{chunk-DCRLJMQ6.js → chunk-5RQJRD2E.js} +1 -1
- package/dist/{chunk-RBBIAIPH.js → chunk-6M5O2P64.js} +9 -9
- package/dist/{chunk-OP5DOO3K.js → chunk-75UD5ZMP.js} +4 -4
- package/dist/chunk-7IY47EKR.js +1 -0
- package/dist/{chunk-LYHJHUQH.js → chunk-7JVGF555.js} +1 -1
- package/dist/{chunk-N67QX3WW.js → chunk-7KWYVQMX.js} +2 -2
- package/dist/chunk-7LU3H72S.js +7 -0
- package/dist/chunk-7RP7QTRF.js +12 -0
- package/dist/{chunk-ALF3GC7A.js → chunk-A6FR2D46.js} +2 -2
- package/dist/{chunk-XCHAU2UN.js → chunk-AFG34RBV.js} +6 -6
- package/dist/{chunk-VN4KSRZ5.js → chunk-BBXFIBXB.js} +1 -1
- package/dist/{chunk-DPYBV5PU.js → chunk-BMXTPJ7T.js} +5 -5
- package/dist/{chunk-I33SVQ7P.js → chunk-CH3JQUDW.js} +5 -5
- package/dist/{chunk-4UKGVLFP.js → chunk-CIHR5ZKF.js} +1 -1
- package/dist/{chunk-JNQKBN5M.js → chunk-COF33H6J.js} +5 -5
- package/dist/{chunk-RXCGE2AY.js → chunk-CQEVJG43.js} +1 -1
- package/dist/{chunk-YJXS7BR5.js → chunk-CX4XR4HO.js} +1 -1
- package/dist/chunk-DBL7MFCB.js +14 -0
- package/dist/{chunk-HV47GP2C.js → chunk-DGWS4GTI.js} +1 -1
- package/dist/{chunk-YSDPFDAG.js → chunk-DIEH76MB.js} +1 -1
- package/dist/{chunk-W3OWPBQL.js → chunk-DRUQH4ZE.js} +2 -2
- package/dist/{chunk-6T2CL4JT.js → chunk-DVYIBJ3S.js} +2 -2
- package/dist/{chunk-Y62TTKSY.js → chunk-DWAA4YZV.js} +3 -3
- package/dist/{chunk-5TDQPZDB.js → chunk-DZOJQURG.js} +6 -6
- package/dist/{chunk-3UXXA2CS.js → chunk-E3EJWNNK.js} +8 -8
- package/dist/{chunk-2EYXE5XK.js → chunk-E6LQY6TB.js} +1 -1
- package/dist/{chunk-I4VIEGCX.js → chunk-EOVXFXVV.js} +2 -2
- package/dist/chunk-EXLHFM3V.js +6 -0
- package/dist/{chunk-MMYWBTYP.js → chunk-FUDUQ44A.js} +1 -1
- package/dist/{chunk-TXDA7TTP.js → chunk-FZM3ZPW3.js} +1 -1
- package/dist/{chunk-VWIYC2NB.js → chunk-G66SG6JN.js} +8 -8
- package/dist/{chunk-5SIOCKCK.js → chunk-G7BBSHDF.js} +2 -2
- package/dist/{chunk-2VGQS6CW.js → chunk-GC3DA6D6.js} +1 -1
- package/dist/{chunk-NVD4AI5Y.js → chunk-GCZU4XFA.js} +1 -1
- package/dist/{chunk-FKRPQDFX.js → chunk-GOXQJCXG.js} +17 -17
- package/dist/{chunk-QRYSL6QU.js → chunk-H475WZPF.js} +14 -14
- package/dist/{chunk-Z5A4EY2R.js → chunk-H5NIW2KS.js} +1 -1
- package/dist/{chunk-2YSGXZOL.js → chunk-I3XM2PSQ.js} +57 -57
- package/dist/{chunk-DGZAQXTW.js → chunk-I4DLYOPO.js} +4 -4
- package/dist/{chunk-FACWYKL6.js → chunk-IPO4LHSB.js} +6 -6
- package/dist/{chunk-QHPVAXHR.js → chunk-JET2TKEQ.js} +3 -3
- package/dist/chunk-JPOYR5AO.js +7 -0
- package/dist/{chunk-I35NCNAF.js → chunk-LCSMBVMU.js} +1 -1
- package/dist/{chunk-PUF75SMJ.js → chunk-LE5LWALR.js} +1 -1
- package/dist/chunk-LNXBTK7Q.js +1 -0
- package/dist/{chunk-S6Y4I22Q.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-3NW5LD7D.js → chunk-N5KO2IHG.js} +4 -4
- package/dist/{chunk-6XBWM453.js → chunk-NJN5IKWO.js} +5 -5
- package/dist/{chunk-RUGQO7YF.js → chunk-NRALUW6P.js} +6 -6
- package/dist/chunk-NWC6YCIJ.js +11 -0
- package/dist/{chunk-UDKTAG57.js → chunk-NZ34BQKH.js} +1 -1
- package/dist/{chunk-X2N6UARO.js → chunk-O52BQ5DP.js} +1 -1
- package/dist/{chunk-XK42AQOJ.js → chunk-O7RR2ZZ2.js} +6 -6
- package/dist/chunk-OFCHJWM2.js +1 -0
- package/dist/chunk-OGU5JE52.js +20 -0
- package/dist/{chunk-EPY34L26.js → chunk-OKHKY3ZZ.js} +1 -1
- package/dist/{chunk-4WEFGKJL.js → chunk-OTITQ3IH.js} +11 -11
- package/dist/{chunk-VIQ6OME2.js → chunk-P7H2DXJB.js} +8 -8
- package/dist/{chunk-2H6YNMBE.js → chunk-PSR6SXCC.js} +10 -10
- package/dist/chunk-QGWKM7C3.js +9 -0
- package/dist/{chunk-YTGNGX3D.js → chunk-QO5E33DH.js} +4 -4
- package/dist/{chunk-WYFMSL4Q.js → chunk-QWCEKHAP.js} +9 -9
- package/dist/{chunk-O6JJIR4H.js → chunk-RDKIYORS.js} +1 -1
- package/dist/{chunk-ZWMODDVE.js → chunk-RV2FGSGH.js} +3 -3
- package/dist/{chunk-3PR5YMWZ.js → chunk-RZQGPWSN.js} +1 -1
- package/dist/{chunk-3ELLBQPS.js → chunk-S4FPYCUU.js} +3 -3
- package/dist/{chunk-DHIQ46C5.js → chunk-TDAI4J27.js} +4 -4
- package/dist/{chunk-34URULVW.js → chunk-TE6R53YD.js} +1 -1
- package/dist/{chunk-7VBXIIEC.js → chunk-TFSLPAGB.js} +4 -4
- package/dist/chunk-TNJ2VCH4.js +8 -0
- package/dist/{chunk-OORL6BIG.js → chunk-U44DVPGB.js} +1 -1
- package/dist/{chunk-N6CS2FO2.js → chunk-UNQ54QOF.js} +1 -1
- package/dist/chunk-UPXDDO3U.js +1 -0
- package/dist/{chunk-RVRDDTEG.js → chunk-USVL5SLG.js} +1 -1
- package/dist/chunk-USWA6YNZ.js +3 -0
- package/dist/chunk-VCCGS6Q2.js +29 -0
- package/dist/{chunk-6JSXIEH2.js → chunk-VX4COEWP.js} +3 -3
- package/dist/{chunk-MNNZGO2E.js → chunk-VX6TKEEK.js} +1 -1
- package/dist/{chunk-A42MKJA3.js → chunk-WDQEUNGE.js} +1 -1
- package/dist/{chunk-MVZRZTQP.js → chunk-WGLHB6WE.js} +1 -1
- package/dist/{chunk-GEP4FROW.js → chunk-WL4U4MTQ.js} +3 -3
- package/dist/{chunk-AYDW63LV.js → chunk-XBHXGBJR.js} +1 -1
- package/dist/{chunk-4HBSQGRI.js → chunk-XCAUDTCC.js} +8 -8
- package/dist/{chunk-SLU45G5J.js → chunk-XFH64VIG.js} +11 -11
- package/dist/{chunk-GMOEYB4X.js → chunk-XJPKDTQN.js} +11 -11
- package/dist/chunk-XXL5RLNM.js +22 -0
- package/dist/{chunk-VDUXPMOQ.js → chunk-YOZGW2RB.js} +2 -2
- package/dist/{chunk-ZQKA2XKH.js → chunk-YQOVUH5W.js} +8 -8
- package/dist/{chunk-JYIH2EBG.js → chunk-Z3SLQKE6.js} +1 -1
- package/dist/{chunk-5QGBVTGS.js → chunk-Z44JWU75.js} +2 -2
- package/dist/{chunk-FS6EOU4G.js → chunk-Z46MSUTP.js} +1 -1
- package/dist/{chunk-GISDIVFK.js → chunk-ZRLWE3JM.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/format/index.d.ts +2 -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 +25 -0
- package/dist/hooks/useRootIsDark.js +2 -0
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/payment.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +145 -145
- package/dist/map/index.js +20 -20
- 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 +2 -0
- package/dist/ui/index.js +1 -1
- package/dist/utils/glass.js +1 -1
- package/dist/utils/rootTheme.d.ts +51 -0
- package/dist/utils/rootTheme.js +1 -0
- package/dist/version.js +1 -1
- package/package.json +6 -1
- package/dist/Calculator-6NJNSIRN.js +0 -29
- package/dist/Notepad-YGYSYF3R.js +0 -24
- package/dist/Sidebar-2HHICMZZ.js +0 -44
- package/dist/Stock-IABQRSXZ.js +0 -16
- package/dist/chunk-22RQC4EW.js +0 -20
- package/dist/chunk-5HO53ZE7.js +0 -29
- package/dist/chunk-5TQLUPZD.js +0 -6
- package/dist/chunk-67MQ5S32.js +0 -8
- package/dist/chunk-BTFBXZS2.js +0 -1
- package/dist/chunk-DESWIPOZ.js +0 -3
- package/dist/chunk-F27JJHNJ.js +0 -1
- package/dist/chunk-FTF6JKD5.js +0 -9
- package/dist/chunk-GO2ZUVQD.js +0 -11
- package/dist/chunk-LAO5ZHQ6.js +0 -14
- package/dist/chunk-M5A7723Z.js +0 -22
- package/dist/chunk-MJGK6QTO.js +0 -7
- package/dist/chunk-PN5FQVMB.js +0 -7
- package/dist/chunk-RNPCHEXO.js +0 -8
- package/dist/chunk-TD76YFXE.js +0 -1
- package/dist/chunk-TLMFVEMC.js +0 -9
- package/dist/chunk-XYBI57KO.js +0 -12
- package/dist/chunk-XZJK5DFD.js +0 -2
- /package/dist/{chunk-NOKZ54GD.js → chunk-CSA6CGXS.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&&!!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 ${
|
|
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:_},"rosh-after-pinned")),/* @__PURE__ */p("div",{className:
|
|
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:
|
|
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
3
|
/* @__PURE__ */M(e,{mode:"range",min:E,max:R,value:V||null,endValue:ee||null,month:Ce,onMonthChange:Me,onSelect:e=>{ne("Custom"),A?"from"===ae?(ee&&e>ee?(_(ee),te(e)):_(e),oe("to")):V&&e<V?(te(V),_(e)):te(e):!V||V&&ee?(_(e),te("")):e<V?(te(V),_(e)):te(e)},weekStartsOn:G,"aria-label":I.dialog});/* @__PURE__ */
|
|
4
4
|
return k("div",{className:"relative"+(U?" w-full":""),ref:ie,children:[
|
|
5
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:
|
|
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&&!q&&(t||n)&&/* @__PURE__ */M("button",{type:"button",onClick:
|
|
9
|
-
/* @__PURE__ */M("input",{type:"hidden",name:
|
|
10
|
-
/* @__PURE__ */M("input",{type:"hidden",name:
|
|
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"}${
|
|
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"}${
|
|
17
|
-
/* @__PURE__ */k("div",{ref:ge,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[
|
|
18
|
-
/* @__PURE__ */M("div",{className:"w-full",children:
|
|
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
|
+
/* @__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: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:A?!V&&!ee:!V||!ee,className:c({variant:"primary"}),children:I.apply})]})]}),document.body)]})}export{H as DateRangePicker,
|
|
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__ */
|