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,9 +1,9 @@
|
|
|
1
|
-
import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-
|
|
2
|
-
/* @__PURE__ */f("div",{className:`flex h-full flex-col ${
|
|
3
|
-
/* @__PURE__ */p(t,{side:m,width:
|
|
4
|
-
return f("div",
|
|
5
|
-
/* @__PURE__ */p(g,{phone:
|
|
6
|
-
/* @__PURE__ */p(v,{phone:
|
|
1
|
+
import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-PRR2GXBV.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-VJPJNCB4.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-OVNRVFWS.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:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:C=("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,W=i().sidebar,j=a(),z=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}}(),[O,D]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),E=null!=l||null!=n,I=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:O},children:[
|
|
2
|
+
/* @__PURE__ */f("div",{className:`flex h-full flex-col ${E?"overflow-hidden":"overflow-y-auto"} ${C}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),E?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,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(t,{side:m,width:O,onResize:D,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:W.resize})]}),S=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${P}`,children:u});/* @__PURE__ */
|
|
4
|
+
return f("div",j?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
|
|
5
|
+
/* @__PURE__ */p(g,{phone:z,top:l,fallback:W.sections}),S,
|
|
6
|
+
/* @__PURE__ */p(v,{phone:z,bottom:n,label:W.sections,closeLabel:W.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[R?null:I,S,R?I:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
|
|
7
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
8
|
/* @__PURE__ */f("button",{ref:l.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":l.open,onClick:()=>l.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
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))}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Popover as e}from"./chunk-
|
|
2
|
-
return i(e,{className:v,disabled:f,triggerLabel:j?b.button(d,x(j)):d,"aria-label":d,initialFocus:
|
|
1
|
+
import{Popover as e}from"./chunk-RNBM5JZI.js";import{IconButton_default as r}from"./chunk-HMZLRXLA.js";import{Icon as n}from"./chunk-VJPJNCB4.js";import{Tooltip as a}from"./chunk-2LXTJXWC.js";import{useShellStrings as l}from"./chunk-OVNRVFWS.js";import{useRef as t}from"react";import{jsx as i,jsxs as o}from"react/jsx-runtime";var s={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function c({value:c,onChange:m,options:u,label:d,emptyValue:h,columns:p=5,disabled:f=!1,className:v=""}){const g=l(),b=g.iconPicker,N=g.iconNames,x=e=>e.label??N[e.value]??e.value,w=t([]),k=Math.max(0,u.findIndex(e=>e.value===c)),j=u[k],A=j?.value===h,C=t(null);/* @__PURE__ */
|
|
2
|
+
return i(e,{className:v,disabled:f,triggerLabel:j?b.button(d,x(j)):d,"aria-label":d,initialFocus:C,panelClassName:"!p-2",trigger:/* @__PURE__ */o("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */i("span",A||!j?{className:"text-sm",children:j?x(j):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:j.icon}),
|
|
3
3
|
/* @__PURE__ */i(n,{name:"chevron-down",className:"h-4 w-4"})]}),children:({close:e})=>/* @__PURE__ */i("div",{role:"listbox","aria-label":d,className:"grid gap-1",style:{gridTemplateColumns:`repeat(${p}, 2rem)`},children:u.map((n,l)=>{const t=n.value===c;/* @__PURE__ */
|
|
4
|
-
return i(a,{content:x(n),children:/* @__PURE__ */i(r,{ref:e=>{w.current[l]=e,l===k&&(
|
|
4
|
+
return i(a,{content:x(n),children:/* @__PURE__ */i(r,{ref:e=>{w.current[l]=e,l===k&&(C.current=e)},role:"option","aria-selected":t,"aria-label":x(n),pressed:t,tabIndex:l===k?0:-1,onKeyDown:e=>((e,r)=>{const n=s[r.key];if(!n)return;r.preventDefault();const a=Math.floor(e/p)+n[0],l=e%p+n[1];if(a<0||l<0||l>=p)return;const t=a*p+l;if(!(t>=u.length)){for(const[e,r]of w.current.entries())r?.setAttribute("tabindex",e===t?"0":"-1");w.current[t]?.focus()}})(l,e),onClick:()=>{m(n.value),e()},children:/* @__PURE__ */i("span",{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})})},n.value)})})})}export{c as IconPicker};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Tooltip as e}from"./chunk-
|
|
2
|
-
return s(e,{content:z??P.hint,side:
|
|
1
|
+
import{Tooltip as e}from"./chunk-2LXTJXWC.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as t}from"./chunk-OVNRVFWS.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const N="horizontal"===h,P=t().resizeHandle,k=o(null),C=o({onResize:d,min:f,max:p,side:m});C.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const D=i(()=>{k.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>D,[D]);const M=e=>{k.current&&(e.currentTarget.hasPointerCapture?.(k.current.pointer)&&e.currentTarget.releasePointerCapture(k.current.pointer),D())},T="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",I="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",R=N?`absolute inset-x-0 ${T} z-10 flex h-2`:`absolute inset-y-0 ${T} z-10 flex w-2`;/* @__PURE__ */
|
|
2
|
+
return s(e,{content:z??P.hint,side:I,delay:600,className:`${R} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??P.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),k.current={x:N?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=N?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=k.current;if(!r)return;if(0===e.buttons)return void D();const t=(N?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=C.current;o(l(r.width,t,s,n,i))},onPointerUp:M,onPointerCancel:M,onLostPointerCapture:()=>{k.current&&D()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=N?"ArrowDown":"ArrowRight",t=N?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:N?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:N?`absolute inset-x-0 ${T} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${T} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-PEELLEPP.js";import{Avatar as r}from"./chunk-UL4WB3VH.js";import{Button_default as t}from"./chunk-UDD7GB4F.js";import{useState as a}from"react";import{jsx as i,jsxs as l}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],n=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function d(){const[d,c]=a(1),o=n.find(e=>e.id===d)??n[0];/* @__PURE__ */
|
|
2
2
|
return i("div",{className:"h-full",children:/* @__PURE__ */i(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */l("div",{className:"flex h-full flex-col p-2",children:[
|
|
3
3
|
/* @__PURE__ */i(t,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,r)=>/* @__PURE__ */l("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
4
4
|
/* @__PURE__ */i("span",{children:e.label}),null!=e.count&&/* @__PURE__ */i("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */l("div",{className:"flex h-full",children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellLanguage as e}from"./chunk-SDIGC5NU.js";import{RadioGroup as a}from"./chunk-TZSPJIP4.js";import{Select_default as n}from"./chunk-
|
|
1
|
+
import{useShellLanguage as e}from"./chunk-SDIGC5NU.js";import{RadioGroup as a}from"./chunk-TZSPJIP4.js";import{Select_default as n}from"./chunk-3S52QOEP.js";import{Icon as t}from"./chunk-VJPJNCB4.js";import{useShellStrings as l}from"./chunk-OVNRVFWS.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-gray-500 ${m}`.trim(),children:[
|
|
2
2
|
/* @__PURE__ */i(t,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
|
|
3
3
|
/* @__PURE__ */i("span",{className:"block",style:{width:`${r(c.map(e=>e.name))}em`},children:/* @__PURE__ */i(n,{size:a,touchSize:a,"aria-label":u.title,value:o,onChange:e=>{g(e)},options:c.map(({tag:e,name:a})=>({value:e,label:a,lang:e}))})})]})}function o({description:n,className:t=""}){const{language:r,languages:m,setLanguage:o}=e(),c=l().language;return m.length<2?null:/* @__PURE__ */s("div",{className:`space-y-4 ${t}`.trim(),children:[
|
|
4
4
|
/* @__PURE__ */s("div",{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-PEELLEPP.js";import{Avatar as t}from"./chunk-UL4WB3VH.js";import{Input_default as a}from"./chunk-UNEJ2ABD.js";import{Button_default as i}from"./chunk-UDD7GB4F.js";import{useState as s}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
|
|
2
2
|
return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */l("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */n("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
|
|
3
3
|
/* @__PURE__ */l(t,{name:e.name,status:e.status}),
|
|
4
4
|
/* @__PURE__ */n("div",{className:"min-w-0 flex-1",children:[
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-X3II54HU.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,[I,w]=u(null),{highlighted:C}=r(),E=[];if(m(p,-Math.PI/2,2*Math.PI,0,0,"","",E),0===E.length)/* @__PURE__ */return s("p",{className:`text-sm text-gray-500 ${g??""}`,children:N});const F=Math.max(...E.map(e=>e.depth))+1,L=f/2,O=f/2,R=(f/2-8-b)/F,U=E.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),V=e=>`color-mix(in oklab, ${n(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${a.surface})`,z=e=>null!==I?e.id===I:null===C||e.branchKey===C,A=I?E.find(e=>e.id===I):void 0,B=e=>c(e.value/U*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(U),F),onMouseLeave:()=>w(null),children:[E.map(e=>/* @__PURE__ */s("path",{d:t(L,O,b+e.depth*R+v/2,b+(e.depth+1)*R-v/2,e.start,e.end),fill:V(e),fillOpacity:z(e)?1:.45,stroke:a.surface,strokeWidth:1,onMouseEnter:()=>w(e.id)},e.id)),x&&/* @__PURE__ */s("text",{x:L,y:O+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:a.label,children:x})]}),A&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(l,{title:A.label,rows:[{key:"value",label:M.value,color:V(A),value:j(A.value)},{key:"share",label:M.share,color:a.muted,value:B(A)}]})}),
|
|
4
|
+
/* @__PURE__ */s(e,{caption:M.sunburst(j(U),F),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:E.map(e=>[e.depth+1,e.label,j(e.value),B(e)])})]})}export{f as SunburstChart};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-
|
|
2
|
-
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:
|
|
1
|
+
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-CD6PGAYP.js";import{Icon as i}from"./chunk-VJPJNCB4.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
|
|
2
|
+
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:P,rowRef:D,className:B=""}){const A=x||!!p,C=n(u),J=l(null),$=s(),I=[P?.["aria-describedby"],j?$:void 0].filter(Boolean).join(" ")||void 0,K=P?.tabIndex;a(()=>{const e=J.current;if(!e||void 0!==K)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const T="comfortable"===C?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},q=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
|
|
3
3
|
/* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
|
|
4
|
-
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":
|
|
5
|
-
/* @__PURE__ */c("div",{...
|
|
6
|
-
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[
|
|
7
|
-
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:
|
|
4
|
+
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":A||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-white transition-colors duration-(--motion-fast)",w?"":A?"border-blue-300":"border-gray-200 hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${T[k]}`}),
|
|
5
|
+
/* @__PURE__ */c("div",{...P,ref:e=>{var r,t;J.current=e,t=e,"function"==typeof(r=D)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":P?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":I,onKeyDown:e=>{if(P?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",B].filter(Boolean).join(" "),children:[
|
|
6
|
+
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[q&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[q,
|
|
7
|
+
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:q})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:$})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return m(g.Provider,{value:r,children:e})}function F({value:r,onChange:a,min:c,max:S,step:F=1,shiftStep:z,precision:$,inputMin:k,inputMax:N,suffix:j,showInput:L=!0,emptyLabel:
|
|
3
|
-
return f("div",{"data-slider":"",className:`flex w-full min-w-0 items-center ${se?"flex-wrap gap-2":"gap-3"} ${
|
|
4
|
-
/* @__PURE__ */m("input",{id:
|
|
5
|
-
/* @__PURE__ */m("div",{ref:_,"data-slider-box":"",className:se?"ml-auto shrink-0":"shrink-0 text-xs",style:se?void 0:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */m(e,{value:r,onChange:e=>{null!=e?e<
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-SWSN3HZX.js";import{useSettingAuto as t,useInSettingRow as i}from"./chunk-E4Z5OXBI.js";import{useShellStrings as n}from"./chunk-OVNRVFWS.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as s,useEffect as u,useLayoutEffect as c}from"react";import{jsx as m,jsxs as f}from"react/jsx-runtime";var p=(e,t,i)=>Math.min(i,Math.max(t,e));function h(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var v=8,x=40;function b(e){return Math.max(1,...e.map(e=>(e??"").length))}var w="undefined"==typeof window?u:c;function y(e,t,i,n){return Number(p(e,t,i).toFixed(n))}var g=r(null);function S({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
|
|
2
|
+
return m(g.Provider,{value:r,children:e})}function F({value:r,onChange:a,min:c,max:S,step:F=1,shiftStep:z,precision:$,inputMin:k,inputMax:N,suffix:j,showInput:L=!0,emptyLabel:K,placeholderValue:M,stepFrom:A,label:C,"aria-labelledby":E,valueText:R,id:V,disabled:W,size:D="md",className:O="",auto:B}){const I=n(),X=o(),Z=t(),q=B??Z,H=o(),P=V??X,T=$??h(F),U=k??c,G=N??S,J=void 0!==K||void 0!==M,Q=A??M,Y=p(r??M??c,c,S),_=d(null),[ee,te]=l(null),ie=Boolean(j);w(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,L]);const ne=e=>R?R(e):"string"==typeof j?`${e.toFixed(T)} ${j}`:void 0,re=null==r?K??(null!=M?ne(M)??String(M):void 0):ne(r),le=`calc(${b([c.toFixed(T),S.toFixed(T),r?.toFixed(T),K,M?.toFixed(T)])}ch + ${(ee?.frame??10+(ie?x:v))+2}px)`,ae=s(g),oe=o(),de=ae?.set;w(()=>{de&&de(oe,L?le:null)},[de,oe,le,L]),u(()=>()=>de?.(oe,null),[de,oe]);const se=i();/* @__PURE__ */
|
|
3
|
+
return f("div",{"data-slider":"",className:`flex w-full min-w-0 items-center ${se?"flex-wrap gap-2":"gap-3"} ${O}`.trim(),children:[
|
|
4
|
+
/* @__PURE__ */m("input",{id:P,type:"range",min:c,max:S,step:F,value:Y,disabled:W,"aria-label":E?void 0:C,"aria-labelledby":E,"aria-valuetext":re,"aria-describedby":q?H:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=z;if(!i&&!(null==r&&null!=Q))return;e.preventDefault();a(y((r??Q??Y)+t*(i?z??F:F),c,S,T))},onChange:e=>a(y(Number(e.target.value),c,S,T)),className:`min-w-24 flex-1 ${se?"basis-24":""} cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 ${"sm"===D?"h-1":"h-1.5"}`}),L&&
|
|
5
|
+
/* @__PURE__ */m("div",{ref:_,"data-slider-box":"",className:se?"ml-auto shrink-0":"shrink-0 text-xs",style:se?void 0:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */m(e,{value:r,onChange:e=>{null!=e?e<U||e>G||a(e):J&&a(null)},min:U,max:G,step:F,shiftStep:z,stepFrom:Q,precision:T,snap:!0,allowEmpty:J,suffix:j,disabled:W,placeholder:K??(null!=M?M.toFixed(T):void 0),size:se?void 0:"sm",auto:q,"aria-label":C?I.slider.value(C):void 0,"aria-labelledby":C?void 0:E})}),q&&/* @__PURE__ */m("span",{id:H,hidden:!0,children:I.settingView.auto})]})}export{F as Slider,S as SliderGroup,y as settleSliderValue,b as sliderBoxChars,h as stepDecimals};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{FormField as e}from"./chunk-MVQBVPWP.js";import{zoneFocusClass as r,mediaPromptLine as t,UploadGlyph as a,dropzoneClass as o,BusyOverlay as n,isVideoUrl as l,mediaFileName as i,FilenameBadge as s}from"./chunk-
|
|
1
|
+
import{FormField as e}from"./chunk-MVQBVPWP.js";import{zoneFocusClass as r,mediaPromptLine as t,UploadGlyph as a,dropzoneClass as o,BusyOverlay as n,isVideoUrl as l,mediaFileName as i,FilenameBadge as s}from"./chunk-LI7D6SMK.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-VAACOJ2H.js";import{Icon as u}from"./chunk-VJPJNCB4.js";import{useShellStrings as p}from"./chunk-OVNRVFWS.js";import{useId as m,useState as g,useRef as f}from"react";import{jsxs as h,jsx as b}from"react/jsx-runtime";var v=/* @__PURE__ */b(u,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function y({items:u,onPick:y,onFiles:x,onRemove:D,onReorder:k,dragType:N,dropType:w,onDropData:j,label:A,hint:P,error:T,required:L,className:S,accept:C="image/*",maxSizeBytes:F,maxFiles:O,fit:V="cover",thumbSize:$=96,placeholder:z,cta:H,acceptHint:I,showCover:B=!1,coverLabel:E,busy:M=!1,busyLabel:R,progress:J,disabled:W=!1,readOnly:q=!1}){const K=p().media,Q=H??K.cta,U=E??K.cover,G=R??K.uploading,X=m(),[Y,Z]=g(null),_=W||M,ee=!(!y&&!x||_||q),re=!!D&&!_&&!q,te=!!k&&!_&&!q,ae=!!N&&!W&&!te,oe=!(!w||!j||_||q),ne=r(_),le=z??t(C,K),ie=d({accept:C,maxSizeBytes:F,maxFiles:O,acceptHint:I,multiple:!0,disabled:!ee,currentCount:u.length,onAccept:e=>{if(x)x(e);else for(const r of e)y(r)}}),[se,de]=g(!1),ce=f(0),ue=e=>oe&&Array.from(e.dataTransfer?.types??[]).includes(w),pe=ie.zoneProps,me={onDragEnter:e=>{if(!ue(e))return pe.onDragEnter?.(e);e.preventDefault(),ce.current+=1,de(!0)},onDragOver:e=>{if(!ue(e))return pe.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",se||de(!0)},onDragLeave:e=>{if(!ue(e))return pe.onDragLeave?.(e);ce.current=Math.max(0,ce.current-1),0===ce.current&&de(!1)},onDrop:e=>{if(!ue(e))return pe.onDrop?.(e);e.preventDefault(),ce.current=0,de(!1);const r=e.dataTransfer.getData(w);r&&j(r)}},ge=ie.dragOver||se,fe=()=>{ee&&(y?y():ie.open())},he={width:$,height:$},be=ee&&/* @__PURE__ */h("button",{type:"button",onClick:()=>fe(),"aria-label":K.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${ne}`,style:he,children:[
|
|
2
2
|
/* @__PURE__ */b(a,{className:"h-5 w-5"}),
|
|
3
|
-
/* @__PURE__ */b("span",{className:"text-xs font-medium text-gray-500",children:
|
|
3
|
+
/* @__PURE__ */b("span",{className:"text-xs font-medium text-gray-500",children:K.add})]}),ve=ee?/* @__PURE__ */h("button",{type:"button",onClick:()=>fe(),"aria-label":"string"==typeof le?le:K.upload,className:o(ge,!1,ne),style:{minHeight:$+32},children:[
|
|
4
4
|
/* @__PURE__ */b("span",{className:"text-gray-400",children:/* @__PURE__ */b(a,{})}),
|
|
5
5
|
/* @__PURE__ */b("span",{className:"px-3 text-xs text-gray-500",children:le}),
|
|
6
|
-
/* @__PURE__ */b("span",{className:"text-sm font-medium text-blue-600",children:
|
|
7
|
-
return h(e,{label:A,labelId:A?`${
|
|
8
|
-
/* @__PURE__ */h("div",{id:
|
|
9
|
-
return h("div",{draggable:te||ae&&!!e.dragData||void 0,onDragStart:te?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),Z(r)}:ae&&e.dragData?r=>{r.dataTransfer.effectAllowed="link",r.dataTransfer.setData(N,e.dragData)}:void 0,onDragEnd:te?()=>Z(null):void 0,onDragOver:te?e=>{null!=Y&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:te?e=>{null!=Y&&(e.preventDefault(),e.stopPropagation(),Y!==r&&k(Y,r),Z(null))}:void 0,tabIndex:te?0:void 0,"aria-label":te?
|
|
6
|
+
/* @__PURE__ */b("span",{className:"text-sm font-medium text-blue-600",children:Q}),I&&/* @__PURE__ */b("span",{className:"text-xs text-gray-400",children:I})]}):/* @__PURE__ */b("div",{className:"flex w-full items-center justify-center rounded-lg border border-gray-200 bg-gray-50 px-3 text-xs text-gray-400",style:{minHeight:$+32},children:/* @__PURE__ */b("span",{className:M?"invisible":void 0,children:K.empty})});/* @__PURE__ */
|
|
7
|
+
return h(e,{label:A,labelId:A?`${X}-label`:void 0,htmlFor:X,hint:P,error:T,required:L,className:S,children:[
|
|
8
|
+
/* @__PURE__ */h("div",{id:X,role:"group","aria-labelledby":A?`${X}-label`:void 0,"aria-describedby":T?`${X}-error`:P?`${X}-hint`:void 0,"aria-busy":M||void 0,...ie.zoneProps,...oe?me:{},className:"relative rounded-lg transition-colors",style:{..._?{opacity:.6}:{},...ge?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===u.length?ve:/* @__PURE__ */h("div",{className:"flex flex-wrap gap-2",children:[u.map((e,r)=>{const t=e.kind?"video"===e.kind:l(e.url,C),a=i(e.url),o=B&&(e.cover??0===r);/* @__PURE__ */
|
|
9
|
+
return h("div",{draggable:te||ae&&!!e.dragData||void 0,onDragStart:te?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),Z(r)}:ae&&e.dragData?r=>{r.dataTransfer.effectAllowed="link",r.dataTransfer.setData(N,e.dragData)}:void 0,onDragEnd:te?()=>Z(null):void 0,onDragOver:te?e=>{null!=Y&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:te?e=>{null!=Y&&(e.preventDefault(),e.stopPropagation(),Y!==r&&k(Y,r),Z(null))}:void 0,tabIndex:te?0:void 0,"aria-label":te?K.reorder(a,r+1,u.length):void 0,onKeyDown:te?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?r>0&&(e.preventDefault(),k(r,r-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||r<u.length-1&&(e.preventDefault(),k(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",ne,Y===r?"opacity-50":""].join(" "),style:{...he,cursor:te?"move":void 0},children:[t?/* @__PURE__ */b("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:V}}):/* @__PURE__ */b("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:V}}),o&&/* @__PURE__ */b("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-2 py-0.5 text-xs font-medium text-white",children:U}),!o&&null!=e.mark&&/* @__PURE__ */b("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-white",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),null!=e.caption&&/* @__PURE__ */b(s,{children:e.caption}),re&&/* @__PURE__ */b("button",{type:"button",onClick:()=>D(e.id),"aria-label":e.removeLabel??K.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${ne}`,style:{background:"var(--rosh-media-scrim-button)"},children:v})]},e.id)}),be]}),M&&/* @__PURE__ */b(n,{label:G,progress:J})]}),!y&&x&&/* @__PURE__ */b("input",{...ie.inputProps}),
|
|
10
10
|
/* @__PURE__ */b(c,{rejections:ie.rejections})]})}export{y as MediaUploadGrid};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveGrip as r,MoveHint as t,moveFromKey as a}from"./chunk-
|
|
1
|
+
import{MOVE_KEYS as e,MoveGrip as r,MoveHint as t,moveFromKey as a}from"./chunk-CD6PGAYP.js";import{GROUP_COLORS as n}from"./chunk-5SULG7D5.js";import{OneLineLabel as o}from"./chunk-7T3COEQK.js";import{Icon as i}from"./chunk-VJPJNCB4.js";import{Tooltip as s}from"./chunk-2LXTJXWC.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c}from"./chunk-OVNRVFWS.js";import{useRef as d,useCallback as u,useId as p,isValidElement as m}from"react";import{jsx as g,jsxs as h}from"react/jsx-runtime";var f='[role="treeitem"]';function b(e){return[...e.querySelectorAll(f)].filter(r=>{for(let t=r.parentElement?.closest('[role="group"]');t&&e.contains(t);t=t.parentElement?.closest('[role="group"]')??null)if(t.hasAttribute("hidden"))return!1;return!0})}function y({"aria-label":e,"aria-labelledby":r,children:t,className:a="",rootProps:n}){const o=d(null);l(()=>{const e=o.current;if(!e)return;const r=[...e.querySelectorAll(f)];if(0===r.length)return;const t=r.find(e=>e===document.activeElement)??r.find(e=>"true"===e.getAttribute("aria-selected"))??b(e)[0]??r[0];for(const e of r)e.tabIndex=e===t?0:-1});const i=u(e=>{n?.onKeyDown?.(e);const r=o.current,t=e.target.closest?.(f);if(!r||!t||e.target!==t||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const a=b(r),i=a.indexOf(t),s=Number(t.getAttribute("aria-level")??"1"),l=t=>{e.preventDefault(),function(e,r){if(r){for(const t of e.querySelectorAll(f))t.tabIndex=t===r?0:-1;r.focus()}}(r,t)};switch(e.key){case"ArrowDown":l(a[i+1]);break;case"ArrowUp":l(a[i-1]);break;case"Home":l(a[0]);break;case"End":l(a[a.length-1]);break;case"ArrowRight":if("true"===t.getAttribute("aria-expanded")){const r=a[i+1];r&&Number(r.getAttribute("aria-level")??"1")>s?l(r):e.preventDefault()}break;case"ArrowLeft":if("true"!==t.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(a[e].getAttribute("aria-level")??"1")<s){l(a[e]);break}}},[n]);/* @__PURE__ */
|
|
2
2
|
return g("div",{...n,ref:o,role:"tree","aria-label":r?void 0:e,"aria-labelledby":r,onKeyDown:i,className:`flex flex-col gap-1 ${a}`.trim(),children:t})}function v({children:e,hidden:r,className:t=""}){/* @__PURE__ */
|
|
3
3
|
return g("div",{role:"group",hidden:r,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${t}`.trim(),children:e})}var x=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal"].join(" "),k=`${x} bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600`;function w(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!m(e)&&"label"in e}function N(e){if(null==e||!1===e)return null;const r=Array.isArray(e)&&e.length>0&&e.every(w)?e:w(e)?[e]:null;return r?r.map((e,r)=>/* @__PURE__ */g("span",{"data-tree-count":"","data-tone":e.tone,className:e.tone?`${x} ${n[e.tone]}`:k,children:e.label},r)):/* @__PURE__ */g("span",{"data-tree-count":"",className:k,children:e})}function A({children:e,count:r,expanded:t,onToggle:a}){const n=void 0!==t,i=
|
|
4
4
|
/* @__PURE__ */g("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */g(o,{children:e})}),s=null!=r&&!1!==r&&/* @__PURE__ */g("span",{"data-tree-count":"",className:k,children:r}),l="text-xs font-semibold uppercase tracking-wide text-gray-500";return n?/* @__PURE__ */g("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */h("button",{type:"button","aria-expanded":t,onClick:a,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-gray-900","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",l].join(" "),children:[
|
|
5
5
|
/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:j(!!t)}),i,s]})}):/* @__PURE__ */h("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${l}`,children:[
|
|
6
|
-
/* @__PURE__ */g("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),i,s]})}var j=e=>/* @__PURE__ */g(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),P={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function
|
|
7
|
-
return h("div",{
|
|
8
|
-
/* @__PURE__ */g(r,{marker:"tree",hint:
|
|
9
|
-
/* @__PURE__ */g("span",
|
|
6
|
+
/* @__PURE__ */g("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),i,s]})}var j=e=>/* @__PURE__ */g(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),P={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function C({label:n,level:i=1,icon:s,preview:l,selected:c=!1,expanded:d,onToggle:u,onSelect:m,muted:f=!1,badge:b,actions:y,actionsPinned:v=!1,actionsOverlay:x=!0,rename:k,drop:w,dragging:A=!1,draggable:C=!1,dragHint:D,onMove:$,rowProps:K,className:E=""}){const I=void 0!==d,S=p(),T=[K?.["aria-describedby"],$?S:void 0].filter(Boolean).join(" ")||void 0,H=c?"bg-blue-50 text-blue-700":"into"===w?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
|
|
7
|
+
return h("div",{...K,role:"treeitem","aria-level":i,"aria-selected":c,"aria-expanded":I?d:void 0,tabIndex:c?0:-1,"aria-keyshortcuts":K?.["aria-keyshortcuts"]??($?e:void 0),"aria-describedby":T,"data-drop":w,"data-draggable":C||void 0,onKeyDown:e=>{if(K?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const r=a(e);r&&$?(e.preventDefault(),$(r)):"Enter"!==e.key&&" "!==e.key||!m?("ArrowRight"===e.key&&I&&!d&&u||"ArrowLeft"===e.key&&I&&d&&u)&&(e.preventDefault(),u()):(e.preventDefault(),m())},onClick:e=>{K?.onClick?.(e),e.defaultPrevented||m?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",C?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",H,"into"===w?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",A?"opacity-40":"",E].filter(Boolean).join(" "),children:["before"===w&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===w&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),C&&
|
|
8
|
+
/* @__PURE__ */g(r,{marker:"tree",hint:D,dragging:A,revealClassName:"group-hover/treerow:opacity-100"}),
|
|
9
|
+
/* @__PURE__ */g("span",I?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),u?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:j(!!d)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=s&&/* @__PURE__ */g("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(f?"text-gray-400":""),children:s}),
|
|
10
10
|
/* @__PURE__ */h("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[k??
|
|
11
11
|
/* @__PURE__ */g("span",{className:`flex min-w-0 ${c?"font-semibold":"font-medium"} ${f?"text-gray-400 line-through":""}`,children:/* @__PURE__ */h(o,{children:[n,null!=l&&/* @__PURE__ */g("span",{className:"ml-2 font-normal text-gray-500",children:l})]})}),N(b),null!=y&&!x&&/* @__PURE__ */g("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(v||f?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:y})]}),null!=y&&x&&
|
|
12
12
|
/* @__PURE__ */h("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:P,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(v||f||c?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
|
|
13
13
|
/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
14
14
|
/* @__PURE__ */g("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
15
|
-
/* @__PURE__ */g("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:y})]})
|
|
15
|
+
/* @__PURE__ */g("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:y})]}),$&&/* @__PURE__ */g(t,{id:S})]})}function D({onAdd:e,label:r,drop:t=!1,slotProps:a}){const n=c().tree,o=t?n.dropHere:r??n.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(t?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
|
|
16
16
|
return g("div",{...a,role:"presentation","data-drop":t||void 0,children:e?/* @__PURE__ */h("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
|
|
17
|
-
/* @__PURE__ */g("span",{"aria-hidden":"true",children:"+"}),o]}):/* @__PURE__ */g("span",{className:i,children:o})})}function
|
|
17
|
+
/* @__PURE__ */g("span",{"aria-hidden":"true",children:"+"}),o]}):/* @__PURE__ */g("span",{className:i,children:o})})}function $({onInsert:e,label:r,drop:t=!1,seamProps:a}){const n=c().tree,o=r??n.insertHere,l=t?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
|
|
18
18
|
return h("div",{...a,role:"presentation","data-tree-seam":"","data-drop":t||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${a?.className??""}`.trim(),children:[
|
|
19
19
|
/* @__PURE__ */g("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
|
|
20
|
-
/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${l}`}),e&&/* @__PURE__ */g(s,{content:o,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */g("button",{type:"button","aria-label":o,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(t?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */g(i,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}export{y as Tree,
|
|
20
|
+
/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${l}`}),e&&/* @__PURE__ */g(s,{content:o,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */g("button",{type:"button","aria-label":o,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(t?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */g(i,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}export{y as Tree,D as TreeEmptySlot,v as TreeGroup,A as TreeGroupLabel,C as TreeRow,$ as TreeSeam};
|
|
@@ -0,0 +1,9 @@
|
|
|
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-LI7D6SMK.js";import{TransferProgress as d}from"./chunk-FARRGETL.js";import{Segmented as u}from"./chunk-CHNYSP6K.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 N,Fragment as j}from"react/jsx-runtime";var x=["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 L({value:L,onChange:w,onPick:R,onFile:C,label:P,hint:F,error:U,required:O,className:V,accept:$="image/*",maxSizeBytes:z,fit:H="cover",height:S=112,placeholder:A,cta:B,acceptHint:J,showFilename:M=!0,allowReplace:q=!0,allowRemove:I=!0,replaceLabel:K,removeLabel:W,busy:Q=!1,busyLabel:Y,choosingLabel:_,pickFailedLabel:D,progress:E,disabled:G=!1,kind:T,onKindChange:X,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=B??ie.cta,re=T??(/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=Q||ne,me=ne&&!Q?_??ie.choosing:Y??ie.uploading,he=U??(se?D??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&w(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=G||ue,ke=!!L&&(i(L,$)||L===ve),Ne=A??t($,ie),je=K??(ke||"video"===re?ie.changeVideo:ie.changeImage),xe=e=>{R?pe(e):C?C(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),w(a)})(e)},Le=m({accept:$,maxSizeBytes:z,acceptHint:J,multiple:!1,disabled:ye,onAccept:([e])=>xe(e)}),{dragOver:we}=Le,Re=()=>{ye||(R?pe():Le.open())},Ce=L?r(L):"",Pe=!ke&&!!ee,Fe=G||!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:Pe?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${x}`,children:[
|
|
2
|
+
/* @__PURE__ */N(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
3
|
+
/* @__PURE__ */N("span",{id:`${be}-change`,className:"truncate",children:je})]}),I&&/* @__PURE__ */N("button",{type:"button","aria-label":oe,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),w("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${x}`,children:/* @__PURE__ */N(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Ue=/* @__PURE__ */k("div",{...Le.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Pe?"":"bg-gray-100",we?"border-blue-500":"border-gray-200"].join(" "),style:Pe?void 0:{height:S},children:[Pe?
|
|
4
|
+
/* @__PURE__ */N(e,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:L,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */N("video",{src:L??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ce||void 0,className:"h-full w-full",style:{objectFit:H}}):/* @__PURE__ */N("img",{src:L??void 0,alt:Ce,className:"h-full w-full",style:{objectFit:H,objectPosition:Z||void 0}}),M&&L&&/* @__PURE__ */N(o,{children:Ce}),Fe,ue&&/* @__PURE__ */N(n,{label:me,progress:E,rounded:"rounded-md"})]}),Oe=/* @__PURE__ */N("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof Ne?Ne:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":O||void 0,"aria-describedby":he?`${be}-error`:F?`${be}-hint`:void 0,...Le.zoneProps,className:s(we,ye,c(ye)),style:{minHeight:S},children:ue?/* @__PURE__ */N(d,{state:"busy",verb:me,pct:E}):/* @__PURE__ */k(j,{children:[
|
|
5
|
+
/* @__PURE__ */N("span",{className:"text-gray-400",children:/* @__PURE__ */N(l,{})}),
|
|
6
|
+
/* @__PURE__ */N("span",{className:"px-3 text-xs text-gray-500",children:Ne}),
|
|
7
|
+
/* @__PURE__ */N("span",{className:"text-sm font-medium text-blue-600",children:te}),J&&/* @__PURE__ */N("span",{className:"text-xs text-gray-400",children:J})]})});/* @__PURE__ */
|
|
8
|
+
return k(a,{label:P,htmlFor:be,hint:F,error:he,required:O,className:V,children:[X&&/* @__PURE__ */N("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */N(u,{value:re,onChange:e=>X(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */N(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */N(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof P&&P?P:ie.upload})}),L?Ue:Oe,!R&&/* @__PURE__ */N("input",{...Le.inputProps}),
|
|
9
|
+
/* @__PURE__ */N(h,{rejections:Le.rejections})]})}export{L as MediaUploadField};
|
|
@@ -0,0 +1,4 @@
|
|
|
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-GLUJS42B.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 k({trigger:k,children:C,title:N,description:D,"aria-label":E,align:L="start",side:j="bottom",open:T,defaultOpen:O=!1,onOpenChange:$,matchTriggerWidth:H=!1,maxHeight:K,initialFocus:S,id:W,triggerLabel:J,"aria-describedby":M,disabled:P,className:U="",triggerClassName:z,panelClassName:R=""}){const[B,G]=p(O),F=(T??B)&&!P,I=u(),A=f(null),Q=f(null),V=f(null),X=f(null),Y=h(),q=W??Y,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=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:L,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=L},[L,j,H,K]);d(()=>{F&&I&&ce()}),v(()=>{if(!F||!I)return;const e=l(()=>Q.current,ce),t=X.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>ce());return r.observe(t),()=>{e(),r.disconnect()}},[F,I,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&&(A.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"),n=i(()=>oe()),o=m(e=>"Escape"===e.key&&(oe(),Q.current?.focus(),!0),()=>V.current);return()=>{t(),r(),n(),o()}},[F,oe]),e(V,F&&I),d(()=>{if(!F||!I)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})}},[F,I]),v(()=>{if(!F||!I)return;const e=V.current;e&&(re.current=!1,(S?.current??t(e)[0]??e).focus({preventScroll:!0}))},[F,I]);const se="function"==typeof C?C({close:()=>oe()}):C,le=N?{"aria-labelledby":_}:E?{"aria-label":E}:{"aria-labelledby":q};/* @__PURE__ */
|
|
2
|
+
return x("div",{ref:A,className:`relative inline-flex ${U}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */w("button",{ref:Q,id:q,type:"button","aria-haspopup":"dialog","aria-expanded":F,"aria-controls":F&&I?Z:void 0,"aria-label":J,"aria-describedby":M,disabled:P,onClick:()=>F?oe():ie(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!F)return;const r=(()=>{const e=V.current;return e?t(e)[0]??e:null})();r&&(e.preventDefault(),r.focus({preventScroll:!0}))},className:z??n({variant:"secondary"}),children:k}),F&&I&&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 ${R}`.trim(),style:y.test(R)?void 0:{zIndex:o.popup},children:/* @__PURE__ */x("div",{ref:X,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};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-5SULG7D5.js";import{OneLineLabel as i}from"./chunk-7T3COEQK.js";import{Icon as r}from"./chunk-VJPJNCB4.js";import{useShellStrings as s}from"./chunk-OVNRVFWS.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
2
2
|
return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
|
|
3
3
|
/* @__PURE__ */n(i,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(r,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{Checkbox_default as e}from"./chunk-CGZBDI6C.js";import{Pagination as t}from"./chunk-XKCEVZZB.js";import{TH_ONE_LINE as r,OneLineLabel as o}from"./chunk-
|
|
1
|
+
import{Checkbox_default as e}from"./chunk-CGZBDI6C.js";import{Pagination as t}from"./chunk-XKCEVZZB.js";import{TH_ONE_LINE as r,OneLineLabel as o}from"./chunk-7T3COEQK.js";import{SpinnerRing as n}from"./chunk-Q5MD3VY6.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as s}from"./chunk-OVNRVFWS.js";import{useState as a,useRef as i}from"react";import{jsxs as c,Fragment as d,jsx as h}from"react/jsx-runtime";function u(e){const t={};if(!e)return t;for(const[r,o]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||(t[r]=o);return t}var m=e=>Array.isArray(e.columns),g=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",f="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",p={sm:"px-2 py-2",md:"px-3 py-2"},y={left:"text-left",right:"text-right",center:"text-center"};function b({direction:e}){/* @__PURE__ */
|
|
2
2
|
return c("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
3
3
|
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 0L8 5H0z"})}),
|
|
4
|
-
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:S=!1,size:$="md",minWidth:z,rowClassName:H,onRow:
|
|
5
|
-
return h("th",{scope:"col",...J("columnheader"),rowSpan:n>1?n:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...i?{left:(Be[t]??0)+be}:{},...
|
|
4
|
+
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:S=!1,size:$="md",minWidth:z,rowClassName:H,onRow:T,rowHref:I,onRowPress:O,linkAs:D,emptyText:E,selection:F,footer:A,virtualized:K,stackOnNarrow:L=!1,stackBelow:P,className:R=""}){const V=s(),W=E??V.table.empty,Z=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),Q=L&&!K,G=Q?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),J=e=>Q?{role:e}:{},X=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[Y,q]=a(0),U=K?.overscan??6,_=K?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/K.rowHeight)-U);q(e=>e===t?e:t)}:void 0,ee=K?Math.ceil(K.height/K.rowHeight)+2*U:v.length,te=K?Math.min(Y,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=K?te*K.rowHeight:0,ne=K?(v.length-re)*K.rowHeight:0,le=i(null),[se,ae]=a(0);l(()=>{if(!K)return;const e=le.current?.offsetHeight??0;ae(t=>t===e?t:e)});const ie=e=>e.sortField??e.key,ce=e=>N&&N.field===ie(e)?N.direction:null,de=G.flatMap(e=>m(e)?e.columns:[e]),he=G.some(m),ue=/* @__PURE__ */new Map;if(Q)for(const e of G)if(m(e))for(const t of e.columns)ue.set(t,X(e.title,e.label));const me=e=>{const t=X(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},ge=new Set(F?.selected??[]),fe=F?v.map((e,t)=>Z(e,t)):[],pe=fe.length>0&&fe.every(e=>ge.has(e)),ye=fe.some(e=>ge.has(e)),be=F?36:0,we=de.length+(F?1:0),xe=de.some(e=>"left"===e.fixed),ve=Q&&!F&&de.some(e=>e.cardCorner),ke=D??"a",Ne=`${p[$]} ${"sm"===$?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,n,l=0)=>{const s=ce(e),a=y[e.align??(e.numeric?"right":"left")],i="left"===e.fixed,d=!(!e.sortable||!C);/* @__PURE__ */
|
|
5
|
+
return h("th",{scope:"col",...J("columnheader"),rowSpan:n>1?n:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...i?{left:(Be[t]??0)+be}:{},...K?{top:l}:{}},className:[Ne,a,r,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs",i?K?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":K?"sticky z-10 bg-gray-50":"",Q&&d?"rosh-dt-sort":"",Q?g(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:Ce(e,d?/* @__PURE__ */c("button",{type:"button",onClick:()=>(e=>{if(!C)return;const t=ie(e),r=ce(e),o=e.sortFirst??"asc";C(null===r?{field:t,direction:o}:r===o?{field:t,direction:"asc"===o?"desc":"asc"}:null)})(e),"data-group":Q?ue.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${a}`,children:[
|
|
6
6
|
/* @__PURE__ */h(o,{children:e.title}),
|
|
7
7
|
/* @__PURE__ */h(b,{direction:s})]}):/* @__PURE__ */h(o,{children:e.title}))},e.key)};let Me=0;const Be=de.map(e=>{if("left"!==e.fixed)return null;const t=Me;return Me+=e.width??0,t}),Se=/* @__PURE__ */c(d,{children:[
|
|
8
|
-
/* @__PURE__ */c("div",{onScroll:_,style:
|
|
8
|
+
/* @__PURE__ */c("div",{onScroll:_,style:K?{maxHeight:K.height}:void 0,className:`relative overflow-x-auto ${K?"overflow-y-auto":""} ${S?"rounded-lg border border-gray-200":""}${Q?" rosh-dt-scroll":""}`.trim(),children:[B&&
|
|
9
9
|
/* @__PURE__ */c("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
|
|
10
10
|
/* @__PURE__ */h(n,{className:"h-6 w-6"}),
|
|
11
|
-
/* @__PURE__ */h("span",{className:"sr-only",children:
|
|
12
|
-
/* @__PURE__ */c("table",{...J("table"),className:(
|
|
13
|
-
/* @__PURE__ */c("thead",{...J("rowgroup"),className:
|
|
14
|
-
/* @__PURE__ */c("tr",{ref:le,...J("row"),className:"border-b border-gray-200 bg-gray-50",children:[F&&/* @__PURE__ */h("th",{scope:"col",...J("columnheader"),rowSpan:he?2:void 0,style:{width:36,...
|
|
15
|
-
/* @__PURE__ */h("tbody",{...J("rowgroup"),className:
|
|
16
|
-
return c("tr",{...u(n),...J("row"),style:
|
|
17
|
-
return h("td",{...J("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",
|
|
18
|
-
return h("td",{...J("cell"),"data-label":l?me(e):void 0,style:r?{left:(Be[t]??0)+be}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",
|
|
19
|
-
/* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},
|
|
20
|
-
return h("div",
|
|
11
|
+
/* @__PURE__ */h("span",{className:"sr-only",children:V.table.loading})]}),
|
|
12
|
+
/* @__PURE__ */c("table",{...J("table"),className:(Q?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:z?{minWidth:z}:void 0,children:[M&&/* @__PURE__ */h("caption",{className:"sr-only",children:M}),
|
|
13
|
+
/* @__PURE__ */c("thead",{...J("rowgroup"),className:Q?"rosh-dt-head":void 0,children:[
|
|
14
|
+
/* @__PURE__ */c("tr",{ref:le,...J("row"),className:"border-b border-gray-200 bg-gray-50",children:[F&&/* @__PURE__ */h("th",{scope:"col",...J("columnheader"),rowSpan:he?2:void 0,style:{width:36,...K?{top:0}:{}},className:[Ne,r,xe||K?"sticky z-20 bg-gray-50":"",xe?"left-0":"",Q?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(e,{"aria-label":V.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!F)return;const e=new Set(fe);F.onChange(pe?F.selected.filter(t=>!e.has(t)):[...F.selected,...fe.filter(e=>!ge.has(e))])}})}),G.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...J("columnheader"),colSpan:e.columns.length,style:K?{top:0}:void 0,className:[Ne,"text-center",r,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs","border-b border-gray-200",K?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(o,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...J("row"),className:"border-b border-gray-200 bg-gray-50",children:G.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
|
|
15
|
+
/* @__PURE__ */h("tbody",{...J("rowgroup"),className:Q?"rosh-dt-body":void 0,children:0!==v.length||B?/* @__PURE__ */c(d,{children:[oe>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:oe,padding:0,border:0}})}),v.slice(te,re).map((t,r)=>{const o=te+r,n=T?.(t,o),l=!!n?.current,s=I?.(t,o),a=void 0===s&&O?()=>O(t,o):void 0,i=void 0!==s||void 0!==a;let d=!1;const m=(e,t)=>{if(d=!0,!i)return e;const r=[f,a?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:a,className:r,"aria-current":o,children:e})},p=de.map(e=>e.render?e.render(t,o,m):e.dataIndex?t[e.dataIndex]:null);if(i&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
16
|
+
return c("tr",{...u(n),...J("row"),style:K?{height:K.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!i?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[Q?F?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",Q&&ve?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",i?"rosh-dt-linked hover:bg-gray-50":"",l?"rosh-dt-current":"",H?.(t,o)??"",n?.className??""].filter(Boolean).join(" "),children:[F&&(()=>{const r=Z(t,o);/* @__PURE__ */
|
|
17
|
+
return h("td",{...J("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",Q?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(e,{"aria-label":V.table.selectRow,checked:ge.has(r),onChange:()=>(e=>{F&&F.onChange(ge.has(e)?F.selected.filter(t=>t!==e):[...F.selected,e])})(r)})})})(),de.map((e,t)=>{const r="left"===e.fixed,o=p[t],n=ve&&!!e.cardCorner,l=Q&&!n&&"wide"!==e.only;/* @__PURE__ */
|
|
18
|
+
return h("td",{...J("cell"),"data-label":l?me(e):void 0,style:r?{left:(Be[t]??0)+be}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",Q?g(e):"",Ne,y[e.align??(e.numeric?"right":"left")],Q?"":w(e),"text-gray-900",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:Q?
|
|
19
|
+
/* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},Z(t,o))}),ne>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:ne,padding:0,border:0}})})]}):/* @__PURE__ */h("tr",{...J("row"),className:Q?"rosh-dt-empty":void 0,children:/* @__PURE__ */h("td",{...J("cell"),colSpan:we,className:`${Ne} py-10 text-center text-gray-500`,children:W})})})]}),A]}),j&&j.pageCount>1&&/* @__PURE__ */h("div",{className:Q?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */h(t,{page:j.page,pageCount:j.pageCount,onPageChange:j.onPageChange})})]});/* @__PURE__ */
|
|
20
|
+
return h("div",Q?void 0!==P&&P>0&&40!==P?{className:`rosh-dt-at ${R}`.trim(),children:/* @__PURE__ */h("div",{className:"rosh-dt-stack",style:{width:40/P*100+"%"},children:/* @__PURE__ */h("div",{className:"rosh-dt-fit",style:{width:P/40*100+"%"},children:Se})})}:{className:`rosh-dt-stack ${R}`.trim(),children:Se}:{className:R,children:Se})}export{x as DataTable};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{StatCard as e,Card as a}from"./chunk-RD5UPROC.js";import{Avatar as t}from"./chunk-UL4WB3VH.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-2DGTGJYJ.js";import{ColumnChart as l}from"./chunk-UWHGJTAL.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-
|
|
1
|
+
import{StatCard as e,Card as a}from"./chunk-RD5UPROC.js";import{Avatar as t}from"./chunk-UL4WB3VH.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-2DGTGJYJ.js";import{ColumnChart as l}from"./chunk-UWHGJTAL.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-5SULG7D5.js";import{TH_ONE_LINE as c}from"./chunk-7T3COEQK.js";import{Button_default as n}from"./chunk-UDD7GB4F.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
|
|
2
2
|
return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */m("div",{className:"mx-auto max-w-6xl space-y-6",children:[
|
|
3
3
|
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */m("div",{children:[
|
|
@@ -0,0 +1,8 @@
|
|
|
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-5SULG7D5.js";import{Tooltip as o}from"./chunk-2LXTJXWC.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-GLUJS42B.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:L,disabled:C,id:D,className:W="",tone:S,tooltip:E,split:T}){const[F,J]=m(!1),[$,G]=m(""),H=d(),M=h(null),B=h(null),I=h(null),R=a(M,F),U=e=>k.find(t=>t.value===e)?.label??e,V=p(()=>{const t=new Set(r),n=[],o=$.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,$]),X=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)},z=e=>{e&&!r.includes(e)?(y([...r,e]),G("")):G("")},K=e=>y(r.filter(t=>t!==e)),O=()=>{const e=$.trim();if(T&&e)return X(e.split(T)),void G("");j&&e?z(e):G("")},P=h(()=>{});P.current=()=>{O(),J(!1)},f(()=>{if(!F)return;const e=e=>{const t=e.target;M.current?.contains(t)||I.current?.contains(t)||(O(),J(!1))};document.addEventListener("mousedown",e);const t=l(()=>P.current());return()=>{document.removeEventListener("mousedown",e),t()}});const Y=k.length>0;/* @__PURE__ */
|
|
2
|
+
return v("div",{ref:M,className:"relative",children:[
|
|
3
|
+
/* @__PURE__ */v("div",{onMouseDown:e=>{C||e.target.closest("button")||(e.preventDefault(),B.current?.focus())},className:n({invalid:L,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)] ${C?"bg-gray-50 cursor-not-allowed":""} ${W}`}),children:[r.map(e=>{const t=S?.(e),n=w[t??"accent"],r=/* @__PURE__ */v("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
+
/* @__PURE__ */x("span",{className:"truncate",children:U(e)}),!C&&/* @__PURE__ */x("button",{type:"button","aria-label":H.select.removeItem?.(U(e))??`${H.select.remove} ${U(e)}`,onClick:()=>K(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:B,type:"text",autoComplete:"off",role:"combobox","aria-expanded":F&&Y,"aria-invalid":L||void 0,disabled:C,value:$,placeholder:0===r.length?N:void 0,onChange:e=>{(e=>{if(T){const t=e.split(T);if(t.length>1)return X(t.slice(0,-1)),void G(t[t.length-1])}G(e)})(e.target.value),J(!0)},onFocus:()=>{!C&&Y&&J(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=$.trim(),r=n?V.filter(t=>e(t,n.toLowerCase())):[];1===r.length?z(r[0].value):O()}else"Backspace"===t.key&&""===$&&r.length>0?K(r[r.length-1]):"Escape"===t.key?(J(!1),G(""),B.current?.blur()):"Tab"===t.key&&(O(),J(!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"})]}),F&&Y&&g(
|
|
6
|
+
/* @__PURE__ */x("div",{ref:I,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:R?.left,right:R?.right,top:R?.top,bottom:R?.bottom,minWidth:R?.minWidth,maxWidth:R?.maxWidth??s,width:"max-content",visibility:R?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:R?.maxHeight??c},children:0===V.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&r.length>=k.length?H.select.allSelected:H.select.noMatches}):V.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),z(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-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};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{useSettingAuto as e,useInSettingRow as t}from"./chunk-E4Z5OXBI.js";import{IconButton_default as r}from"./chunk-
|
|
2
|
-
return f("div",{className:"relative","data-number-box":"",children:[S&&/* @__PURE__ */m("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:S}),Ee,je,
|
|
1
|
+
import{useSettingAuto as e,useInSettingRow as t}from"./chunk-E4Z5OXBI.js";import{IconButton_default as r}from"./chunk-HMZLRXLA.js";import{inputClasses as n}from"./chunk-JFSYWEHD.js";import{Icon as i}from"./chunk-VJPJNCB4.js";import{registerModalEscapeInterceptor as o}from"./chunk-TWVUQUUD.js";import{useShellStrings as a}from"./chunk-OVNRVFWS.js";import{forwardRef as l,useId as c,useState as u,useRef as s,useCallback as d,useEffect as p}from"react";import{jsx as m,jsxs as f,Fragment as b}from"react/jsx-runtime";function v(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var h=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function y({dir:e,compact:t,label:n,disabled:o,onStep:a}){const l=s(a);l.current=a;const c=s({}),u=d(()=>{const e=c.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),c.current={}},[]);p(()=>u,[u]),p(()=>{o&&u()},[o,u]);const f=/* @__PURE__ */m(i,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:t?2.6:2}),b={tabIndex:-1,"aria-label":n,disabled:o,onPointerDown:e=>{if(0!==e.button||o)return;e.preventDefault(),u();const t=e.shiftKey;l.current(t);const r=e.currentTarget.ownerDocument.defaultView??window;r.addEventListener("pointerup",u),c.current={off:()=>r.removeEventListener("pointerup",u),wait:setTimeout(()=>{c.current.every=setInterval(()=>l.current(t),60)},400)}},onPointerLeave:u,onPointerCancel:u,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return t?/* @__PURE__ */m("button",{type:"button",...b,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:f}):/* @__PURE__ */m(r,{size:"sm",...b,children:f})}var g=l(function({value:r,onChange:i,min:l,max:g,precision:x,step:w,shiftStep:k,disabled:N,readOnly:E,invalid:j,placeholder:D,size:F,prefix:S,suffix:B,id:W,name:C,className:L="",onBlur:O,onFocus:K,steppers:M,stepFrom:P,snap:U=!1,allowEmpty:V=!0,appearance:T="box",display:$,reportWhileTyping:I=!0,onRevert:z,"aria-label":A,"aria-labelledby":J,"aria-describedby":R,auto:X,...H},Y){const Z="bare"===T,Q=e(),q=X??Q,G=c(),_="string"==typeof B&&""!==B.trim()?B.trim():void 0,ee=e=>function(e,t){let r=e.trim();if(t&&r.endsWith(t)&&(r=r.slice(0,-t.length).trim()),r=r.replace(",","."),""===r||"-"===r||"."===r||"-."===r)return null;const n=Number(r);return Number.isFinite(n)?n:null}(e,_),te=Object.fromEntries(Object.entries(H).filter(([e])=>e.startsWith("data-"))),re=a(),[ne,ie]=u(()=>h(r,x)),oe=s(ne);oe.current=ne;const ae=s(null),le=d(e=>{ae.current=e,"function"==typeof Y?Y(e):Y&&(Y.current=e)},[Y]),ce=s(r),ue=s(r);ue.current=r;const se=Boolean(N||E),de=t(),pe=M??(!!de&&"compact"),me="compact"===pe;p(()=>{ee(oe.current)!==r&&ie(h(r,x))},[r,x]);const fe=e=>{if(se)return;let t=(ee(oe.current)??P??(D?ee(D):null)??0)+e;null!=l&&t<l&&(t=l),null!=g&&t>g&&(t=g);const r=x??String(w??1).split(".")[1]?.length??0;t=Number(t.toFixed(r));const n=h(t,x);oe.current=n,ie(n),i(t),we()},be=s(fe);be.current=fe;const ve=s({unit:w??1,big:k??10*(w??1),locked:se});ve.current={unit:w??1,big:k??10*(w??1),locked:se},p(()=>{const e=ae.current;if(!e)return;const t=t=>{const{unit:r,big:n,locked:i}=ve.current;if(i||e.ownerDocument.activeElement!==e)return;const o=t.deltaY||t.deltaX;o&&(t.preventDefault(),be.current((o<0?1:-1)*(t.shiftKey?n:r)))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[]);const[he,ye]=u(!1),[ge,xe]=u(0),we=()=>{Z&&xe(e=>e+1)};p(()=>{Z&&he&&document.activeElement===ae.current&&ae.current?.select()},[Z,he,ge]);const ke=s(!1);p(()=>{if(he&&!se)return o(e=>{if("Escape"!==e.key||document.activeElement!==ae.current)return!1;const t=ce.current;if(ee(oe.current)===t)return!1;const r=h(t,x);return oe.current=r,ie(r),ue.current!==t&&(z??i)(t),we(),!0})},[he,se,x,i,z]);const Ne=()=>{const e=ee(oe.current);if(null==e){if(!V){const e=h(ue.current,x);return oe.current=e,ie(e),ue.current}return oe.current="",ie(""),null!==ue.current&&i(null),null}let t=e;const r=x??(U?Math.max(v(w??1),v(l??0)):void 0);U&&(t=function(e,t,r){const n=(e-r)/t;return r+Math.round(n+1e-9*Math.sign(e))*t}(t,w??1,l??0)),null!=l&&t<l&&(t=l),null!=g&&t>g&&(t=g),null!=r&&(t=Number(t.toFixed(r)));const n=h(t,x);return oe.current=n,ie(n),t===e&&t===ue.current||i(t),t},Ee=/* @__PURE__ */m("input",{ref:le,id:W,"data-number-input":"",name:C,type:"text",inputMode:0===x?"numeric":"decimal",value:!he&&$?$(r):ne,disabled:N,readOnly:E,placeholder:D,step:w,role:"spinbutton","aria-valuenow":r??void 0,"aria-valuemin":l,"aria-valuemax":g,"aria-valuetext":null==r?D||void 0:`${h(r,x)}${Z&&_?_:""}`,"aria-describedby":[R,q?G:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":Z?"bare":void 0,...te,autoComplete:Z?"off":void 0,spellCheck:!Z&&void 0,"aria-invalid":j||void 0,"aria-label":A,"aria-labelledby":J,onChange:e=>(e=>{if(E)return;const t=_&&e.trimEnd().endsWith(_)?e.trimEnd().slice(0,-_.length).trimEnd():e;if(""!==t&&!/^-?\d*[.,]?\d*$/.test(t))return;if(ie(e),!I)return;const r=ee(e);(null!==r||V)&&i(r)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!se)return ce.current=Ne(),void we();const t=w??1,r=k??10*t,n="ArrowUp"===e.key?e.shiftKey?r:t:"ArrowDown"===e.key?-(e.shiftKey?r:t):"PageUp"===e.key?10*t:"PageDown"===e.key?10*-t:null;null===n||se||(e.preventDefault(),fe(n))},onFocus:()=>{ce.current=ue.current,ye(!0),ke.current=!0,K?.()},onMouseUp:Z?e=>{ke.current&&(ke.current=!1,e.preventDefault())}:void 0,onBlur:()=>{ye(!1),ke.current=!1,Ne(),O?.()},className:Z?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",he?"bg-white":"bg-transparent",se?"cursor-default":"cursor-text",L].filter(Boolean).join(" "):n({invalid:j,size:F,readOnly:E,auto:q,className:[S?"pl-6":"",me?B?"pr-10":"pr-6":pe?B?"pr-24":"pr-16":B?"pr-10":"","text-left tabular-nums",L].filter(Boolean).join(" ")})}),je=q?/* @__PURE__ */m("span",{id:G,hidden:!0,children:re.settingView.auto}):null;if(Z||!S&&!B&&!pe)return je?/* @__PURE__ */f(b,{children:[Ee,je]}):Ee;const De=ee(ne);/* @__PURE__ */
|
|
2
|
+
return f("div",{className:"relative","data-number-box":"",children:[S&&/* @__PURE__ */m("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:S}),Ee,je,B&&/* @__PURE__ */m("span",{className:`pointer-events-none absolute ${me?"right-6":pe?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-gray-500`,children:B}),pe&&(()=>{const e=/* @__PURE__ */m(y,{dir:-1,compact:me,label:re.number.decrease,disabled:se||null!=l&&null!=De&&De<=l,onStep:e=>be.current(-(e?k??10*(w??1):w??1))}),t=/* @__PURE__ */m(y,{dir:1,compact:me,label:re.number.increase,disabled:se||null!=g&&null!=De&&De>=g,onStep:e=>be.current(e?k??10*(w??1):w??1)});/* @__PURE__ */
|
|
3
3
|
return f("span",me?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[t,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,t]})})()]})});export{g as InputNumber_default};
|