efficient-shell 8.34.0 → 8.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/{Browser-QBAMRKYI.js → Browser-ERZNOFN7.js} +14 -14
- package/dist/Calculator-NXIOZMML.js +29 -0
- package/dist/{CurrencyConverter-S7LG5PMX.js → CurrencyConverter-57WUTV4H.js} +12 -12
- package/dist/{Documents-E3GMXALJ.js → Documents-POWS4L44.js} +19 -19
- package/dist/{Files-2DWPYRM5.js → Files-O44UH6ZF.js} +43 -43
- package/dist/{Notepad-VQ66RWLT.js → Notepad-66ZCGUHC.js} +10 -10
- package/dist/PdfViewer-KSLOYXMD.js +1 -0
- package/dist/{PomodoroTimer-2HPCAEI5.js → PomodoroTimer-GLYNCO4H.js} +17 -17
- package/dist/{Preview-VZYFOH2U.js → Preview-WZDFVBNJ.js} +23 -23
- package/dist/Sidebar-QQFJJWE2.js +43 -0
- package/dist/{Spreadsheet-4KXRJSHT.js → Spreadsheet-OYAVNRCT.js} +14 -14
- package/dist/{Stock-VNFYS73L.js → Stock-CIHUZOQS.js} +7 -7
- package/dist/{Weather-DS4YZ6SH.js → Weather-UKLNJ3VF.js} +13 -13
- package/dist/{WorldClock-7S4TITSF.js → WorldClock-OZ3I7D2M.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-L3NYH4QV.js → chunk-2AHHM4SK.js} +39 -39
- package/dist/{chunk-Z2YGQBLZ.js → chunk-2C6IG7LG.js} +1 -1
- 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-ZN3O2KJ7.js → chunk-2WL3Q7VW.js} +12 -12
- package/dist/{chunk-EYX6KLCZ.js → chunk-37CCKGHU.js} +1 -1
- 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-3BPF6PP3.js → chunk-4RNF6MNW.js} +2 -2
- package/dist/chunk-5FCEBKT2.js +7 -0
- package/dist/{chunk-DGLCMYSQ.js → chunk-5N5DBTTF.js} +11 -11
- package/dist/{chunk-KNVE7CMS.js → chunk-5OX6KXWY.js} +1 -1
- 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-BZMZTPS6.js +1 -0
- package/dist/chunk-CAMLFCGY.js +29 -0
- 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-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-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-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-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-KKSW5IZ7.js → chunk-PCKYNZ5Y.js} +5 -5
- package/dist/{chunk-YW2DH6YQ.js → chunk-QPWD5CCS.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-BZV4K6GR.js → chunk-RPJ2GC3K.js} +20 -20
- package/dist/{chunk-XC55NMXR.js → chunk-S4IW5OL3.js} +1 -1
- package/dist/{chunk-PBMZJXSZ.js → chunk-S4J4B7LY.js} +5 -5
- package/dist/{chunk-HVX37PKU.js → chunk-SEXLHFMR.js} +1 -1
- package/dist/{chunk-BQ2IPQNR.js → chunk-SWHRP52Y.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-YCQVEJOT.js → chunk-TW6WYYBC.js} +2 -2
- package/dist/{chunk-B55IXYDR.js → chunk-TZHWF3P5.js} +2 -2
- package/dist/{chunk-IAQC775L.js → chunk-UZ3CZQA4.js} +1 -1
- 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-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 +139 -139
- 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.js +1 -1
- 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/PdfViewer-67VBUIRD.js +0 -1
- package/dist/Sidebar-YB4OVUG5.js +0 -43
- 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
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-XZL3HCWH.js";import{useSettingAuto as d}from"./chunk-L65BESIE.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-PF3ANJFI.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-QR4RM7PO.js";import{Icon as m}from"./chunk-2SHYR3RA.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{solidSurfaceStyle as g}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-E6UCGCOC.js";import{forwardRef as w,useId as k,useState as N,useRef as $,useMemo as D,useCallback as S,useEffect as j,useLayoutEffect as C}from"react";import{createPortal as E}from"react-dom";import{jsxs as H,jsx as I,Fragment as T}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,R=w(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},w){const N=t,$=x(),D=d(),S=f??D,j=k(),C=/* @__PURE__ */H("select",{ref:w,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,S?j:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:S,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */I("option",{value:"",disabled:!0,children:i}),
|
|
2
|
+
/* @__PURE__ */I(z,{items:r})]});return S?/* @__PURE__ */H(T,{children:[C,
|
|
3
|
+
/* @__PURE__ */I("span",{id:j,hidden:!0,children:$.settingView.auto})]}):C});function z({items:e}){const t=e=>/* @__PURE__ */I("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
4
|
+
return I(T,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */I("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var A=w(function({value:l,onChange:u,options:w,placeholder:R,invalid:A,className:B="",id:U,disabled:F,size:K,touchSize:L,title:P,multiple:V,renderOption:W,renderValue:M,valueText:G,readOnly:J=!1,footer:q,changed:Q=!1,auto:X,"aria-describedby":Y,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=N(!1),[ne,ae]=N(-1),le=$(null),oe=$(null),de=$(null),se=$(null),ce=$([]),ue=()=>se.current??de.current,pe=!!q?.length,me="sm"===K,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=N(null),ge=x(),ye=$(re);ye.current=re;const xe=$({buffer:"",timer:null}),we=k(),ke=`${we}-listbox`,Ne=U??`${we}-trigger`,$e=e=>`${we}-opt-${e}`,De=`${we}-changed`,Se=d(),je=X??Se,Ce=`${we}-auto`,Ee=[Y,Q?De:void 0,je?Ce:void 0].filter(Boolean).join(" ")||void 0,He=D(()=>n(w),[w]),Ie=V?l:[],Te=u,Oe=f(oe,re,{matchTriggerWidth:!0,...q?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Re="undefined"==typeof window?j:C,ze=`${re}|${Oe?.top}|${Oe?.bottom}|${Oe?.maxHeight}|${w.length}`;Re(()=>{be(null)},[ze]),Re(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,ze]);const Ae=V?He.findIndex(e=>Ie.includes(e.value)):He.findIndex(e=>e.value===l),Be=V?He.filter(e=>Ie.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ae>=0?He[Ae].label:void 0,Ue=!V&&Ae>=0?He[Ae].lang:void 0,Fe=V?He.filter(e=>Ie.includes(e.value)):Ae>=0?[He[Ae]]:[],Ke=M&&Fe.length?M(Fe):void 0,Le=void 0!==Ke&&G?G(Fe):void 0,Pe=S((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Ve=S(()=>{F||J||(ae(Ae>=0?Ae:e(He)),ie(!0))},[F,J,He,Ae]),We=S(e=>{const t=He[e];if(t&&!t.disabled){if(V){const r=l;return Te(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Te(t.value),Pe()}},[He,V,l,Te,Pe]);j(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Pe(),!0),ue)},[re,Pe]),j(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Pe(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Pe(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Pe]),j(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const Me=S(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:Ae,n=t(He,r.buffer,i);n<0||(re?ae(n):V?(ae(n),ie(!0)):We(n))},[re,ne,Ae,He,We,V]),Ge=re?a(w,(e,t)=>{const r=(i=e.value,V?Ie.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
|
|
5
|
+
return H("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||W?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>We(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${V?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":n?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[V&&/* @__PURE__ */I(o,{selected:r}),W?/* @__PURE__ */I("span",{className:"block min-w-0 flex-1 truncate",children:W(e,{selected:r,active:n})}):V?/* @__PURE__ */H("span",{className:"block min-w-0 flex-1",children:[
|
|
6
|
+
/* @__PURE__ */I("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */I("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
|
|
7
|
+
/* @__PURE__ */H(T,{children:[
|
|
8
|
+
/* @__PURE__ */I("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */I("span",{className:he,children:e.description})]}):e.label]},e.value)},we,"mx-1"):null,Je=void 0!==Ke?
|
|
9
|
+
/* @__PURE__ */H("span",{className:"relative block min-w-0 truncate",children:[
|
|
10
|
+
/* @__PURE__ */I("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ke}),
|
|
11
|
+
/* @__PURE__ */I("span",{lang:void 0===Le?Ue:void 0,className:"sr-only",children:Le??Be})]}):/* @__PURE__ */I("span",{lang:Ue,className:`block truncate ${void 0===Be?c:""}`,children:Be??R??" "}),qe={zIndex:h.popup,left:Oe?.left,top:Oe?.top,bottom:Oe?.bottom,width:Oe?.width,maxHeight:Oe?.maxHeight??b,visibility:Oe?void 0:"hidden",...g()},Qe=/* @__PURE__ */I("div",{ref:de,id:ke,role:"listbox","aria-labelledby":_??(Z?void 0:Ne),"aria-label":_?void 0:Z,"aria-multiselectable":V||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...qe,maxHeight:fe}:qe,children:Ge}),Xe=pe?/* @__PURE__ */H("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:qe,children:[Qe,
|
|
12
|
+
/* @__PURE__ */I("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:q.map((e,t)=>/* @__PURE__ */H("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Pe(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(q?.length??0)-1,i=t=>{e.preventDefault(),ce.current[t]?.focus()},n=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void i(Math.min(t+1,r));case"ArrowUp":return void(0===t?n():i(t-1));case"Home":return void i(0);case"End":return void i(r);case"Tab":return e.shiftKey?void(0===t?n():i(t-1)):t<r?void i(t+1):(e.preventDefault(),void Pe());case"Escape":return e.preventDefault(),e.stopPropagation(),void Pe()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-gray-400":"cursor-pointer text-gray-700 hover:bg-blue-50 hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */I(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
13
|
+
/* @__PURE__ */I("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Qe;/* @__PURE__ */
|
|
14
|
+
return H("div",{ref:le,className:"relative",children:[
|
|
15
|
+
/* @__PURE__ */I("button",{ref:oe,id:Ne,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?ke:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":A||void 0,"aria-describedby":Ee,"aria-label":Z,"aria-labelledby":_,title:P,disabled:F,"aria-readonly":J||void 0,onClick:()=>re?Pe():Ve(),onKeyDown:t=>{if(!F&&!J)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(He,e,1)):Ve());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(He,e,-1)):Ve());case"Home":return void(re&&(t.preventDefault(),ae(e(He))));case"End":return void(re&&(t.preventDefault(),ae(r(He))));case"Enter":return void(re&&(t.preventDefault(),We(ne)));case" ":return t.preventDefault(),void(re?We(ne):Ve());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Pe()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Pe(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Me(t.key))}},className:s({invalid:A,size:K,readOnly:J,auto:je,className:`${J?"":"pr-8 "}text-left ${B}`.trim()}),children:Q?
|
|
16
|
+
/* @__PURE__ */H("span",{className:"flex min-w-0 items-center gap-1",children:[Je,
|
|
17
|
+
/* @__PURE__ */I("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Je}),Q&&/* @__PURE__ */I("span",{id:De,hidden:!0,children:ge.select.changed}),je&&/* @__PURE__ */I("span",{id:Ce,hidden:!0,children:ge.settingView.auto}),!J&&/* @__PURE__ */I(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
|
|
18
|
+
/* @__PURE__ */H("select",{ref:te,value:l,multiple:V||void 0,onChange:e=>Te(V?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:F,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==R&&!V&&/* @__PURE__ */I("option",{value:"",disabled:!0,children:R}),
|
|
19
|
+
/* @__PURE__ */I(z,{items:w})]}),re&&E(Xe,document.body)]})}),B=w(function({touchSize:e="touch",...t},r){const i=u();return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */I(R,{ref:r,...t,size:e}):/* @__PURE__ */I(A,{ref:r,...t}):/* @__PURE__ */I(A,{ref:r,...t,size:e})});export{R as NativeSelect,B as Select_default};
|
|
@@ -87,7 +87,8 @@ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"current
|
|
|
87
87
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})})},"folder:solid":function({size:e=18,...r}){/* @__PURE__ */
|
|
88
88
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"})})},globe:function({size:e=18,...r}){/* @__PURE__ */
|
|
89
89
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"})})},grid:function({size:e=18,...r}){/* @__PURE__ */
|
|
90
|
-
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"})})},
|
|
90
|
+
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"})})},"hand-thumb-up":function({size:e=18,...r}){/* @__PURE__ */
|
|
91
|
+
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.633 10.25c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V2.75a.75.75 0 0 1 .75-.75 2.25 2.25 0 0 1 2.25 2.25c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282m0 0h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23H5.904m10.598-9.75H14.25M5.904 18.5c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 0 1-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 9.953 4.167 9.5 5 9.5h1.053c.472 0 .745.556.5.96a8.958 8.958 0 0 0-1.302 4.665c0 1.194.232 2.333.654 3.375Z"})})},help:function({size:e=18,...r}){/* @__PURE__ */
|
|
91
92
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"})})},home:function({size:e=18,...r}){/* @__PURE__ */
|
|
92
93
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})})},image:function({size:e=18,...r}){/* @__PURE__ */
|
|
93
94
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M6 3.75h12a2.25 2.25 0 0 1 2.25 2.25v12a2.25 2.25 0 0 1 -2.25 2.25h-12a2.25 2.25 0 0 1 -2.25 -2.25v-12a2.25 2.25 0 0 1 2.25 -2.25ZM3.75 17.075L8.114 12.71A1.903 1.903 0 0 1 10.806 12.71L15.171 17.075M13.902 15.806L15.094 14.613A1.903 1.903 0 0 1 17.785 14.613L20.247 17.075M14.995 8.255a0.75 0.75 0 1 0 1.5 0a0.75 0.75 0 1 0 -1.5 0Z"})})},inbox:function({size:e=18,...r}){/* @__PURE__ */
|
|
@@ -165,5 +166,5 @@ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"current
|
|
|
165
166
|
return t("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"})})},widgets:function({size:e=18,...r}){/* @__PURE__ */
|
|
166
167
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"})})},window:function({size:e=18,...r}){/* @__PURE__ */
|
|
167
168
|
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8.25V18a2.25 2.25 0 0 0 2.25 2.25h13.5A2.25 2.25 0 0 0 21 18V8.25m-18 0V6a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 6v2.25m-18 0h18M5.25 6h.008v.008H5.25V6ZM7.5 6h.008v.008H7.5V6Zm2.25 0h.008v.008H9.75V6Z"})})},"zoom-in":function({size:e=18,...r}){/* @__PURE__ */
|
|
168
|
-
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM10.5 7.5v6m3-3h-6"})})}};function h(e,r){return(r?d[`${e}:${r}`]:void 0)??d[e]}var a={muted:"text-gray-500",accent:"text-blue-600",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600"},
|
|
169
|
-
return t(f,{width:
|
|
169
|
+
return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM10.5 7.5v6m3-3h-6"})})}};function h(e,r){return(r?d[`${e}:${r}`]:void 0)??d[e]}var a={muted:"text-gray-500",accent:"text-blue-600",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600"},u=/* @__PURE__ */new Set;function s({name:o,glyph:d,size:s,tone:l,look:c,title:L,fallback:k,className:M,...v}){n(e,r,r);const p=o??d,f=i(p,c)??k??h(p,c);if(!f)return u.has(p)||(u.add(p),console.warn(`efficient-shell/icons: no registered icon set draws "${p}". Register one at startup, for example registerIconSet(efficient) from 'efficient-shell/icons/efficient'.`)),null;const g=void 0!==L||void 0!==v["aria-label"]||void 0!==v["aria-labelledby"],w=[l?a[l]:"",M??""].filter(Boolean).join(" ");/* @__PURE__ */
|
|
170
|
+
return t(f,{width:s??"1em",height:s??"1em","data-icon":p,"aria-hidden":!g||void 0,role:g?"img":void 0,"aria-label":L,...v,className:w||void 0})}export{s as Icon,h as kitDrawing};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveGrip as r,MoveHint as t,moveFromKey as a}from"./chunk-3PGK3VFS.js";import{GROUP_COLORS as n}from"./chunk-D323R2FT.js";import{Icon as o}from"./chunk-
|
|
1
|
+
import{MOVE_KEYS as e,MoveGrip as r,MoveHint as t,moveFromKey as a}from"./chunk-3PGK3VFS.js";import{GROUP_COLORS as n}from"./chunk-D323R2FT.js";import{Icon as o}from"./chunk-2SHYR3RA.js";import{OneLineLabel as i}from"./chunk-6KO5VTL7.js";import{Tooltip as s}from"./chunk-22S6LG6D.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c}from"./chunk-E6UCGCOC.js";import{useRef as d,useCallback as u,useId as p,isValidElement as m}from"react";import{jsx as g,jsxs as h}from"react/jsx-runtime";var f='[role="treeitem"]';function b(e){return[...e.querySelectorAll(f)].filter(r=>{for(let t=r.parentElement?.closest('[role="group"]');t&&e.contains(t);t=t.parentElement?.closest('[role="group"]')??null)if(t.hasAttribute("hidden"))return!1;return!0})}function y({"aria-label":e,"aria-labelledby":r,children:t,className:a="",rootProps:n}){const o=d(null);l(()=>{const e=o.current;if(!e)return;const r=[...e.querySelectorAll(f)];if(0===r.length)return;const t=r.find(e=>e===document.activeElement)??r.find(e=>"true"===e.getAttribute("aria-selected"))??b(e)[0]??r[0];for(const e of r)e.tabIndex=e===t?0:-1});const i=u(e=>{n?.onKeyDown?.(e);const r=o.current,t=e.target.closest?.(f);if(!r||!t||e.target!==t||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const a=b(r),i=a.indexOf(t),s=Number(t.getAttribute("aria-level")??"1"),l=t=>{e.preventDefault(),function(e,r){if(r){for(const t of e.querySelectorAll(f))t.tabIndex=t===r?0:-1;r.focus()}}(r,t)};switch(e.key){case"ArrowDown":l(a[i+1]);break;case"ArrowUp":l(a[i-1]);break;case"Home":l(a[0]);break;case"End":l(a[a.length-1]);break;case"ArrowRight":if("true"===t.getAttribute("aria-expanded")){const r=a[i+1];r&&Number(r.getAttribute("aria-level")??"1")>s?l(r):e.preventDefault()}break;case"ArrowLeft":if("true"!==t.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(a[e].getAttribute("aria-level")??"1")<s){l(a[e]);break}}},[n]);/* @__PURE__ */
|
|
2
2
|
return g("div",{...n,ref:o,role:"tree","aria-label":r?void 0:e,"aria-labelledby":r,onKeyDown:i,className:`flex flex-col gap-1 ${a}`.trim(),children:t})}function v({children:e,hidden:r,className:t=""}){/* @__PURE__ */
|
|
3
3
|
return g("div",{role:"group",hidden:r,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${t}`.trim(),children:e})}var x=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal"].join(" "),k=`${x} bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600`;function w(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!m(e)&&"label"in e}function N(e){if(null==e||!1===e)return null;const r=Array.isArray(e)&&e.length>0&&e.every(w)?e:w(e)?[e]:null;return r?r.map((e,r)=>/* @__PURE__ */g("span",{"data-tree-count":"","data-tone":e.tone,className:e.tone?`${x} ${n[e.tone]}`:k,children:e.label},r)):/* @__PURE__ */g("span",{"data-tree-count":"",className:k,children:e})}function A({children:e,count:r,expanded:t,onToggle:a}){const n=void 0!==t,o=
|
|
4
4
|
/* @__PURE__ */g("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */g(i,{children:e})}),s=null!=r&&!1!==r&&/* @__PURE__ */g("span",{"data-tree-count":"",className:k,children:r}),l="text-xs font-semibold uppercase tracking-wide text-gray-500";return n?/* @__PURE__ */g("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */h("button",{type:"button","aria-expanded":t,onClick:a,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-gray-900","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",l].join(" "),children:[
|
|
5
5
|
/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:j(!!t)}),o,s]})}):/* @__PURE__ */h("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${l}`,children:[
|
|
6
|
-
/* @__PURE__ */g("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),o,s]})}var j=e=>/* @__PURE__ */g(o,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),D={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function C({label:n,level:o=1,icon:s,preview:l,selected:c=!1,tone:d,expanded:u,onToggle:m,onSelect:f,muted:b=!1,badge:y,actions:v,actionsPinned:x=!1,actionsOverlay:k=!0,rename:w,drop:A,dragging:C=!1,draggable:P=!1,dragHint:$,onMove:K,rowProps:
|
|
7
|
-
return h("div",{...
|
|
6
|
+
/* @__PURE__ */g("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),o,s]})}var j=e=>/* @__PURE__ */g(o,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),D={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function C({label:n,level:o=1,icon:s,preview:l,selected:c=!1,tone:d,expanded:u,onToggle:m,onSelect:f,muted:b=!1,badge:y,actions:v,actionsPinned:x=!1,actionsOverlay:k=!0,rename:w,drop:A,dragging:C=!1,draggable:P=!1,dragHint:$,onMove:K,rowProps:S,className:E=""}){const H=void 0!==u,I=p(),T=[S?.["aria-describedby"],K?I:void 0].filter(Boolean).join(" ")||void 0,R="shared"===d?"text-[color:var(--status-success-soft-ink)]":null,L=c?R?`bg-[var(--status-success-soft)] ${R}`:"bg-blue-50 text-blue-700":"into"===A?`bg-blue-50 ${R??"text-gray-900"}`:`${R??"text-gray-700"} hover:bg-gray-100`;/* @__PURE__ */
|
|
7
|
+
return h("div",{...S,role:"treeitem","aria-level":o,"aria-selected":c,"aria-expanded":H?u:void 0,"data-tone":d,tabIndex:c?0:-1,"aria-keyshortcuts":S?.["aria-keyshortcuts"]??(K?e:void 0),"aria-describedby":T,"data-drop":A,"data-draggable":P||void 0,onKeyDown:e=>{if(S?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const r=a(e);r&&K?(e.preventDefault(),K(r)):"Enter"!==e.key&&" "!==e.key||!f?("ArrowRight"===e.key&&H&&!u&&m||"ArrowLeft"===e.key&&H&&u&&m)&&(e.preventDefault(),m()):(e.preventDefault(),f())},onClick:e=>{S?.onClick?.(e),e.defaultPrevented||f?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",P?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",L,"into"===A?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",C?"opacity-40":"",E].filter(Boolean).join(" "),children:["before"===A&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===A&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),P&&
|
|
8
8
|
/* @__PURE__ */g(r,{marker:"tree",hint:$,dragging:C,revealClassName:"group-hover/treerow:opacity-100"}),
|
|
9
|
-
/* @__PURE__ */g("span",
|
|
9
|
+
/* @__PURE__ */g("span",H?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),m?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:j(!!u)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=s&&/* @__PURE__ */g("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(b?"text-gray-400":""),children:s}),
|
|
10
10
|
/* @__PURE__ */h("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[w??
|
|
11
11
|
/* @__PURE__ */g("span",{className:`flex min-w-0 ${c?"font-semibold":"font-medium"} ${b?"text-gray-400 line-through":""}`,children:/* @__PURE__ */h(i,{children:[n,null!=l&&/* @__PURE__ */g("span",{className:"ml-2 font-normal text-gray-500",children:l})]})}),N(y),null!=v&&!k&&/* @__PURE__ */g("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(x||b?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:v})]}),null!=v&&k&&
|
|
12
12
|
/* @__PURE__ */h("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:D,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(x||b||c?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
|
|
13
13
|
/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
14
14
|
/* @__PURE__ */g("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
15
|
-
/* @__PURE__ */g("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:v})]}),K&&/* @__PURE__ */g(t,{id:
|
|
15
|
+
/* @__PURE__ */g("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:v})]}),K&&/* @__PURE__ */g(t,{id:I})]})}function P({onAdd:e,label:r,drop:t=!1,slotProps:a}){const n=c().tree,o=t?n.dropHere:r??n.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(t?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
|
|
16
16
|
return g("div",{...a,role:"presentation","data-drop":t||void 0,children:e?/* @__PURE__ */h("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
|
|
17
17
|
/* @__PURE__ */g("span",{"aria-hidden":"true",children:"+"}),o]}):/* @__PURE__ */g("span",{className:i,children:o})})}function $({onInsert:e,label:r,drop:t=!1,seamProps:a}){const n=c().tree,i=r??n.insertHere,l=t?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
|
|
18
18
|
return h("div",{...a,role:"presentation","data-tree-seam":"","data-drop":t||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${a?.className??""}`.trim(),children:[
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{Dialog as e}from"./chunk-
|
|
1
|
+
import{Dialog as e}from"./chunk-TW6WYYBC.js";import{buttonClasses as t}from"./chunk-K7U4RWXJ.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{useShellStrings as n,splitAround as o}from"./chunk-E6UCGCOC.js";import{createContext as l,useContext as a,useState as i,useRef as s,useCallback as c,useEffect as u}from"react";import{jsxs as d,jsx as m,Fragment as h}from"react/jsx-runtime";var b=l(()=>Promise.resolve(!1)),f=()=>a(b),g=()=>Promise.resolve(!1),p=e=>g(e),y=()=>Promise.resolve(!1),v=e=>y(e),x=()=>Promise.resolve(null),N=e=>x(e),k={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-blue-100",button:t({variant:"primary"})}},w=t({variant:"secondary"}),C=t({variant:"primary"}),L="w-full rounded-md border border-gray-300 h-8 px-3 text-sm";function P(){/* @__PURE__ */
|
|
2
2
|
return m(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function j(){/* @__PURE__ */
|
|
3
|
-
return m(r,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function E({children:t}){const[r,l]=i(!1),[a,f]=i({message:""}),[p,v]=i(0),N=s(),E=s(null),
|
|
4
|
-
return d(b.Provider,{value:
|
|
5
|
-
/* @__PURE__ */m(e,{open:r,onClose:()=>
|
|
6
|
-
/* @__PURE__ */m("button",{ref:
|
|
7
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>
|
|
3
|
+
return m(r,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function E({children:t}){const[r,l]=i(!1),[a,f]=i({message:""}),[p,v]=i(0),N=s(),E=s(null),W=s(0),F=s([]),T=s(null),$=s(null),K=c(e=>{E.current=e.id,N.current=e.resolve,v(e.id),f(e.options),l(!0)},[]),R=c(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const r={id:++W.current,options:t,resolve:e};null===E.current?K(r):F.current.push(r)})},[K]),[Y,D]=i(!1),[U,A]=i({message:""}),[B,G]=i(""),H=s(),J=c(e=>(A(e),G(""),D(!0),new Promise(e=>{H.current=e})),[]),[O,S]=i(!1),[V,X]=i({}),[q,z]=i(""),I=s(),M=c(e=>{const t="string"==typeof e?{message:e}:e;return X(t),z(t.defaultValue??""),S(!0),new Promise(e=>{I.current=e})},[]);u(()=>{g=R,y=J,x=M},[R,J,M]);const Q=(e,t)=>{if(E.current!==e)return;const r=N.current,n=F.current.shift();n?K(n):(E.current=null,N.current=void 0,l(!1)),r?.(t)},Z=e=>{D(!1),G(""),H.current?.(e)},_=e=>{if(e){const e=q.trim();if(!e&&!V.allowEmpty)return S(!1),void I.current?.(null);S(!1),I.current?.(e)}else S(!1),I.current?.(null)},ee=a.variant||(a.confirmLabel?.toLowerCase().includes("delete")||a.message.toLowerCase().includes("delete")?"danger":"info"),te=k[ee],re=k["warning"===U.variant?"warning":"danger"],ne=U.confirmWord,oe=null==ne||B===ne,le=n().dialog,[ae,ie]=o(le.typeToConfirm);/* @__PURE__ */
|
|
4
|
+
return d(b.Provider,{value:R,children:[t,
|
|
5
|
+
/* @__PURE__ */m(e,{open:r,onClose:()=>Q(p,!1),initialFocus:T,footer:/* @__PURE__ */d(h,{children:[
|
|
6
|
+
/* @__PURE__ */m("button",{ref:T,type:"button",onClick:()=>Q(p,!1),className:w,children:a.cancelLabel||le.cancel}),
|
|
7
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>Q(p,!0),className:te.button,children:a.confirmLabel||le.ok})]}),children:/* @__PURE__ */d("div",{className:"flex gap-4",children:[
|
|
8
8
|
/* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */m(P,{})}),
|
|
9
9
|
/* @__PURE__ */d("div",{className:"flex-1",children:[
|
|
10
10
|
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900",children:a.title||le.confirmTitle}),
|
|
11
11
|
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:a.message})]})]})}),
|
|
12
|
-
/* @__PURE__ */d(e,{open:
|
|
13
|
-
/* @__PURE__ */m("button",{ref
|
|
12
|
+
/* @__PURE__ */d(e,{open:Y,onClose:()=>Z(!1),initialFocus:null!=ne?void 0:$,footer:/* @__PURE__ */d(h,{children:[
|
|
13
|
+
/* @__PURE__ */m("button",{ref:$,type:"button",onClick:()=>Z(!1),className:w,children:U.cancelLabel||le.destructiveCancel}),
|
|
14
14
|
/* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!0),disabled:!oe,className:re.button,children:ne??U.confirmLabel??le.destructiveConfirm})]}),children:[
|
|
15
15
|
/* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!1),"aria-label":le.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */m(j,{})}),
|
|
16
16
|
/* @__PURE__ */d("div",{className:"flex gap-4",children:[
|
|
@@ -21,7 +21,7 @@ return d(b.Provider,{value:D,children:[t,
|
|
|
21
21
|
/* @__PURE__ */d("p",{className:"mt-3 text-sm text-gray-700",children:[ae,
|
|
22
22
|
/* @__PURE__ */m("kbd",{className:"rounded border border-gray-300 bg-gray-50 px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:ne}),ie]}),
|
|
23
23
|
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:B,onChange:e=>G(e.target.value),onKeyDown:e=>{"Enter"===e.key&&B===ne&&Z(!0)},placeholder:ne,className:`mt-2 ${L} focus:border-red-500`})]})]})]})]}),
|
|
24
|
-
/* @__PURE__ */d(e,{open:
|
|
25
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:
|
|
26
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!
|
|
27
|
-
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:q,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:
|
|
24
|
+
/* @__PURE__ */d(e,{open:O,onClose:()=>_(!1),title:V.title||le.promptTitle,footer:/* @__PURE__ */d(h,{children:[
|
|
25
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:V.cancelLabel||le.cancel}),
|
|
26
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!V.allowEmpty&&!q.trim(),className:C,children:V.confirmLabel||le.ok})]}),children:[V.message&&/* @__PURE__ */m("p",{className:"text-sm text-gray-600",children:V.message}),
|
|
27
|
+
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:q,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:V.placeholder,className:`mt-3 ${L} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{E as ConfirmProvider,p as confirm,v as confirmDestructive,N as prompt,f as useConfirm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-P5BOTIJU.js";import{CartesianPlot as t}from"./chunk-
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-P5BOTIJU.js";import{CartesianPlot as t}from"./chunk-I4VD5D43.js";import{resolveSeriesColor as i,CHART_INK as l}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as a}from"./chunk-E6UCGCOC.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{jsx as m,jsxs as n}from"react/jsx-runtime";function s({boxes:s,height:c=240,width:h,color:u,tone:x,formatValue:d,yAxisLabel:y,label:k,className:b,emptyLabel:f}){const p=r().charts,q=a(),g=d??(e=>o(e,q)),v=k??p.distribution,W=i(0,u,x),j=s.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
|
|
2
2
|
return m(t,{labels:s.map(e=>e.label),values:j,height:c,width:h,bandPadding:.5,formatValue:g,yAxisLabel:y,className:b,emptyLabel:f,ariaLabel:p.fiveNumber(v,s.length),tooltip:t=>{const i=s[t];/* @__PURE__ */
|
|
3
3
|
return m(e,{title:i.label,rows:[{key:"max",label:p.maximum,color:W,value:g(i.max)},{key:"q3",label:p.q3,color:W,value:g(i.q3)},{key:"median",label:p.median,color:W,value:g(i.median)},{key:"q1",label:p.q1,color:W,value:g(i.q1)},{key:"min",label:p.minimum,color:W,value:g(i.min)}],emphasisKey:"median",footnote:i.outliers?.length?p.outliers(i.outliers.length):void 0})},children:({x:e,y:t,active:i})=>/* @__PURE__ */m("g",{children:s.map((r,a)=>{const o=e.center(a),s=Math.max(6,e.bandwidth);/* @__PURE__ */
|
|
4
4
|
return n("g",{opacity:null!==i&&i!==a?.45:1,children:[
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-D323R2FT.js";import{Icon as i}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-D323R2FT.js";import{Icon as i}from"./chunk-2SHYR3RA.js";import{OneLineLabel as r}from"./chunk-6KO5VTL7.js";import{useShellStrings as s}from"./chunk-E6UCGCOC.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
2
2
|
return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
|
|
3
3
|
/* @__PURE__ */n(r,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(i,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-PCKYNZ5Y.js";import{Avatar as r}from"./chunk-MMFJBWJC.js";import{Button_default as t}from"./chunk-4IU5BSVE.js";import{useState as a}from"react";import{jsx as i,jsxs as l}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],n=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function d(){const[d,c]=a(1),o=n.find(e=>e.id===d)??n[0];/* @__PURE__ */
|
|
2
2
|
return i("div",{className:"h-full",children:/* @__PURE__ */i(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */l("div",{className:"flex h-full flex-col p-2",children:[
|
|
3
3
|
/* @__PURE__ */i(t,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,r)=>/* @__PURE__ */l("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
4
4
|
/* @__PURE__ */i("span",{children:e.label}),null!=e.count&&/* @__PURE__ */i("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */l("div",{className:"flex h-full",children:[
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{CountBadge as e}from"./chunk-MAOJENIB.js";import{Icon as n}from"./chunk-
|
|
2
|
-
return o("div",{"data-accordion":$,className:`@container/acc flex flex-col ${"band"===$?"gap-0.5":""} ${g}`.trim(),children:d.map(i=>{const t=
|
|
1
|
+
import{CountBadge as e}from"./chunk-MAOJENIB.js";import{Icon as n}from"./chunk-2SHYR3RA.js";import{useShellStrings as i,useShellLocale as t}from"./chunk-E6UCGCOC.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useState as a,useId as s}from"react";import{jsx as o,jsxs as c,Fragment as l}from"react/jsx-runtime";var d="px-4 @max-[260px]/acc:px-3",h={band:{head:`${d} py-3 bg-(--rosh-fold-band)`,press:"hover:bg-(--rosh-fold-band-hover)",title:"text-base font-semibold text-(--ink-strongest)",chev:"text-(--ink-strongest)",body:`${d} pb-2`},row:{head:`${d} py-2`,press:"hover:bg-gray-50",title:"text-sm font-medium text-(--ink-strong)",chev:"text-(--ink-strong)",body:`${d} pb-2`}},m=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join(""),u="m-0 p-0 border-0 [font:inherit] [letter-spacing:inherit] [text-transform:inherit]";function f({items:d,defaultOpenIds:f=[],openIds:p,onOpenChange:b,allowMultiple:v=!1,level:x=3,tier:$="band",className:g=""}){const N=h[$],y=i(),k=t(),[w,j]=a(f),C=s(),O=`h${x}`,A=p??w;/* @__PURE__ */
|
|
2
|
+
return o("div",{"data-accordion":$,className:`@container/acc flex flex-col ${"band"===$?"gap-0.5":""} ${g}`.trim(),children:d.map(i=>{const t=A.includes(i.id),a=`${C}-${m(i.id)}-head`,s=`${C}-${m(i.id)}-panel`;/* @__PURE__ */
|
|
3
3
|
return c("div",{children:[
|
|
4
|
-
/* @__PURE__ */o(O,{className:u,children:/* @__PURE__ */c("button",{type:"button",id:a,disabled:i.disabled,"aria-expanded":t,"aria-controls":t?s:void 0,onClick:()=>(e=>{const n=
|
|
4
|
+
/* @__PURE__ */o(O,{className:u,children:/* @__PURE__ */c("button",{type:"button",id:a,disabled:i.disabled,"aria-expanded":t,"aria-controls":t?s:void 0,onClick:()=>(e=>{const n=A.includes(e)?A.filter(n=>n!==e):v?[...A,e]:[e];void 0===p&&j(n),b?.(n)})(i.id),className:`flex w-full items-center gap-2 text-left transition-colors duration-(--motion-fast) disabled:cursor-not-allowed disabled:opacity-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${N.head} ${N.press}`,children:[null!=i.icon&&/* @__PURE__ */o("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${N.chev}`,children:i.icon}),
|
|
5
5
|
/* @__PURE__ */o("span",{className:`min-w-0 flex-1 ${N.title}`,children:i.title}),"number"==typeof i.count&&i.count>0&&
|
|
6
6
|
/* @__PURE__ */c(l,{children:[
|
|
7
7
|
/* @__PURE__ */o("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */o(e,{count:i.count,tone:"accent"})}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useWindowMenuItem as e,Modal as t}from"./chunk-
|
|
1
|
+
import{useWindowMenuItem as e,Modal as t}from"./chunk-2AHHM4SK.js";import{navIcons as r}from"./chunk-CY5N5OA3.js";import{VERSION as s}from"./chunk-BZMZTPS6.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};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-TZHWF3P5.js";import{useTabLayer as n,focusableIn as o}from"./chunk-CDAJKLGL.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-FKZEGBLK.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k=/(^|[\s:])!?z-/,w={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function D({trigger:D,items:L,align:K="end",side:j="bottom","aria-label":E,className:W="",triggerClassName:A,menuClassName:C="",minWidth:S=180,linkAs:H,disabled:$,id:N,"aria-describedby":T,"aria-disabled":U=!1,onOpenChange:B,footer:G,footerLabel:I}){const[J,q]=m(!1),[M,P]=m(-1),z=h(null),F=h(null),R=h(null),Z=h(null),O=h(null),Q=null!=G&&!1!==G,V=h({text:"",at:0}),Y=g(),X=g(),_=N??X,ee=h(B);ee.current=B;const te=h(J);te.current=J;const re=v(e=>{q(!1),te.current&&(te.current=!1,ee.current?.(!1)),e&&F.current?.focus()},[]),ne=(t,r)=>{const n=L.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(L[i]))return i}return-1},oe=()=>R.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!J)return;const e=e=>{const t=e.target;if(z.current?.contains(t)||oe()?.contains(t))return;const r=oe()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||re(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>re(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[J,re]);const ie=v(()=>{const e=oe(),t=F.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:K,side:j});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=K},[K,j]);p(()=>{J&&ie()}),b(()=>{if(J)return u(()=>F.current,ie)},[J,ie]),b(()=>{if(!J)return;const t=R.current,r=e(L[M])?t?.querySelector(`[data-dropdown-index="${M}"]`):null;(r??t)?.focus({preventScroll:!0})},[J,M]),b(()=>{if(J)return f(e=>"Escape"===e.key&&(re(!0),!0),()=>Z.current)},[J,re]),n(Z,J&&Q);const ae=h(null),le=e=>"first"===e?ne(0,1):ne(L.length-1,-1),se=e=>{P(le(e)),q(!0),te.current||(te.current=!0,ae.current=e,B?.(!0))};p(()=>{const e=ae.current;if(!J||!e)return;ae.current=null;const t=le(e);t!==M&&P(t)});const de=t(L,Y),ce="function"==typeof G?G({close:()=>re(!0)}):G,ue={...k.test(C)?{}:{zIndex:s.popup},minWidth:S};/* @__PURE__ */
|
|
2
|
+
return y("div",{ref:z,className:`relative inline-flex ${W}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */x("button",{ref:F,id:_,type:"button","aria-haspopup":"menu","aria-expanded":J,"aria-controls":J?Y:void 0,"aria-label":E,"aria-describedby":T,"aria-disabled":U||void 0,disabled:$,onClick:()=>{U||(J?re(!1):se("first"))},onKeyDown:e=>{U||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),se("first")):"ArrowUp"===e.key&&(e.preventDefault(),se("last")))},className:A??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60 "+(E?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:D}),J&&
|
|
4
|
+
/* @__PURE__ */x(i,{portal:!0,className:C,style:ue,children:/* @__PURE__ */y("div",{ref:Z,children:[
|
|
5
|
+
/* @__PURE__ */x("div",{ref:R,id:Y,role:"menu","aria-orientation":"vertical","aria-label":E,"aria-labelledby":E?void 0:_,"aria-describedby":de,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),P(ne(M+1,1));else if("ArrowUp"===t.key)t.preventDefault(),P(ne(M-1,-1));else if("Home"===t.key)t.preventDefault(),P(ne(0,1));else if("End"===t.key)t.preventDefault(),P(ne(L.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&O.current?o(O.current)[0]:void 0;e?e.focus({preventScroll:!0}):re(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-V.current.at<500?V.current.text+n:n;V.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?M+1:Math.max(M,0),s=R.current,d=L.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(L[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void P(n)}})(t)},children:r(L,{menuId:Y,choose:e=>{e.disabled||(re(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>re(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===M?0:-1,onMouseEnter:()=>{t.disabled||O.current?.contains(document.activeElement)||P(e)}}),linkAs:H})}),Q&&/* @__PURE__ */y("div",{ref:O,role:"group","aria-label":I,"data-dropdown-footer":"",onKeyDown:e=>{const t=O.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=R.current?.querySelector(`[data-dropdown-index="${M}"]`);return void(t??R.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),re(!0))},children:[
|
|
6
|
+
/* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
|
|
7
|
+
/* @__PURE__ */x("div",{style:w,children:ce})]})]})})]})}export{D as DropdownMenu};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as a}from"./chunk-
|
|
2
|
-
return S("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function F(F){const{options:
|
|
3
|
-
return C("div",{ref:ye,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(ye.current?.contains(t)||xe.current?.contains(t))||je.current||document.activeElement!==we.current&&De(!0)},children:[(Ye=/* @__PURE__ */S("input",{id:de,ref:we,type:"text",autoComplete:"off",role:"combobox","aria-expanded":ae,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":ae?he:void 0,"aria-activedescendant":ae&&se>=0&&se<
|
|
4
|
-
/* @__PURE__ */S("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */S("span",{ref:
|
|
5
|
-
/* @__PURE__ */C("div",{ref:xe,onMouseDownCapture:()=>{je.current=!0,setTimeout(()=>{je.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:p.popup,left:We?.left,right:We?.right,top:We?.top,bottom:We?.bottom,minWidth:We?.minWidth,width:We?.width,...re&&{maxWidth:We?.maxWidth},visibility:We?void 0:"hidden",...v()},children:[Z&&te&&
|
|
6
|
-
/* @__PURE__ */S("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ee([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-gray-50 border-b ${b}`,children:ge.select.clearAll}),
|
|
7
|
-
/* @__PURE__ */S(c,{size:"sm",padding:"py-2",label:ge.search.searching}):
|
|
8
|
-
/* @__PURE__ */S("span",{className:"min-w-0 flex-1",children:
|
|
9
|
-
/* @__PURE__ */C("div",{id:he,role:
|
|
1
|
+
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as a}from"./chunk-XZL3HCWH.js";import{INPUT_BASE_ON as i,INPUT_BASE as s}from"./chunk-PF3ANJFI.js";import{Button_default as u}from"./chunk-4IU5BSVE.js";import{LoadingSpinner as c}from"./chunk-Q5MD3VY6.js";import{Tooltip as d}from"./chunk-22S6LG6D.js";import{onOverlayOpen as h}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as p}from"./chunk-62LW225J.js";import{useDropdownPosition as m,MENU_MAX_HEIGHT as f}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{GLASS_DIVIDER as b,glassStyle as v}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as w}from"./chunk-E6UCGCOC.js";import{useState as x,useId as k,useRef as $,useMemo as j,useEffect as D}from"react";import{createPortal as N}from"react-dom";import{jsxs as C,jsx as S}from"react/jsx-runtime";function W(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}function L({onClear:e,ariaLabel:t}){/* @__PURE__ */
|
|
2
|
+
return S("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function F(F){const{options:R,placeholder:E,emptyOptionLabel:M,className:T="",disabled:z,id:I,filter:O=!1,allowFreeText:U=!1,freeTextOption:A,onSearchChange:B,loading:H=!1,error:J,onRetry:G,rightAdornment:P,renderOption:V,clearable:Q=!0,"aria-label":X,"aria-labelledby":K,"aria-describedby":Y}=F,Z=!0===F.multiple,q=F.multiple?F.value:F.value?[F.value]:[],_=F.multiple?"":F.value,ee=e=>{F.multiple?F.onChange(e):F.onChange(e[0]??"")},te=q.length>0,ne=O&&te&&!z,re=Z||O,le=null!=A,oe=U||le,[ae,ie]=x(!1),[se,ue]=x(-1),ce=k(),de=I??`${ce}-input`,he=`${ce}-listbox`,pe=e=>`${ce}-opt-${e}`,[me,fe]=x(""),ge=w(),be=M??ge.select.none,ve=e=>{fe(e),ue(-1),B?.(e)},ye=$(null),we=$(null),xe=$(null),ke=$(null),$e=$(ae);$e.current=ae;const je=$(!1),De=e=>{$e.current&&($e.current=!1,e&&U&&!le&&Qe&&(Z?q.includes(Qe)||ee([...q,Qe]):Qe!==_&&ee([Qe])),ie(!1),ve(""))},Ne=(e,t)=>{if(!e.disabled){if(Z)return ee(q.includes(e.value)?q.filter(t=>t!==e.value):[...q,e.value]),void(e===Xe?ve(""):ue(t));ee([e.value]),De(!1)}},[Ce,Se]=x(null);g(()=>{if(!P||ae)return void Se(null);const e=ke.current?.offsetWidth??0;Se(e?e+(Me?32:8)+6:null)});const We=m(we,ae,re?{popupRef:xe}:{matchTriggerWidth:!0}),Le=j(()=>t(R),[R]),Fe=q.join("\0"),Re=j(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Le)q.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(oe)for(const n of q)t.has(n)||e.push(n);return e},[Le,Fe,oe]),Ee=Re.join(", "),Me=Q&&te&&!z,[Te,ze]=x(null),Ie=$(null),Oe=$(""),Ue=$(()=>{});Ue.current=()=>{const e=we.current,t=Ie.current;if(!Z||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Re.join("\0")}`;if(o===Oe.current)return;Oe.current=o;let a=null;r>0&&Re.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,a=W(Re,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),ze(e=>e?.shown===a?.shown&&e?.cut===a?.cut?e:a)},g(()=>{Ue.current()}),D(()=>{const e=we.current;if(!Z||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Ue.current());return t.observe(e),()=>t.disconnect()},[Z]);const Ae=Re.length,Be=!Z||!Te||Te.shown>=Ae?Ee:0===Te.shown?ge.select.selectedCount(Ae):`${Re.slice(0,Te.shown).join(", ")} +${Ae-Te.shown}`,He=Z&&null!==Te&&(Te.shown<Ae||Te.cut),Je=ae&&te&&re;D(()=>{if(!ae)return;const e=e=>{const t=e.target;ye.current?.contains(t)||xe.current?.contains(t)||De(!0)};document.addEventListener("mousedown",e);const t=h(()=>De(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[ae,U,me,Fe,F.onChange]),D(()=>{if(ae)return y(e=>!("Escape"!==e.key||!$e.current)&&(De(!1),we.current?.blur(),!0),()=>xe.current)},[ae]);const Ge=j(()=>{const e=/* @__PURE__ */new Set;return n(R,t=>!e.has(t.value)&&(e.add(t.value),!0))},[R]),Pe=j(()=>{if(B)return Ge;const e=me.trim().toLowerCase();return e?n(Ge,t=>r(t,e)):Ge},[Ge,me,B]),Ve=j(()=>t(Pe),[Pe]),Qe=me.trim(),Xe=j(()=>le&&Qe?Le.some(e=>e.label===Qe)||q.includes(Qe)?null:{value:Qe,label:Qe}:null,[le,Qe,Le,Fe]),Ke=j(()=>Xe?[...Ve,Xe]:Ve,[Ve,Xe]);/* @__PURE__ */
|
|
3
|
+
return C("div",{ref:ye,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(ye.current?.contains(t)||xe.current?.contains(t))||je.current||document.activeElement!==we.current&&De(!0)},children:[(Ye=/* @__PURE__ */S("input",{id:de,ref:we,type:"text",autoComplete:"off",role:"combobox","aria-expanded":ae,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":ae?he:void 0,"aria-activedescendant":ae&&se>=0&&se<Ke.length?pe(se):void 0,"aria-label":K?void 0:X,"aria-labelledby":K,"aria-describedby":Y,value:ae?me:Be,onChange:e=>{ve(e.target.value),ie(!0)},onFocus:()=>{z||(ve(""),ie(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(z)return;if(t.preventDefault(),!ae)return void ie(!0);if(0===Ke.length)return;const n="ArrowDown"===t.key?1:-1;return void ue(t=>e(Ke,t,n))}"Enter"===t.key?(t.preventDefault(),ae&&se>=0&&se<Ke.length?Ne(Ke[se],se):1!==Ve.length||Ve[0].disabled?U&&!le&&Qe&&(Z?(q.includes(Qe)||ee([...q,Qe]),ve("")):(ee([Qe]),De(!1),we.current?.blur())):Ne(Ve[0],0)):"Escape"===t.key?(De(!1),we.current?.blur()):"Tab"===t.key&&De(!0)},placeholder:Je?Be:E||be,className:`${ne?i:s} ${T} ${Me?"pr-8":""} ${z?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate${Je?" rosh-field-shows-choice":""}`,style:Ce?{paddingRight:Ce}:void 0,disabled:z}),Z?/* @__PURE__ */S(d,{content:!ae&&He?Ee:null,className:"block",children:Ye}):Ye),Z&&
|
|
4
|
+
/* @__PURE__ */S("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */S("span",{ref:Ie,className:"whitespace-pre"})}),Me&&/* @__PURE__ */S(L,{ariaLabel:ge.select.clear,onClear:()=>{ee([]),De(!1)}}),P&&!ae&&/* @__PURE__ */S("div",{ref:ke,className:`absolute top-1/2 -translate-y-1/2 ${Me?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:P}),ae&&N(
|
|
5
|
+
/* @__PURE__ */C("div",{ref:xe,onMouseDownCapture:()=>{je.current=!0,setTimeout(()=>{je.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:p.popup,left:We?.left,right:We?.right,top:We?.top,bottom:We?.bottom,minWidth:We?.minWidth,width:We?.width,...re&&{maxWidth:We?.maxWidth},visibility:We?void 0:"hidden",...v()},children:[Z&&te&&Q&&!z&&
|
|
6
|
+
/* @__PURE__ */S("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ee([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-gray-50 border-b ${b}`,children:ge.select.clearAll}),H?
|
|
7
|
+
/* @__PURE__ */S(c,{size:"sm",padding:"py-2",label:ge.search.searching}):J?/* @__PURE__ */C("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
8
|
+
/* @__PURE__ */S("span",{className:"min-w-0 flex-1",children:J}),G&&/* @__PURE__ */S(u,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:G,className:"shrink-0",children:ge.list.retry})]}):null,
|
|
9
|
+
/* @__PURE__ */C("div",{id:he,role:Ke.length?"listbox":void 0,"aria-labelledby":Ke.length?K??(X?void 0:de):void 0,"aria-label":Ke.length&&!K?X:void 0,"aria-multiselectable":!(!Ke.length||!Z)||void 0,className:"overflow-y-auto",style:{maxHeight:We?.maxHeight??f},children:[0===Ke.length?H||J?null:/* @__PURE__ */S("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:ge.select.noMatches}):0===Ve.length?null:l(Pe,(e,t)=>{const n=q.includes(e.value);/* @__PURE__ */
|
|
10
10
|
return C("button",{id:pe(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||Z)&&n.preventDefault(),Ne(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===se?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[Z&&/* @__PURE__ */S(o,{selected:n}),
|
|
11
|
-
/* @__PURE__ */S("span",{className:`min-w-0 ${re?"flex-auto":"flex-1"} truncate`,children:
|
|
12
|
-
/* @__PURE__ */S("button",{id:pe(
|
|
11
|
+
/* @__PURE__ */S("span",{className:`min-w-0 ${re?"flex-auto":"flex-1"} truncate`,children:V?V(e,{selected:n,active:t===se}):e.label}),e.sublabel&&/* @__PURE__ */S(a,{grows:re,children:e.sublabel})]},e.value)},ce),Xe&&A&&
|
|
12
|
+
/* @__PURE__ */S("button",{id:pe(Ve.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{Z&&e.preventDefault(),Ne(Xe,Ve.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-gray-700 hover:bg-gray-50 ${Ve.length?`border-t ${b}`:""} ${se===Ve.length?"bg-gray-100":""}`,children:/* @__PURE__ */S("span",{className:"min-w-0 flex-1 truncate",children:A(Xe.value)})},`${ce}-typed`)]})]}),document.body)]});var Ye}export{F as SearchableSelect,W as fitChoice};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-2AHHM4SK.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
|
|
2
2
|
return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
|
|
3
3
|
/* @__PURE__ */n("div",{children:[
|
|
4
4
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as r}from"./chunk-TZFNWAED.js";import{Icon as n}from"./chunk-
|
|
1
|
+
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as r}from"./chunk-TZFNWAED.js";import{Icon as n}from"./chunk-2SHYR3RA.js";import{useBrowserState as a}from"./chunk-D65T4H6J.js";import{useShellStrings as l}from"./chunk-E6UCGCOC.js";import{useId as i,useRef as s,useEffect as c,Children as o,isValidElement as u}from"react";import{jsx as d,jsxs as m,Fragment as h}from"react/jsx-runtime";function p(e){return"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-2 h-5 rounded-full text-2xs font-medium "+(e?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600")}function f({children:e,count:t}){return null==t?/* @__PURE__ */d("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */m("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:[
|
|
2
2
|
/* @__PURE__ */d("span",{className:"min-w-0 truncate",children:e}),
|
|
3
|
-
/* @__PURE__ */d("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function g(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function x({label:n,count:a,active:o,onClick:u,icon:f,trailing:x,severity:b,depth:y=0}){const w=t(b,"SidebarNavItem"),k=l().severity,N=w?r(w,k):void 0,v=e(),j=i(),C=s(null),
|
|
3
|
+
/* @__PURE__ */d("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function g(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function x({label:n,count:a,active:o,onClick:u,icon:f,trailing:x,severity:b,depth:y=0}){const w=t(b,"SidebarNavItem"),k=l().severity,N=w?r(w,k):void 0,v=e(),j=i(),C=s(null),S=s(n);S.current=n,c(()=>{if(v&&o)return v.report(j,()=>S.current,C.current)},[v,o,j]);const I=/* @__PURE__ */m(h,{children:[null!=f&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:f}),w&&
|
|
4
4
|
/* @__PURE__ */d("span",{"aria-hidden":"true",title:N,className:`shrink-0 h-1.5 w-1.5 rounded-full ${w.fill}`}),
|
|
5
5
|
/* @__PURE__ */d("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof n?n:void 0,children:n}),w&&/* @__PURE__ */d("span",{className:"sr-only",children:N}),null!=a&&a>0&&/* @__PURE__ */d("span",{className:p(o),children:a}),null!=x&&/* @__PURE__ */d("span",{className:"shrink-0",children:x})]});/* @__PURE__ */
|
|
6
|
-
return d("button",1===y?{ref:C,type:"button",onClick:u,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */d("span",{className:g(o),children:
|
|
6
|
+
return d("button",1===y?{ref:C,type:"button",onClick:u,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */d("span",{className:g(o),children:I})}:{ref:C,type:"button",onClick:u,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(o?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:I})}function b({label:e,count:t,children:r,defaultExpanded:l=!0,storageKey:s}){const c=i(),[h,f]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return l},l),g=!h&&o.toArray(r).some(e=>u(e)&&!0===e.props.active);/* @__PURE__ */
|
|
7
7
|
return m("div",{children:[
|
|
8
8
|
/* @__PURE__ */m("button",{type:"button",onClick:()=>{const e=!h;if(f(e),s)try{window.localStorage.setItem(s,e?"1":"0")}catch{}},"aria-expanded":h,"aria-controls":c,className:"flex w-full items-center gap-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(g?"bg-blue-50 text-blue-700":"text-gray-800 hover:bg-gray-100"),children:[
|
|
9
9
|
/* @__PURE__ */d("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2SHYR3RA.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-E6UCGCOC.js";import{jsx as r}from"react/jsx-runtime";var n=["left","center","right","justify"],a={left:"align-left",center:"align-center",right:"align-right",justify:"align-justify"};function i(t){switch(t){case"left":/* @__PURE__ */
|
|
2
2
|
return r(e,{name:"align-left"});case"center":/* @__PURE__ */
|
|
3
3
|
return r(e,{name:"align-center"});case"right":/* @__PURE__ */
|
|
4
4
|
return r(e,{name:"align-right"});case"justify":/* @__PURE__ */
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-DZNG34DC.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-
|
|
2
|
-
return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:
|
|
3
|
-
/* @__PURE__ */h("button",{type:"button",onClick:z.toggle,"aria-pressed":z.playing,title:z.playing?
|
|
4
|
-
/* @__PURE__ */b("span",{children:z.playing?
|
|
5
|
-
/* @__PURE__ */b("b",{className:"font-medium",children:N(
|
|
6
|
-
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",
|
|
1
|
+
import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-DZNG34DC.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-2SHYR3RA.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-E6UCGCOC.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:o,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),_=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[v,M]=u(!1),w=g(null),N=()=>{null!=w.current&&(cancelAnimationFrame(w.current),w.current=null),M(!1)};m(()=>()=>N(),[]),m(()=>{N()},[d]);const S=t.map(e=>a(e.date)).filter(e=>null!=e),x=l(Date.now,null)??Math.max(0,...S,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),C=S.length?Math.min(...S):x,D=S.length?Math.max(...S):x,R=a(r??null)??C,P=a(n??null)??0,O=k.has((o||"").toLowerCase()),q=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),A=(()=>{const e=[P,D,q,R+i];return O||e.push(x),Math.max(...e)})(),T=Math.max(1,Math.round((A-R)/i)),I=a(p??null)??D??R,j=Math.min(Math.max(y??I,R),A),L=t.find(e=>{const t=a(e.date);return null!=t&&t<=j})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>j){$=t[e];break}}const F=(()=>{if(L||!$||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:_.start,date:r||new Date(R).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),E=L??F,G=L?a(L.date):F?R:null,z=$?a($.date):null,H=!!(E&&$&&null!=G&&null!=z&&j>G&&j<z);let J,U;if(H&&null!=G&&null!=z){const e=(j-G)/Math.max(z-G,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of E?.items??[])r[e.part_number]=e;const n={};for(const e of $?.items??[])n[e.part_number]=e;const o=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const o=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:o.description??i.description??"",order_qty:s(o.order_qty??i.order_qty??0),casting:t(s(o.casting),s(i.casting)),cnc:t(s(o.cnc),s(i.cnc)),painting:t(s(o.painting),s(i.painting)),packing:t(s(o.packing),s(i.packing)),finished_goods:t(s(o.finished_goods),s(i.finished_goods)),stock_qty:t(s(o.stock_qty),s(i.stock_qty))}}),i=a(E?.est_completion_date),s=a($?.est_completion_date);let l;l=null!=i&&null!=s?new Date(Math.round(i+(s-i)*e)).toISOString().slice(0,10):E?.est_completion_date||$?.est_completion_date||null,J={id:`interp-${j}`,progress_number:_.estimated,date:new Date(j).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},U=E}else if(J=E??t[t.length-1]??null,J){const e=t.findIndex(e=>e.id===J.id);U=e>=0&&e<t.length-1?t[e+1]:null}else U=null;const Y={};for(const e of U?.items??[])Y[e.part_number]=e;const B=!(!d||J?.id===d),K=d?Math.min(a(p??null)??A,A):A,V=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:R,endMs:A,totalLeadDays:T,scrubMs:j,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:B,beforeAnchor:E,nextAfter:$,displayed:J,prevReport:U,prevByPN:Y,isInterpolated:H,playing:v,startPlay:()=>{if(v)return void N();if(K<=R)return void f(K);M(!0),f(R);let e=performance.now(),t=R;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=K)return f(K),w.current=null,void M(!1);f(t),w.current=requestAnimationFrame(r)};w.current=requestAnimationFrame(r)},stopPlay:N,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:V,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:i,activeId:s,onChange:l,onPickReport:p,onOpenReport:u,onOpenMarker:m,onDragStart:g,renderReportPreview:h,reportLabel:y,playback:k,edgeCaptions:f,bare:_=!1,endMark:v=null}){const M=c().production,w=d(),N=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),S=N.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:y(e),preview:e.preview??h?.(e),onOpen:u?()=>u(e.id):void 0})),x=new Map(N.map(({report:e,ms:t})=>[e.id,t])),C=N.map(({ms:e})=>e),D=m?a.map(e=>({...e,onOpen:m})):a;/* @__PURE__ */
|
|
2
|
+
return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:S,markers:D,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=x.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:C,ariaLabel:M.scrub,valueText:e=>{const t=(e=>N.find(t=>t.ms===e)?.report)(e);return t?`${y(t)} · ${o(e,w)}`:o(e,w)}},ariaLabel:M.label(o(e,w),o(t,w))})})}function N({snapshot:n,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:N=e=>e.progress_number,resetLabel:S,variant:x="card",onPlayStart:C}){const{reports:D,markers:R,poNumber:P,startMs:O,endMs:q,totalLeadDays:A,scrubMs:T,setScrubMs:I,displayed:j,scrubbedAway:L,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:E,estCompletionMs:G}=n,z=function(e,t,r){const[n,a]=u(!1),o=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),o.current||(o.current=!0,t(e[0])),a(!0))},stop:()=>{o.current=!1,a(!1)}}}(D.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),I,C),H=c().production,J=d(),U=_??H.heading,Y=e=>o(e,J);if(0===D.length&&0===R.length)return null;const B=R.filter(e=>"shipment"===e.kind),K=R.filter(e=>"inspection"===e.kind),V=R.filter(e=>"invoice"===e.kind),X=(j?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),Z=j?v(j):0,Q=D.find(e=>e.id===F),W=Q?N(Q):E,ee=
|
|
3
|
+
/* @__PURE__ */h("button",{type:"button",onClick:z.toggle,"aria-pressed":z.playing,title:z.playing?H.pause:H.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[z.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
|
|
4
|
+
/* @__PURE__ */b("span",{children:z.playing?H.pause:H.play})]}),te=L&&(S??W)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{z.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:S??H.backTo(String(W))}):null,[re,ne]=p(H.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:j?/* @__PURE__ */h(y,{children:[e&&re,
|
|
5
|
+
/* @__PURE__ */b("b",{className:"font-medium",children:N(j)}),e&&ne,
|
|
6
|
+
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",Y(new Date(j.date).getTime())," · ",H.overall(Math.round(Z))," · ",H.inStock(X)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:H.noReport})});if("rail"===x){const e=null!=G&&G>=q&&q>O,t=e?{key:"__estimate__",label:H.estimatedCompletion,dateText:Y(G)}:null;/* @__PURE__ */
|
|
7
7
|
return h("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
|
|
8
|
-
/* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:D,markers:
|
|
8
|
+
/* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:D,markers:R,valueMs:T,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??H.start,end:M?.end??(e?H.estDone:void 0)},onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}}),
|
|
9
9
|
/* @__PURE__ */h("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[ee,te,ae(!1)]})]})}/* @__PURE__ */
|
|
10
|
-
return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:
|
|
10
|
+
return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:U,subject:P,meta:[`${Y(O)} → ${Y(q)}`,H.leadTime(A)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
|
|
11
11
|
/* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[D.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
12
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),
|
|
13
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),
|
|
14
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),
|
|
15
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),
|
|
12
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),H.report]}),B.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
13
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),H.shipment]}),K.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
14
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),H.inspection]}),V.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
15
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),H.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:D,markers:R,valueMs:T,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-VU6VPKM3.js";import{Select_default as l}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-VU6VPKM3.js";import{Select_default as l}from"./chunk-2PWZNFFP.js";import{FormField as a}from"./chunk-MVQBVPWP.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-MY755PTJ.js";import{Input_default as c}from"./chunk-GX2GSDJP.js";import{Button_default as d}from"./chunk-4IU5BSVE.js";import{useState as s}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=s(!0),[p,u]=s("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
|
|
3
3
|
/* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
|
|
4
4
|
/* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
|
|
5
5
|
/* @__PURE__ */t("form",{className:"space-y-5 lg:col-span-2",onSubmit:e=>e.preventDefault(),children:[
|
|
6
|
-
/* @__PURE__ */n(e,{header:"Contact",children:/* @__PURE__ */n("div",{className:"space-y-4",children:/* @__PURE__ */n(
|
|
6
|
+
/* @__PURE__ */n(e,{header:"Contact",children:/* @__PURE__ */n("div",{className:"space-y-4",children:/* @__PURE__ */n(a,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */n(c,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
|
|
7
7
|
/* @__PURE__ */n(e,{header:"Shipping address",children:/* @__PURE__ */t("div",{className:"space-y-4",children:[
|
|
8
8
|
/* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
9
|
-
/* @__PURE__ */n(
|
|
10
|
-
/* @__PURE__ */n(
|
|
11
|
-
/* @__PURE__ */n(
|
|
9
|
+
/* @__PURE__ */n(a,{label:"First name",required:!0,children:/* @__PURE__ */n(c,{placeholder:"Alice"})}),
|
|
10
|
+
/* @__PURE__ */n(a,{label:"Last name",required:!0,children:/* @__PURE__ */n(c,{placeholder:"Nguyen"})})]}),
|
|
11
|
+
/* @__PURE__ */n(a,{label:"Address",required:!0,children:/* @__PURE__ */n(c,{placeholder:"123 Market St"})}),
|
|
12
12
|
/* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[
|
|
13
|
-
/* @__PURE__ */n(
|
|
14
|
-
/* @__PURE__ */n(
|
|
15
|
-
/* @__PURE__ */n(
|
|
16
|
-
/* @__PURE__ */n(
|
|
13
|
+
/* @__PURE__ */n(a,{label:"City",children:/* @__PURE__ */n(c,{placeholder:"San Francisco"})}),
|
|
14
|
+
/* @__PURE__ */n(a,{label:"ZIP",children:/* @__PURE__ */n(c,{placeholder:"94103"})}),
|
|
15
|
+
/* @__PURE__ */n(a,{label:"Country",children:/* @__PURE__ */n(l,{value:p,onChange:u,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})})]}),
|
|
16
|
+
/* @__PURE__ */n(r,{checked:m,onChange:o,label:"Billing address same as shipping"})]})}),
|
|
17
17
|
/* @__PURE__ */n(e,{header:"Payment",children:/* @__PURE__ */t("div",{className:"space-y-4",children:[
|
|
18
|
-
/* @__PURE__ */n(
|
|
18
|
+
/* @__PURE__ */n(a,{label:"Card number",required:!0,children:/* @__PURE__ */n(c,{placeholder:"1234 5678 9012 3456"})}),
|
|
19
19
|
/* @__PURE__ */t("div",{className:"grid grid-cols-2 gap-4",children:[
|
|
20
|
-
/* @__PURE__ */n(
|
|
21
|
-
/* @__PURE__ */n(
|
|
20
|
+
/* @__PURE__ */n(a,{label:"Expiry",required:!0,children:/* @__PURE__ */n(c,{placeholder:"MM / YY"})}),
|
|
21
|
+
/* @__PURE__ */n(a,{label:"CVC",required:!0,children:/* @__PURE__ */n(c,{placeholder:"123"})})]})]})})]}),
|
|
22
22
|
/* @__PURE__ */t("div",{className:"space-y-4",children:[
|
|
23
23
|
/* @__PURE__ */t(e,{header:"Order summary",children:[
|
|
24
24
|
/* @__PURE__ */n("ul",{className:"space-y-2 text-sm",children:h.map(e=>/* @__PURE__ */t("li",{className:"flex items-center justify-between gap-2 text-gray-700",children:[
|
|
@@ -36,4 +36,4 @@ return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__P
|
|
|
36
36
|
/* @__PURE__ */n("span",{children:"Total"}),
|
|
37
37
|
/* @__PURE__ */t("span",{children:["$",g]})]})]}),
|
|
38
38
|
/* @__PURE__ */t(d,{block:!0,className:"mt-4",children:["Pay $",g]})]}),
|
|
39
|
-
/* @__PURE__ */n(
|
|
39
|
+
/* @__PURE__ */n(i,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}export{m as CheckoutTemplate};
|