efficient-shell 8.34.0 → 8.35.1
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 +9 -0
- package/dist/{Browser-QBAMRKYI.js → Browser-F67PEY2U.js} +14 -14
- package/dist/Calculator-6ZU5MKTQ.js +29 -0
- package/dist/CurrencyConverter-Z6L7QAZU.js +21 -0
- package/dist/{Documents-E3GMXALJ.js → Documents-MQDSI27F.js} +25 -25
- package/dist/{Files-2DWPYRM5.js → Files-DEC4KVQM.js} +43 -43
- package/dist/Notepad-2IRVJ7MB.js +25 -0
- package/dist/PdfViewer-KSLOYXMD.js +1 -0
- package/dist/{PomodoroTimer-2HPCAEI5.js → PomodoroTimer-TRGMI4YT.js} +44 -44
- package/dist/{Preview-VZYFOH2U.js → Preview-PXOEKXSR.js} +17 -17
- package/dist/Sidebar-QQFJJWE2.js +43 -0
- package/dist/Spreadsheet-WROI4P6D.js +37 -0
- package/dist/Stock-SUDCDSUL.js +16 -0
- package/dist/{Weather-DS4YZ6SH.js → Weather-WQE4ZQAL.js} +18 -18
- package/dist/{WorldClock-7S4TITSF.js → WorldClock-2AGEYLZP.js} +6 -6
- package/dist/ai/index.d.ts +47 -9
- package/dist/ai/index.js +38 -33
- package/dist/ai.css +1 -1
- 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/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-Z2YGQBLZ.js → chunk-2C6IG7LG.js} +1 -1
- package/dist/chunk-2EOQDYGM.js +29 -0
- package/dist/{chunk-7CFH6Y4T.js → chunk-2F7ZOMKK.js} +1 -1
- package/dist/chunk-2PWZNFFP.js +19 -0
- package/dist/{chunk-KIBL6M3T.js → chunk-2SHYR3RA.js} +4 -3
- package/dist/{chunk-G433MKIN.js → chunk-2U2GJCSP.js} +5 -5
- package/dist/{chunk-EYX6KLCZ.js → chunk-37CCKGHU.js} +1 -1
- package/dist/{chunk-BQ2IPQNR.js → chunk-3RPIPYLU.js} +1 -1
- package/dist/chunk-4AJRHTTB.js +1 -0
- package/dist/{chunk-XWLWG4HS.js → chunk-4GVH4ZUH.js} +1 -1
- package/dist/{chunk-GIM2422N.js → chunk-4HCRZHIX.js} +1 -1
- package/dist/{chunk-MXHEREC6.js → chunk-4MO375G3.js} +3 -3
- package/dist/chunk-5FCEBKT2.js +7 -0
- package/dist/{chunk-DGLCMYSQ.js → chunk-5N5DBTTF.js} +11 -11
- package/dist/{chunk-PNQ4EYYM.js → chunk-5YELPBUT.js} +3 -3
- package/dist/{chunk-QDOTMA3W.js → chunk-64ZHCEZN.js} +1 -1
- package/dist/{chunk-Y2D2YMFY.js → chunk-6ANFVX4M.js} +12 -12
- package/dist/{chunk-T5SEGUCJ.js → chunk-7ACSSYEZ.js} +13 -13
- package/dist/{chunk-GI7FOLDX.js → chunk-ACW3J77L.js} +1 -1
- package/dist/{chunk-ERMZ75FO.js → chunk-AF7R2MV4.js} +1 -1
- package/dist/{chunk-QQK3XS6H.js → chunk-AZU7YOES.js} +8 -8
- package/dist/{chunk-NFR4QZL2.js → chunk-BHMUOWAE.js} +4 -4
- package/dist/{chunk-TFMC2WAS.js → chunk-BKZGI76S.js} +1 -1
- package/dist/{chunk-UB4BTRSB.js → chunk-BYCOB6WT.js} +1 -1
- package/dist/{chunk-LCM5U6BY.js → chunk-CCPNMYCK.js} +1 -1
- package/dist/{chunk-RAAUW5OZ.js → chunk-DG2WU3BU.js} +2 -2
- package/dist/chunk-DIN3EFOM.js +14 -0
- package/dist/{chunk-WJ3XSJ6B.js → chunk-EBC4XFL2.js} +1 -1
- package/dist/{chunk-37JDUDCO.js → chunk-ECCUEG3J.js} +1 -1
- package/dist/{chunk-4C4SQ4YW.js → chunk-EM6BEHAD.js} +8 -8
- package/dist/{chunk-W5M6P4DZ.js → chunk-ETF7LAYZ.js} +5 -5
- package/dist/{chunk-LEC4SZIV.js → chunk-EVB35JP5.js} +1 -1
- package/dist/{chunk-FL2PUQX7.js → chunk-EW6FRPFJ.js} +1 -1
- package/dist/{chunk-JCMP5KMS.js → chunk-EZY4CO4A.js} +6 -6
- package/dist/chunk-F2AEP37B.js +4 -0
- package/dist/{chunk-PJCVNFWM.js → chunk-FKZEGBLK.js} +10 -10
- package/dist/{chunk-DTSCO7VM.js → chunk-FMKTVZAO.js} +1 -1
- package/dist/{chunk-IZCODCSC.js → chunk-FTKKGGOQ.js} +1 -1
- package/dist/{chunk-FFJVCLGH.js → chunk-G2MJTE6X.js} +11 -11
- package/dist/{chunk-3BPF6PP3.js → chunk-G2V2ADJQ.js} +2 -2
- package/dist/{chunk-EZGY6CFN.js → chunk-GK3QH63P.js} +1 -1
- package/dist/{chunk-3WC6ITJ3.js → chunk-H33Z4ZIY.js} +6 -6
- package/dist/{chunk-CPXHU3Y2.js → chunk-HAIMJAI4.js} +2 -2
- package/dist/chunk-HMHL27AU.js +6 -0
- package/dist/{chunk-RSO67DWS.js → chunk-I4VD5D43.js} +4 -4
- package/dist/{chunk-BIYL7CEI.js → chunk-IFDW5QW6.js} +2 -2
- package/dist/{chunk-4AAGZQX7.js → chunk-IHEEJO5S.js} +1 -1
- package/dist/{chunk-WQNIXV4T.js → chunk-IUCIYWTT.js} +8 -8
- package/dist/chunk-JBQWR4SX.js +8 -0
- package/dist/{chunk-AX7KPMDV.js → chunk-JDKRQG7X.js} +2 -2
- package/dist/chunk-JE6TBZGY.js +8 -0
- package/dist/{chunk-LBLV64XG.js → chunk-JUGPTBMS.js} +1 -1
- package/dist/{chunk-BUGAWNOC.js → chunk-JVIOAZHW.js} +4 -4
- package/dist/{chunk-B2XDNBR3.js → chunk-L3G3YHVN.js} +1 -1
- package/dist/{chunk-ZEKM6HAA.js → chunk-M2AIC7IK.js} +2 -2
- package/dist/{chunk-KDZUWQEG.js → chunk-M2KV4WKR.js} +1 -1
- package/dist/{chunk-H3BC4KDE.js → chunk-M2LLVSBR.js} +1 -1
- package/dist/{chunk-SAKHGHF5.js → chunk-MC43PRTL.js} +1 -1
- package/dist/{chunk-USYNZGY4.js → chunk-MICWRC72.js} +7 -7
- package/dist/{chunk-ZN3O2KJ7.js → chunk-MOD4PGVF.js} +10 -10
- package/dist/{chunk-WTY3SXO7.js → chunk-MY755PTJ.js} +1 -1
- package/dist/chunk-NKZNPYDB.js +3 -0
- package/dist/{chunk-YSFLXPUS.js → chunk-NUSSZJF2.js} +5 -5
- package/dist/{chunk-RGBX3EVC.js → chunk-O2YAB6WK.js} +8 -8
- package/dist/{chunk-3J5QUHPO.js → chunk-OFKWTOXK.js} +3 -3
- package/dist/{chunk-ZT5Y5JZB.js → chunk-P42YNSKI.js} +4 -4
- package/dist/{chunk-L3NYH4QV.js → chunk-PAB2ZU4F.js} +37 -37
- package/dist/{chunk-KKSW5IZ7.js → chunk-PCKYNZ5Y.js} +5 -5
- package/dist/{chunk-RUQEB2ZC.js → chunk-R4C3GGCS.js} +3 -3
- package/dist/{chunk-3V5Z2BJY.js → chunk-RB2F65YJ.js} +12 -12
- package/dist/{chunk-KNVE7CMS.js → chunk-RJZYORCR.js} +1 -1
- package/dist/{chunk-BZV4K6GR.js → chunk-RPJ2GC3K.js} +20 -20
- package/dist/{chunk-PBMZJXSZ.js → chunk-S4J4B7LY.js} +5 -5
- package/dist/{chunk-HVX37PKU.js → chunk-SEXLHFMR.js} +1 -1
- package/dist/{chunk-NWP6IJYK.js → chunk-TANR67XF.js} +2 -2
- package/dist/{chunk-4F3IKYUO.js → chunk-TOVHLONK.js} +6 -6
- package/dist/{chunk-JOIWDQRJ.js → chunk-TRD22FC7.js} +6 -6
- package/dist/{chunk-YGZMD6TZ.js → chunk-TTY62G5D.js} +16 -16
- package/dist/{chunk-B55IXYDR.js → chunk-TZHWF3P5.js} +2 -2
- package/dist/{chunk-IAQC775L.js → chunk-UZ3CZQA4.js} +1 -1
- package/dist/chunk-WAZTGEMG.js +1 -0
- package/dist/{chunk-V4KQUOUP.js → chunk-WKRFD4E4.js} +8 -8
- package/dist/{chunk-PDXD6DT7.js → chunk-WME5DFB6.js} +1 -1
- package/dist/{chunk-OSA24YH6.js → chunk-WSPO4N72.js} +14 -14
- package/dist/{chunk-3C67XRVJ.js → chunk-XB2YPUKR.js} +8 -8
- package/dist/{chunk-VB7Z3HXO.js → chunk-XDDTFV32.js} +1 -1
- package/dist/{chunk-XC55NMXR.js → chunk-XNJMLHGK.js} +1 -1
- package/dist/{chunk-UQBPKZUR.js → chunk-XZL3HCWH.js} +1 -1
- package/dist/{chunk-CRYEG7OT.js → chunk-YBB56N6X.js} +1 -1
- package/dist/{chunk-FRPNTDP4.js → chunk-ZNCU3UIW.js} +4 -4
- package/dist/{chunk-ZOSIPTXM.js → chunk-ZNXBKFV7.js} +5 -5
- package/dist/{chunk-RCMP37VO.js → chunk-ZRHQGFO5.js} +3 -3
- package/dist/{chunk-MEFXMUWI.js → chunk-ZXSMSVLU.js} +3 -3
- package/dist/data/ListLoadError.js +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.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/IconPicker.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/PositionInput.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/mediaLibraryMenu.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +136 -136
- package/dist/map/index.js +6 -6
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.d.ts +2 -2
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.d.ts +2 -2
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-4JDJKSA7.js +0 -29
- package/dist/CurrencyConverter-S7LG5PMX.js +0 -21
- package/dist/Notepad-VQ66RWLT.js +0 -25
- package/dist/PdfViewer-67VBUIRD.js +0 -1
- package/dist/Sidebar-YB4OVUG5.js +0 -43
- package/dist/Spreadsheet-4KXRJSHT.js +0 -37
- package/dist/Stock-VNFYS73L.js +0 -16
- package/dist/chunk-3JJFBUK6.js +0 -3
- package/dist/chunk-57SJKYA4.js +0 -29
- package/dist/chunk-AS4CTEZD.js +0 -8
- package/dist/chunk-HSOREHQB.js +0 -1
- package/dist/chunk-JJXFPGX4.js +0 -6
- package/dist/chunk-LYYR5DSP.js +0 -14
- package/dist/chunk-RERNKFEW.js +0 -19
- package/dist/chunk-W7S56JZ7.js +0 -7
- package/dist/chunk-YCQVEJOT.js +0 -3
- package/dist/chunk-YW2DH6YQ.js +0 -8
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return k("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&
|
|
3
|
-
return x("button",{ref:f,id:d,role:"radio"===
|
|
1
|
+
import{keepsNativeMenu as e}from"./chunk-5QFPTDQF.js";import{optionNoteClass as t}from"./chunk-QR4RM7PO.js";import{Icon as n}from"./chunk-2SHYR3RA.js";import{onOverlayOpen as r}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as o}from"./chunk-62LW225J.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{glassStyle as l,GLASS_DIVIDER as c}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{createContext as u,forwardRef as d,useContext as p,useId as m,useRef as h,useState as f,useEffect as g,useMemo as y,useCallback as b}from"react";import{createPortal as w}from"react-dom";import{jsxs as x,jsx as k,Fragment as v}from"react/jsx-runtime";function N(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function C(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function T(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function E(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function M(e,t,n,r,o,i=!1,a=8){const l=t+o,c=e-o-n,s=c>=a;return i&&s?{left:c,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:s?{left:c,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function R(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var W=u(null),$=u(!1);function L({children:t,style:n,className:a="",onClose:c,minWidth:u=180,portal:d=!1}){const p=h(null),b=m(),[x,v]=f([]),T=h();g(()=>()=>clearTimeout(T.current),[]);const E=i(),M=y(()=>{const e=()=>clearTimeout(T.current);return{id:b,depth:0,path:x,open:(t,n)=>{e(),v(e=>N(e,t,n))},scheduleClose:t=>{e(),T.current=setTimeout(()=>v(e=>C(e,t)),200)},closeBelow:t=>{e(),v(e=>C(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),c?.()},root:p}},[b,x,c]);g(()=>{if(!c)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${b}"]`)||p.current&&!p.current.contains(e.target)&&c()},t=e=>{"Escape"===e.key&&c()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const n=r(c),o=s(()=>!1,()=>p.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),n(),o()}},[c,b]),g(()=>{const e=p.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const $=R(),L=/(^|[\s:])!?z-/.test(a),j=/* @__PURE__ */k("div",{ref:p,"data-popup-menu-tree":b,className:`fixed rounded-(--radius-popup) ${"tight"===$?"py-1":"large"===$?"py-2":"py-1"} ${a}`,onContextMenu:t=>{e(t.target)||t.preventDefault()},style:{...L?{}:{zIndex:o.menu},minWidth:u,animation:"popup-in 0.12s ease-out",...l(),...n},children:/* @__PURE__ */k(W.Provider,{value:M,children:t})});return d?E?w(j,document.body):null:j}function j(e,t,n,r=!1){const o=R(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":0;return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 not-disabled:not-aria-disabled:hover:bg-red-50":r?"bg-blue-50 text-blue-700":"text-gray-700 not-disabled:not-aria-disabled:hover:bg-blue-50 not-disabled:not-aria-disabled:hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:i,paddingBottom:i,..."normal"===o?{minHeight:"calc(var(--row-height-menu, 2.25rem) + 2 * (var(--menu-padding-y, 0.5rem) - 0.5rem))"}:{}}}}var B=/* @__PURE__ */k(n,{name:"check","aria-hidden":!0,className:"h-4 w-4",strokeWidth:2});function D({kind:e,checked:t}){/* @__PURE__ */
|
|
2
|
+
return k("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&B}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&B})}var P=d(function({onClick:e,children:n,className:r="",danger:o,disabled:i,role:a,checked:l,icon:c,description:s,tabIndex:u,id:d,onMouseEnter:h},f){const g=p(W),y=m(),b=null!=s&&!1!==s,w=`${d??y}-label`,N=`${d??y}-note`,C=p($),T=j(o,i,r),E=void 0===l?null:"menuitemradio"===a?"radio":"checkbox";/* @__PURE__ */
|
|
3
|
+
return x("button",{ref:f,id:d,role:"radio"===E?"menuitemradio":"checkbox"===E?"menuitemcheckbox":a??(C?"menuitem":void 0),"aria-checked":E?l:void 0,"aria-labelledby":b?w:void 0,"aria-describedby":b?N:void 0,tabIndex:u,onClick:()=>{e?.(),g&&g.depth>0&&"checkbox"!==E&&g.closeTree()},onMouseEnter:()=>{g?.scheduleClose(g.depth),h?.()},disabled:i,className:T.className,style:T.style,children:[E&&/* @__PURE__ */k(D,{kind:E,checked:!!l}),b?
|
|
4
4
|
/* @__PURE__ */x("span",{className:"block min-w-0 flex-1 py-2",children:[
|
|
5
5
|
/* @__PURE__ */x("span",{className:"flex items-center gap-2",children:[null!=c&&/* @__PURE__ */k(A,{children:c}),
|
|
6
6
|
/* @__PURE__ */k("span",{id:w,className:"min-w-0",children:n})]}),
|
|
7
|
-
/* @__PURE__ */k("span",{id:N,"data-menu-note":"",className:
|
|
8
|
-
return k("span",{"aria-hidden":"true","data-menu-icon":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e})}var
|
|
7
|
+
/* @__PURE__ */k("span",{id:N,"data-menu-note":"",className:t(),style:null!=c?{paddingLeft:"1.5rem"}:void 0,children:s})]}):/* @__PURE__ */x(v,{children:[null!=c&&/* @__PURE__ */k(A,{children:c}),n]})]})});function A({children:e}){/* @__PURE__ */
|
|
8
|
+
return k("span",{"aria-hidden":"true","data-menu-icon":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e})}var H=/* @__PURE__ */k(n,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function F(e){let t=o.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function I(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function S({label:t,icon:n,children:r,disabled:o,className:i="",minWidth:c=180,maxHeight:u,rowProps:d}){const f=p(W),N=m(),C=h(null),T=h(null),$=h(),L=h(!1),B=`${N}-menu`;g(()=>()=>clearTimeout($.current),[]);const D=f?.depth??0,P=f?.path[D],A=!!P&&P.key===N&&!o,S=b(e=>{if(!f||o||!C.current)return;clearTimeout($.current),L.current=e;const t=C.current.getBoundingClientRect(),n=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,i=D>0&&(f.path[D-1]?.flipped??!1),a=M(r.left,r.right,c,window.innerWidth,4,i);f.open(D,{key:N,y:t.top,...a})},[f,o,D,N,c]),z=e=>{f?.closeBelow(D),C.current?.focus()};g(()=>{if(A)return s(e=>"Escape"===e.key&&(!(f&&f.path.length>D+1)&&(z(),!0)),()=>T.current)}),a(()=>{if(!A||!P)return;const e=()=>{const e=T.current;if(!e||!C.current)return;const t=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??C.current.getBoundingClientRect(),r=D>0&&(f?.path[D-1]?.flipped??!1),o=e.offsetWidth||c,i=M(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=E(C.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),g(()=>{A&&L.current&&(L.current=!1,I(T.current)[0]?.focus())},[A]);const q=y(()=>f&&{...f,depth:D+1},[f,D]);if(!f)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const Q=j(!1,o,i,A),U=R();/* @__PURE__ */
|
|
9
9
|
return x(v,{children:[
|
|
10
|
-
/* @__PURE__ */x("button",{ref:C,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":A,"aria-controls":A?
|
|
11
|
-
/* @__PURE__ */k("span",{className:"min-w-0 flex-1 truncate",children:
|
|
12
|
-
/* @__PURE__ */k("div",{ref:T,id:
|
|
13
|
-
return k("div",{className:`border-t ${c} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function q(){const e=
|
|
10
|
+
/* @__PURE__ */x("button",{ref:C,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":A,"aria-controls":A?B:void 0,disabled:o,"data-popup-submenu-row":!0,className:Q.className,style:Q.style,onClick:e=>{const t=0===e.detail;A?t&&I(T.current)[0]?.focus():S(t)},...d,onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),S(!0))},onMouseEnter:()=>{d?.onMouseEnter?.(),o||(f.cancelClose(),A?f.closeBelow(D+1):(clearTimeout($.current),$.current=setTimeout(()=>S(!1),120)))},onMouseLeave:()=>{clearTimeout($.current),f.scheduleClose(D)},children:[n,
|
|
11
|
+
/* @__PURE__ */k("span",{className:"min-w-0 flex-1 truncate",children:t}),H]}),A&&w(
|
|
12
|
+
/* @__PURE__ */k("div",{ref:T,id:B,role:"menu","data-popup-menu-tree":f.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===U?"py-1":"large"===U?"py-2":"py-1"),style:{left:P.left,top:P.y,minWidth:c,maxHeight:void 0===u?"calc(100vh - 16px)":`min(${"number"==typeof u?`${u}px`:u}, calc(100vh - 16px))`,zIndex:F(f.root.current)+D+1,animation:(P.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...l()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=I(T.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),z())},onMouseEnter:()=>{f.cancelClose(),clearTimeout($.current)},onMouseLeave:()=>f.scheduleClose(D+1),onContextMenu:t=>{e(t.target)||t.preventDefault()},children:/* @__PURE__ */k(W.Provider,{value:q,children:r})}),document.body)]})}function z(){const e=R();/* @__PURE__ */
|
|
13
|
+
return k("div",{className:`border-t ${c} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function q(){const e=R(),t="tight"===e?"0.125rem":"large"===e?"0.375rem":"0.25rem";return{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:t,paddingBottom:t}}function Q({children:e}){/* @__PURE__ */
|
|
14
14
|
return k("div",{className:"text-xs font-medium uppercase tracking-wide",style:q(),children:e})}function U({d:e,className:t="h-4 w-4"}){/* @__PURE__ */
|
|
15
|
-
return k("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */k("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{D as MenuCheckMark,U as MenuIcon,$ as MenuSemanticsContext,
|
|
15
|
+
return k("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */k("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{D as MenuCheckMark,U as MenuIcon,$ as MenuSemanticsContext,L as PopupMenu,z as PopupMenuDivider,P as PopupMenuItem,Q as PopupMenuLabel,S as PopupSubmenu,E as clampMenuTop,C as closeMenuBelow,j as itemLook,M as menuPanelLeft,q as menuTextRowStyle,N as openMenuLevel,T as resolveMenuLevels};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{TransferProgress as e}from"./chunk-S7VSXUKS.js";import{Icon as r}from"./chunk-
|
|
1
|
+
import{TransferProgress as e}from"./chunk-S7VSXUKS.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-E6UCGCOC.js";import{jsx as o}from"react/jsx-runtime";var n=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function i(e){if(/^data:/i.test(e||""))return function(e){const r=n.exec(e);if(!r)return"media";const[,t,o]=r,i=o.split("+")[0].split(".").pop().replace(/^x-/i,"");return i?`${t.toLowerCase()}.${i.toLowerCase()}`:"media"}(e);const r=(e||"").split("?")[0].split("#")[0],t=r.substring(r.lastIndexOf("/")+1);try{return decodeURIComponent(t.replace(/^[0-9a-f]{32}_/i,""))||t||"media"}catch{return t||"media"}}var s=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function a(e,r=t.media){const o=function(e){const r=e.includes("video"),t=e.includes("image")||"*"===e||""===e;return r&&!t?"video":t&&!r?"image":"file"}(e);return"image"===o?r.uploadImage:"video"===o?r.uploadVideo:r.uploadFile}function u(e,r,t="",o="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",o,r?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",t].filter(Boolean).join(" ")}function c(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function d({label:r,progress:t,rounded:n="rounded-lg"}){/* @__PURE__ */
|
|
2
2
|
return o("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${n}`,children:/* @__PURE__ */o(e,{state:"busy",verb:r,pct:t})})}function l({children:e}){/* @__PURE__ */
|
|
3
3
|
return o("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-white",style:{background:"var(--rosh-media-scrim)"},children:e})}function m(e,r=""){if(!e)return!1;const t=n.exec(e);if(t)return"video"===t[1].toLowerCase();const o=r.includes("video"),i=r.includes("image")||"*"===r||""===r;return s.test(e)||o&&!i}function f({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
4
4
|
return o(r,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function p({className:e="h-6 w-6"}){/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Banner as e}from"./chunk-
|
|
1
|
+
import{Banner as e}from"./chunk-MY755PTJ.js";import{Button_default as t}from"./chunk-4IU5BSVE.js";import{useShellStrings as n}from"./chunk-E6UCGCOC.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
|
|
2
2
|
return o("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${u}`.trim(),children:/* @__PURE__ */a(e,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */o(t,{type:"button",variant:"primary",size:"md",onClick:f,children:p.update.refreshNow}),children:[
|
|
3
3
|
/* @__PURE__ */o("span",{className:"font-medium",children:l??p.update.available}),
|
|
4
4
|
/* @__PURE__ */a("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[r," → ",d]})]})})}export{s as APP_UPDATE_POLL_MS,l as AppUpdateBanner,c as useAppUpdate};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{Popover as e}from"./chunk-RNBM5JZI.js";import{InputNumber_default as r}from"./chunk-
|
|
2
|
-
return w("button",{ref:l,type:o,"aria-pressed":a,className:$({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(e)})})}),D=(e,r,a)=>Math.min(a,Math.max(r,e)),I=e=>"string"==typeof e?{value:e}:e;function
|
|
1
|
+
import{Popover as e}from"./chunk-RNBM5JZI.js";import{InputNumber_default as r}from"./chunk-HAIMJAI4.js";import{InSettingRowContext as a}from"./chunk-L65BESIE.js";import{parseHexColor as n,hexToHsv as o,hsvToHex as t,hexReadout as l,HUE_GRADIENT as i,HEX_MAX_LENGTH as s,svFromPoint as c,hueFromPoint as u}from"./chunk-S6OB6HJB.js";import{inputClasses as d}from"./chunk-PF3ANJFI.js";import{Tooltip as h}from"./chunk-22S6LG6D.js";import{useShellStrings as g}from"./chunk-E6UCGCOC.js";import{forwardRef as p,useState as b,useRef as m,useEffect as f,useId as v}from"react";import{jsx as w,jsxs as x}from"react/jsx-runtime";var y={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},k={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function C(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function N(e,r){if(!e)return k;const a=C(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${k.backgroundImage}`,backgroundSize:`auto, ${k.backgroundSize}`}}function $({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",y[e],a].filter(Boolean).join(" ")}var z=p(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
|
|
2
|
+
return w("button",{ref:l,type:o,"aria-pressed":a,className:$({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(e)})})}),D=(e,r,a)=>Math.min(a,Math.max(r,e)),I=e=>"string"==typeof e?{value:e}:e;function A(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:D(e.s+o[0],0,1),v:D(e.v+o[1],0,1)}:null}function M(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,359);case"ArrowRight":case"ArrowUp":return D(e+n,0,359);case"PageDown":return D(e-10,0,359);case"PageUp":return D(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var P={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function j(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,100);case"ArrowRight":case"ArrowUp":return D(e+n,0,100);case"PageDown":return D(e-10,0,100);case"PageUp":return D(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function S({value:e,onChange:r,label:s,presets:d,clearable:p=!1,fallback:v,dragWrites:y="live",disabled:$=!1,opacity:D,onOpacityChange:S,onClose:B,id:K,className:T=""}){const O=g().color,R=C(D),U=e=>{const r=C(e);$||r===R||S?.(r)},H=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:R},J=n(v??""),[q,F]=b(()=>o(e||J||"")),W=m(e);f(()=>{e!==W.current&&(W.current=e,e?F(o(e)):J&&F(o(J)))},[e]);const X=a=>{$||a===e||(W.current=a,r(a))},G=e=>{const r=n(e);r&&(F(o(r)),X(r))},V=e=>{F(e),X(t(e))},[Y,Z]=b(!1),Q=m(q);Q.current=q;const _=e=>({onPointerDown:r=>{if($||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,Q.current);"end"===y?(Z(!0),F(a)):V(a)},onPointerMove:r=>{if($||!(1&r.buttons))return;const a=e(r,Q.current);"end"===y?F(a):V(a)},onPointerUp:r=>{"end"===y&&Y&&(Z(!1),V(e(r,Q.current)))}}),ee=_((e,r)=>({...r,...c(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),re=_((e,r)=>({...r,h:u(e.clientX,e.currentTarget.getBoundingClientRect())})),ae=Y?t(q):e,ne=e=>`${Math.round(100*e)}%`,oe=(d??[]).map(I),te=n(e),le=ae||J||"";
|
|
3
3
|
/* @__PURE__ */
|
|
4
|
-
return w(a.Provider,{value:!1,children:/* @__PURE__ */x("div",{id:K,className:`flex w-56 flex-col gap-3 ${$?"opacity-60":""} ${T}`.trim(),onKeyDown:e=>{"Escape"===e.key&&B&&(e.preventDefault(),e.stopPropagation(),B())},children:[(oe.length>0||p)&&/* @__PURE__ */x("div",{role:"group","aria-label":
|
|
4
|
+
return w(a.Provider,{value:!1,children:/* @__PURE__ */x("div",{id:K,className:`flex w-56 flex-col gap-3 ${$?"opacity-60":""} ${T}`.trim(),onKeyDown:e=>{"Escape"===e.key&&B&&(e.preventDefault(),e.stopPropagation(),B())},children:[(oe.length>0||p)&&/* @__PURE__ */x("div",{role:"group","aria-label":O.presets,className:"flex flex-wrap gap-2",children:[p&&/* @__PURE__ */w(h,{content:O.clear,children:/* @__PURE__ */w(z,{color:"",size:"sm","aria-label":O.clear,selected:""===e,disabled:$,onClick:()=>{$||""===e||(W.current="",r(""))}})}),oe.map(e=>{const r=n(e.value),a=e.label?`${e.label} · ${l(r??e.value)}`:l(r??e.value);/* @__PURE__ */
|
|
5
5
|
return w(h,{content:a,children:/* @__PURE__ */w(z,{color:r??e.value,size:"sm","aria-label":a,selected:null!==r&&r===te,disabled:$,onClick:()=>G(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
6
|
-
/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":
|
|
7
|
-
/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":
|
|
6
|
+
/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":O.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*q.v),"aria-valuetext":O.squareValue(Math.round(100*q.s),Math.round(100*q.v)),"aria-disabled":$||void 0,"data-color-square":"",onKeyDown:e=>{if($)return;const r=A(q,e.key,e.shiftKey);r&&(e.preventDefault(),V(r))},...ee,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:t({h:q.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ne(q.s),top:ne(1-q.v),...P}})}),
|
|
7
|
+
/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":O.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(q.h),"aria-orientation":"horizontal","aria-disabled":$||void 0,"data-color-hue":"",onKeyDown:e=>{if($)return;const r=M(q.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),V({...q,h:r}))},...re,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:i},children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:q.h/360*100+"%",background:t({h:q.h,s:1,v:1}),...P}})}),S&&/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":O.opacity(s),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":R,"aria-valuetext":`${R}%`,"aria-orientation":"horizontal","aria-disabled":$||void 0,"data-color-opacity":"",onKeyDown:e=>{if($)return;const r=j(R,e.key,e.shiftKey);null!==r&&(e.preventDefault(),U(r))},onPointerDown:e=>{$||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),U(H(e)))},onPointerMove:e=>{!$&&1&e.buttons&&U(H(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${le||"black"}), ${k.backgroundImage}`,backgroundSize:`auto, ${k.backgroundSize}`},children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${R}%`,...N(le||"black",R),...P}})}),
|
|
8
8
|
/* @__PURE__ */x("div",{className:"flex items-center gap-2",children:[
|
|
9
|
-
/* @__PURE__ */w("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-gray-300",style:N(le,S?
|
|
10
|
-
/* @__PURE__ */w(
|
|
11
|
-
return w("input",{id:i,type:"text",value:g??(e?l(e):""),"aria-label":a,placeholder:o,maxLength:s,spellCheck:!1,autoComplete:"off",disabled:t,onChange:a=>{p(a.target.value);const o=n(a.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(null),"data-hex-look":u,className:m})}function
|
|
12
|
-
return w("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */w(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function
|
|
9
|
+
/* @__PURE__ */w("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-gray-300",style:N(le,S?R:null)}),
|
|
10
|
+
/* @__PURE__ */w(E,{value:ae,placeholder:!e&&J?l(J):void 0,onChange:G,label:O.hex(s),disabled:$}),S&&/* @__PURE__ */w(L,{value:R,onChange:U,label:O.opacity(s),disabled:$})]})]})})}var B={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},K={sm:"h-6",md:"h-8",lg:"h-10"},T=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-gray-800 placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function E({value:e,onChange:r,label:a,placeholder:o,disabled:t,id:i,size:c="md",look:u="box",className:h=""}){const[g,p]=b(null),m="text"===u?`${T} ${K[c]} ${h}`.trim():d({size:c,className:`${B[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
|
|
11
|
+
return w("input",{id:i,type:"text",value:g??(e?l(e):""),"aria-label":a,placeholder:o,maxLength:s,spellCheck:!1,autoComplete:"off",disabled:t,onChange:a=>{p(a.target.value);const o=n(a.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(null),"data-hex-look":u,className:m})}function L({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
|
|
12
|
+
return w("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */w(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function O({value:r,onChange:a,label:o,presets:t,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:h=!1,opacity:p,onOpacityChange:b,size:m="md",align:f="start",open:y,onOpenChange:k,className:z=""}){const D=g().color,I=C(p),A=v(),M=n(s??""),P=r||M||"",j=r?l(r):M?l(M):D.none;
|
|
13
13
|
/* @__PURE__ */
|
|
14
14
|
return x("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":h?"gap-1":"gap-2"} ${z}`.trim(),children:[
|
|
15
|
-
/* @__PURE__ */w(e,{id:d,trigger:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(
|
|
16
|
-
/* @__PURE__ */w(
|
|
15
|
+
/* @__PURE__ */w(e,{id:d,trigger:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(P,b?I:null)}),triggerLabel:D.swatch(o,j),triggerClassName:$({size:m}),"aria-label":D.panel(o),align:f,open:y,onOpenChange:k,disabled:u,children:/* @__PURE__ */w(S,{id:A,value:r,onChange:a,label:o,presets:t,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),h&&
|
|
16
|
+
/* @__PURE__ */w(E,{value:r,placeholder:!r&&M?l(M):void 0,onChange:e=>{u||e===r||a(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */w(L,{value:I,onChange:e=>{u||e===I||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{O as ColorPicker,S as ColorPickerPanel,z as ColorSwatch,E as HexInput,k as NO_COLOR_FILL,C as clampOpacity,N as colorFill,$ as colorSwatchClasses,M as stepHue,j as stepOpacity,A as stepSquare};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useWindowMenuItem as e,Modal as t}from"./chunk-
|
|
1
|
+
import{useWindowMenuItem as e,Modal as t}from"./chunk-PAB2ZU4F.js";import{navIcons as r}from"./chunk-CY5N5OA3.js";import{VERSION as s}from"./chunk-WAZTGEMG.js";import{Icon as o}from"./chunk-2SHYR3RA.js";import{DEFAULT_SHELL_STRINGS as n,useShellStrings as i,splitAround as a}from"./chunk-E6UCGCOC.js";import{useState as m,useCallback as c,isValidElement as l,cloneElement as d}from"react";import{jsx as p,jsxs as h}from"react/jsx-runtime";var u=n.aboutApp,f={spreadsheet:{name:"Spreadsheets",version:"1.2.0",route:"/spreadsheet",description:u.spreadsheet},notepad:{name:"Notepad",version:"1.0.2",route:"/notepad",description:u.notepad},documents:{name:"Documents",version:"1.1.1",route:"/documents",description:u.documents},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:u.preview},files:{name:"Files",version:"1.1.3",route:"/files",description:u.files},browser:{name:"Browser",version:"1.0.2",route:"/browser",description:u.browser}},x=/* @__PURE__ */p(o,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),v=/* @__PURE__ */p(o,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function w({app:o}){const n=f[o],[u,w]=m(!1),N=c(()=>w(!0),[]),g=i().aboutApp,b=g.title(n.name);if(e(b,N,x),!u)return null;const y=r[n.route],k=l(y)?d(y,{className:"h-9 w-9"}):v,[j,A]=a(g.partOf);/* @__PURE__ */
|
|
2
2
|
return p(t,{open:!0,onClose:()=>w(!1),title:b,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */h("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
|
|
3
3
|
/* @__PURE__ */p("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:k}),
|
|
4
4
|
/* @__PURE__ */p("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:n.name}),
|
|
@@ -6,4 +6,4 @@ return p(t,{open:!0,onClose:()=>w(!1),title:b,size:"sm",compact:!0,bodyScroll:!1
|
|
|
6
6
|
/* @__PURE__ */p("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:g[o]}),
|
|
7
7
|
/* @__PURE__ */h("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
|
|
8
8
|
/* @__PURE__ */h("p",{className:"text-2xs text-gray-500",children:[j,
|
|
9
|
-
/* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),
|
|
9
|
+
/* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),A]}),s&&/* @__PURE__ */p("p",{className:"mt-0.5 text-2xs font-mono text-gray-400",children:g.shellVersion(s)})]})]})})}export{w as AboutApp,f as BUILTIN_APP_INFO};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ColoredBadge as e}from"./chunk-
|
|
1
|
+
import{ColoredBadge as e}from"./chunk-4GVH4ZUH.js";import{Button_default as n}from"./chunk-4IU5BSVE.js";import{useShellStrings as t}from"./chunk-E6UCGCOC.js";import{useId as a}from"react";import{jsx as m,jsxs as i}from"react/jsx-runtime";function s({items:s,heading:l,emptyText:r,className:c=""}){const o=t().media,d=a();return s.length?/* @__PURE__ */i("div",{className:c||void 0,children:[
|
|
2
2
|
/* @__PURE__ */m("p",{id:d,className:"text-xs font-medium text-gray-500",children:l??o.usedIn(s.length)}),
|
|
3
3
|
/* @__PURE__ */m("ul",{"aria-labelledby":d,className:"mt-2 flex flex-col gap-1",children:s.map(t=>/* @__PURE__ */i("li",{className:"flex min-w-0 items-center gap-2 text-sm",children:[null!=t.kind&&/* @__PURE__ */m(e,{size:"xs",className:"flex-none",children:t.kind}),t.onOpen?/* @__PURE__ */m(n,{variant:"link",size:"sm",onClick:t.onOpen,className:"min-w-0 text-left",children:t.name}):/* @__PURE__ */m("span",{className:"min-w-0 break-words text-gray-700",children:t.name})]},t.key))})]}):/* @__PURE__ */m("p",{className:`text-sm text-gray-500 ${c}`.trim(),children:r??o.notUsed})}export{s as MediaUsedInList};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-P5BOTIJU.js";import{usePlotWidth as t}from"./chunk-MAFUXCPZ.js";import{
|
|
2
|
-
return f("div",{className:k,ref:F,children:/* @__PURE__ */f("p",{className:"py-8 text-center text-sm text-gray-500",children:D})});const L=y??
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-P5BOTIJU.js";import{usePlotWidth as t}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as l,CHART_INK as r}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as n}from"./chunk-TWVUQUUD.js";import{useShellStrings as i,useShellLocale as a}from"./chunk-E6UCGCOC.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{useRef as h,useId as c,useState as s,useEffect as m}from"react";import{jsx as f,jsxs as u}from"react/jsx-runtime";function x({rows:x,columns:d,cells:p,height:M,width:g,color:y,max:v,formatValue:$,label:b,className:k,emptyLabel:w,cellGap:A=2,cellRadius:C=2}){const N=i().charts,U=a(),j=$??(e=>o(e,U)),z=b??N.intensity,D=w??N.noActivity,F=h(null),R=t(F),S=g??R,B=c(),[E,G]=s(null);if(m(()=>{if(null!==E)return n(e=>"Escape"===e.key&&(G(null),!0))},[E]),0===x.length||0===d.length)/* @__PURE__ */
|
|
2
|
+
return f("div",{className:k,ref:F,children:/* @__PURE__ */f("p",{className:"py-8 text-center text-sm text-gray-500",children:D})});const L=y??l(0),O=v??Math.max(1,...p.flat().filter(Number.isFinite)),T=96,V=26*x.length,I=M??V+26+26,P=Math.max(2,(Math.max(97,S)-T)/d.length),Q=e=>{const t=O>0?Math.max(0,Math.min(1,e/O)):0;return`color-mix(in oklab, ${L} ${(8+92*t).toFixed(1)}%, ${r.surface})`};/* @__PURE__ */
|
|
3
3
|
return u("div",{className:`relative ${k??""}`,ref:F,children:[
|
|
4
4
|
/* @__PURE__ */u("svg",{width:"100%",height:I,viewBox:`0 0 ${S} ${I}`,role:"img","aria-label":N.heatmap(z,x.length,d.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>G(null),onBlur:()=>G(null),onKeyDown:e=>{const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0,l="ArrowRight"===e.key?1:"ArrowLeft"===e.key?-1:0;0===t&&0===l||(e.preventDefault(),G(e=>({r:Math.min(x.length-1,Math.max(0,(e?.r??0)+t)),c:Math.min(d.length-1,Math.max(0,(e?.c??0)+l))})))},children:[
|
|
5
5
|
/* @__PURE__ */f("defs",{children:/* @__PURE__ */u("linearGradient",{id:B,x1:"0",x2:"1",children:[
|
|
6
6
|
/* @__PURE__ */f("stop",{offset:"0",stopColor:Q(0)}),
|
|
7
|
-
/* @__PURE__ */f("stop",{offset:"1",stopColor:Q(O)})]})}),x.map((e,t)=>/* @__PURE__ */f("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:
|
|
8
|
-
return f("rect",{x:T+r*P+A/2,y:26*t+A/2,width:Math.max(1,P-A),height:26-A,rx:C,fill:Q(n),opacity:i?.55:1,onMouseEnter:()=>G({r:t,c:r}),children:/* @__PURE__ */f("title",{children:`${e} · ${l}: ${j(n)}`})},`${t}-${r}`)})),d.map((e,t)=>t%Math.max(1,Math.ceil(d.length/Math.max(1,Math.floor((S-T)/56))))===0?/* @__PURE__ */f("text",{x:T+t*P+P/2,y:V+15,textAnchor:"middle",fontSize:11,fill:
|
|
7
|
+
/* @__PURE__ */f("stop",{offset:"1",stopColor:Q(O)})]})}),x.map((e,t)=>/* @__PURE__ */f("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:r.label,children:e},`r${t}`)),x.map((e,t)=>d.map((l,r)=>{const n=p[t]?.[r]??0,i=E&&(E.r!==t||E.c!==r);/* @__PURE__ */
|
|
8
|
+
return f("rect",{x:T+r*P+A/2,y:26*t+A/2,width:Math.max(1,P-A),height:26-A,rx:C,fill:Q(n),opacity:i?.55:1,onMouseEnter:()=>G({r:t,c:r}),children:/* @__PURE__ */f("title",{children:`${e} · ${l}: ${j(n)}`})},`${t}-${r}`)})),d.map((e,t)=>t%Math.max(1,Math.ceil(d.length/Math.max(1,Math.floor((S-T)/56))))===0?/* @__PURE__ */f("text",{x:T+t*P+P/2,y:V+15,textAnchor:"middle",fontSize:11,fill:r.label,children:e},`c${t}`):null),
|
|
9
9
|
/* @__PURE__ */f("rect",{x:T,y:V+26,width:Math.min(180,Math.max(40,S-T)),height:8,rx:4,fill:`url(#${B})`}),
|
|
10
|
-
/* @__PURE__ */f("text",{x:T,y:V+48,fontSize:11,fill:
|
|
11
|
-
/* @__PURE__ */f("text",{x:T+Math.min(180,Math.max(40,S-T)),y:V+48,textAnchor:"end",fontSize:11,fill:
|
|
10
|
+
/* @__PURE__ */f("text",{x:T,y:V+48,fontSize:11,fill:r.label,children:"0"}),
|
|
11
|
+
/* @__PURE__ */f("text",{x:T+Math.min(180,Math.max(40,S-T)),y:V+48,textAnchor:"end",fontSize:11,fill:r.label,style:{fontVariantNumeric:"tabular-nums"},children:j(O)})]}),E&&/* @__PURE__ */f("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */f(e,{title:`${x[E.r]} · ${d[E.c]}`,rows:[{key:"v",label:z,color:L,value:null==p[E.r]?.[E.c]?void 0:j(p[E.r][E.c])}]})})]})}export{x as HeatmapChart};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{useSettingAuto as e,useInSettingRow as t}from"./chunk-L65BESIE.js";import{
|
|
2
|
-
return f("div",{className:"relative","data-number-box":"",children:[
|
|
1
|
+
import{useSettingAuto as e,useInSettingRow as t}from"./chunk-L65BESIE.js";import{inputClasses as r}from"./chunk-PF3ANJFI.js";import{IconButton_default as n}from"./chunk-4CANQ3B3.js";import{Icon as i}from"./chunk-2SHYR3RA.js";import{registerModalEscapeInterceptor as o}from"./chunk-TWVUQUUD.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.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:r,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":r,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(n,{size:"sm",...b,children:f})}var g=l(function({value:n,onChange:i,min:l,max:g,precision:x,step:w,shiftStep:k,disabled:E,readOnly:N,invalid:j,placeholder:D,size:C,prefix:F,suffix:S,id:B,name:U,className:K="",onBlur:L,onFocus:O,steppers:P,stepFrom:W,snap:A=!1,allowEmpty:I=!0,appearance:M="box",display:T,reportWhileTyping:$=!0,onRevert:z,"aria-label":R,"aria-labelledby":V,"aria-describedby":Q,auto:Y,...G},H){const J="bare"===M,X=e(),q=Y??X,Z=c(),_="string"==typeof S&&""!==S.trim()?S.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(G).filter(([e])=>e.startsWith("data-"))),re=a(),[ne,ie]=u(()=>h(n,x)),oe=s(ne);oe.current=ne;const ae=s(null),le=d(e=>{ae.current=e,"function"==typeof H?H(e):H&&(H.current=e)},[H]),ce=s(n),ue=s(n);ue.current=n;const se=Boolean(E||N),de=t(),pe=P??(!!de&&"compact"),me="compact"===pe;p(()=>{ee(oe.current)!==n&&ie(h(n,x))},[n,x]);const fe=e=>{if(se)return;let t=(ee(oe.current)??W??(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=()=>{J&&xe(e=>e+1)};p(()=>{J&&he&&document.activeElement===ae.current&&ae.current?.select()},[J,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 Ee=()=>{const e=ee(oe.current);if(null==e){if(!I){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??(A?Math.max(v(w??1),v(l??0)):void 0);A&&(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},Ne=/* @__PURE__ */m("input",{ref:le,id:B,"data-number-input":"",name:U,type:"text",inputMode:0===x?"numeric":"decimal",value:!he&&T?T(n):ne,disabled:E,readOnly:N,placeholder:D,step:w,role:"spinbutton","aria-valuenow":n??void 0,"aria-valuemin":l,"aria-valuemax":g,"aria-valuetext":null==n?D||void 0:`${h(n,x)}${J&&_?_:""}`,"aria-describedby":[Q,q?Z:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":J?"bare":void 0,...te,autoComplete:J?"off":void 0,spellCheck:!J&&void 0,"aria-invalid":j||void 0,"aria-label":R,"aria-labelledby":V,onChange:e=>(e=>{if(N)return;const t=_&&e.trimEnd().endsWith(_)?e.trimEnd().slice(0,-_.length).trimEnd():e;if(""!==t&&!/^-?\d*[.,]?\d*$/.test(t))return;if(ie(e),!$)return;const r=ee(e);(null!==r||I)&&i(r)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!se)return ce.current=Ee(),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,O?.()},onMouseUp:J?e=>{ke.current&&(ke.current=!1,e.preventDefault())}:void 0,onBlur:()=>{ye(!1),ke.current=!1,Ee(),L?.()},className:J?["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",K].filter(Boolean).join(" "):r({invalid:j,size:C,readOnly:N,auto:q,className:[F?"pl-6":"",me?S?"pr-10":"pr-6":pe?S?"pr-24":"pr-16":S?"pr-10":"","text-left tabular-nums",K].filter(Boolean).join(" ")})}),je=q?/* @__PURE__ */m("span",{id:Z,hidden:!0,children:re.settingView.auto}):null;if(J||!F&&!S&&!pe)return je?/* @__PURE__ */f(b,{children:[Ne,je]}):Ne;const De=ee(ne);/* @__PURE__ */
|
|
2
|
+
return f("div",{className:"relative","data-number-box":"",children:[F&&/* @__PURE__ */m("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:F}),Ne,je,S&&/* @__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:S}),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};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-64ZHCEZN.js";import{IconButton_default as a}from"./chunk-4CANQ3B3.js";import{Icon as o}from"./chunk-2SHYR3RA.js";import{Tooltip as n}from"./chunk-22S6LG6D.js";import{useShellStrings as s}from"./chunk-E6UCGCOC.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s}){const i=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),t=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);return{words:i>0,paragraph:t>0,oneRow:i>0&&t>0&&i+1+t<=9,flow:i>0&&t>0&&i+1+t>9&&i<=7,cells:{words:i,paragraph:t}}}function w(e,l){/* @__PURE__ */
|
|
2
|
+
return i(n,{content:e,children:l},l.key??void 0)}function g({offered:n,pressed:h,onMark:g,color:f,linkOpen:k=!1,last:v,alignment:N,list:C,letterCase:D,disabled:M=!1,"aria-label":x,windows:y,className:A="",layout:j="grid"}){const R=s().textToolbar,S=m({offered:n,color:f,last:v,alignment:N,list:C,letterCase:D});if(!S.words&&!S.paragraph)return null;const q=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,B=(e,l,r,o)=>n.has(e)?w(l,/* @__PURE__ */i(a,"link"===e?{pressed:k,className:q(k),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":k,"aria-keyshortcuts":o,disabled:M,onMouseDown:c,onClick:()=>g(e),children:r}:{className:q(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:M,onMouseDown:c,onClick:()=>g(e),children:r},e)):null,L=l(R),$=e.map(e=>[e,L[e],r(e)]),I=N?e.filter(e=>N.allow.includes(e)):[],U=N&&I.includes(N.value)?N.value:I[0],E=[["none",R.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",R.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",R.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],H=/* @__PURE__ */t(d,{children:[B("bold",R.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),B("italic",R.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),B("underline",R.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),B("strike",R.strike,/* @__PURE__ */i(o,{name:"strike"})),f?w(R.color,/* @__PURE__ */i(a,{pressed:f.open,className:q(f.open,"rosh-tb-color"),"aria-label":R.color,"aria-haspopup":"dialog","aria-expanded":f.open,disabled:M,style:f.run?{"--rosh-tb-run":f.run}:void 0,onMouseDown:c,onClick:f.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,B("link",R.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),B("sup",R.sup,/* @__PURE__ */i(o,{name:"superscript"})),B("sub",R.sub,/* @__PURE__ */i(o,{name:"subscript"})),B("code",R.code,/* @__PURE__ */i(o,{name:"code"})),u(v)?v:null]}),K=/* @__PURE__ */t(d,{children:[N&&I.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":R.alignment,onKeyDown:e=>p(e,I,e=>N.onChange(e)),children:$.map(([e,l,r])=>N.allow.includes(e)?w(l,/* @__PURE__ */i(a,{role:"radio",pressed:N.value===e,className:q(N.value===e),"aria-checked":N.value===e,"aria-label":l,tabIndex:e===U?0:-1,disabled:M||N.disabled,onMouseDown:c,onClick:()=>N.onChange(e),children:r},e)):null)}):null,C&&n.has("bullet")?w(R.bullet,/* @__PURE__ */i(a,{className:q("bullet"===C.pressed),"aria-label":R.bullet,"aria-pressed":"bullet"===C.pressed,disabled:M,onMouseDown:c,onClick:()=>C.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,C&&n.has("number")?w(R.number,/* @__PURE__ */i(a,{className:q("number"===C.pressed),"aria-label":R.number,"aria-pressed":"number"===C.pressed,disabled:M,onMouseDown:c,onClick:()=>C.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,B("quote",R.quote,/* @__PURE__ */i(o,{name:"quote"})),D?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":R.letterCase,onKeyDown:e=>p(e,E.map(([e])=>e),e=>D.onChange(e)),children:E.map(([e,l,r])=>w(l,/* @__PURE__ */i(a,{role:"radio",pressed:D.value===e,className:q(D.value===e),"aria-checked":D.value===e,"aria-label":l,tabIndex:e===(D.value||"none")?0:-1,disabled:M||D.disabled,onMouseDown:c,onClick:()=>D.onChange(D.value===e?"":e),children:r},e)))}):null]}),T="row"===j,G=T?" is-row":S.flow?" is-flow":S.oneRow?" is-one-row":S.words&&void 0===v?" is-eight":"",O=b(n,Boolean(f)),Z={"--rosh-tb-color-col":String(O.color),"--rosh-tb-link-col":String(O.link),...T?{"--rosh-tb-cells":String(S.cells.words+S.cells.paragraph),"--rosh-tb-groupgap":S.words&&S.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let Q;return Q=T?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[S.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:H}):null,S.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:K}):null]}):S.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[H,
|
|
3
|
+
/* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),K]}):S.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
|
|
4
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-words",children:H}),
|
|
5
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-para",children:K})]}):/* @__PURE__ */t(d,{children:[S.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===v?" is-eight":""),children:H}):null,S.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:K}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${G} ${A}`.trim(),style:Z,children:[
|
|
6
|
+
/* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":x??R.formatting,children:Q}),y]})}export{g as TextToolbar,m as textToolbarRows,b as textToolbarWindowColumns};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{tooltipBesideBand as t}from"./chunk-MG7A3R75.js";import{niceAxis as e,niceMax as i,linearScale as r,axisGutter as n,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{
|
|
1
|
+
import{tooltipBesideBand as t}from"./chunk-MG7A3R75.js";import{niceAxis as e,niceMax as i,linearScale as r,axisGutter as n,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{CHART_INK as a}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-E6UCGCOC.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useRef as d,useState as u,useId as f,useEffect as x}from"react";import{jsx as g,jsxs as p}from"react/jsx-runtime";function y({labels:y,values:v,height:b=220,width:k,bandPadding:M=.24,min:w,max:N,yTickCount:A=4,formatValue:$,yAxisLabel:j,xTickAnchor:C="center",children:R,overlay:E,tooltip:U,onSelect:z,ariaLabel:D,className:L,emptyLabel:P}){const F=s().charts,I=c(),S=$??(t=>m(t,I)),T=P??F.noData,V=d(null),W=o(V),B=k??W,[G,O]=u(null),Q=f();if(x(()=>{if(null!==G)return h(t=>"Escape"===t.key&&(O(null),!0))},[G]),0===y.length||!v.some(Number.isFinite))/* @__PURE__ */
|
|
2
2
|
return g("div",{className:L,ref:V,children:/* @__PURE__ */g("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:b},children:T})});const Z=v.filter(Number.isFinite),H=Z.every(Number.isInteger),J=void 0===w&&void 0===N?e(Math.min(0,...Z),Math.max(0,...Z),{intervals:A+1,integer:H}):null,K=void 0!==w&&void 0===N?e(w,Math.max(w,...Z),{intervals:A+1,integer:H,zero:!1}):null,X=J?J.lo:w??Math.min(0,...Z),q=J?J.hi:K?K.hi:N??i(Math.max(...Z,0)),Y=J?J.ticks:K?[X,...K.ticks.filter(t=>t>X)]:r([X,q],{from:0,to:1}).ticks(A+1),_={top:12,right:16,bottom:26,left:n(Y.map(S),48)+(j?10:0)},tt=_.left,et=Math.max(tt+1,B-_.right),it=_.top,rt=b-_.bottom,nt=r([X,q],{from:rt,to:it}),lt=l(y.length,{from:tt,to:et},M),ot=(et-tt)/Math.max(1,y.length),at=ot>=48,ht=at?1:Math.max(1,Math.ceil(y.length/Math.max(1,Math.floor(B/84)))),st=Math.max(2,Math.floor((ot-6)/6.6)),ct=t=>at&&t.length>st?`${t.slice(0,st-1).trimEnd()}…`:t;/* @__PURE__ */
|
|
3
3
|
return p("div",{className:`relative ${L??""}`,ref:V,children:[
|
|
4
4
|
/* @__PURE__ */p("svg",{width:"100%",height:b,viewBox:`0 0 ${B} ${b}`,role:"img","aria-label":D,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>O(null),onBlur:()=>O(null),onKeyDown:t=>{if(z&&null!==G&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void z(G);if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const e="ArrowRight"===t.key?1:-1;O(t=>Math.min(y.length-1,Math.max(0,(t??0)+e)))},children:[
|
|
5
|
-
/* @__PURE__ */g("defs",{children:/* @__PURE__ */g("clipPath",{id:Q,children:/* @__PURE__ */g("rect",{x:tt,y:it,width:et-tt,height:rt-it})})}),Y.map(t=>/* @__PURE__ */g("line",{x1:tt,y1:nt(t),x2:et,y2:nt(t),stroke:
|
|
6
|
-
/* @__PURE__ */g("line",{x1:tt,y1:nt(Math.max(X,0)),x2:et,y2:nt(Math.max(X,0)),stroke:
|
|
7
|
-
/* @__PURE__ */g("g",{clipPath:`url(#${Q})`,children:R({x:lt,y:nt,left:tt,right:et,top:it,bottom:rt,width:B,height:b,clipId:Q,active:G})}),E?.({x:lt,y:nt,left:tt,right:et,top:it,bottom:rt,width:B,height:b,clipId:Q,active:G}),y.map((t,e)=>e%ht===0?/* @__PURE__ */g("text",{x:"start"===C?lt(e):lt.center(e),y:b-8,textAnchor:"middle",fontSize:11,fill:
|
|
5
|
+
/* @__PURE__ */g("defs",{children:/* @__PURE__ */g("clipPath",{id:Q,children:/* @__PURE__ */g("rect",{x:tt,y:it,width:et-tt,height:rt-it})})}),Y.map(t=>/* @__PURE__ */g("line",{x1:tt,y1:nt(t),x2:et,y2:nt(t),stroke:a.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${t}`)),
|
|
6
|
+
/* @__PURE__ */g("line",{x1:tt,y1:nt(Math.max(X,0)),x2:et,y2:nt(Math.max(X,0)),stroke:a.axis,strokeWidth:1,shapeRendering:"crispEdges"}),Y.map(t=>/* @__PURE__ */g("text",{x:tt-8,y:nt(t)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:S(t)},`t${t}`)),j&&/* @__PURE__ */g("text",{x:14,y:(it+rt)/2,transform:`rotate(-90 14 ${(it+rt)/2})`,textAnchor:"middle",fontSize:11,fill:a.label,children:j}),
|
|
7
|
+
/* @__PURE__ */g("g",{clipPath:`url(#${Q})`,children:R({x:lt,y:nt,left:tt,right:et,top:it,bottom:rt,width:B,height:b,clipId:Q,active:G})}),E?.({x:lt,y:nt,left:tt,right:et,top:it,bottom:rt,width:B,height:b,clipId:Q,active:G}),y.map((t,e)=>e%ht===0?/* @__PURE__ */g("text",{x:"start"===C?lt(e):lt.center(e),y:b-8,textAnchor:"middle",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:ct(t)},`x${e}`):null),y.map((t,e)=>/* @__PURE__ */g("rect",{x:lt.center(e)-(et-tt)/y.length/2,y:it,width:(et-tt)/y.length,height:rt-it,fill:"transparent",onMouseEnter:()=>O(e),onClick:z?()=>z(e):void 0,style:z?{cursor:"pointer"}:void 0},`h${e}`))]}),U&&null!==G&&
|
|
8
8
|
/* @__PURE__ */g("div",{className:"pointer-events-none absolute top-2 z-10",style:t(lt.center(G),lt.bandwidth,B),children:U(G)})]})}export{y as CartesianPlot};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ChartTooltip as t}from"./chunk-P5BOTIJU.js";import{CartesianPlot as o}from"./chunk-
|
|
2
|
-
return l(o,{labels:
|
|
1
|
+
import{ChartTooltip as t}from"./chunk-P5BOTIJU.js";import{CartesianPlot as o}from"./chunk-I4VD5D43.js";import{binValues as r}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as e,useShellLocale as i}from"./chunk-E6UCGCOC.js";import{formatPlain as m,formatFixed as n}from"./chunk-C3QOHMR6.js";import{jsx as l}from"react/jsx-runtime";function c({values:c,bins:s=10,precomputed:h,height:u=220,width:p,color:b,tone:f,formatBound:d,formatCount:x,yAxisLabel:g,label:k,className:y,emptyLabel:j}){const C=e().charts,v=i(),w=d??(t=>Number.isInteger(t)?m(t,v):n(t,1,v)),A=x??(t=>m(t,v)),L=g??C.countAxis,M=k??C.distribution,N=h??r(c??[],s),O=a(0,b,f),U=N.map(t=>w(t.from)),I=N.map(t=>t.count);/* @__PURE__ */
|
|
2
|
+
return l(o,{labels:U,values:I,height:u,width:p,bandPadding:0,xTickAnchor:"start",formatValue:A,yAxisLabel:L,className:y,emptyLabel:j,ariaLabel:C.histogram(M,N.length,(c??[]).length),tooltip:o=>/* @__PURE__ */l(t,{title:`${w(N[o].from)} – ${w(N[o].to)}`,rows:[{key:"count",label:C.observations,color:O,value:A(N[o].count)}]}),children:({x:t,y:o,bottom:r,active:a})=>/* @__PURE__ */l("g",{children:N.map((e,i)=>/* @__PURE__ */l("rect",{x:t(i)+.5,y:o(e.count),width:Math.max(1,t.bandwidth-1),height:Math.max(0,r-o(e.count)),fill:O,fillOpacity:null===a||a===i?.85:.42},i))})})}export{c as HistogramChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DropdownMenu as e}from"./chunk-
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-5FCEBKT2.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
|
|
2
2
|
return r("span",{className:"my-3 w-px shrink-0 bg-gray-200","aria-hidden":!0})}function m({item:e,active:t,caret:i}){/* @__PURE__ */
|
|
3
3
|
return a(n,{children:[e.icon&&/* @__PURE__ */r("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
4
4
|
/* @__PURE__ */r("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */r("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),i&&/* @__PURE__ */r("span",{className:"-ml-1 text-xs","aria-hidden":!0,children:"▾"}),t&&/* @__PURE__ */r("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]})}function d({items:n,activeKey:d,onSelect:o,brand:u,actions:b,linkAs:h,className:g}){/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Markdown as e}from"./chunk-
|
|
1
|
+
import{Markdown as e}from"./chunk-ECCUEG3J.js";import{PLACEHOLDER_INK as t}from"./chunk-PF3ANJFI.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{LoadingSpinner as l}from"./chunk-Q5MD3VY6.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useState as s,useMemo as n}from"react";import{jsxs as o,jsx as i,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */i(r,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:y,emptyMessage:f}){const b=a(),[v,N]=s(""),[w,k]=s(null),[C,j]=s({}),E=v.trim().toLowerCase(),M=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let r=e.get(t.category);r||(r={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,r)),r.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,r)=>(t.get(e.key)??1/0)-(t.get(r.key)??1/0))},[h,p]),_=e=>!E||e.title.toLowerCase().includes(E)||e.body.toLowerCase().includes(E)||e.category_label.toLowerCase().includes(E),A=n(()=>M.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[M,E]),L=n(()=>A.flatMap(e=>e.docs),[A]),R=(w?L.find(e=>e.slug===w):void 0)??L[0]??null,z=e=>!!E||(C[e]??e===R?.category);/* @__PURE__ */
|
|
2
2
|
return o("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
3
3
|
/* @__PURE__ */o("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
|
|
4
4
|
/* @__PURE__ */o("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
@@ -6,16 +6,16 @@ return o("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
|
6
6
|
/* @__PURE__ */i("div",{className:"px-3 py-2 border-b border-gray-100 shrink-0",children:/* @__PURE__ */o("div",{className:"relative",children:[
|
|
7
7
|
/* @__PURE__ */i(r,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
|
|
8
8
|
/* @__PURE__ */i("input",{type:"text",value:v,onChange:e=>N(e.target.value),placeholder:b.help.searchPlaceholder,className:"w-full rounded-md border border-gray-300 bg-white h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
|
|
9
|
-
/* @__PURE__ */i("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */i(l,{size:"sm",padding:"py-6",label:b.help.loading}):0===A.length?/* @__PURE__ */i("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:
|
|
9
|
+
/* @__PURE__ */i("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */i(l,{size:"sm",padding:"py-6",label:b.help.loading}):0===A.length?/* @__PURE__ */i("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:E?b.help.noResults:f??b.help.empty}):A.map(e=>{const t=z(e.key);/* @__PURE__ */
|
|
10
10
|
return o("div",{className:"py-0.5",children:[
|
|
11
|
-
/* @__PURE__ */o("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!
|
|
11
|
+
/* @__PURE__ */o("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!z(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-gray-400 hover:text-gray-600",children:[
|
|
12
12
|
/* @__PURE__ */i(d,{open:t}),
|
|
13
|
-
/* @__PURE__ */i("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=
|
|
13
|
+
/* @__PURE__ */i("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=R?.slug===e.slug;/* @__PURE__ */
|
|
14
14
|
return o("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
|
|
15
15
|
/* @__PURE__ */i("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */i("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:b.help.draft})]},e.slug)})]},e.key)})})]}),
|
|
16
|
-
/* @__PURE__ */i("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:
|
|
16
|
+
/* @__PURE__ */i("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:R?/* @__PURE__ */o(c,{children:[
|
|
17
17
|
/* @__PURE__ */o("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
18
18
|
/* @__PURE__ */o("div",{className:"min-w-0",children:[
|
|
19
|
-
/* @__PURE__ */i("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:
|
|
20
|
-
/* @__PURE__ */o("p",{className:"text-xs text-gray-500 mt-0.5",children:[
|
|
21
|
-
/* @__PURE__ */i("div",{className:"flex-1 overflow-auto px-5 py-4",children:y?y(
|
|
19
|
+
/* @__PURE__ */i("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:R.title}),
|
|
20
|
+
/* @__PURE__ */o("p",{className:"text-xs text-gray-500 mt-0.5",children:[R.category_label,!1===R.is_published&&/* @__PURE__ */o("span",{className:"ml-2 text-amber-600",children:["· ",b.help.draft]})]})]}),u&&x&&/* @__PURE__ */i("button",{type:"button",onClick:()=>x(R),className:"shrink-0 text-sm text-blue-600 hover:underline",children:b.help.edit})]}),
|
|
21
|
+
/* @__PURE__ */i("div",{className:"flex-1 overflow-auto px-5 py-4",children:y?y(R):R.body?/* @__PURE__ */i(e,{children:R.body}):/* @__PURE__ */i("p",{className:"text-sm text-gray-500 italic",children:b.help.noBody})})]}):/* @__PURE__ */i("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */i(l,{size:"sm",padding:"",label:b.help.loading}):/* @__PURE__ */i("p",{className:"text-sm text-gray-500",children:b.help.pickArticle})})})]})}export{h as HelpCenter};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{optionMatches as e,OptionSublabel as t}from"./chunk-XZL3HCWH.js";import{inputClasses as n}from"./chunk-PF3ANJFI.js";import{GROUP_COLORS as r}from"./chunk-D323R2FT.js";import{Tooltip as o}from"./chunk-22S6LG6D.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-E6UCGCOC.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:C=!1,invalid:j,disabled:L,id:D,className:W="",tone:E,tooltip:F,split:$}){const[G,H]=m(!1),[I,J]=m(""),M=d(),S=h(null),T=h(null),B=h(null),R=a(S,G),P=e=>k.find(t=>t.value===e)?.label??e,U=p(()=>{const t=new Set(r),n=[],o=I.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,I]),z=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??(C?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==r.length&&y(t)},A=e=>{e&&!r.includes(e)?(y([...r,e]),J("")):J("")},K=e=>y(r.filter(t=>t!==e)),O=()=>{const e=I.trim();if($&&e)return z(e.split($)),void J("");C&&e?A(e):J("")},X=h(()=>{});X.current=()=>{O(),H(!1)},f(()=>{if(!G)return;const e=e=>{const t=e.target;S.current?.contains(t)||B.current?.contains(t)||(O(),H(!1))};document.addEventListener("mousedown",e);const t=l(()=>X.current());return()=>{document.removeEventListener("mousedown",e),t()}});const Z=k.length>0;/* @__PURE__ */
|
|
2
|
+
return v("div",{ref:S,className:"relative",children:[
|
|
3
|
+
/* @__PURE__ */v("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),T.current?.focus())},className:n({invalid:j,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)] ${L?"bg-gray-50 cursor-not-allowed":""} ${W}`}),children:[r.map(e=>{const t=E?.(e),n=w[t??"accent"],r=/* @__PURE__ */v("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
+
/* @__PURE__ */x("span",{className:"truncate",children:P(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":M.select.removeItem?.(P(e))??`${M.select.remove} ${P(e)}`,onClick:()=>K(e),className:n.remove,children:"×"})]},e),l=F?.(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:T,type:"text",autoComplete:"off",role:"combobox","aria-expanded":G&&Z,"aria-invalid":j||void 0,disabled:L,value:I,placeholder:0===r.length?N:void 0,onChange:e=>{(e=>{if($){const t=e.split($);if(t.length>1)return z(t.slice(0,-1)),void J(t[t.length-1])}J(e)})(e.target.value),H(!0)},onFocus:()=>{!L&&Z&&H(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&C){t.preventDefault();const n=I.trim(),r=n?U.filter(t=>e(t,n.toLowerCase())):[];1===r.length?A(r[0].value):O()}else"Backspace"===t.key&&""===I&&r.length>0?K(r[r.length-1]):"Escape"===t.key?(H(!1),J(""),T.current?.blur()):"Tab"===t.key&&(O(),H(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-[color:var(--ink-placeholder)] rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),G&&Z&&g(
|
|
6
|
+
/* @__PURE__ */x("div",{ref:B,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===U.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&r.length>=k.length?M.select.allSelected:M.select.noMatches}):U.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),A(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,2 +1,2 @@
|
|
|
1
|
-
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-
|
|
2
|
-
return p(n,{portal:!0,minWidth:x,style:
|
|
1
|
+
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-TZHWF3P5.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-FKZEGBLK.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:L=!0}){const D=s(null),j=a(),[A,S]=d(null),U=s(w);U.current=w,c(()=>{const e=D.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const C=s(null),F=s(!1);m(()=>(C.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!D.current?.contains(e)||C.current?.focus?.({preventScroll:!0})}),[]),m(()=>{A&&!F.current&&L&&(F.current=!0,h(D.current)[0]?.focus({preventScroll:!0}))},[A,L]),m(()=>{if(L)return;const e=e=>{if(D.current?.contains(document.activeElement))return;const t=h(D.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[L]),m(()=>u(e=>"Escape"===e.key&&(U.current(),!0),()=>D.current),[]),m(()=>{const e=()=>U.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const T=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void U.current();const t=h(D.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),W=A?{left:A.left,top:A.top,maxHeight:A.maxHeight,...A.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
|
|
2
|
+
return p(n,{portal:!0,minWidth:x,style:W,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:D,id:j,role:"menu","aria-label":b,"aria-describedby":y?t(y,j):void 0,"data-context-menu":"",onKeyDown:T,children:[y&&e(y,{menuId:j,choose:e=>{e.disabled||(U.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>U.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{useOverlayTarget as e,OverlayLayerProvider as r}from"./chunk-4AJRHTTB.js";import{dialogA11y as i}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as o}from"./chunk-PKXQDCNR.js";import{useFocusTrap as t,useScrollLock as l}from"./chunk-CDAJKLGL.js";import{Icon as s}from"./chunk-2SHYR3RA.js";import{Z_LAYERS as a}from"./chunk-62LW225J.js";import{useHydrated as n}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as d}from"./chunk-TWVUQUUD.js";import{useShellStrings as c}from"./chunk-E6UCGCOC.js";import{useRef as m,useId as h,useState as u,useEffect as f}from"react";import{createPortal as p}from"react-dom";import{jsx as b,jsxs as x}from"react/jsx-runtime";var g={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},y={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function v({onClose:e}){const r=c().dialog;/* @__PURE__ */
|
|
2
|
+
return b("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */b(s,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function k({open:s,onClose:c,side:k="right",size:N="md",title:j,description:w,footer:C,children:W,blocking:A=!1,initialFocus:D,"aria-label":H,"aria-labelledby":J,"aria-describedby":L,className:R=""}){const T=m(null),U=h(),z=h(),B=h(),G=e(n()),[I,K]=u(null);if(o(s),t(T,s&&null!==G,D),l(s),f(()=>{if(s)return d(()=>(A||c(),!0),()=>T.current)},[s,A,c]),!s||!G)return null;const Q="bottom"===k,V=Q?{maxHeight:"85vh"}:void 0;return p(
|
|
3
|
+
/* @__PURE__ */b(r,{value:I,children:/* @__PURE__ */x("div",{ref:K,className:"fixed inset-0",style:{zIndex:a.overlay},role:"presentation",children:[
|
|
4
|
+
/* @__PURE__ */b("div",{className:"fixed inset-0 bg-black/30",onClick:A?void 0:c,"aria-hidden":"true"}),
|
|
5
|
+
/* @__PURE__ */x("div",{ref:T,...i({modal:!0,titleId:j?B:void 0,labelledBy:J,label:H}),"aria-describedby":L??(w?z:W?U:void 0),"data-drawer-side":k,style:V,className:["fixed flex flex-col bg-white shadow-xl",Q?"":`w-full max-w-full ${g[N]}`,y[k],Q?"rounded-t-xl":"",R].filter(Boolean).join(" "),children:[j?/* @__PURE__ */x("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
6
|
+
/* @__PURE__ */x("div",{className:"min-w-0",children:[
|
|
7
|
+
/* @__PURE__ */b("h2",{id:B,className:"text-base font-semibold text-gray-900",children:j}),w&&/* @__PURE__ */b("p",{id:z,className:"mt-0.5 text-sm text-gray-500",children:w})]}),!A&&/* @__PURE__ */b(v,{onClose:c})]}):!A&&/* @__PURE__ */b("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */b(v,{onClose:c})}),
|
|
8
|
+
/* @__PURE__ */x("div",{id:U,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[w&&!j&&/* @__PURE__ */b("p",{id:z,className:("mb-3 text-sm text-gray-500 "+(A?"":"pr-8")).trim(),children:w}),W]}),C&&/* @__PURE__ */b("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:C})]})]})}),G)}export{k as Drawer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-P5BOTIJU.js";import{CartesianPlot as l}from"./chunk-
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-P5BOTIJU.js";import{CartesianPlot as l}from"./chunk-I4VD5D43.js";import{STATUS_VARS as o}from"./chunk-TZFACUMR.js";import{useShellStrings as t,useShellLocale as a}from"./chunk-E6UCGCOC.js";import{formatPlain as i,formatFixed as r}from"./chunk-C3QOHMR6.js";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";function h({candles:h,variant:m="candle",height:p=260,width:d,formatValue:u,yAxisLabel:b,label:y,className:x,emptyLabel:k}){const g=t().charts,f=a(),w=u??(e=>Number.isInteger(e)?i(e,f):r(e,2,f)),M=y??g.price,v=h.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),j=Math.min(...v),C=Math.max(...v),L=.08*(C-j)||1;/* @__PURE__ */
|
|
2
2
|
return c(l,{labels:h.map(e=>e.label),values:v,height:p,width:d,min:j-L,max:C+L,bandPadding:.42,formatValue:w,yAxisLabel:b,className:x,emptyLabel:k,ariaLabel:g.ohlc(M,h.length),tooltip:l=>{const t=h[l],a=t.close>=t.open,i=a?o.good:o.critical;/* @__PURE__ */
|
|
3
3
|
return c(e,{title:t.label,rows:[{key:"open",label:g.open,color:i,value:w(t.open)},{key:"high",label:g.high,color:i,value:w(t.high)},{key:"low",label:g.low,color:i,value:w(t.low)},{key:"close",label:g.close,color:i,value:w(t.close)}],emphasisKey:"close",footnote:a?g.closedAbove:g.closedBelow})},children:({x:e,y:l,active:t})=>/* @__PURE__ */c("g",{children:h.map((a,i)=>{const r=a.close>=a.open,h=r?o.good:o.critical,p=e.center(i),d=Math.max(3,e.bandwidth),u=null!==t&&t!==i,b=l(Math.max(a.open,a.close)),y=Math.max(1,Math.abs(l(a.close)-l(a.open)));/* @__PURE__ */
|
|
4
4
|
return n("g",{opacity:u?.45:1,children:[
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{CountBadge as e}from"./chunk-MAOJENIB.js";import{
|
|
1
|
+
import{CountBadge as e}from"./chunk-MAOJENIB.js";import{SettingRowNameContext as t,SettingAutoContext as a,InSettingRowContext as i}from"./chunk-L65BESIE.js";import{isShown as n}from"./chunk-HCP7WOAL.js";import{useShellStrings as s}from"./chunk-E6UCGCOC.js";import{useId as r}from"react";import{jsx as l,jsxs as d}from"react/jsx-runtime";var c={default:{pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},compact:{pad:"py-2",gap:"gap-2",text:"text-sm",bodyTop:"mt-2",bodyPad:"pt-2"}};function m({label:m,icon:o,action:p,value:h,readout:x,description:u,children:f,controlId:g,labelId:v,unknownText:y="—",quiet:N=!1,size:w="default",viewState:b,divider:$=!0,showWhen:j,values:k,context:P,className:C=""}){const E=s(),I=r();if(!n(j,k,P))return null;const T=c[w],B=void 0!==h||void 0===f&&null==p,O=null==h||""===h,A=N?"text-gray-500":"text-gray-800",L=O?"text-gray-400":N?"text-gray-500":"text-gray-900",S=null!=x&&!1!==x,V=`${T.text} font-medium ${A}${"compact"===w?" whitespace-nowrap":""}`,W=v??("compact"===w?I:void 0),q=g?/* @__PURE__ */l("label",{htmlFor:g,id:W,className:V,children:m}):/* @__PURE__ */l("span",{id:W,className:V,children:m}),z="auto"===b?/* @__PURE__ */l("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-gray-200 px-1 text-2xs font-normal leading-4 text-gray-500",children:E.settingView.auto}):"edited"===b?/* @__PURE__ */d("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
|
|
2
2
|
/* @__PURE__ */l("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */l(e,{dot:!0,tone:"accent"})}),
|
|
3
|
-
/* @__PURE__ */l("span",{className:"sr-only",children:E.settingView.edited})]}):null,F=/* @__PURE__ */l(
|
|
3
|
+
/* @__PURE__ */l("span",{className:"sr-only",children:E.settingView.edited})]}):null,F=/* @__PURE__ */l(t.Provider,{value:W,children:/* @__PURE__ */l(a.Provider,{value:"auto"===b,children:O?y:h})}),G=[$?"border-t border-gray-100 first:border-t-0":"",T.pad,C].filter(Boolean).join(" "),H=null!=f&&!1!==f&&/* @__PURE__ */l("div",{className:`${T.bodyTop} border-t border-gray-100 ${T.bodyPad}`,children:f});/* @__PURE__ */
|
|
4
4
|
return d("div",S?{className:G,"data-setting-row":"compact"===w?w:void 0,children:[
|
|
5
5
|
/* @__PURE__ */d("div",{"data-setting-line":"",className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-2",children:[
|
|
6
6
|
/* @__PURE__ */l("div",{"data-setting-name":"compact"===w?"":void 0,className:"flex-1 basis-0",children:/* @__PURE__ */d("div",{className:`flex min-w-0 items-center gap-2 ${A}`,children:[null!=o&&/* @__PURE__ */l("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),q,z]})}),
|
|
7
7
|
/* @__PURE__ */d("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[
|
|
8
|
-
/* @__PURE__ */l("span",{"data-setting-readout":"",className:`whitespace-nowrap ${T.text} ${N?"text-gray-500":"text-gray-900"}`,children:x}),("compact"===w||null!=p)&&/* @__PURE__ */l("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:p})]})]}),u&&/* @__PURE__ */l("p",{className:"mt-0.5 text-xs text-gray-500",children:u}),void 0!==h&&/* @__PURE__ */l("div",{"data-setting-value":"",className:`mt-2 flex justify-end ${T.text} ${L}`,children:/* @__PURE__ */l(
|
|
8
|
+
/* @__PURE__ */l("span",{"data-setting-readout":"",className:`whitespace-nowrap ${T.text} ${N?"text-gray-500":"text-gray-900"}`,children:x}),("compact"===w||null!=p)&&/* @__PURE__ */l("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:p})]})]}),u&&/* @__PURE__ */l("p",{className:"mt-0.5 text-xs text-gray-500",children:u}),void 0!==h&&/* @__PURE__ */l("div",{"data-setting-value":"",className:`mt-2 flex justify-end ${T.text} ${L}`,children:/* @__PURE__ */l(i.Provider,{value:"compact"===w,children:F})}),H]}:{className:G,"data-setting-row":"compact"===w?w:void 0,children:[
|
|
9
9
|
/* @__PURE__ */d("div",{className:"compact"===w?"flex flex-wrap items-center justify-between gap-x-2 gap-y-2":`flex items-center justify-between ${T.gap}`,children:[
|
|
10
10
|
/* @__PURE__ */d("div",{"data-setting-name":"compact"===w?"":void 0,className:"compact"===w?"flex-1 basis-0":"min-w-0 flex-1",children:[null!=o?
|
|
11
11
|
/* @__PURE__ */d("div",{className:`flex min-w-0 items-center gap-2 ${A}`,children:[
|
|
12
12
|
/* @__PURE__ */l("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),q,z]}):z?/* @__PURE__ */d("div",{className:"flex min-w-0 items-center gap-2",children:[q,z]}):q,u&&/* @__PURE__ */l("p",{className:"mt-0.5 text-xs text-gray-500",children:u})]}),"compact"===w?
|
|
13
|
-
/* @__PURE__ */d("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[B&&/* @__PURE__ */l("div",{"data-setting-value":"",className:`flex items-center justify-end ${T.text} ${L}`,children:/* @__PURE__ */l(
|
|
13
|
+
/* @__PURE__ */d("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[B&&/* @__PURE__ */l("div",{"data-setting-value":"",className:`flex items-center justify-end ${T.text} ${L}`,children:/* @__PURE__ */l(i.Provider,{value:!0,children:F})}),
|
|
14
14
|
/* @__PURE__ */l("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:p})]}):null!=p?/* @__PURE__ */d("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[B&&/* @__PURE__ */l("div",{className:`${T.text} ${L}`,children:F}),p]}):B&&/* @__PURE__ */l("div",{className:`shrink-0 ${T.text} ${L}`,children:F})]}),H]})}export{m as SettingRow};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Avatar as e}from"./chunk-MMFJBWJC.js";import{StatCard as a,Card as t}from"./chunk-VU6VPKM3.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-NID6MGGC.js";import{ColumnChart as l}from"./chunk-
|
|
1
|
+
import{Avatar as e}from"./chunk-MMFJBWJC.js";import{StatCard as a,Card as t}from"./chunk-VU6VPKM3.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-NID6MGGC.js";import{ColumnChart as l}from"./chunk-ETF7LAYZ.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-D323R2FT.js";import{Button_default as c}from"./chunk-4IU5BSVE.js";import{TH_ONE_LINE as n}from"./chunk-6KO5VTL7.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:[
|