efficient-shell 10.6.0 → 10.8.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 -1
- package/dist/{Browser-4ONXYI26.js → Browser-EMNG4HTB.js} +12 -12
- package/dist/Calculator-QZCD6MHP.js +29 -0
- package/dist/{CurrencyConverter-IQCGNNYA.js → CurrencyConverter-L4WCQBUO.js} +8 -8
- package/dist/{Documents-6H3UDVIU.js → Documents-DEBV3IGR.js} +1 -1
- package/dist/{Files-3OOVEIKW.js → Files-WMINXPW5.js} +88 -88
- package/dist/{Notepad-IPTDLXZZ.js → Notepad-KM6GRBUP.js} +9 -9
- package/dist/{PomodoroTimer-YF5AN5RX.js → PomodoroTimer-2Q5DXEYT.js} +6 -6
- package/dist/{Preview-D6MAGBWE.js → Preview-OWM7JE4U.js} +18 -18
- package/dist/Sidebar-XMDORF77.js +44 -0
- package/dist/{Spreadsheet-RXZR3OSI.js → Spreadsheet-I7LUDZTI.js} +13 -13
- package/dist/{Stock-XAZUTWT6.js → Stock-CN4KZVHA.js} +3 -3
- package/dist/{Weather-MLRF4QNB.js → Weather-N3AC6Q5Z.js} +15 -15
- package/dist/{WorldClock-IWRZVM4L.js → WorldClock-YTNLKOSF.js} +6 -6
- package/dist/ai/index.d.ts +4 -1
- package/dist/ai/index.js +41 -40
- 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/brand.css +1 -1
- package/dist/{chunk-37U326EL.js → chunk-235E63CP.js} +7 -7
- package/dist/{chunk-ULXCDM7Y.js → chunk-36R3R3IB.js} +4 -4
- package/dist/{chunk-OTGQYHVC.js → chunk-3BYLHJLC.js} +7 -7
- package/dist/{chunk-LHYVPDCP.js → chunk-3LPG6HMG.js} +1 -1
- package/dist/{chunk-A5BV6NFA.js → chunk-456CJCDK.js} +5 -5
- package/dist/{chunk-5S3YYN7M.js → chunk-47EYPWCB.js} +2 -2
- package/dist/{chunk-DDCMMOB4.js → chunk-4FX5FZ4Z.js} +1 -1
- package/dist/chunk-4GSSOUOI.js +29 -0
- package/dist/{chunk-RZGYD2PM.js → chunk-4X75SGTT.js} +46 -46
- package/dist/chunk-4YDCNWNU.js +3 -0
- package/dist/{chunk-ORIGX2H5.js → chunk-5NIA6CSZ.js} +4 -4
- package/dist/chunk-7QSDPSXP.js +1 -0
- package/dist/{chunk-6PFZK6ED.js → chunk-7SIH7VPC.js} +1 -1
- package/dist/{chunk-2K2W6VIR.js → chunk-7T4E6VMR.js} +1 -1
- package/dist/{chunk-YGSU5KCP.js → chunk-B4KKEVHL.js} +3 -3
- package/dist/{chunk-A224Q5ZC.js → chunk-BAPQOY7Q.js} +1 -1
- package/dist/{chunk-7X3XNVES.js → chunk-CNPEAHOY.js} +2 -2
- package/dist/{chunk-GNHLVGG5.js → chunk-CUO62I67.js} +3 -3
- package/dist/{chunk-QWWJUYZI.js → chunk-GBCH3UHD.js} +16 -16
- package/dist/{chunk-TVH7IZQ4.js → chunk-GKIU55T5.js} +2 -2
- package/dist/{chunk-ZZOBG6GP.js → chunk-I7EF6DW2.js} +13 -13
- package/dist/{chunk-IPFWXM2Y.js → chunk-ISJPW2FZ.js} +11 -11
- package/dist/{chunk-DLNIRZNR.js → chunk-JBOMPD3V.js} +1 -1
- package/dist/{chunk-UNOQ46YW.js → chunk-JDBMIY7R.js} +1 -1
- package/dist/{chunk-ZUS7FXKE.js → chunk-JGMQLQTE.js} +12 -12
- package/dist/chunk-KZMJE24J.js +5 -0
- package/dist/{chunk-XKDBYJHF.js → chunk-KZX25YEW.js} +1 -1
- package/dist/{chunk-QQPIQCT7.js → chunk-L3QNKCXH.js} +8 -8
- package/dist/{chunk-O45WQK57.js → chunk-M3OYHYIS.js} +1 -1
- package/dist/chunk-NOYVZPAU.js +4 -0
- package/dist/{chunk-G5NQOV7L.js → chunk-O6G72N3C.js} +4 -4
- package/dist/{chunk-EYZZW6SO.js → chunk-OYEAAX4A.js} +5 -5
- package/dist/chunk-P2HDCQBJ.js +1 -0
- package/dist/chunk-QZXN5IRK.js +3 -0
- package/dist/{chunk-JRZ7PPVJ.js → chunk-SKP66IK4.js} +4 -4
- package/dist/{chunk-SF654IHN.js → chunk-SW7ENSST.js} +12 -12
- package/dist/{chunk-3CPB3WP2.js → chunk-T2ULJNQP.js} +35 -35
- package/dist/{chunk-W6SC3ZNO.js → chunk-TEIJOFHO.js} +2 -2
- package/dist/chunk-UVA3BITM.js +2 -0
- package/dist/chunk-UWK5Q3R4.js +19 -0
- package/dist/{chunk-IOIDZC2M.js → chunk-V4W5BG4A.js} +1 -1
- package/dist/{chunk-PXDDCD5X.js → chunk-VZ4PBHFN.js} +1 -1
- package/dist/{chunk-YCOYCPAH.js → chunk-ZQKZCQJA.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/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DisplayChips.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/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/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +40 -2
- package/dist/index.js +126 -126
- package/dist/map/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/AppUpdateBanner.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/GlobalSearch.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/MilestoneTimeline.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.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-T35PX2QS.js +0 -29
- package/dist/Sidebar-QCUDD4OU.js +0 -44
- package/dist/chunk-7Z4PTLDL.js +0 -4
- package/dist/chunk-AM2F5ZXH.js +0 -2
- package/dist/chunk-GTNJAKFO.js +0 -29
- package/dist/chunk-LNWQBSYD.js +0 -5
- package/dist/chunk-N4DI5F74.js +0 -19
- package/dist/chunk-PKXQDCNR.js +0 -1
- package/dist/chunk-QEKOEIOQ.js +0 -3
- package/dist/chunk-WTTSB4SV.js +0 -3
- package/dist/chunk-YJFB6CCJ.js +0 -1
- /package/dist/{chunk-OW7MLJ3Y.js → chunk-S2P74CBN.js} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}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?
|
|
1
|
+
import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-T2ULJNQP.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-KKSVRIMP.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-4PAWQEXM.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 x=t.map(e=>a(e.date)).filter(e=>null!=e),P=l(Date.now,null)??Math.max(0,...x,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),S=x.length?Math.min(...x):P,D=x.length?Math.max(...x):P,C=a(r??null)??S,R=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),T=(()=>{const e=[R,D,q,C+i];return O||e.push(P),Math.max(...e)})(),A=Math.max(1,Math.round((T-C)/i)),I=a(p??null)??D??C,L=Math.min(Math.max(y??I,C),T),j=t.find(e=>{const t=a(e.date);return null!=t&&t<=L})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>L){$=t[e];break}}const F=(()=>{if(j||!$||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(C).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),E=j??F,K=j?a(j.date):F?C:null,z=$?a($.date):null,J=!!(E&&$&&null!=K&&null!=z&&L>K&&L<z);let Q,X;if(J&&null!=K&&null!=z){const e=(L-K)/Math.max(z-K,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,Q={id:`interp-${L}`,progress_number:_.estimated,date:new Date(L).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},X=E}else if(Q=E??t[t.length-1]??null,Q){const e=t.findIndex(e=>e.id===Q.id);X=e>=0&&e<t.length-1?t[e+1]:null}else X=null;const B={};for(const e of X?.items??[])B[e.part_number]=e;const G=!(!d||Q?.id===d),H=d?Math.min(a(p??null)??T,T):T,U=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:C,endMs:T,totalLeadDays:A,scrubMs:L,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:G,beforeAnchor:E,nextAfter:$,displayed:Q,prevReport:X,prevByPN:B,isInterpolated:J,playing:v,startPlay:()=>{if(v)return void N();if(H<=C)return void f(H);M(!0),f(C);let e=performance.now(),t=C;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=H)return f(H),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:U,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),x=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})),P=new Map(N.map(({report:e,ms:t})=>[e.id,t])),S=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:x,markers:D,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=P.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:S,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:x,variant:P="card",onPlayStart:S}){const{reports:D,markers:C,poNumber:R,startMs:O,endMs:q,totalLeadDays:T,scrubMs:A,setScrubMs:I,displayed:L,scrubbedAway:j,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:E,estCompletionMs:K}=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,S),J=c().production,Q=d(),X=_??J.heading,B=e=>o(e,Q);if(0===D.length&&0===C.length)return null;const G=C.filter(e=>"shipment"===e.kind),H=C.filter(e=>"inspection"===e.kind),U=C.filter(e=>"invoice"===e.kind),V=(L?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),W=L?v(L):0,Y=D.find(e=>e.id===F),Z=Y?N(Y):E,ee=
|
|
3
|
+
/* @__PURE__ */h("button",{type:"button",onClick:z.toggle,"aria-pressed":z.playing,title:z.playing?J.pause:J.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?J.pause:J.play})]}),te=j&&(x??Z)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{z.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:x??J.backTo(String(Z))}):null,[re,ne]=p(J.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:L?/* @__PURE__ */h(y,{children:[e&&re,
|
|
5
5
|
/* @__PURE__ */b("b",{className:"font-medium",children:N(L)}),e&&ne,
|
|
6
|
-
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",
|
|
6
|
+
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",B(new Date(L.date).getTime())," · ",J.overall(Math.round(W))," · ",J.inStock(V)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:J.noReport})});if("rail"===P){const e=null!=K&&K>=q&&q>O,t=e?{key:"__estimate__",label:J.estimatedCompletion,dateText:B(K)}: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:
|
|
8
|
+
/* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:D,markers:C,valueMs:A,activeId:L?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??J.start,end:M?.end??(e?J.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:X,subject:R,meta:[`${
|
|
11
|
-
/* @__PURE__ */h("div",{className:"rosh-tl-legend",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"})}),
|
|
10
|
+
return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:X,subject:R,meta:[`${B(O)} → ${B(q)}`,J.leadTime(T)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
|
|
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"}),J.report]}),G.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"})}),J.shipment]}),H.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"})}),J.inspection]}),U.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"})}),J.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:D,markers:C,valueMs:A,activeId:L?.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};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as i,OverlayLayerProvider as t}from"./chunk-3DVNXNTF.js";import{useDiscardGuard as l}from"./chunk-S2P74CBN.js";import{dialogA11y as a}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as o}from"./chunk-7QSDPSXP.js";import{useFocusTrap as n,useScrollLock as s}from"./chunk-CDAJKLGL.js";import{Icon as d}from"./chunk-KKSVRIMP.js";import{Z_LAYERS as c}from"./chunk-62LW225J.js";import{useHydrated as m}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as p}from"./chunk-4PAWQEXM.js";import{useRef as f,useId as h,useState as x,useEffect as v}from"react";import{createPortal as b}from"react-dom";import{jsxs as y,Fragment as g,jsx as k}from"react/jsx-runtime";var N={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl"};function j({open:j,onClose:w,title:C,description:W,role:D="dialog",children:P,footer:L,blocking:S=!1,size:T="md",aside:V=!1,dirty:A=!1,initialFocus:I,"aria-label":J,"aria-labelledby":K,"aria-describedby":Q,className:U=""}){const X=f(null),$=h(),z=h(),B=!S,F=h(),G=p().dialog,M=e(m()),[E,H]=x(null),R=l({open:j,dirty:A,onClose:w,title:C,layer:E}),Y=f(null),Z=r(j&&null!==M,Y),q=i(Z,X);if(o(j),n(X,j&&null!==M,I),s(j),v(()=>{if(j)return u(()=>(S||R(),!0),()=>X.current)},[j,S,R]),!j||!M)return null;/* @__PURE__ */
|
|
2
|
+
return y(g,{children:[/* @__PURE__ */k("span",{ref:Y,hidden:!0,"data-popup-anchor":""}),b(
|
|
3
|
+
/* @__PURE__ */k(t,{value:E,children:/* @__PURE__ */y("div",{ref:H,className:"fixed inset-0"+(V?" pointer-events-none opacity-0":""),style:{zIndex:c.overlay},role:"presentation","data-overlay-layer":"","data-aside":V?"":void 0,children:[
|
|
4
|
+
/* @__PURE__ */k("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
|
|
5
|
+
/* @__PURE__ */k("div",{className:Z?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:S?void 0:e=>{e.target===e.currentTarget&&R()},children:/* @__PURE__ */y("div",{ref:X,"data-popup-panel":"",style:Z?{left:q?.left??0,top:q?.top??0,visibility:q?void 0:"hidden"}:void 0,...a({role:D,modal:!0,titleId:C?F:void 0,labelledBy:K,label:J}),"aria-describedby":Q??(W?z:P?$:void 0),className:`${Z?"absolute max-h-[calc(100%-2rem)] w-[calc(100%-2rem)]":"relative max-h-full w-full"} ${N[T]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${U}`.trim(),children:[C&&/* @__PURE__ */k("h2",{id:F,className:(B?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:C}),W&&/* @__PURE__ */k("p",{id:z,className:((C?"mt-1":B?"pr-8":"")+" text-sm text-gray-500").trim(),children:W}),P&&/* @__PURE__ */k("div",{id:$,className:"mt-2 text-sm text-gray-600",children:P}),L&&/* @__PURE__ */k("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:L}),B&&/* @__PURE__ */k("button",{type:"button",onClick:R,"aria-label":G.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */k(d,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]})}),M)]})}export{j as Dialog};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-TOVKWNI2.js";import{Radio_default as a}from"./chunk-NI5FXWK5.js";import{Select_default as l}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-TOVKWNI2.js";import{Radio_default as a}from"./chunk-NI5FXWK5.js";import{Select_default as l}from"./chunk-UWK5Q3R4.js";import{FormField as r}from"./chunk-6KBDNYRW.js";import{Checkbox_default as n}from"./chunk-CGZBDI6C.js";import{Textarea_default as i}from"./chunk-PB7G6CJ7.js";import{Input_default as c}from"./chunk-MAMWQCJ6.js";import{Button_default as o}from"./chunk-I4VIEGCX.js";import{useState as t}from"react";import{jsx as m,jsxs as d}from"react/jsx-runtime";function s(){const[s,h]=t("pro"),[u,p]=t(!0),[f,g]=t("us");/* @__PURE__ */
|
|
2
2
|
return m("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */d("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
|
|
3
3
|
/* @__PURE__ */d("div",{children:[
|
|
4
4
|
/* @__PURE__ */m("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-67JCJ2MG.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-
|
|
1
|
+
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-67JCJ2MG.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-7QSDPSXP.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-CDAJKLGL.js";import{Button_default as c}from"./chunk-I4VIEGCX.js";import{buttonClasses as s}from"./chunk-UQYNPYF4.js";import{Icon as m}from"./chunk-KKSVRIMP.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{useHydrated as d}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as h}from"./chunk-4PAWQEXM.js";import{useRef as p,useState as x,useCallback as b,useEffect as k}from"react";import{createPortal as g}from"react-dom";import{jsx as v,jsxs as w,Fragment as N}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function j(e){return e.kind?e.kind:r(e.url)?"video":y.test(e.url)?"file":"image"}var C="flex items-center justify-center rounded-full bg-black/60 text-on-accent hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",I=e=>e.stopPropagation();function A({images:r,startIndex:y=0,onClose:A,onIndexChange:J,onOpenFile:L}){const P=h().lightbox,U=d(),$=p(null),z=p(null),[D,G]=x(y),M=r.length,W=U&&M>0,E=b(e=>{if(M<2)return;const t=((D+e)%M+M)%M;G(t),J?.(t)},[D,M,J]);if(a(W),l($,W,z),i(W),k(()=>{if(W)return f(()=>(A(),!0),()=>$.current)},[W,A]),k(()=>{if(!W)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),E("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[W,E]),!W)return null;const F=r[Math.min(D,M-1)],Q=j(F),V=F.caption||n(F.url);let K;return K="video"===Q?/* @__PURE__ */v("video",{src:F.url,controls:!0,playsInline:!0,"aria-label":V,onClick:I,className:`${e} rounded-lg bg-black`}):"file"===Q?/* @__PURE__ */w("div",{onClick:I,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-surface px-10 py-8 text-center text-ink-faint",children:[
|
|
2
2
|
/* @__PURE__ */v(m,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
|
|
3
|
-
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:
|
|
4
|
-
/* @__PURE__ */w("div",{ref
|
|
3
|
+
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:V}),L?/* @__PURE__ */v(c,{size:"sm",onClick:()=>L(F),children:P.openFile}):/* @__PURE__ */v("a",{href:F.url,target:"_blank",rel:"noopener noreferrer",className:s({size:"sm"}),children:P.openFile})]}):/* @__PURE__ */v(t,{src:F.url,alt:V,className:`${e} object-contain`,frameClassName:"rounded-lg"}),g(
|
|
4
|
+
/* @__PURE__ */w("div",{ref:$,...o({role:"dialog",modal:!0,label:P.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:u.overlay},onClick:A,children:[K,
|
|
5
5
|
/* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:I,children:[
|
|
6
|
-
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:
|
|
7
|
-
/* @__PURE__ */v("button",{ref:
|
|
8
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{I(e),E(-1)},"aria-label":
|
|
9
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{I(e),E(1)},"aria-label":
|
|
6
|
+
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:P.counter(D+1,M)}),
|
|
7
|
+
/* @__PURE__ */v("button",{ref:z,type:"button",onClick:A,"aria-label":P.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(m,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),M>1&&/* @__PURE__ */w(N,{children:[
|
|
8
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{I(e),E(-1)},"aria-label":P.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(m,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
|
|
9
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{I(e),E(1)},"aria-label":P.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(m,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
|
|
10
10
|
/* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:I,children:[
|
|
11
|
-
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:
|
|
11
|
+
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:V}),"file"!==Q&&/* @__PURE__ */v("a",{href:F.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-on-accent/70 underline decoration-on-accent/30 underline-offset-2 hover:text-on-accent",children:P.openOriginal})]})]}),document.body)}export{A as ImageLightbox,j as lightboxKind};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-TOVKWNI2.js";import{Select_default as l}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-TOVKWNI2.js";import{Select_default as l}from"./chunk-UWK5Q3R4.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-GSKLHUQ6.js";import{Input_default as c}from"./chunk-MAMWQCJ6.js";import{Button_default as s}from"./chunk-I4VIEGCX.js";import{useState as d}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]=d(!0),[p,u]=d("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:[
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-4YDCNWNU.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{useShellStrings as n}from"./chunk-4PAWQEXM.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as u,useEffect as s}from"react";import{jsx as c,jsxs as m}from"react/jsx-runtime";var f=(e,t,i)=>Math.min(i,Math.max(t,e));function p(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var h=8,v=40;function x(e){return Math.max(1,...e.map(e=>(e??"").length))}function b(e,t,i,n){return Number(f(e,t,i).toFixed(n))}var y=r(null);function w({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
|
|
2
|
+
return c(y.Provider,{value:r,children:e})}function g({value:r,onChange:a,min:w,max:g,step:S=1,shiftStep:z,precision:F,inputMin:N,inputMax:k,suffix:j,showInput:M=!0,emptyLabel:$,placeholderValue:L,stepFrom:A,label:C,"aria-labelledby":D,valueText:K,id:W,disabled:E,size:P="md",boxSize:R="sm",className:T="",auto:U}){const V=n(),q=o(),B=t(),H=U??B,I=o(),J=W??q,O=F??p(S),Q=N??w,X=k??g,Y=void 0!==$||void 0!==L,G=A??L,Z=f(r??L??w,w,g),_=d(null),[ee,te]=l(null),ie=Boolean(j);i(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,M]);const ne=e=>K?K(e):"string"==typeof j?`${e.toFixed(O)} ${j}`:void 0,re=null==r?$??(null!=L?ne(L)??String(L):void 0):ne(r),le=`calc(${x([w.toFixed(O),g.toFixed(O),r?.toFixed(O),$,L?.toFixed(O)])}ch + ${(ee?.frame??10+(ie?v:h))+2}px)`,ae=u(y),oe=o(),de=ae?.set;return i(()=>{de&&de(oe,M?le:null)},[de,oe,le,M]),s(()=>()=>de?.(oe,null),[de,oe]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-3 ${T}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */c("input",{id:J,type:"range",min:w,max:g,step:S,value:Z,disabled:E,"aria-label":D?void 0:C,"aria-labelledby":D,"aria-valuetext":re,"aria-describedby":H?I:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=z;if(!i&&!(null==r&&null!=G))return;e.preventDefault();a(b((r??G??Z)+t*(i?z??S:S),w,g,O))},onChange:e=>a(b(Number(e.target.value),w,g,O)),className:"min-w-24 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===P?"h-1":"h-1.5")}),M&&
|
|
4
|
+
/* @__PURE__ */c("div",{ref:_,"data-slider-box":"",className:"shrink-0 text-xs",style:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */c(e,{value:r,onChange:e=>{null!=e?e<Q||e>X||a(e):Y&&a(null)},min:Q,max:X,step:S,shiftStep:z,stepFrom:G,precision:O,snap:!0,allowEmpty:Y,suffix:j,disabled:E,placeholder:$??(null!=L?L.toFixed(O):void 0),size:R,auto:H,"aria-label":C?V.slider.value(C):void 0,"aria-labelledby":C?void 0:D})}),H&&/* @__PURE__ */c("span",{id:I,hidden:!0,children:V.settingView.auto})]})}export{g as Slider,w as SliderGroup,b as settleSliderValue,x as sliderBoxChars,p as stepDecimals};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-
|
|
1
|
+
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-4YDCNWNU.js";import{Tooltip as i}from"./chunk-6XBWM453.js";import{useShellStrings as l}from"./chunk-4PAWQEXM.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:j=""}){const R=l().widths,z=a(),A=m(Math.round(x)||1,1,n),B=e($,A),D=B??[...t[A]??[]],S=[...D,100-p(D)],E=P||M,K=s(null),O=s({onChange:k,shown:D,locked:E,n:A,stored:B});O.current={onChange:k,shown:D,locked:E,n:A,stored:B};const T=t=>{const{onChange:r,shown:n,locked:o,n:i}=O.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},W=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],T(i.slice(0,-1))&&(ne.current=null)},X=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=S[e]+S[e+1],i="ArrowRight"===t.key?S[e]+n:"ArrowLeft"===t.key?S[e]-n:"PageUp"===t.key?S[e]+10:"PageDown"===t.key?S[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),W(S,e,i))},H=s(null),[I,L]=c(null),U=()=>{H.current=null,L(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>U,[]);const F=e=>t=>{if(0!==t.button||E)return;t.preventDefault();const r=K.current?.getBoundingClientRect().width??0;r<=0||(H.current={i:e,x:t.clientX,width:r,from:S,moved:!1,pointer:t.pointerId},L(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},G=e=>{const t=H.current;if(!t)return;if(0===e.buttons)return void U();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}W(t.from,t.i,t.from[t.i]+r/t.width*100)},q=e=>{const t=H.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),U())},J=(e,t)=>{const{shown:n}=O.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return T(o.slice(0,-1))?o:null},[Q,V]=c(0);u(()=>{const e=K.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>V(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const Y=s(null),[Z,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=O.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=S.join(",");u(()=>{const e=null===Z?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(Y.current,Z);te(t=>v(t,e)?t:e)},[Z,ie,Q]);const le=R.hint(A,r),ae=S.slice(0,-1).map((e,t)=>p(S.slice(0,t+1)));/* @__PURE__ */
|
|
2
2
|
return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":A>1?z:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${j}`.trim(),children:[
|
|
3
3
|
/* @__PURE__ */h("div",{ref:Y,"data-widths-bar":"",className:"relative h-8",children:[
|
|
4
|
-
/* @__PURE__ */f("div",{ref:
|
|
5
|
-
/* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),A>1&&
|
|
6
|
-
return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>
|
|
4
|
+
/* @__PURE__ */f("div",{ref:K,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:S.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===A&&/* @__PURE__ */f("span",{"data-widths-label":"",children:`${e}%`})},t))}),
|
|
5
|
+
/* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),A>1&&S.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=Z===t,l=p(S.slice(0,t)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
6
|
+
return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>Q>0&&Q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(A-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":R.column(t+1),"aria-describedby":z,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||J(t,e)},onRevert:e=>((e,t)=>{O.current.locked||null===t||oe(e,t)||J(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:O.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<A-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:R.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":R.divider(t+1,t+2),"aria-valuenow":S[t],"aria-valuemin":r,"aria-valuemax":S[t]+S[t+1]-r,"aria-valuetext":R.dividerValue(t+1,S[t],t+2,S[t+1]),"aria-disabled":E||void 0,onKeyDown:E?void 0:X(t),onPointerDown:F(t),onPointerMove:G,onPointerUp:q,onPointerCancel:q,onLostPointerCapture:()=>{H.current&&U()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(E?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(E?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${I===t?"w-1":y}`)})})})})]},t))]}),A>1&&/* @__PURE__ */f("span",{id:z,className:"sr-only",children:le})]})}export{x as WidthsBar};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{CloseGlyph as e}from"./chunk-67JCJ2MG.js";import{IconButton_default as t}from"./chunk-PUF75SMJ.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-6RX4PVBU.js";import{Button_default as s}from"./chunk-I4VIEGCX.js";import{Icon as i}from"./chunk-KKSVRIMP.js";import{useShellStrings as c}from"./chunk-4PAWQEXM.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
2
2
|
return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
3
3
|
return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
|
|
4
4
|
return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
|
|
5
|
-
/* @__PURE__ */d("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */d("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function f({files:
|
|
5
|
+
/* @__PURE__ */d("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */d("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function f({files:t,onRemove:r,disabled:a=!1,className:s=""}){const i=c().files,m=l(/* @__PURE__ */new Map);o(()=>{const e=new Set(t);for(const[t,n]of m.current)e.has(t)||(URL.revokeObjectURL(n),m.current.delete(t))},[t]),o(()=>()=>{for(const e of m.current.values())URL.revokeObjectURL(e);m.current.clear()},[]);const h=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=m.current.get(e);return t||(t=URL.createObjectURL(e),m.current.set(e,t)),t};return 0===t.length?null:/* @__PURE__ */d("ul",{className:`flex flex-wrap gap-2 ${s}`,children:t.map((t,s)=>{const c=h(t);/* @__PURE__ */
|
|
6
6
|
return u("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-line bg-surface-sunken py-1 pl-2 pr-1 text-xs text-ink",children:[c?/* @__PURE__ */d("img",{src:c,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */d("span",{className:"text-gray-400",children:/* @__PURE__ */d(p,{})}),
|
|
7
|
-
/* @__PURE__ */d("span",{className:"min-w-0 truncate",title:
|
|
8
|
-
/* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:n(
|
|
9
|
-
/* @__PURE__ */d(
|
|
7
|
+
/* @__PURE__ */d("span",{className:"min-w-0 truncate",title:t.name,children:t.name}),
|
|
8
|
+
/* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:n(t.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(t.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */d(e,{className:"h-3.5 w-3.5"})})]},`${t.name}-${t.size}-${s}`)})})}function b({onClick:e,count:n=0,variant:r="button",label:a,disabled:i=!1}){const l=c().files,o=a??l.attach,p=n>0?`${o} (${n})`:o;return"icon"===r?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
|
|
9
|
+
/* @__PURE__ */d(t,{"aria-label":p,onClick:e,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:v}){const L=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),y=l([]);return o(()=>{j&&L.rejections.length>0&&L.rejections!==y.current&&(y.current=L.rejections,j(L.rejections))},[L.rejections,j]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:N,children:[v,
|
|
10
10
|
/* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{L.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
|
|
11
11
|
/* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
|
|
12
12
|
/* @__PURE__ */d(b,{onClick:L.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="10.8.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-456CJCDK.js";import{Button_default as i}from"./chunk-I4VIEGCX.js";import{iconButtonClasses as n}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-KKSVRIMP.js";import{Tooltip as a}from"./chunk-6XBWM453.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:g=!1,disabledReason:N,tooltip:w,menuDisabled:x=!1,menuDisabledReason:C,onMenuOpenChange:j,menuFooter:y,menuFooterLabel:I,align:W="end",side:z="bottom",menuMinWidth:M,linkAs:R,block:D=!1,className:F=""},K){const L=g&&(null!=N&&""!==N&&!1!==N)&&!v,$=x&&null!=C&&""!==C&&!1!==C,A=o(),B=/* @__PURE__ */t(i,{ref:K,type:b,variant:f,size:p,loading:v,leftIcon:k,block:D,disabled:g&&!L,"aria-disabled":!!L||void 0,disabledReason:L?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),O=D?"relative flex min-w-0 flex-1":"relative inline-flex",P=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
2
|
+
return s("div",{className:[D?"flex w-full":"inline-flex","items-stretch",F].filter(Boolean).join(" "),children:[null==w||""===w||L?B:/* @__PURE__ */t(a,{content:w,className:O,children:B}),
|
|
3
|
+
/* @__PURE__ */t(a,{content:$?C:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":$?A:void 0,items:h,align:W,side:z,minWidth:M,linkAs:R,disabled:x&&!$,"aria-disabled":$,onOpenChange:j,footer:y,footerLabel:I,triggerClassName:n({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(r,{name:"chevron-down",className:P,strokeWidth:2,"aria-hidden":"true"})})}),$&&/* @__PURE__ */t("span",{id:A,className:"sr-only",children:C})]})});export{c as SplitButton_default};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{MediaUploadField as e}from"./chunk-
|
|
1
|
+
import{MediaUploadField as e}from"./chunk-B4KKEVHL.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-I4VIEGCX.js";import{useShellStrings as t}from"./chunk-4PAWQEXM.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[L,R]=l(null),[U,I]=l(""),[C,E]=l(""),[H,A]=l(!1),[B,F]=l(!1),G=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),O=t().brandAsset,P=U||d||g||"",S=L?null:d?o:h,V=L?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const $=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
|
|
2
2
|
return n("section",{"aria-label":O.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
3
3
|
/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
4
|
-
/* @__PURE__ */c(e,{value:
|
|
4
|
+
/* @__PURE__ */c(e,{value:P,onChange:()=>{},onFile:e=>{if(k)return;$();const r=URL.createObjectURL(e);j.current=r,R(e),I(r),E("")},label:p,hint:C||O.usedFor(b),error:C||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:H||B,disabled:k}),
|
|
5
5
|
/* @__PURE__ */n("div",{className:"mt-3 flex flex-wrap gap-2",children:[
|
|
6
|
-
/* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!
|
|
6
|
+
/* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!H){A(!0),E("");try{await x(L),$(),R(null),I("")}catch(e){E(e instanceof Error?e.message:O.saveFailed(G,p))}finally{A(!1)}}},disabled:!L||k,loading:H,children:O.save(G,p)}),(L||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!B){if(L)return $(),R(null),I(""),void E("");if(d){F(!0),E("");try{await f()}catch(e){E(e instanceof Error?e.message:O.removeFailed(G,p))}finally{F(!1)}}}},disabled:k,loading:B,children:L?O.discard:O.remove(G,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":O.previews(p),children:[
|
|
7
7
|
/* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:O.preview}),
|
|
8
|
-
/* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:
|
|
8
|
+
/* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:P,alt:O.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:S,isLight:V,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
|
|
9
9
|
return n("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
|
|
10
10
|
/* @__PURE__ */c("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */n("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
|
|
11
11
|
/* @__PURE__ */n("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[a,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-
|
|
2
|
-
return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function A(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function
|
|
3
|
-
return w("div",{id:
|
|
4
|
-
return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:N,onClick:()=>
|
|
5
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":
|
|
6
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":
|
|
1
|
+
import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-4YDCNWNU.js";import{parseHexColor as a,hexToHsv as n,hsvToHex as o,hexReadout as t,HUE_GRADIENT as l,HEX_MAX_LENGTH as i,svFromPoint as s,hueFromPoint as c}from"./chunk-S6OB6HJB.js";import{inputClasses as u}from"./chunk-AYZY3YNC.js";import{Tooltip as d}from"./chunk-6XBWM453.js";import{useShellStrings as h}from"./chunk-4PAWQEXM.js";import{forwardRef as g,useState as p,useRef as b,useEffect as m,useId as f}from"react";import{jsx as v,jsxs as w}from"react/jsx-runtime";var x={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function k(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function C(e,r){if(!e)return y;const a=k(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function N({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",x[e],a].filter(Boolean).join(" ")}var $=g(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
|
|
2
|
+
return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function A(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function M(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,359);case"ArrowRight":case"ArrowUp":return z(e+n,0,359);case"PageDown":return z(e-10,0,359);case"PageUp":return z(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var P={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function I(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,100);case"ArrowRight":case"ArrowUp":return z(e+n,0,100);case"PageDown":return z(e-10,0,100);case"PageUp":return z(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function j({value:e,onChange:r,label:i,presets:u,clearable:g=!1,fallback:f,dragWrites:x="live",disabled:N=!1,opacity:z,onOpacityChange:j,onClose:S,id:B,className:K=""}){const U=h().color,W=k(z),O=e=>{const r=k(e);N||r===W||j?.(r)},E=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:W},L=a(f??""),[X,Y]=p(()=>n(e||L||"")),H=b(e);m(()=>{e!==H.current&&(H.current=e,e?Y(n(e)):L&&Y(n(L)))},[e]);const q=a=>{N||a===e||(H.current=a,r(a))},J=e=>{const r=a(e);r&&(Y(n(r)),q(r))},F=e=>{Y(e),q(o(e))},[G,Q]=p(!1),V=b(X);V.current=X;const Z=e=>({onPointerDown:r=>{if(N||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,V.current);"end"===x?(Q(!0),Y(a)):F(a)},onPointerMove:r=>{if(N||!(1&r.buttons))return;const a=e(r,V.current);"end"===x?Y(a):F(a)},onPointerUp:r=>{"end"===x&&G&&(Q(!1),F(e(r,V.current)))}}),_=Z((e,r)=>({...r,...s(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),ee=Z((e,r)=>({...r,h:c(e.clientX,e.currentTarget.getBoundingClientRect())})),re=G?o(X):e,ae=e=>`${Math.round(100*e)}%`,ne=(u??[]).map(D),oe=a(e),te=re||L||"";/* @__PURE__ */
|
|
3
|
+
return w("div",{id:B,className:`flex w-56 flex-col gap-3 ${N?"opacity-60":""} ${K}`.trim(),onKeyDown:e=>{"Escape"===e.key&&S&&(e.preventDefault(),e.stopPropagation(),S())},children:[(ne.length>0||g)&&/* @__PURE__ */w("div",{role:"group","aria-label":U.presets,className:"flex flex-wrap gap-2",children:[g&&/* @__PURE__ */v(d,{content:U.clear,children:/* @__PURE__ */v($,{color:"",size:"sm","aria-label":U.clear,selected:""===e,disabled:N,onClick:()=>{N||""===e||(H.current="",r(""))}})}),ne.map(e=>{const r=a(e.value),n=e.label?`${e.label} · ${t(r??e.value)}`:t(r??e.value);/* @__PURE__ */
|
|
4
|
+
return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:N,onClick:()=>J(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
5
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":U.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*X.v),"aria-valuetext":U.squareValue(Math.round(100*X.s),Math.round(100*X.v)),"aria-disabled":N||void 0,"data-color-square":"",onKeyDown:e=>{if(N)return;const r=A(X,e.key,e.shiftKey);r&&(e.preventDefault(),F(r))},..._,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:o({h:X.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ae(X.s),top:ae(1-X.v),...P}})}),
|
|
6
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":U.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(X.h),"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-hue":"",onKeyDown:e=>{if(N)return;const r=M(X.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),F({...X,h:r}))},...ee,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:l},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:X.h/360*100+"%",background:o({h:X.h,s:1,v:1}),...P}})}),j&&/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":U.opacity(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":W,"aria-valuetext":`${W}%`,"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-opacity":"",onKeyDown:e=>{if(N)return;const r=I(W,e.key,e.shiftKey);null!==r&&(e.preventDefault(),O(r))},onPointerDown:e=>{N||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),O(E(e)))},onPointerMove:e=>{!N&&1&e.buttons&&O(E(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${te||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${W}%`,...C(te||"black",W),...P}})}),
|
|
7
7
|
/* @__PURE__ */w("div",{className:"flex items-center gap-2",children:[
|
|
8
|
-
/* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,j?
|
|
9
|
-
/* @__PURE__ */v(
|
|
10
|
-
return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function
|
|
11
|
-
return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function
|
|
8
|
+
/* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,j?W:null)}),
|
|
9
|
+
/* @__PURE__ */v(T,{value:re,placeholder:!e&&L?t(L):void 0,onChange:J,label:U.hex(i),disabled:N}),j&&/* @__PURE__ */v(R,{value:W,onChange:O,label:U.opacity(i),disabled:N})]})]})}var S={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},B={sm:"h-6",md:"h-8",lg:"h-10"},K=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function T({value:e,onChange:r,label:n,placeholder:o,disabled:l,id:s,size:c="md",look:d="box",className:h=""}){const[g,b]=p(null),m="text"===d?`${K} ${B[c]} ${h}`.trim():u({size:c,className:`${S[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
|
|
10
|
+
return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function R({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
|
|
11
|
+
return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function U({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:z=""}){const D=h().color,A=k(p),M=f(),P=a(s??""),I=r||P||"",S=r?t(r):P?t(P):D.none;
|
|
12
12
|
/* @__PURE__ */
|
|
13
13
|
return w("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":g?"gap-1":"gap-2"} ${z}`.trim(),children:[
|
|
14
|
-
/* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(
|
|
15
|
-
/* @__PURE__ */v(
|
|
14
|
+
/* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(I,b?A:null)}),triggerLabel:D.swatch(o,S),triggerClassName:N({size:m}),"aria-label":D.panel(o),align:x,open:y,onOpenChange:$,disabled:u,children:/* @__PURE__ */v(j,{id:M,value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),g&&
|
|
15
|
+
/* @__PURE__ */v(T,{value:r,placeholder:!r&&P?t(P):void 0,onChange:e=>{u||e===r||n(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */v(R,{value:A,onChange:e=>{u||e===A||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{U as ColorPicker,j as ColorPickerPanel,$ as ColorSwatch,T as HexInput,y as NO_COLOR_FILL,k as clampOpacity,C as colorFill,N as colorSwatchClasses,M as stepHue,I as stepOpacity,A as stepSquare};
|