efficient-shell 13.4.0 → 13.6.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.
Files changed (108) hide show
  1. package/README.md +5 -1
  2. package/dist/{Browser-AT2XPDDM.js → Browser-C35LEPPI.js} +14 -14
  3. package/dist/{Calculator-XTG7MO36.js → Calculator-TJ4XFVNQ.js} +22 -22
  4. package/dist/{CurrencyConverter-ZYT5HN7A.js → CurrencyConverter-6H3QM3TU.js} +6 -6
  5. package/dist/Files-LBIF3W3O.js +141 -0
  6. package/dist/Notepad-XLG7G5IZ.js +24 -0
  7. package/dist/{PomodoroTimer-BX2GDNXQ.js → PomodoroTimer-57XARJRF.js} +65 -65
  8. package/dist/{Preview-ZCYEZKBQ.js → Preview-IYNPMZCR.js} +8 -8
  9. package/dist/{Stock-HMIUZHYW.js → Stock-OYUZ4D3M.js} +1 -1
  10. package/dist/{Weather-3Q5GAAGM.js → Weather-Y4TMYOQB.js} +15 -15
  11. package/dist/{WorldClock-LS3LEEI4.js → WorldClock-FY3UCIAW.js} +2 -2
  12. package/dist/ai/index.js +41 -41
  13. package/dist/apps/index.js +1 -1
  14. package/dist/bin/browser-check.js +1 -1
  15. package/dist/bin/media-host-check.js +1 -1
  16. package/dist/bin/ui-check.js +1 -1
  17. package/dist/charts/PieChart.js +1 -1
  18. package/dist/charts/RadarChart.js +1 -1
  19. package/dist/charts/RadialBarChart.js +1 -1
  20. package/dist/charts/SpecChart.js +1 -1
  21. package/dist/charts/TimeSeriesChart.js +1 -1
  22. package/dist/chunk-3MIIXPV6.js +9 -0
  23. package/dist/{chunk-APGIPXR7.js → chunk-4OKZXAQN.js} +2 -2
  24. package/dist/{chunk-EOY6U6UI.js → chunk-5RTQLC2I.js} +1 -1
  25. package/dist/chunk-7K73G35Z.js +2 -0
  26. package/dist/{chunk-6GDVURG7.js → chunk-AI4A7GYI.js} +1 -1
  27. package/dist/chunk-BBXYBERF.js +1 -0
  28. package/dist/{chunk-S26FG4RF.js → chunk-BRZ55H2G.js} +34 -34
  29. package/dist/{chunk-DYOFTZOC.js → chunk-CUJA3HBZ.js} +2 -2
  30. package/dist/chunk-ENCZRE3H.js +29 -0
  31. package/dist/chunk-GXVWI3U5.js +1 -0
  32. package/dist/chunk-H22D2PYM.js +14 -0
  33. package/dist/{chunk-PDOPU3KN.js → chunk-H4LUHKUJ.js} +82 -82
  34. package/dist/{chunk-C4FSZ37W.js → chunk-IWNQPPJ7.js} +3 -3
  35. package/dist/chunk-JRQMX4PK.js +1 -0
  36. package/dist/{chunk-KRWHKEGT.js → chunk-NVAH2NQI.js} +1 -1
  37. package/dist/chunk-NZKR3JPM.js +2 -0
  38. package/dist/chunk-NZYBHM7H.js +1 -0
  39. package/dist/{chunk-E6PDAYBR.js → chunk-O5UD3ZWM.js} +4 -4
  40. package/dist/{chunk-DGFFDZCY.js → chunk-OZV5P5A7.js} +5 -5
  41. package/dist/chunk-PDIGCTZD.js +23 -0
  42. package/dist/chunk-R3BLTWKE.js +15 -0
  43. package/dist/{chunk-767USLF5.js → chunk-R3R6ZJNW.js} +6 -6
  44. package/dist/{chunk-3U4IIEEY.js → chunk-RI5QSLX3.js} +1 -1
  45. package/dist/{chunk-GEYM4WN3.js → chunk-S6UJKSF3.js} +1 -1
  46. package/dist/{chunk-KZQRUVII.js → chunk-TZBNN6HD.js} +5 -5
  47. package/dist/{chunk-EEFUXXYJ.js → chunk-UF76AFFY.js} +13 -13
  48. package/dist/chunk-VNNVG4NR.js +1 -0
  49. package/dist/chunk-VP64XZR6.js +1 -0
  50. package/dist/{chunk-LPAOHDUE.js → chunk-WAKWESOR.js} +1 -1
  51. package/dist/{chunk-5RFSFKAV.js → chunk-XOZ5VPXF.js} +1 -1
  52. package/dist/chunk-ZPJTLNKU.js +1 -0
  53. package/dist/data/Gantt.js +1 -1
  54. package/dist/format/index.d.ts +2 -1
  55. package/dist/format/index.js +1 -1
  56. package/dist/forms/BrandAssetEditor.js +1 -1
  57. package/dist/forms/Calendar.js +1 -1
  58. package/dist/forms/DatePicker.js +1 -1
  59. package/dist/forms/DateRangePicker.js +1 -1
  60. package/dist/forms/DateTimePicker.js +1 -1
  61. package/dist/forms/MediaLibrary.js +1 -1
  62. package/dist/icons/brands.node.js +1 -1
  63. package/dist/icons/efficient-glyphs.js +1 -1
  64. package/dist/icons/efficient-looks.js +1 -1
  65. package/dist/icons/efficient.js +1 -1
  66. package/dist/icons/index.js +1 -1
  67. package/dist/icons/looks/map.js +1 -1
  68. package/dist/icons/payment.js +1 -1
  69. package/dist/icons/sets.js +1 -1
  70. package/dist/index.d.ts +4 -3
  71. package/dist/index.js +362 -362
  72. package/dist/shell/LanguageSelect.js +1 -1
  73. package/dist/shell/MilestoneTimeline.js +1 -1
  74. package/dist/shell/ProductionTimeline.js +1 -1
  75. package/dist/shell/SettingRow.js +1 -1
  76. package/dist/shell/TimeAgo.js +1 -1
  77. package/dist/shell/TimelineTrack.js +1 -1
  78. package/dist/shell/timelineDates.d.ts +3 -8
  79. package/dist/shell/timelineDates.js +1 -1
  80. package/dist/telemetry/index.js +1 -1
  81. package/dist/templates/DashboardTemplate.js +1 -1
  82. package/dist/ui/index.d.ts +4 -3
  83. package/dist/ui/index.js +1 -1
  84. package/dist/utils/date.d.ts +46 -1
  85. package/dist/utils/date.js +1 -1
  86. package/dist/utils/dateKey.d.ts +3 -1
  87. package/dist/utils/dateKey.js +1 -1
  88. package/dist/utils/format.js +1 -1
  89. package/dist/utils/gridColumns.d.ts +18 -0
  90. package/dist/utils/gridColumns.js +1 -0
  91. package/dist/version.js +1 -1
  92. package/package.json +1 -1
  93. package/dist/Files-JYSWQWY3.js +0 -141
  94. package/dist/Notepad-VAYNWENE.js +0 -24
  95. package/dist/chunk-3C2VAHGO.js +0 -9
  96. package/dist/chunk-3HU63I3K.js +0 -1
  97. package/dist/chunk-7TC3LJQM.js +0 -1
  98. package/dist/chunk-IGBFTBKL.js +0 -14
  99. package/dist/chunk-KRCWLZV7.js +0 -15
  100. package/dist/chunk-OFHJXWMZ.js +0 -2
  101. package/dist/chunk-RQVP7CBW.js +0 -1
  102. package/dist/chunk-RTGGGZ2R.js +0 -2
  103. package/dist/chunk-RXRF2327.js +0 -23
  104. package/dist/chunk-SKMXSDRJ.js +0 -1
  105. package/dist/chunk-VNROPHRY.js +0 -29
  106. package/dist/chunk-XNMXCK7B.js +0 -1
  107. package/dist/chunk-Y3JW2GW5.js +0 -1
  108. /package/dist/{chunk-KH3253OM.js → chunk-CLEMKDRO.js} +0 -0
@@ -0,0 +1,29 @@
1
+ import{Segmented as e}from"./chunk-HNIIDDLJ.js";import{calendarNames as t,formatDate as n}from"./chunk-ZPJTLNKU.js";import{toDateKey as r,fromDateKey as a,DAY_MS as o}from"./chunk-JRQMX4PK.js";import{LoadingSpinner as i}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as s}from"./chunk-D65T4H6J.js";import{useShellStrings as l,useShellLocale as d}from"./chunk-DEJIH3ZQ.js";import{useState as c,useRef as u,useId as h,useMemo as m}from"react";import{jsx as f,Fragment as p,jsxs as b}from"react/jsx-runtime";var g={day:32,week:16,month:4},y=44;function w(e){const t="string"==typeof e?a(e.slice(0,10)):null;return t?Math.round(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())/o):null}function x(e){return new Date(e*o).toISOString().slice(0,10)}function v(e){return new Date(e*o)}function k(e){return((e+3)%7+7)%7}function N(e){return e-k(e)}function D(e){const t=v(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)/o)}function M(e){const t=v(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)/o)}function C(e){return Math.round(Date.UTC(v(e).getUTCFullYear(),0,1)/o)}function $(e){return Math.round(Date.UTC(v(e).getUTCFullYear()+1,0,1)/o)}var T={day:3,week:7,month:14},U={day:28,week:84,month:182};function j(e,t,n){return(e-t.startDay)*g[n]}function P(e,t,n){return j(e,t,n)+g[n]/2}function I(e,t,n,r){const a=[];let o=e.startDay;if(n(o)!==o){const n=Math.min(r(o),e.endDay);a.push({startDay:o,endDay:n,x:j(o,e,t),width:(n-o)*g[t]}),o=n}for(;o<e.endDay;){const n=Math.min(r(o),e.endDay);a.push({startDay:o,endDay:n,x:j(o,e,t),width:(n-o)*g[t]}),o=n}return a}function S(e,t,n,r){if(null===e&&null===t)return{kind:"none"};if(null===e)return{kind:"milestone",day:t,cx:j(t,n,r)+g[r]/2};const a=null===t?e:Math.min(e,t),o=null===t?e:Math.max(e,t);return{kind:"bar",startDay:a,endDay:o,x:j(a,n,r),width:(o-a+1)*g[r]}}function X(e){return"bar"===e.kind?{inX:e.x,outX:e.x+e.width}:"milestone"===e.kind?{inX:e.cx-9,outX:e.cx+9}:null}function R(e,t,n,r,a=44,o=10){let i;if(n-e>=2*o){const a=e+o;i=[[e,t],[a,t],[a,r],[n,r]]}else{const s=t+(r>=t?1:-1)*a/2,l=e+o,d=n-o;i=[[e,t],[l,t],[l,s],[d,s],[d,r],[n,r]]}return i.filter((e,t)=>0===t||e[0]!==i[t-1][0]||e[1]!==i[t-1][1])}function z(e){return e.map(([e,t],n)=>`${0===n?"M":"L"}${e} ${t}`).join(" ")}function Y(e,t,n=5){return`${e},${t} ${e-n},${t-n} ${e-n},${t+n}`}function F(e,t,n,r){if("move"===e)return{start:null===t?null:t+r,end:null===n?null:n+r};if("start"===e){if(null===t)return{start:t,end:n};const e=t+r;return{start:null===n?e:Math.min(e,n),end:n}}if(null===n)return{start:t,end:n};const a=n+r;return{start:t,end:null===t?a:Math.max(a,t)}}var H=24;function L({rows:a,groups:o=[],dependencies:j=[],scale:L,onScaleChange:K,onRowClick:Q,onRowChange:A,readOnly:J=!1,today:E,isLoading:W=!1,emptyState:Z,labelHeader:O,labelWidth:V=240,className:q=""}){const B=l().gantt,G=d(),_=t(G),ee=!!A&&!J,[te,ne]=c(null),re=u(!1),ae=u(null),oe=h(),ie=w(E)??w(r(/* @__PURE__ */new Date)),se=m(()=>{const e=/* @__PURE__ */new Map;for(const t of a){const n=w(t.start),r=w(t.end);e.set(t.id,te&&te.id===t.id?F(te.mode,te.start,te.end,te.delta):{start:n,end:r})}return e},[a,te]),le=m(()=>{const e=[ie];for(const t of a){const n=w(t.start),r=w(t.end);null!==n&&e.push(n),null!==r&&e.push(r)}return function(e,t){const n=e.filter(e=>Number.isFinite(e)),r=n.length?Math.min(...n):0,a=n.length?Math.max(...n):0;let o=r-T[t],i=a+1+T[t];const s=U[t]-(i-o);return s>0&&(o-=Math.floor(s/2),i+=Math.ceil(s/2)),"week"===t?(o=N(o),i=N(i-1)+7):"month"===t&&(o=D(o),i=M(i-1)),{startDay:o,endDay:i}}(e,L)},[a,L,ie]),de=m(()=>function(e,t){return"day"===t?{major:I(e,t,D,M),minor:I(e,t,e=>e,e=>e+1)}:"week"===t?{major:I(e,t,D,M),minor:I(e,t,N,e=>N(e)+7)}:{major:I(e,t,C,$),minor:I(e,t,D,M)}}(le,L),[le,L]),ce=function(e,t){return(e.endDay-e.startDay)*g[t]}(le,L),ue=m(()=>function(e,t){const n=new Set(t.map(e=>e.id)),r=/* @__PURE__ */new Map,a=[];for(const t of e)if(null!=t.groupId&&n.has(t.groupId)){const e=r.get(t.groupId)??[];e.push(t),r.set(t.groupId,e)}else a.push(t);const o=a.map(e=>({kind:"row",row:e}));for(const e of t){o.push({kind:"group",group:e});for(const t of r.get(e.id)??[])o.push({kind:"row",row:t})}return o}(a,o),[a,o]),he=m(()=>{const e=/* @__PURE__ */new Map;return ue.forEach((t,n)=>{if("row"!==t.kind)return;const r=se.get(t.row.id);e.set(t.row.id,{shape:S(r.start,r.end,le,L),line:n})}),e},[ue,se,le,L]),me=m(()=>{const e=[];for(const t of j){const n=he.get(t.from),r=he.get(t.to);if(!n||!r)continue;const a=X(n.shape),o=X(r.shape);if(!a||!o)continue;const i=n.line*y+22,s=r.line*y+22,l=R(a.outX,i,o.inX,s);e.push({key:`${t.from}>${t.to}`,d:z(l),head:Y(o.inX,s)})}return e},[j,he]),fe=!W&&(a.length>0||o.length>0);s(()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-V;e.scrollLeft=Math.max(0,P(ie,le,L)-t/4)},[L,fe]);if(W)/* @__PURE__ */return f(i,{size:"sm",padding:"p-4",label:B.loading});if(!fe)/* @__PURE__ */return f(p,{children:Z??/* @__PURE__ */f("div",{className:"text-sm text-ink-faint p-4",children:B.empty})});const pe=(e,t,n)=>{A?.(e.id,{start:null===t?null:x(t),end:null===n?null:x(n)})},be=(e,t,n)=>{if(re.current=!1,ee&&0===e.button){e.stopPropagation();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}ne({id:t.id,mode:n,originX:e.clientX,start:w(t.start),end:w(t.end),delta:0})}},ge=e=>{if(!te)return;const t=function(e,t){const n=Math.round(e/g[t]);return 0===n?0:n}(e.clientX-te.originX,L);t!==te.delta&&ne({...te,delta:t})},ye=e=>{if(te){if(0!==te.delta){const t=F(te.mode,te.start,te.end,te.delta);re.current=!0,pe(e,t.start,t.end)}ne(null)}},we=(e,t)=>{if("Enter"===e.key||" "===e.key)return e.preventDefault(),void Q?.(t);if(!ee||"ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const n="ArrowRight"===e.key?1:-1,r=F(e.shiftKey?"end":"move",w(t.start),w(t.end),n);pe(t,r.start,r.end)},xe=e=>{re.current?re.current=!1:Q?.(e)},ve=e=>n(x(e),{locale:G}),ke=(e,t)=>{const n=v(e.startDay),r=n.getUTCFullYear(),a=n.getUTCMonth();return"major"===t?"month"===L?String(r):"week"===L?_.shortMonthYear(r,a):_.monthYear(r,a):"month"===L?_.monthsShort[a]:String(n.getUTCDate())},Ne=ue.length*y,De=P(ie,le,L),Me=De>=0&&De<=ce,Ce=de.minor.find(e=>e.startDay<=ie&&ie<e.endDay),$e=Ce?De-Ce.x:0,Te=!!Ce&&$e<=Ce.width/2;/* @__PURE__ */
2
+ return b("div",{className:`flex min-h-0 flex-col ${q}`,children:[
3
+ /* @__PURE__ */b("div",{className:"flex items-center justify-end gap-2 pb-2",children:[
4
+ /* @__PURE__ */f("button",{type:"button",onClick:()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-V;e.scrollTo?.({left:Math.max(0,P(ie,le,L)-t/4),behavior:"smooth"})},className:"min-h-8 rounded-(--radius-control) border border-line bg-surface px-3 text-xs font-medium text-ink hover:bg-row-hover",children:B.today}),K&&/* @__PURE__ */f(e,{size:"sm",label:B.scale,value:L,onChange:K,options:[{value:"day",label:B.day},{value:"week",label:B.week},{value:"month",label:B.month}]})]}),
5
+ /* @__PURE__ */f("div",{ref:ae,"data-gantt-scroller":"",className:"relative min-h-0 flex-1 overflow-auto grid-scroll rounded-(--radius-card) border border-line bg-surface",children:/* @__PURE__ */b("div",{className:"relative",style:{width:V+ce,minHeight:48+Ne},children:[
6
+ /* @__PURE__ */b("div",{className:"sticky top-0 z-20 flex border-b border-line bg-surface",style:{height:48},children:[
7
+ /* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-end border-r border-line bg-surface px-3 pb-1 text-xs font-medium text-ink-muted",style:{width:V},children:O??B.task}),
8
+ /* @__PURE__ */b("div",{className:"relative shrink-0",style:{width:ce},"aria-hidden":!0,children:[de.major.map(e=>/* @__PURE__ */f("div",{className:"absolute top-0 border-l border-line-subtle text-xs font-medium leading-6 text-ink",style:{left:e.x,width:e.width,height:H},children:/* @__PURE__ */f("span",{className:"sticky inline-block whitespace-nowrap px-2",style:{left:V},children:ke(e,"major")})},`M${e.startDay}`)),de.minor.map(e=>/* @__PURE__ */f("div",{"data-gantt-tick":"minor",className:`absolute truncate border-l border-line-subtle text-2xs leading-6 text-ink-faint ${"day"===L?"text-center":"px-1"} ${e.startDay===ie&&"day"===L?"font-semibold text-danger":""}`,style:{left:e.x,width:e.width,top:H,height:H},children:ke(e,"minor")},`m${e.startDay}`)),Me&&Ce&&"day"!==L&&
9
+ /* @__PURE__ */b("div",{className:"pointer-events-none absolute flex items-center text-2xs "+(Te?"":"flex-row-reverse"),style:{left:Te?Ce.x:De-(Ce.width-$e),width:2*(Te?$e:Ce.width-$e),top:H,height:H},children:[Te&&/* @__PURE__ */f("span",{className:"invisible shrink-0 whitespace-nowrap px-1",children:ke(Ce,"minor")}),
10
+ /* @__PURE__ */f("span",{className:"min-w-0 flex-1"}),
11
+ /* @__PURE__ */f("span",{"data-gantt-today-label":"",className:"shrink-0 whitespace-nowrap rounded-(--radius-control) bg-danger px-1 font-medium leading-4 text-on-accent",children:B.today}),
12
+ /* @__PURE__ */f("span",{className:"min-w-0 flex-1"}),Te&&/* @__PURE__ */f("span",{className:"invisible min-w-0 shrink overflow-hidden",children:/* @__PURE__ */f("span",{className:"inline-block whitespace-nowrap px-1",children:ke(Ce,"minor")})})]})]})]}),
13
+ /* @__PURE__ */b("div",{className:"pointer-events-none absolute",style:{left:V,top:48,width:ce,height:Ne},"aria-hidden":!0,children:["day"===L&&de.minor.filter(e=>k(e.startDay)>=5).map(e=>/* @__PURE__ */f("div",{className:"absolute inset-y-0 bg-surface-sunken",style:{left:e.x,width:e.width}},`w${e.startDay}`)),de.minor.map(e=>/* @__PURE__ */f("div",{className:"absolute inset-y-0 w-px bg-line-subtle",style:{left:e.x}},`g${e.startDay}`))]}),
14
+ /* @__PURE__ */f("div",{role:"list",children:ue.map(e=>{if("group"===e.kind)/* @__PURE__ */
15
+ return b("div",{role:"listitem",className:"flex",style:{height:y},children:[
16
+ /* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-center border-r border-b border-line bg-surface-sunken px-3 text-sm font-semibold text-ink",style:{width:V},children:/* @__PURE__ */f("span",{className:"truncate",children:e.group.label})}),
17
+ /* @__PURE__ */f("div",{className:"shrink-0 border-b border-line-subtle",style:{width:ce}})]},`g:${e.group.id}`);const t=e.row,n=he.get(t.id).shape,r=function(e,t){return e.done?{className:"border text-ink-muted",style:{background:"var(--status-neutral-soft)",borderColor:"var(--status-neutral-line)"}}:e.tone?{className:"text-on-accent",style:{background:`var(--status-${e.tone}-solid)`}}:{className:t?"bg-identity-3":"bg-accent-fill text-on-accent"}}(t,"milestone"===n.kind),a=te?.id===t.id,o=t.done?`, ${B.done}`:"";/* @__PURE__ */
18
+ return b("div",{role:"listitem",className:"flex",style:{height:y},"data-gantt-row":t.id,children:[
19
+ /* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 border-r border-b border-line-subtle bg-surface",style:{width:V},children:/* @__PURE__ */f("button",{type:"button",tabIndex:"none"===n.kind&&Q?0:-1,onClick:()=>Q?.(t),className:`flex w-full min-w-0 items-center px-3 text-left text-sm hover:bg-row-hover ${t.done?"text-ink-faint line-through":"text-ink"} ${Q?"cursor-pointer":"cursor-default"}`,children:/* @__PURE__ */f("span",{className:"truncate",children:t.label})})}),
20
+ /* @__PURE__ */b("div",{className:"relative shrink-0 border-b border-line-subtle",style:{width:ce},children:["bar"===n.kind&&/* @__PURE__ */b(p,{children:[
21
+ /* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"aria-label":B.barName(t.label,ve(n.startDay),ve(n.endDay))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`group/bar absolute rounded-(--radius-control) shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":Q?"cursor-pointer":""} ${a?"opacity-80":""}`,style:{...r.style,left:n.x,width:n.width,top:10,height:24,touchAction:ee?"none":void 0},children:ee&&/* @__PURE__ */b(p,{children:[
22
+ /* @__PURE__ */f("span",{"aria-hidden":!0,"data-gantt-handle":"start",className:"absolute inset-y-0 left-0 w-2 cursor-ew-resize rounded-l-(--radius-control) group-hover/bar:bg-scrim-soft",onPointerDown:e=>be(e,t,"start")}),
23
+ /* @__PURE__ */f("span",{"aria-hidden":!0,"data-gantt-handle":"end",className:"absolute inset-y-0 right-0 w-2 cursor-ew-resize rounded-r-(--radius-control) group-hover/bar:bg-scrim-soft",onPointerDown:e=>be(e,t,"end")})]})}),
24
+ /* @__PURE__ */f("span",{"aria-hidden":!0,className:"pointer-events-none absolute whitespace-nowrap text-xs leading-none text-ink-muted",style:{left:n.x+n.width+16,top:16},children:t.label})]}),"milestone"===n.kind&&/* @__PURE__ */b(p,{children:[
25
+ /* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"data-gantt-milestone":"","aria-label":B.milestoneName(t.label,ve(n.day))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`absolute rotate-45 rounded-sm shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":Q?"cursor-pointer":""}`,style:{...r.style,left:n.cx-9/Math.SQRT2,top:22-9/Math.SQRT2,width:18/Math.SQRT2,height:18/Math.SQRT2,touchAction:ee?"none":void 0}}),
26
+ /* @__PURE__ */f("span",{"aria-hidden":!0,className:"pointer-events-none absolute whitespace-nowrap text-xs leading-none text-ink-muted",style:{left:n.cx+9+16,top:16},children:t.label})]})]})]},t.id)})}),
27
+ /* @__PURE__ */f("svg",{className:"pointer-events-none absolute overflow-visible text-ink-faint",style:{left:V,top:48,width:ce,height:Ne},width:ce,height:Ne,"aria-hidden":!0,children:me.map(e=>/* @__PURE__ */b("g",{"data-gantt-arrow":e.key,children:[
28
+ /* @__PURE__ */f("path",{d:e.d,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round"}),
29
+ /* @__PURE__ */f("polygon",{points:e.head,fill:"currentColor"})]},e.key))}),Me&&/* @__PURE__ */f("div",{"data-gantt-today":"",className:"pointer-events-none absolute z-0 w-0.5 -translate-x-1/2 bg-danger",style:{left:V+De,top:48,height:Ne},"aria-hidden":!0}),ee&&/* @__PURE__ */f("span",{id:oe,hidden:!0,children:B.moveHint})]})})]})}export{L as Gantt};
@@ -0,0 +1 @@
1
+ import{formatDate as e}from"./chunk-ZPJTLNKU.js";function n(e){if(!e)return null;const n=new Date(e).getTime();if(!Number.isFinite(n))return null;const t=new Date(n).getUTCFullYear();return t<2e3||t>2100?null:n}function t(n,t){return e(new Date(n).toISOString().slice(0,10),{locale:t})}export{t as fmtSliderDate,n as toDayMs};
@@ -0,0 +1,14 @@
1
+ import{calendarNames as e,firstDayOfWeek as r,userToday as t}from"./chunk-ZPJTLNKU.js";import{fromDateKey as a,toMonthKey as n,toDateKey as o,fromMonthKey as l,addMonths as i}from"./chunk-JRQMX4PK.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{useBrowserValue as c}from"./chunk-D65T4H6J.js";import{useShellStrings as u,useShellLocale as g}from"./chunk-DEJIH3ZQ.js";import{useMemo as d,useState as h,useRef as m,useEffect as f}from"react";import{jsxs as b,jsx as y,Fragment as v}from"react/jsx-runtime";var p="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";var x=()=>t();var w=(e,r)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+r);function N({value:t,endValue:N,mode:k="single",onSelect:D,min:M,max:Y,month:F,defaultMonth:j,onMonthChange:A,weekStartsOn:C,quickJump:S=!0,markedDates:P,readOnly:J=!1,"aria-label":K,className:q=""}){const E=d(()=>new Set(P??[]),[P]),H=a(t),I=c(x,null),O=a(I),R=u().calendar,U=g(),$=e(U),L=c(()=>r(U),0),Q=C??L,T=()=>{if(!O)return null;const e=n(O);return M&&e<M.slice(0,7)?M.slice(0,7):Y&&e>Y.slice(0,7)?Y.slice(0,7):e},[V,W]=h(()=>j||(H?n(H):T())),Z=F??V??T(),B=null===Z?null:function(e,r){return l(e)??r}(Z,O),[X,z]=h(()=>t??I),G=m(null),_=m(!1),[ee,re]=h("days"),te=d(()=>B?function(e,r){const t=new Date(e.getFullYear(),e.getMonth(),1),a=(t.getDay()-r+7)%7,n=new Date(t.getFullYear(),t.getMonth(),1-a);return Array.from({length:42},(e,r)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+r))}(B,Q):[],[Z,Q]),ae=e=>!!M&&e<M||!!Y&&e>Y,ne=X??I,oe=te.some(e=>o(e)===ne),le=B?te.find(e=>e.getMonth()===B.getMonth())??te[0]:null,ie=oe&&ne?ne:le?o(le):"";if(f(()=>{_.current&&(_.current=!1,G.current?.querySelector('[data-active="true"]')?.focus())},[ie,Z]),!B)/* @__PURE__ */
2
+ return b("div",{className:q,"aria-hidden":"true","data-calendar-pending":"",children:[
3
+ /* @__PURE__ */y("div",{className:"mb-2 h-6"}),
4
+ /* @__PURE__ */y("div",{className:"space-y-1",children:Array.from({length:7},(e,r)=>/* @__PURE__ */y("div",0===r?{className:"py-1 text-xs",children:" "}:{className:p,children:/* @__PURE__ */y("span",{className:"aspect-square"})},r))})]});const se=e=>"years"===ee?new Date(B.getFullYear()+12*e,B.getMonth(),1):"months"===ee?new Date(B.getFullYear()+e,B.getMonth(),1):i(B,e),ce=e=>{const r=n(e);void 0===F&&W(r),A?.(r)},ue=K??$.monthYear(B.getFullYear(),B.getMonth());/* @__PURE__ */
5
+ return b("div",{className:q,children:[
6
+ /* @__PURE__ */b("div",{className:"mb-2 flex items-center justify-between px-1",children:[
7
+ /* @__PURE__ */y("button",{type:"button","aria-label":"years"===ee?R.previousYears:"months"===ee?R.previousYear:R.previousMonth,onClick:()=>ce(se(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */y(s,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
8
+ /* @__PURE__ */y("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:S?/* @__PURE__ */b(v,{children:["years"!==ee&&/* @__PURE__ */y("button",{type:"button","aria-label":R.chooseMonth($.months[B.getMonth()]),onClick:()=>re(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:$.months[B.getMonth()]}),
9
+ /* @__PURE__ */y("button",{type:"button","aria-label":R.chooseYear(B.getFullYear()),onClick:()=>re(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:B.getFullYear()})]}):/* @__PURE__ */y("span",{children:$.monthYear(B.getFullYear(),B.getMonth())})}),
10
+ /* @__PURE__ */y("button",{type:"button","aria-label":"years"===ee?R.nextYears:"months"===ee?R.nextYear:R.nextMonth,onClick:()=>ce(se(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */y(s,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===ee&&/* @__PURE__ */y("div",{role:"group","aria-label":R.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:$.monthsShort.map((e,r)=>/* @__PURE__ */y("button",{type:"button","aria-pressed":r===B.getMonth(),onClick:()=>{ce(new Date(B.getFullYear(),r,1)),re("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",r===B.getMonth()?"bg-blue-600 font-semibold text-white":O&&r===O.getMonth()&&B.getFullYear()===O.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===ee&&/* @__PURE__ */y("div",{role:"group","aria-label":R.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,r)=>{return t=B.getFullYear(),12*Math.floor(t/12)+r;var t}).map(e=>/* @__PURE__ */y("button",{type:"button","aria-pressed":e===B.getFullYear(),onClick:()=>{ce(new Date(e,B.getMonth(),1)),re("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===B.getFullYear()?"bg-blue-600 font-semibold text-white":e===O?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
11
+ /* @__PURE__ */b("div",{ref:G,role:"grid","aria-label":ue,className:"space-y-1","aria-readonly":J||void 0,onKeyDown:e=>{const r=a(ie)??O??B,t={ArrowLeft:()=>w(r,-1),ArrowRight:()=>w(r,1),ArrowUp:()=>w(r,-7),ArrowDown:()=>w(r,7),Home:()=>w(r,-(r.getDay()-Q+7)%7),End:()=>w(r,6-(r.getDay()-Q+7)%7),PageUp:()=>i(r,e.shiftKey?-12:-1),PageDown:()=>i(r,e.shiftKey?12:1)};if(t[e.key])return e.preventDefault(),l=t[e.key](),_.current=!0,z(o(l)),void(n(l)!==Z&&ce(l));var l;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),J||ae(ie)||D(ie))},hidden:"days"!==ee,children:[
12
+ /* @__PURE__ */y("div",{role:"row",className:`${p} text-center text-xs font-medium text-ink-faint`,children:Array.from({length:7},(e,r)=>(r+Q)%7).map(e=>
13
+ /* @__PURE__ */y("div",{role:"columnheader","aria-label":$.weekdays[e],className:"py-1",children:/* @__PURE__ */y("abbr",{title:$.weekdays[e],className:"no-underline",children:$.weekdaysShort[e]})},e))}),Array.from({length:6},(e,r)=>/* @__PURE__ */y("div",{role:"row",className:`${p} text-center text-sm`,children:te.slice(7*r,7*r+7).map(e=>{const r=o(e),a=e.getMonth()!==B.getMonth(),n=r===t||"range"===k&&r===N,l=(e=>!("range"!==k||!t||!N)&&e>t&&e<N)(r),i=ae(r),s=$.longDate(e.getFullYear(),e.getMonth(),e.getDate()),c=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",i?"cursor-not-allowed text-gray-300":n?"bg-accent-fill font-semibold text-on-accent":l?"bg-accent-tint-strong text-blue-800":a?"text-ink-faint"+(e?" hover:bg-gray-100":""):"text-ink"+(e?" hover:bg-gray-100":""),r!==I||n?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),u=E.has(r)&&/* @__PURE__ */y("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(n?"bg-surface":a?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
14
+ return y("div",{role:"gridcell","aria-selected":n,"aria-label":J?s:void 0,children:J?/* @__PURE__ */b("span",{"aria-hidden":"true",className:`grid place-items-center ${c(!1)}`,children:[e.getDate(),u]}):/* @__PURE__ */b("button",{type:"button","data-active":r===ie,tabIndex:r===ie?0:-1,disabled:i,"aria-label":s,"aria-current":r===I?"date":void 0,onClick:()=>{z(r),D(r)},className:c(!0),children:[e.getDate(),u]})},r)})},r))]})]})}export{N as Calendar};