@ahrowe/ui 0.37.0 → 0.38.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 (95) hide show
  1. package/README.md +4 -1
  2. package/dist/cjs-types/common/commandPalette/commandPalette.d.ts +4 -0
  3. package/dist/cjs-types/common/commandPalette/commandPalette.types.d.ts +42 -0
  4. package/dist/cjs-types/common/commandPalette/filterCommands.d.ts +15 -0
  5. package/dist/cjs-types/common/commandPalette/index.d.ts +2 -0
  6. package/dist/cjs-types/common/configProvider/configProvider.types.d.ts +6 -0
  7. package/dist/cjs-types/common/copyButton/copyButton.d.ts +4 -0
  8. package/dist/cjs-types/common/copyButton/copyButton.types.d.ts +36 -0
  9. package/dist/cjs-types/common/copyButton/index.d.ts +2 -0
  10. package/dist/cjs-types/common/errorBoundary/errorBoundary.d.ts +0 -3
  11. package/dist/cjs-types/common/errorBoundary/errorBoundary.types.d.ts +2 -3
  12. package/dist/cjs-types/common/hooks/index.d.ts +2 -0
  13. package/dist/cjs-types/common/hooks/useClipboard.d.ts +16 -0
  14. package/dist/cjs-types/common/inputDropdown/inputDropdown.types.d.ts +7 -1
  15. package/dist/cjs-types/common/menu/menu.types.d.ts +2 -0
  16. package/dist/cjs-types/common/themeProvider/themeProvider.d.ts +8 -7
  17. package/dist/cjs-types/common/weatherIcon/index.d.ts +3 -0
  18. package/dist/cjs-types/common/weatherIcon/parts.d.ts +26 -0
  19. package/dist/cjs-types/common/weatherIcon/weatherIcon.d.ts +4 -0
  20. package/dist/cjs-types/common/weatherIcon/weatherIcon.types.d.ts +44 -0
  21. package/dist/cjs-types/index.d.ts +6 -0
  22. package/dist/esm/common/buttonGroup/buttonGroup.module.mjs.map +1 -1
  23. package/dist/esm/common/commandPalette/commandPalette.mjs +2 -0
  24. package/dist/esm/common/commandPalette/commandPalette.mjs.map +1 -0
  25. package/dist/esm/common/commandPalette/commandPalette.module.mjs +2 -0
  26. package/dist/esm/common/commandPalette/commandPalette.module.mjs.map +1 -0
  27. package/dist/esm/common/commandPalette/filterCommands.mjs +2 -0
  28. package/dist/esm/common/commandPalette/filterCommands.mjs.map +1 -0
  29. package/dist/esm/common/copyButton/copyButton.mjs +2 -0
  30. package/dist/esm/common/copyButton/copyButton.mjs.map +1 -0
  31. package/dist/esm/common/copyButton/copyButton.module.mjs +2 -0
  32. package/dist/esm/common/copyButton/copyButton.module.mjs.map +1 -0
  33. package/dist/esm/common/dropdown/dropdown.mjs +1 -1
  34. package/dist/esm/common/dropdown/dropdown.module.mjs.map +1 -1
  35. package/dist/esm/common/errorBoundary/errorBoundary.mjs +2 -2
  36. package/dist/esm/common/errorBoundary/errorBoundary.mjs.map +1 -1
  37. package/dist/esm/common/errorBoundary/errorBoundary.module.mjs +1 -1
  38. package/dist/esm/common/errorBoundary/errorBoundary.module.mjs.map +1 -1
  39. package/dist/esm/common/hooks/useClipboard.mjs +2 -0
  40. package/dist/esm/common/hooks/useClipboard.mjs.map +1 -0
  41. package/dist/esm/common/inputDropdown/inputDropdown.mjs +1 -1
  42. package/dist/esm/common/inputDropdown/inputDropdown.mjs.map +1 -1
  43. package/dist/esm/common/inputDropdown/inputDropdown.module.mjs +1 -1
  44. package/dist/esm/common/inputDropdown/inputDropdown.module.mjs.map +1 -1
  45. package/dist/esm/common/menu/menu.mjs +1 -1
  46. package/dist/esm/common/menu/menu.mjs.map +1 -1
  47. package/dist/esm/common/menu/menu.types.mjs.map +1 -1
  48. package/dist/esm/common/themeProvider/themeProvider.mjs +1 -1
  49. package/dist/esm/common/themeProvider/themeProvider.mjs.map +1 -1
  50. package/dist/esm/common/timer/timer.mjs +1 -1
  51. package/dist/esm/common/timer/timer.mjs.map +1 -1
  52. package/dist/esm/common/weatherIcon/parts.mjs +2 -0
  53. package/dist/esm/common/weatherIcon/parts.mjs.map +1 -0
  54. package/dist/esm/common/weatherIcon/weatherIcon.mjs +2 -0
  55. package/dist/esm/common/weatherIcon/weatherIcon.mjs.map +1 -0
  56. package/dist/esm/common/weatherIcon/weatherIcon.module.mjs +2 -0
  57. package/dist/esm/common/weatherIcon/weatherIcon.module.mjs.map +1 -0
  58. package/dist/esm/common/weatherIcon/weatherIcon.types.mjs +2 -0
  59. package/dist/esm/common/weatherIcon/weatherIcon.types.mjs.map +1 -0
  60. package/dist/esm/index.mjs +1 -1
  61. package/dist/index.cjs +3 -3
  62. package/dist/index.cjs.map +1 -1
  63. package/dist/style.css +1 -1
  64. package/dist/types/common/commandPalette/commandPalette.d.ts +4 -0
  65. package/dist/types/common/commandPalette/commandPalette.types.d.ts +42 -0
  66. package/dist/types/common/commandPalette/filterCommands.d.ts +15 -0
  67. package/dist/types/common/commandPalette/index.d.ts +2 -0
  68. package/dist/types/common/configProvider/configProvider.types.d.ts +6 -0
  69. package/dist/types/common/copyButton/copyButton.d.ts +4 -0
  70. package/dist/types/common/copyButton/copyButton.types.d.ts +36 -0
  71. package/dist/types/common/copyButton/index.d.ts +2 -0
  72. package/dist/types/common/errorBoundary/errorBoundary.d.ts +0 -3
  73. package/dist/types/common/errorBoundary/errorBoundary.types.d.ts +2 -3
  74. package/dist/types/common/hooks/index.d.ts +2 -0
  75. package/dist/types/common/hooks/useClipboard.d.ts +16 -0
  76. package/dist/types/common/inputDropdown/inputDropdown.types.d.ts +7 -1
  77. package/dist/types/common/menu/menu.types.d.ts +2 -0
  78. package/dist/types/common/themeProvider/themeProvider.d.ts +8 -7
  79. package/dist/types/common/weatherIcon/index.d.ts +3 -0
  80. package/dist/types/common/weatherIcon/parts.d.ts +26 -0
  81. package/dist/types/common/weatherIcon/weatherIcon.d.ts +4 -0
  82. package/dist/types/common/weatherIcon/weatherIcon.types.d.ts +44 -0
  83. package/dist/types/index.d.ts +6 -0
  84. package/docs/ButtonGroup.md +2 -0
  85. package/docs/CLAUDE.md +4 -1
  86. package/docs/CommandPalette.md +84 -0
  87. package/docs/ConfigProvider.md +2 -2
  88. package/docs/CopyButton.md +45 -0
  89. package/docs/ErrorBoundary.md +4 -4
  90. package/docs/Fab.md +1 -2
  91. package/docs/Hooks.md +39 -3
  92. package/docs/InputDropdown.md +9 -4
  93. package/docs/Menu.md +5 -3
  94. package/docs/WeatherIcon.md +49 -0
  95. package/package.json +1 -2
@@ -1,2 +1,2 @@
1
- "use client";import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import{useLabels as t}from"../configProvider/useLabels.mjs";import{ButtonSize as n}from"../button/button.types.mjs";import r from"../button/button.mjs";import i from"../actionIcon/actionIcon.mjs";import"./timer.chime.mjs";import a from"./timer.module.mjs";import{useEffect as o,useImperativeHandle as ee,useMemo as te,useRef as s,useState as c}from"react";import l from"classnames";import{faMinus as ne,faPause as re,faPlay as ie,faPlus as ae,faXmark as oe}from"@fortawesome/free-solid-svg-icons";import{jsx as u,jsxs as d}from"react/jsx-runtime";var se=200,ce=1e3,le={cancel:`Cancel timer`};function ue(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}function de(e){let t=Math.ceil(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=String(r).padStart(2,`0`),o=String(i).padStart(2,`0`);return n>0?`${n}:${a}:${o}`:`${a}:${o}`}function f(f){let{ref:fe,durationSeconds:p,autoStart:m=!0,resetOnDurationChange:pe=!0,onTick:h,onComplete:me,onStart:he,onPause:ge,onResume:_e,onCancel:ve,onAddTime:ye,onRemoveTime:be,showControls:g=!0,hideAddButton:xe=!1,hideRemoveButton:Se=!1,hidePauseButton:Ce=!1,hideCancelButton:we=!1,adjustSeconds:_=30,maxSeconds:v,label:y,formatTime:Te=de,size:b,strokeWidth:x=10,counterClockwise:Ee=!1,urgentThreshold:De=.1,urgentMinSeconds:Oe=3,pulseOnUrgent:ke=!0,showRunningRipples:S=!1,playSoundOnComplete:C=!1,soundUrl:w,soundVolume:Ae=.5,notifyOnComplete:T=!1,notificationTitle:je,notificationBody:Me,className:Ne,style:Pe,classNames:E,styles:D,labels:Fe,...Ie}=e(`Timer`,f),Le=t(`Timer`,Fe,le),O=p*1e3,[k,Re]=c(m?`running`:`idle`),[A,ze]=c(O),[Be,Ve]=c(0),[j,M]=c([]),N=s(A),P=s(k),F=s(O),I=s(!1),L=s(!1),R=s(!1),z=s(0);function B(e){N.current=e,ze(e)}function V(e){P.current=e,Re(e)}function H(){Ve(e=>e+1)}o(()=>{if(k!==`running`)return;let e=Date.now(),t=N.current,n=setInterval(()=>{let n=Math.max(0,t-(Date.now()-e));B(n),h?.(n),n<=0&&V(`completed`)},se);return()=>clearInterval(n)},[k,Be]),o(()=>{if(k===`completed`&&!I.current){if(I.current=!0,me?.(),C)try{let e=new Audio(w||`data:audio/wav;base64,UklGRkYeAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YSIeAAAAAAkAIAA4AEQANwAPANH/jv9b/07/cf/F/zkAsAAJAScB+QCCANv/K/+h/mX+j/4d//P/3QChAQkC8QFZAV0AOP80/pb9i/0g/jj/kgDaAbsC9gJzAkwBwv82/gz9k/zz/Bz+y/+ZARMD1QOoA44CxQC6/u782PvD+778kv7SAO8CYQTGBPwDLALE/1j9hfvD+kz7Bf2J/zwCcgSbBWUF1QNGAVX+vPsk+vj5TPvU/fYA7QP6BZYGkAUjA+D/k/wP+vj4nPna+y3/xQK+BVkHKActBeABC/6h+nz4LPjN+QD9AAHTBIQHYggvBy4EFgDn+6v4NPfm9576uP4zA/YGDAnsCJUGkgLc/Zz54vZh9kL4FfzvAKAF/AgqCtYITQVmAFX7W/d49Sv2Ufkq/ocDFgizCrIKCQhaA8f9sPhY9Zr0rfYW+8QAUwZiCuoLgwp9BtAA3voh9sjzb/T194T9wAMgCUwMdQyJCTgEzv3d9+Dz2fIR9QT6fwDsBrMLoQ00DL4HUgGC+v30JPKy8o32yPzeAxAK1A01DhILKwXu/ST3evIf8W/z4PghAGsH7wxMD+YNDQnrAUH68fOP8PjwGfX2++ED6ApKD+4PowwxBin+hfYq8W/vyfGs96r/zgcTDusQmQ9pCpwCGvr+8gvv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BlAZUB7wDb//X+sP4f//b/uAAEAcEAJQCO/0r/bv/U/zkAaQBXAB8A7v/f/+7/`);e.volume=Ae,e.play()?.catch(()=>{})}catch{}if(T&&typeof Notification<`u`&&Notification.permission===`granted`)try{new Notification(je??`Timer done`,{body:Me??(typeof y==`string`?y:void 0)})}catch{}}k!==`completed`&&(I.current=!1)},[k]),o(()=>{if(!R.current){R.current=!0;return}let e=p*1e3;F.current=e,B(e),I.current=!1,H(),pe&&V(m?`running`:`idle`)},[p]),o(()=>{if(!S||k!==`running`||ue())return;function e(){z.current+=1,M(e=>[...e,z.current])}e();let t=setInterval(e,ce);return()=>clearInterval(t)},[S,k]);function He(e){M(t=>t.filter(t=>t!==e))}function Ue(){T&&!L.current&&typeof Notification<`u`&&Notification.permission==="default"&&(L.current=!0,Notification.requestPermission().catch(()=>{}))}function U(){Ue(),(P.current===`completed`||P.current===`cancelled`)&&(B(F.current),I.current=!1),H(),V(`running`),he?.()}function W(){P.current===`running`&&(V(`paused`),ge?.())}function G(){P.current===`paused`&&(H(),V(`running`),_e?.())}function K(e){let t=v==null?1/0:v*1e3,n=Math.min(N.current+e*1e3,t);B(n),H(),ye?.(e,Math.round(n/1e3)),P.current===`completed`&&n>0&&(I.current=!1,V(`running`))}function q(e){let t=Math.max(0,N.current-e*1e3);B(t),H(),be?.(e,Math.round(t/1e3)),t<=0&&P.current===`running`&&V(`completed`)}function J(){B(F.current),V(`cancelled`),ve?.()}function We(){B(F.current),I.current=!1,V(`idle`)}ee(fe,()=>({start:U,pause:W,resume:G,addTime:K,removeTime:q,cancel:J,reset:We,getStatus:()=>P.current,getRemainingMs:()=>N.current}));let Y=50-x/2,X=te(()=>2*Math.PI*Y,[Y]),Ge=X*(1-(F.current>0?Math.min(1,A/F.current):0)),Z=Math.max(F.current*De,Oe*1e3),Q=k===`running`&&A<=Z,Ke=Q&&A<=Math.min(5e3,Z),$=k===`paused`,qe=g&&!xe,Je=g&&!Se,Ye=g&&!Ce,Xe=k===`running`?re:ie,Ze=k===`running`?`Pause`:$?`Resume`:k===`idle`?`Start`:`Restart`,Qe=k===`running`?W:$?G:U,$e=g&&!we;return d(`div`,{...Ie,className:l(a.timer,ke&&Q&&a.timerPulsing,Ke&&a.timerCritical,Ne,E?.root),style:{...b?{"--timer-size":b}:null,"--timer-stroke-width":`${x}px`,...Pe,...D?.root},children:[d(`div`,{className:l(a.timerRingWrapper,E?.ringWrapper),style:D?.ringWrapper,children:[j.length>0&&u(`div`,{className:l(a.timerRipples,E?.ripples),style:D?.ripples,children:j.map(e=>u(`span`,{className:l(a.timerRipple,E?.ripple),style:D?.ripple,onAnimationEnd:()=>He(e)},e))}),d(`svg`,{className:l(a.timerRingSvg,E?.ringSvg),viewBox:`0 0 100 100`,style:D?.ringSvg,children:[u(`circle`,{className:l(a.timerRingTrack,E?.ringTrack),cx:`50`,cy:`50`,r:Y,style:D?.ringTrack}),u(`circle`,{className:l(a.timerRingProgress,Q&&a.timerRingProgressUrgent,E?.ringProgress),cx:`50`,cy:`50`,r:Y,strokeDasharray:X,strokeDashoffset:Ge,style:{transition:$?`none`:void 0,transform:Ee?`rotate(-90deg)`:void 0,...D?.ringProgress}})]}),d(`div`,{className:l(a.timerDisplay,E?.display),style:D?.display,children:[u(`span`,{className:l(a.timerTime,E?.time),style:D?.time,children:Te(A)}),y&&u(`span`,{className:l(a.timerLabel,E?.label),style:D?.label,children:y})]})]}),g&&d(`div`,{className:l(a.timerControls,E?.controls),style:D?.controls,children:[d(`div`,{className:a.timerControlsRow,children:[Je&&u(i,{icon:ne,title:`Remove ${_}s`,onClick:()=>q(_),className:l(a.timerAdjustButton,E?.removeButton),style:D?.removeButton}),Ye&&u(r,{size:n.Small,icon:Xe,title:Ze,onClick:Qe,className:E?.pauseButton,style:D?.pauseButton}),qe&&u(i,{icon:ae,title:`Add ${_}s`,onClick:()=>K(_),className:l(a.timerAdjustButton,E?.addButton),style:D?.addButton})]}),$e&&u(i,{icon:oe,title:Le.cancel,onClick:J,className:l(a.timerCancelButton,E?.cancelButton),style:D?.cancelButton})]})]})}export{f as default};
1
+ "use client";import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import{useLabels as t}from"../configProvider/useLabels.mjs";import{ButtonSize as n}from"../button/button.types.mjs";import r from"../button/button.mjs";import i from"../actionIcon/actionIcon.mjs";import"./timer.chime.mjs";import a from"./timer.module.mjs";import{useEffect as o,useImperativeHandle as ee,useMemo as te,useRef as s,useState as c}from"react";import l from"classnames";import{faMinus as ne,faPause as re,faPlay as ie,faPlus as ae,faXmark as oe}from"@fortawesome/free-solid-svg-icons";import{jsx as u,jsxs as d}from"react/jsx-runtime";var se=200,ce=1e3,le={cancel:`Cancel timer`};function ue(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}function de(e){let t=Math.ceil(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=String(r).padStart(2,`0`),o=String(i).padStart(2,`0`);return n>0?`${n}:${a}:${o}`:`${a}:${o}`}function f(f){let{ref:fe,durationSeconds:p,autoStart:m=!0,resetOnDurationChange:pe=!0,onTick:h,onComplete:me,onStart:he,onPause:ge,onResume:_e,onCancel:ve,onAddTime:g,onRemoveTime:ye,showControls:_=!0,hideAddButton:be=!1,hideRemoveButton:xe=!1,hidePauseButton:Se=!1,hideCancelButton:Ce=!1,adjustSeconds:v=30,maxSeconds:y,label:b,formatTime:we=de,size:x,strokeWidth:S=10,counterClockwise:Te=!1,urgentThreshold:Ee=.1,urgentMinSeconds:De=3,pulseOnUrgent:Oe=!0,showRunningRipples:C=!1,playSoundOnComplete:w=!1,soundUrl:T,soundVolume:ke=.5,notifyOnComplete:E=!1,notificationTitle:Ae,notificationBody:je,className:Me,style:Ne,classNames:D,styles:O,labels:Pe,...Fe}=e(`Timer`,f),Ie=t(`Timer`,Pe,le),k=p*1e3,[A,Le]=c(m?`running`:`idle`),[j,Re]=c(k),[ze,Be]=c(0),[M,N]=c([]),P=s(j),F=s(A),I=s(k),L=s(!1),R=s(!1),z=s(!1),Ve=s(0);function B(e){P.current=e,Re(e)}function V(e){F.current=e,Le(e)}function H(){Be(e=>e+1)}o(()=>{if(A!==`running`)return;let e=Date.now(),t=P.current,n=setInterval(()=>{let n=Math.max(0,t-(Date.now()-e));B(n),h?.(n),n<=0&&V(`completed`)},se);return()=>clearInterval(n)},[A,ze]),o(()=>{if(A===`completed`&&!L.current){if(L.current=!0,me?.(),w)try{let e=new Audio(T||`data:audio/wav;base64,UklGRkYeAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YSIeAAAAAAkAIAA4AEQANwAPANH/jv9b/07/cf/F/zkAsAAJAScB+QCCANv/K/+h/mX+j/4d//P/3QChAQkC8QFZAV0AOP80/pb9i/0g/jj/kgDaAbsC9gJzAkwBwv82/gz9k/zz/Bz+y/+ZARMD1QOoA44CxQC6/u782PvD+778kv7SAO8CYQTGBPwDLALE/1j9hfvD+kz7Bf2J/zwCcgSbBWUF1QNGAVX+vPsk+vj5TPvU/fYA7QP6BZYGkAUjA+D/k/wP+vj4nPna+y3/xQK+BVkHKActBeABC/6h+nz4LPjN+QD9AAHTBIQHYggvBy4EFgDn+6v4NPfm9576uP4zA/YGDAnsCJUGkgLc/Zz54vZh9kL4FfzvAKAF/AgqCtYITQVmAFX7W/d49Sv2Ufkq/ocDFgizCrIKCQhaA8f9sPhY9Zr0rfYW+8QAUwZiCuoLgwp9BtAA3voh9sjzb/T194T9wAMgCUwMdQyJCTgEzv3d9+Dz2fIR9QT6fwDsBrMLoQ00DL4HUgGC+v30JPKy8o32yPzeAxAK1A01DhILKwXu/ST3evIf8W/z4PghAGsH7wxMD+YNDQnrAUH68fOP8PjwGfX2++ED6ApKD+4PowwxBin+hfYq8W/vyfGs96r/zgcTDusQmQ9pCpwCGvr+8gvvQu+d8xD7ygOkC60QoBE5DkcHff4C9u/vy+0i8Gr2HP8WCCAPeRJIEc8LYgMP+iXyme2S7RnyF/qYA0YM+hFHE9IPbgjp/p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&&typeof Notification<`u`&&Notification.permission===`granted`)try{new Notification(Ae??`Timer done`,{body:je??(typeof b==`string`?b:void 0)})}catch{}}A!==`completed`&&(L.current=!1)},[A]),o(()=>{if(!z.current){z.current=!0;return}let e=p*1e3;I.current=e,B(e),L.current=!1,H(),pe&&V(m?`running`:`idle`)},[p]),o(()=>{if(!C||A!==`running`||ue())return;function e(){let e=++Ve.current;N(t=>[...t,e])}e();let t=setInterval(e,ce);return()=>clearInterval(t)},[C,A]);function He(e){N(t=>t.filter(t=>t!==e))}function Ue(){E&&!R.current&&typeof Notification<`u`&&Notification.permission==="default"&&(R.current=!0,Notification.requestPermission().catch(()=>{}))}function U(){Ue(),(F.current===`completed`||F.current===`cancelled`)&&(B(I.current),L.current=!1),H(),V(`running`),he?.()}function W(){F.current===`running`&&(V(`paused`),ge?.())}function G(){F.current===`paused`&&(H(),V(`running`),_e?.())}function K(e){let t=y==null?1/0:y*1e3,n=Math.min(P.current+e*1e3,t);B(n),H(),g?.(e,Math.round(n/1e3)),F.current===`completed`&&n>0&&(L.current=!1,V(`running`))}function q(e){let t=Math.max(0,P.current-e*1e3);B(t),H(),ye?.(e,Math.round(t/1e3)),t<=0&&F.current===`running`&&V(`completed`)}function J(){B(I.current),V(`cancelled`),ve?.()}function We(){B(I.current),L.current=!1,V(`idle`)}ee(fe,()=>({start:U,pause:W,resume:G,addTime:K,removeTime:q,cancel:J,reset:We,getStatus:()=>F.current,getRemainingMs:()=>P.current}));let Y=50-S/2,X=te(()=>2*Math.PI*Y,[Y]),Ge=X*(1-(I.current>0?Math.min(1,j/I.current):0)),Z=Math.max(I.current*Ee,De*1e3),Q=A===`running`&&j<=Z,Ke=Q&&j<=Math.min(5e3,Z),$=A===`paused`,qe=_&&!be,Je=_&&!xe,Ye=_&&!Se,Xe=A===`running`?re:ie,Ze=A===`running`?`Pause`:$?`Resume`:A===`idle`?`Start`:`Restart`,Qe=A===`running`?W:$?G:U,$e=_&&!Ce;return d(`div`,{...Fe,className:l(a.timer,Oe&&Q&&a.timerPulsing,Ke&&a.timerCritical,Me,D?.root),style:{...x?{"--timer-size":x}:null,"--timer-stroke-width":`${S}px`,...Ne,...O?.root},children:[d(`div`,{className:l(a.timerRingWrapper,D?.ringWrapper),style:O?.ringWrapper,children:[M.length>0&&u(`div`,{className:l(a.timerRipples,D?.ripples),style:O?.ripples,children:M.map(e=>u(`span`,{className:l(a.timerRipple,D?.ripple),style:O?.ripple,onAnimationEnd:()=>He(e)},e))}),d(`svg`,{className:l(a.timerRingSvg,D?.ringSvg),viewBox:`0 0 100 100`,style:O?.ringSvg,children:[u(`circle`,{className:l(a.timerRingTrack,D?.ringTrack),cx:`50`,cy:`50`,r:Y,style:O?.ringTrack}),u(`circle`,{className:l(a.timerRingProgress,Q&&a.timerRingProgressUrgent,D?.ringProgress),cx:`50`,cy:`50`,r:Y,strokeDasharray:X,strokeDashoffset:Ge,style:{transition:$?`none`:void 0,transform:Te?`rotate(-90deg)`:void 0,...O?.ringProgress}})]}),d(`div`,{className:l(a.timerDisplay,D?.display),style:O?.display,children:[u(`span`,{className:l(a.timerTime,D?.time),style:O?.time,children:we(j)}),b&&u(`span`,{className:l(a.timerLabel,D?.label),style:O?.label,children:b})]})]}),_&&d(`div`,{className:l(a.timerControls,D?.controls),style:O?.controls,children:[d(`div`,{className:a.timerControlsRow,children:[Je&&u(i,{icon:ne,title:`Remove ${v}s`,onClick:()=>q(v),className:l(a.timerAdjustButton,D?.removeButton),style:O?.removeButton}),Ye&&u(r,{size:n.Small,icon:Xe,title:Ze,onClick:Qe,className:D?.pauseButton,style:O?.pauseButton}),qe&&u(i,{icon:ae,title:`Add ${v}s`,onClick:()=>K(v),className:l(a.timerAdjustButton,D?.addButton),style:O?.addButton})]}),$e&&u(i,{icon:oe,title:Ie.cancel,onClick:J,className:l(a.timerCancelButton,D?.cancelButton),style:O?.cancelButton})]})]})}export{f as default};
2
2
  //# sourceMappingURL=timer.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"timer.mjs","names":[],"sources":["../../../../package/common/timer/timer.tsx"],"sourcesContent":["import { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';\nimport cx from 'classnames';\nimport { faPlus, faMinus, faPause, faPlay, faXmark } from '@fortawesome/free-solid-svg-icons';\n\nimport ActionIcon from '../actionIcon';\nimport Button from '../button';\nimport { ButtonSize } from '../button/button.types';\nimport { useComponentDefaults, useLabels } from '../configProvider';\nimport { DEFAULT_CHIME_DATA_URI } from './timer.chime';\nimport type { TimerLabels, TimerProps, TimerStatus } from './timer.types';\nimport styles from './timer.module.pcss';\n\nconst TICK_MS = 200;\nconst RIPPLE_SPAWN_INTERVAL_MS = 1000;\n\nconst DEFAULT_LABELS: Required<TimerLabels> = {\n cancel: 'Cancel timer',\n};\n\nfunction prefersReducedMotion(): boolean {\n return typeof window !== 'undefined' && window.matchMedia?.('(prefers-reduced-motion: reduce)').matches === true;\n}\n\nfunction formatTimeDefault(remainingMs: number) {\n const totalSeconds = Math.ceil(remainingMs / 1000);\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor((totalSeconds % 3600) / 60);\n const seconds = totalSeconds % 60;\n const mm = String(minutes).padStart(2, '0');\n const ss = String(seconds).padStart(2, '0');\n return hours > 0 ? `${hours}:${mm}:${ss}` : `${mm}:${ss}`;\n}\n\nfunction Timer(props: TimerProps) {\n const {\n ref,\n durationSeconds,\n autoStart = true,\n resetOnDurationChange = true,\n\n onTick,\n onComplete,\n onStart,\n onPause,\n onResume,\n onCancel,\n onAddTime,\n onRemoveTime,\n\n showControls = true,\n hideAddButton = false,\n hideRemoveButton = false,\n hidePauseButton = false,\n hideCancelButton = false,\n adjustSeconds = 30,\n maxSeconds,\n\n label,\n formatTime = formatTimeDefault,\n size,\n strokeWidth = 10,\n counterClockwise = false,\n\n urgentThreshold = 0.1,\n urgentMinSeconds = 3,\n pulseOnUrgent = true,\n showRunningRipples = false,\n\n playSoundOnComplete = false,\n soundUrl,\n soundVolume = 0.5,\n notifyOnComplete = false,\n notificationTitle,\n notificationBody,\n\n className,\n style,\n classNames,\n styles: slotStyles,\n labels,\n ...rest\n } = useComponentDefaults('Timer', props);\n const text = useLabels('Timer', labels, DEFAULT_LABELS);\n\n const initialMs = durationSeconds * 1000;\n const [status, setStatusState] = useState<TimerStatus>(autoStart ? 'running' : 'idle');\n const [remainingMs, setRemainingMsState] = useState(initialMs);\n const [epoch, setEpoch] = useState(0);\n const [ripples, setRipples] = useState<number[]>([]);\n\n const remainingRef = useRef(remainingMs);\n const statusRef = useRef(status);\n const totalMsRef = useRef(initialMs);\n const completedFiredRef = useRef(false);\n const notifyPermissionRequestedRef = useRef(false);\n const mountedRef = useRef(false);\n const rippleIdRef = useRef(0);\n\n function setRemaining(next: number) {\n remainingRef.current = next;\n setRemainingMsState(next);\n }\n\n function setStatus(next: TimerStatus) {\n statusRef.current = next;\n setStatusState(next);\n }\n\n function bumpEpoch() {\n setEpoch((e) => e + 1);\n }\n\n // Ticking effect. Re-derives the remaining time from Date.now() every tick (rather than\n // accumulating setInterval's own drift), so it stays accurate over long countdowns. Any\n // external mutation of remainingRef (addTime/removeTime while already running, or a resume)\n // must bump `epoch` so this effect re-arms and re-captures a fresh start/startRemaining —\n // without that, a stale `startRemaining` captured before the mutation would silently\n // overwrite it on the next tick.\n useEffect(() => {\n if (status !== 'running') return undefined;\n const start = Date.now();\n const startRemaining = remainingRef.current;\n const id = setInterval(() => {\n const next = Math.max(0, startRemaining - (Date.now() - start));\n setRemaining(next);\n onTick?.(next);\n if (next <= 0) setStatus('completed');\n }, TICK_MS);\n return () => clearInterval(id);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [status, epoch]);\n\n // Fires onComplete exactly once per completion, plus the opt-in sound/notification.\n useEffect(() => {\n if (status === 'completed' && !completedFiredRef.current) {\n completedFiredRef.current = true;\n onComplete?.();\n if (playSoundOnComplete) {\n try {\n const audio = new Audio(soundUrl || DEFAULT_CHIME_DATA_URI);\n audio.volume = soundVolume;\n // play() can reject (autoplay policy) or, in some environments, return undefined\n // instead of a Promise — never let a blocked/unsupported playback surface as an error.\n audio.play()?.catch(() => {});\n } catch {\n // Audio unavailable/unsupported — fail silently.\n }\n }\n if (notifyOnComplete && typeof Notification !== 'undefined' && Notification.permission === 'granted') {\n try {\n new Notification(notificationTitle ?? 'Timer done', {\n body: notificationBody ?? (typeof label === 'string' ? label : undefined),\n });\n } catch {\n // Some browsers (e.g. certain mobile Safari versions) throw constructing\n // Notification outside specific contexts — fail silently, as documented.\n }\n }\n }\n if (status !== 'completed') completedFiredRef.current = false;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [status]);\n\n // durationSeconds prop change: reset (and optionally restart) at the new duration. Skips\n // the initial mount, since autoStart/initial state already cover that.\n useEffect(() => {\n if (!mountedRef.current) {\n mountedRef.current = true;\n return;\n }\n const nextMs = durationSeconds * 1000;\n totalMsRef.current = nextMs;\n setRemaining(nextMs);\n completedFiredRef.current = false;\n bumpEpoch();\n if (resetOnDurationChange) {\n setStatus(autoStart ? 'running' : 'idle');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [durationSeconds]);\n\n // Running-ripple spawner: spawns a new ripple roughly every RIPPLE_SPAWN_INTERVAL_MS while\n // running, each animating once (via CSS, `forwards`) and removing itself on `onAnimationEnd`.\n // Pausing (or otherwise leaving `running`) only stops new spawns here — it doesn't touch\n // `ripples` — so whichever ripples are already mid-flight keep animating to completion\n // instead of vanishing mid-cycle.\n useEffect(() => {\n if (!showRunningRipples || status !== 'running' || prefersReducedMotion()) return undefined;\n function spawnRipple() {\n rippleIdRef.current += 1;\n setRipples((prev) => [...prev, rippleIdRef.current]);\n }\n spawnRipple();\n const id = setInterval(spawnRipple, RIPPLE_SPAWN_INTERVAL_MS);\n return () => clearInterval(id);\n }, [showRunningRipples, status]);\n\n function handleRippleAnimationEnd(id: number) {\n setRipples((prev) => prev.filter((existingId) => existingId !== id));\n }\n\n function requestNotificationPermissionIfNeeded() {\n if (!notifyOnComplete || notifyPermissionRequestedRef.current) return;\n if (typeof Notification === 'undefined' || Notification.permission !== 'default') return;\n notifyPermissionRequestedRef.current = true;\n Notification.requestPermission().catch(() => {});\n }\n\n function start() {\n requestNotificationPermissionIfNeeded();\n if (statusRef.current === 'completed' || statusRef.current === 'cancelled') {\n setRemaining(totalMsRef.current);\n completedFiredRef.current = false;\n }\n bumpEpoch();\n setStatus('running');\n onStart?.();\n }\n\n function pause() {\n if (statusRef.current !== 'running') return;\n setStatus('paused');\n onPause?.();\n }\n\n function resume() {\n if (statusRef.current !== 'paused') return;\n bumpEpoch();\n setStatus('running');\n onResume?.();\n }\n\n function addTime(seconds: number) {\n const capped = maxSeconds != null ? maxSeconds * 1000 : Infinity;\n const next = Math.min(remainingRef.current + seconds * 1000, capped);\n setRemaining(next);\n bumpEpoch();\n onAddTime?.(seconds, Math.round(next / 1000));\n if (statusRef.current === 'completed' && next > 0) {\n completedFiredRef.current = false;\n setStatus('running');\n }\n }\n\n function removeTime(seconds: number) {\n const next = Math.max(0, remainingRef.current - seconds * 1000);\n setRemaining(next);\n bumpEpoch();\n onRemoveTime?.(seconds, Math.round(next / 1000));\n if (next <= 0 && statusRef.current === 'running') setStatus('completed');\n }\n\n function cancel() {\n setRemaining(totalMsRef.current);\n setStatus('cancelled');\n onCancel?.();\n }\n\n function reset() {\n setRemaining(totalMsRef.current);\n completedFiredRef.current = false;\n setStatus('idle');\n }\n\n useImperativeHandle(ref, () => ({\n start,\n pause,\n resume,\n addTime,\n removeTime,\n cancel,\n reset,\n getStatus: () => statusRef.current,\n getRemainingMs: () => remainingRef.current,\n }));\n\n const radius = 50 - strokeWidth / 2;\n const circumference = useMemo(() => 2 * Math.PI * radius, [radius]);\n const clampedFraction = totalMsRef.current > 0 ? Math.min(1, remainingMs / totalMsRef.current) : 0;\n const dashOffset = circumference * (1 - clampedFraction);\n const urgentMs = Math.max(totalMsRef.current * urgentThreshold, urgentMinSeconds * 1000);\n const isUrgent = status === 'running' && remainingMs <= urgentMs;\n const isCritical = isUrgent && remainingMs <= Math.min(5000, urgentMs);\n const isPaused = status === 'paused';\n\n // The pause button doubles as a play/restart button whenever there's nothing to pause —\n // idle (autoStart={false}), completed, or cancelled — rather than hiding itself, so there's\n // always a way to (re)start the countdown from the built-in controls alone.\n const showAddButton = showControls && !hideAddButton;\n const showRemoveButton = showControls && !hideRemoveButton;\n const showPauseButton = showControls && !hidePauseButton;\n const pauseButtonIcon = status === 'running' ? faPause : faPlay;\n const pauseButtonTitle =\n status === 'running' ? 'Pause' : isPaused ? 'Resume' : status === 'idle' ? 'Start' : 'Restart';\n const handlePauseButtonClick = status === 'running' ? pause : isPaused ? resume : start;\n const showCancelButton = showControls && !hideCancelButton;\n\n return (\n <div\n {...rest}\n className={cx(\n styles.timer,\n pulseOnUrgent && isUrgent && styles.timerPulsing,\n isCritical && styles.timerCritical,\n className,\n classNames?.root,\n )}\n style={\n {\n ...(size ? { '--timer-size': size } : null),\n '--timer-stroke-width': `${strokeWidth}px`,\n ...style,\n ...slotStyles?.root,\n } as React.CSSProperties\n }\n >\n <div className={cx(styles.timerRingWrapper, classNames?.ringWrapper)} style={slotStyles?.ringWrapper}>\n {ripples.length > 0 && (\n <div className={cx(styles.timerRipples, classNames?.ripples)} style={slotStyles?.ripples}>\n {ripples.map((id) => (\n <span\n key={id}\n className={cx(styles.timerRipple, classNames?.ripple)}\n style={slotStyles?.ripple}\n onAnimationEnd={() => handleRippleAnimationEnd(id)}\n />\n ))}\n </div>\n )}\n <svg className={cx(styles.timerRingSvg, classNames?.ringSvg)} viewBox='0 0 100 100' style={slotStyles?.ringSvg}>\n <circle\n className={cx(styles.timerRingTrack, classNames?.ringTrack)}\n cx='50'\n cy='50'\n r={radius}\n style={slotStyles?.ringTrack}\n />\n <circle\n className={cx(\n styles.timerRingProgress,\n isUrgent && styles.timerRingProgressUrgent,\n classNames?.ringProgress,\n )}\n cx='50'\n cy='50'\n r={radius}\n strokeDasharray={circumference}\n strokeDashoffset={dashOffset}\n style={{\n transition: isPaused ? 'none' : undefined,\n transform: counterClockwise ? 'rotate(-90deg)' : undefined,\n ...slotStyles?.ringProgress,\n }}\n />\n </svg>\n <div className={cx(styles.timerDisplay, classNames?.display)} style={slotStyles?.display}>\n <span className={cx(styles.timerTime, classNames?.time)} style={slotStyles?.time}>\n {formatTime(remainingMs)}\n </span>\n {label && (\n <span className={cx(styles.timerLabel, classNames?.label)} style={slotStyles?.label}>\n {label}\n </span>\n )}\n </div>\n </div>\n\n {showControls && (\n <div className={cx(styles.timerControls, classNames?.controls)} style={slotStyles?.controls}>\n <div className={styles.timerControlsRow}>\n {showRemoveButton && (\n <ActionIcon\n icon={faMinus}\n title={`Remove ${adjustSeconds}s`}\n onClick={() => removeTime(adjustSeconds)}\n className={cx(styles.timerAdjustButton, classNames?.removeButton)}\n style={slotStyles?.removeButton}\n />\n )}\n {showPauseButton && (\n <Button\n size={ButtonSize.Small}\n icon={pauseButtonIcon}\n title={pauseButtonTitle}\n onClick={handlePauseButtonClick}\n className={classNames?.pauseButton}\n style={slotStyles?.pauseButton}\n />\n )}\n {showAddButton && (\n <ActionIcon\n icon={faPlus}\n title={`Add ${adjustSeconds}s`}\n onClick={() => addTime(adjustSeconds)}\n className={cx(styles.timerAdjustButton, classNames?.addButton)}\n style={slotStyles?.addButton}\n />\n )}\n </div>\n {showCancelButton && (\n <ActionIcon\n icon={faXmark}\n title={text.cancel}\n onClick={cancel}\n className={cx(styles.timerCancelButton, classNames?.cancelButton)}\n style={slotStyles?.cancelButton}\n />\n )}\n </div>\n )}\n </div>\n );\n}\n\nexport default Timer;\n"],"mappings":"koBAYA,IAAM,GAAU,IACV,GAA2B,IAE3B,GAAwC,CAC5C,OAAQ,cACV,EAEA,SAAS,IAAgC,CACvC,OAAO,OAAO,OAAW,KAAe,OAAO,aAAa,kCAAkC,CAAC,CAAC,UAAY,EAC9G,CAEA,SAAS,GAAkB,EAAqB,CAC9C,IAAM,EAAe,KAAK,KAAK,EAAc,GAAI,EAC3C,EAAQ,K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,YAAe,EAAW,CAAa,EACvC,UAAW,EAAG,EAAO,kBAAmB,GAAY,YAAY,EAChE,MAAO,GAAY,YACpB,CAAA,EAEF,IACC,EAAC,EAAD,CACE,KAAM,EAAW,MACjB,KAAM,GACN,MAAO,GACP,QAAS,GACT,UAAW,GAAY,YACvB,MAAO,GAAY,WACpB,CAAA,EAEF,IACC,EAAC,EAAD,CACE,KAAM,GACN,MAAO,OAAO,EAAc,GAC5B,YAAe,EAAQ,CAAa,EACpC,UAAW,EAAG,EAAO,kBAAmB,GAAY,SAAS,EAC7D,MAAO,GAAY,SACpB,CAAA,CAEA,CACJ,CAAA,EAAA,IACC,EAAC,EAAD,CACE,KAAM,GACN,MAAO,GAAK,OACZ,QAAS,EACT,UAAW,EAAG,EAAO,kBAAmB,GAAY,YAAY,EAChE,MAAO,GAAY,YACpB,CAAA,CAEA,CAEJ,CAAA,CAAA,GAET"}
1
+ {"version":3,"file":"timer.mjs","names":[],"sources":["../../../../package/common/timer/timer.tsx"],"sourcesContent":["import { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';\nimport cx from 'classnames';\nimport { faPlus, faMinus, faPause, faPlay, faXmark } from '@fortawesome/free-solid-svg-icons';\n\nimport ActionIcon from '../actionIcon';\nimport Button from '../button';\nimport { ButtonSize } from '../button/button.types';\nimport { useComponentDefaults, useLabels } from '../configProvider';\nimport { DEFAULT_CHIME_DATA_URI } from './timer.chime';\nimport type { TimerLabels, TimerProps, TimerStatus } from './timer.types';\nimport styles from './timer.module.pcss';\n\nconst TICK_MS = 200;\nconst RIPPLE_SPAWN_INTERVAL_MS = 1000;\n\nconst DEFAULT_LABELS: Required<TimerLabels> = {\n cancel: 'Cancel timer',\n};\n\nfunction prefersReducedMotion(): boolean {\n return typeof window !== 'undefined' && window.matchMedia?.('(prefers-reduced-motion: reduce)').matches === true;\n}\n\nfunction formatTimeDefault(remainingMs: number) {\n const totalSeconds = Math.ceil(remainingMs / 1000);\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor((totalSeconds % 3600) / 60);\n const seconds = totalSeconds % 60;\n const mm = String(minutes).padStart(2, '0');\n const ss = String(seconds).padStart(2, '0');\n return hours > 0 ? `${hours}:${mm}:${ss}` : `${mm}:${ss}`;\n}\n\nfunction Timer(props: TimerProps) {\n const {\n ref,\n durationSeconds,\n autoStart = true,\n resetOnDurationChange = true,\n\n onTick,\n onComplete,\n onStart,\n onPause,\n onResume,\n onCancel,\n onAddTime,\n onRemoveTime,\n\n showControls = true,\n hideAddButton = false,\n hideRemoveButton = false,\n hidePauseButton = false,\n hideCancelButton = false,\n adjustSeconds = 30,\n maxSeconds,\n\n label,\n formatTime = formatTimeDefault,\n size,\n strokeWidth = 10,\n counterClockwise = false,\n\n urgentThreshold = 0.1,\n urgentMinSeconds = 3,\n pulseOnUrgent = true,\n showRunningRipples = false,\n\n playSoundOnComplete = false,\n soundUrl,\n soundVolume = 0.5,\n notifyOnComplete = false,\n notificationTitle,\n notificationBody,\n\n className,\n style,\n classNames,\n styles: slotStyles,\n labels,\n ...rest\n } = useComponentDefaults('Timer', props);\n const text = useLabels('Timer', labels, DEFAULT_LABELS);\n\n const initialMs = durationSeconds * 1000;\n const [status, setStatusState] = useState<TimerStatus>(autoStart ? 'running' : 'idle');\n const [remainingMs, setRemainingMsState] = useState(initialMs);\n const [epoch, setEpoch] = useState(0);\n const [ripples, setRipples] = useState<number[]>([]);\n\n const remainingRef = useRef(remainingMs);\n const statusRef = useRef(status);\n const totalMsRef = useRef(initialMs);\n const completedFiredRef = useRef(false);\n const notifyPermissionRequestedRef = useRef(false);\n const mountedRef = useRef(false);\n const rippleIdRef = useRef(0);\n\n function setRemaining(next: number) {\n remainingRef.current = next;\n setRemainingMsState(next);\n }\n\n function setStatus(next: TimerStatus) {\n statusRef.current = next;\n setStatusState(next);\n }\n\n function bumpEpoch() {\n setEpoch((e) => e + 1);\n }\n\n // Ticking effect. Re-derives the remaining time from Date.now() every tick (rather than\n // accumulating setInterval's own drift), so it stays accurate over long countdowns. Any\n // external mutation of remainingRef (addTime/removeTime while already running, or a resume)\n // must bump `epoch` so this effect re-arms and re-captures a fresh start/startRemaining —\n // without that, a stale `startRemaining` captured before the mutation would silently\n // overwrite it on the next tick.\n useEffect(() => {\n if (status !== 'running') return undefined;\n const start = Date.now();\n const startRemaining = remainingRef.current;\n const id = setInterval(() => {\n const next = Math.max(0, startRemaining - (Date.now() - start));\n setRemaining(next);\n onTick?.(next);\n if (next <= 0) setStatus('completed');\n }, TICK_MS);\n return () => clearInterval(id);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [status, epoch]);\n\n // Fires onComplete exactly once per completion, plus the opt-in sound/notification.\n useEffect(() => {\n if (status === 'completed' && !completedFiredRef.current) {\n completedFiredRef.current = true;\n onComplete?.();\n if (playSoundOnComplete) {\n try {\n const audio = new Audio(soundUrl || DEFAULT_CHIME_DATA_URI);\n audio.volume = soundVolume;\n // play() can reject (autoplay policy) or, in some environments, return undefined\n // instead of a Promise — never let a blocked/unsupported playback surface as an error.\n audio.play()?.catch(() => {});\n } catch {\n // Audio unavailable/unsupported — fail silently.\n }\n }\n if (notifyOnComplete && typeof Notification !== 'undefined' && Notification.permission === 'granted') {\n try {\n new Notification(notificationTitle ?? 'Timer done', {\n body: notificationBody ?? (typeof label === 'string' ? label : undefined),\n });\n } catch {\n // Some browsers (e.g. certain mobile Safari versions) throw constructing\n // Notification outside specific contexts — fail silently, as documented.\n }\n }\n }\n if (status !== 'completed') completedFiredRef.current = false;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [status]);\n\n // durationSeconds prop change: reset (and optionally restart) at the new duration. Skips\n // the initial mount, since autoStart/initial state already cover that.\n useEffect(() => {\n if (!mountedRef.current) {\n mountedRef.current = true;\n return;\n }\n const nextMs = durationSeconds * 1000;\n totalMsRef.current = nextMs;\n setRemaining(nextMs);\n completedFiredRef.current = false;\n bumpEpoch();\n if (resetOnDurationChange) {\n setStatus(autoStart ? 'running' : 'idle');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [durationSeconds]);\n\n // Running-ripple spawner: spawns a new ripple roughly every RIPPLE_SPAWN_INTERVAL_MS while\n // running, each animating once (via CSS, `forwards`) and removing itself on `onAnimationEnd`.\n // Pausing (or otherwise leaving `running`) only stops new spawns here — it doesn't touch\n // `ripples` — so whichever ripples are already mid-flight keep animating to completion\n // instead of vanishing mid-cycle.\n useEffect(() => {\n if (!showRunningRipples || status !== 'running' || prefersReducedMotion()) return undefined;\n function spawnRipple() {\n // Read now, not in the updater: two spawns before a render would both see the later id.\n const rippleId = ++rippleIdRef.current;\n setRipples((prev) => [...prev, rippleId]);\n }\n spawnRipple();\n const id = setInterval(spawnRipple, RIPPLE_SPAWN_INTERVAL_MS);\n return () => clearInterval(id);\n }, [showRunningRipples, status]);\n\n function handleRippleAnimationEnd(id: number) {\n setRipples((prev) => prev.filter((existingId) => existingId !== id));\n }\n\n function requestNotificationPermissionIfNeeded() {\n if (!notifyOnComplete || notifyPermissionRequestedRef.current) return;\n if (typeof Notification === 'undefined' || Notification.permission !== 'default') return;\n notifyPermissionRequestedRef.current = true;\n Notification.requestPermission().catch(() => {});\n }\n\n function start() {\n requestNotificationPermissionIfNeeded();\n if (statusRef.current === 'completed' || statusRef.current === 'cancelled') {\n setRemaining(totalMsRef.current);\n completedFiredRef.current = false;\n }\n bumpEpoch();\n setStatus('running');\n onStart?.();\n }\n\n function pause() {\n if (statusRef.current !== 'running') return;\n setStatus('paused');\n onPause?.();\n }\n\n function resume() {\n if (statusRef.current !== 'paused') return;\n bumpEpoch();\n setStatus('running');\n onResume?.();\n }\n\n function addTime(seconds: number) {\n const capped = maxSeconds != null ? maxSeconds * 1000 : Infinity;\n const next = Math.min(remainingRef.current + seconds * 1000, capped);\n setRemaining(next);\n bumpEpoch();\n onAddTime?.(seconds, Math.round(next / 1000));\n if (statusRef.current === 'completed' && next > 0) {\n completedFiredRef.current = false;\n setStatus('running');\n }\n }\n\n function removeTime(seconds: number) {\n const next = Math.max(0, remainingRef.current - seconds * 1000);\n setRemaining(next);\n bumpEpoch();\n onRemoveTime?.(seconds, Math.round(next / 1000));\n if (next <= 0 && statusRef.current === 'running') setStatus('completed');\n }\n\n function cancel() {\n setRemaining(totalMsRef.current);\n setStatus('cancelled');\n onCancel?.();\n }\n\n function reset() {\n setRemaining(totalMsRef.current);\n completedFiredRef.current = false;\n setStatus('idle');\n }\n\n useImperativeHandle(ref, () => ({\n start,\n pause,\n resume,\n addTime,\n removeTime,\n cancel,\n reset,\n getStatus: () => statusRef.current,\n getRemainingMs: () => remainingRef.current,\n }));\n\n const radius = 50 - strokeWidth / 2;\n const circumference = useMemo(() => 2 * Math.PI * radius, [radius]);\n const clampedFraction = totalMsRef.current > 0 ? Math.min(1, remainingMs / totalMsRef.current) : 0;\n const dashOffset = circumference * (1 - clampedFraction);\n const urgentMs = Math.max(totalMsRef.current * urgentThreshold, urgentMinSeconds * 1000);\n const isUrgent = status === 'running' && remainingMs <= urgentMs;\n const isCritical = isUrgent && remainingMs <= Math.min(5000, urgentMs);\n const isPaused = status === 'paused';\n\n // The pause button doubles as a play/restart button whenever there's nothing to pause —\n // idle (autoStart={false}), completed, or cancelled — rather than hiding itself, so there's\n // always a way to (re)start the countdown from the built-in controls alone.\n const showAddButton = showControls && !hideAddButton;\n const showRemoveButton = showControls && !hideRemoveButton;\n const showPauseButton = showControls && !hidePauseButton;\n const pauseButtonIcon = status === 'running' ? faPause : faPlay;\n const pauseButtonTitle =\n status === 'running' ? 'Pause' : isPaused ? 'Resume' : status === 'idle' ? 'Start' : 'Restart';\n const handlePauseButtonClick = status === 'running' ? pause : isPaused ? resume : start;\n const showCancelButton = showControls && !hideCancelButton;\n\n return (\n <div\n {...rest}\n className={cx(\n styles.timer,\n pulseOnUrgent && isUrgent && styles.timerPulsing,\n isCritical && styles.timerCritical,\n className,\n classNames?.root,\n )}\n style={\n {\n ...(size ? { '--timer-size': size } : null),\n '--timer-stroke-width': `${strokeWidth}px`,\n ...style,\n ...slotStyles?.root,\n } as React.CSSProperties\n }\n >\n <div className={cx(styles.timerRingWrapper, classNames?.ringWrapper)} style={slotStyles?.ringWrapper}>\n {ripples.length > 0 && (\n <div className={cx(styles.timerRipples, classNames?.ripples)} style={slotStyles?.ripples}>\n {ripples.map((id) => (\n <span\n key={id}\n className={cx(styles.timerRipple, classNames?.ripple)}\n style={slotStyles?.ripple}\n onAnimationEnd={() => handleRippleAnimationEnd(id)}\n />\n ))}\n </div>\n )}\n <svg className={cx(styles.timerRingSvg, classNames?.ringSvg)} viewBox='0 0 100 100' style={slotStyles?.ringSvg}>\n <circle\n className={cx(styles.timerRingTrack, classNames?.ringTrack)}\n cx='50'\n cy='50'\n r={radius}\n style={slotStyles?.ringTrack}\n />\n <circle\n className={cx(\n styles.timerRingProgress,\n isUrgent && styles.timerRingProgressUrgent,\n classNames?.ringProgress,\n )}\n cx='50'\n cy='50'\n r={radius}\n strokeDasharray={circumference}\n strokeDashoffset={dashOffset}\n style={{\n transition: isPaused ? 'none' : undefined,\n transform: counterClockwise ? 'rotate(-90deg)' : undefined,\n ...slotStyles?.ringProgress,\n }}\n />\n </svg>\n <div className={cx(styles.timerDisplay, classNames?.display)} style={slotStyles?.display}>\n <span className={cx(styles.timerTime, classNames?.time)} style={slotStyles?.time}>\n {formatTime(remainingMs)}\n </span>\n {label && (\n <span className={cx(styles.timerLabel, classNames?.label)} style={slotStyles?.label}>\n {label}\n </span>\n )}\n </div>\n </div>\n\n {showControls && (\n <div className={cx(styles.timerControls, classNames?.controls)} style={slotStyles?.controls}>\n <div className={styles.timerControlsRow}>\n {showRemoveButton && (\n <ActionIcon\n icon={faMinus}\n title={`Remove ${adjustSeconds}s`}\n onClick={() => removeTime(adjustSeconds)}\n className={cx(styles.timerAdjustButton, classNames?.removeButton)}\n style={slotStyles?.removeButton}\n />\n )}\n {showPauseButton && (\n <Button\n size={ButtonSize.Small}\n icon={pauseButtonIcon}\n title={pauseButtonTitle}\n onClick={handlePauseButtonClick}\n className={classNames?.pauseButton}\n style={slotStyles?.pauseButton}\n />\n )}\n {showAddButton && (\n <ActionIcon\n icon={faPlus}\n title={`Add ${adjustSeconds}s`}\n onClick={() => addTime(adjustSeconds)}\n className={cx(styles.timerAdjustButton, classNames?.addButton)}\n style={slotStyles?.addButton}\n />\n )}\n </div>\n {showCancelButton && (\n <ActionIcon\n icon={faXmark}\n title={text.cancel}\n onClick={cancel}\n className={cx(styles.timerCancelButton, classNames?.cancelButton)}\n style={slotStyles?.cancelButton}\n />\n )}\n </div>\n )}\n </div>\n );\n}\n\nexport default Timer;\n"],"mappings":"koBAYA,IAAM,GAAU,IACV,GAA2B,IAE3B,GAAwC,CAC5C,OAAQ,cACV,EAEA,SAAS,IAAgC,CACvC,OAAO,OAAO,OAAW,KAAe,OAAO,aAAa,kCAAkC,CAAC,CAAC,UAAY,EAC9G,CAEA,SAAS,GAAkB,EAAqB,CAC9C,IAAM,EAAe,KAAK,KAAK,EAAc,GAAI,EAC3C,EAAQ,KAAK,MAAM,EAAe,IAAI,EACtC,EAAU,KAAK,MAAO,EAAe,KAAQ,EAAE,EAC/C,EAAU,EAAe,GACzB,EAAK,OAAO,CAAO,CAAC,CAAC,SAAS,EAAG,GAAG,EACpC,EAAK,OAAO,CAAO,CAAC,CAAC,SAAS,EAAG,GAAG,EAC1C,OAAO,EAAQ,EAAI,GAAG,EAAM,GAAG,EAAG,GAAG,IAAO,GAAG,EAAG,GAAG,GACvD,CAEA,SAAS,EAAM,EAAmB,CAChC,GAAM,CACJ,OACA,kBACA,YAAY,GACZ,yBAAwB,GAExB,SACA,cACA,WACA,WACA,YACA,YACA,YACA,gBAEA,eAAe,GACf,iBAAgB,GAChB,oBAAmB,GACnB,mBAAkB,GAClB,oBAAmB,GACnB,gBAAgB,GAChB,aAEA,QACA,cAAa,GACb,OACA,cAAc,GACd,oBAAmB,GAEnB,mBAAkB,GAClB,oBAAmB,EACnB,iBAAgB,GAChB,qBAAqB,GAErB,sBAAsB,GACtB,WACA,eAAc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import t from"classnames";import{jsx as n,jsxs as r}from"react/jsx-runtime";var i=`M 26.3 62.9 C 15.4 65.0 15.0 48.5 27.8 49.8 C 23.9 43.9 34.2 34.0 43.0 39.6 C 46.0 26.2 73.9 32.0 68.9 46.3 C 85.0 44.3 84.6 64.2 72.4 62.5 Z`;function a(e,t,n,r){return{animationDuration:`${t}s`,animationDelay:`${e?n:-r*t}s`}}function o({className:r,delayed:a=!1}){return n(`path`,{className:t(e.weatherIconCloud,a&&e.weatherIconCloudDelayed,r),d:i})}var s=12;function c({className:t}){return r(`g`,{className:t,children:[n(`g`,{className:e.weatherIconSunRays,children:Array.from({length:s},(t,r)=>n(`g`,{transform:`rotate(${r/s*360} 50 50)`,children:n(`line`,{className:e.weatherIconSunRay,x1:50,y1:23,x2:50,y2:r%2==0?16:11})},r))}),n(`circle`,{className:e.weatherIconSunCore,cx:50,cy:50,r:18})]})}var l=[{x:74,y:32,size:2.2,duration:2.4,delay:0},{x:28,y:30,size:2.6,duration:3.1,delay:.4},{x:80,y:60,size:1.8,duration:2.7,delay:.9},{x:22,y:66,size:2.4,duration:3.6,delay:.2},{x:58,y:82,size:2,duration:2.9,delay:1.3},{x:34,y:80,size:2.5,duration:3.3,delay:.6}];function u({className:t}){return r(`g`,{className:t,children:[l.map(t=>n(`g`,{transform:`translate(${t.x}, ${t.y})`,children:n(`g`,{className:e.weatherIconStar,style:{animationDuration:`${t.duration}s`,animationDelay:`${t.delay}s`},children:n(`path`,{d:`M 0 ${-t.size} L 0 ${t.size} M ${-t.size} 0 L ${t.size} 0`})})},`${t.x}-${t.y}`)),n(`circle`,{className:e.weatherIconMoonCore,cx:50,cy:50,r:18})]})}var d=function(e){return e.Light=`light`,e.Medium=`medium`,e.Heavy=`heavy`,e}({}),f={light:{lanes:4,duration:1.5},medium:{lanes:6,duration:.95},heavy:{lanes:10,duration:.55}},p=[.85,1.1,.95,1.2,.9,1.05,1.15,.8,1,1.08],m=[.05,.62,.31,.85,.18,.5,.74,.1,.43,.95],h=2,g=.65;function _(e,t=m,n=.8){return .1+n*t[e%t.length]}function v({animated:t,intensity:i=`medium`}){let{lanes:o,duration:s}=f[i];return n(`g`,{className:e.weatherIconRain,children:Array.from({length:o},(i,c)=>{let l=26+50*c/(o-1),u=s*p[c],d=u*m[c];return Array.from({length:h},(i,o)=>{let s=a(t,u,d+o*u/h,_(c*h+o,m,g));return r(`g`,{children:[n(`line`,{className:e.weatherIconDrop,style:s,x1:l,y1:68,x2:l-2.4,y2:92}),n(`ellipse`,{className:e.weatherIconSplash,style:s,cx:l-2.4,cy:92,rx:`1.4`,ry:`0.7`})]},`${c}-${o}`)})})})}var y=[.65,1.5,.85,1.25,1.65,.75,1.1],b=[.15,.7,.35,.9,.05,.55,.8],x=7;function S({animated:t}){return n(`g`,{className:e.weatherIconSnow,children:Array.from({length:x},(r,i)=>{let o=24+54*i/6,s=7*y[i],c=s*b[i];return Array.from({length:h},(r,l)=>n(`g`,{transform:`translate(${o}, 68)`,children:n(`g`,{className:e.weatherIconFlake,style:a(t,s,c+l*s*.7,_(i*h+l,b)),children:n(`path`,{d:`M 0 -2 L 0 2 M -1.7 -1 L 1.7 1 M -1.7 1 L 1.7 -1`})})},`${i}-${l}`))})})}var C=[{x:34,y:66,dx:-1,dy:18,duration:.6,delay:.05},{x:47,y:68,dx:-2,dy:17,duration:.7,delay:.3},{x:58,y:65,dx:1,dy:18,duration:.55,delay:.15},{x:40,y:70,dx:-1,dy:16,duration:.75,delay:.45},{x:65,y:67,dx:-2,dy:17,duration:.65,delay:0},{x:52,y:71,dx:1,dy:16,duration:.7,delay:.35}];function w({animated:t}){let i=C.length*h;return n(`g`,{className:e.weatherIconHail,children:C.flatMap((o,s)=>Array.from({length:h},(c,l)=>{let u=s*h+l,d=a(t,o.duration,o.delay+l*o.duration/h,.1+.8*(u+.5)/i);return r(`g`,{children:[n(`g`,{transform:`translate(${o.x}, ${o.y})`,children:n(`g`,{className:e.weatherIconStone,style:{...d,"--weather-icon-dx":o.dx,"--weather-icon-dy":o.dy},children:n(`circle`,{r:`2`})})}),n(`ellipse`,{className:e.weatherIconImpact,style:d,cx:o.x+o.dx,cy:o.y+o.dy,rx:`1.8`,ry:`0.9`})]},u)}))})}function T(){return r(`g`,{className:e.weatherIconFog,children:[n(`line`,{x1:`32`,y1:`40`,x2:`68`,y2:`40`}),n(`line`,{x1:`20`,y1:`52`,x2:`80`,y2:`52`}),n(`line`,{x1:`26`,y1:`64`,x2:`74`,y2:`64`}),n(`line`,{x1:`34`,y1:`76`,x2:`66`,y2:`76`})]})}function E(){return n(`path`,{className:e.weatherIconBolt,d:`M 54 52 L 44 72 H 52 L 46 90 L 62 66 H 54 L 60 52 Z`})}export{i as CLOUD_PATH,o as Cloud,T as Fog,w as Hail,E as Lightning,u as Moon,v as Rain,d as RainIntensity,S as Snow,c as Sun};
2
+ //# sourceMappingURL=parts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parts.mjs","names":[],"sources":["../../../../package/common/weatherIcon/parts.tsx"],"sourcesContent":["import type { CSSProperties, ReactElement } from 'react';\nimport cx from 'classnames';\n\nimport type { WeatherPartProps } from './weatherIcon.types';\nimport styles from './weatherIcon.module.pcss';\n\n/** Exported so a scene can clip what sits behind the cloud to this same silhouette. */\nexport const CLOUD_PATH =\n 'M 26.3 62.9 C 15.4 65.0 15.0 48.5 27.8 49.8 C 23.9 43.9 34.2 34.0 43.0 39.6 C 46.0 26.2 73.9 32.0 68.9 46.3 C 85.0 44.3 84.6 64.2 72.4 62.5 Z';\n\n/**\n * A still frame of a falling part must not be its first one, which bunches every drop right under\n * the cloud. A negative delay on a paused animation freezes it that far into its cycle. The\n * fractions come from a jitter table rather than a ramp: lanes run left to right, so a ramp would\n * freeze them along one diagonal line.\n */\nfunction fallStyle(animated: boolean, duration: number, delay: number, freezeFraction: number): CSSProperties {\n return {\n animationDuration: `${duration}s`,\n animationDelay: `${animated ? delay : -freezeFraction * duration}s`,\n };\n}\n\nexport function Cloud({ className, delayed = false }: { className?: string; delayed?: boolean }): ReactElement {\n return (\n <path\n className={cx(styles.weatherIconCloud, delayed && styles.weatherIconCloudDelayed, className)}\n d={CLOUD_PATH}\n />\n );\n}\n\nconst RAY_COUNT = 12;\n\nexport function Sun({ className }: { className?: string }): ReactElement {\n return (\n <g className={className}>\n <g className={styles.weatherIconSunRays}>\n {Array.from({ length: RAY_COUNT }, (_, index) => (\n <g key={index} transform={`rotate(${(index / RAY_COUNT) * 360} 50 50)`}>\n {/* Every second ray reaches further. */}\n <line className={styles.weatherIconSunRay} x1={50} y1={23} x2={50} y2={index % 2 === 0 ? 16 : 11} />\n </g>\n ))}\n </g>\n <circle className={styles.weatherIconSunCore} cx={50} cy={50} r={18} />\n </g>\n );\n}\n\n// Scattered at uneven distances as well as angles: at one distance they read as a ring.\nconst STARS = [\n { x: 74, y: 32, size: 2.2, duration: 2.4, delay: 0 },\n { x: 28, y: 30, size: 2.6, duration: 3.1, delay: 0.4 },\n { x: 80, y: 60, size: 1.8, duration: 2.7, delay: 0.9 },\n { x: 22, y: 66, size: 2.4, duration: 3.6, delay: 0.2 },\n { x: 58, y: 82, size: 2, duration: 2.9, delay: 1.3 },\n { x: 34, y: 80, size: 2.5, duration: 3.3, delay: 0.6 },\n];\n\nexport function Moon({ className }: { className?: string }): ReactElement {\n return (\n <g className={className}>\n {STARS.map((star) => (\n // The position sits on its own group: an animated `transform` would replace a static one.\n <g key={`${star.x}-${star.y}`} transform={`translate(${star.x}, ${star.y})`}>\n <g\n className={styles.weatherIconStar}\n style={{ animationDuration: `${star.duration}s`, animationDelay: `${star.delay}s` }}\n >\n <path d={`M 0 ${-star.size} L 0 ${star.size} M ${-star.size} 0 L ${star.size} 0`} />\n </g>\n </g>\n ))}\n <circle className={styles.weatherIconMoonCore} cx={50} cy={50} r={18} />\n </g>\n );\n}\n\nexport enum RainIntensity {\n Light = 'light',\n Medium = 'medium',\n Heavy = 'heavy',\n}\n\n// Density and speed rise together: speed alone reads as light rain on fast-forward.\nconst RAIN = {\n [RainIntensity.Light]: { lanes: 4, duration: 1.5 },\n [RainIntensity.Medium]: { lanes: 6, duration: 0.95 },\n [RainIntensity.Heavy]: { lanes: 10, duration: 0.55 },\n};\n\nconst DURATION_JITTER = [0.85, 1.1, 0.95, 1.2, 0.9, 1.05, 1.15, 0.8, 1, 1.08];\nconst DELAY_JITTER = [0.05, 0.62, 0.31, 0.85, 0.18, 0.5, 0.74, 0.1, 0.43, 0.95];\nconst PER_LANE = 2;\n// A drop fades out from 80% of its fall, so a still frame keeps every drop short of that.\nconst RAIN_FREEZE_SPAN = 0.65;\n\nfunction freezeAt(index: number, jitter: number[] = DELAY_JITTER, span = 0.8): number {\n return 0.1 + span * jitter[index % jitter.length];\n}\n\nexport function Rain({\n animated,\n intensity = RainIntensity.Medium,\n}: WeatherPartProps & { intensity?: RainIntensity }): ReactElement {\n const { lanes, duration: base } = RAIN[intensity];\n return (\n <g className={styles.weatherIconRain}>\n {Array.from({ length: lanes }, (_, lane) => {\n const x1 = 26 + (50 * lane) / (lanes - 1);\n const duration = base * DURATION_JITTER[lane];\n const delay = duration * DELAY_JITTER[lane];\n return Array.from({ length: PER_LANE }, (_, drop) => {\n const style = fallStyle(\n animated,\n duration,\n delay + (drop * duration) / PER_LANE,\n freezeAt(lane * PER_LANE + drop, DELAY_JITTER, RAIN_FREEZE_SPAN),\n );\n return (\n <g key={`${lane}-${drop}`}>\n <line className={styles.weatherIconDrop} style={style} x1={x1} y1={68} x2={x1 - 2.4} y2={92} />\n <ellipse className={styles.weatherIconSplash} style={style} cx={x1 - 2.4} cy={92} rx='1.4' ry='0.7' />\n </g>\n );\n });\n })}\n </g>\n );\n}\n\n// A wide spread of speeds: with similar ones, flakes drift out of step so slowly that they spend\n// long stretches falling in a line.\nconst FLAKE_DURATION_JITTER = [0.65, 1.5, 0.85, 1.25, 1.65, 0.75, 1.1];\nconst FLAKE_DELAY_JITTER = [0.15, 0.7, 0.35, 0.9, 0.05, 0.55, 0.8];\nconst FLAKE_LANES = 7;\n\nexport function Snow({ animated }: WeatherPartProps): ReactElement {\n return (\n <g className={styles.weatherIconSnow}>\n {Array.from({ length: FLAKE_LANES }, (_, lane) => {\n const x = 24 + (54 * lane) / (FLAKE_LANES - 1);\n const duration = 7 * FLAKE_DURATION_JITTER[lane];\n const delay = duration * FLAKE_DELAY_JITTER[lane];\n return Array.from({ length: PER_LANE }, (_, flake) => (\n <g key={`${lane}-${flake}`} transform={`translate(${x}, 68)`}>\n <g\n className={styles.weatherIconFlake}\n style={fallStyle(\n animated,\n duration,\n delay + flake * duration * 0.7,\n freezeAt(lane * PER_LANE + flake, FLAKE_DELAY_JITTER),\n )}\n >\n <path d='M 0 -2 L 0 2 M -1.7 -1 L 1.7 1 M -1.7 1 L 1.7 -1' />\n </g>\n </g>\n ));\n })}\n </g>\n );\n}\n\n// `dx`/`dy` is where the stone first lands. The keyframe bounces it on from there, so every lane\n// shares one keyframe instead of having its own.\nconst HAIL_LANES = [\n { x: 34, y: 66, dx: -1, dy: 18, duration: 0.6, delay: 0.05 },\n { x: 47, y: 68, dx: -2, dy: 17, duration: 0.7, delay: 0.3 },\n { x: 58, y: 65, dx: 1, dy: 18, duration: 0.55, delay: 0.15 },\n { x: 40, y: 70, dx: -1, dy: 16, duration: 0.75, delay: 0.45 },\n { x: 65, y: 67, dx: -2, dy: 17, duration: 0.65, delay: 0 },\n { x: 52, y: 71, dx: 1, dy: 16, duration: 0.7, delay: 0.35 },\n];\n\nexport function Hail({ animated }: WeatherPartProps): ReactElement {\n const total = HAIL_LANES.length * PER_LANE;\n return (\n <g className={styles.weatherIconHail}>\n {HAIL_LANES.flatMap((lane, laneIndex) =>\n Array.from({ length: PER_LANE }, (_, stone) => {\n const index = laneIndex * PER_LANE + stone;\n const style = fallStyle(\n animated,\n lane.duration,\n lane.delay + (stone * lane.duration) / PER_LANE,\n 0.1 + (0.8 * (index + 0.5)) / total,\n );\n return (\n <g key={index}>\n <g transform={`translate(${lane.x}, ${lane.y})`}>\n <g\n className={styles.weatherIconStone}\n style={{ ...style, '--weather-icon-dx': lane.dx, '--weather-icon-dy': lane.dy } as CSSProperties}\n >\n <circle r='2' />\n </g>\n </g>\n <ellipse\n className={styles.weatherIconImpact}\n style={style}\n cx={lane.x + lane.dx}\n cy={lane.y + lane.dy}\n rx='1.8'\n ry='0.9'\n />\n </g>\n );\n }),\n )}\n </g>\n );\n}\n\nexport function Fog(): ReactElement {\n return (\n <g className={styles.weatherIconFog}>\n <line x1='32' y1='40' x2='68' y2='40' />\n <line x1='20' y1='52' x2='80' y2='52' />\n <line x1='26' y1='64' x2='74' y2='64' />\n <line x1='34' y1='76' x2='66' y2='76' />\n </g>\n );\n}\n\nexport function Lightning(): ReactElement {\n return <path className={styles.weatherIconBolt} d='M 54 52 L 44 72 H 52 L 46 90 L 62 66 H 54 L 60 52 Z' />;\n}\n"],"mappings":"iIAOA,IAAa,EACX,gJAQF,SAAS,EAAU,EAAmB,EAAkB,EAAe,EAAuC,CAC5G,MAAO,CACL,kBAAmB,GAAG,EAAS,GAC/B,eAAgB,GAAG,EAAW,EAAQ,CAAC,EAAiB,EAAS,EACnE,CACF,CAEA,SAAgB,EAAM,CAAE,YAAW,UAAU,IAAkE,CAC7G,OACE,EAAC,OAAD,CACE,UAAW,EAAG,EAAO,iBAAkB,GAAW,EAAO,wBAAyB,CAAS,EAC3F,EAAG,CACJ,CAAA,CAEL,CAEA,IAAM,EAAY,GAElB,SAAgB,EAAI,CAAE,aAAmD,CACvE,OACE,EAAC,IAAD,CAAc,YAAd,SAAA,CACE,EAAC,IAAD,CAAG,UAAW,EAAO,mBAClB,SAAA,MAAM,KAAK,CAAE,OAAQ,CAAU,GAAI,EAAG,IACrC,EAAC,IAAD,CAAe,UAAW,UAAW,EAAQ,EAAa,IAAI,SAE5D,SAAA,EAAC,OAAD,CAAM,UAAW,EAAO,kBAAmB,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,EAAQ,GAAM,EAAI,GAAK,EAAK,CAAA,CAClG,E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AAM,CAAA,CACtC,GAEP,CAEA,SAAgB,GAA0B,CACxC,OAAO,EAAC,OAAD,CAAM,UAAW,EAAO,gBAAiB,EAAE,qDAAuD,CAAA,CAC3G"}
@@ -0,0 +1,2 @@
1
+ "use client";import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import{useLabels as t}from"../configProvider/useLabels.mjs";import n from"../hooks/useMediaQuery.mjs";import{WeatherType as r}from"./weatherIcon.types.mjs";import i from"./weatherIcon.module.mjs";import{CLOUD_PATH as a,Cloud as o,Fog as s,Hail as c,Lightning as l,Moon as u,Rain as d,RainIntensity as f,Snow as p,Sun as m}from"./parts.mjs";import{useId as h}from"react";import g from"classnames";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";var b={[r.Sunny]:`Sunny`,[r.ClearNight]:`Clear night`,[r.Cloudy]:`Cloudy`,[r.PartlyCloudy]:`Partly cloudy`,[r.PartlyCloudyNight]:`Partly cloudy night`,[r.RainyLight]:`Light rain`,[r.Rainy]:`Rain`,[r.RainyHeavy]:`Heavy rain`,[r.Snowy]:`Snow`,[r.Hail]:`Hail`,[r.Foggy]:`Fog`,[r.Thunderstorm]:`Thunderstorm`};function x(x){let{type:S,size:C=64,animated:w=!0,labels:T,className:E,style:D,...O}=e(`WeatherIcon`,x),k=t(`WeatherIcon`,T,b),A=w&&!n(`(prefers-reduced-motion: reduce)`),j=`weather-icon-clip-${h().replace(/[^\w-]/g,``)}`,M=e=>v(`g`,{clipPath:`url(#${j})`,children:e});function N(){switch(S){case r.ClearNight:return v(u,{});case r.Cloudy:return y(_,{children:[M(v(`g`,{className:i.weatherIconCloudBehind,children:v(o,{delayed:!0})})),v(o,{})]});case r.PartlyCloudy:return y(_,{children:[M(v(m,{className:i.weatherIconBehind})),v(o,{})]});case r.PartlyCloudyNight:return y(_,{children:[M(v(u,{className:i.weatherIconBehind})),v(o,{})]});case r.RainyLight:case r.Rainy:case r.RainyHeavy:return y(_,{children:[v(o,{}),v(d,{animated:A,intensity:S===r.RainyLight?f.Light:S===r.RainyHeavy?f.Heavy:f.Medium})]});case r.Snowy:return y(_,{children:[v(o,{}),v(p,{animated:A})]});case r.Hail:return y(_,{children:[v(o,{}),v(c,{animated:A})]});case r.Foggy:return v(s,{});case r.Thunderstorm:return y(_,{children:[v(o,{}),M(v(l,{}))]});default:return v(m,{})}}return y(`svg`,{...O,role:`img`,"aria-label":k[S]??k[r.Sunny],className:g(i.weatherIcon,!A&&i.weatherIconStill,E),style:{width:C,height:C,...D},viewBox:`0 0 100 100`,children:[v(`defs`,{children:v(`clipPath`,{id:j,clipRule:`evenodd`,children:v(`path`,{d:`M -20 -20 H 120 V 120 H -20 Z ${a}`})})}),N()]})}export{x as default};
2
+ //# sourceMappingURL=weatherIcon.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weatherIcon.mjs","names":[],"sources":["../../../../package/common/weatherIcon/weatherIcon.tsx"],"sourcesContent":["import { useId, type ReactElement } from 'react';\nimport cx from 'classnames';\n\nimport { useComponentDefaults, useLabels } from '../configProvider';\nimport { useMediaQuery } from '../hooks/useMediaQuery';\nimport { WeatherType, type WeatherIconLabels, type WeatherIconProps } from './weatherIcon.types';\nimport { CLOUD_PATH, Cloud, Fog, Hail, Lightning, Moon, Rain, RainIntensity, Snow, Sun } from './parts';\nimport styles from './weatherIcon.module.pcss';\n\nconst DEFAULT_LABELS: Required<WeatherIconLabels> = {\n [WeatherType.Sunny]: 'Sunny',\n [WeatherType.ClearNight]: 'Clear night',\n [WeatherType.Cloudy]: 'Cloudy',\n [WeatherType.PartlyCloudy]: 'Partly cloudy',\n [WeatherType.PartlyCloudyNight]: 'Partly cloudy night',\n [WeatherType.RainyLight]: 'Light rain',\n [WeatherType.Rainy]: 'Rain',\n [WeatherType.RainyHeavy]: 'Heavy rain',\n [WeatherType.Snowy]: 'Snow',\n [WeatherType.Hail]: 'Hail',\n [WeatherType.Foggy]: 'Fog',\n [WeatherType.Thunderstorm]: 'Thunderstorm',\n};\n\nfunction WeatherIcon(props: WeatherIconProps): ReactElement {\n const {\n type,\n size = 64,\n animated = true,\n labels,\n className,\n style,\n ...rest\n } = useComponentDefaults('WeatherIcon', props);\n const text = useLabels('WeatherIcon', labels, DEFAULT_LABELS);\n const isAnimated = animated && !useMediaQuery('(prefers-reduced-motion: reduce)');\n // useId's characters are not all safe inside `url(#…)`, and they changed between React 19 minors.\n const clipId = `weather-icon-clip-${useId().replace(/[^\\w-]/g, '')}`;\n\n // The cloud is only an outline, so what sits behind it would show through without this.\n const behindCloud = (content: ReactElement) => <g clipPath={`url(#${clipId})`}>{content}</g>;\n\n function scene(): ReactElement {\n switch (type) {\n case WeatherType.ClearNight:\n return <Moon />;\n case WeatherType.Cloudy:\n return (\n <>\n {/* The offset sits on a wrapper: the cloud's own `transform` is animated and would replace it. */}\n {behindCloud(\n <g className={styles.weatherIconCloudBehind}>\n <Cloud delayed />\n </g>,\n )}\n <Cloud />\n </>\n );\n case WeatherType.PartlyCloudy:\n return (\n <>\n {behindCloud(<Sun className={styles.weatherIconBehind} />)}\n <Cloud />\n </>\n );\n case WeatherType.PartlyCloudyNight:\n return (\n <>\n {behindCloud(<Moon className={styles.weatherIconBehind} />)}\n <Cloud />\n </>\n );\n case WeatherType.RainyLight:\n case WeatherType.Rainy:\n case WeatherType.RainyHeavy:\n return (\n <>\n <Cloud />\n <Rain\n animated={isAnimated}\n intensity={\n type === WeatherType.RainyLight\n ? RainIntensity.Light\n : type === WeatherType.RainyHeavy\n ? RainIntensity.Heavy\n : RainIntensity.Medium\n }\n />\n </>\n );\n case WeatherType.Snowy:\n return (\n <>\n <Cloud />\n <Snow animated={isAnimated} />\n </>\n );\n case WeatherType.Hail:\n return (\n <>\n <Cloud />\n <Hail animated={isAnimated} />\n </>\n );\n case WeatherType.Foggy:\n return <Fog />;\n case WeatherType.Thunderstorm:\n return (\n <>\n <Cloud />\n {behindCloud(<Lightning />)}\n </>\n );\n default:\n return <Sun />;\n }\n }\n\n return (\n <svg\n {...rest}\n role='img'\n aria-label={text[type] ?? text[WeatherType.Sunny]}\n className={cx(styles.weatherIcon, !isAnimated && styles.weatherIconStill, className)}\n style={{ width: size, height: size, ...style }}\n viewBox='0 0 100 100'\n >\n <defs>\n {/* One path, both contours: two separate paths in a clipPath union instead of cutting a hole. */}\n <clipPath id={clipId} clipRule='evenodd'>\n <path d={`M -20 -20 H 120 V 120 H -20 Z ${CLOUD_PATH}`} />\n </clipPath>\n </defs>\n {scene()}\n </svg>\n );\n}\n\nexport default WeatherIcon;\n"],"mappings":"2iBASA,IAAM,EAA8C,EACjD,EAAY,OAAQ,SACpB,EAAY,YAAa,eACzB,EAAY,QAAS,UACrB,EAAY,cAAe,iBAC3B,EAAY,mBAAoB,uBAChC,EAAY,YAAa,cACzB,EAAY,OAAQ,QACpB,EAAY,YAAa,cACzB,EAAY,OAAQ,QACpB,EAAY,MAAO,QACnB,EAAY,OAAQ,OACpB,EAAY,cAAe,cAC9B,EAEA,SAAS,EAAY,EAAuC,CAC1D,GAAM,CACJ,OACA,OAAO,GACP,WAAW,GACX,SACA,YACA,QACA,GAAG,GACD,EAAqB,cAAe,CAAK,EACvC,EAAO,EAAU,cAAe,EAAQ,CAAc,EACtD,EAAa,GAAY,CAAC,EAAc,kCAAkC,EAE1E,EAAS,qBAAqB,EAAM,CAAC,CAAC,QAAQ,UAAW,EAAE,IAG3D,EAAe,GAA0B,EAAC,IAAD,CAAG,SAAU,QAAQ,EAAO,GAAK,SAAA,CAAW,CAAA,EAE3F,SAAS,GAAsB,CAC7B,OAAQ,EAAR,CACE,KAAK,EAAY,WACf,OAAO,EAAC,EAAD,CAAO,CAAA,EAChB,KAAK,EAAY,OACf,OACE,EAAA,EAAA,CAAA,SAAA,CAEG,EACC,EAAC,IAAD,CAAG,UAAW,EAAO,uBACnB,SAAA,EAAC,EAAD,CAAO,QAAA,EAAS,CAAA,CACf,CAAA,CACL,EACA,EAAC,EAAD,CAAQ,CAAA,CACR,CAAA,CAAA,EAEN,KAAK,EAAY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ACnF,MAAO,CAAE,MAAO,EAAM,OAAQ,EAAM,GAAG,CAAM,EAC7C,QAAQ,cANV,SAAA,CAQE,EAAC,OAAD,CAAA,SAEE,EAAC,WAAD,CAAU,GAAI,EAAQ,SAAS,UAC7B,SAAA,EAAC,OAAD,CAAM,EAAG,iCAAiC,GAAe,CAAA,CACjD,CAAA,CACN,CAAA,EACL,EAAM,CACJ,GAET"}
@@ -0,0 +1,2 @@
1
+ "use client";var e=`weatherIcon_FrcJF`,t=`weatherIcon-behind_e2VOz`,n=`weatherIcon-cloudBehind_MZlmZ`,r=`weatherIcon-cloud_KW-i7`,i=`weatherIconCloudDrift_0thIg`,a=`weatherIcon-cloudDelayed_bI1iH`,o=`weatherIcon-sunRays_PBW93`,s=`weatherIconRotate_Hp9YK`,c=`weatherIcon-sunRay_ODCJR`,l=`weatherIconRayPulse_57eG4`,u=`weatherIcon-sunCore_Ucxlh`,d=`weatherIcon-moonCore_USwOg`,f=`weatherIconGlow_W2Qxf`,p=`weatherIcon-star_3CMD1`,m=`weatherIconTwinkle_8DkMV`,h=`weatherIcon-rain_A9qFe`,g=`weatherIcon-drop_SdkW9`,_=`weatherIconFall_NlqDE`,v=`weatherIcon-splash_DF4Wc`,y=`weatherIconRing_kr1SP`,b=`weatherIcon-snow_95z-c`,x=`weatherIcon-flake_LGzkw`,S=`weatherIconSnowFall_I2EGa`,C=`weatherIcon-stone_U0daF`,w=`weatherIconHailFall_U-AE4`,T=`weatherIcon-impact_kCHtC`,E=`weatherIcon-fog_GC8wj`,D=`weatherIconSway_-CD1q`,O=`weatherIcon-bolt_S9sie`,k=`weatherIconFlash_GIecz`,A=`weatherIcon-still_lr-Nl`,j={weatherIcon:e,"weatherIcon-behind":`weatherIcon-behind_e2VOz`,weatherIconBehind:t,"weatherIcon-cloudBehind":`weatherIcon-cloudBehind_MZlmZ`,weatherIconCloudBehind:n,"weatherIcon-cloud":`weatherIcon-cloud_KW-i7`,weatherIconCloud:r,weatherIconCloudDrift:i,"weatherIcon-cloudDelayed":`weatherIcon-cloudDelayed_bI1iH`,weatherIconCloudDelayed:a,"weatherIcon-sunRays":`weatherIcon-sunRays_PBW93`,weatherIconSunRays:o,weatherIconRotate:s,"weatherIcon-sunRay":`weatherIcon-sunRay_ODCJR`,weatherIconSunRay:c,weatherIconRayPulse:l,"weatherIcon-sunCore":`weatherIcon-sunCore_Ucxlh`,weatherIconSunCore:u,"weatherIcon-moonCore":`weatherIcon-moonCore_USwOg`,weatherIconMoonCore:d,weatherIconGlow:f,"weatherIcon-star":`weatherIcon-star_3CMD1`,weatherIconStar:p,weatherIconTwinkle:m,"weatherIcon-rain":`weatherIcon-rain_A9qFe`,weatherIconRain:h,"weatherIcon-drop":`weatherIcon-drop_SdkW9`,weatherIconDrop:g,weatherIconFall:_,"weatherIcon-splash":`weatherIcon-splash_DF4Wc`,weatherIconSplash:v,weatherIconRing:y,"weatherIcon-snow":`weatherIcon-snow_95z-c`,weatherIconSnow:b,"weatherIcon-flake":`weatherIcon-flake_LGzkw`,weatherIconFlake:x,weatherIconSnowFall:S,"weatherIcon-stone":`weatherIcon-stone_U0daF`,weatherIconStone:C,weatherIconHailFall:w,"weatherIcon-impact":`weatherIcon-impact_kCHtC`,weatherIconImpact:T,"weatherIcon-fog":`weatherIcon-fog_GC8wj`,weatherIconFog:E,weatherIconSway:D,"weatherIcon-bolt":`weatherIcon-bolt_S9sie`,weatherIconBolt:O,weatherIconFlash:k,"weatherIcon-still":`weatherIcon-still_lr-Nl`,weatherIconStill:A};export{j as default,e as weatherIcon,t as weatherIconBehind,O as weatherIconBolt,r as weatherIconCloud,n as weatherIconCloudBehind,a as weatherIconCloudDelayed,i as weatherIconCloudDrift,g as weatherIconDrop,_ as weatherIconFall,x as weatherIconFlake,k as weatherIconFlash,E as weatherIconFog,f as weatherIconGlow,w as weatherIconHailFall,T as weatherIconImpact,d as weatherIconMoonCore,h as weatherIconRain,l as weatherIconRayPulse,y as weatherIconRing,s as weatherIconRotate,b as weatherIconSnow,S as weatherIconSnowFall,v as weatherIconSplash,p as weatherIconStar,A as weatherIconStill,C as weatherIconStone,u as weatherIconSunCore,c as weatherIconSunRay,o as weatherIconSunRays,D as weatherIconSway,m as weatherIconTwinkle};
2
+ //# sourceMappingURL=weatherIcon.module.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weatherIcon.module.mjs","names":[],"sources":["../../../../package/common/weatherIcon/weatherIcon.module.pcss"],"sourcesContent":["/* Line art in `currentColor`, like every other icon: it takes the text colour it sits in. */\n.weatherIcon {\n display: inline-block;\n flex-shrink: 0;\n fill: none;\n stroke: currentcolor;\n stroke-linecap: round;\n stroke-linejoin: round;\n\n &-behind {\n transform-origin: 50px 50px;\n transform: translate(14px, -16px) scale(0.62);\n }\n\n &-cloudBehind {\n transform-origin: 50px 50px;\n transform: translate(16px, -14px) scale(0.8);\n opacity: 0.55;\n }\n\n /* Wandering and breathing share one keyframe: a running animation replaces the whole\n `transform`, so two of them on one element would clobber each other. */\n &-cloud {\n stroke-width: 3;\n transform-box: fill-box;\n transform-origin: center;\n animation: weatherIconCloudDrift 20s ease-in-out infinite;\n }\n\n /* Negative, so the second cloud starts partway through its cycle instead of easing in. */\n &-cloudDelayed {\n animation-delay: -9s;\n }\n\n &-sunRays {\n transform-box: fill-box;\n transform-origin: center;\n animation: weatherIconRotate 150s linear infinite;\n }\n\n /* Anchored at the ray's inner end (y1 in parts.tsx), so it grows outwards whichever way it points. */\n &-sunRay {\n stroke-width: 3;\n transform-origin: 50px 23px;\n animation: weatherIconRayPulse 5s ease-in-out infinite;\n }\n\n &-sunRays > g:nth-child(3n + 2) &-sunRay {\n animation-delay: 0.8s;\n }\n\n &-sunRays > g:nth-child(3n) &-sunRay {\n animation-delay: 1.6s;\n }\n\n &-sunCore,\n &-moonCore {\n stroke-width: 3;\n transform-box: fill-box;\n transform-origin: center;\n animation: weatherIconGlow 4s ease-in-out infinite;\n }\n\n &-star {\n stroke-width: 1.4;\n transform-box: fill-box;\n transform-origin: center;\n animation-name: weatherIconTwinkle;\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n }\n\n &-rain {\n stroke-width: 2;\n }\n\n /* A dash of 6 slides along a path of 24.12 with a gap of exactly that length: it grows out of\n the cloud, falls, and shrinks into the ground. With any other gap the loop does not close.\n `backwards` keeps it hidden through its delay instead of showing the unanimated frame. */\n &-drop {\n stroke-dasharray: 6 24.12;\n animation-name: weatherIconFall;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n animation-fill-mode: backwards;\n }\n\n /* The drop's leading edge reaches the ground 24.12 into a cycle of 30.12, at 80%. The drop\n fades out as it hits and the splash is at its fullest by 82%: on a slow lane, a splash that\n peaked later came a visible moment after its drop. Left to sink into the ground, the drop's\n tail also arrived after the splash and ended as a round-capped dot. */\n &-splash {\n stroke-width: 1;\n opacity: 0;\n transform-box: fill-box;\n transform-origin: center;\n animation-name: weatherIconRing;\n animation-timing-function: ease-out;\n animation-iteration-count: infinite;\n }\n\n &-snow {\n stroke-width: 1.3;\n }\n\n /* Linear: easing would stop the flake in mid-air at every sway waypoint. */\n &-flake {\n animation-name: weatherIconSnowFall;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n animation-fill-mode: backwards;\n }\n\n &-stone {\n fill: currentcolor;\n stroke: none;\n animation-name: weatherIconHailFall;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n animation-fill-mode: backwards;\n }\n\n &-impact {\n stroke-width: 1;\n opacity: 0;\n transform-box: fill-box;\n transform-origin: center;\n animation-name: weatherIconRing;\n animation-timing-function: ease-out;\n animation-iteration-count: infinite;\n }\n\n /* Straight bars of different lengths: a wavy fog reads as an odd shape, not as fog. */\n &-fog {\n stroke-width: 4;\n\n & line:nth-child(1) {\n opacity: 0.55;\n animation: weatherIconSway 6.5s ease-in-out infinite;\n }\n\n & line:nth-child(2) {\n opacity: 0.85;\n animation: weatherIconSway 8s ease-in-out -1.2s infinite reverse;\n }\n\n & line:nth-child(3) {\n opacity: 0.7;\n animation: weatherIconSway 7s ease-in-out -0.6s infinite;\n }\n\n & line:nth-child(4) {\n opacity: 0.5;\n animation: weatherIconSway 9s ease-in-out -2s infinite reverse;\n }\n }\n\n /* Two quick flashes and a long dark stretch, well under the three flashes a second that\n WCAG 2.3.1 sets as the limit. */\n &-bolt {\n stroke-width: 2.5;\n animation: weatherIconFlash 4s linear infinite;\n }\n}\n\n@keyframes weatherIconCloudDrift {\n 0%,\n 100% {\n transform: translate(0, 0) scale(1);\n }\n\n 22% {\n transform: translate(1.2px, -1.6px) scale(1.015);\n }\n\n 48% {\n transform: translate(-0.9px, 1.4px) scale(1.03);\n }\n\n 74% {\n transform: translate(0.8px, -1.2px) scale(1.015);\n }\n\n 90% {\n transform: translate(-1.1px, 1px) scale(1.005);\n }\n}\n\n@keyframes weatherIconRotate {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes weatherIconRayPulse {\n 50% {\n transform: scaleY(1.3);\n }\n}\n\n@keyframes weatherIconGlow {\n 0%,\n 100% {\n opacity: 0.92;\n transform: scale(1);\n }\n\n 50% {\n opacity: 1;\n transform: scale(1.04);\n }\n}\n\n@keyframes weatherIconTwinkle {\n 0%,\n 100% {\n opacity: 0.3;\n transform: scale(0.7);\n }\n\n 50% {\n opacity: 1;\n transform: scale(1.1);\n }\n}\n\n@keyframes weatherIconFall {\n 0% {\n stroke-dashoffset: 6;\n opacity: 1;\n }\n\n 80% {\n opacity: 1;\n }\n\n 84% {\n opacity: 0;\n }\n\n 100% {\n stroke-dashoffset: -24.12;\n opacity: 0;\n }\n}\n\n@keyframes weatherIconRing {\n 0%,\n 80% {\n opacity: 0;\n transform: scale(0.6);\n }\n\n 82% {\n opacity: 0.85;\n transform: scale(1);\n }\n\n 100% {\n opacity: 0;\n transform: scale(1.4);\n }\n}\n\n@keyframes weatherIconSnowFall {\n 0% {\n transform: translate(0, 0);\n opacity: 0;\n }\n\n 6% {\n opacity: 1;\n }\n\n 25% {\n transform: translate(3px, 8px);\n }\n\n 50% {\n transform: translate(-3px, 16px);\n }\n\n 75% {\n transform: translate(2px, 24px);\n }\n\n 92% {\n transform: translate(-1px, 29px);\n opacity: 1;\n }\n\n 100% {\n transform: translate(0, 30px);\n opacity: 0;\n }\n}\n\n/* Lands at 80%, then bounces on along the way it was already drifting (sideways as well as up),\n which reads as a bounce rather than a pop. Each stone sets its own landing spot. */\n@keyframes weatherIconHailFall {\n 0% {\n transform: translate(0, 0);\n opacity: 0;\n }\n\n 10% {\n opacity: 1;\n }\n\n 80% {\n transform: translate(calc(var(--weather-icon-dx) * 1px), calc(var(--weather-icon-dy) * 1px));\n opacity: 1;\n animation-timing-function: ease-out;\n }\n\n 88% {\n transform: translate(calc(var(--weather-icon-dx) * 2px), calc((var(--weather-icon-dy) - 2.5) * 1px));\n opacity: 1;\n animation-timing-function: ease-in;\n }\n\n 100% {\n transform: translate(calc(var(--weather-icon-dx) * 2.6px), calc(var(--weather-icon-dy) * 1px));\n opacity: 0;\n }\n}\n\n@keyframes weatherIconSway {\n 50% {\n transform: translateX(3px);\n }\n}\n\n@keyframes weatherIconFlash {\n 0%,\n 8%,\n 14%,\n 100% {\n opacity: 0.35;\n }\n\n 4%,\n 11% {\n opacity: 1;\n }\n}\n\n/* Falling parts pause rather than stop: parts.tsx gives each a negative delay that freezes it\n partway down. The rest stop, and an impact frozen mid-pulse would be a stray mark, so it hides. */\n.weatherIcon-still {\n & .weatherIcon-drop,\n & .weatherIcon-flake,\n & .weatherIcon-stone {\n animation-play-state: paused;\n }\n\n & .weatherIcon-cloud,\n & .weatherIcon-sunRays,\n & .weatherIcon-sunRay,\n & .weatherIcon-sunCore,\n & .weatherIcon-moonCore,\n & .weatherIcon-star,\n & .weatherIcon-fog line,\n & .weatherIcon-bolt {\n animation: none;\n }\n\n & .weatherIcon-splash,\n & .weatherIcon-impact {\n animation: none;\n opacity: 0;\n }\n\n & .weatherIcon-bolt {\n opacity: 1;\n }\n}\n\n/* The component switches to its still frame by itself; this covers where it cannot read the\n setting, such as a server render. */\n@media (prefers-reduced-motion: reduce) {\n .weatherIcon * {\n animation-play-state: paused;\n }\n}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use client";var e=function(e){return e.Sunny=`sunny`,e.ClearNight=`clearNight`,e.Cloudy=`cloudy`,e.PartlyCloudy=`partlyCloudy`,e.PartlyCloudyNight=`partlyCloudyNight`,e.RainyLight=`rainyLight`,e.Rainy=`rainy`,e.RainyHeavy=`rainyHeavy`,e.Snowy=`snowy`,e.Hail=`hail`,e.Foggy=`foggy`,e.Thunderstorm=`thunderstorm`,e}({});export{e as WeatherType};
2
+ //# sourceMappingURL=weatherIcon.types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weatherIcon.types.mjs","names":[],"sources":["../../../../package/common/weatherIcon/weatherIcon.types.ts"],"sourcesContent":["import type { CSSProperties, SVGAttributes } from 'react';\nimport type { DataProps } from '../types/slots.types';\n\nexport enum WeatherType {\n Sunny = 'sunny',\n ClearNight = 'clearNight',\n Cloudy = 'cloudy',\n PartlyCloudy = 'partlyCloudy',\n PartlyCloudyNight = 'partlyCloudyNight',\n RainyLight = 'rainyLight',\n Rainy = 'rainy',\n RainyHeavy = 'rainyHeavy',\n Snowy = 'snowy',\n Hail = 'hail',\n Foggy = 'foggy',\n Thunderstorm = 'thunderstorm',\n}\n\n/** The accessible name of each weather, read out by screen readers. */\nexport type WeatherIconLabels = Partial<Record<`${WeatherType}`, string>>;\n\n/**\n * The root is an `<svg>`, so the native attributes come from `SVGAttributes` rather than\n * `HtmlProps`. Its `type` is the attribute of `<script>` and `<style>`, not of an `<svg>`.\n */\nexport interface WeatherIconProps extends DataProps, Omit<SVGAttributes<SVGSVGElement>, 'type'> {\n /**\n * The weather to draw. Takes the enum or its string value, so an API's own enum with the same\n * values passes as it is.\n */\n type: WeatherType | `${WeatherType}`;\n /** Width and height, any CSS size. Default `64`. */\n size?: number | string;\n /**\n * Default `true`. `false` draws a still frame, for small or repeated icons where the motion is\n * too small to see but costs the same. Always still under `prefers-reduced-motion`.\n */\n animated?: boolean;\n /** Text this component renders of its own. */\n labels?: WeatherIconLabels;\n className?: string;\n style?: CSSProperties;\n}\n\n/** What a falling part needs to know to pick its still frame. */\nexport interface WeatherPartProps {\n animated: boolean;\n}\n"],"mappings":"aAGA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,MAAA,QACA,EAAA,WAAA,aACA,EAAA,OAAA,SACA,EAAA,aAAA,eACA,EAAA,kBAAA,oBACA,EAAA,WAAA,aACA,EAAA,MAAA,QACA,EAAA,WAAA,aACA,EAAA,MAAA,QACA,EAAA,KAAA,OACA,EAAA,MAAA,QACA,EAAA,aAAA,gBACF,EAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- "use client";import{AccordionStyleType as e}from"./common/accordion/accordion.types.mjs";import t from"./common/configProvider/configProvider.mjs";import{useComponentDefaults as n}from"./common/configProvider/useComponentDefaults.mjs";import{useLabels as r}from"./common/configProvider/useLabels.mjs";import{usePresentationDefault as i}from"./common/configProvider/usePresentationDefault.mjs";import{Presentation as a}from"./common/configProvider/presentation.types.mjs";import o from"./common/accordion/accordion.mjs";import s from"./common/loading/spinnerLoading/index.mjs";import{ButtonSize as c,ButtonStyleType as l,ButtonType as u}from"./common/button/button.types.mjs";import d from"./common/ripple/ripple.mjs";import f from"./common/button/button.mjs";import p from"./common/actionButtons/actionButtons.mjs";import m from"./common/interactableDiv/index.mjs";import h from"./common/actionIcon/actionIcon.mjs";import{AlertStyleType as g}from"./common/alert/alert.types.mjs";import _ from"./common/alert/alert.mjs";import v from"./common/animatedLogo/animatedLogo.mjs";import{AnimatedTextUnit as y,AnimatedTextVariant as b}from"./common/animatedText/animatedText.types.mjs";import x from"./common/animatedText/animatedText.mjs";import{BadgePosition as S,BadgeStyleType as C}from"./common/badge/badge.types.mjs";import w from"./common/badge/badge.mjs";import T from"./common/avatar/avatar.mjs";import E from"./common/avatar/avatarGroup.mjs";import D from"./common/bodyEnd/bodyEnd.mjs";import{PopoverAlign as O,PopoverPlacement as k,PopoverTrigger as A}from"./common/popover/popover.types.mjs";import{tabbablesIn as j}from"./common/hooks/useFocusBoundary.mjs";import M from"./common/hooks/useMediaQuery.mjs";import N from"./common/hooks/useCoarsePointer.mjs";import{useVisualViewportSize as P}from"./common/hooks/useVisualViewportSize.mjs";import{useOverlay as F}from"./common/hooks/useOverlay.mjs";import I from"./common/popover/popover.mjs";import L from"./common/breadcrumb/breadcrumb.mjs";import{ButtonGroupOrientation as R}from"./common/buttonGroup/buttonGroup.types.mjs";import z from"./common/buttonGroup/buttonGroup.mjs";import{CardStyleType as B}from"./common/card/card.types.mjs";import V from"./common/card/Card.mjs";import H from"./common/card/CardHeader.mjs";import U from"./common/card/CardMedia.mjs";import W from"./common/card/CardContent.mjs";import G from"./common/card/CardActions.mjs";import K from"./common/carousel/carousel.mjs";import q from"./common/checkbox/checkbox.mjs";import{ChipStyleType as J}from"./common/chip/chip.types.mjs";import Y from"./common/chip/chip.mjs";import X from"./common/chip/chipContainer.mjs";import Z from"./common/tooltip/tooltip.mjs";import{InputIconPosition as Q,InputType as $}from"./common/input/input.types.mjs";import ee from"./common/input/input.mjs";import te from"./common/colorPicker/colorPicker.mjs";import{useScrollEdges as ne}from"./common/hooks/useScrollEdges.mjs";import re from"./common/modal/modal.mjs";import ie from"./common/confirmModal/confirmModal.mjs";import{getLocale as ae,mapLocale as oe,setLocale as se}from"./services/localization.mjs";import ce from"./common/dropdown/dropdown.mjs";import le from"./common/datePicker/datePicker.mjs";import{DividerOrientation as ue,DividerTextPosition as de}from"./common/divider/divider.types.mjs";import fe from"./common/divider/divider.mjs";import pe from"./common/drawer/drawer.mjs";import{DropZoneReturnType as me,DropZoneStatus as he}from"./common/dropZone/dropZone.types.mjs";import ge from"./common/dropZone/dropZone.mjs";import _e from"./common/emptyState/emptyState.mjs";import{useSwipeDismiss as ve}from"./common/hooks/useSwipeDismiss.mjs";import{showToast as ye}from"./common/toast/toastService.mjs";import be from"./common/toast/toastProvider.mjs";import xe from"./common/errorBoundary/errorBoundary.mjs";import Se from"./common/fab/fab.mjs";import Ce from"./common/flip/flip.mjs";import{DoorSwing as we,OpeningKind as Te,PlanIssueKind as Ee,PlanUnitSystem as De,WallType as Oe}from"./common/floorPlan/floorPlan.types.mjs";import{MIN_OPENING_WIDTH as ke,MIN_WALL_LENGTH as Ae}from"./common/floorPlan/floorPlan.geometry.mjs";import{DEFAULT_WALL_ATTRS as je,addOpening as Me,addRect as Ne,addWall as Pe,cleanupPlan as Fe,detachWall as Ie,dissolveNode as Le,mergeNodes as Re,moveNode as ze,removeOpening as Be,removeWall as Ve,scalePlan as He,splitWall as Ue,transformPlan as We,updateOpening as Ge,validatePlan as Ke,wallLength as qe,weldShortWalls as Je}from"./common/floorPlan/floorPlan.graph.mjs";import{MIN_FLOOR_HEIGHT as Ye,addFloor as Xe,duplicateFloor as Ze,emptyFloor as Qe,emptyFloorPlan as $e,floorBelow as et,floorBounds as tt,floorIndex as nt,getFloor as rt,moveFloor as it,removeFloor as at,renameFloor as ot,setFloor as st,setFloorHeight as ct,updateFloor as lt}from"./common/floorPlan/floorPlan.plan.mjs";import{deriveFaces as ut,nodeDegrees as dt}from"./common/floorPlan/floorPlan.faces.mjs";import{commitDerivation as ft,derivePlan as pt,pruneUnmatchedRooms as mt,roomAtPoint as ht}from"./common/floorPlan/floorPlan.rooms.mjs";import{buildWallPaths as gt,openingGeometry as _t,wallCentrelineSpans as vt}from"./common/floorPlan/floorPlan.path.mjs";import{HIT_PX as yt,HIT_PX_COARSE as bt,hitTest as xt,selectionsEqual as St,worldTolerances as Ct}from"./common/floorPlan/floorPlan.hit.mjs";import{DEFAULT_SNAP_OPTIONS as wt,SnapKind as Tt,clientToWorld as Et,resolveSnap as Dt,screenScale as Ot}from"./common/floorPlan/floorPlan.snap.mjs";import{PLAN_FORMAT_VERSION as kt,planFromJson as At,planToJson as jt}from"./common/floorPlan/floorPlan.json.mjs";import{buildPlanMesh as Mt}from"./common/floorPlan/floorPlan.mesh.mjs";import{planFromLegacySvg as Nt}from"./common/floorPlan/legacySvg.mjs";import Pt from"./common/iconPicker/iconPicker.mjs";import Ft from"./common/idleManager/idleManager.mjs";import It from"./common/inputDropdown/inputDropdown.mjs";import Lt from"./common/kanbanBoard/KanbanColumn.mjs";import Rt from"./common/kanbanBoard/KanbanBoard.mjs";import zt from"./common/searchInput/searchInput.mjs";import Bt from"./common/klipyPicker/klipyPicker.mjs";import Vt,{formatHotkey as Ht}from"./common/hooks/useHotkeys.mjs";import{isMenuAction as Ut,isMenuHeading as Wt,isMenuSeparator as Gt}from"./common/menu/menu.types.mjs";import Kt from"./common/menu/menu.mjs";import{menuHotkeys as qt}from"./common/menu/menuHotkeys.mjs";import Jt from"./common/multiSelect/multiSelect.mjs";import Yt from"./common/numberInput/index.mjs";import Xt from"./common/optionPicker/optionPicker.mjs";import{OtpInputCharset as Zt}from"./common/otpInput/otpInput.types.mjs";import Qt from"./common/otpInput/otpInput.mjs";import $t from"./common/overscroll/overscroll.mjs";import en from"./common/pagination/pagination.mjs";import tn from"./common/progressBar/progressBar.mjs";import{RadioGroupOrientation as nn}from"./common/radioGroup/radioGroup.types.mjs";import rn from"./common/radioGroup/radioGroup.mjs";import an from"./common/rating/rating.mjs";import on from"./common/revealLens/revealLens.mjs";import sn from"./common/roomDrawer/roomDrawer.mjs";import cn from"./common/roomViewer/roomViewer.mjs";import{ScrollFadeAxis as ln}from"./common/scrollFade/scrollFade.types.mjs";import un from"./common/scrollFade/scrollFade.mjs";import dn from"./common/scrollbarProvider/index.mjs";import{SectionHeaderSize as fn}from"./common/sectionHeader/sectionHeader.types.mjs";import pn from"./common/sectionHeader/sectionHeader.mjs";import{SkeletonAnimation as mn,SkeletonVariant as hn}from"./common/skeleton/skeleton.types.mjs";import gn from"./common/skeleton/skeleton.mjs";import _n from"./common/slider/slider.mjs";import vn from"./common/splitButton/splitButton.mjs";import{StepperAlignment as yn,StepperCollapse as bn,StepperLabelPlacement as xn,StepperStyleType as Sn}from"./common/stepper/stepper.types.mjs";import Cn from"./common/stepper/stepper.mjs";import wn from"./common/sticky/sticky.mjs";import Tn from"./common/switch/switch.mjs";import En from"./common/tabHeader/tabHeader.mjs";import Dn from"./common/textarea/textarea.mjs";import{defaultTheme as On}from"./common/themeProvider/defaultTheme.mjs";import kn from"./common/themeProvider/themeProvider.mjs";import{lightTheme as An}from"./common/themeProvider/lightTheme.mjs";import{useTheme as jn}from"./common/themeProvider/useTheme.mjs";import Mn,{TiltGroupContext as Nn,useTiltGroup as Pn}from"./common/tiltGroup/tiltGroup.mjs";import{defaultTiltEasing as Fn}from"./common/tilt/tiltMath.mjs";import In from"./common/tilt/tilt.mjs";import Ln from"./common/timeInput/timeInput.mjs";import{TimelineAlignment as Rn,TimelineItemStatus as zn}from"./common/timeline/timeline.types.mjs";import Bn from"./common/timeline/timeline.mjs";import Vn from"./common/timer/timer.mjs";import Hn from"./common/virtualList/virtualList.mjs";import{flattenTree as Un}from"./common/tree/flattenTree.mjs";import Wn from"./common/tree/tree.mjs";import Gn from"./common/wizard/wizard.mjs";import Kn from"./services/formValidation/FormValidatorGroupWithForm.mjs";import qn from"./services/formValidation/validatableComponent.mjs";import{useFormValidatorGroup as Jn}from"./services/formValidation/useFormValidatorGroup.mjs";import{FormValidator as Yn,Validators as Xn,useFormValidator as Zn}from"./services/formValidation/index.mjs";import{hasEightPasswordChars as Qn,hasOnePasswordDigit as $n,hasOnePasswordLetter as er,isBic as tr,isDate as nr,isEmail as rr,isISODate as ir,isNumber as ar,isPassword as or,isURL as sr}from"@ahrowe/form-validation";export{o as Accordion,e as AccordionStyleType,p as ActionButtons,h as ActionIcon,_ as Alert,g as AlertStyleType,v as AnimatedLogo,x as AnimatedText,y as AnimatedTextUnit,b as AnimatedTextVariant,T as Avatar,E as AvatarGroup,w as Badge,S as BadgePosition,C as BadgeStyleType,D as BodyEnd,L as Breadcrumb,f as Button,z as ButtonGroup,R as ButtonGroupOrientation,c as ButtonSize,l as ButtonStyleType,u as ButtonType,V as Card,G as CardActions,W as CardContent,H as CardHeader,U as CardMedia,B as CardStyleType,K as Carousel,q as Checkbox,Y as Chip,X as ChipContainer,J as ChipStyleType,te as ColorPicker,t as ConfigProvider,ie as ConfirmModal,wt as DEFAULT_SNAP_OPTIONS,je as DEFAULT_WALL_ATTRS,le as DatePicker,fe as Divider,ue as DividerOrientation,de as DividerTextPosition,we as DoorSwing,pe as Drawer,ge as DropZone,me as DropZoneReturnType,he as DropZoneStatus,ce as Dropdown,_e as EmptyState,xe as ErrorBoundary,Se as Fab,Ce as Flip,Yn as FormValidator,Kn as FormValidatorGroup,yt as HIT_PX,bt as HIT_PX_COARSE,Pt as IconPicker,Ft as IdleManager,ee as Input,It as InputDropdown,Q as InputIconPosition,$ as InputType,m as InteractableDiv,Rt as KanbanBoard,Lt as KanbanColumn,Bt as KlipyPicker,Ye as MIN_FLOOR_HEIGHT,ke as MIN_OPENING_WIDTH,Ae as MIN_WALL_LENGTH,Kt as Menu,re as Modal,Jt as MultiSelect,Yt as NumberInput,Te as OpeningKind,Xt as OptionPicker,Qt as OtpInput,Zt as OtpInputCharset,$t as Overscroll,kt as PLAN_FORMAT_VERSION,en as Pagination,Ee as PlanIssueKind,De as PlanUnitSystem,I as Popover,O as PopoverAlign,k as PopoverPlacement,A as PopoverTrigger,a as Presentation,tn as ProgressBar,rn as RadioGroup,nn as RadioGroupOrientation,an as Rating,on as RevealLens,d as Ripple,sn as RoomDrawer,cn as RoomViewer,un as ScrollFade,ln as ScrollFadeAxis,dn as ScrollbarProvider,zt as SearchInput,pn as SectionHeader,fn as SectionHeaderSize,gn as Skeleton,mn as SkeletonAnimation,hn as SkeletonVariant,_n as Slider,Tt as SnapKind,s as SpinnerLoading,vn as SplitButton,Cn as Stepper,yn as StepperAlignment,bn as StepperCollapse,xn as StepperLabelPlacement,Sn as StepperStyleType,wn as Sticky,Tn as Switch,En as TabHeader,Dn as Textarea,kn as ThemeProvider,In as Tilt,Mn as TiltGroup,Nn as TiltGroupContext,Ln as TimeInput,Bn as Timeline,Rn as TimelineAlignment,zn as TimelineItemStatus,Vn as Timer,be as ToastProvider,Z as Tooltip,Wn as Tree,qn as ValidatableComponent,Xn as Validators,Hn as VirtualList,Oe as WallType,Gn as Wizard,Xe as addFloor,Me as addOpening,Ne as addRect,Pe as addWall,Mt as buildPlanMesh,gt as buildWallPaths,Fe as cleanupPlan,Et as clientToWorld,ft as commitDerivation,On as defaultTheme,Fn as defaultTiltEasing,ut as deriveFaces,pt as derivePlan,Ie as detachWall,Le as dissolveNode,Ze as duplicateFloor,Qe as emptyFloor,$e as emptyFloorPlan,Un as flattenTree,et as floorBelow,tt as floorBounds,nt as floorIndex,Ht as formatHotkey,rt as getFloor,ae as getLocale,Qn as hasEightPasswordChars,$n as hasOnePasswordDigit,er as hasOnePasswordLetter,xt as hitTest,tr as isBic,nr as isDate,rr as isEmail,ir as isISODate,Ut as isMenuAction,Wt as isMenuHeading,Gt as isMenuSeparator,ar as isNumber,or as isPassword,sr as isURL,An as lightTheme,oe as mapLocale,qt as menuHotkeys,Re as mergeNodes,it as moveFloor,ze as moveNode,dt as nodeDegrees,_t as openingGeometry,At as planFromJson,Nt as planFromLegacySvg,jt as planToJson,mt as pruneUnmatchedRooms,at as removeFloor,Be as removeOpening,Ve as removeWall,ot as renameFloor,Dt as resolveSnap,ht as roomAtPoint,He as scalePlan,Ot as screenScale,St as selectionsEqual,st as setFloor,ct as setFloorHeight,se as setLocale,ye as showToast,Ue as splitWall,j as tabbablesIn,We as transformPlan,lt as updateFloor,Ge as updateOpening,N as useCoarsePointer,n as useComponentDefaults,Zn as useFormValidator,Jn as useFormValidatorGroup,Vt as useHotkeys,r as useLabels,M as useMediaQuery,F as useOverlay,i as usePresentationDefault,ne as useScrollEdges,ve as useSwipeDismiss,jn as useTheme,Pn as useTiltGroup,P as useVisualViewportSize,Ke as validatePlan,vt as wallCentrelineSpans,qe as wallLength,Je as weldShortWalls,Ct as worldTolerances};
1
+ "use client";import{AccordionStyleType as e}from"./common/accordion/accordion.types.mjs";import t from"./common/configProvider/configProvider.mjs";import{useComponentDefaults as n}from"./common/configProvider/useComponentDefaults.mjs";import{useLabels as r}from"./common/configProvider/useLabels.mjs";import{usePresentationDefault as i}from"./common/configProvider/usePresentationDefault.mjs";import{Presentation as a}from"./common/configProvider/presentation.types.mjs";import o from"./common/accordion/accordion.mjs";import s from"./common/loading/spinnerLoading/index.mjs";import{ButtonSize as c,ButtonStyleType as l,ButtonType as u}from"./common/button/button.types.mjs";import d from"./common/ripple/ripple.mjs";import f from"./common/button/button.mjs";import p from"./common/actionButtons/actionButtons.mjs";import m from"./common/interactableDiv/index.mjs";import h from"./common/actionIcon/actionIcon.mjs";import{AlertStyleType as g}from"./common/alert/alert.types.mjs";import _ from"./common/alert/alert.mjs";import v from"./common/animatedLogo/animatedLogo.mjs";import{AnimatedTextUnit as y,AnimatedTextVariant as b}from"./common/animatedText/animatedText.types.mjs";import x from"./common/animatedText/animatedText.mjs";import{BadgePosition as S,BadgeStyleType as C}from"./common/badge/badge.types.mjs";import w from"./common/badge/badge.mjs";import T from"./common/avatar/avatar.mjs";import E from"./common/avatar/avatarGroup.mjs";import D from"./common/bodyEnd/bodyEnd.mjs";import{PopoverAlign as O,PopoverPlacement as k,PopoverTrigger as A}from"./common/popover/popover.types.mjs";import{tabbablesIn as j}from"./common/hooks/useFocusBoundary.mjs";import M from"./common/hooks/useMediaQuery.mjs";import N from"./common/hooks/useCoarsePointer.mjs";import{useVisualViewportSize as P}from"./common/hooks/useVisualViewportSize.mjs";import{useOverlay as F}from"./common/hooks/useOverlay.mjs";import I from"./common/popover/popover.mjs";import L from"./common/breadcrumb/breadcrumb.mjs";import{ButtonGroupOrientation as R}from"./common/buttonGroup/buttonGroup.types.mjs";import z from"./common/buttonGroup/buttonGroup.mjs";import{CardStyleType as B}from"./common/card/card.types.mjs";import V from"./common/card/Card.mjs";import H from"./common/card/CardHeader.mjs";import U from"./common/card/CardMedia.mjs";import W from"./common/card/CardContent.mjs";import G from"./common/card/CardActions.mjs";import K from"./common/carousel/carousel.mjs";import q from"./common/checkbox/checkbox.mjs";import{ChipStyleType as J}from"./common/chip/chip.types.mjs";import Y from"./common/chip/chip.mjs";import X from"./common/chip/chipContainer.mjs";import Z from"./common/tooltip/tooltip.mjs";import{InputIconPosition as Q,InputType as $}from"./common/input/input.types.mjs";import ee from"./common/input/input.mjs";import te from"./common/colorPicker/colorPicker.mjs";import{useScrollEdges as ne}from"./common/hooks/useScrollEdges.mjs";import re from"./common/modal/modal.mjs";import ie,{formatHotkey as ae}from"./common/hooks/useHotkeys.mjs";import{isMenuAction as oe,isMenuHeading as se,isMenuSeparator as ce}from"./common/menu/menu.types.mjs";import le from"./common/commandPalette/commandPalette.mjs";import ue from"./common/confirmModal/confirmModal.mjs";import de from"./common/hooks/useClipboard.mjs";import fe from"./common/copyButton/copyButton.mjs";import{getLocale as pe,mapLocale as me,setLocale as he}from"./services/localization.mjs";import ge from"./common/dropdown/dropdown.mjs";import _e from"./common/datePicker/datePicker.mjs";import{DividerOrientation as ve,DividerTextPosition as ye}from"./common/divider/divider.types.mjs";import be from"./common/divider/divider.mjs";import xe from"./common/drawer/drawer.mjs";import{DropZoneReturnType as Se,DropZoneStatus as Ce}from"./common/dropZone/dropZone.types.mjs";import we from"./common/dropZone/dropZone.mjs";import Te from"./common/emptyState/emptyState.mjs";import{useSwipeDismiss as Ee}from"./common/hooks/useSwipeDismiss.mjs";import{showToast as De}from"./common/toast/toastService.mjs";import Oe from"./common/toast/toastProvider.mjs";import ke from"./common/errorBoundary/errorBoundary.mjs";import Ae from"./common/fab/fab.mjs";import je from"./common/flip/flip.mjs";import{DoorSwing as Me,OpeningKind as Ne,PlanIssueKind as Pe,PlanUnitSystem as Fe,WallType as Ie}from"./common/floorPlan/floorPlan.types.mjs";import{MIN_OPENING_WIDTH as Le,MIN_WALL_LENGTH as Re}from"./common/floorPlan/floorPlan.geometry.mjs";import{DEFAULT_WALL_ATTRS as ze,addOpening as Be,addRect as Ve,addWall as He,cleanupPlan as Ue,detachWall as We,dissolveNode as Ge,mergeNodes as Ke,moveNode as qe,removeOpening as Je,removeWall as Ye,scalePlan as Xe,splitWall as Ze,transformPlan as Qe,updateOpening as $e,validatePlan as et,wallLength as tt,weldShortWalls as nt}from"./common/floorPlan/floorPlan.graph.mjs";import{MIN_FLOOR_HEIGHT as rt,addFloor as it,duplicateFloor as at,emptyFloor as ot,emptyFloorPlan as st,floorBelow as ct,floorBounds as lt,floorIndex as ut,getFloor as dt,moveFloor as ft,removeFloor as pt,renameFloor as mt,setFloor as ht,setFloorHeight as gt,updateFloor as _t}from"./common/floorPlan/floorPlan.plan.mjs";import{deriveFaces as vt,nodeDegrees as yt}from"./common/floorPlan/floorPlan.faces.mjs";import{commitDerivation as bt,derivePlan as xt,pruneUnmatchedRooms as St,roomAtPoint as Ct}from"./common/floorPlan/floorPlan.rooms.mjs";import{buildWallPaths as wt,openingGeometry as Tt,wallCentrelineSpans as Et}from"./common/floorPlan/floorPlan.path.mjs";import{HIT_PX as Dt,HIT_PX_COARSE as Ot,hitTest as kt,selectionsEqual as At,worldTolerances as jt}from"./common/floorPlan/floorPlan.hit.mjs";import{DEFAULT_SNAP_OPTIONS as Mt,SnapKind as Nt,clientToWorld as Pt,resolveSnap as Ft,screenScale as It}from"./common/floorPlan/floorPlan.snap.mjs";import{PLAN_FORMAT_VERSION as Lt,planFromJson as Rt,planToJson as zt}from"./common/floorPlan/floorPlan.json.mjs";import{buildPlanMesh as Bt}from"./common/floorPlan/floorPlan.mesh.mjs";import{planFromLegacySvg as Vt}from"./common/floorPlan/legacySvg.mjs";import Ht from"./common/iconPicker/iconPicker.mjs";import Ut from"./common/idleManager/idleManager.mjs";import Wt from"./common/inputDropdown/inputDropdown.mjs";import Gt from"./common/kanbanBoard/KanbanColumn.mjs";import Kt from"./common/kanbanBoard/KanbanBoard.mjs";import qt from"./common/searchInput/searchInput.mjs";import Jt from"./common/klipyPicker/klipyPicker.mjs";import Yt from"./common/menu/menu.mjs";import{menuHotkeys as Xt}from"./common/menu/menuHotkeys.mjs";import Zt from"./common/multiSelect/multiSelect.mjs";import Qt from"./common/numberInput/index.mjs";import $t from"./common/optionPicker/optionPicker.mjs";import{OtpInputCharset as en}from"./common/otpInput/otpInput.types.mjs";import tn from"./common/otpInput/otpInput.mjs";import nn from"./common/overscroll/overscroll.mjs";import rn from"./common/pagination/pagination.mjs";import an from"./common/progressBar/progressBar.mjs";import{RadioGroupOrientation as on}from"./common/radioGroup/radioGroup.types.mjs";import sn from"./common/radioGroup/radioGroup.mjs";import cn from"./common/rating/rating.mjs";import ln from"./common/revealLens/revealLens.mjs";import un from"./common/roomDrawer/roomDrawer.mjs";import dn from"./common/roomViewer/roomViewer.mjs";import{ScrollFadeAxis as fn}from"./common/scrollFade/scrollFade.types.mjs";import pn from"./common/scrollFade/scrollFade.mjs";import mn from"./common/scrollbarProvider/index.mjs";import{SectionHeaderSize as hn}from"./common/sectionHeader/sectionHeader.types.mjs";import gn from"./common/sectionHeader/sectionHeader.mjs";import{SkeletonAnimation as _n,SkeletonVariant as vn}from"./common/skeleton/skeleton.types.mjs";import yn from"./common/skeleton/skeleton.mjs";import bn from"./common/slider/slider.mjs";import xn from"./common/splitButton/splitButton.mjs";import{StepperAlignment as Sn,StepperCollapse as Cn,StepperLabelPlacement as wn,StepperStyleType as Tn}from"./common/stepper/stepper.types.mjs";import En from"./common/stepper/stepper.mjs";import Dn from"./common/sticky/sticky.mjs";import On from"./common/switch/switch.mjs";import kn from"./common/tabHeader/tabHeader.mjs";import An from"./common/textarea/textarea.mjs";import{defaultTheme as jn}from"./common/themeProvider/defaultTheme.mjs";import Mn from"./common/themeProvider/themeProvider.mjs";import{lightTheme as Nn}from"./common/themeProvider/lightTheme.mjs";import{useTheme as Pn}from"./common/themeProvider/useTheme.mjs";import Fn,{TiltGroupContext as In,useTiltGroup as Ln}from"./common/tiltGroup/tiltGroup.mjs";import{defaultTiltEasing as Rn}from"./common/tilt/tiltMath.mjs";import zn from"./common/tilt/tilt.mjs";import Bn from"./common/timeInput/timeInput.mjs";import{TimelineAlignment as Vn,TimelineItemStatus as Hn}from"./common/timeline/timeline.types.mjs";import Un from"./common/timeline/timeline.mjs";import Wn from"./common/timer/timer.mjs";import Gn from"./common/virtualList/virtualList.mjs";import{flattenTree as Kn}from"./common/tree/flattenTree.mjs";import qn from"./common/tree/tree.mjs";import{WeatherType as Jn}from"./common/weatherIcon/weatherIcon.types.mjs";import Yn from"./common/weatherIcon/weatherIcon.mjs";import Xn from"./common/wizard/wizard.mjs";import Zn from"./services/formValidation/FormValidatorGroupWithForm.mjs";import Qn from"./services/formValidation/validatableComponent.mjs";import{useFormValidatorGroup as $n}from"./services/formValidation/useFormValidatorGroup.mjs";import{FormValidator as er,Validators as tr,useFormValidator as nr}from"./services/formValidation/index.mjs";import{hasEightPasswordChars as rr,hasOnePasswordDigit as ir,hasOnePasswordLetter as ar,isBic as or,isDate as sr,isEmail as cr,isISODate as lr,isNumber as ur,isPassword as dr,isURL as fr}from"@ahrowe/form-validation";export{o as Accordion,e as AccordionStyleType,p as ActionButtons,h as ActionIcon,_ as Alert,g as AlertStyleType,v as AnimatedLogo,x as AnimatedText,y as AnimatedTextUnit,b as AnimatedTextVariant,T as Avatar,E as AvatarGroup,w as Badge,S as BadgePosition,C as BadgeStyleType,D as BodyEnd,L as Breadcrumb,f as Button,z as ButtonGroup,R as ButtonGroupOrientation,c as ButtonSize,l as ButtonStyleType,u as ButtonType,V as Card,G as CardActions,W as CardContent,H as CardHeader,U as CardMedia,B as CardStyleType,K as Carousel,q as Checkbox,Y as Chip,X as ChipContainer,J as ChipStyleType,te as ColorPicker,le as CommandPalette,t as ConfigProvider,ue as ConfirmModal,fe as CopyButton,Mt as DEFAULT_SNAP_OPTIONS,ze as DEFAULT_WALL_ATTRS,_e as DatePicker,be as Divider,ve as DividerOrientation,ye as DividerTextPosition,Me as DoorSwing,xe as Drawer,we as DropZone,Se as DropZoneReturnType,Ce as DropZoneStatus,ge as Dropdown,Te as EmptyState,ke as ErrorBoundary,Ae as Fab,je as Flip,er as FormValidator,Zn as FormValidatorGroup,Dt as HIT_PX,Ot as HIT_PX_COARSE,Ht as IconPicker,Ut as IdleManager,ee as Input,Wt as InputDropdown,Q as InputIconPosition,$ as InputType,m as InteractableDiv,Kt as KanbanBoard,Gt as KanbanColumn,Jt as KlipyPicker,rt as MIN_FLOOR_HEIGHT,Le as MIN_OPENING_WIDTH,Re as MIN_WALL_LENGTH,Yt as Menu,re as Modal,Zt as MultiSelect,Qt as NumberInput,Ne as OpeningKind,$t as OptionPicker,tn as OtpInput,en as OtpInputCharset,nn as Overscroll,Lt as PLAN_FORMAT_VERSION,rn as Pagination,Pe as PlanIssueKind,Fe as PlanUnitSystem,I as Popover,O as PopoverAlign,k as PopoverPlacement,A as PopoverTrigger,a as Presentation,an as ProgressBar,sn as RadioGroup,on as RadioGroupOrientation,cn as Rating,ln as RevealLens,d as Ripple,un as RoomDrawer,dn as RoomViewer,pn as ScrollFade,fn as ScrollFadeAxis,mn as ScrollbarProvider,qt as SearchInput,gn as SectionHeader,hn as SectionHeaderSize,yn as Skeleton,_n as SkeletonAnimation,vn as SkeletonVariant,bn as Slider,Nt as SnapKind,s as SpinnerLoading,xn as SplitButton,En as Stepper,Sn as StepperAlignment,Cn as StepperCollapse,wn as StepperLabelPlacement,Tn as StepperStyleType,Dn as Sticky,On as Switch,kn as TabHeader,An as Textarea,Mn as ThemeProvider,zn as Tilt,Fn as TiltGroup,In as TiltGroupContext,Bn as TimeInput,Un as Timeline,Vn as TimelineAlignment,Hn as TimelineItemStatus,Wn as Timer,Oe as ToastProvider,Z as Tooltip,qn as Tree,Qn as ValidatableComponent,tr as Validators,Gn as VirtualList,Ie as WallType,Yn as WeatherIcon,Jn as WeatherType,Xn as Wizard,it as addFloor,Be as addOpening,Ve as addRect,He as addWall,Bt as buildPlanMesh,wt as buildWallPaths,Ue as cleanupPlan,Pt as clientToWorld,bt as commitDerivation,jn as defaultTheme,Rn as defaultTiltEasing,vt as deriveFaces,xt as derivePlan,We as detachWall,Ge as dissolveNode,at as duplicateFloor,ot as emptyFloor,st as emptyFloorPlan,Kn as flattenTree,ct as floorBelow,lt as floorBounds,ut as floorIndex,ae as formatHotkey,dt as getFloor,pe as getLocale,rr as hasEightPasswordChars,ir as hasOnePasswordDigit,ar as hasOnePasswordLetter,kt as hitTest,or as isBic,sr as isDate,cr as isEmail,lr as isISODate,oe as isMenuAction,se as isMenuHeading,ce as isMenuSeparator,ur as isNumber,dr as isPassword,fr as isURL,Nn as lightTheme,me as mapLocale,Xt as menuHotkeys,Ke as mergeNodes,ft as moveFloor,qe as moveNode,yt as nodeDegrees,Tt as openingGeometry,Rt as planFromJson,Vt as planFromLegacySvg,zt as planToJson,St as pruneUnmatchedRooms,pt as removeFloor,Je as removeOpening,Ye as removeWall,mt as renameFloor,Ft as resolveSnap,Ct as roomAtPoint,Xe as scalePlan,It as screenScale,At as selectionsEqual,ht as setFloor,gt as setFloorHeight,he as setLocale,De as showToast,Ze as splitWall,j as tabbablesIn,Qe as transformPlan,_t as updateFloor,$e as updateOpening,de as useClipboard,N as useCoarsePointer,n as useComponentDefaults,nr as useFormValidator,$n as useFormValidatorGroup,ie as useHotkeys,r as useLabels,M as useMediaQuery,F as useOverlay,i as usePresentationDefault,ne as useScrollEdges,Ee as useSwipeDismiss,Pn as useTheme,Ln as useTiltGroup,P as useVisualViewportSize,et as validatePlan,Et as wallCentrelineSpans,tt as wallLength,nt as weldShortWalls,jt as worldTolerances};