efficient-shell 7.18.1 → 7.19.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.
Files changed (33) hide show
  1. package/README.md +2 -2
  2. package/dist/{Browser-K4DQBJWS.js → Browser-62T2OSLK.js} +15 -15
  3. package/dist/{Calculator-NGSHZWOR.js → Calculator-YSHOGYHB.js} +22 -22
  4. package/dist/{ConfirmDialog-JMQI6CGW.js → ConfirmDialog-AVFQGXKL.js} +1 -1
  5. package/dist/{CurrencyConverter-PICVES6A.js → CurrencyConverter-V6LH7VQP.js} +9 -9
  6. package/dist/{Documents-QEPM2X7B.js → Documents-R6IE64IZ.js} +13 -13
  7. package/dist/{Files-S45MKBYC.js → Files-RVESLH5D.js} +26 -26
  8. package/dist/{Notepad-XEROGOZT.js → Notepad-2QJH5T7B.js} +11 -11
  9. package/dist/{PomodoroTimer-OCAJKGQU.js → PomodoroTimer-M7BLRWTH.js} +4 -4
  10. package/dist/{Preview-S4UIOU43.js → Preview-3ZQ7SSHV.js} +24 -24
  11. package/dist/{Spreadsheet-L7QG3LGD.js → Spreadsheet-OBFCMT3L.js} +13 -13
  12. package/dist/{Stock-74K5L75A.js → Stock-XDKUT7RW.js} +6 -6
  13. package/dist/{Weather-QTRJYIPS.js → Weather-XGIJGO23.js} +16 -16
  14. package/dist/{WorldClock-L6PSFBLE.js → WorldClock-V6S6QEXK.js} +6 -6
  15. package/dist/apps/index.js +1 -1
  16. package/dist/bin/ui-check.js +1 -1
  17. package/dist/{chunk-23C25QZV.js → chunk-3FLFIKAL.js} +1 -1
  18. package/dist/{chunk-NXYHRDRD.js → chunk-3LEHVM4D.js} +4 -4
  19. package/dist/chunk-76VCH7N6.js +29 -0
  20. package/dist/{chunk-QWSVX6OP.js → chunk-7JN73EKI.js} +1 -1
  21. package/dist/{chunk-BIYMQKF3.js → chunk-AJCAZNBF.js} +1 -1
  22. package/dist/chunk-FTZ5WHJM.js +1 -0
  23. package/dist/chunk-NUCPJVKD.js +108 -0
  24. package/dist/chunk-Q2HEVH2C.js +1025 -0
  25. package/dist/index.js +76 -76
  26. package/dist/page-tabs/index.js +5 -5
  27. package/dist/telemetry/index.js +1 -1
  28. package/dist/ui/index.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/chunk-ERDQLQVK.js +0 -1
  31. package/dist/chunk-IBGEW3OA.js +0 -108
  32. package/dist/chunk-L5YNA4NS.js +0 -1025
  33. package/dist/chunk-QBXX5A7U.js +0 -29
@@ -1,29 +0,0 @@
1
- import{useDismissPopupsOnOpen as e}from"./chunk-UVBK6YSR.js";import{buttonClasses as t}from"./chunk-JTNKC4CR.js";import{registerModalEscapeInterceptor as n,Z_LAYERS as r}from"./chunk-FIEA5CGB.js";import{useShellStrings as o,splitAround as i}from"./chunk-QRCDQPJA.js";import{Icon as l}from"./chunk-ZGUQLVY4.js";import{createContext as a,useEffect as s,useRef as c,useId as d,useContext as u,useState as m,useCallback as f}from"react";import{jsxs as h,jsx as b,Fragment as g}from"react/jsx-runtime";var p=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function v(e){return Array.from(e.querySelectorAll(p)).filter(e=>null!==e.offsetParent||e===document.activeElement)}var y=[];function x(e){const t=y.findIndex(t=>t!==e&&e.contains(t));-1===t?y.push(e):y.splice(t,0,e)}function w(e){const t=y.lastIndexOf(e);-1!==t&&y.splice(t,1)}var N=/* @__PURE__ */new WeakSet;function k(e){return v(e)}function C(e,t){s(()=>{if(!t)return;const n=e.current;return n?(N.add(n),x(n),()=>{w(n),N.delete(n)}):void 0},[e,t])}function E(e,t){const n=y.lastIndexOf(t),r=n>0?y[n-1]:-1===n?y[y.length-1]??null:null,o=v(r??e.ownerDocument.body).filter(n=>!t.contains(n)&&!e.contains(n)),i=o.find(t=>0!==(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING));return i||(r&&!N.has(r)?o[0]??null:null)}function L(e,t,n){s(()=>{if(!t)return;const r=e.current;if(!r)return;const o=document.activeElement,i=n?.current??v(r)[0]??r;i!==r||r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),i.focus();const l=e=>{if("Tab"!==e.key)return;if(y[y.length-1]!==r)return;const t=v(r);if(0===t.length)return void e.preventDefault();const n=t[0],o=t[t.length-1],i=document.activeElement;!e.shiftKey||i!==n&&r.contains(i)?e.shiftKey||i!==o&&r.contains(i)||(e.preventDefault(),n.focus()):(e.preventDefault(),o.focus())};return x(r),document.addEventListener("keydown",l,!0),()=>{w(r),document.removeEventListener("keydown",l,!0),(r.contains(document.activeElement)||document.activeElement===document.body)&&o?.focus?.()}},[e,t,n])}var P=0,j=null;function D(e){s(()=>{if(!e)return;const t=document.body;if(0===P){j={overflow:t.style.overflow,paddingRight:t.style.paddingRight};const e=window.innerWidth-document.documentElement.clientWidth;t.style.overflow="hidden",e>0&&(t.style.paddingRight=`${e}px`)}return P+=1,()=>{0===(P-=1)&&j&&(t.style.overflow=j.overflow,t.style.paddingRight=j.paddingRight,j=null)}},[e])}var T={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function F({open:t,onClose:i,title:a,description:u,role:m="dialog",children:f,footer:g,blocking:p=!1,size:v="md",initialFocus:y,"aria-label":x,"aria-labelledby":w,"aria-describedby":N,className:k=""}){const C=c(null),E=d(),P=d(),j=!p&&!g,F=d(),I=o().dialog;return e(t),L(C,t,y),D(t),s(()=>{if(t)return n(()=>(p||i(),!0),()=>C.current)},[t,p,i]),t?/* @__PURE__ */h("div",{className:"fixed inset-0",style:{zIndex:r.overlay},role:"presentation",children:[
2
- /* @__PURE__ */b("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
3
- /* @__PURE__ */b("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:p?void 0:e=>{e.target===e.currentTarget&&i()},children:/* @__PURE__ */h("div",{ref:C,role:m,"aria-modal":"true","aria-labelledby":a?F:w,"aria-label":a||w?void 0:x,"aria-describedby":N??(u?P:f?E:void 0),className:`relative max-h-full w-full ${T[v]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${k}`.trim(),children:[a&&/* @__PURE__ */b("h2",{id:F,className:(j?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:a}),u&&/* @__PURE__ */b("p",{id:P,className:((a?"mt-1":j?"pr-8":"")+" text-sm text-gray-500").trim(),children:u}),f&&/* @__PURE__ */b("div",{id:E,className:"mt-2 text-sm text-gray-600",children:f}),g&&/* @__PURE__ */b("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:g}),j&&/* @__PURE__ */b("button",{type:"button",onClick:i,"aria-label":I.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */b(l,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]}):null}var I=a(()=>Promise.resolve(!1)),R=()=>u(I),W=()=>Promise.resolve(!1),O=e=>W(e),$=()=>Promise.resolve(!1),A=e=>$(e),K=()=>Promise.resolve(null),S=e=>K(e),G={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-blue-100",button:t({variant:"primary"})}},Q=t({variant:"secondary"}),U=t({variant:"primary"}),V="w-full rounded-md border border-gray-300 h-8 px-3 text-sm";function z(){/* @__PURE__ */
4
- return b(l,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function B(){/* @__PURE__ */
5
- return b(l,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function J({children:e}){const[t,n]=m(!1),[r,l]=m({message:""}),[a,d]=m(0),u=c(),p=c(null),v=c(0),y=c([]),x=c(null),w=c(null),N=f(e=>{p.current=e.id,u.current=e.resolve,d(e.id),l(e.options),n(!0)},[]),k=f(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++v.current,options:t,resolve:e};null===p.current?N(n):y.current.push(n)})},[N]),[C,E]=m(!1),[L,P]=m({message:""}),[j,D]=m(""),T=c(),R=f(e=>(P(e),D(""),E(!0),new Promise(e=>{T.current=e})),[]),[O,A]=m(!1),[S,J]=m({}),[Y,_]=m(""),q=c(),M=f(e=>{const t="string"==typeof e?{message:e}:e;return J(t),_(t.defaultValue??""),A(!0),new Promise(e=>{q.current=e})},[]);s(()=>{W=k,$=R,K=M},[k,R,M]);const Z=(e,t)=>{if(p.current!==e)return;const r=u.current,o=y.current.shift();o?N(o):(p.current=null,u.current=void 0,n(!1)),r?.(t)},H=e=>{E(!1),D(""),T.current?.(e)},X=e=>{if(e){const e=Y.trim();if(!e&&!S.allowEmpty)return A(!1),void q.current?.(null);A(!1),q.current?.(e)}else A(!1),q.current?.(null)},ee=r.variant||(r.confirmLabel?.toLowerCase().includes("delete")||r.message.toLowerCase().includes("delete")?"danger":"info"),te=G[ee],ne=G["warning"===L.variant?"warning":"danger"],re=L.confirmWord,oe=null==re||j===re,ie=o().dialog,[le,ae]=i(ie.typeToConfirm);/* @__PURE__ */
6
- return h(I.Provider,{value:k,children:[e,
7
- /* @__PURE__ */b(F,{open:t,onClose:()=>Z(a,!1),initialFocus:x,footer:/* @__PURE__ */h(g,{children:[
8
- /* @__PURE__ */b("button",{ref:x,type:"button",onClick:()=>Z(a,!1),className:Q,children:r.cancelLabel||ie.cancel}),
9
- /* @__PURE__ */b("button",{type:"button",onClick:()=>Z(a,!0),className:te.button,children:r.confirmLabel||ie.ok})]}),children:/* @__PURE__ */h("div",{className:"flex gap-4",children:[
10
- /* @__PURE__ */b("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */b(z,{})}),
11
- /* @__PURE__ */h("div",{className:"flex-1",children:[
12
- /* @__PURE__ */b("h2",{className:"text-base font-semibold text-gray-900",children:r.title||ie.confirmTitle}),
13
- /* @__PURE__ */b("p",{className:"mt-2 text-sm text-gray-600",children:r.message})]})]})}),
14
- /* @__PURE__ */h(F,{open:C,onClose:()=>H(!1),initialFocus:null!=re?void 0:w,footer:/* @__PURE__ */h(g,{children:[
15
- /* @__PURE__ */b("button",{ref:w,type:"button",onClick:()=>H(!1),className:Q,children:L.cancelLabel||ie.destructiveCancel}),
16
- /* @__PURE__ */b("button",{type:"button",onClick:()=>H(!0),disabled:!oe,className:ne.button,children:re??L.confirmLabel??ie.destructiveConfirm})]}),children:[
17
- /* @__PURE__ */b("button",{type:"button",onClick:()=>H(!1),"aria-label":ie.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */b(B,{})}),
18
- /* @__PURE__ */h("div",{className:"flex gap-4",children:[
19
- /* @__PURE__ */b("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */b(z,{})}),
20
- /* @__PURE__ */h("div",{className:"flex-1",children:[
21
- /* @__PURE__ */b("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:L.title||ie.destructiveTitle}),
22
- /* @__PURE__ */b("p",{className:"mt-2 text-sm text-gray-600",children:L.message}),null!=re&&/* @__PURE__ */h(g,{children:[
23
- /* @__PURE__ */h("p",{className:"mt-3 text-sm text-gray-700",children:[le,
24
- /* @__PURE__ */b("kbd",{className:"rounded border border-gray-300 bg-gray-50 px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:re}),ae]}),
25
- /* @__PURE__ */b("input",{autoFocus:!0,type:"text",value:j,onChange:e=>D(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j===re&&H(!0)},placeholder:re,className:`mt-2 ${V} focus:border-red-500`})]})]})]})]}),
26
- /* @__PURE__ */h(F,{open:O,onClose:()=>X(!1),title:S.title||ie.promptTitle,footer:/* @__PURE__ */h(g,{children:[
27
- /* @__PURE__ */b("button",{type:"button",onClick:()=>X(!1),className:Q,children:S.cancelLabel||ie.cancel}),
28
- /* @__PURE__ */b("button",{type:"button",onClick:()=>X(!0),disabled:!S.allowEmpty&&!Y.trim(),className:U,children:S.confirmLabel||ie.ok})]}),children:[S.message&&/* @__PURE__ */b("p",{className:"text-sm text-gray-600",children:S.message}),
29
- /* @__PURE__ */b("input",{autoFocus:!0,type:"text",value:Y,onChange:e=>_(e.target.value),onKeyDown:e=>{"Enter"===e.key?X(!0):"Escape"===e.key&&X(!1)},onFocus:e=>e.target.select(),placeholder:S.placeholder,className:`mt-3 ${V} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{J as ConfirmProvider,F as Dialog,O as confirm,A as confirmDestructive,k as focusableIn,S as prompt,E as stopAfter,R as useConfirm,L as useFocusTrap,D as useScrollLock,C as useTabLayer};