efficient-shell 8.16.1 → 8.17.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 +20 -1
- package/dist/{Browser-QBOH7J6X.js → Browser-GZXTAL7Z.js} +14 -14
- package/dist/Calculator-TYZWIYJW.js +29 -0
- package/dist/{CurrencyConverter-QTFV2RSB.js → CurrencyConverter-XK6SETYS.js} +6 -6
- package/dist/{Documents-7TUZDRPO.js → Documents-GXYD4UD2.js} +7 -7
- package/dist/{Files-4KRJX4CJ.js → Files-OYZXQMRA.js} +18 -18
- package/dist/{Notepad-GBSYEVOZ.js → Notepad-L4TKPWZ7.js} +10 -10
- package/dist/{PomodoroTimer-23O2CBIZ.js → PomodoroTimer-D37Y6TE7.js} +23 -23
- package/dist/{Preview-WEWO3FSN.js → Preview-MPDXIVGC.js} +21 -21
- package/dist/{Sidebar-NONBFVWE.js → Sidebar-F4LYK5XP.js} +34 -34
- package/dist/{Spreadsheet-SDDJ3EBT.js → Spreadsheet-JBPWIBDY.js} +13 -13
- package/dist/{Stock-AQ2SJRU6.js → Stock-ZUTJX6S6.js} +3 -3
- package/dist/{Weather-UHCDMFZE.js → Weather-4GPPPHK5.js} +18 -18
- package/dist/{WorldClock-TB3HCUIH.js → WorldClock-TW36BP7G.js} +6 -6
- package/dist/ai/index.js +15 -15
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/chunk-2LXTJXWC.js +6 -0
- package/dist/{chunk-MNWYPP3F.js → chunk-2OTCFJCU.js} +1 -1
- package/dist/{chunk-I7GWKMYO.js → chunk-35DHYR37.js} +1 -1
- package/dist/chunk-3S52QOEP.js +20 -0
- package/dist/{chunk-J77ZVPF5.js → chunk-4EIGXW4U.js} +5 -5
- package/dist/{chunk-ELVFPH7Y.js → chunk-4G5M752L.js} +3 -3
- package/dist/{chunk-ABJ4LWOW.js → chunk-4TL3MRRE.js} +1 -1
- package/dist/{chunk-L42Q6GVA.js → chunk-5BLAPU7W.js} +1 -1
- package/dist/{chunk-BOGBLZKS.js → chunk-5SULG7D5.js} +1 -1
- package/dist/{chunk-H3XEO4LR.js → chunk-62LFDQGF.js} +6 -6
- package/dist/chunk-65HOBHY7.js +3 -0
- package/dist/{chunk-7JKFXRAR.js → chunk-6AKXEUZA.js} +5 -5
- package/dist/{chunk-UOOHE3FX.js → chunk-6EJ7G234.js} +7 -7
- package/dist/{chunk-DYSUTUH3.js → chunk-6TWRV44R.js} +11 -11
- package/dist/{chunk-EK3JM3J2.js → chunk-7KZ65FSA.js} +1 -1
- package/dist/{chunk-QMQVOUIV.js → chunk-7T3COEQK.js} +1 -1
- package/dist/{chunk-JZ7NBWGB.js → chunk-7UBV5MPQ.js} +1 -1
- package/dist/{chunk-7HPOALEV.js → chunk-AGPQEI3I.js} +7 -7
- package/dist/{chunk-6L7MMUMP.js → chunk-B3LWYJS7.js} +2 -2
- package/dist/{chunk-DKY6X24V.js → chunk-BMBQ3IX3.js} +1 -1
- package/dist/{chunk-HPW6QAAY.js → chunk-C6LV3HJW.js} +1 -1
- package/dist/{chunk-JGZWAEOJ.js → chunk-CD6PGAYP.js} +1 -1
- package/dist/{chunk-BF2G42QU.js → chunk-CHNYSP6K.js} +1 -1
- package/dist/{chunk-H62JMI7C.js → chunk-DVFMCVI5.js} +2 -2
- package/dist/{chunk-UAXP4A2A.js → chunk-E4YSP5RD.js} +2 -2
- package/dist/{chunk-7OC3L4VZ.js → chunk-EIUCHQI2.js} +1 -1
- package/dist/{chunk-EXU3ZXKB.js → chunk-EKFIRCNP.js} +8 -8
- package/dist/{chunk-LKSHI57C.js → chunk-EPGKTANF.js} +6 -6
- package/dist/{chunk-EZQXLIG3.js → chunk-FARRGETL.js} +1 -1
- package/dist/{chunk-ZSTBFMQE.js → chunk-GATOVTJT.js} +1 -1
- package/dist/chunk-GLCKZI3N.js +1 -0
- package/dist/chunk-GLUJS42B.js +1 -0
- package/dist/{chunk-7OLYHD4V.js → chunk-HEJTHEXN.js} +1 -1
- package/dist/{chunk-55IY2ZJY.js → chunk-HEM6NC23.js} +1 -1
- package/dist/chunk-HMZLRXLA.js +1 -0
- package/dist/{chunk-VX4OBI4U.js → chunk-HPQ56MKK.js} +1 -1
- package/dist/{chunk-4CXQX5AX.js → chunk-IH2DJOTW.js} +22 -22
- package/dist/{chunk-NRWIULLI.js → chunk-ION2GBY3.js} +13 -13
- package/dist/{chunk-LRM5XTDF.js → chunk-JHXYW542.js} +3 -3
- package/dist/{chunk-53XMYVJO.js → chunk-JIJOXLDJ.js} +1 -1
- package/dist/{chunk-4MHHPESC.js → chunk-KBHC4VLA.js} +1 -1
- package/dist/{chunk-2HLS7AGL.js → chunk-KIGGG3LT.js} +1 -1
- package/dist/{chunk-YL44UDNT.js → chunk-KLAZTKN2.js} +5 -5
- package/dist/{chunk-UONWIAII.js → chunk-KSYNJTVA.js} +20 -20
- package/dist/{chunk-5J6Y5TOO.js → chunk-LC52BB6N.js} +1 -1
- package/dist/{chunk-CQXV3SJA.js → chunk-LI7D6SMK.js} +1 -1
- package/dist/{chunk-2KOXALIK.js → chunk-LJSJFS2M.js} +11 -11
- package/dist/{chunk-VR5GVM3A.js → chunk-MV7WC6SL.js} +28 -28
- package/dist/{chunk-L6CG37L3.js → chunk-OHHJF547.js} +1 -1
- package/dist/{chunk-5K3QLWUX.js → chunk-OS57C5J7.js} +1 -1
- package/dist/{chunk-DSBLBBES.js → chunk-OU3ITBK5.js} +6 -6
- package/dist/{chunk-G34KXE2L.js → chunk-PEELLEPP.js} +6 -6
- package/dist/{chunk-BKWLFZHI.js → chunk-PK4ZY4GZ.js} +3 -3
- package/dist/{chunk-XSY22PWH.js → chunk-PRR2GXBV.js} +2 -2
- package/dist/{chunk-C4YTKSXY.js → chunk-PRXPLEVZ.js} +1 -1
- package/dist/{chunk-U6FORQTI.js → chunk-PSOHSTXL.js} +1 -1
- package/dist/{chunk-ZKRWJILC.js → chunk-QIEMOYTG.js} +1 -1
- package/dist/chunk-QP2S2K2Y.js +4 -0
- package/dist/{chunk-2LTB2DSA.js → chunk-QV2GME3Y.js} +6 -6
- package/dist/{chunk-WCAQWHFD.js → chunk-R6N26ITY.js} +5 -5
- package/dist/{chunk-MSCILVJB.js → chunk-R6XC7X63.js} +6 -6
- package/dist/{chunk-37S3WLBL.js → chunk-RECXXFYW.js} +8 -8
- package/dist/chunk-RKWGWBET.js +9 -0
- package/dist/chunk-RNBM5JZI.js +4 -0
- package/dist/{chunk-JF45HC5H.js → chunk-RQARJHDB.js} +1 -1
- package/dist/{chunk-B7IHOBK6.js → chunk-S2ONNZVX.js} +14 -14
- package/dist/{chunk-CXDJXNPZ.js → chunk-S3RTAWEU.js} +1 -1
- package/dist/chunk-SEFPZXO5.js +8 -0
- package/dist/{chunk-FDIJEOGV.js → chunk-SWSN3HZX.js} +2 -2
- package/dist/{chunk-Y5W6POQE.js → chunk-T2VNNW6Z.js} +6 -6
- package/dist/{chunk-7QLI3HAO.js → chunk-T6L6HQI5.js} +1 -1
- package/dist/{chunk-FEAOJLGA.js → chunk-TB3AK6XF.js} +2 -2
- package/dist/{chunk-3YNRFMIN.js → chunk-TLJCUUZU.js} +1 -1
- package/dist/{chunk-FSP63GKK.js → chunk-UDD7GB4F.js} +2 -2
- package/dist/{chunk-OSRLZZDO.js → chunk-WKSVUJZA.js} +3 -3
- package/dist/{chunk-C2FBUQJW.js → chunk-X3II54HU.js} +1 -1
- package/dist/chunk-Y4NIZQNT.js +8 -0
- package/dist/{chunk-2TPUNCT7.js → chunk-YO52QEKT.js} +8 -8
- package/dist/chunk-YYUICWSB.js +12 -0
- package/dist/{chunk-U5PXB4UW.js → chunk-ZOGEAYWJ.js} +5 -5
- package/dist/{client-DLm3Fvbc.d.ts → client-DZeDEyG1.d.ts} +30 -9
- package/dist/data/DataTable.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/dropdownPosition.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +87 -87
- package/dist/map/index.js +6 -6
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/telemetry/index.d.ts +2 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-KKB7EFVO.js +0 -29
- package/dist/chunk-3WV3CMSU.js +0 -1
- package/dist/chunk-7NEIYFM2.js +0 -8
- package/dist/chunk-DXQCNU5I.js +0 -12
- package/dist/chunk-EKHT4PDR.js +0 -4
- package/dist/chunk-FND3BDOO.js +0 -4
- package/dist/chunk-JHDWTYZ4.js +0 -1
- package/dist/chunk-JXOBORLD.js +0 -3
- package/dist/chunk-L3VD25XR.js +0 -8
- package/dist/chunk-OJ3RN3BG.js +0 -20
- package/dist/chunk-T53TXXOC.js +0 -1
- package/dist/chunk-Z3WKHMVB.js +0 -6
- package/dist/chunk-Z5UVBCEE.js +0 -9
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-MNWYPP3F.js";import{useWidgetSettings as n}from"./chunk-VR5GVM3A.js";import"./chunk-TPDOOCFS.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-LR2X6MKB.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-JF45HC5H.js";import"./chunk-5GHLKEJQ.js";import"./chunk-LT2MMSHH.js";import"./chunk-ARC3R4I2.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-KC3EX26K.js";import"./chunk-7IF3RZF3.js";import"./chunk-GZCAFWWB.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-BOGBLZKS.js";import"./chunk-CDAJKLGL.js";import"./chunk-QMQVOUIV.js";import"./chunk-FSP63GKK.js";import"./chunk-K7U4RWXJ.js";import"./chunk-ABJ4LWOW.js";import{Icon as r}from"./chunk-VJPJNCB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-Z3WKHMVB.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-T53TXXOC.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-OVNRVFWS.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as l,useEffect as o}from"react";import{jsxs as s,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[b,g]=c(null),[N,j]=c(!1),[y,x]=c(""),[C,f]=c([]),[v,$]=c(!1),[W,R]=c(()=>e(h)),[T,J]=c(!1),[K,M]=c(W),w=i(null);n(l(()=>{M({...W}),J(!0)},[W]));const E=l(e=>{x(""),k(t=>N||"0"===t?(j(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[N]),F=l(()=>{k("0"),d(null),g(null),j(!1)},[]),S=l((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),V=l(e=>{const t=parseFloat(m);if(null!==p&&b&&!N){const e=S(p,t,b);k(String(e)),d(e),f(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),j(!0)},[m,p,b,N,S]),A=l(()=>{if(null===p||!b)return;const e=parseFloat(m),t=S(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),x(n),k(String(t)),d(null),g(null),j(!0)},[m,p,b,S]),B=l(()=>{k(e=>String(parseFloat(e)/100))},[]),L=l(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);o(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?E(e.key):"."===e.key?E("."):"+"===e.key?V("+"):"-"===e.key?V("-"):"*"===e.key?V("×"):"/"===e.key?(e.preventDefault(),V("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&w.current?.contains(e.target)&&e.preventDefault(),A()):"Escape"===e.key?F():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&B())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[E,V,A,F,B]);const O="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",G=`${O} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,D=`${O} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,Q=`${O} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,H=`${O} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
|
|
2
|
-
return s(a,{children:[
|
|
3
|
-
/* @__PURE__ */s("div",{ref:w,className:"flex flex-col h-full",style:{opacity:W.activeOpacity/100,backdropFilter:W.activeBlur>0?`blur(${W.activeBlur}px)`:void 0},children:[
|
|
4
|
-
/* @__PURE__ */s("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
|
|
5
|
-
/* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:C.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(y||b&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:y||`${p} ${b} ${N?"":m}`}),
|
|
6
|
-
/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[
|
|
7
|
-
/* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
|
|
8
|
-
/* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(m)})]})]}),
|
|
9
|
-
/* @__PURE__ */s("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
|
|
10
|
-
/* @__PURE__ */u("button",{onClick:F,className:Q,children:"AC"}),
|
|
11
|
-
/* @__PURE__ */u("button",{onClick:L,className:Q,children:"+/−"}),
|
|
12
|
-
/* @__PURE__ */u("button",{onClick:B,className:Q,children:"%"}),
|
|
13
|
-
/* @__PURE__ */u("button",{onClick:()=>V("÷"),className:`${D} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
|
|
14
|
-
/* @__PURE__ */u("button",{onClick:()=>E("7"),className:G,children:"7"}),
|
|
15
|
-
/* @__PURE__ */u("button",{onClick:()=>E("8"),className:G,children:"8"}),
|
|
16
|
-
/* @__PURE__ */u("button",{onClick:()=>E("9"),className:G,children:"9"}),
|
|
17
|
-
/* @__PURE__ */u("button",{onClick:()=>V("×"),className:`${D} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
|
|
18
|
-
/* @__PURE__ */u("button",{onClick:()=>E("4"),className:G,children:"4"}),
|
|
19
|
-
/* @__PURE__ */u("button",{onClick:()=>E("5"),className:G,children:"5"}),
|
|
20
|
-
/* @__PURE__ */u("button",{onClick:()=>E("6"),className:G,children:"6"}),
|
|
21
|
-
/* @__PURE__ */u("button",{onClick:()=>V("-"),className:`${D} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
|
|
22
|
-
/* @__PURE__ */u("button",{onClick:()=>E("1"),className:G,children:"1"}),
|
|
23
|
-
/* @__PURE__ */u("button",{onClick:()=>E("2"),className:G,children:"2"}),
|
|
24
|
-
/* @__PURE__ */u("button",{onClick:()=>E("3"),className:G,children:"3"}),
|
|
25
|
-
/* @__PURE__ */u("button",{onClick:()=>V("+"),className:`${D} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
|
|
26
|
-
/* @__PURE__ */u("button",{onClick:()=>E("0"),className:`${G} col-span-2`,children:"0"}),
|
|
27
|
-
/* @__PURE__ */u("button",{onClick:()=>E("."),className:G,children:"."}),
|
|
28
|
-
/* @__PURE__ */u("button",{onClick:A,className:H,children:"="})]})]}),
|
|
29
|
-
/* @__PURE__ */u(t,{open:T,onClose:()=>J(!1),title:"Calculator Settings",appearance:K,onAppearanceChange:M,onSave:()=>{R(K),localStorage.setItem(h,JSON.stringify(K)),J(!1)}})]})}export{m as default};
|
package/dist/chunk-3WV3CMSU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r="8.16.1",a=r;export{a as APP_VERSION,r as VERSION};
|
package/dist/chunk-7NEIYFM2.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{AccessibleTable as t}from"./chunk-C2FBUQJW.js";import{arcPath as e}from"./chunk-VFC6QUEN.js";import{useHighlight as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as n}from"./chunk-P5BOTIJU.js";import{CHART_INK as r,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as l,useShellLocale as s}from"./chunk-OVNRVFWS.js";import{formatPlain as i}from"./chunk-C3QOHMR6.js";import{useState as c}from"react";import{jsx as d,jsxs as m}from"react/jsx-runtime";function h(t,e,o,n){const r=(t,o)=>{const n=e[t]?.[o];return"number"==typeof n&&Number.isFinite(n)?n:0},a=t.map((e,o)=>t.reduce((t,e,n)=>t+r(o,n)+r(n,o),0)),l=Math.max(2,o),s=t.length>l,i=s?t.map((t,e)=>e).sort((t,e)=>a[e]-a[t]).slice(0,l-1).sort((t,e)=>t-e):t.map((t,e)=>e),c=new Map(i.map((t,e)=>[t,e])),d=s?i.length:-1,m=s?[...i.map(e=>t[e]),n]:[...t],h=m.map(()=>m.map(()=>0));let u=0;t.forEach((e,o)=>t.forEach((t,e)=>{const n=c.get(o)??d,a=c.get(e)??d;n!==d||a!==d?h[n][a]+=r(o,e):u+=r(o,e)}));const f=m.map((t,e)=>m.reduce((t,o,n)=>t+h[e][n]+h[n][e],0));return d>=0&&(f[d]+=u),{labels:m,matrix:h,totals:f,otherIndex:d,foldedCount:s?t.length-i.length:0}}function u({labels:u,matrix:f,size:p=340,maxNodes:x=8,padAngle:g=.04,arcWidth:b=12,formatValue:v,className:k,emptyLabel:M}){const $=l().charts,w=s(),N=v??(t=>i(t,w)),y=M??$.noFlows,[F,j]=c(null),{highlighted:C}=o(),E=h(u,f,x,$.other),{labels:I,matrix:O,otherIndex:z,foldedCount:A}=E,Q=(t,e)=>O[t]?.[e]??0,U=t=>t===z?r.muted:a(t),V=E.totals,W=I.map((t,e)=>e).sort((t,e)=>V[e]-V[t]),B=W.reduce((t,e)=>t+V[e],0);if(B<=0)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${k??""}`,children:y});const L=p/2,P=p/2,R=p/2-44,T=R-b,H=g*W.length,J=/* @__PURE__ */new Map;let S=-Math.PI/2;W.forEach((t,e)=>{const o=V[t]/B*(2*Math.PI-H);J.set(t,{start:S,end:S+o,slot:e}),S+=o+g});const Y=/* @__PURE__ */new Map,Z=[];for(const t of W)for(const e of W){const o=Q(t,e);if(o<=0)continue;const n=J.get(t),r=o/Math.max(1,V[t])*(n.end-n.start),a=Y.get(t)??0;Y.set(t,a+r),Z.push({from:t,to:e,value:o,a:n.start+a+r/2,b:J.get(e).start+(J.get(e).end-J.get(e).start)/2})}const q=(t,e)=>[L+e*Math.cos(t),P+e*Math.sin(t)],D="arc"===F?.kind?F.index:void 0,G="ribbon"===F?.kind?Z[F.index]:void 0;/* @__PURE__ */
|
|
2
|
-
return m("div",{className:`relative ${k??""}`,children:[
|
|
3
|
-
/* @__PURE__ */m("svg",{width:"100%",height:p,viewBox:`0 0 ${p} ${p}`,role:"img","aria-label":$.chord(W.length),onMouseLeave:()=>j(null),children:[Z.map((t,e)=>{const[o,n]=q(t.a,T),[r,a]=q(t.b,T),l=U(t.from),s=((t,e)=>F?"ribbon"===F.kind?F.index===e:F.index===t.from||F.index===t.to:null!==C?I[t.from]===C||I[t.to]===C:null)(t,e);/* @__PURE__ */
|
|
4
|
-
return d("path",{d:`M${o},${n} Q${L},${P} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/B*p*.9),strokeOpacity:null===s||s?.34:.07,strokeLinecap:"round",onMouseEnter:()=>j({kind:"ribbon",index:e})},`${I[t.from]}→${I[t.to]}`)}),W.map(t=>{const o=J.get(t),n=(o.start+o.end)/2,[a,l]=q(n,R+16),s=(t=>F?"arc"===F.kind?F.index===t:Z[F.index].from===t||Z[F.index].to===t:null!==C?I[t]===C:null)(t);/* @__PURE__ */
|
|
5
|
-
return m("g",{onMouseEnter:()=>j({kind:"arc",index:t}),children:[
|
|
6
|
-
/* @__PURE__ */d("path",{d:e(L,P,T,R,o.start,o.end),fill:U(t),fillOpacity:null===s||s?1:.45}),
|
|
7
|
-
/* @__PURE__ */d("text",{x:a,y:l+4,fontSize:11,fill:r.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:I[t]})]},t)})]}),A>0&&/* @__PURE__ */d("p",{className:"mt-1 text-xs text-gray-500",children:$.chordFolded(A)}),void 0!==D&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:I[D],rows:[{key:"total",label:$.totalFlow,color:U(D),value:N(V[D])}]})}),G&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:`${I[G.from]} → ${I[G.to]}`,rows:[{key:"value",label:$.flow,color:U(G.from),value:N(G.value)}]})}),
|
|
8
|
-
/* @__PURE__ */d(t,{caption:$.chord(W.length),head:[$.tableFrom,$.tableTo,$.value],rows:Z.map(t=>[I[t.from],I[t.to],N(t.value)])})]})}export{u as ChordChart,h as foldChord};
|
package/dist/chunk-DXQCNU5I.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as a}from"./chunk-TUT6SGH2.js";import{INPUT_BASE_ON as i,INPUT_BASE as s}from"./chunk-JFSYWEHD.js";import{Button_default as u}from"./chunk-FSP63GKK.js";import{LoadingSpinner as c}from"./chunk-Q5MD3VY6.js";import{Tooltip as d}from"./chunk-Z3WKHMVB.js";import{onOverlayOpen as h}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as p}from"./chunk-62LW225J.js";import{useDropdownPosition as m,MENU_MAX_HEIGHT as f}from"./chunk-T53TXXOC.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{GLASS_DIVIDER as b,glassStyle as v}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as w}from"./chunk-OVNRVFWS.js";import{useState as x,useId as k,useRef as $,useMemo as j,useEffect as D}from"react";import{createPortal as N}from"react-dom";import{jsxs as C,jsx as S}from"react/jsx-runtime";function W(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}function T({onClear:e,ariaLabel:t}){/* @__PURE__ */
|
|
2
|
-
return S("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function F(F){const{options:R,placeholder:M,emptyOptionLabel:E,className:L="",disabled:z,id:O,filter:H=!1,allowFreeText:A=!1,freeTextOption:I,onSearchChange:U,loading:V=!1,error:B,onRetry:J,rightAdornment:K,renderOption:G,clearable:P=!0,"aria-label":X,"aria-labelledby":Q,"aria-describedby":Y}=F,Z=!0===F.multiple,q=F.multiple?F.value:F.value?[F.value]:[],_=F.multiple?"":F.value,ee=e=>{F.multiple?F.onChange(e):F.onChange(e[0]??"")},te=q.length>0,ne=H&&te&&!z,re=Z||H,le=null!=I,oe=A||le,[ae,ie]=x(!1),[se,ue]=x(-1),ce=k(),de=O??`${ce}-input`,he=`${ce}-listbox`,pe=e=>`${ce}-opt-${e}`,[me,fe]=x(""),ge=w(),be=E??ge.select.none,ve=e=>{fe(e),ue(-1),U?.(e)},ye=$(null),we=$(null),xe=$(null),ke=$(null),$e=$(ae);$e.current=ae;const je=$(!1),De=e=>{$e.current&&($e.current=!1,e&&A&&!le&&Pe&&(Z?q.includes(Pe)||ee([...q,Pe]):Pe!==_&&ee([Pe])),ie(!1),ve(""))},Ne=(e,t)=>{if(!e.disabled){if(Z)return ee(q.includes(e.value)?q.filter(t=>t!==e.value):[...q,e.value]),void(e===Xe?ve(""):ue(t));ee([e.value]),De(!1)}},[Ce,Se]=x(null);g(()=>{if(!K||ae)return void Se(null);const e=ke.current?.offsetWidth??0;Se(e?e+(Ee?32:8)+6:null)});const We=m(we,ae,re?{popupRef:xe}:{matchTriggerWidth:!0}),Te=j(()=>t(R),[R]),Fe=q.join("\0"),Re=j(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Te)q.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(oe)for(const n of q)t.has(n)||e.push(n);return e},[Te,Fe,oe]),Me=Re.join(", "),Ee=P&&te&&!z,[Le,ze]=x(null),Oe=$(null),He=$(""),Ae=$(()=>{});Ae.current=()=>{const e=we.current,t=Oe.current;if(!Z||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Re.join("\0")}`;if(o===He.current)return;He.current=o;let a=null;r>0&&Re.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,a=W(Re,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),ze(e=>e?.shown===a?.shown&&e?.cut===a?.cut?e:a)},g(()=>{Ae.current()}),D(()=>{const e=we.current;if(!Z||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Ae.current());return t.observe(e),()=>t.disconnect()},[Z]);const Ie=Re.length,Ue=!Z||!Le||Le.shown>=Ie?Me:0===Le.shown?ge.select.selectedCount(Ie):`${Re.slice(0,Le.shown).join(", ")} +${Ie-Le.shown}`,Ve=Z&&null!==Le&&(Le.shown<Ie||Le.cut),Be=ae&&te&&re;D(()=>{if(!ae)return;const e=e=>{const t=e.target;ye.current?.contains(t)||xe.current?.contains(t)||De(!0)};document.addEventListener("mousedown",e);const t=h(()=>De(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[ae,A,me,Fe,F.onChange]),D(()=>{if(ae)return y(e=>!("Escape"!==e.key||!$e.current)&&(De(!1),we.current?.blur(),!0),()=>xe.current)},[ae]);const Je=j(()=>{const e=/* @__PURE__ */new Set;return n(R,t=>!e.has(t.value)&&(e.add(t.value),!0))},[R]),Ke=j(()=>{if(U)return Je;const e=me.trim().toLowerCase();return e?n(Je,t=>r(t,e)):Je},[Je,me,U]),Ge=j(()=>t(Ke),[Ke]),Pe=me.trim(),Xe=j(()=>le&&Pe?Te.some(e=>e.label===Pe)||q.includes(Pe)?null:{value:Pe,label:Pe}:null,[le,Pe,Te,Fe]),Qe=j(()=>Xe?[...Ge,Xe]:Ge,[Ge,Xe]);/* @__PURE__ */
|
|
3
|
-
return C("div",{ref:ye,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(ye.current?.contains(t)||xe.current?.contains(t))||je.current||document.activeElement!==we.current&&De(!0)},children:[(Ye=/* @__PURE__ */S("input",{id:de,ref:we,type:"text",autoComplete:"off",role:"combobox","aria-expanded":ae,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":ae?he:void 0,"aria-activedescendant":ae&&se>=0&&se<Qe.length?pe(se):void 0,"aria-label":Q?void 0:X,"aria-labelledby":Q,"aria-describedby":Y,value:ae?me:Ue,onChange:e=>{ve(e.target.value),ie(!0)},onFocus:()=>{z||(ve(""),ie(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(z)return;if(t.preventDefault(),!ae)return void ie(!0);if(0===Qe.length)return;const n="ArrowDown"===t.key?1:-1;return void ue(t=>e(Qe,t,n))}"Enter"===t.key?(t.preventDefault(),ae&&se>=0&&se<Qe.length?Ne(Qe[se],se):1!==Ge.length||Ge[0].disabled?A&&!le&&Pe&&(Z?(q.includes(Pe)||ee([...q,Pe]),ve("")):(ee([Pe]),De(!1),we.current?.blur())):Ne(Ge[0],0)):"Escape"===t.key?(De(!1),we.current?.blur()):"Tab"===t.key&&De(!0)},placeholder:Be?Ue:M||be,className:`${ne?i:s} ${L} ${Ee?"pr-8":""} ${z?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate${Be?" rosh-field-shows-choice":""}`,style:Ce?{paddingRight:Ce}:void 0,disabled:z}),Z?/* @__PURE__ */S(d,{content:!ae&&Ve?Me:null,className:"block",children:Ye}):Ye),Z&&
|
|
4
|
-
/* @__PURE__ */S("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */S("span",{ref:Oe,className:"whitespace-pre"})}),Ee&&/* @__PURE__ */S(T,{ariaLabel:ge.select.clear,onClear:()=>{ee([]),De(!1)}}),K&&!ae&&/* @__PURE__ */S("div",{ref:ke,className:`absolute top-1/2 -translate-y-1/2 ${Ee?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:K}),ae&&N(
|
|
5
|
-
/* @__PURE__ */C("div",{ref:xe,onMouseDownCapture:()=>{je.current=!0,setTimeout(()=>{je.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:p.popup,left:We?.left,right:We?.right,top:We?.top,bottom:We?.bottom,minWidth:We?.minWidth,width:We?.width,...re&&{maxWidth:We?.maxWidth},visibility:We?void 0:"hidden",...v()},children:[Z&&te&&P&&!z&&
|
|
6
|
-
/* @__PURE__ */S("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ee([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-gray-50 border-b ${b}`,children:ge.select.clearAll}),V?
|
|
7
|
-
/* @__PURE__ */S(c,{size:"sm",padding:"py-2",label:ge.search.searching}):B?/* @__PURE__ */C("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
8
|
-
/* @__PURE__ */S("span",{className:"min-w-0 flex-1",children:B}),J&&/* @__PURE__ */S(u,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:J,className:"shrink-0",children:ge.list.retry})]}):null,
|
|
9
|
-
/* @__PURE__ */C("div",{id:he,role:Qe.length?"listbox":void 0,"aria-labelledby":Qe.length?Q??(X?void 0:de):void 0,"aria-label":Qe.length&&!Q?X:void 0,"aria-multiselectable":!(!Qe.length||!Z)||void 0,className:"overflow-y-auto",style:{maxHeight:We?.maxHeight??f},children:[0===Qe.length?V||B?null:/* @__PURE__ */S("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:ge.select.noMatches}):0===Ge.length?null:l(Ke,(e,t)=>{const n=q.includes(e.value);/* @__PURE__ */
|
|
10
|
-
return C("button",{id:pe(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||Z)&&n.preventDefault(),Ne(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===se?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[Z&&/* @__PURE__ */S(o,{selected:n}),
|
|
11
|
-
/* @__PURE__ */S("span",{className:`min-w-0 ${re?"flex-auto":"flex-1"} truncate`,children:G?G(e,{selected:n,active:t===se}):e.label}),e.sublabel&&/* @__PURE__ */S(a,{grows:re,children:e.sublabel})]},e.value)},ce),Xe&&I&&
|
|
12
|
-
/* @__PURE__ */S("button",{id:pe(Ge.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{Z&&e.preventDefault(),Ne(Xe,Ge.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-gray-700 hover:bg-gray-50 ${Ge.length?`border-t ${b}`:""} ${se===Ge.length?"bg-gray-100":""}`,children:/* @__PURE__ */S("span",{className:"min-w-0 flex-1 truncate",children:I(Xe.value)})},`${ce}-typed`)]})]}),document.body)]});var Ye}export{F as SearchableSelect,W as fitChoice};
|
package/dist/chunk-EKHT4PDR.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{AccessibleTable as e}from"./chunk-C2FBUQJW.js";import{arcPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as l}from"./chunk-P5BOTIJU.js";import{CHART_INK as a,resolveSeriesColor as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as o}from"./chunk-OVNRVFWS.js";import{formatPlain as h,formatPercent as c}from"./chunk-C3QOHMR6.js";import{useState as u}from"react";import{jsx as s,jsxs as d}from"react/jsx-runtime";function m(e,t,r,l,a,n,i,o){if(l>=8)return;const h=e.reduce((e,t)=>e+p(t,8-l),0);if(h<=0)return;let c=t;e.forEach((e,t)=>{const u=p(e,8-l),s=u/h*r,d=`${i}/${e.key}`,f=0===l?t:a,b=0===l?e.key:n;o.push({id:d,label:e.label,value:u,depth:l,start:c,end:c+s,branch:f,branchKey:b}),e.children?.length&&m(e.children,c,s,l+1,f,b,d,o),c+=s})}function p(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+p(r,t-1),0):Math.max(0,e.value??0)}function f({nodes:p,size:f=320,innerRadius:b=44,ringGap:v=2,formatValue:k,centerLabel:x,className:g,emptyLabel:y}){const M=i().charts,$=o(),j=k??(e=>h(e,$)),N=y??M.nothingToBreakDown,[w,C]=u(null),{highlighted:F}=r(),B=[];if(m(p,-Math.PI/2,2*Math.PI,0,0,"","",B),0===B.length)/* @__PURE__ */return s("p",{className:`text-sm text-gray-500 ${g??""}`,children:N});const E=Math.max(...B.map(e=>e.depth))+1,I=f/2,L=f/2,O=(f/2-8-b)/E,R=B.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),U=e=>`color-mix(in oklab, ${n(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${a.surface})`,V=e=>null!==w?e.id===w:null===F||e.branchKey===F,W=w?B.find(e=>e.id===w):void 0,z=e=>c(e.value/R*100,1,$);/* @__PURE__ */
|
|
2
|
-
return d("div",{className:`relative ${g??""}`,children:[
|
|
3
|
-
/* @__PURE__ */d("svg",{width:"100%",height:f,viewBox:`0 0 ${f} ${f}`,role:"img","aria-label":M.sunburst(j(R),E),onMouseLeave:()=>C(null),children:[B.map(e=>/* @__PURE__ */s("path",{d:t(I,L,b+e.depth*O+v/2,b+(e.depth+1)*O-v/2,e.start,e.end),fill:U(e),fillOpacity:V(e)?1:.45,stroke:a.surface,strokeWidth:1,onMouseEnter:()=>C(e.id)},e.id)),x&&/* @__PURE__ */s("text",{x:I,y:L+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:a.label,children:x})]}),W&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(l,{title:W.label,rows:[{key:"value",label:M.value,color:U(W),value:j(W.value)},{key:"share",label:M.share,color:a.muted,value:z(W)}]})}),
|
|
4
|
-
/* @__PURE__ */s(e,{caption:M.sunburst(j(R),E),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:B.map(e=>[e.depth+1,e.label,j(e.value),z(e)])})]})}export{f as SunburstChart};
|
package/dist/chunk-FND3BDOO.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{useTabLayer as e,focusableIn as t,stopAfter as r}from"./chunk-CDAJKLGL.js";import{buttonClasses as n}from"./chunk-K7U4RWXJ.js";import{onOverlayOpen as i}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as o}from"./chunk-62LW225J.js";import{popupBounds as a,VIEWPORT_MARGIN as c,placeMenu as s,followAnchor as l}from"./chunk-T53TXXOC.js";import{useHydrated as u,useBrowserLayoutEffect as d}from"./chunk-D65T4H6J.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 C({trigger:C,children:k,title:N,description:T,"aria-label":D,align:E="start",side:j="bottom",open:L,defaultOpen:O=!1,onOpenChange:$,matchTriggerWidth:H=!1,maxHeight:K,initialFocus:W,id:M,triggerLabel:P,"aria-describedby":S,disabled:z,className:J="",triggerClassName:R,panelClassName:U=""}){const[X,B]=p(O),F=(L??X)&&!z,G=u(),I=f(null),A=f(null),Q=f(null),V=f(null),Y=h(),q=M??Y,Z=h(),_=h(),ee=h(),te=f(null),re=f(!1),ne=f({openProp:L,onOpenChange:$});ne.current={openProp:L,onOpenChange:$};const ie=g(e=>{void 0===ne.current.openProp&&B(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=Q.current,t=A.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=a(t),i=Math.max(0,n.right-n.left-2*c),o=e.style;o.left="0px",o.top="0px",o.maxWidth=`${i}px`,o.maxHeight="none",o.width=H?`${Math.min(r.width,i)}px`:"";const l={width:e.offsetWidth,height:e.offsetHeight},u=K??1/0,d=s({trigger:r,menu:{width:l.width,height:Math.min(l.height,u)},bounds:n,align:E,side:j}),m=Math.min(d.maxHeight,u);o.left=`${d.left}px`,o.top=`${d.top}px`,o.maxHeight=`${m}px`,o.overflowY=l.height>m?"auto":"",e.dataset.side=d.side,e.dataset.align=E},[E,j,H,K]);d(()=>{F&&G&&ce()}),v(()=>{if(!F||!G)return;const e=l(()=>A.current,ce),t=V.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>ce());return r.observe(t),()=>{e(),r.disconnect()}},[F,G,ce]),v(()=>{if(!F)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)||Q.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"),n=i(()=>oe()),o=m(e=>"Escape"===e.key&&(oe(),A.current?.focus(),!0),()=>Q.current);return()=>{t(),r(),n(),o()}},[F,oe]),e(Q,F&&G),d(()=>{if(!F||!G)return;const e=Q.current;return()=>{if(re.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||A.current?.focus({preventScroll:!0})}},[F,G]),v(()=>{if(!F||!G)return;const e=Q.current;e&&(re.current=!1,(W?.current??t(e)[0]??e).focus({preventScroll:!0}))},[F,G]);const se="function"==typeof k?k({close:()=>oe()}):k,le=N?{"aria-labelledby":_}:D?{"aria-label":D}:{"aria-labelledby":q};/* @__PURE__ */
|
|
2
|
-
return x("div",{ref:I,className:`relative inline-flex ${J}`.trim(),children:[
|
|
3
|
-
/* @__PURE__ */w("button",{ref:A,id:q,type:"button","aria-haspopup":"dialog","aria-expanded":F,"aria-controls":F&&G?Z:void 0,"aria-label":P,"aria-describedby":S,disabled:z,onClick:()=>F?oe():ie(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!F)return;const r=(()=>{const e=Q.current;return e?t(e)[0]??e:null})();r&&(e.preventDefault(),r.focus({preventScroll:!0}))},className:R??n({variant:"secondary"}),children:C}),F&&G&&b(
|
|
4
|
-
/* @__PURE__ */w("div",{ref:Q,id:Z,role:"dialog",...le,"aria-describedby":T?ee:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:ae,onFocusCapture:ae,onKeyDown:e=>{const n=Q.current,i=A.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 ${U}`.trim(),style:y.test(U)?void 0:{zIndex:o.popup},children:/* @__PURE__ */x("div",{ref:V,children:[N&&/* @__PURE__ */w("h2",{id:_,className:"text-sm font-semibold text-gray-900",children:N}),T&&/* @__PURE__ */w("p",{id:ee,className:"mt-1 text-sm text-gray-500",children:T}),N||T?/* @__PURE__ */w("div",{className:"mt-3",children:se}):se]})}),document.body)]})}export{C as Popover};
|
package/dist/chunk-JHDWTYZ4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{iconButtonClasses as e}from"./chunk-K7U4RWXJ.js";import{isAriaDisabled as r,swallowPress as a,describedByWith as i,OffWithReason as s}from"./chunk-ABJ4LWOW.js";import{forwardRef as d,useId as n}from"react";import{jsx as o}from"react/jsx-runtime";var t=d(function({children:d,variant:t="ghost",size:c="md",type:l="button",className:m="",pressed:b,disabledReason:p,ink:u,disabled:f,onClick:h,"aria-disabled":k,"aria-describedby":v,...y},j){const N=n(),W=(Boolean(f)||r(k))&&null!=p&&""!==p,x=W||r(k),z=/* @__PURE__ */o("button",{ref:j,type:l,className:e({variant:t,size:c,pressed:b??(!0===y["aria-pressed"]||"true"===y["aria-pressed"]),ink:u,className:m}),...y,disabled:W?void 0:f,"aria-disabled":!!x||k,"aria-describedby":i(v,W?N:void 0),onClick:x?a:h,children:d});return W?/* @__PURE__ */o(s,{reason:p,id:N,children:z}):z});export{t as IconButton_default};
|
package/dist/chunk-JXOBORLD.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{DropdownMenu as e}from"./chunk-H3XEO4LR.js";import{Button_default as i}from"./chunk-FSP63GKK.js";import{iconButtonClasses as n}from"./chunk-K7U4RWXJ.js";import{Icon as r}from"./chunk-VJPJNCB4.js";import{Tooltip as a}from"./chunk-Z3WKHMVB.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:g=!1,disabledReason:N,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:C,menuFooterLabel:W,align:R="end",side:z="bottom",menuMinWidth:K,linkAs:L,block:B=!1,className:F=""},J){const M=g&&(null!=N&&""!==N&&!1!==N)&&!v,O=x&&null!=j&&""!==j&&!1!==j,$=o(),A=/* @__PURE__ */t(i,{ref:J,type:b,variant:f,size:p,loading:v,leftIcon:k,block:B,disabled:g&&!M,"aria-disabled":!!M||void 0,disabledReason:M?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),D=B?"relative flex min-w-0 flex-1":"relative inline-flex",H=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
2
|
-
return s("div",{className:[B?"flex w-full":"inline-flex","items-stretch",F].filter(Boolean).join(" "),children:[null==w||""===w||M?A:/* @__PURE__ */t(a,{content:w,className:D,children:A}),
|
|
3
|
-
/* @__PURE__ */t(a,{content:O?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":O?$:void 0,items:h,align:R,side:z,minWidth:K,linkAs:L,disabled:x&&!O,"aria-disabled":O,onOpenChange:y,footer:C,footerLabel:W,triggerClassName:n({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(r,{name:"chevron-down",className:H,strokeWidth:2,"aria-hidden":"true"})})}),O&&/* @__PURE__ */t("span",{id:$,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|
package/dist/chunk-L3VD25XR.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{optionMatches as e,OptionSublabel as t}from"./chunk-TUT6SGH2.js";import{inputClasses as n}from"./chunk-JFSYWEHD.js";import{GROUP_COLORS as r}from"./chunk-BOGBLZKS.js";import{Tooltip as o}from"./chunk-Z3WKHMVB.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as a,POPUP_MAX_WIDTH as s,MENU_MAX_HEIGHT as c}from"./chunk-T53TXXOC.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as d}from"./chunk-OVNRVFWS.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as g}from"react-dom";import{jsxs as v,jsx as x,Fragment as b}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${r.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:r,onChange:y,options:k=[],placeholder:N,allowFreeText:j=!1,invalid:C,disabled:W,id:D,className:L="",tone:T,tooltip:E,split:S}){const[B,F]=m(!1),[H,M]=m(""),$=d(),G=h(null),I=h(null),J=h(null),K=a(G,B),O=e=>k.find(t=>t.value===e)?.label??e,R=p(()=>{const t=new Set(r),n=[],o=H.trim().toLowerCase();for(const r of k)t.has(r.value)||(t.add(r.value),o&&!e(r,o)||n.push(r));return n},[k,r,H]),V=e=>{const t=[...r];for(const n of e){const e=n.trim();if(!e)continue;const r=e.toLowerCase(),o=k.find(t=>t.value===e||t.label.toLowerCase()===r)?.value,l=o??(j?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==r.length&&y(t)},X=e=>{e&&!r.includes(e)?(y([...r,e]),M("")):M("")},Z=e=>y(r.filter(t=>t!==e)),z=()=>{const e=H.trim();if(S&&e)return V(e.split(S)),void M("");j&&e?X(e):M("")},P=h(()=>{});P.current=()=>{z(),F(!1)},f(()=>{if(!B)return;const e=e=>{const t=e.target;G.current?.contains(t)||J.current?.contains(t)||(z(),F(!1))};document.addEventListener("mousedown",e);const t=l(()=>P.current());return()=>{document.removeEventListener("mousedown",e),t()}});const U=k.length>0;/* @__PURE__ */
|
|
2
|
-
return v("div",{ref:G,className:"relative",children:[
|
|
3
|
-
/* @__PURE__ */v("div",{onMouseDown:e=>{W||e.target.closest("button")||(e.preventDefault(),I.current?.focus())},className:n({invalid:C,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${W?"bg-gray-50 cursor-not-allowed":""} ${L}`}),children:[r.map(e=>{const t=T?.(e),n=w[t??"accent"],r=/* @__PURE__ */v("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
-
/* @__PURE__ */x("span",{className:"truncate",children:O(e)}),!W&&/* @__PURE__ */x("button",{type:"button","aria-label":$.select.removeItem?.(O(e))??`${$.select.remove} ${O(e)}`,onClick:()=>Z(e),className:n.remove,children:"×"})]},e),l=E?.(e);return null==l?r:/* @__PURE__ */x(o,{content:l,className:"relative inline-flex max-w-full",children:r},e)}),
|
|
5
|
-
/* @__PURE__ */x("input",{id:D,ref:I,type:"text",autoComplete:"off",role:"combobox","aria-expanded":B&&U,"aria-invalid":C||void 0,disabled:W,value:H,placeholder:0===r.length?N:void 0,onChange:e=>{(e=>{if(S){const t=e.split(S);if(t.length>1)return V(t.slice(0,-1)),void M(t[t.length-1])}M(e)})(e.target.value),F(!0)},onFocus:()=>{!W&&U&&F(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=H.trim(),r=n?R.filter(t=>e(t,n.toLowerCase())):[];1===r.length?X(r[0].value):z()}else"Backspace"===t.key&&""===H&&r.length>0?Z(r[r.length-1]):"Escape"===t.key?(F(!1),M(""),I.current?.blur()):"Tab"===t.key&&(z(),F(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-gray-400 rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),B&&U&&g(
|
|
6
|
-
/* @__PURE__ */x("div",{ref:J,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:K?.left,right:K?.right,top:K?.top,bottom:K?.bottom,minWidth:K?.minWidth,maxWidth:K?.maxWidth??s,width:"max-content",visibility:K?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:K?.maxHeight??c},children:0===R.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&r.length>=k.length?$.select.allSelected:$.select.noMatches}):R.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),X(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.sublabel?/* @__PURE__ */v(b,{children:[
|
|
7
|
-
/* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
|
|
8
|
-
/* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
|
package/dist/chunk-OJ3RN3BG.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as n}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as i,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-TUT6SGH2.js";import{useSettingAuto as d}from"./chunk-E4Z5OXBI.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-JFSYWEHD.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-QR4RM7PO.js";import{Icon as m}from"./chunk-VJPJNCB4.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-T53TXXOC.js";import{solidSurfaceStyle as g}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-OVNRVFWS.js";import{forwardRef as w,useId as k,useState as N,useRef as $,useMemo as D,useCallback as T,useEffect as j,useLayoutEffect as O}from"react";import{createPortal as E}from"react-dom";import{jsxs as S,jsx as C,Fragment as H}from"react/jsx-runtime";var I=w(function({value:e,onChange:t,options:r,placeholder:n,invalid:i,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},w){const N=t,$=x(),D=d(),T=f??D,j=k(),O=/* @__PURE__ */S("select",{ref:w,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":i||void 0,"aria-describedby":[g,T?j:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:i,size:l,auto:T,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==n&&!b&&/* @__PURE__ */C("option",{value:"",disabled:!0,children:n}),
|
|
2
|
-
/* @__PURE__ */C(R,{items:r})]});return T?/* @__PURE__ */S(H,{children:[O,
|
|
3
|
-
/* @__PURE__ */C("span",{id:j,hidden:!0,children:$.settingView.auto})]}):O});function R({items:e}){const t=e=>/* @__PURE__ */C("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
4
|
-
return C(H,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */C("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var z=w(function({value:l,onChange:u,options:w,placeholder:I,invalid:z,className:V="",id:B,disabled:W,size:A,touchSize:F,title:K,multiple:P,renderOption:U,renderValue:J,valueText:M,readOnly:L=!1,footer:X,changed:G=!1,auto:q,"aria-describedby":Q,"aria-label":Y,"aria-labelledby":Z,..._},ee){const[te,re]=N(!1),[ne,ie]=N(-1),ae=$(null),le=$(null),oe=$(null),de=$(null),se=$([]),ce=()=>de.current??oe.current,ue=!!X?.length,pe="sm"===A,me=pe?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",ve=p(pe),[he,fe]=N(null),be=x(),ge=$(te);ge.current=te;const ye=$({buffer:"",timer:null}),xe=k(),we=`${xe}-listbox`,ke=B??`${xe}-trigger`,Ne=e=>`${xe}-opt-${e}`,$e=`${xe}-changed`,De=d(),Te=q??De,je=`${xe}-auto`,Oe=[Q,G?$e:void 0,Te?je:void 0].filter(Boolean).join(" ")||void 0,Ee=D(()=>i(w),[w]),Se=P?l:[],Ce=u,He=f(le,te,{matchTriggerWidth:!0,...X?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Ie="undefined"==typeof window?j:O,Re=`${te}|${He?.top}|${He?.bottom}|${He?.maxHeight}|${w.length}`;Ie(()=>{fe(null)},[Re]),Ie(()=>{const e=oe.current;if(!te||!e||null!==he)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let i=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;i=r}i>r&&fe(Math.floor(i))},[te,he,Re]);const ze=P?Ee.findIndex(e=>Se.includes(e.value)):Ee.findIndex(e=>e.value===l),Ve=P?Ee.filter(e=>Se.includes(e.value)).map(e=>e.label).join(", ")||void 0:ze>=0?Ee[ze].label:void 0,Be=!P&&ze>=0?Ee[ze].lang:void 0,We=P?Ee.filter(e=>Se.includes(e.value)):ze>=0?[Ee[ze]]:[],Ae=J&&We.length?J(We):void 0,Fe=void 0!==Ae&&M?M(We):void 0,Ke=T((e=!0)=>{re(!1),ie(-1),e&&le.current?.focus()},[]),Pe=T(()=>{W||L||(ie(ze>=0?ze:e(Ee)),re(!0))},[W,L,Ee,ze]),Ue=T(e=>{const t=Ee[e];if(t&&!t.disabled){if(P){const r=l;return Ce(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ie(e)}Ce(t.value),Ke()}},[Ee,P,l,Ce,Ke]);j(()=>{if(!te)return;return y(e=>!("Escape"!==e.key||!ge.current)&&(Ke(),!0),ce)},[te,Ke]),j(()=>{if(!te)return;const e=e=>{const t=e.target;ae.current?.contains(t)||ce()?.contains(t)||Ke(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Ke(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[te,Ke]),j(()=>{!te||ne<0||oe.current?.querySelector(`#${CSS.escape(Ne(ne))}`)?.scrollIntoView({block:"nearest"})},[te,ne]);const Je=T(e=>{const r=ye.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const n=te?ne:ze,i=t(Ee,r.buffer,n);i<0||(te?ie(i):P?(ie(i),re(!0)):Ue(i))},[te,ne,ze,Ee,Ue,P]),Me=te?a(w,(e,t)=>{const r=(n=e.value,P?Se.includes(n):l===n);var n;const i=t===ne;/* @__PURE__ */
|
|
5
|
-
return S("div",{id:Ne(t),role:"option",lang:e.description||U?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ie(t)},onClick:()=>Ue(t),className:`mx-1 cursor-pointer truncate rounded-lg ${me}${P?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":i?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[P&&/* @__PURE__ */C(o,{selected:r}),U?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1 truncate",children:U(e,{selected:r,active:i})}):P?/* @__PURE__ */S("span",{className:"block min-w-0 flex-1",children:[
|
|
6
|
-
/* @__PURE__ */C("span",{lang:e.lang,className:"block truncate",children:e.label}),e.description&&/* @__PURE__ */C("span",{className:ve,children:e.description})]}):e.description?
|
|
7
|
-
/* @__PURE__ */S(H,{children:[
|
|
8
|
-
/* @__PURE__ */C("span",{lang:e.lang,className:"block truncate",children:e.label}),
|
|
9
|
-
/* @__PURE__ */C("span",{className:ve,children:e.description})]}):e.label]},e.value)},xe,"mx-1"):null,Le=void 0!==Ae?
|
|
10
|
-
/* @__PURE__ */S("span",{className:"relative block min-w-0 truncate",children:[
|
|
11
|
-
/* @__PURE__ */C("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ae}),
|
|
12
|
-
/* @__PURE__ */C("span",{lang:void 0===Fe?Be:void 0,className:"sr-only",children:Fe??Ve})]}):/* @__PURE__ */C("span",{lang:Be,className:"block truncate "+(void 0===Ve?"text-gray-400":""),children:Ve??I??" "}),Xe={zIndex:h.popup,left:He?.left,top:He?.top,bottom:He?.bottom,width:He?.width,maxHeight:He?.maxHeight??b,visibility:He?void 0:"hidden",...g()},Ge=/* @__PURE__ */C("div",{ref:oe,id:we,role:"listbox","aria-labelledby":Z??(Y?void 0:ke),"aria-label":Z?void 0:Y,"aria-multiselectable":P||void 0,className:ue?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:ue?null!==he?{maxHeight:he}:void 0:null!==he?{...Xe,maxHeight:he}:Xe,children:Me}),qe=ue?/* @__PURE__ */S("div",{ref:de,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Xe,children:[Ge,
|
|
13
|
-
/* @__PURE__ */C("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:X.map((e,t)=>/* @__PURE__ */S("button",{ref:e=>{se.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Ke(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(X?.length??0)-1,n=t=>{e.preventDefault(),se.current[t]?.focus()},i=()=>{e.preventDefault(),le.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?i():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?i():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void Ke());case"Escape":return e.preventDefault(),e.stopPropagation(),void Ke()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${me} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-gray-400":"cursor-pointer text-gray-700 hover:bg-blue-50 hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */C(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
14
|
-
/* @__PURE__ */C("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Ge;/* @__PURE__ */
|
|
15
|
-
return S("div",{ref:ae,className:"relative",children:[
|
|
16
|
-
/* @__PURE__ */C("button",{ref:le,id:ke,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":te,"aria-controls":te?we:void 0,"aria-activedescendant":te&&ne>=0?Ne(ne):void 0,"aria-invalid":z||void 0,"aria-describedby":Oe,"aria-label":Y,"aria-labelledby":Z,title:K,disabled:W,"aria-readonly":L||void 0,onClick:()=>te?Ke():Pe(),onKeyDown:t=>{if(!W&&!L)switch(t.key){case"ArrowDown":return t.preventDefault(),void(te?ie(e=>n(Ee,e,1)):Pe());case"ArrowUp":return t.preventDefault(),void(te?ie(e=>n(Ee,e,-1)):Pe());case"Home":return void(te&&(t.preventDefault(),ie(e(Ee))));case"End":return void(te&&(t.preventDefault(),ie(r(Ee))));case"Enter":return void(te&&(t.preventDefault(),Ue(ne)));case" ":return t.preventDefault(),void(te?Ue(ne):Pe());case"Escape":return void(te&&(t.preventDefault(),t.stopPropagation(),Ke()));case"Tab":return te&&ue&&!t.shiftKey?(t.preventDefault(),void se.current[0]?.focus()):void(te&&Ke(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Je(t.key))}},className:s({invalid:z,size:A,readOnly:L,auto:Te,className:`${L?"":"pr-8 "}text-left ${V}`.trim()}),children:G?
|
|
17
|
-
/* @__PURE__ */S("span",{className:"flex min-w-0 items-center gap-1",children:[Le,
|
|
18
|
-
/* @__PURE__ */C("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Le}),G&&/* @__PURE__ */C("span",{id:$e,hidden:!0,children:be.select.changed}),Te&&/* @__PURE__ */C("span",{id:je,hidden:!0,children:be.settingView.auto}),!L&&/* @__PURE__ */C(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
|
|
19
|
-
/* @__PURE__ */S("select",{ref:ee,value:l,multiple:P||void 0,onChange:e=>Ce(P?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:W,"aria-hidden":"true",tabIndex:-1,className:"sr-only",..._,children:[void 0!==I&&!P&&/* @__PURE__ */C("option",{value:"",disabled:!0,children:I}),
|
|
20
|
-
/* @__PURE__ */C(R,{items:w})]}),te&&E(qe,document.body)]})}),V=w(function({touchSize:e="touch",...t},r){const n=u();return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */C(I,{ref:r,...t,size:e}):/* @__PURE__ */C(z,{ref:r,...t}):/* @__PURE__ */C(z,{ref:r,...t,size:e})});export{I as NativeSelect,V as Select_default};
|
package/dist/chunk-T53TXXOC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useBrowserLayoutEffect as t}from"./chunk-D65T4H6J.js";import{useState as e}from"react";var o=448,i=240,n=8,h=()=>({left:0,right:window.innerWidth,top:0,bottom:window.innerHeight});function r(t){const e=h(),o=t?.closest?.("[data-modal-panel]");if(!o)return e;const i=o.getBoundingClientRect();return i.width<=0||i.height<=0?e:{left:Math.max(e.left,i.left),right:Math.min(e.right,i.right),top:Math.max(e.top,i.top),bottom:Math.min(e.bottom,i.bottom)}}var a=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);function m(t){const e=t.getBoundingClientRect();if(e.width<=0&&e.height<=0&&0===e.left&&0===e.top)return null;const o=h(),i={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 n=getComputedStyle(t).position;for(let e=t.parentElement;e&&e!==document.documentElement&&"fixed"!==n;e=e.parentElement){const t=getComputedStyle(e);if("absolute"===n&&"static"===t.position)continue;n=t.position;const o=a.has(t.overflowX),h=a.has(t.overflowY);if(!o&&!h)continue;const r=e.getBoundingClientRect();r.width<=0&&r.height<=0||(o&&(i.left=Math.max(i.left,r.left),i.right=Math.min(i.right,r.right)),h&&(i.top=Math.max(i.top,r.top),i.bottom=Math.min(i.bottom,r.bottom)))}return i.right>=i.left&&i.bottom>=i.top?i:null}var l={top:"bottom",bottom:"top",left:"right",right:"left"},f={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function g(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 d=(t,e,o)=>Math.max(e,Math.min(t,o));function s(t,e,o,i,n){const h=g(t,i,n),r=t=>h[t]-("top"===t||"bottom"===t?e.height:e.width),a=[o,l[o],...f[o]],m=a.find(t=>r(t)>=0)??a.reduce((t,e)=>r(e)>r(t)?e:t),s=(t.left+t.right)/2,c=(t.top+t.bottom)/2;let u,p;switch(m){case"top":u=s-e.width/2,p=t.top-n-e.height;break;case"bottom":u=s-e.width/2,p=t.bottom+n;break;case"left":u=t.left-n-e.width,p=c-e.height/2;break;case"right":u=t.right+n,p=c-e.height/2}return{side:m,left:d(u,i.left+8,i.right-8-e.width),top:d(p,i.top+8,i.bottom-8-e.height)}}function c(t,e,o,i,n){const{side:h,left:r,top:a}=e,m=r+o.width,l=a+o.height;if({top:t.top-l,bottom:a-t.bottom,left:t.left-m,right:r-t.right}[h]<n)return null;const f=(t,e,o)=>o<2*i?e+o/2:Math.max(e+i,Math.min(t,e+o-i)),g=(t.left+t.right)/2,d=(t.top+t.bottom)/2;switch(h){case"top":return{side:h,x:f(g,r,o.width),y:l};case"bottom":return{side:h,x:f(g,r,o.width),y:a};case"left":return{side:h,x:m,y:f(d,a,o.height)};case"right":return{side:h,x:r,y:f(d,a,o.height)}}}function u(t,e,o){return p(()=>t()?.getBoundingClientRect(),e,o)}function p(t,e,o){let i=NaN,n=NaN,h=NaN,r=NaN,a=NaN;const m=()=>{const e=t();if(!e)return!1;const m=o?o():NaN,l=e.left!==i||e.top!==n||e.right!==h||e.bottom!==r||m!==a&&!(Number.isNaN(m)&&Number.isNaN(a));return i=e.left,n=e.top,h=e.right,r=e.bottom,a=m,l};m();const l=()=>{m(),e()};let f=requestAnimationFrame(function t(){m()&&e(),f=requestAnimationFrame(t)});return window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{cancelAnimationFrame(f),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}}function b({trigger:t,menu:e,bounds:o,align:i,side:n}){const h=g(t,o,4),r="bottom"===n?"top":"bottom",a=e.height>h[n]&&(e.height<=h[r]||h[r]>h[n])?r:n,m=Math.max(Math.min(e.height,96),h[a]),l=Math.min(e.height,m),f=d("bottom"===a?t.bottom+4:t.top-4-l,o.top+8,o.bottom-8-l),s=Math.max(0,o.right-o.left-16),c=Math.min(e.width,s);return{left:d("start"===i?t.left:t.right-c,o.left+8,o.right-8-c),top:f,side:a,maxHeight:m,maxWidth:s}}function x(n,h,a={}){const{matchTriggerWidth:m=!1,preferredMaxWidth:l=o,preferredMaxHeight:f=i,popupRef:g}=a,[d,s]=e(null);return t(()=>{if(!h)return void s(null);const t=()=>{const t=n.current,e=t?.getBoundingClientRect();if(!e)return;const o=r(t),i=o.bottom-e.bottom-4-8,h=e.top-o.top-4-8,a=i<Math.min(f,160)&&h>i,d=Math.max(96,Math.min(f,a?h:i)),c=Math.max(0,o.right-o.left-16),u={minWidth:e.width,maxWidth:Math.min(l,c),maxHeight:d};if(m){const t=Math.min(e.width,c);u.width=t,u.maxWidth=t,u.left=Math.min(Math.max(o.left+8,e.left),o.right-8-t)}else if(g&&o.right-8-e.left<u.maxWidth&&Math.min(e.right,o.right-8)-o.left-8<u.maxWidth){const t=g.current?.offsetWidth??0,i=t>0?Math.min(t,u.maxWidth):u.maxWidth;u.left=Math.max(o.left+8,Math.min(e.left,o.right-8-i))}else if(o.right-8-e.left<u.maxWidth){const t=Math.min(e.right,o.right-8);u.right=window.innerWidth-t,u.maxWidth=Math.min(u.maxWidth,Math.max(0,t-o.left-8))}else u.left=Math.max(o.left+8,e.left);a?u.bottom=window.innerHeight-e.top+4:u.top=e.bottom+4,s(u)};return t(),u(()=>n.current,t,g?()=>g.current?.offsetWidth??NaN:void 0)},[h,n,m,l,f,g]),d}function M({point:t,menu:e,bounds:o}){const i={left:t.x,right:t.x,top:t.y,bottom:t.y},n=o.right-8-t.x,h=t.x-(o.left+8);return b({trigger:i,menu:e,bounds:o,align:e.width<=n||n>=h?"start":"end",side:"bottom"})}export{i as MENU_MAX_HEIGHT,o as POPUP_MAX_WIDTH,n as VIEWPORT_MARGIN,u as followAnchor,p as followRect,c as placeArrow,M as placeAtPoint,s as placeBeside,b as placeMenu,r as popupBounds,m as showingBox,x as useDropdownPosition};
|
package/dist/chunk-Z3WKHMVB.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{onOverlayOpen as t}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{followAnchor as r,popupBounds as o,VIEWPORT_MARGIN as n,showingBox as i,placeBeside as a,placeArrow as l}from"./chunk-T53TXXOC.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as s}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as d,escapeSurfaceAbove as h}from"./chunk-TWVUQUUD.js";import{createContext as m,useContext as u,useState as p,useRef as f,useId as x,useEffect as w,isValidElement as g,cloneElement as b}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,jsx as k}from"react/jsx-runtime";var T=m(!1),W=()=>u(T),j={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 H({content:m,side:u="top",delay:W=200,children:H,className:N="relative inline-flex",describe:B=!0}){const[M,C]=p(!1),D=M&&!(null==m||!1===m||""===m),[R,z]=p(null),E=f(void 0),J=f(null),P=f(null),U=x(),$=f(!1),F=()=>{window.clearTimeout(E.current),$.current||(E.current=window.setTimeout(()=>C(!0),W))},I=()=>{window.clearTimeout(E.current),C(!1)},L=()=>{$.current=!0,I()},X=()=>{$.current=!1,I()};w(()=>()=>window.clearTimeout(E.current),[]),c(()=>{if(!D)return void z(null);const t=()=>{const t=J.current,e=P.current;if(!t||!e)return;const r=o(t),c=Math.max(0,r.right-r.left-2*n),s=Math.max(0,r.bottom-r.top-2*n);e.style.maxWidth=`${c}px`,e.style.maxHeight=`${s}px`;const d=e.getBoundingClientRect();if(d.width<=0||d.height<=0)return;const h=t.getBoundingClientRect();if(!i(t))return void I();const m=a(h,d,u,r,12),p=l(h,m,d,16,6),f={anchor:{left:h.left,top:h.top,width:h.width,height:h.height},left:m.left-h.left,top:m.top-h.top,maxWidth:c,maxHeight:s,side:m.side,arrow:p&&{left:p.x-h.left,top:p.y-h.top}};z(t=>{return t&&(r=f,(e=t).anchor.left===r.anchor.left&&e.anchor.top===r.anchor.top&&e.anchor.width===r.anchor.width&&e.anchor.height===r.anchor.height&&e.left===r.left&&e.top===r.top&&e.maxWidth===r.maxWidth&&e.maxHeight===r.maxHeight&&e.side===r.side&&e.arrow?.left===r.arrow?.left&&e.arrow?.top===r.arrow?.top)?t:f;var e,r})};return t(),r(()=>J.current,t)},[D,u,m]),w(()=>{if(!D)return;const e=d(t=>"Escape"===t.key&&(I(),!h(J.current))),r=t(I);return()=>{e(),r()}},[D]);const G=D&&B?U:void 0,O=g(H)?b(H,{"aria-describedby":[H.props["aria-describedby"],G].filter(Boolean).join(" ")||void 0}):H,Q=D?s():void 0;/* @__PURE__ */
|
|
2
|
-
return y("span",{ref:J,className:N,"aria-describedby":g(H)?void 0:G,onMouseEnter:F,onMouseLeave:X,onFocus:t=>{let e=!0;try{e=t.target.matches(":focus-visible")}catch{}e&&F()},onBlur:X,onPointerDown:L,onClick:L,children:[
|
|
3
|
-
/* @__PURE__ */k(T.Provider,{value:!0,children:O}),D&&v(
|
|
4
|
-
/* @__PURE__ */y("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:e.hint,...R?.anchor},children:[
|
|
5
|
-
/* @__PURE__ */k("span",{ref:P,id:U,role:"tooltip",className:`pointer-events-none absolute z-(--z-hint) box-border w-max overflow-hidden whitespace-normal break-words text-start rounded-md px-2 py-1 text-xs text-gray-800 ${R?"":j[u]}`,style:{...Q,...R&&{left:R.left,top:R.top,maxWidth:R.maxWidth,maxHeight:R.maxHeight}},children:m}),(!R||R.arrow)&&
|
|
6
|
-
/* @__PURE__ */k("span",{"aria-hidden":"true",className:"rosh-tooltip-arrow","data-side":R?.side??u,style:{background:Q?.background,"--rosh-tooltip-edge":Q?.border,...R?.arrow&&{left:R.arrow.left,top:R.arrow.top}}})]}),document.body)]})}export{H as Tooltip,W as useInsideTooltip};
|
package/dist/chunk-Z5UVBCEE.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{ImageFocusPoint as e}from"./chunk-PMJMPYLQ.js";import{FormField as a}from"./chunk-MVQBVPWP.js";import{isVideoUrl as i,mediaPromptLine as t,mediaFileName as r,FilenameBadge as o,BusyOverlay as n,UploadGlyph as l,dropzoneClass as s,zoneFocusClass as c}from"./chunk-CQXV3SJA.js";import{TransferProgress as d}from"./chunk-EZQXLIG3.js";import{Segmented as u}from"./chunk-BF2G42QU.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-VAACOJ2H.js";import{Icon as p}from"./chunk-VJPJNCB4.js";import{useShellStrings as b}from"./chunk-OVNRVFWS.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:C,onFile:R,label:F,hint:P,error:U,required:V,className:O,accept:$="image/*",maxSizeBytes:z,fit:B="cover",height:J=112,placeholder:Q,cta:A,acceptHint:H,showFilename:S=!0,allowReplace:q=!0,allowRemove:I=!0,replaceLabel:M,removeLabel:W,busy:G=!1,busyLabel:X,choosingLabel:_,pickFailedLabel:E,progress:K,disabled:Y=!1,kind:Z,onKindChange:D,focus:T,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=A??ie.cta,re=Z??(/video/.test($)&&!/image/.test($)?"video":"image"),oe="string"==typeof W&&W?W:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=G||ne,me=ne&&!G?_??ie.choosing:X??ie.uploading,he=U??(se?E??ie.pickFailed:void 0),pe=e=>{if(!C)return;ce(!1);const a=C(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=Y||ue,ke=!!w&&(i(w,$)||w===ve),je=Q??t($,ie),xe=M??(ke||"video"===re?ie.changeVideo:ie.changeImage),Ne=e=>{C?pe(e):R?R(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:$,maxSizeBytes:z,acceptHint:H,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:Le}=we,Ce=()=>{ye||(C?pe():we.open())},Re=w?r(w):"",Fe=!ke&&!!ee,Pe=Y||!q&&!I?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[q&&/* @__PURE__ */k("button",{id:Fe?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Ce(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
|
|
2
|
-
/* @__PURE__ */j(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
3
|
-
/* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),I&&/* @__PURE__ */j("button",{type:"button","aria-label":oe,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Ue=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Fe?"":"bg-gray-100",Le?"border-blue-500":"border-gray-200"].join(" "),style:Fe?void 0:{height:J},children:[Fe?
|
|
4
|
-
/* @__PURE__ */j(e,{value:T??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Re||void 0,className:"h-full w-full",style:{objectFit:B}}):/* @__PURE__ */j("img",{src:w??void 0,alt:Re,className:"h-full w-full",style:{objectFit:B,objectPosition:T||void 0}}),S&&w&&/* @__PURE__ */j(o,{children:Re}),Pe,ue&&/* @__PURE__ */j(n,{label:me,progress:K,rounded:"rounded-md"})]}),Ve=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Ce(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":V||void 0,"aria-describedby":he?`${be}-error`:P?`${be}-hint`:void 0,...we.zoneProps,className:s(Le,ye,c(ye)),style:{minHeight:J},children:ue?/* @__PURE__ */j(d,{state:"busy",verb:me,pct:K}):/* @__PURE__ */k(x,{children:[
|
|
5
|
-
/* @__PURE__ */j("span",{className:"text-gray-400",children:/* @__PURE__ */j(l,{})}),
|
|
6
|
-
/* @__PURE__ */j("span",{className:"px-3 text-xs text-gray-500",children:je}),
|
|
7
|
-
/* @__PURE__ */j("span",{className:"text-sm font-medium text-blue-600",children:te}),H&&/* @__PURE__ */j("span",{className:"text-xs text-gray-400",children:H})]})});/* @__PURE__ */
|
|
8
|
-
return k(a,{label:F,htmlFor:be,hint:P,error:he,required:V,className:O,children:[D&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(u,{value:re,onChange:e=>D(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof F&&F?F:ie.upload})}),w?Ue:Ve,!C&&/* @__PURE__ */j("input",{...we.inputProps}),
|
|
9
|
-
/* @__PURE__ */j(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
|