efficient-shell 13.14.0 → 13.15.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 +2 -1
- package/dist/{Browser-FJSOZLWR.js → Browser-KHMTFVKZ.js} +18 -18
- package/dist/Calculator-OKVS4UOJ.js +29 -0
- package/dist/CurrencyConverter-ZA2NGJWI.js +21 -0
- package/dist/{Files-XLDCJ7DO.js → Files-EN4DDZYV.js} +78 -78
- package/dist/Notepad-PHQNEUKW.js +24 -0
- package/dist/{PomodoroTimer-XKSYNHS7.js → PomodoroTimer-PW7BRZUJ.js} +6 -6
- package/dist/{Preview-24XTJDIR.js → Preview-OSQHIS3Z.js} +31 -31
- package/dist/Stock-2P4NWUNB.js +16 -0
- package/dist/{Weather-IWM5XTE5.js → Weather-7LIQ4POB.js} +20 -20
- package/dist/{WorldClock-35TNXAJM.js → WorldClock-KHBYIJQZ.js} +6 -6
- package/dist/ai/index.js +43 -43
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.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/ChartFrame.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/SpecChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/{chunk-UGEA3C5C.js → chunk-23LK4PLJ.js} +5 -5
- package/dist/{chunk-SNHBDP4X.js → chunk-3J4SFHC7.js} +5 -5
- package/dist/{chunk-RT77WNRB.js → chunk-3OUG6QAD.js} +1 -1
- package/dist/{chunk-775K6APE.js → chunk-3QNZ7YGZ.js} +1 -1
- package/dist/chunk-42RCQEEJ.js +14 -0
- package/dist/{chunk-36UB4MJX.js → chunk-4OBSVO6U.js} +1 -1
- package/dist/{chunk-64PPKUJG.js → chunk-5HBAJ2UA.js} +1 -1
- package/dist/{chunk-GTT7LIWK.js → chunk-7JG64RQW.js} +1 -1
- package/dist/{chunk-QNQLKGBC.js → chunk-A4WNUFLT.js} +1 -1
- package/dist/{chunk-A7ZYFJ6V.js → chunk-AOLJKOO6.js} +23 -23
- package/dist/chunk-BWJZTHZ6.js +1 -0
- package/dist/{chunk-2GMYO6ET.js → chunk-BWLC56GZ.js} +1 -1
- package/dist/chunk-CBUBDXJ2.js +1 -0
- package/dist/{chunk-JWLOERV5.js → chunk-CGKY4ZRA.js} +2 -2
- package/dist/{chunk-OYXA7SWV.js → chunk-D3T3JCUC.js} +1 -1
- package/dist/chunk-G5UGCAWN.js +17 -0
- package/dist/{chunk-HTANBHNV.js → chunk-GKNF53YM.js} +1 -1
- package/dist/chunk-GSLZ46DJ.js +24 -0
- package/dist/chunk-HNPJ3V3I.js +6 -0
- package/dist/{chunk-JPKNVTTK.js → chunk-I6JTDAOB.js} +1 -1
- package/dist/{chunk-YY7OFUT2.js → chunk-JFRBUVHX.js} +2 -2
- package/dist/chunk-KXPXLUNM.js +4 -0
- package/dist/{chunk-KBQNMQCK.js → chunk-LLYMOV4S.js} +1 -1
- package/dist/{chunk-WIFK6TLB.js → chunk-NYKOATR5.js} +1 -1
- package/dist/chunk-O2PVZC5D.js +8 -0
- package/dist/{chunk-FMERX3PG.js → chunk-OLSA36VX.js} +2 -2
- package/dist/{chunk-FUP2J2OX.js → chunk-QQK7HKNK.js} +1 -1
- package/dist/{chunk-RZJ63ZM4.js → chunk-QVQO3EFL.js} +9 -9
- package/dist/{chunk-ZDYIVU5R.js → chunk-RZ3OQFOD.js} +6 -6
- package/dist/chunk-S25KELFW.js +11 -0
- package/dist/{chunk-YBYJUBWE.js → chunk-TTLVTJR6.js} +1 -1
- package/dist/{chunk-EHM3ZVVT.js → chunk-UC5IC3AM.js} +4 -4
- package/dist/{chunk-YUDBB7VC.js → chunk-UGEX7SVM.js} +3 -3
- package/dist/{chunk-G3MJO3A6.js → chunk-W6NGPSMM.js} +13 -13
- package/dist/{chunk-ALHYNNE2.js → chunk-WJ7U6TGK.js} +6 -6
- package/dist/{chunk-YNVH2EIE.js → chunk-ZNKZ6J65.js} +3 -3
- package/dist/chunk-ZOCE74ED.js +2 -0
- package/dist/data/EntityList.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +515 -515
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/Dialog.d.ts +14 -4
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.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/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +4 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-ZHINQHFI.js +0 -29
- package/dist/CurrencyConverter-AAXS7RPC.js +0 -21
- package/dist/Notepad-NENKOSXJ.js +0 -24
- package/dist/Stock-TCQSVSSY.js +0 -16
- package/dist/chunk-4S3E3VJH.js +0 -11
- package/dist/chunk-64RHGJXK.js +0 -4
- package/dist/chunk-6AUQWWUA.js +0 -17
- package/dist/chunk-FQD6P6EZ.js +0 -4
- package/dist/chunk-IQDHVQAQ.js +0 -14
- package/dist/chunk-JGKDWDVM.js +0 -27
- package/dist/chunk-KY3KGRGC.js +0 -1
- package/dist/chunk-RIG5FEVS.js +0 -1
- package/dist/chunk-XSHDPG45.js +0 -9
- /package/dist/{chunk-JR2HHKVP.js → chunk-HOHHRNCB.js} +0 -0
package/dist/chunk-4S3E3VJH.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{useShellLocale as e}from"./chunk-IUVGHHR3.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useId as d,Children as n}from"react";import{jsxs as t,jsx as a}from"react/jsx-runtime";var i={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},l={neutral:"border-line",warning:"border-amber-300",current:"border-line"};function s({children:e,header:r,description:s,footer:c,padded:o=!0,padding:m,headingLevel:b,headerActions:u,"aria-label":p,className:h="",bodyClassName:x="",style:g,tone:f="neutral"}){const y=i[m??(o?"md":"none")],N=d(),v=d(),$=null!=r&&null!=s&&""!==s,w=null!=b&&null!=r,j=`h${b}`,k=null!=p&&""!==p,H=w||k,A=H?"section":"div",C=`rounded-(--radius-card) border ${l[f]} bg-surface shadow-sm ${h}`.trim(),R=n.toArray(e).length>0,B=R?"border-b border-line-subtle ":"",G="current"===f,I=G?"text-base font-semibold text-blue-700":"text-base font-semibold text-ink-strongest",L=G?"rounded-t-(--radius-card) bg-accent-tint ":"",M=`${B}${L}${y.edge} ${I}`;/* @__PURE__ */
|
|
2
|
-
return t(A,{className:C,style:g,...k?{"aria-label":p}:w?{"aria-labelledby":N}:{},...$&&H?{"aria-describedby":v}:{},...G?{"aria-current":!0}:{},children:[$?
|
|
3
|
-
/* @__PURE__ */t("div",{className:`${B}${L}${y.edge}`,children:[null!=u?/* @__PURE__ */t("div",{className:`flex items-center justify-between gap-3 ${I}`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?/* @__PURE__ */a(j,{id:N,className:I,children:r}):/* @__PURE__ */a("div",{className:I,children:r}),
|
|
4
|
-
/* @__PURE__ */a("p",{id:v,className:G?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-ink-faint",children:s})]}):null!=r&&(null!=u?
|
|
5
|
-
/* @__PURE__ */t("div",{className:`${M} flex items-center justify-between gap-3`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?
|
|
6
|
-
/* @__PURE__ */a(j,{id:N,className:M,children:r}):/* @__PURE__ */a("div",{className:M,children:r})),R&&/* @__PURE__ */a("div",{className:[y.body,x].filter(Boolean).join(" "),children:e}),c&&/* @__PURE__ */a("div",{className:`border-t border-gray-100 ${y.edge}`,children:c})]})}function c({label:d,value:n,icon:i,delta:l,className:s=""}){const c=e(),o="number"==typeof n&&c?r(n,c):n,m="up"===l?.direction?"text-green-600":"down"===l?.direction?"text-red-600":"text-gray-500",b="up"===l?.direction?"▲":"down"===l?.direction?"▼":"→";/* @__PURE__ */
|
|
7
|
-
return t("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${s}`.trim(),children:[
|
|
8
|
-
/* @__PURE__ */t("div",{className:"flex items-center justify-between text-ink-faint",children:[
|
|
9
|
-
/* @__PURE__ */a("span",{className:"text-xs font-medium uppercase tracking-wide",children:d}),i]}),
|
|
10
|
-
/* @__PURE__ */t("div",{className:"mt-2 flex items-baseline gap-2",children:[
|
|
11
|
-
/* @__PURE__ */a("span",{className:"text-2xl font-semibold text-gray-900",children:o}),l&&/* @__PURE__ */t("span",{className:`text-xs font-medium ${m}`,children:[b," ",l.value]})]})]})}export{s as Card,c as StatCard};
|
package/dist/chunk-64RHGJXK.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{useTabLayer as e,focusableIn as t,stopAfter as r}from"./chunk-DWGYC7OD.js";import{onOverlayOpen as n}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{popupBounds as o,VIEWPORT_MARGIN as a,placeMenu as c,followAnchor as s}from"./chunk-GLUJS42B.js";import{useHydrated as l,useBrowserLayoutEffect as u}from"./chunk-D65T4H6J.js";import{buttonClasses as d}from"./chunk-UQYNPYF4.js";import{registerModalEscapeInterceptor as m}from"./chunk-TWVUQUUD.js";import{useState as p,useRef as f,useId as h,useCallback as g,useEffect as v}from"react";import{createPortal as b}from"react-dom";import{jsxs as x,jsx as w}from"react/jsx-runtime";var y=/(^|[\s:])!?z-/;function k({trigger:k,children:C,title:N,description:D,"aria-label":E,align:j="start",side:O="bottom",open:T,defaultOpen:L=!1,onOpenChange:$,matchTriggerWidth:H=!1,maxHeight:P,initialFocus:S,id:W,triggerLabel:M,"aria-describedby":U,disabled:z,className:K="",triggerClassName:Y,panelClassName:B=""}){const[F,G]=p(L),J=(T??F)&&!z,R=l(),I=f(null),Q=f(null),V=f(null),q=f(null),A=h(),X=W??A,Z=h(),_=h(),ee=h(),te=f(null),re=f(!1),ne=f({openProp:T,onOpenChange:$});ne.current={openProp:T,onOpenChange:$};const ie=g(e=>{void 0===ne.current.openProp&&G(e),ne.current.onOpenChange?.(e)},[]),oe=g((e=!1)=>{re.current=e,ie(!1)},[ie]),ae=e=>{te.current=e.nativeEvent},ce=g(()=>{const e=V.current,t=Q.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=o(t),i=Math.max(0,n.right-n.left-2*a),s=e.style;s.left="0px",s.top="0px",s.maxWidth=`${i}px`,s.maxHeight="none",s.width=H?`${Math.min(r.width,i)}px`:"";const l={width:e.offsetWidth,height:e.offsetHeight},u=P??1/0,d=c({trigger:r,menu:{width:l.width,height:Math.min(l.height,u)},bounds:n,align:j,side:O}),m=Math.min(d.maxHeight,u);s.left=`${d.left}px`,s.top=`${d.top}px`,s.maxHeight=`${m}px`,s.overflowY=l.height>m?"auto":"",e.dataset.side=d.side,e.dataset.align=j},[j,O,H,P]);u(()=>{J&&R&&ce()}),v(()=>{if(!J||!R)return;const e=s(()=>Q.current,ce),t=q.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>ce());return r.observe(t),()=>{e(),r.disconnect()}},[J,R,ce]),v(()=>{if(!J)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(te.current===e)return!1;const t=e.target;return!(t&&(I.current?.contains(t)||V.current?.contains(t)))})(e)&&oe(!0))},i=e=>{t=e,r=window.setTimeout(()=>n(e),0)},o=e=>n(e);return document.addEventListener(e,i,!0),window.addEventListener(e,o),()=>{window.clearTimeout(r),document.removeEventListener(e,i,!0),window.removeEventListener(e,o)}},t=e("pointerdown"),r=e("focusin"),i=n(()=>oe()),o=m(e=>"Escape"===e.key&&(oe(),Q.current?.focus(),!0),()=>V.current);return()=>{t(),r(),i(),o()}},[J,oe]),e(V,J&&R),u(()=>{if(!J||!R)return;const e=V.current;return()=>{if(re.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||Q.current?.focus({preventScroll:!0})}},[J,R]),v(()=>{if(!J||!R)return;const e=V.current;e&&(re.current=!1,(S?.current??t(e)[0]??e).focus({preventScroll:!0}))},[J,R]);const se="function"==typeof C?C({close:()=>oe()}):C,le=N?{"aria-labelledby":_}:E?{"aria-label":E}:{"aria-labelledby":X};/* @__PURE__ */
|
|
2
|
-
return x("div",{ref:I,className:`relative inline-flex ${K}`.trim(),children:[
|
|
3
|
-
/* @__PURE__ */w("button",{ref:Q,id:X,type:"button","aria-haspopup":"dialog","aria-expanded":J,"aria-controls":J&&R?Z:void 0,"aria-label":M,"aria-describedby":U,disabled:z,onClick:()=>J?oe():ie(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!J)return;const r=(()=>{const e=V.current;return e?t(e)[0]??e:null})();r&&(e.preventDefault(),r.focus({preventScroll:!0}))},className:Y??d({variant:"secondary"}),children:k}),J&&R&&b(
|
|
4
|
-
/* @__PURE__ */w("div",{ref:V,id:Z,role:"dialog",...le,"aria-describedby":D?ee:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:ae,onFocusCapture:ae,onKeyDown:e=>{const n=V.current,i=Q.current;if("Tab"!==e.key||!n||!i||!n.contains(e.target))return;const o=t(n),a=document.activeElement;if(e.shiftKey){if(o.length>0&&a!==o[0]&&a!==n)return;return e.preventDefault(),void i.focus({preventScroll:!0})}if(o.length>0&&a!==o[o.length-1])return;e.preventDefault();const c=r(i,n);oe(!!c),(c??i).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${B}`.trim(),style:y.test(B)?void 0:{zIndex:i.popup},children:/* @__PURE__ */x("div",{ref:q,children:[N&&/* @__PURE__ */w("h2",{id:_,className:"text-sm font-semibold text-gray-900",children:N}),D&&/* @__PURE__ */w("p",{id:ee,className:"mt-1 text-sm text-gray-500",children:D}),N||D?/* @__PURE__ */w("div",{className:"mt-3",children:se}):se]})}),document.body)]})}export{k as Popover};
|
package/dist/chunk-6AUQWWUA.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{ChartSkeleton as e}from"./chunk-ZNV75GAG.js";import{ChartHighlightProvider as r,useHighlight as a}from"./chunk-CNYAHYE6.js";import{CHART_INK as t,resolveSeriesColor as s}from"./chunk-TZFACUMR.js";import{useShellStrings as l}from"./chunk-IUVGHHR3.js";import{jsx as n,jsxs as o,Fragment as c}from"react/jsx-runtime";function i({shape:e,colour:r}){const a="shrink-0";switch(e){case"circle":/* @__PURE__ */
|
|
2
|
-
return n("span",{className:`${a} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:r}});case"circle-outline":/* @__PURE__ */
|
|
3
|
-
return n("span",{className:`${a} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:r}});case"rounded-square-outline":/* @__PURE__ */
|
|
4
|
-
return n("span",{className:`${a} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:r}});case"square":/* @__PURE__ */
|
|
5
|
-
return n("span",{className:`${a} h-2.5 w-2.5`,style:{backgroundColor:r}});case"bar":/* @__PURE__ */
|
|
6
|
-
return n("span",{className:`${a} h-1 w-4 rounded-full`,style:{backgroundColor:r}});case"bar-vertical":/* @__PURE__ */
|
|
7
|
-
return n("span",{className:`${a} h-3.5 w-1 rounded-full`,style:{backgroundColor:r}});default:/* @__PURE__ */
|
|
8
|
-
return n("span",{className:`${a} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:r}})}}function d({entries:e,interactive:r,fallbackSwatch:t,onClick:l}){const{highlighted:d,setHighlighted:u}=a();/* @__PURE__ */
|
|
9
|
-
return n("ul",{className:"m-0 flex flex-wrap items-center gap-x-4 gap-y-1 p-0",children:e.map((e,a)=>{const h=r&&null!==d&&d!==e.key,m=/* @__PURE__ */o(c,{children:[
|
|
10
|
-
/* @__PURE__ */n(i,{shape:e.swatch??t,colour:s(a,e.color,e.tone)}),e.label]});/* @__PURE__ */
|
|
11
|
-
return n("li",{className:"list-none",children:r||l?/* @__PURE__ */n("button",{type:"button",onClick:l?()=>l(e.key):void 0,"aria-pressed":l?Boolean(e.pressed):void 0,onMouseEnter:r?()=>u(e.key):void 0,onMouseLeave:r?()=>u(null):void 0,onFocus:r?()=>u(e.key):void 0,onBlur:r?()=>u(null):void 0,className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(h?"opacity-40":""),children:m}):/* @__PURE__ */n("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:m})},e.key)})})}function u({title:a,subtitle:s,legend:c,table:i,tableLabel:u,busy:h=!1,loading:m=!1,skeletonVariant:p="area",skeletonHeight:b,interactiveLegend:g=!0,legendSwatch:y="rounded-square",onLegendClick:f,actions:k,children:N,className:x}){const w=l().charts;/* @__PURE__ */
|
|
12
|
-
return n(r,{children:/* @__PURE__ */o("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${x??""}`,"aria-busy":h||m||void 0,children:[
|
|
13
|
-
/* @__PURE__ */o("header",{className:"flex items-start justify-between gap-4",children:[
|
|
14
|
-
/* @__PURE__ */o("div",{className:"min-w-0",children:[
|
|
15
|
-
/* @__PURE__ */n("h3",{className:"text-base font-semibold text-ink-strongest",children:a}),s&&/* @__PURE__ */n("p",{className:"mt-0.5 text-sm text-gray-500",children:s})]}),k&&/* @__PURE__ */n("div",{className:"shrink-0",children:k})]}),m?/* @__PURE__ */n(e,{variant:p,height:b}):/* @__PURE__ */n("div",{className:h?"opacity-60 transition-opacity":"transition-opacity",children:N}),!m&&c&&c.length>1&&/* @__PURE__ */n(d,{entries:c,interactive:g,fallbackSwatch:y,onClick:f}),!m&&i&&/* @__PURE__ */o("details",{className:"border-t border-gray-100 pt-3",children:[
|
|
16
|
-
/* @__PURE__ */n("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:u??w.showTable}),
|
|
17
|
-
/* @__PURE__ */n("div",{className:"mt-3 overflow-x-auto",style:{color:t.label},children:i})]})]})})}export{u as ChartFrame};
|
package/dist/chunk-FQD6P6EZ.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as i,usePopupLevel as t,usePopupLevelBindings as a,windowScrimStyle as o,OverlayLayerProvider as l,scrimHasCorners as n,popupLayerStyle as s}from"./chunk-RIG5FEVS.js";import{useDiscardGuard as d}from"./chunk-JR2HHKVP.js";import{dialogA11y as c}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as m}from"./chunk-7QSDPSXP.js";import{useFocusTrap as u,useScrollLock as p}from"./chunk-DWGYC7OD.js";import{Icon as f}from"./chunk-ISVODSRP.js";import{useHydrated as h}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as v}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-IUVGHHR3.js";import{useRef as b,useId as y,useState as g,useEffect as k}from"react";import{createPortal as w}from"react-dom";import{jsxs as j,Fragment as N,jsx as $}from"react/jsx-runtime";var C="bg-black/30 backdrop-blur-sm",D={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl"};function V({open:V,onClose:H,title:S,description:W,role:G="dialog",children:I,footer:P,blocking:R=!1,size:U="md",aside:T=!1,dirty:E=!1,initialFocus:F,"aria-label":J,"aria-labelledby":O,"aria-describedby":Q,className:Y=""}){const z=b(null),A=y(),B=y(),K=!R,L=y(),X=x().dialog,Z=e(h()),[q,M]=g(null),_=d({open:V,dirty:E,onClose:H,title:S,layer:q}),ee=b(null),re=r(V&&null!==Z,ee),ie=i(re,z),te=t(V&&null!==Z,ee),ae=a(te,q),oe=o(te),le=null!==te.host;if(m(V),u(z,V&&null!==Z,F,ae),p(V),k(()=>{if(V)return v(()=>!ae.current?.(document.activeElement)&&(R||_(),!0),()=>z.current)},[V,R,_,ae]),!V||!Z)return null;/* @__PURE__ */
|
|
2
|
-
return j(N,{children:[/* @__PURE__ */$("span",{ref:ee,hidden:!0,"data-popup-anchor":""}),w(
|
|
3
|
-
/* @__PURE__ */$(l,{value:q,children:/* @__PURE__ */j("div",{ref:M,className:"fixed inset-0"+(T?" pointer-events-none opacity-0":le?" pointer-events-none":""),style:s(te),role:"presentation","data-overlay-layer":"","data-aside":T?"":void 0,children:[!le&&/* @__PURE__ */$("div",{className:`fixed inset-0 ${C}`,"aria-hidden":"true","data-popup-scrim":"system"}),oe&&/* @__PURE__ */$("div",{className:`fixed ${C}${T?"":" pointer-events-auto"}${n(te)?" rounded-(--radius-window)":""}`,style:oe,onClick:R?void 0:_,"aria-hidden":"true","data-popup-scrim":"window"}),
|
|
4
|
-
/* @__PURE__ */$("div",{className:re?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:R||le?void 0:e=>{e.target===e.currentTarget&&_()},children:/* @__PURE__ */j("div",{ref:z,"data-popup-panel":"",style:re?{left:ie?.left??0,top:ie?.top??0,visibility:ie?void 0:"hidden"}:void 0,...c({role:G,modal:!0,titleId:S?L:void 0,labelledBy:O,label:J}),"aria-describedby":Q??(W?B:I?A:void 0),className:`${re?"absolute max-h-[calc(100%-2rem)] w-[calc(100%-2rem)]":"relative max-h-full w-full"} ${D[U]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl${le&&!T?" pointer-events-auto":""} ${Y}`.trim(),children:[S&&/* @__PURE__ */$("h2",{id:L,className:(K?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:S}),W&&/* @__PURE__ */$("p",{id:B,className:((S?"mt-1":K?"pr-8":"")+" text-sm text-gray-500").trim(),children:W}),I&&/* @__PURE__ */$("div",{id:A,className:"mt-2 text-sm text-gray-600",children:I}),P&&/* @__PURE__ */$("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:P}),K&&/* @__PURE__ */$("button",{type:"button",onClick:_,"aria-label":X.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__ */$(f,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]})}),Z)]})}export{V as Dialog};
|
package/dist/chunk-IQDHVQAQ.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{readStoredWidth as e,ResizeHandle as l}from"./chunk-LXPDURUL.js";import{SidebarBarContext as r,SidebarSheetContext as t}from"./chunk-QWK6DRSN.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-IUVGHHR3.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:r,sidebarTop:t,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:D=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:P="bg-white"}){const R="right"===m,j=i().sidebar,z=a(),C=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[I,O]=o(()=>(x?e(x,w,k):null)??b(N,w,k),b(N,w,k)),W=null!=t||null!=n,S=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:I},children:[
|
|
2
|
-
/* @__PURE__ */f("div",{className:`flex h-full flex-col ${W?"overflow-hidden":"overflow-y-auto"} ${D}`,children:[null!=t&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:t}),W?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:r}):r,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
|
|
3
|
-
/* @__PURE__ */p(l,{side:m,width:I,onResize:O,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:j.resize})]}),E=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${P}`,children:u});/* @__PURE__ */
|
|
4
|
-
return f("div",z?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
|
|
5
|
-
/* @__PURE__ */p(g,{phone:C,top:t,fallback:j.sections}),E,
|
|
6
|
-
/* @__PURE__ */p(v,{phone:C,bottom:n,label:j.sections,closeLabel:j.closeSections,children:r})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[R?null:S,E,R?S:null]})}function g({phone:e,top:l,fallback:t}){const a=e.current();/* @__PURE__ */
|
|
7
|
-
return f("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
|
|
8
|
-
/* @__PURE__ */f("button",{ref:e.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":e.open,onClick:()=>e.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
|
|
9
|
-
/* @__PURE__ */p("span",{className:"min-w-0 truncate",children:0===a.length?t:a.map((e,l)=>/* @__PURE__ */f(u,{children:[l>0&&" · ",e]},l))}),
|
|
10
|
-
/* @__PURE__ */p(n,{name:"chevron-down",className:"size-4 shrink-0",strokeWidth:2,"aria-hidden":"true"})]}),null!=l&&/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */p("div",{className:"flex min-w-0 max-w-[60%] shrink-0 items-center gap-2",children:l})})]})}function v({phone:e,bottom:l,label:r,closeLabel:a,children:n}){const o=c(null),{open:i,setOpen:s,trigger:d}=e,h=()=>{s(!1),o.current?.contains(document.activeElement)&&d.current?.focus()};return m(()=>{i&&o.current?.focus()},[i]),
|
|
11
|
-
/* @__PURE__ */f(t.Provider,{value:e.api,children:[i&&/* @__PURE__ */p("button",{type:"button","aria-label":a,onClick:h,className:"absolute inset-0 z-(--z-in-box) cursor-default bg-gray-900/40"}),
|
|
12
|
-
/* @__PURE__ */f("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":r,tabIndex:-1,"data-sidebar-section-sheet":!0,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),h())},onClick:e=>{const l=e.target.closest("button, a");!l||l.hasAttribute("aria-expanded")||l.closest("[data-sheet-keep-open]")||h()},className:(i?"flex":"hidden")+" absolute inset-x-0 bottom-0 z-(--z-in-box) max-h-[75%] flex-col rounded-t-2xl bg-white pt-2 shadow-(--elevation-dialog)",children:[
|
|
13
|
-
/* @__PURE__ */p("div",{className:"mx-auto mb-2 h-1 w-9 shrink-0 rounded-full bg-gray-300","aria-hidden":"true"}),
|
|
14
|
-
/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 pb-3",children:n}),null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:l})]})]})}export{x as SidebarLayout};
|
package/dist/chunk-JGKDWDVM.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import{Dialog as e}from"./chunk-FQD6P6EZ.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{buttonClasses as r}from"./chunk-UQYNPYF4.js";import{useShellStrings as n,splitAround as o}from"./chunk-IUVGHHR3.js";import{createContext as l,useContext as i,useState as s,useRef as a,useCallback as c,useEffect as u}from"react";import{jsxs as d,jsx as m,Fragment as h}from"react/jsx-runtime";var f=l(()=>Promise.resolve(!1)),b=()=>i(f),g=()=>Promise.resolve(!1),p=e=>g(e),v=()=>Promise.resolve(!1),y=e=>v(e),x=()=>Promise.resolve(null),N=e=>x(e),k={danger:{icon:"text-red-600 bg-red-100",button:r({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:r({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:r({variant:"primary"})}},w=r({variant:"secondary"}),C=r({variant:"primary"}),P="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function L(){/* @__PURE__ */
|
|
2
|
-
return m(t,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function j(){/* @__PURE__ */
|
|
3
|
-
return m(t,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F({children:t}){const[r,l]=s(!1),[i,b]=s({message:""}),[p,y]=s(0),N=a(),F=a(null),E=a(0),D=a([]),T=a(null),$=a(null),V=c(e=>{F.current=e.id,N.current=e.resolve,y(e.id),b(e.options),l(!0)},[]),W=c(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const r={id:++E.current,options:t,resolve:e};null===F.current?V(r):D.current.push(r)})},[V]),[H,I]=s(!1),[K,Q]=s({message:""}),[R,S]=s(""),U=a(),Y=c(e=>(Q(e),S(""),I(!0),new Promise(e=>{U.current=e})),[]),[G,O]=s(!1),[Z,q]=s({}),[z,A]=s(""),B=a(),J=c(e=>{const t="string"==typeof e?{message:e}:e;return q(t),A(t.defaultValue??""),O(!0),new Promise(e=>{B.current=e})},[]);u(()=>{g=W,v=Y,x=J},[W,Y,J]);const M=(e,t)=>{if(F.current!==e)return;const r=N.current,n=D.current.shift();n?V(n):(F.current=null,N.current=void 0,l(!1)),r?.(t)},X=e=>{I(!1),S(""),U.current?.(e)},_=e=>{if(e){const e=z.trim();if(!e&&!Z.allowEmpty)return O(!1),void B.current?.(null);O(!1),B.current?.(e)}else O(!1),B.current?.(null)},ee=i.variant||(i.confirmLabel?.toLowerCase().includes("delete")||i.message.toLowerCase().includes("delete")?"danger":"info"),te=k[ee],re=k["warning"===K.variant?"warning":"danger"],ne=K.confirmWord,oe=null==ne||R===ne,le=n().dialog,[ie,se]=o(le.typeToConfirm);/* @__PURE__ */
|
|
4
|
-
return d(f.Provider,{value:W,children:[t,
|
|
5
|
-
/* @__PURE__ */m(e,{open:r,onClose:()=>M(p,!1),initialFocus:T,footer:/* @__PURE__ */d(h,{children:[
|
|
6
|
-
/* @__PURE__ */m("button",{ref:T,type:"button",onClick:()=>M(p,!1),className:w,children:i.cancelLabel||le.cancel}),
|
|
7
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>M(p,!0),className:te.button,children:i.confirmLabel||le.ok})]}),children:/* @__PURE__ */d("div",{className:"flex gap-4",children:[
|
|
8
|
-
/* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */m(L,{})}),
|
|
9
|
-
/* @__PURE__ */d("div",{className:"flex-1",children:[
|
|
10
|
-
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900",children:i.title||le.confirmTitle}),
|
|
11
|
-
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:i.message})]})]})}),
|
|
12
|
-
/* @__PURE__ */d(e,{open:H,onClose:()=>X(!1),initialFocus:null!=ne?void 0:$,footer:/* @__PURE__ */d(h,{children:[
|
|
13
|
-
/* @__PURE__ */m("button",{ref:$,type:"button",onClick:()=>X(!1),className:w,children:K.cancelLabel||le.destructiveCancel}),
|
|
14
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>X(!0),disabled:!oe,className:re.button,children:ne??K.confirmLabel??le.destructiveConfirm})]}),children:[
|
|
15
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>X(!1),"aria-label":le.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */m(j,{})}),
|
|
16
|
-
/* @__PURE__ */d("div",{className:"flex gap-4",children:[
|
|
17
|
-
/* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */m(L,{})}),
|
|
18
|
-
/* @__PURE__ */d("div",{className:"flex-1",children:[
|
|
19
|
-
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:K.title||le.destructiveTitle}),
|
|
20
|
-
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:K.message}),null!=ne&&/* @__PURE__ */d(h,{children:[
|
|
21
|
-
/* @__PURE__ */d("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
|
|
22
|
-
/* @__PURE__ */m("kbd",{className:"rounded border border-line-strong bg-surface-sunken px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:ne}),se]}),
|
|
23
|
-
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:R,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"===e.key&&R===ne&&X(!0)},placeholder:ne,className:`mt-2 ${P} focus:border-red-500`})]})]})]})]}),
|
|
24
|
-
/* @__PURE__ */d(e,{open:G,onClose:()=>_(!1),title:Z.title||le.promptTitle,footer:/* @__PURE__ */d(h,{children:[
|
|
25
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:Z.cancelLabel||le.cancel}),
|
|
26
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!Z.allowEmpty&&!z.trim(),className:C,children:Z.confirmLabel||le.ok})]}),children:[Z.message&&/* @__PURE__ */m("p",{className:"text-sm text-gray-600",children:Z.message}),
|
|
27
|
-
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:z,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:Z.placeholder,className:`mt-3 ${P} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{F as ConfirmProvider,p as confirm,y as confirmDestructive,N as prompt,b as useConfirm};
|
package/dist/chunk-KY3KGRGC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r="13.14.0",a=r;export{a as APP_VERSION,r as VERSION};
|
package/dist/chunk-RIG5FEVS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getActiveModalId as t}from"./chunk-F3ZOO23R.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{createContext as i,useContext as o,useRef as r,useState as u}from"react";var l=i(void 0),d=l.Provider;function s(t){const e=o(l);return t?void 0===e?document.body:e:null}function h(t,e){if("undefined"==typeof Element||!(t instanceof Element))return!1;const n=t.closest("[data-overlay-layer]");return null!==n&&!e?.contains(n)}var c="[data-modal-panel], [data-popup-panel]";function f(t,e){const n=Math.max(0,t.left),i=Math.max(0,t.top),o=Math.min(e.width,t.left+t.width),r=Math.min(e.height,t.top+t.height);return o-n<1||r-i<1?null:{left:n,top:i,width:o-n,height:r-i}}function a(t,e,n){return n<e?e:Math.min(Math.max(t,e),n)}function w(){return{width:window.innerWidth,height:window.innerHeight}}function v(t,e){const i=r(null),o=r(!1);t&&!o.current&&(i.current="undefined"==typeof document?null:document.activeElement),o.current=t;const[l,d]=u(null);return n(()=>{if(!t)return void d(null);const n=(o=e.current,r=i.current,o?.parentElement?.closest(c)??r?.closest(c)??null);var o,r;if(!n)return void d(null);const u=()=>{const t=n.getBoundingClientRect(),e=w(),i=f({left:t.left,top:t.top,width:t.width,height:t.height},e),o=null!==i&&i.width>=e.width-1&&i.height>=e.height-1;d(t=>{const e=o?null:i;return t===e||t&&e&&t.left===e.left&&t.top===e.top&&t.width===e.width&&t.height===e.height?t:e})};u(),window.addEventListener("resize",u);const l="undefined"==typeof ResizeObserver?null:new ResizeObserver(u);return l?.observe(n),()=>{window.removeEventListener("resize",u),l?.disconnect()}},[t,e]),l}function p(t,e){const[i,o]=u(null);return n(()=>{const n=e.current;if(!t||!n)return void o(null);const i=()=>{const e=function(t,e,n,i=16){return{left:a(t.left+t.width/2-e.width/2,i,n.width-i-e.width),top:a(t.top+t.height/2-e.height/2,i,n.height-i-e.height)}}(t,{width:n.offsetWidth,height:n.offsetHeight},w());o(t=>t&&t.left===e.left&&t.top===e.top?t:e)};i(),window.addEventListener("resize",i);const r="undefined"==typeof ResizeObserver?null:new ResizeObserver(i);return r?.observe(n),()=>{window.removeEventListener("resize",i),r?.disconnect()}},[t,e]),i}var b=/* @__PURE__ */new WeakMap;function m(t){if(!t)return null;const e=t.closest("[data-overlay-layer]");return e?b.get(e)??null:t.closest("[data-modal-panel]")}var g={host:null,box:null,z:0,hidden:!1};function x(t,e){const i=r(null),o=r(!1);t&&!o.current&&(i.current="undefined"==typeof document?null:document.activeElement),o.current=t;const[l,d]=u(g);return n(()=>{if(!t)return void d(g);const n=(o=e.current,r=i.current,m(o?.parentElement)??m(r));var o,r;if(!n)return void d(g);const u=()=>{const t=n.getBoundingClientRect(),e=getComputedStyle(n),i=f({left:t.left,top:t.top,width:t.width,height:t.height},{width:window.innerWidth,height:window.innerHeight}),o=Number.parseInt(e.zIndex,10),r={host:n,box:i,z:Number.isFinite(o)?o:0,hidden:null===i||"none"===e.display||"hidden"===e.visibility};d(t=>{return n=r,(e=t).host===n.host&&e.z===n.z&&e.hidden===n.hidden&&(e.box===n.box||null!==e.box&&null!==n.box&&e.box.left===n.box.left&&e.box.top===n.box.top&&e.box.width===n.box.width&&e.box.height===n.box.height)?t:r;var e,n})};u(),window.addEventListener("resize",u);const l="undefined"==typeof ResizeObserver?null:new ResizeObserver(u);l?.observe(n);const s="undefined"==typeof MutationObserver?null:new MutationObserver(u);return s?.observe(n,{attributes:!0,attributeFilter:["style","class"]}),()=>{window.removeEventListener("resize",u),l?.disconnect(),s?.disconnect()}},[t,e]),l}function z(e,n){const i=r(null);return i.current=i=>function(t,e,n,i){const o=t.host;if(!o)return!1;if(n&&e?.contains(n))return!1;const r=o.getAttribute("data-modal-id");if(i&&r&&i!==r)return!0;const u=m(n);return null!==u&&u!==o&&!o.contains(u)}(e,n,i,t()),n&&function(t,e){b.set(t,e)}(n,e.host),i}function y(t){return t.host?{zIndex:t.z+1,...t.hidden?{visibility:"hidden"}:{}}:{zIndex:e.overlay}}function E(t){if(!t.host||!t.box)return null;const{left:e,top:n,width:i,height:o}=t.box;return{left:e,top:n,width:i,height:o}}function O(t){return null!==t.host&&!t.host.hasAttribute("data-window-tab")}export{d as OverlayLayerProvider,h as isInOverlayOver,y as popupLayerStyle,O as scrimHasCorners,s as useOverlayTarget,p as usePanelPosition,v as usePopupAnchor,x as usePopupLevel,z as usePopupLevelBindings,E as windowScrimStyle};
|
package/dist/chunk-XSHDPG45.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{useOverlayTarget as e,usePopupAnchor as t,usePopupLevel as r,usePopupLevelBindings as i,windowScrimStyle as o,OverlayLayerProvider as n,scrimHasCorners as l,popupLayerStyle as s}from"./chunk-RIG5FEVS.js";import{useDiscardGuard as a}from"./chunk-JR2HHKVP.js";import{dialogA11y as d}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as c}from"./chunk-7QSDPSXP.js";import{useFocusTrap as m,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{Icon as u}from"./chunk-ISVODSRP.js";import{useHydrated as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as b}from"./chunk-IUVGHHR3.js";import{useRef as g,useId as x,useState as y,useEffect as v}from"react";import{createPortal as w}from"react-dom";import{jsxs as k,Fragment as N,jsx as j}from"react/jsx-runtime";var C={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},H={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function D(e,t){const r=window.innerHeight-(t.top+t.height);if("bottom"===e)return{left:t.left,width:t.width,bottom:r};const i={top:t.top,height:t.height};return"left"===e?{...i,left:t.left}:{...i,right:window.innerWidth-(t.left+t.width)}}function V({onClose:e}){const t=b().dialog;/* @__PURE__ */
|
|
2
|
-
return j("button",{type:"button",onClick:e,"aria-label":t.close,className:"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__ */j(u,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function W({open:u,onClose:b,side:W="right",size:S="md",title:G,description:I,footer:P,children:R,blocking:U=!1,dirty:z=!1,initialFocus:B,"aria-label":E,"aria-labelledby":F,"aria-describedby":J,className:O=""}){const Q=g(null),T=x(),Y=x(),A=x(),K=e(p()),[L,X]=y(null),Z=a({open:u,dirty:z,onClose:b,title:G,layer:L}),$=g(null),q=t(u&&null!==K,$),M=r(u&&null!==K,$),_=i(M,L),ee=o(M),te=null!==M.host;if(c(u),m(Q,u&&null!==K,B,_),h(u),v(()=>{if(u)return f(()=>!_.current?.(document.activeElement)&&(U||Z(),!0),()=>Q.current)},[u,U,Z,_]),!u||!K)return null;const re="bottom"===W,ie={...re?{maxHeight:"85vh"}:{},...q?D(W,q):{}};/* @__PURE__ */
|
|
3
|
-
return k(N,{children:[/* @__PURE__ */j("span",{ref:$,hidden:!0,"data-popup-anchor":""}),w(
|
|
4
|
-
/* @__PURE__ */j(n,{value:L,children:/* @__PURE__ */k("div",{ref:X,className:te?"fixed inset-0 pointer-events-none":"fixed inset-0",style:s(M),role:"presentation","data-overlay-layer":"",children:[
|
|
5
|
-
/* @__PURE__ */j("div",{className:"fixed bg-black/30 backdrop-blur-sm "+(te?"pointer-events-auto"+(l(M)?" rounded-(--radius-window)":""):"inset-0"),style:ee??void 0,hidden:te&&!ee,onClick:U?void 0:Z,"aria-hidden":"true","data-popup-scrim":te?"window":"system"}),
|
|
6
|
-
/* @__PURE__ */k("div",{ref:Q,...d({modal:!0,titleId:G?A:void 0,labelledBy:F,label:E}),"aria-describedby":J??(I?Y:R?T:void 0),"data-drawer-side":W,"data-popup-panel":"",style:ie,className:["fixed flex flex-col bg-white shadow-xl",te?"pointer-events-auto":"",re?"":`w-full max-w-full ${C[S]}`,q?"":H[W],re?"rounded-t-xl":"",O].filter(Boolean).join(" "),children:[G?/* @__PURE__ */k("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
7
|
-
/* @__PURE__ */k("div",{className:"min-w-0",children:[
|
|
8
|
-
/* @__PURE__ */j("h2",{id:A,className:"text-base font-semibold text-gray-900",children:G}),I&&/* @__PURE__ */j("p",{id:Y,className:"mt-0.5 text-sm text-gray-500",children:I})]}),!U&&/* @__PURE__ */j(V,{onClose:Z})]}):!U&&/* @__PURE__ */j("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */j(V,{onClose:Z})}),
|
|
9
|
-
/* @__PURE__ */k("div",{id:T,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[I&&!G&&/* @__PURE__ */j("p",{id:Y,className:("mb-3 text-sm text-gray-500 "+(U?"":"pr-8")).trim(),children:I}),R]}),P&&/* @__PURE__ */j("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:P})]})]})}),K)]})}export{W as Drawer};
|
|
File without changes
|