efficient-shell 10.15.0 → 10.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/{Browser-WR4GMYE7.js → Browser-RI5X7GMK.js} +14 -14
- package/dist/Calculator-Y566OMJZ.js +29 -0
- package/dist/{CurrencyConverter-HEAAQX23.js → CurrencyConverter-2GUEE7ZR.js} +6 -6
- package/dist/{Documents-NSPKXCTF.js → Documents-GI346UL5.js} +12 -12
- package/dist/{Files-5HAUE2PR.js → Files-UA23KXN7.js} +54 -54
- package/dist/{Notepad-5LSFAYXO.js → Notepad-HRZKLHO3.js} +9 -9
- package/dist/{PomodoroTimer-5V32QOCZ.js → PomodoroTimer-QYCTTTPZ.js} +68 -68
- package/dist/{Preview-PDVZZRSK.js → Preview-LSGN5GN7.js} +29 -29
- package/dist/Sidebar-2P26444H.js +44 -0
- package/dist/{Spreadsheet-K4IAI3A2.js → Spreadsheet-7JBZY6KJ.js} +9 -9
- package/dist/{Stock-AOCHAKUF.js → Stock-ZVQT25IE.js} +3 -3
- package/dist/{Weather-F2QHTG32.js → Weather-RAUDLLVU.js} +17 -17
- package/dist/{WorldClock-G72577HU.js → WorldClock-2XBWZ6SZ.js} +6 -6
- package/dist/ai/index.d.ts +76 -1
- package/dist/ai/index.js +70 -52
- package/dist/ai.css +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/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-4U57ANZF.js → chunk-2SY76NFO.js} +1 -1
- package/dist/{chunk-N2RHM432.js → chunk-2VGQS6CW.js} +1 -1
- package/dist/{chunk-SQCUN2DX.js → chunk-34URULVW.js} +1 -1
- package/dist/{chunk-5LCDCO46.js → chunk-3ELLBQPS.js} +1 -1
- package/dist/{chunk-NZCSLS4O.js → chunk-3LDXURVU.js} +3 -3
- package/dist/{chunk-NZQCDFDG.js → chunk-3NW5LD7D.js} +3 -3
- package/dist/{chunk-N3YBOXOF.js → chunk-4G2C6J4I.js} +1 -1
- package/dist/{chunk-FQIA5BTN.js → chunk-4QJOEHM6.js} +7 -7
- package/dist/{chunk-V2MIQ4GJ.js → chunk-4UKGVLFP.js} +2 -2
- package/dist/{chunk-FRVNDEV2.js → chunk-4WEFGKJL.js} +8 -8
- package/dist/{chunk-LVBO2OMQ.js → chunk-57HN6MPC.js} +2 -2
- package/dist/{chunk-2RAOWHHM.js → chunk-5UYZ75F3.js} +12 -12
- package/dist/{chunk-ZL5OSF26.js → chunk-6AS5PHHK.js} +18 -18
- package/dist/{chunk-Q3IR5SKD.js → chunk-6XBWM453.js} +1 -1
- package/dist/{chunk-CDA2VXBN.js → chunk-74OUAR6L.js} +6 -6
- package/dist/{chunk-ARCQYF7G.js → chunk-7HLC352T.js} +2 -2
- package/dist/{chunk-B25RVAVS.js → chunk-7HTRLRVO.js} +64 -64
- package/dist/{chunk-G4JTO5PB.js → chunk-7JGR7WPD.js} +1 -1
- package/dist/{chunk-RFEET2LS.js → chunk-7NBSBGLX.js} +1 -1
- package/dist/{chunk-S52GQQVB.js → chunk-7TNAOZZ2.js} +1 -1
- package/dist/{chunk-AJFR35CO.js → chunk-7UTPXU6K.js} +4 -4
- package/dist/{chunk-NBB2RKDH.js → chunk-7X5FABQS.js} +5 -5
- package/dist/chunk-7XYTJPWW.js +29 -0
- package/dist/{chunk-IC7BEFE3.js → chunk-7ZP64SC7.js} +1 -1
- package/dist/{chunk-YLGQ6ACR.js → chunk-AJO72CPB.js} +1 -1
- package/dist/{chunk-4XS32UWF.js → chunk-AOK3BHRT.js} +4 -4
- package/dist/{chunk-SSM3EN7G.js → chunk-B7UCXROE.js} +1 -1
- package/dist/chunk-BNJWZAQE.js +12 -0
- package/dist/{chunk-HL3DJTIC.js → chunk-CBEKJTXU.js} +7 -7
- package/dist/{chunk-NWURIQI3.js → chunk-CKKUFDZ3.js} +3 -3
- package/dist/chunk-COJYPNKF.js +2 -0
- package/dist/{chunk-ZLSUQAD3.js → chunk-CPZ42W2B.js} +1 -1
- package/dist/{chunk-ZL7O4KGQ.js → chunk-CQV3VSI2.js} +1 -1
- package/dist/{chunk-5LXT3IUL.js → chunk-D4I3U7UE.js} +1 -1
- package/dist/{chunk-7PSIPTOE.js → chunk-D7F442OZ.js} +1 -1
- package/dist/chunk-DESWIPOZ.js +3 -0
- package/dist/{chunk-KJCTXWF7.js → chunk-DRDYZ633.js} +2 -2
- package/dist/{chunk-FJYTYW6M.js → chunk-DWR7MYQU.js} +5 -5
- package/dist/{chunk-EYEB3J77.js → chunk-E3753CWP.js} +5 -5
- package/dist/chunk-EU3JZGV2.js +14 -0
- package/dist/{chunk-55W5TTKS.js → chunk-FEQDZTZ7.js} +6 -6
- package/dist/{chunk-LWEWURFT.js → chunk-FWVC4A2O.js} +13 -13
- package/dist/{chunk-WZ5QSSUM.js → chunk-G4GVLK44.js} +6 -6
- package/dist/{chunk-5N5AAYQV.js → chunk-GISDIVFK.js} +1 -1
- package/dist/{chunk-N4REWGMM.js → chunk-GPJO34QP.js} +8 -8
- package/dist/{chunk-FFZREKEF.js → chunk-H32EQG5Z.js} +9 -9
- package/dist/{chunk-PUBJ5YHQ.js → chunk-I2XGPTCN.js} +1 -1
- package/dist/chunk-I4VIEGCX.js +2 -0
- package/dist/{chunk-ZZTCYEQ4.js → chunk-IKNG7EFQ.js} +7 -7
- package/dist/{chunk-OSVY6SUO.js → chunk-ISJPW2FZ.js} +5 -5
- package/dist/{chunk-POQ4ETLL.js → chunk-JGTGQGHY.js} +1 -1
- package/dist/{chunk-RSS2ALHH.js → chunk-JJW43QPS.js} +5 -5
- package/dist/chunk-JSGQWVYH.js +7 -0
- package/dist/{chunk-HRPXJ4EI.js → chunk-K4ANB6AF.js} +1 -1
- package/dist/{chunk-CHAWFMV4.js → chunk-KTA77U3P.js} +4 -4
- package/dist/{chunk-OAT7OEWP.js → chunk-KTVXPGGB.js} +8 -8
- package/dist/{chunk-CFAELIKH.js → chunk-L4IW77TD.js} +6 -6
- package/dist/{chunk-ZHPHNQKM.js → chunk-LCJRTJXT.js} +7 -7
- package/dist/{chunk-FUVVO6YP.js → chunk-LDE5IV2M.js} +1 -1
- package/dist/{chunk-TXNCDDB4.js → chunk-LO5T2K4B.js} +3 -3
- package/dist/chunk-LU6NA4RU.js +5 -0
- package/dist/{chunk-ZI6SMZJ4.js → chunk-MHB52H2Y.js} +11 -11
- package/dist/{chunk-FGJOGBGZ.js → chunk-MNSKGMVZ.js} +8 -8
- package/dist/{chunk-AJFWBEIG.js → chunk-MTEFYFUO.js} +9 -9
- package/dist/{chunk-S5SRXI4V.js → chunk-MVZRZTQP.js} +1 -1
- package/dist/{chunk-MMQ6ETRD.js → chunk-N67QX3WW.js} +2 -2
- package/dist/{chunk-M5LR7ZZX.js → chunk-O6JJIR4H.js} +1 -1
- package/dist/{chunk-G7QK7WAK.js → chunk-PCFBDXLN.js} +1 -1
- package/dist/chunk-PJQGYKN6.js +11 -0
- package/dist/chunk-PN5FQVMB.js +7 -0
- package/dist/chunk-PN65IIYN.js +8 -0
- package/dist/chunk-PUF75SMJ.js +1 -0
- package/dist/{chunk-AJVUND5A.js → chunk-PVZGSCCB.js} +6 -6
- package/dist/{chunk-B37JVKW5.js → chunk-PYAJCN2Q.js} +1 -1
- package/dist/chunk-Q6YNMNUH.js +6 -0
- package/dist/{chunk-YFMZKTJC.js → chunk-QDQ347RL.js} +1 -1
- package/dist/{chunk-4VTJEKHX.js → chunk-QHOBK35Y.js} +1 -1
- package/dist/{chunk-66XPG5G3.js → chunk-QYSEYYV7.js} +1 -1
- package/dist/chunk-RCPFUDPS.js +4 -0
- package/dist/{chunk-25M7CYCR.js → chunk-RLJHRDDW.js} +8 -8
- package/dist/{chunk-6BB6A5OB.js → chunk-RPYFOQM2.js} +5 -5
- package/dist/chunk-RRUHQLUY.js +14 -0
- package/dist/{chunk-ESYYKGN4.js → chunk-S6FBMSFU.js} +2 -2
- package/dist/{chunk-5FRFSPQ2.js → chunk-SDQIXE5M.js} +8 -8
- package/dist/{chunk-PB3OC4BO.js → chunk-SG4LO2AN.js} +8 -8
- package/dist/{chunk-U2WCV56F.js → chunk-SHKBDFSE.js} +1 -1
- package/dist/{chunk-ZMRGHVKS.js → chunk-TKJBZIHT.js} +1 -1
- package/dist/{chunk-EHGGSUXA.js → chunk-TM33D3CE.js} +1 -1
- package/dist/chunk-TMNAHOJ7.js +9 -0
- package/dist/{chunk-GKIU55T5.js → chunk-TVH7IZQ4.js} +2 -2
- package/dist/{chunk-EQZZ4V5X.js → chunk-TXDA7TTP.js} +1 -1
- package/dist/{chunk-SOGQZVPJ.js → chunk-UBMY23AG.js} +5 -5
- package/dist/{chunk-KKOADH55.js → chunk-UDRMZ22J.js} +1 -1
- package/dist/{chunk-36R3R3IB.js → chunk-ULXCDM7Y.js} +4 -4
- package/dist/{chunk-MCYFUIXH.js → chunk-UWIZX3RK.js} +1 -1
- package/dist/{chunk-SP2AUVIU.js → chunk-UYRITNQW.js} +3 -3
- package/dist/{chunk-OET2Q7P6.js → chunk-VNACNNCJ.js} +3 -3
- package/dist/{chunk-UWIFXNH6.js → chunk-VTFZ6W2D.js} +3 -3
- package/dist/chunk-W35N7SL3.js +8 -0
- package/dist/{chunk-UPCLAEKC.js → chunk-W3OWPBQL.js} +2 -2
- package/dist/chunk-W4OBVKN4.js +1 -0
- package/dist/chunk-W6URVLQF.js +20 -0
- package/dist/{chunk-EK5WJQTR.js → chunk-WB4P4QE2.js} +1 -1
- package/dist/{chunk-XPPLCLYK.js → chunk-WINNA7LS.js} +1 -1
- package/dist/chunk-WMEYNKXZ.js +22 -0
- package/dist/{chunk-A267MPGS.js → chunk-X6BFVDB4.js} +2 -2
- package/dist/{chunk-5JU53T3U.js → chunk-XZGGJHJC.js} +8 -8
- package/dist/chunk-Y3R267FV.js +15 -0
- package/dist/{chunk-XJUREXYW.js → chunk-YOSUCCHG.js} +3 -3
- package/dist/chunk-ZZVE64OI.js +2 -0
- package/dist/data/DataTable.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListLoadError.js +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/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/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/useTheme.d.ts +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +247 -247
- package/dist/map/index.js +7 -7
- 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/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/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/MilestoneTimeline.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/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/TimelineTrack.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/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.d.ts +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-MV5JVQBS.js +0 -29
- package/dist/Sidebar-E3VDFBF6.js +0 -44
- package/dist/chunk-3GHTOSJP.js +0 -14
- package/dist/chunk-4AQ67NP2.js +0 -15
- package/dist/chunk-6WSH6D5N.js +0 -29
- package/dist/chunk-7LQGPMRP.js +0 -3
- package/dist/chunk-CNLYFW47.js +0 -9
- package/dist/chunk-EFU4Z66K.js +0 -8
- package/dist/chunk-FX6DBXXD.js +0 -1
- package/dist/chunk-HXNMRJQ4.js +0 -2
- package/dist/chunk-IFA2EOAF.js +0 -4
- package/dist/chunk-KMEERBZV.js +0 -2
- package/dist/chunk-KORKSPHQ.js +0 -6
- package/dist/chunk-LWWMRL2Y.js +0 -5
- package/dist/chunk-NLGMJGD6.js +0 -14
- package/dist/chunk-SCYL5V5X.js +0 -20
- package/dist/chunk-SM7IDX7Y.js +0 -1
- package/dist/chunk-TIPU74XW.js +0 -22
- package/dist/chunk-UUKTYAWY.js +0 -7
- package/dist/chunk-V6F42DX3.js +0 -11
- package/dist/chunk-VWEG2WM4.js +0 -12
- package/dist/chunk-XIB72X74.js +0 -2
- package/dist/chunk-ZE5TNYWX.js +0 -7
- package/dist/chunk-ZO244TWH.js +0 -8
- /package/dist/{chunk-ID6WFAXW.js → chunk-N3TOHWFF.js} +0 -0
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import{useCopyText as e,CopyGlyph as t}from"./chunk-F2R3UFNQ.js";import{ItemCount as n}from"./chunk-
|
|
1
|
+
import{useCopyText as e,CopyGlyph as t}from"./chunk-F2R3UFNQ.js";import{ItemCount as n}from"./chunk-QHOBK35Y.js";import{PopupMenu as r,PopupMenuItem as i,PopupMenuDivider as l}from"./chunk-4WEFGKJL.js";import{Icon as o}from"./chunk-2UO47XB4.js";import{useShellStrings as a}from"./chunk-4PAWQEXM.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 z({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 I({tabs:e,activeKey:t,idFor:f,panelMounted:b,onActivate:I,onClose:j,onCloseMany:D,label:
|
|
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 z({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 I({tabs:e,activeKey:t,idFor:f,panelMounted:b,onActivate:I,onClose:j,onCloseMany:D,label:A,className:E,activeClassName:T,end:B,afterPinned:M,onIconMenu:_,menuItems:K,sizing:O="even",tall:R=!1,onReorder:F,groupInfo:L}){const S=a().pageTabs,W=a().count,[X,Q]=s(null),H=R?"h-[34px]":"h-8",P=d(()=>e.map(e=>({key:e.key,group:L?e.group:void 0})),[e,L]),U=d(()=>g(P),[P]),[Y,G]=s(()=>/* @__PURE__ */new Set),J=e=>G(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),V=d(()=>{const n=[];for(const r of U)for(let i=r.start;i<=r.end;i++)void 0!==r.group&&Y.has(r.group)&&e[i].key!==t||n.push(e[i]);return n},[U,Y,e,t]),q=c(null),[Z,ee]=s(null),te=(t,n)=>F?{draggable:!0,onDragStart:n=>{q.current=t,n.dataTransfer.effectAllowed="move",n.dataTransfer.setData("text/plain",e.find(e=>e.key===t.key)?.title??"")},onDragOver:e=>{const r=q.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(P,r,n,l)?k(P,r,n,l):null;o?(e.preventDefault(),e.dataTransfer.dropEffect="move",Z?.key===o.key&&Z.side===o.side||ee({key:o.key,side:o.side})):Z&&ee(null)},onDrop:e=>{const t=q.current;if(!t||!Z)return;e.preventDefault();const n=x(P,t,Z.key,Z.side);q.current=null,ee(null),n&&F(n)},onDragEnd:()=>{q.current=null,ee(null)}}:{},ne=d(()=>new Set(U.filter(e=>void 0!==e.group&&L).map(t=>e[t.start].key)),[U,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=>Z?.key===e&&!("before"===Z.side&&ne.has(e))&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:re(Z.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=M?V.findIndex(e=>!e.pinned):-1,ae=V.some(e=>e.key===t)?t:V[0]?.key,se=e=>{const t=V[(e+V.length)%V.length];t&&document.getElementById(f(t.key,"tab"))?.focus()},de=(e,t)=>{const n=V[e+t];if(!F||!n)return;const r=x(P,{kind:"tab",key:V[e].key},n.key,t<0?"before":"after");r&&(F(r),setTimeout(()=>document.getElementById(f(V[e].key,"tab"))?.focus(),0))},ce=X?e.find(e=>e.key===X.key):void 0,ue=ce&&K?K(ce.key):[],me=ce?e.indexOf(ce):-1,fe=e=>e.some(e=>!e.pinned),pe=e=>()=>{Q(null),e()},ye=(e,n)=>{const r=e.key===t,i=!!e.dirty,l=e.icon,a=r?T??"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:()=>I(e.key)},c={onContextMenu:t=>((e,t)=>{e.preventDefault(),Q({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
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&&!!_&&!!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 ${H} ${l?"w-10":""} ${a}`,...c,...te({kind:"tab",key:e.key},e.key),children:[ie(e.key),
|
|
6
|
-
/* @__PURE__ */p("button",{...d,className:`flex h-full items-center justify-center rounded-t-md ${l?"w-full":"px-3"} ${
|
|
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 ${H} ${"active-full"===
|
|
9
|
-
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":
|
|
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"} ${
|
|
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":
|
|
8
|
+
/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-md border border-b-0 text-sm transition-colors ${H} ${"active-full"===O&&r?"":"@container"} ${"active-full"===O?r?"flex-[0_0_15rem] min-w-0":w:r&&(e.copy||h)?"flex-[0_1_20rem]":v} ${r?"active-full"===O?"":"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":S.tabMenu,title:S.tabMenu,onClick:t=>{const n=t.currentTarget.getBoundingClientRect();_?.(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
|
+
/* @__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"===O&&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":S.favorite,title:S.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(z,{node:e.actions}),r&&e.copy&&/* @__PURE__ */y($,{text:e.copy,label:S.copy(e.copy),copiedLabel:S.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":S.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
|
|
14
|
+
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":S.closeTab?.(e.title)??`${S.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=!M;for(const t of U){const r=V.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:M},"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=!Y.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:S.groupToggle(l.label,a),onClick:()=>J(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:W.tabs(a),active:!0})]}),Z?.key===d&&"before"===Z.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:M},"rosh-after-pinned")),/* @__PURE__ */p("div",{className:E??"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":
|
|
22
|
+
/* @__PURE__ */y("div",{role:"tablist","aria-label":A,onKeyDown:e=>{const t=V.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(V.length-1);else{if("Delete"!==e.key||V[t].pinned)return;j(V[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}),X&&ce&&/* @__PURE__ */p(r,{portal:!0,style:{left:X.x,top:X.y},onClose:()=>Q(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:S.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:S.closeOthers}),
|
|
27
|
+
/* @__PURE__ */y(i,{disabled:!fe(e.slice(me+1)),onClick:pe(()=>D("right",ce.key)),children:S.closeRight}),
|
|
28
|
+
/* @__PURE__ */y(i,{disabled:!fe(e),onClick:pe(()=>D("all",null)),children:S.closeAll})]})]})}export{I as TabStrip};
|
|
@@ -1,4 +1,4 @@
|
|
|
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{
|
|
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-F27JJHNJ.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:J=!0,open:T}){const[M,U]=p(!1),z=(T??M)&&!(null==m||!1===m||""===m),[C,D]=p(null),E=f(void 0),L=f(null),P=f(null),$=x(),F=f(!1),G=()=>{window.clearTimeout(E.current),F.current||(E.current=window.setTimeout(()=>U(!0),H))},R=()=>{window.clearTimeout(E.current),U(!1)},I=()=>{F.current=!0,R()},Q=()=>{F.current=!1,R()};w(()=>()=>window.clearTimeout(E.current),[]),c(()=>{if(!z)return void D(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}};D(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 S=z&&J?$:void 0,V=g(N)?b(N,{"aria-describedby":[N.props["aria-describedby"],S].filter(Boolean).join(" ")||void 0}):N,q=z?s():void 0;/* @__PURE__ */
|
|
2
2
|
return y("span",{ref:L,className:B,"aria-describedby":g(N)?void 0:S,onMouseEnter:G,onMouseLeave:Q,onFocus:t=>{let e=!0;try{e=t.target.matches(":focus-visible")}catch{}e&&G()},onBlur:Q,onPointerDown:I,onClick:I,children:[
|
|
3
3
|
/* @__PURE__ */k(j.Provider,{value:!0,children:V}),z&&v(
|
|
4
4
|
/* @__PURE__ */y("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:e.hint,...C?.anchor},children:[
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{optionMatches as e,OptionSublabel as t}from"./chunk-LJN77RG6.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-
|
|
2
|
-
return g("div",{ref:
|
|
3
|
-
/* @__PURE__ */g("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),
|
|
4
|
-
/* @__PURE__ */x("span",{className:"truncate",children:
|
|
5
|
-
/* @__PURE__ */x("input",{id:D,ref:
|
|
6
|
-
/* @__PURE__ */x("div",{ref:
|
|
1
|
+
import{optionMatches as e,OptionSublabel as t}from"./chunk-LJN77RG6.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-TXDA7TTP.js";import{Tooltip as r}from"./chunk-6XBWM453.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as s,POPUP_MAX_WIDTH as a,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-F27JJHNJ.js";import{useShellStrings as d}from"./chunk-4PAWQEXM.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as v}from"react-dom";import{jsxs as g,jsx as x,Fragment as b}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-accent-tint px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${o.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:o,onChange:y,options:k=[],placeholder:N,allowFreeText:j=!1,invalid:C,disabled:L,id:D,className:W="",tone:E,tooltip:J,split:M}){const[T,$]=m(!1),[B,A]=m(""),F=d(),G=h(null),H=h(null),P=h(null),S=s(G,T),X=e=>k.find(t=>t.value===e)?.label??e,Y=p(()=>{const t=new Set(o),n=[],r=B.trim().toLowerCase();for(const o of k)t.has(o.value)||(t.add(o.value),r&&!e(o,r)||n.push(o));return n},[k,o,B]),I=e=>{const t=[...o];for(const n of e){const e=n.trim();if(!e)continue;const o=e.toLowerCase(),r=k.find(t=>t.value===e||t.label.toLowerCase()===o)?.value,l=r??(j?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==o.length&&y(t)},z=e=>{e&&!o.includes(e)?(y([...o,e]),A("")):A("")},K=e=>y(o.filter(t=>t!==e)),Q=()=>{const e=B.trim();if(M&&e)return I(e.split(M)),void A("");j&&e?z(e):A("")},R=h(()=>{});R.current=()=>{Q(),$(!1)},f(()=>{if(!T)return;const e=e=>{const t=e.target;G.current?.contains(t)||P.current?.contains(t)||(Q(),$(!1))};document.addEventListener("mousedown",e);const t=l(()=>R.current());return()=>{document.removeEventListener("mousedown",e),t()}});const U=k.length>0;/* @__PURE__ */
|
|
2
|
+
return g("div",{ref:G,className:"relative",children:[
|
|
3
|
+
/* @__PURE__ */g("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),H.current?.focus())},className:n({invalid:C,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${L?"bg-gray-50 cursor-not-allowed":""} ${W}`}),children:[o.map(e=>{const t=E?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
+
/* @__PURE__ */x("span",{className:"truncate",children:X(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":F.select.removeItem?.(X(e))??`${F.select.remove} ${X(e)}`,onClick:()=>K(e),className:n.remove,children:"×"})]},e),l=J?.(e);return null==l?o:/* @__PURE__ */x(r,{content:l,className:"relative inline-flex max-w-full",children:o},e)}),
|
|
5
|
+
/* @__PURE__ */x("input",{id:D,ref:H,type:"text",autoComplete:"off",role:"combobox","aria-expanded":T&&U,"aria-invalid":C||void 0,disabled:L,value:B,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if(M){const t=e.split(M);if(t.length>1)return I(t.slice(0,-1)),void A(t[t.length-1])}A(e)})(e.target.value),$(!0)},onFocus:()=>{!L&&U&&$(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=B.trim(),o=n?Y.filter(t=>e(t,n.toLowerCase())):[];1===o.length?z(o[0].value):Q()}else"Backspace"===t.key&&""===B&&o.length>0?K(o[o.length-1]):"Escape"===t.key?($(!1),A(""),H.current?.blur()):"Tab"===t.key&&(Q(),$(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-ink-strong placeholder:text-[color:var(--ink-placeholder)] rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),T&&U&&v(
|
|
6
|
+
/* @__PURE__ */x("div",{ref:P,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:S?.left,right:S?.right,top:S?.top,bottom:S?.bottom,minWidth:S?.minWidth,maxWidth:S?.maxWidth??a,width:"max-content",visibility:S?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:S?.maxHeight??c},children:0===Y.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?F.select.allSelected:F.select.noMatches}):Y.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),z(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-row-hover text-ink whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-row-hover text-ink whitespace-nowrap",children:e.sublabel?/* @__PURE__ */g(b,{children:[
|
|
7
7
|
/* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
|
|
8
8
|
/* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-7MSC3Z5H.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{
|
|
1
|
+
import{Calendar as e}from"./chunk-7MSC3Z5H.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-F27JJHNJ.js";import{useShellStrings as g,useShellLocale as b}from"./chunk-4PAWQEXM.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"],j=t;function D(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 F(e){const t=r(e);return t?`${s(t.getDate())}/${s(t.getMonth()+1)}/${t.getFullYear()}`:e}var Y=/* @__PURE__ */new Map;function S({from:t,to:n,onChange:s,formatDisplay:j,clearable:S,required:O=!1,name:H,id:J,"aria-labelledby":L,"aria-label":B,weekStartsOn:E,placeholder:T,fullWidth:U=!1,min:A,max:G,disabled:R=!1,allowOpenEnd:q=!1}){const I=g().dateRange,P=b(),X=j??(P?function(e){let t=Y.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Y.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):F),Z=T??I.placeholder,Q=S??!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=!!J&&(le.current?.labels?.length??0)>0;e!==ye&&we(e)});const Ne=!!B||!!L||ye,ke=/* @__PURE__ */new Date,[Ce,Me]=x(()=>t?t.slice(0,7):$(ke,A,G)),We=W.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(D(e,ke),A,G)),je=e=>e?X(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(()=>{R&&K(!1)},[R]);const De=()=>{s("",""),K(!1)},$e=t&&n?`${je(t)} — ${je(n)}`:t?I.fromOnly(je(t)):n?I.toOnly(je(n)):"",Fe=l(P),Ye=e=>{const t=r(e);return t?Fe.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Se=t&&n?I.range(Ye(t),Ye(n)):t?I.fromOnly(Ye(t)):n?I.toOnly(Ye(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"),He=/* @__PURE__ */k(C,{children:[We.map(e=>/* @__PURE__ */M("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=D(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
2
|
/* @__PURE__ */M("button",{type:"button",onClick:()=>ne("Custom"),className:Oe("Custom"),children:I.custom})]}),Je=(e,t)=>q?/* @__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=>q&&ae===e?" ring-1 ring-blue-400":"",Be=
|
|
3
3
|
/* @__PURE__ */M(e,{mode:"range",min:A,max:G,value:V||null,endValue:ee||null,month:Ce,onMonthChange:Me,onSelect:e=>{ne("Custom"),q?"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:E,"aria-label":I.dialog});/* @__PURE__ */
|
|
4
4
|
return k("div",{className:"relative"+(U?" w-full":""),ref:ie,children:[
|
|
@@ -8,7 +8,7 @@ return k("div",{className:"relative"+(U?" w-full":""),ref:ie,children:[
|
|
|
8
8
|
/* @__PURE__ */M("span",{className:"truncate",children:$e||Z})]}),Q&&!R&&(t||n)&&/* @__PURE__ */M("button",{type:"button",onClick:De,"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:Se}),O&&/* @__PURE__ */M("span",{id:me,className:"sr-only",children:I.required}),H&&/* @__PURE__ */k(C,{children:[
|
|
9
9
|
/* @__PURE__ */M("input",{type:"hidden",name:H.from,value:t,disabled:R||void 0}),
|
|
10
10
|
/* @__PURE__ */M("input",{type:"hidden",name:H.to,value:n,disabled:R||void 0})]}),z&&N(
|
|
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",...
|
|
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
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:[Je("from",/* @__PURE__ */k(C,{children:[
|
|
13
13
|
/* @__PURE__ */M("span",{className:"text-xs font-medium text-gray-500",children:I.from}),
|
|
14
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?je(V):I.start})]})),!ue&&/* @__PURE__ */M("span",{className:"text-gray-300",children:"—"}),Je("to",/* @__PURE__ */k(C,{children:[
|