efficient-shell 4.164.0 → 4.166.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 +146 -4
- package/dist/{Browser-AZSXQEJ2.js → Browser-2MBG34IR.js} +13 -13
- package/dist/Calculator-R3WJTNZ6.js +29 -0
- package/dist/ConfirmDialog-ZDVMT74Y.js +1 -0
- package/dist/{CurrencyConverter-VT2SZDA3.js → CurrencyConverter-PEXSQQUK.js} +7 -7
- package/dist/{Documents-WIYSUFCQ.js → Documents-YL4RIOZO.js} +10 -10
- package/dist/{Files-FAO4MFCO.js → Files-3ZRUTRSB.js} +30 -30
- package/dist/Notepad-3ZM2FR6C.js +25 -0
- package/dist/PdfViewer-S2B2DZYB.js +1 -0
- package/dist/{PomodoroTimer-4JBDIQZK.js → PomodoroTimer-5QHA5UOY.js} +40 -40
- package/dist/{Preview-FBVFDTPN.js → Preview-32F4DTCK.js} +23 -23
- package/dist/Sidebar-QQSRLMJG.js +44 -0
- package/dist/Spreadsheet-GOZI7I4L.js +37 -0
- package/dist/{Stock-NIM7MAYG.js → Stock-XJFITZZA.js} +4 -4
- package/dist/{Weather-RLISJWFA.js → Weather-BDC633GV.js} +18 -18
- package/dist/{WorldClock-G4L5OLOT.js → WorldClock-ROOVRRCJ.js} +6 -6
- package/dist/apps/index.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-6ZUAHFK3.js → chunk-3U47BTEV.js} +14 -14
- package/dist/{chunk-6NG4TM3E.js → chunk-4P3IWZUC.js} +14 -14
- package/dist/{chunk-Z43BI2JI.js → chunk-5J2TKKGH.js} +1 -1
- package/dist/{chunk-XY25UBVS.js → chunk-7TQ7NMT3.js} +1 -1
- package/dist/{chunk-YLJ7AZON.js → chunk-7YFAFXQG.js} +8 -8
- package/dist/chunk-AFYQTVZO.js +1 -0
- package/dist/chunk-BKDE67DB.js +12 -0
- package/dist/{chunk-T7DDT2Z6.js → chunk-CRI4UFBU.js} +6 -6
- package/dist/{chunk-DGWWPVEQ.js → chunk-DTRXR6JQ.js} +11 -11
- package/dist/{chunk-J5E4VMLJ.js → chunk-FZRQBHTK.js} +1 -1
- package/dist/chunk-G5J6YSN5.js +5 -0
- package/dist/{chunk-I3CQI462.js → chunk-HA2WG27U.js} +2 -2
- package/dist/{chunk-RKOTKWWU.js → chunk-HGG5M5AB.js} +1 -1
- package/dist/chunk-HZZNJHRH.js +1 -0
- package/dist/chunk-JKVDTKBE.js +988 -0
- package/dist/{chunk-IY4CP2HO.js → chunk-KSSAVLO7.js} +1 -1
- package/dist/chunk-M4DB7UBZ.js +29 -0
- package/dist/{chunk-YS57MJFM.js → chunk-NCQLGQYR.js} +1 -1
- package/dist/{chunk-U7ZDZXOJ.js → chunk-QASZIYLG.js} +1 -1
- package/dist/{chunk-37QZZRDT.js → chunk-QZG72OVX.js} +1 -1
- package/dist/chunk-SOI4LR67.js +27 -0
- package/dist/chunk-UVZIPXIA.js +10 -0
- package/dist/chunk-VRHUY4P4.js +1 -0
- package/dist/{chunk-TJ4YXVQQ.js → chunk-VXBJNMAA.js} +94 -94
- package/dist/chunk-X4FJ54PP.js +1 -0
- package/dist/file-intake/index.js +1 -1
- package/dist/{index-CFLEu3eh.d.ts → index-DcLqfJX3.d.ts} +285 -16
- package/dist/index.d.ts +3 -13
- package/dist/index.js +114 -114
- package/dist/map/index.js +6 -6
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-GRNWTZIZ.js +0 -29
- package/dist/ConfirmDialog-LSFNIGKM.js +0 -1
- package/dist/Notepad-APW5DX37.js +0 -25
- package/dist/PdfViewer-3NWOBXPP.js +0 -1
- package/dist/Sidebar-KRN5ZV3F.js +0 -44
- package/dist/Spreadsheet-IQF6QAWU.js +0 -37
- package/dist/chunk-4UCRT4ST.js +0 -5
- package/dist/chunk-ELSUXC3N.js +0 -1
- package/dist/chunk-HQREOTKI.js +0 -9
- package/dist/chunk-L2W5XPZ3.js +0 -1
- package/dist/chunk-LZIS72CF.js +0 -9
- package/dist/chunk-MAIHBBWT.js +0 -1
- package/dist/chunk-MHGFTCEA.js +0 -971
- package/dist/chunk-NNUE7M5G.js +0 -29
- package/dist/chunk-SVJN7WWF.js +0 -27
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import{EditableGrid as e}from"./chunk-YLJ7AZON.js";import"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-RKOTKWWU.js";import{peekSpreadsheetPreviewStage as r,claimSpreadsheetPreviewStage as n,SPREADSHEET_PREVIEW_UPDATE_EVENT as o}from"./chunk-VTVSMRFX.js";import"./chunk-L2W5XPZ3.js";import{WindowTitle as a}from"./chunk-TJ4YXVQQ.js";import"./chunk-T7DDT2Z6.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-4UCRT4ST.js";import"./chunk-6KO2U66R.js";import"./chunk-NNUE7M5G.js";import"./chunk-HQREOTKI.js";import"./chunk-ELSUXC3N.js";import"./chunk-MAIHBBWT.js";import"./chunk-YS57MJFM.js";import"./chunk-D65T4H6J.js";import{useRef as l,useState as s,useEffect as c,useCallback as i}from"react";import{jsxs as u,jsx as d,Fragment as h}from"react/jsx-runtime";var m="ABCDEFGHIJKLMNOPQRSTUVWXYZ",p=10,x=30;function g(e){return e<26?m[e]:m[Math.floor(e/26)-1]+m[e%26]}function y(e){return Array.from({length:e},(e,t)=>({key:`col_${t}`,title:g(t),width:100}))}function b(e,t){return Array.from({length:e},()=>Array(t).fill(""))}function f(e){return{id:crypto.randomUUID(),name:e,columns:y(p),data:b(x,p),cellStyles:{}}}function v(e){return e.split("\n").map(e=>{if(e.includes("\t"))return e.split("\t").map(e=>e.trim());const t=[];let r="",n=!1;for(const o of e)'"'!==o?","!==o||n?r+=o:(t.push(r.trim()),r=""):n=!n;return t.push(r.trim()),t}).filter(e=>e.some(e=>e.trim()))}function w(e,t){const r=v(e);if(0===r.length)return null;const n=Math.max(p,r.reduce((e,t)=>Math.max(e,t.length),0)),o=r.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));return{id:crypto.randomUUID(),name:t,columns:y(n),data:o,cellStyles:{}}}function k(){const m=l(null),g=l(void 0);void 0===g.current&&(g.current=r());const k=l(g.current?.data??null),N=(()=>{const e=g.current;if(!e)return null;const t=w(e.data.csv,"Sheet 1");if(!t)return null;return{sheet:t,title:e.data.filename.replace(/\.(csv|tsv|txt)$/i,"")}})(),[C,S]=s(N?[N.sheet]:[f("Sheet 1")]),[j,M]=s(0),U=l([]),$=l(C),E=l(!1);c(()=>{E.current?E.current=!1:$.current!==C&&(U.current.push($.current),U.current.length>50&&U.current.shift()),$.current=C},[C]);const A=i(()=>{const e=U.current.pop();e&&(E.current=!0,S(e))},[]);c(()=>{const e=e=>{if(!m.current?.contains(document.activeElement)&&!m.current?.matches(":focus-within"))return;(e.ctrlKey||e.metaKey)&&!e.shiftKey&&("z"===e.key||"Z"===e.key)&&(e.preventDefault(),A())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[A]);const[D,L]=s(N?.title??"Untitled"),[R,T]=s(()=>g.current?.data.onEmail),K=i(e=>{const t=w(e.csv,"Sheet 1");t&&(S([t]),M(0),L(e.filename.replace(/\.(csv|tsv|txt)$/i,"")),T(()=>e.onEmail))},[]);c(()=>{const e=g.current;null!=e&&(n(e),e.data!==k.current&&K(e.data))},[]),c(()=>{const e=g.current?.token;if(null==e)return;const t=t=>{const r=t.detail;r&&r.token===e&&K(r.data)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)},[]);const[B,F]=s(!1),[I,O]=s(null),[X,W]=s(""),H=l(null),[J,Q]=s("1"),[V,Z]=s("10"),z=C[j]||C[0],Y=z.data,P=z.columns,_=z.cellStyles??{},[G,q]=s(null),[ee,te]=s(null),re=i(()=>{if(ee){const e=Math.min(ee.anchor.row,ee.end.row),t=Math.max(ee.anchor.row,ee.end.row),r=Math.min(ee.anchor.col,ee.end.col),n=Math.max(ee.anchor.col,ee.end.col),o=[];for(let a=e;a<=t;a++)for(let e=r;e<=n;e++)o.push({row:a,col:e});return o}return G?[G]:[]},[ee,G]),ne=i((e,t)=>{const r=re();0!==r.length&&S(n=>n.map((n,o)=>{if(o!==j)return n;const a={...n.cellStyles??{}},l=`${r[0].row}:${r[0].col}`,s=void 0!==t?t:!(a[l]??{})[e];for(const{row:t,col:n}of r){const r=`${t}:${n}`;a[r]={...a[r]??{},[e]:s}}return{...n,cellStyles:a}}))},[re,j]),oe=ee?{row:ee.anchor.row,col:ee.anchor.col}:G,ae=oe?_[`${oe.row}:${oe.col}`]??{}:{},le=!!oe,se=i(e=>{S(t=>t.map((t,r)=>r===j?{...t,...e}:t))},[j]),ce=i(e=>{const t=e.reduce((e,t)=>Math.max(e,t.length),0);t!==P.length?se({data:e,columns:y(t)}):se({data:e})},[se,P.length]),ie=(e,t)=>{S(r=>r.map((r,n)=>n===e?{...r,name:t}:r)),O(null)},ue=()=>Y.filter(e=>e.some(e=>e.trim())).map(e=>e.map(e=>e.includes(",")||e.includes('"')||e.includes("\n")?`"${e.replace(/"/g,'""')}"`:e).join(",")).join("\n"),de=[];Y.forEach(e=>e.forEach(e=>{const t=parseFloat(e);!isNaN(t)&&e.trim()&&de.push(t)}));const he=Y.reduce((e,t)=>e+t.filter(e=>e.trim()).length,0);/* @__PURE__ */
|
|
2
|
-
return u("div",{ref:m,className:"flex flex-col h-full",children:[
|
|
3
|
-
/* @__PURE__ */d(a,{title:`${me=D||"Untitled",me.length>24?`${me.slice(0,23)}…`:me} - Spreadsheets`}),
|
|
4
|
-
/* @__PURE__ */d(t,{app:"spreadsheet"}),
|
|
5
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[B?/* @__PURE__ */d("input",{type:"text",value:D,onChange:e=>L(e.target.value),onBlur:()=>F(!1),onKeyDown:e=>{"Enter"===e.key&&F(!1)},autoFocus:!0,className:"text-sm font-medium text-gray-900 border border-gray-300 rounded px-2 py-0.5 w-40 focus:border-blue-500 focus:ring-blue-500"}):/* @__PURE__ */d("button",{onClick:()=>F(!0),className:"text-sm font-medium text-gray-900 hover:text-blue-600 truncate max-w-[200px]",title:"Click to rename",children:D||"Untitled"}),
|
|
6
|
-
/* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
|
|
7
|
-
/* @__PURE__ */d("input",{ref:H,type:"file",accept:".csv,.tsv,.txt,.xlsx,.xls,.ods",onChange:async e=>{const t=e.target.files?.[0];if(!t)return;const r=t.name.replace(/\.(csv|tsv|txt|xlsx|xls|ods)$/i,"");if(/\.(xlsx|xls|ods)$/i.test(t.name)){const e=new Uint8Array(await t.arrayBuffer()),n=await(import("xlsx")),o=n.read(e,{type:"array"}),a=o.SheetNames.map(e=>{const t=n.utils.sheet_to_json(o.Sheets[e],{header:1,defval:""}),r=Math.max(p,t.reduce((e,t)=>Math.max(e,t.length),0)),a=t.map(e=>{const t=e.map(e=>String(e??""));for(;t.length<r;)t.push("");return t});for(;a.length<x;)a.push(Array(r).fill(""));return{id:crypto.randomUUID(),name:e,columns:y(r),data:a}});S(a),M(0),L(r)}else{const e=v(await t.text());if(0===e.length)return;const n=Math.max(p,e.reduce((e,t)=>Math.max(e,t.length),0)),o=e.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));se({columns:y(n),data:o}),L(r)}H.current&&(H.current.value="")},className:"hidden"}),
|
|
8
|
-
/* @__PURE__ */d("button",{onClick:()=>H.current?.click(),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Open"}),
|
|
9
|
-
/* @__PURE__ */d("button",{onClick:()=>{const e=new Blob([ue()],{type:"text/csv"}),t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download=`${D||"spreadsheet"}.csv`,r.click(),URL.revokeObjectURL(t)},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save CSV"}),R&&/* @__PURE__ */d("button",{onClick:()=>R(ue(),`${D||"spreadsheet"}.csv`),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Email"}),
|
|
10
|
-
/* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
|
|
11
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
|
|
12
|
-
/* @__PURE__ */d("input",{type:"number",min:"1",max:"50",value:J,onChange:e=>Q(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
|
|
13
|
-
/* @__PURE__ */d("button",{onClick:()=>(e=>{const t=P.length+e;se({columns:y(t),data:Y.map(t=>[...t,...Array(e).fill("")])})})(parseInt(J)||1),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Col"})]}),
|
|
14
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
|
|
15
|
-
/* @__PURE__ */d("input",{type:"number",min:"1",max:"500",value:V,onChange:e=>Z(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
|
|
16
|
-
/* @__PURE__ */d("button",{onClick:()=>{return e=parseInt(V)||10,void se({data:[...Y,...Array.from({length:e},()=>Array(P.length).fill(""))]});var e},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Row"})]}),
|
|
17
|
-
/* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
|
|
18
|
-
/* @__PURE__ */d("button",{onClick:()=>{se({columns:y(p),data:b(x,p)})},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Clear"}),
|
|
19
|
-
/* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
|
|
20
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-0.5",title:le?"":"Click a cell first",children:[
|
|
21
|
-
/* @__PURE__ */d("button",{onClick:()=>ne("bold"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors font-bold ${ae.bold?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"B"}),
|
|
22
|
-
/* @__PURE__ */d("button",{onClick:()=>ne("italic"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors italic ${ae.italic?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"I"}),
|
|
23
|
-
/* @__PURE__ */d("button",{onClick:()=>ne("underline"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors underline ${ae.underline?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"U"}),
|
|
24
|
-
/* @__PURE__ */u("select",{value:ae.fontSize??"base",onChange:e=>ne("fontSize",e.target.value),disabled:!le,className:"ml-1 text-xs border border-gray-300 rounded px-1 py-0.5 bg-white disabled:opacity-40 disabled:cursor-not-allowed",children:[
|
|
25
|
-
/* @__PURE__ */d("option",{value:"sm",children:"XS"}),
|
|
26
|
-
/* @__PURE__ */d("option",{value:"base",children:"S"}),
|
|
27
|
-
/* @__PURE__ */d("option",{value:"lg",children:"M"}),
|
|
28
|
-
/* @__PURE__ */d("option",{value:"xl",children:"L"})]})]})]}),
|
|
29
|
-
/* @__PURE__ */d("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */d(e,{columns:P,data:Y,onChange:ce,onColumnsChange:e=>se({columns:e}),cellStyles:_,onFocusChange:q,onSelectionChange:te,minRows:x,maxHeight:"100%"})}),
|
|
30
|
-
/* @__PURE__ */u("div",{className:"flex items-center border-t border-gray-200 bg-gray-50 shrink-0",children:[
|
|
31
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-0.5 px-1 py-1 overflow-x-auto flex-1 min-w-0",children:[C.map((e,t)=>/* @__PURE__ */d("button",{onClick:()=>M(t),onDoubleClick:()=>{O(t),W(e.name)},onContextMenu:e=>{e.preventDefault(),C.length>1&&(e=>{C.length<=1||(S(t=>t.filter((t,r)=>r!==e)),j>=e&&j>0&&M(j-1))})(t)},className:"px-3 py-1 text-xs font-medium rounded-b whitespace-nowrap transition-colors "+(t===j?"bg-white text-blue-700 border border-t-0 border-gray-300 -mt-px relative z-10":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:I===t?/* @__PURE__ */d("input",{type:"text",value:X,onChange:e=>W(e.target.value),onBlur:()=>ie(t,X||e.name),onKeyDown:r=>{"Enter"===r.key&&ie(t,X||e.name),"Escape"===r.key&&O(null)},onClick:e=>e.stopPropagation(),autoFocus:!0,className:"w-20 text-xs border border-blue-400 rounded px-1 py-0 focus:ring-0 focus:outline-none"}):e.name},e.id)),
|
|
32
|
-
/* @__PURE__ */d("button",{onClick:()=>{const e=`Sheet ${C.length+1}`;S(t=>[...t,f(e)]),M(C.length)},className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded",title:"Add sheet",children:"+"})]}),
|
|
33
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-4 px-3 py-1 text-xs text-gray-500 shrink-0 border-l border-gray-200",children:[
|
|
34
|
-
/* @__PURE__ */u("span",{children:[he," cells"]}),de.length>0&&/* @__PURE__ */u(h,{children:[
|
|
35
|
-
/* @__PURE__ */u("span",{children:["Sum: ",de.reduce((e,t)=>e+t,0).toLocaleString(void 0,{maximumFractionDigits:2})]}),
|
|
36
|
-
/* @__PURE__ */u("span",{children:["Avg: ",(de.reduce((e,t)=>e+t,0)/de.length).toLocaleString(void 0,{maximumFractionDigits:2})]})]}),
|
|
37
|
-
/* @__PURE__ */u("span",{children:[Y.length," × ",P.length]})]})]})]});var me}export{k as default};
|
package/dist/chunk-4UCRT4ST.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{forwardRef as e,useId as r}from"react";import{jsxs as o,jsx as t}from"react/jsx-runtime";var s="inline-flex items-center justify-center rounded-md font-medium transition-colors rosh-focus-ring focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-60",i={primary:"bg-blue-600 text-white shadow-sm hover:bg-blue-700 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",secondary:"border border-gray-300 bg-white text-gray-700 shadow-sm hover:bg-gray-50 focus-visible:ring-[color:var(--rosh-focus-ring)]",ghost:"text-gray-700 hover:bg-gray-100 focus-visible:ring-[color:var(--rosh-focus-ring)]","ghost-danger":"text-red-600 hover:bg-red-50 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]",danger:"bg-red-600 text-white shadow-sm hover:bg-red-700 focus-visible:ring-[color:var(--rosh-focus-ring-invalid-strong)]",link:"text-blue-600 underline-offset-4 hover:underline focus-visible:ring-[color:var(--rosh-focus-ring)]"},a={sm:"gap-1 px-2.5 py-1 text-xs",md:"gap-1.5 px-3 py-1.5 text-sm",lg:"gap-2 px-4 py-2.5 text-sm","touch-sm":"gap-1.5 h-11 px-4 text-base",touch:"gap-2 h-14 px-5 text-base","touch-lg":"gap-2 h-16 px-6 text-lg","touch-xl":"gap-3 h-20 px-8 text-2xl"},l={sm:"gap-1 text-xs",md:"gap-1.5 text-sm",lg:"gap-2 text-sm","touch-sm":"gap-1.5 text-base",touch:"gap-2 text-base","touch-lg":"gap-2 text-lg","touch-xl":"gap-3 text-2xl"},n={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10","touch-sm":"h-11 w-11",touch:"h-14 w-14","touch-lg":"h-16 w-16","touch-xl":"h-20 w-20"};function c({variant:e="primary",size:r="md",block:o=!1,className:t=""}={}){const n="link"===e;return[n?"inline-flex items-center font-medium transition-colors rosh-focus-ring focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-60":s,i[e],n?l[r]:a[r],o?"w-full":"",t].filter(Boolean).join(" ")}function g({variant:e="ghost",size:r="md",pressed:o=!1,className:t=""}={}){const a=!o||"ghost"!==e&&"secondary"!==e?i[e]:"bg-blue-50 text-blue-700 hover:bg-blue-100 focus-visible:ring-[color:var(--rosh-focus-ring)]";return[s,a,n[r],"shrink-0 p-0",t].filter(Boolean).join(" ")}function u(){/* @__PURE__ */
|
|
2
|
-
return o("svg",{className:"h-3.5 w-3.5 animate-spin",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[
|
|
3
|
-
/* @__PURE__ */t("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
|
|
4
|
-
/* @__PURE__ */t("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}var d=e(function({variant:e="primary",size:s="md",loading:i=!1,leftIcon:a,rightIcon:l,block:n=!1,disabled:g,type:d="button",children:h,className:x="",disabledReason:b,...m},p){const f=r(),v=g||i,y=v&&null!=b&&""!==b,w=y?f:void 0,N=/* @__PURE__ */o("button",{ref:p,type:d,disabled:v,"aria-busy":i||void 0,"aria-describedby":w,className:c({variant:e,size:s,block:n,className:x}),...m,children:[i?/* @__PURE__ */t(u,{}):a,h,!i&&l]});return y?/* @__PURE__ */o("span",{className:n?"flex w-full flex-col gap-1":"inline-flex flex-col items-start gap-1",children:[N,
|
|
5
|
-
/* @__PURE__ */t("span",{id:w,className:"text-xs text-red-600",children:b})]}):N});export{d as Button_default,c as buttonClasses,g as iconButtonClasses};
|
package/dist/chunk-ELSUXC3N.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useEffect as e,useLayoutEffect as n}from"react";var t=/* @__PURE__ */new Set,o=null;var r=/* @__PURE__ */new Map;function i(e,n){return t.add(e),n&&r.set(e,n),function(){if(o||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&d(e)&&(e.preventDefault(),e.stopPropagation())};document.addEventListener("keydown",e,!0),o=()=>document.removeEventListener("keydown",e,!0)}(),()=>{t.delete(e),r.delete(e),0===t.size&&o&&(o(),o=null)}}function d(e){const n=Array.from(t);for(let t=n.length-1;t>=0;t--)try{if(n[t](e))return!0}catch{}return!1}function u(e){if(!e)return!1;for(const[n,o]of r){if(!t.has(n))continue;let r;try{r=o()}catch{r=null}if(r&&r.isConnected&&!r.contains(e))return!0}return!1}var f="react-os-shell:overlay-open";function c(){"undefined"!=typeof window&&window.dispatchEvent(new Event(f))}function a(e){return"undefined"==typeof window?()=>{}:(window.addEventListener(f,e),()=>window.removeEventListener(f,e))}var w={window:50,windowStep:10,menu:400,pinnedWindow:999,overlay:9999,popup:1e4},p="undefined"==typeof document?e:n;function s(e){p(()=>{e&&c()},[e])}export{f as OVERLAY_OPEN_EVENT,w as Z_LAYERS,c as dismissPopups,u as escapeSurfaceAbove,a as onOverlayOpen,i as registerModalEscapeInterceptor,d as runEscapeInterceptors,s as useDismissPopupsOnOpen};
|
package/dist/chunk-HQREOTKI.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{onOverlayOpen as e,registerModalEscapeInterceptor as t,Z_LAYERS as n}from"./chunk-ELSUXC3N.js";import{rootIsDark as r}from"./chunk-MAIHBBWT.js";import{useHydrated as o,useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{createContext as a,forwardRef as s,useContext as l,useRef as u,useId as c,useState as d,useEffect as p,useMemo as m,useCallback as h}from"react";import{createPortal as f}from"react-dom";import{jsx as g,jsxs as y,Fragment as b}from"react/jsx-runtime";function x(){try{const e=getComputedStyle(document.documentElement).getPropertyValue("--menu-opacity")?.trim();if(e)return parseFloat(e)}catch{}return.95}var w=r;function v(){try{return document.documentElement.classList.contains("rosh-reduce-transparency")}catch{return!1}}function k(e,t){return`color-mix(in srgb, ${e} ${+(Math.round(255*Math.min(1,Math.max(0,t)))/255*100).toFixed(4)}%, transparent)`}function C(e,t={}){const n=e??x();if(v()&&"light"===t.ink)return{background:"var(--rosh-glass-light-ink-surface)",border:"1px solid var(--rosh-glass-light-ink-solid-border)",boxShadow:"var(--rosh-glass-solid-shadow)"};if(v())return{background:"var(--rosh-glass-surface)",border:"1px solid var(--rosh-glass-solid-border)",boxShadow:"var(--rosh-glass-solid-shadow)"};const r="var(--rosh-glass-surface)",o="var(--rosh-glass-surface-mid)";return w()?{background:`linear-gradient(135deg in srgb, ${k(r,.85*n)} 0%, ${k(o,.75*n)} 50%, ${k(r,.85*n)} 100%)`,backdropFilter:"blur(40px) saturate(1.6)",WebkitBackdropFilter:"blur(40px) saturate(1.6)",border:"1px solid var(--rosh-glass-border)",boxShadow:"var(--rosh-glass-shadow)"}:{background:`linear-gradient(135deg in srgb, ${k(r,.85*n)} 0%, ${k(o,.65*n)} 50%, ${k(r,.75*n)} 100%)`,backdropFilter:"blur(40px) saturate(1.8)",WebkitBackdropFilter:"blur(40px) saturate(1.8)",border:"1px solid var(--rosh-glass-border)",boxShadow:"var(--rosh-glass-shadow)"}}function $(e){return v()?"var(--rosh-glass-surface)":k("var(--rosh-glass-surface)",.85*(e??x()))}var N="border-white/20",L="glass-input-bg",M=/* @__PURE__ */new Set(["text","search","url","tel","email","password","number","date","datetime-local","month","week","time"]),E="data-native-context-menu";function T(e,t){return e&&"function"==typeof e.closest?e.closest(t):null}function B(e){const t=e;if(!t||"function"!=typeof t.closest)return!1;if(T(t,`[${E}]`))return!0;if(T(t,"textarea"))return!0;if(T(t,"img, picture, canvas, video, audio"))return!0;const n=T(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(M.has(e))return!0}const r=T(t,"[contenteditable]");if(r){const e=(r.getAttribute("contenteditable")||"").toLowerCase();if(""===e||"true"===e||"plaintext-only"===e)return!0}return!1}var W=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:","blob:"]);function S(e,t,n){const r=T(e,"a[href]"),o=(t||"").trim(),i=function(e,t){if(e&&"#"!==e)try{const n=new URL(e,t??("undefined"!=typeof document?document.baseURI:void 0));return W.has(n.protocol)?n.href:void 0}catch{return}}(r?.getAttribute("href"),n);return{kind:o?"selection":i?"link":"default",...o?{selectionText:o}:{},...i?{linkUrl:i}:{}}}function A(e){if(e.defaultPrevented)return!0;if(e.shiftKey)return!0;if("touch"===e.pointerType)return!0;return B(("function"==typeof e.composedPath?e.composedPath()[0]:void 0)??e.target)}function F(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function P(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function R(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function H(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function D(e,t,n,r,o,i=!1,a=8){const s=t+o,l=e-o-n,u=l>=a;return i&&u?{left:l,flipped:!0}:s+n<=r-a?{left:s,flipped:!1}:u?{left:l,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function I(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var j=a(null),z=a(!1);function U({children:r,style:i,className:a="",onClose:s,minWidth:l=180,portal:h=!1}){const y=u(null),b=c(),[x,w]=d([]),v=u();p(()=>()=>clearTimeout(v.current),[]);const k=o(),$=m(()=>{const e=()=>clearTimeout(v.current);return{id:b,depth:0,path:x,open:(t,n)=>{e(),w(e=>F(e,t,n))},scheduleClose:t=>{e(),v.current=setTimeout(()=>w(e=>P(e,t)),200)},closeBelow:t=>{e(),w(e=>P(e,t))},cancelClose:e,closeTree:()=>{e(),w([]),s?.()},root:y}},[b,x,s]);p(()=>{if(!s)return;const n=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${b}"]`)||y.current&&!y.current.contains(e.target)&&s()},r=e=>{"Escape"===e.key&&s()};window.addEventListener("pointerdown",n),window.addEventListener("keydown",r);const o=e(s),i=t(()=>!1,()=>y.current);return()=>{window.removeEventListener("pointerdown",n),window.removeEventListener("keydown",r),o(),i()}},[s,b]),p(()=>{const e=y.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const N=I(),L=/(^|[\s:])!?z-/.test(a),M=/* @__PURE__ */g("div",{ref:y,"data-popup-menu-tree":b,className:`fixed rounded-2xl ${"tight"===N?"py-1":"large"===N?"py-2":"py-1.5"} ${a}`,onContextMenu:e=>{B(e.target)||e.preventDefault()},style:{...L?{}:{zIndex:n.menu},minWidth:l,animation:"popup-in 0.12s ease-out",...C(),...i},children:/* @__PURE__ */g(j.Provider,{value:$,children:r})});return h?k?f(M,document.body):null:M}function q(e,t,n,r=!1){const o=I(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":"max(0.25rem, calc(var(--menu-padding-y, 0.5rem) - 0.1rem))";return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 hover:bg-red-50":r?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-blue-50 hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:i,paddingBottom:i}}}var K=s(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,tabIndex:a,id:s,onMouseEnter:u},c){const d=l(j),p=l(z),m=q(r,o,n);/* @__PURE__ */
|
|
2
|
-
return g("button",{ref:c,id:s,role:i??(p?"menuitem":void 0),tabIndex:a,onClick:()=>{e?.(),d&&d.depth>0&&d.closeTree()},onMouseEnter:()=>{d?.scheduleClose(d.depth),u?.()},disabled:o,className:m.className,style:m.style,children:t})}),V=/* @__PURE__ */g("svg",{"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})});function J(e){let t=n.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function O(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function X({label:e,icon:n,children:r,disabled:o,className:a="",minWidth:s=180,maxHeight:d}){const x=l(j),w=c(),v=u(null),k=u(null),$=u(),N=u(!1),L=`${w}-menu`;p(()=>()=>clearTimeout($.current),[]);const M=x?.depth??0,E=x?.path[M],T=!!E&&E.key===w&&!o,W=h(e=>{if(!x||o||!v.current)return;clearTimeout($.current),N.current=e;const t=v.current.getBoundingClientRect(),n=v.current.closest("[data-popup-submenu-panel]")??v.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,i=M>0&&(x.path[M-1]?.flipped??!1),a=D(r.left,r.right,s,window.innerWidth,4,i);x.open(M,{key:w,y:t.top,...a})},[x,o,M,w,s]),S=e=>{x?.closeBelow(M),v.current?.focus()};p(()=>{if(T)return t(e=>"Escape"===e.key&&(!(x&&x.path.length>M+1)&&(S(),!0)),()=>k.current)}),i(()=>{if(!T||!E)return;const e=()=>{const e=k.current;if(!e||!v.current)return;const t=v.current.closest("[data-popup-submenu-panel]")??v.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??v.current.getBoundingClientRect(),r=M>0&&(x?.path[M-1]?.flipped??!1),o=e.offsetWidth||s,i=D(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=H(v.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),p(()=>{T&&N.current&&(N.current=!1,O(k.current)[0]?.focus())},[T]);const A=m(()=>x&&{...x,depth:M+1},[x,M]);if(!x)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const F=q(!1,o,a,T),P=I();/* @__PURE__ */
|
|
3
|
-
return y(b,{children:[
|
|
4
|
-
/* @__PURE__ */y("button",{ref:v,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":T,"aria-controls":T?L:void 0,disabled:o,"data-popup-submenu-row":!0,className:F.className,style:F.style,onClick:e=>{const t=0===e.detail;T?t&&O(k.current)[0]?.focus():W(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),W(!0))},onMouseEnter:()=>{o||(x.cancelClose(),T?x.closeBelow(M+1):(clearTimeout($.current),$.current=setTimeout(()=>W(!1),120)))},onMouseLeave:()=>{clearTimeout($.current),x.scheduleClose(M)},children:[n,
|
|
5
|
-
/* @__PURE__ */g("span",{className:"min-w-0 flex-1 truncate",children:e}),V]}),T&&f(
|
|
6
|
-
/* @__PURE__ */g("div",{ref:k,id:L,role:"menu","data-popup-menu-tree":x.id,"data-popup-submenu-panel":!0,className:"fixed rounded-2xl overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===P?"py-1":"large"===P?"py-2":"py-1.5"),style:{left:E.left,top:E.y,minWidth:s,maxHeight:void 0===d?"calc(100vh - 16px)":`min(${"number"==typeof d?`${d}px`:d}, calc(100vh - 16px))`,zIndex:J(x.root.current)+M+1,animation:(E.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...C()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=O(k.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),S())},onMouseEnter:()=>{x.cancelClose(),clearTimeout($.current)},onMouseLeave:()=>x.scheduleClose(M+1),onContextMenu:e=>{B(e.target)||e.preventDefault()},children:/* @__PURE__ */g(j.Provider,{value:A,children:r})}),document.body)]})}function G(){const e=I();/* @__PURE__ */
|
|
7
|
-
return g("div",{className:`border-t ${N} ${"tight"===e?"my-0.5":"large"===e?"my-1.5":"my-1"} mx-3`})}function Q({children:e}){const t=I(),n="tight"===t?"0.125rem":"large"===t?"0.375rem":"0.25rem";/* @__PURE__ */
|
|
8
|
-
return g("div",{className:"text-xs font-medium uppercase tracking-wide",style:{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:n,paddingBottom:n},children:e})}function Y({d:e,className:t="h-4 w-4 text-gray-400"}){/* @__PURE__ */
|
|
9
|
-
return g("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{N as GLASS_DIVIDER,L as GLASS_INPUT_BG,Y as MenuIcon,z as MenuSemanticsContext,E as NATIVE_MENU_ATTR,U as PopupMenu,G as PopupMenuDivider,K as PopupMenuItem,Q as PopupMenuLabel,X as PopupSubmenu,H as clampMenuTop,P as closeMenuBelow,S as describeContextTarget,$ as glassFill,C as glassStyle,q as itemLook,B as keepsNativeMenu,A as leavesContextMenuAlone,D as menuPanelLeft,F as openMenuLevel,R as resolveMenuLevels};
|
package/dist/chunk-L2W5XPZ3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r="4.164.0",a=r;export{a as APP_VERSION,r as VERSION};
|
package/dist/chunk-LZIS72CF.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{glassStyle as t,glassFill as e}from"./chunk-HQREOTKI.js";import{registerModalEscapeInterceptor as o,escapeSurfaceAbove as r,onOverlayOpen as i,Z_LAYERS as n}from"./chunk-ELSUXC3N.js";import{useShellStrings as a}from"./chunk-YS57MJFM.js";import{useBrowserLayoutEffect as l,useBrowserState as h}from"./chunk-D65T4H6J.js";import{useState as s,useRef as d,useId as c,useEffect as m,isValidElement as u,cloneElement as f,useCallback as g}from"react";import{createPortal as p}from"react-dom";import{jsxs as b,jsx as x,Fragment as w}from"react/jsx-runtime";var v=448,y=240,M=8,N=()=>({left:0,right:window.innerWidth,top:0,bottom:window.innerHeight});function W(t){const e=N(),o=t?.closest?.("[data-modal-panel]");if(!o)return e;const r=o.getBoundingClientRect();return r.width<=0||r.height<=0?e:{left:Math.max(e.left,r.left),right:Math.min(e.right,r.right),top:Math.max(e.top,r.top),bottom:Math.min(e.bottom,r.bottom)}}var z=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);var k={top:"bottom",bottom:"top",left:"right",right:"left"},C={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function H(t,e,o){return{top:t.top-o-(e.top+8),bottom:e.bottom-8-(t.bottom+o),left:t.left-o-(e.left+8),right:e.right-8-(t.right+o)}}var R=(t,e,o)=>Math.max(e,Math.min(t,o));function E(t,e,o){let r=NaN,i=NaN,n=NaN,a=NaN,l=NaN;const h=()=>{const e=t()?.getBoundingClientRect();if(!e)return!1;const h=o?o():NaN,s=e.left!==r||e.top!==i||e.right!==n||e.bottom!==a||h!==l&&!(Number.isNaN(h)&&Number.isNaN(l));return r=e.left,i=e.top,n=e.right,a=e.bottom,l=h,s};h();const s=()=>{h(),e()};let d=requestAnimationFrame(function t(){h()&&e(),d=requestAnimationFrame(t)});return window.addEventListener("scroll",s,!0),window.addEventListener("resize",s),()=>{cancelAnimationFrame(d),window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s)}}function T({trigger:t,menu:e,bounds:o,align:r,side:i}){const n=H(t,o,4),a="bottom"===i?"top":"bottom",l=e.height>n[i]&&(e.height<=n[a]||n[a]>n[i])?a:i,h=Math.max(Math.min(e.height,96),n[l]),s=Math.min(e.height,h),d=R("bottom"===l?t.bottom+4:t.top-4-s,o.top+8,o.bottom-8-s),c=Math.max(0,o.right-o.left-16),m=Math.min(e.width,c);return{left:R("start"===r?t.left:t.right-m,o.left+8,o.right-8-m),top:d,side:l,maxHeight:h,maxWidth:c}}function P(t,e,o={}){const{matchTriggerWidth:r=!1,preferredMaxWidth:i=v,preferredMaxHeight:n=y,popupRef:a}=o,[h,d]=s(null);return l(()=>{if(!e)return void d(null);const o=()=>{const e=t.current,o=e?.getBoundingClientRect();if(!o)return;const l=W(e),h=l.bottom-o.bottom-4-8,s=o.top-l.top-4-8,c=h<Math.min(n,160)&&s>h,m=Math.max(96,Math.min(n,c?s:h)),u=Math.max(0,l.right-l.left-16),f={minWidth:o.width,maxWidth:Math.min(i,u),maxHeight:m};if(r){const t=Math.min(o.width,u);f.width=t,f.maxWidth=t,f.left=Math.min(Math.max(l.left+8,o.left),l.right-8-t)}else if(a&&l.right-8-o.left<f.maxWidth&&Math.min(o.right,l.right-8)-l.left-8<f.maxWidth){const t=a.current?.offsetWidth??0,e=t>0?Math.min(t,f.maxWidth):f.maxWidth;f.left=Math.max(l.left+8,Math.min(o.left,l.right-8-e))}else if(l.right-8-o.left<f.maxWidth){const t=Math.min(o.right,l.right-8);f.right=window.innerWidth-t,f.maxWidth=Math.min(f.maxWidth,Math.max(0,t-l.left-8))}else f.left=Math.max(l.left+8,o.left);c?f.bottom=window.innerHeight-o.top+4:f.top=o.bottom+4,d(f)};return o(),E(()=>t.current,o,a?()=>a.current?.offsetWidth??NaN:void 0)},[e,t,r,i,n,a]),h}function B({point:t,menu:e,bounds:o}){const r={left:t.x,right:t.x,top:t.y,bottom:t.y},i=o.right-8-t.x,n=t.x-(o.left+8);return T({trigger:r,menu:e,bounds:o,align:e.width<=i||i>=n?"start":"end",side:"bottom"})}var $={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 S({content:a,side:h="top",delay:g=200,children:w,className:v="relative inline-flex"}){const[y,M]=s(!1),[T,P]=s(null),B=d(void 0),S=d(null),I=d(null),L=c(),D=d(!1),j=()=>{window.clearTimeout(B.current),D.current||(B.current=window.setTimeout(()=>M(!0),g))},A=()=>{window.clearTimeout(B.current),M(!1)},F=()=>{D.current=!0,A()},K=()=>{D.current=!1,A()};m(()=>()=>window.clearTimeout(B.current),[]),l(()=>{if(!y)return void P(null);const t=()=>{const t=S.current,e=I.current;if(!t||!e)return;const o=W(t),r=Math.max(0,o.right-o.left-16),i=Math.max(0,o.bottom-o.top-16);e.style.maxWidth=`${r}px`,e.style.maxHeight=`${i}px`;const n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return;const a=t.getBoundingClientRect();if(!function(t){const e=t.getBoundingClientRect();if(e.width<=0&&e.height<=0&&0===e.left&&0===e.top)return null;const o=N(),r={left:Math.max(o.left,e.left),right:Math.min(o.right,e.right),top:Math.max(o.top,e.top),bottom:Math.min(o.bottom,e.bottom)};let i=getComputedStyle(t).position;for(let e=t.parentElement;e&&e!==document.documentElement&&"fixed"!==i;e=e.parentElement){const t=getComputedStyle(e);if("absolute"===i&&"static"===t.position)continue;i=t.position;const o=z.has(t.overflowX),n=z.has(t.overflowY);if(!o&&!n)continue;const a=e.getBoundingClientRect();a.width<=0&&a.height<=0||(o&&(r.left=Math.max(r.left,a.left),r.right=Math.min(r.right,a.right)),n&&(r.top=Math.max(r.top,a.top),r.bottom=Math.min(r.bottom,a.bottom)))}return r.right>=r.left&&r.bottom>=r.top?r:null}(t))return void A();const l=function(t,e,o,r,i){const n=H(t,r,i),a=t=>n[t]-("top"===t||"bottom"===t?e.height:e.width),l=[o,k[o],...C[o]],h=l.find(t=>a(t)>=0)??l.reduce((t,e)=>a(e)>a(t)?e:t),s=(t.left+t.right)/2,d=(t.top+t.bottom)/2;let c,m;switch(h){case"top":c=s-e.width/2,m=t.top-i-e.height;break;case"bottom":c=s-e.width/2,m=t.bottom+i;break;case"left":c=t.left-i-e.width,m=d-e.height/2;break;case"right":c=t.right+i,m=d-e.height/2}return{side:h,left:R(c,r.left+8,r.right-8-e.width),top:R(m,r.top+8,r.bottom-8-e.height)}}(a,n,h,o,12),s=function(t,e,o,r,i){const{side:n,left:a,top:l}=e,h=a+o.width,s=l+o.height;if({top:t.top-s,bottom:l-t.bottom,left:t.left-h,right:a-t.right}[n]<i)return null;const d=(t,e,o)=>o<2*r?e+o/2:Math.max(e+r,Math.min(t,e+o-r)),c=(t.left+t.right)/2,m=(t.top+t.bottom)/2;switch(n){case"top":return{side:n,x:d(c,a,o.width),y:s};case"bottom":return{side:n,x:d(c,a,o.width),y:l};case"left":return{side:n,x:h,y:d(m,l,o.height)};case"right":return{side:n,x:a,y:d(m,l,o.height)}}}(a,l,n,16,6),d={anchor:{left:a.left,top:a.top,width:a.width,height:a.height},left:l.left-a.left,top:l.top-a.top,maxWidth:r,maxHeight:i,side:l.side,arrow:s&&{left:s.x-a.left,top:s.y-a.top}};P(t=>{return t&&(o=d,(e=t).anchor.left===o.anchor.left&&e.anchor.top===o.anchor.top&&e.anchor.width===o.anchor.width&&e.anchor.height===o.anchor.height&&e.left===o.left&&e.top===o.top&&e.maxWidth===o.maxWidth&&e.maxHeight===o.maxHeight&&e.side===o.side&&e.arrow?.left===o.arrow?.left&&e.arrow?.top===o.arrow?.top)?t:d;var e,o})};return t(),E(()=>S.current,t)},[y,h,a]),m(()=>{if(!y)return;const t=o(t=>"Escape"===t.key&&(A(),!r(S.current))),e=i(A);return()=>{t(),e()}},[y]);const X=y?L:void 0,q=u(w)?f(w,{"aria-describedby":[w.props["aria-describedby"],X].filter(Boolean).join(" ")||void 0}):w,J=y?t():void 0,U=y?e():void 0;/* @__PURE__ */
|
|
2
|
-
return b("span",{ref:S,className:v,"aria-describedby":u(w)?void 0:X,onMouseEnter:j,onMouseLeave:K,onFocus:j,onBlur:K,onPointerDown:F,onClick:F,children:[q,y&&p(
|
|
3
|
-
/* @__PURE__ */b("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:n.popup,...T?.anchor},children:[
|
|
4
|
-
/* @__PURE__ */x("span",{ref:I,id:L,role:"tooltip",className:`pointer-events-none absolute z-[300] box-border w-max overflow-hidden whitespace-normal break-words text-start rounded-md px-2 py-1 text-xs text-gray-800 ${T?"":$[h]}`,style:{...J,...T&&{left:T.left,top:T.top,maxWidth:T.maxWidth,maxHeight:T.maxHeight}},children:a}),(!T||T.arrow)&&
|
|
5
|
-
/* @__PURE__ */x("span",{"aria-hidden":"true",className:"rosh-tooltip-arrow","data-side":T?.side??h,style:{background:U,"--rosh-tooltip-edge":J?.border,...T?.arrow&&{left:T.arrow.left,top:T.arrow.top}}})]}),document.body)]})}var I=(t,e,o)=>Math.min(o,Math.max(e,t));function L(t,e,o,r,i){return Math.round(I("left"===o?t+e:t-e,r,i))}function D(t,e,o){let r=null;try{r=window.localStorage.getItem(t)}catch{return null}const i=r?parseInt(r,10):NaN;return Number.isNaN(i)?null:I(i,e,o)}function j({width:t,onResize:e,side:o,min:r,max:i,defaultWidth:n=r,step:h=16,storageKey:s,label:c,hint:u,controls:f,className:p=""}){const b=a().resizeHandle,w=d(null),v=d({onResize:e,min:r,max:i,side:o});v.current={onResize:e,min:r,max:i,side:o},l(()=>{if(!s)return;const o=D(s,r,i);null!==o&&o!==t&&e(o)},[s]),m(()=>{if(!s)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(s,String(Math.round(t)))}catch{}},200);return()=>window.clearTimeout(e)},[t,s]);const y=g(()=>{w.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);m(()=>y,[y]);const M=t=>{w.current&&(t.currentTarget.hasPointerCapture?.(w.current.pointer)&&t.currentTarget.releasePointerCapture(w.current.pointer),y())},N="left"===o?"right-0":"left-0";/* @__PURE__ */
|
|
6
|
-
return x(S,{content:u??b.hint,side:"left"===o?"right":"left",delay:600,className:`absolute inset-y-0 ${N} z-10 flex w-2 ${p}`.trim(),children:/* @__PURE__ */x("div",{role:"separator",tabIndex:0,"aria-orientation":"vertical","aria-label":c??b.label,"aria-valuenow":Math.round(t),"aria-valuemin":r,"aria-valuemax":i,"aria-controls":f,"data-resize-handle":o,onPointerDown:e=>{0===e.button&&(e.preventDefault(),w.current={x:e.clientX,width:t,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},onPointerMove:t=>{const e=w.current;if(!e)return;if(0===t.buttons)return void y();const o=t.clientX-e.x;if(!e.moved){if(Math.abs(o)<3)return;e.moved=!0}const{onResize:r,min:i,max:n,side:a}=v.current;r(L(e.width,o,a,i,n))},onPointerUp:M,onPointerCancel:M,onLostPointerCapture:()=>{w.current&&y()},onDoubleClick:()=>e(I(n,r,i)),onKeyDown:a=>{const l="ArrowRight"===a.key?h:"ArrowLeft"===a.key?-h:null,s=null!==l?L(t,l,o,r,i):"Home"===a.key?r:"End"===a.key?i:"Enter"===a.key?I(n,r,i):null;null!==s&&(a.preventDefault(),s!==t&&e(s))},className:"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */x("div",{"aria-hidden":"true",className:`absolute inset-y-0 ${N} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}var A=(t,e,o)=>Math.min(Math.max(t,e),o);function F({sidebar:t,sidebarTop:e,sidebarBottom:o,children:r,side:i="left",storageKey:n,defaultWidth:l=256,minWidth:s=180,maxWidth:d=480,className:c="",sidebarClassName:m=("right"===i?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:u="bg-white"}){const f="right"===i,g=a().sidebar,[p,v]=h(()=>(n?D(n,s,d):null)??A(l,s,d),A(l,s,d)),y=null!=e||null!=o,M=/* @__PURE__ */b("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:p},children:[
|
|
7
|
-
/* @__PURE__ */b("div",{className:`flex h-full flex-col ${y?"overflow-hidden":"overflow-y-auto"} ${m}`,children:[null!=e&&/* @__PURE__ */x("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:e}),y?/* @__PURE__ */x("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t}):t,null!=o&&/* @__PURE__ */x("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:o})]}),
|
|
8
|
-
/* @__PURE__ */x(j,{side:i,width:p,onResize:v,min:s,max:d,defaultWidth:A(l,s,d),storageKey:n,hint:g.resize})]}),N=/* @__PURE__ */x("div",{className:`flex min-w-0 flex-1 flex-col ${u}`,children:r});/* @__PURE__ */
|
|
9
|
-
return x("div",{className:`flex h-full w-full overflow-hidden ${c}`,children:/* @__PURE__ */b(w,f?{children:[N,M]}:{children:[M,N]})})}export{y as MENU_MAX_HEIGHT,v as POPUP_MAX_WIDTH,j as ResizeHandle,F as SidebarLayout,S as Tooltip,M as VIEWPORT_MARGIN,E as followAnchor,B as placeAtPoint,T as placeMenu,W as popupBounds,P as useDropdownPosition};
|
package/dist/chunk-MAIHBBWT.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(){try{const t=document.documentElement;return"dark"===t.getAttribute("data-theme")||t.classList.contains("dark")}catch{return!1}}var e=["data-theme","class"];export{e as ROOT_THEME_ATTRIBUTES,t as rootIsDark};
|