meticulous-ui 3.11.3 → 3.11.5

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),M=require("react"),D=require("../Spinner/Spinner.cjs"),P=require("../../colors/colorMap.cjs"),w=require("../../colors/blue.cjs"),R=require("../Ripple/Ripple.cjs"),S=require("../../colors/white.cjs"),v=require("../../colors/grey.cjs"),y=require("./constants.cjs"),z=require("prop-types"),l=require("styled-components"),x=e=>e&&e.__esModule?e:{default:e},o=x(z),d=x(l),B=d.default.button`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),R=require("react"),D=require("../Spinner/Spinner.cjs"),P=require("../../colors/colorMap.cjs"),y=require("../../colors/blue.cjs"),S=require("../Ripple/Ripple.cjs"),z=require("../../colors/white.cjs"),v=require("../../colors/grey.cjs"),w=require("./constants.cjs"),B=require("prop-types"),l=require("styled-components"),x=e=>e&&e.__esModule?e:{default:e},o=x(B),d=x(l),E=d.default.button`
2
2
  height: ${({$height:e})=>e}rem;
3
3
  width: ${({$width:e})=>e}rem;
4
4
  border-radius: 0.96rem;
@@ -15,18 +15,18 @@
15
15
 
16
16
  ${({disabled:e,$isLoading:t})=>!(e||t)&&l.css`
17
17
  &:hover {
18
- background-color: ${({$hoverColor:n})=>n};
18
+ background-color: ${({$hoverColor:r})=>r};
19
19
  }
20
20
 
21
21
  &:active {
22
- background-color: ${({$activeColor:n})=>n};
22
+ background-color: ${({$activeColor:r})=>r};
23
23
  }
24
24
  `};
25
25
 
26
26
  &:focus-visible {
27
27
  outline: none;
28
28
  }
29
- `,E=d.default.div`
29
+ `,K=d.default.div`
30
30
  font-size: ${({$font:e})=>e}rem;
31
31
  font-weight: 500;
32
32
  max-width: 100%;
@@ -34,7 +34,7 @@
34
34
  color: ${({$textColor:e})=>e};
35
35
  opacity: ${({$isLoading:e})=>e?0:1};
36
36
  transition: opacity 0.3s ease;
37
- `,K=d.default.div`
37
+ `,O=d.default.div`
38
38
  height: ${({$height:e})=>e}rem;
39
39
  width: ${({$width:e})=>e}rem;
40
40
  display: inline-block;
@@ -53,7 +53,7 @@
53
53
  transform: translateY(-2px);
54
54
  }
55
55
  `};
56
- `,O=d.default.div`
56
+ `,W=d.default.div`
57
57
  position: absolute;
58
58
  inset: 0;
59
59
  display: flex;
@@ -62,4 +62,4 @@
62
62
  opacity: ${({$isLoading:e})=>e?1:0};
63
63
  transition: opacity 0.3s ease;
64
64
  pointer-events: none;
65
- `,W=({theme:e,children:t})=>r.jsx(R.default,{rippleColor:e.m100,children:t}),C=e=>{var g;const{children:t,theme:n=w.blue,size:q=y.MEDIUM,width:c,leftIcon:U,rightIcon:Y,isLoading:i,textColor:u,onKeyDown:a,...j}=e||{},f=M.useRef(0),_=s=>{if(s.key==="Enter"||s.key===" "){const $=Date.now();if($-f.current<500){s.preventDefault(),s.stopPropagation();return}f.current=$}a==null||a(s)},{m400:T,m500:k,m600:I}=(g=P.default[n])!=null?g:w.blue,{height:h,width:p,font:L}=y.SIZE[q]||{},m=["white","yellow"].includes(n)?v.default.m600:S.default,b=r.jsxs(B,{type:"button",...j,onKeyDown:_,$hoverColor:k,$activeColor:I,$selectedColor:T,$height:h,$width:c||p,disabled:e.disabled,$isLoading:i,children:[r.jsx(O,{$isLoading:i,children:r.jsx(D.default,{size:"small",color:u||m})}),r.jsx(E,{$isLoading:i,$textColor:u||m,$font:L,children:t})]});return r.jsx(K,{$height:h,$width:c||p,disabled:e.disabled,$isLoading:i,children:i?b:r.jsx(W,{theme:n,children:b})})};C.propTypes={children:o.default.node,theme:o.default.string,size:o.default.string,width:o.default.oneOfType([o.default.string,o.default.number]),leftIcon:o.default.elementType,rightIcon:o.default.elementType,isLoading:o.default.bool,textColor:o.default.string,disabled:o.default.bool};exports.default=C;
65
+ `,U=({theme:e,children:t})=>n.jsx(S.default,{rippleColor:e.m100,borderRadius:"0.96rem",children:t}),C=e=>{var g;const{children:t,theme:r=y.blue,size:q=w.MEDIUM,width:u,leftIcon:Y,rightIcon:Z,isLoading:i,textColor:c,onKeyDown:a,style:j,..._}=e||{},f=R.useRef(0),T=s=>{if(s.key==="Enter"||s.key===" "){const $=Date.now();if($-f.current<500){s.preventDefault(),s.stopPropagation();return}f.current=$}a==null||a(s)},{m400:k,m500:I,m600:L}=(g=P.default[r])!=null?g:y.blue,{height:h,width:p,font:M}=w.SIZE[q]||{},m=["white","yellow"].includes(r)?v.default.m600:z.default,b=n.jsxs(E,{type:"button",..._,onKeyDown:T,$hoverColor:I,$activeColor:L,$selectedColor:k,$height:h,$width:u||p,disabled:e.disabled,$isLoading:i,children:[n.jsx(W,{$isLoading:i,children:n.jsx(D.default,{size:"small",color:c||m})}),n.jsx(K,{$isLoading:i,$textColor:c||m,$font:M,children:t})]});return n.jsx(O,{style:j,$height:h,$width:u||p,disabled:e.disabled,$isLoading:i,children:i?b:n.jsx(U,{theme:r,children:b})})};C.propTypes={children:o.default.node,theme:o.default.string,size:o.default.string,width:o.default.oneOfType([o.default.string,o.default.number]),leftIcon:o.default.elementType,rightIcon:o.default.elementType,isLoading:o.default.bool,textColor:o.default.string,disabled:o.default.bool};exports.default=C;
@@ -82,4 +82,4 @@
82
82
  white-space: nowrap;
83
83
  opacity: 0;
84
84
  pointer-events: none;
85
- `,V=({theme:e,children:t})=>r.jsx(L.default,{rippleColor:e.m100,children:t}),_=({label:e,labelColor:t,theme:n=v.blue,size:k=j.MEDIUM,width:z,isLoading:i,disabled:s,prefixIcon:p=F.default,suffixIcon:f,type:I="file",accept:M,isMultiple:R,onChange:T,...D})=>{var g;const h=b.useRef(null),{m400:P,m500:S,m600:W}=(g=H.default[n])!=null?g:v.blue,{height:$,width:E,font:a}=j.SIZE[k]||{},c=t||["white","yellow"].includes(n)?q.default.m600:B.default,m=b.useRef(0),K=u=>{var w;if(u.key==="Enter"||u.key===" "){u.preventDefault();const y=Date.now();if(y-m.current<500){u.stopPropagation();return}m.current=y,!s&&!i&&((w=h.current)==null||w.click())}},x=r.jsxs(A,{$selectedColor:P,$hoverColor:S,$height:$,$width:z||E,$activeColor:W,disabled:s,$isLoading:i,tabIndex:0,"aria-disabled":s,onKeyDown:K,children:[r.jsx(Q,{ref:h,type:I,accept:M,multiple:R,disabled:s,onChange:T,tabIndex:-1}),r.jsx(J,{$isLoading:i,children:r.jsx(O.default,{size:"small",color:c})}),r.jsxs(N,{$isLoading:i,children:[p&&r.jsx(p,{color:c,size:a+19}),r.jsx(G,{color:c,size:`${a}rem`,$prefixIcon:!!p,$suffixIcon:!!f,$iconSize:a+19,title:e,children:e}),f&&r.jsx(f,{color:c,size:a+19})]})]});return r.jsx(Z,{$height:$,disabled:s,$isLoading:i,...D,children:i||s?x:r.jsx(V,{theme:n,children:x})})};_.propTypes={label:o.default.string,labelColor:o.default.string,theme:o.default.string,size:o.default.string,width:o.default.oneOfType([o.default.string,o.default.number]),isLoading:o.default.bool,disabled:o.default.bool,prefixIcon:o.default.elementType,suffixIcon:o.default.elementType,type:o.default.string,accept:o.default.string,isMultiple:o.default.bool,onChange:o.default.func};exports.default=_;
85
+ `,V=({theme:e,children:t})=>r.jsx(L.default,{rippleColor:e.m100,borderRadius:"0.96rem",children:t}),_=({label:e,labelColor:t,theme:n=v.blue,size:k=j.MEDIUM,width:R,isLoading:i,disabled:s,prefixIcon:p=F.default,suffixIcon:f,type:z="file",accept:I,isMultiple:M,onChange:T,...D})=>{var g;const h=b.useRef(null),{m400:P,m500:S,m600:W}=(g=H.default[n])!=null?g:v.blue,{height:m,width:E,font:a}=j.SIZE[k]||{},c=t||["white","yellow"].includes(n)?q.default.m600:B.default,$=b.useRef(0),K=u=>{var w;if(u.key==="Enter"||u.key===" "){u.preventDefault();const y=Date.now();if(y-$.current<500){u.stopPropagation();return}$.current=y,!s&&!i&&((w=h.current)==null||w.click())}},x=r.jsxs(A,{$selectedColor:P,$hoverColor:S,$height:m,$width:R||E,$activeColor:W,disabled:s,$isLoading:i,tabIndex:0,"aria-disabled":s,onKeyDown:K,children:[r.jsx(Q,{ref:h,type:z,accept:I,multiple:M,disabled:s,onChange:T,tabIndex:-1}),r.jsx(J,{$isLoading:i,children:r.jsx(O.default,{size:"small",color:c})}),r.jsxs(N,{$isLoading:i,children:[p&&r.jsx(p,{color:c,size:a+19}),r.jsx(G,{color:c,size:`${a}rem`,$prefixIcon:!!p,$suffixIcon:!!f,$iconSize:a+19,title:e,children:e}),f&&r.jsx(f,{color:c,size:a+19})]})]});return r.jsx(Z,{$height:m,disabled:s,$isLoading:i,...D,children:i||s?x:r.jsx(V,{theme:n,children:x})})};_.propTypes={label:o.default.string,labelColor:o.default.string,theme:o.default.string,size:o.default.string,width:o.default.oneOfType([o.default.string,o.default.number]),isLoading:o.default.bool,disabled:o.default.bool,prefixIcon:o.default.elementType,suffixIcon:o.default.elementType,type:o.default.string,accept:o.default.string,isMultiple:o.default.bool,onChange:o.default.func};exports.default=_;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),D=require("react"),y=require("styled-components"),L=require("../Icons/ChevronLeft.cjs"),b=require("../Icons/ChevronRight.cjs"),I=require("../Ripple/Ripple.cjs"),B=require("../../colors/colorMap.cjs"),P=require("../../colors/teal.cjs"),M=require("../../colors/grey.cjs"),q=require("../../colors/white.cjs"),O=require("../../colors/black.cjs"),o=require("./constants.cjs"),F=e=>e&&e.__esModule?e:{default:e},a=F(y),j=e=>({$shades:i})=>{if(["#FFFFFF"].includes(i))return O.black.m900;if(e===o.SELECTED_BG)return i.m600;if(e===o.NOT_SELECTED_BG)return i.m50;if(e===o.ACTIVE_NOT_SELECTED_BG)return i.m100},p=a.default.nav`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),D=require("react"),y=require("styled-components"),G=require("../Icons/ChevronLeft.cjs"),L=require("../Icons/ChevronRight.cjs"),I=require("../Ripple/Ripple.cjs"),B=require("../../colors/colorMap.cjs"),P=require("../../colors/teal.cjs"),M=require("../../colors/grey.cjs"),q=require("../../colors/white.cjs"),O=require("../../colors/black.cjs"),o=require("./constants.cjs"),F=e=>e&&e.__esModule?e:{default:e},a=F(y),j=e=>({$shades:i})=>{if(["#FFFFFF"].includes(i))return O.black.m900;if(e===o.SELECTED_BG)return i.m600;if(e===o.NOT_SELECTED_BG)return i.m50;if(e===o.ACTIVE_NOT_SELECTED_BG)return i.m100},p=a.default.nav`
2
2
  display: flex;
3
3
  justify-content: center;
4
4
  align-items: center;
@@ -55,7 +55,7 @@
55
55
  color: ${M.default.m700};
56
56
  font-size: 1.4rem;
57
57
  user-select: none;
58
- `,G=a.default.button`
58
+ `,b=a.default.button`
59
59
  border: none;
60
60
  background: none;
61
61
  padding: 0;
@@ -69,13 +69,13 @@
69
69
  &:focus-visible {
70
70
  outline: 1px solid ${({$shades:e})=>e==null?void 0:e.m600};
71
71
  }
72
- `,z=a.default(L.default)`
72
+ `,z=a.default(G.default)`
73
73
  cursor: pointer;
74
- `,g=a.default(b.default)`
74
+ `,g=a.default(L.default)`
75
75
  cursor: pointer;
76
76
  `,w=a.default.div`
77
77
  min-width: ${({size:e})=>e};
78
78
  display: flex;
79
79
  align-items: center;
80
80
  justify-content: space-between;
81
- `,h=({size:e,selected:i,shades:n,changePage:C})=>t=>{const _=o.SIZE_REM_MAPPING[e],$=o.FONT_SIZE_MAPPING[e],f=n,s=i===t,l=()=>{C(t)},x=u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),l())};return r.jsx(K,{"data-testid":s?"current-page":`test-${t}`,$isSelected:s,onClick:l,onKeyDown:x,tabIndex:s?0:-1,"aria-label":`Page ${t}`,"aria-current":s?"page":void 0,$shades:f,$individualRemSize:_,$fontRemSize:$,children:t},`page_${t}`)},T=()=>r.jsx(Z,{"aria-hidden":"true",children:"…"}),A=({iconSize:e,shades:i,setPrevPage:n})=>r.jsx(G,{onClick:n,"aria-label":"Previous page",$shades:i,children:r.jsx(I.default,{rippleColor:i.m50,children:r.jsx(z,{size:e,"aria-hidden":"true"})})}),k=({iconSize:e,shades:i,setNextPage:n})=>r.jsx(G,{onClick:n,"aria-label":"Next page",$shades:i,children:r.jsx(I.default,{rippleColor:i.m50,children:r.jsx(g,{size:e,"aria-hidden":"true"})})}),U=({pageNumber:e,setPageNumber:i,totalPages:n,theme:C="lime",size:t=o.MEDIUM,isDisabled:_=!1,...$})=>{var R;const f=D.useRef(null),s=D.useRef(!1);D.useEffect(()=>{var d,v;s.current&&(s.current=!1,(v=(d=f.current)==null?void 0:d.querySelector('[aria-current="page"]'))==null||v.focus())},[e]);const l=d=>{d!==e&&i(d)},x=()=>{e>1&&l(e-1)},u=()=>{e<n&&l(e+1)},S=d=>{["ArrowLeft","ArrowUp"].includes(d.code)&&(s.current=!0,x()),["ArrowRight","ArrowDown"].includes(d.code)&&(s.current=!0,u())},c=(R=B.default[C])!=null?R:P.default,m=o.SIZE_REM_MAPPING[t],E=o.ICON_SIZE_MAPPING[t];return n<=7?r.jsxs(p,{ref:f,onKeyDown:S,"aria-label":"Pagination",$isDisabled:_,...$,children:[r.jsx(A,{iconSize:E,shades:c,setPrevPage:x}),r.jsx(w,{size:`${n*m}rem`,children:Array.from({length:n},(d,v)=>v+1).map(h({size:t,selected:e,shades:c,changePage:l}))}),r.jsx(k,{iconSize:E,shades:c,setNextPage:u})]}):n<10||e<4||e>n-3&&e<=n?r.jsxs(p,{ref:f,onKeyDown:S,"aria-label":"Pagination",$isDisabled:_,...$,children:[r.jsx(A,{iconSize:E,shades:c,setPrevPage:x}),r.jsxs(w,{size:`${9*m}rem`,children:[[1,2,3,4].map(h({size:t,selected:e,shades:c,changePage:l})),T(),[n-3,n-2,n-1,n].map(h({size:t,selected:e,shades:c,changePage:l}))]}),r.jsx(k,{iconSize:E,shades:c,setNextPage:u})]}):r.jsxs(p,{ref:f,onKeyDown:S,"aria-label":"Pagination",$isDisabled:_,children:[r.jsx(A,{iconSize:E,shades:c,setPrevPage:x}),r.jsxs(w,{size:`${9*m}rem`,children:[[1,2].map(h({size:t,selected:e,shades:c,changePage:l})),e>4&&T(),[e-1,e,e+1].map(h({size:t,selected:e,shades:c,changePage:l})),e<n-3&&T(),[n-1,n].map(h({size:t,selected:e,shades:c,changePage:l}))]}),r.jsx(k,{iconSize:E,shades:c,setNextPage:u})]})};exports.default=U;
81
+ `,h=({size:e,selected:i,shades:n,changePage:C})=>t=>{const _=o.SIZE_REM_MAPPING[e],$=o.FONT_SIZE_MAPPING[e],f=n,l=i===t,s=()=>{C(t)},x=u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),s())};return r.jsx(K,{"data-testid":l?"current-page":`test-${t}`,$isSelected:l,onClick:s,onKeyDown:x,tabIndex:l?0:-1,"aria-label":`Page ${t}`,"aria-current":l?"page":void 0,$shades:f,$individualRemSize:_,$fontRemSize:$,children:t},`page_${t}`)},T=()=>r.jsx(Z,{"aria-hidden":"true",children:"…"}),A=({iconSize:e,shades:i,setPrevPage:n})=>r.jsx(b,{onClick:n,"aria-label":"Previous page",$shades:i,children:r.jsx(I.default,{rippleColor:i.m50,borderRadius:"50%",children:r.jsx(z,{size:e,"aria-hidden":"true"})})}),R=({iconSize:e,shades:i,setNextPage:n})=>r.jsx(b,{onClick:n,"aria-label":"Next page",$shades:i,children:r.jsx(I.default,{rippleColor:i.m50,borderRadius:"50%",children:r.jsx(g,{size:e,"aria-hidden":"true"})})}),U=({pageNumber:e,setPageNumber:i,totalPages:n,theme:C="lime",size:t=o.MEDIUM,isDisabled:_=!1,...$})=>{var k;const f=D.useRef(null),l=D.useRef(!1);D.useEffect(()=>{var d,v;l.current&&(l.current=!1,(v=(d=f.current)==null?void 0:d.querySelector('[aria-current="page"]'))==null||v.focus())},[e]);const s=d=>{d!==e&&i(d)},x=()=>{e>1&&s(e-1)},u=()=>{e<n&&s(e+1)},S=d=>{["ArrowLeft","ArrowUp"].includes(d.code)&&(l.current=!0,x()),["ArrowRight","ArrowDown"].includes(d.code)&&(l.current=!0,u())},c=(k=B.default[C])!=null?k:P.default,m=o.SIZE_REM_MAPPING[t],E=o.ICON_SIZE_MAPPING[t];return n<=7?r.jsxs(p,{ref:f,onKeyDown:S,"aria-label":"Pagination",$isDisabled:_,...$,children:[r.jsx(A,{iconSize:E,shades:c,setPrevPage:x}),r.jsx(w,{size:`${n*m}rem`,children:Array.from({length:n},(d,v)=>v+1).map(h({size:t,selected:e,shades:c,changePage:s}))}),r.jsx(R,{iconSize:E,shades:c,setNextPage:u})]}):n<10||e<4||e>n-3&&e<=n?r.jsxs(p,{ref:f,onKeyDown:S,"aria-label":"Pagination",$isDisabled:_,...$,children:[r.jsx(A,{iconSize:E,shades:c,setPrevPage:x}),r.jsxs(w,{size:`${9*m}rem`,children:[[1,2,3,4].map(h({size:t,selected:e,shades:c,changePage:s})),T(),[n-3,n-2,n-1,n].map(h({size:t,selected:e,shades:c,changePage:s}))]}),r.jsx(R,{iconSize:E,shades:c,setNextPage:u})]}):r.jsxs(p,{ref:f,onKeyDown:S,"aria-label":"Pagination",$isDisabled:_,children:[r.jsx(A,{iconSize:E,shades:c,setPrevPage:x}),r.jsxs(w,{size:`${9*m}rem`,children:[[1,2].map(h({size:t,selected:e,shades:c,changePage:s})),e>4&&T(),[e-1,e,e+1].map(h({size:t,selected:e,shades:c,changePage:s})),e<n-3&&T(),[n-1,n].map(h({size:t,selected:e,shades:c,changePage:s}))]}),r.jsx(R,{iconSize:E,shades:c,setNextPage:u})]})};exports.default=U;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("react/jsx-runtime"),c=require("react"),g=".ripple-container{position:relative;overflow:hidden;display:inline-block;cursor:pointer}.ripple-effect{position:absolute;border-radius:50%;transform:scale(0);animation:ripple-animation 600ms linear;pointer-events:none}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}",h=({children:a,rippleColor:p="rgba(255, 255, 255, 0.3)",className:u="",...d})=>{const i=c.useRef(null);c.useEffect(()=>{if(!document.getElementById("meticulous-ripple-styles")){const e=document.createElement("style");e.id="meticulous-ripple-styles",e.textContent=g,document.head.appendChild(e)}},[]);const l=(e,n)=>{const r=i.current;if(!r)return;const t=document.createElement("span"),s=r.getBoundingClientRect(),o=Math.max(s.width,s.height);t.style.width=t.style.height=`${o}px`,t.style.left=`${e-o/2}px`,t.style.top=`${n-o/2}px`,t.style.backgroundColor=p,t.classList.add("ripple-effect"),r.appendChild(t),t.addEventListener("animationend",()=>t.remove())},m=e=>{if(e.detail===0)return;const n=i.current.getBoundingClientRect();l(e.clientX-n.left,e.clientY-n.top)},f=e=>{if(e.key!=="Enter"&&e.key!==" ")return;const n=i.current.getBoundingClientRect();l(n.width/2,n.height/2)};return y.jsx("div",{ref:i,className:`ripple-container ${u}`,onClick:m,onKeyDown:f,...d,children:a})};exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("react/jsx-runtime"),a=require("react"),h=".ripple-container{position:relative;overflow:hidden;display:inline-block;cursor:pointer}.ripple-effect{position:absolute;border-radius:50%;transform:scale(0);animation:ripple-animation 600ms linear;pointer-events:none}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}",R=({children:p,rippleColor:u="rgba(255, 255, 255, 0.3)",borderRadius:d,className:m="",...l})=>{const i=a.useRef(null);a.useEffect(()=>{if(!document.getElementById("meticulous-ripple-styles")){const e=document.createElement("style");e.id="meticulous-ripple-styles",e.textContent=h,document.head.appendChild(e)}},[]);const s=(e,n)=>{const r=i.current;if(!r)return;const t=document.createElement("span"),c=r.getBoundingClientRect(),o=Math.max(c.width,c.height);t.style.width=t.style.height=`${o}px`,t.style.left=`${e-o/2}px`,t.style.top=`${n-o/2}px`,t.style.backgroundColor=u,t.classList.add("ripple-effect"),r.appendChild(t),t.addEventListener("animationend",()=>t.remove())},f=e=>{if(e.detail===0)return;const n=i.current.getBoundingClientRect();s(e.clientX-n.left,e.clientY-n.top)},y=e=>{if(e.key!=="Enter"&&e.key!==" ")return;const n=i.current.getBoundingClientRect();s(n.width/2,n.height/2)};return g.jsx("div",{ref:i,className:`ripple-container ${m}`,onClick:f,onKeyDown:y,...l,style:{borderRadius:d,...l.style},children:p})};exports.default=R;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),n=require("react"),G=require("react-dom"),A=require("prop-types"),l=require("styled-components"),S=require("../Icons/Close.cjs"),F=require("../Icons/Check.cjs"),X=require("../Icons/Info.cjs"),D=require("../Icons/WarningTriangleFilled.cjs"),z=require("../../colors/white.cjs"),$=require("../../colors/grey.cjs"),s=require("./constants.cjs"),E=e=>e&&e.__esModule?e:{default:e},a=E(A),i=E(l),q=()=>{},U=l.keyframes`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),s=require("react"),G=require("react-dom"),A=require("prop-types"),l=require("styled-components"),S=require("../Icons/Close.cjs"),F=require("../Icons/Check.cjs"),X=require("../Icons/Info.cjs"),D=require("../Icons/WarningTriangleFilled.cjs"),z=require("../../colors/white.cjs"),$=require("../../colors/grey.cjs"),i=require("./constants.cjs"),E=e=>e&&e.__esModule?e:{default:e},a=E(A),n=E(l),q=()=>{},U=l.keyframes`
2
2
  from { transform: scale(0); }
3
3
  to { transform: scale(1); }
4
4
  `,B=l.keyframes`
@@ -22,7 +22,7 @@
22
22
  opacity: 0;
23
23
  transform: translateX(100%); /* Move off-screen to the right */
24
24
  }
25
- `,K=i.default.div`
25
+ `,K=n.default.div`
26
26
  position: fixed;
27
27
  top: 1.6rem;
28
28
  right: 1.6rem;
@@ -31,7 +31,7 @@
31
31
  display: flex;
32
32
  flex-direction: column;
33
33
  gap: 1.6rem;
34
- `,Q=i.default.div`
34
+ `,Q=n.default.div`
35
35
  display: flex;
36
36
  align-items: center;
37
37
  justify-content: space-between;
@@ -73,7 +73,7 @@
73
73
  border-radius: 0.8rem;
74
74
  padding: 0.4rem 1rem;
75
75
  }
76
- `,V=i.default.div`
76
+ `,V=n.default.div`
77
77
  position: absolute;
78
78
  top: 50%;
79
79
  left: 50%;
@@ -97,7 +97,7 @@
97
97
  width: 1.76rem;
98
98
  height: 1.76rem;
99
99
  }
100
- `,Y=i.default.div`
100
+ `,Y=n.default.div`
101
101
  position: relative;
102
102
  width: 6.4rem;
103
103
  height: 6.4rem;
@@ -119,7 +119,7 @@
119
119
  width: 3.9rem;
120
120
  height: 3.9rem;
121
121
  }
122
- `,Z=i.default.div`
122
+ `,Z=n.default.div`
123
123
  position: absolute;
124
124
  top: ${({$isWarning:e})=>e?"49%":"50%"};
125
125
  left: 50%;
@@ -139,7 +139,7 @@
139
139
  );
140
140
  scale: 0.75;
141
141
  }
142
- `,ee=i.default.div`
142
+ `,ee=n.default.div`
143
143
  position: absolute;
144
144
  top: 50%;
145
145
  left: 50%;
@@ -167,7 +167,7 @@
167
167
  `,R=75.4,te=l.keyframes`
168
168
  from { stroke-dashoffset: ${R}; }
169
169
  to { stroke-dashoffset: 0; }
170
- `,re=i.default.div`
170
+ `,re=n.default.div`
171
171
  position: relative;
172
172
  display: inline-flex;
173
173
  align-items: center;
@@ -175,7 +175,8 @@
175
175
  flex-shrink: 0;
176
176
  width: 2.8rem;
177
177
  height: 2.8rem;
178
- `,ae=i.default.svg`
178
+ cursor: pointer;
179
+ `,ae=n.default.svg`
179
180
  position: absolute;
180
181
  inset: 0;
181
182
  transform: ${({$hasClockwiseRotation:e})=>e?"rotate(-90deg)":"rotate(90deg) scaleX(-1)"};
@@ -199,9 +200,7 @@
199
200
  animation: ${te} ${({$duration:e})=>e-.5}s linear forwards;
200
201
  animation-play-state: ${({$paused:e})=>e?"paused":"running"};
201
202
  }
202
- `,se=i.default(S.default)`
203
- cursor: pointer;
204
- `,ie=i.default.div`
203
+ `,ie=n.default.div`
205
204
  font-weight: 600;
206
205
  font-size: 1.92rem;
207
206
  color: ${$.default.m800};
@@ -213,7 +212,7 @@
213
212
  @media screen and (max-width: 380px) {
214
213
  font-size: 1.56rem;
215
214
  }
216
- `,ne=i.default.div`
215
+ `,se=n.default.div`
217
216
  display: flex;
218
217
  flex-direction: column;
219
218
  gap: 0.32rem;
@@ -231,7 +230,7 @@
231
230
  max-width: 18rem;
232
231
  width: auto;
233
232
  }
234
- `,oe=i.default.div`
233
+ `,ne=n.default.div`
235
234
  font-weight: 400;
236
235
  font-size: 1.6rem;
237
236
  color: ${$.default.m700};
@@ -243,4 +242,4 @@
243
242
  @media screen and (max-width: 380px) {
244
243
  font-size: 1.32rem;
245
244
  }
246
- `,de=(e,r)=>e===s.ERROR?t.jsx(S.default,{size:16,color:r}):e===s.SUCCESS?t.jsx(F.default,{size:18,color:r}):e===s.WARNING?t.jsx(D.default,{size:28,color:z.default}):t.jsx(X.default,{size:22,color:r}),ce=e=>e===s.ERROR?1.6:e===s.SUCCESS?1.76:e===s.WARNING?2.8:2.08,le=({type:e,$main:r,$side:o})=>{const d=de(e,r),c=e===s.WARNING;return t.jsxs(Y,{"aria-hidden":"true",$side:o,children:[t.jsx(ee,{$main:r}),!c&&t.jsx(V,{$main:r,type:e}),t.jsx(Z,{size:ce(e),$isWarning:c,children:d})]})},I=({toasts:e,...r})=>{const[o,d]=n.useState(e);n.useEffect(()=>{d(e)},[e]);const c=({type:f,id:u,title:h,subtitle:x,duration:m,onExpire:p=q},g)=>n.createElement(y,{type:f,title:h,subtitle:x,duration:m,key:u,onExpire:p});return G.createPortal(t.jsx(K,{...r,children:[...o].reverse().map(c)}),document.body)};I.propTypes={toasts:a.default.arrayOf(a.default.shape({id:a.default.any,type:a.default.string,title:a.default.string,subtitle:a.default.string,duration:a.default.number,onExpire:a.default.func}))};const O=(e,r,o)=>()=>{e(!0),setTimeout(()=>{r(!1),o()},500)},y=({type:e=s.INFO,visible:r=!0,duration:o=5,onExpire:d=q,hasClockwiseRotation:c=!1,title:f,subtitle:u,...h})=>{var T;const[x,m]=n.useState(r),[p,g]=n.useState(!1),[M,j]=n.useState(!1),w=n.useRef(null),b=n.useRef((o-.5)*1e3),v=n.useRef(null),C=W=>{v.current=Date.now(),w.current=setTimeout(O(g,m,d),W)};n.useEffect(()=>{m(r)},[r]),n.useEffect(()=>(C(b.current),()=>clearTimeout(w.current)),[]);const _=()=>{clearTimeout(w.current),b.current-=Date.now()-v.current,j(!0)},N=()=>{j(!1),C(b.current)},{main:k,side:L,bg:P}=(T=s.COLOR_MAP[e])!=null?T:s.INFO_COLORS;if(x)return t.jsxs(Q,{$bg:P,role:e===s.ERROR?"alert":"status","aria-live":e===s.ERROR?"assertive":"polite","aria-atomic":"true",className:`${p?"fade-out":"fade-in"}`,onMouseEnter:_,onMouseLeave:N,...h,children:[t.jsx(le,{type:e,$main:k,$side:L}),t.jsxs(ne,{children:[t.jsx(ie,{children:f}),u&&t.jsx(oe,{children:u})]}),t.jsxs(re,{children:[t.jsxs(ae,{"aria-hidden":"true",viewBox:"0 0 28 28",$duration:o,$color:k,$paused:M,$hasClockwiseRotation:c,children:[t.jsx("circle",{cx:"14",cy:"14",r:"12"}),t.jsx("circle",{cx:"14",cy:"14",r:"12"})]}),t.jsx(se,{"aria-label":"Close notification",size:13,color:$.default.m600,onClick:O(g,m,d)})]})]})};y.propTypes={type:a.default.string,visible:a.default.bool,duration:a.default.number,onExpire:a.default.func,hasClockwiseRotation:a.default.bool,title:a.default.string,subtitle:a.default.string};exports.ToastContainer=I;exports.default=y;
245
+ `,oe=(e,r)=>e===i.ERROR?t.jsx(S.default,{size:16,color:r}):e===i.SUCCESS?t.jsx(F.default,{size:18,color:r}):e===i.WARNING?t.jsx(D.default,{size:28,color:z.default}):t.jsx(X.default,{size:22,color:r}),de=e=>e===i.ERROR?1.6:e===i.SUCCESS?1.76:e===i.WARNING?2.8:2.08,ce=({type:e,$main:r,$side:o})=>{const d=oe(e,r),c=e===i.WARNING;return t.jsxs(Y,{"aria-hidden":"true",$side:o,children:[t.jsx(ee,{$main:r}),!c&&t.jsx(V,{$main:r,type:e}),t.jsx(Z,{size:de(e),$isWarning:c,children:d})]})},I=({toasts:e,...r})=>{const[o,d]=s.useState(e);s.useEffect(()=>{d(e)},[e]);const c=({type:f,id:u,title:h,subtitle:x,duration:m,onExpire:g=q},p)=>s.createElement(y,{type:f,title:h,subtitle:x,duration:m,key:u,onExpire:g});return G.createPortal(t.jsx(K,{...r,children:[...o].reverse().map(c)}),document.body)};I.propTypes={toasts:a.default.arrayOf(a.default.shape({id:a.default.any,type:a.default.string,title:a.default.string,subtitle:a.default.string,duration:a.default.number,onExpire:a.default.func}))};const O=(e,r,o)=>()=>{e(!0),setTimeout(()=>{r(!1),o()},500)},y=({type:e=i.INFO,visible:r=!0,duration:o=5,onExpire:d=q,hasClockwiseRotation:c=!1,title:f,subtitle:u,...h})=>{var T;const[x,m]=s.useState(r),[g,p]=s.useState(!1),[M,j]=s.useState(!1),w=s.useRef(null),b=s.useRef((o-.5)*1e3),v=s.useRef(null),k=W=>{v.current=Date.now(),w.current=setTimeout(O(p,m,d),W)};s.useEffect(()=>{m(r)},[r]),s.useEffect(()=>(k(b.current),()=>clearTimeout(w.current)),[]);const _=()=>{clearTimeout(w.current),b.current-=Date.now()-v.current,j(!0)},N=()=>{j(!1),k(b.current)},{main:C,side:L,bg:P}=(T=i.COLOR_MAP[e])!=null?T:i.INFO_COLORS;if(x)return t.jsxs(Q,{$bg:P,role:e===i.ERROR?"alert":"status","aria-live":e===i.ERROR?"assertive":"polite","aria-atomic":"true",className:`${g?"fade-out":"fade-in"}`,onMouseEnter:_,onMouseLeave:N,...h,children:[t.jsx(ce,{type:e,$main:C,$side:L}),t.jsxs(se,{children:[t.jsx(ie,{children:f}),u&&t.jsx(ne,{children:u})]}),t.jsxs(re,{onClick:O(p,m,d),children:[t.jsxs(ae,{"aria-hidden":"true",viewBox:"0 0 28 28",$duration:o,$color:C,$paused:M,$hasClockwiseRotation:c,children:[t.jsx("circle",{cx:"14",cy:"14",r:"12"}),t.jsx("circle",{cx:"14",cy:"14",r:"12"})]}),t.jsx(S.default,{"aria-label":"Close notification",size:13,color:$.default.m600})]})]})};y.propTypes={type:a.default.string,visible:a.default.bool,duration:a.default.number,onExpire:a.default.func,hasClockwiseRotation:a.default.bool,title:a.default.string,subtitle:a.default.string};exports.ToastContainer=I;exports.default=y;
@@ -1,15 +1,15 @@
1
1
  import { jsxs as z, jsx as i } from "react/jsx-runtime";
2
2
  import { useRef as D } from "react";
3
- import R from "../Spinner/Spinner.js";
4
- import j from "../../colors/colorMap.js";
3
+ import j from "../Spinner/Spinner.js";
4
+ import B from "../../colors/colorMap.js";
5
5
  import { blue as w } from "../../colors/blue.js";
6
- import B from "../Ripple/Ripple.js";
7
- import E from "../../colors/white.js";
6
+ import E from "../Ripple/Ripple.js";
7
+ import P from "../../colors/white.js";
8
8
  import y from "../../colors/grey.js";
9
- import { MEDIUM as P, SIZE as S } from "./constants.js";
9
+ import { MEDIUM as S, SIZE as K } from "./constants.js";
10
10
  import t from "prop-types";
11
11
  import l, { css as a } from "styled-components";
12
- const K = l.button`
12
+ const M = l.button`
13
13
  height: ${({ $height: o }) => o}rem;
14
14
  width: ${({ $width: o }) => o}rem;
15
15
  border-radius: 0.96rem;
@@ -37,7 +37,7 @@ const K = l.button`
37
37
  &:focus-visible {
38
38
  outline: none;
39
39
  }
40
- `, M = l.div`
40
+ `, W = l.div`
41
41
  font-size: ${({ $font: o }) => o}rem;
42
42
  font-weight: 500;
43
43
  max-width: 100%;
@@ -45,7 +45,7 @@ const K = l.button`
45
45
  color: ${({ $textColor: o }) => o};
46
46
  opacity: ${({ $isLoading: o }) => o ? 0 : 1};
47
47
  transition: opacity 0.3s ease;
48
- `, W = l.div`
48
+ `, O = l.div`
49
49
  height: ${({ $height: o }) => o}rem;
50
50
  width: ${({ $width: o }) => o}rem;
51
51
  display: inline-block;
@@ -64,7 +64,7 @@ const K = l.button`
64
64
  transform: translateY(-2px);
65
65
  }
66
66
  `};
67
- `, O = l.div`
67
+ `, U = l.div`
68
68
  position: absolute;
69
69
  inset: 0;
70
70
  display: flex;
@@ -73,20 +73,21 @@ const K = l.button`
73
73
  opacity: ${({ $isLoading: o }) => o ? 1 : 0};
74
74
  transition: opacity 0.3s ease;
75
75
  pointer-events: none;
76
- `, U = ({ theme: o, children: e }) => /* @__PURE__ */ i(B, { rippleColor: o.m100, children: e }), Y = (o) => {
76
+ `, Y = ({ theme: o, children: e }) => /* @__PURE__ */ i(E, { rippleColor: o.m100, borderRadius: "0.96rem", children: e }), Z = (o) => {
77
77
  var b;
78
78
  const {
79
79
  children: e,
80
80
  theme: r = w,
81
- size: v = P,
81
+ size: v = S,
82
82
  width: c,
83
- leftIcon: Z,
84
- rightIcon: q,
83
+ leftIcon: q,
84
+ rightIcon: A,
85
85
  isLoading: n,
86
86
  textColor: m,
87
87
  onKeyDown: d,
88
- ...C
89
- } = o || {}, p = D(0), x = (s) => {
88
+ style: C,
89
+ ...x
90
+ } = o || {}, p = D(0), k = (s) => {
90
91
  if (s.key === "Enter" || s.key === " ") {
91
92
  const g = Date.now();
92
93
  if (g - p.current < 500) {
@@ -96,37 +97,38 @@ const K = l.button`
96
97
  p.current = g;
97
98
  }
98
99
  d == null || d(s);
99
- }, { m400: k, m500: I, m600: L } = (b = j[r]) != null ? b : w, { height: h, width: f, font: T } = S[v] || {}, $ = ["white", "yellow"].includes(r) ? y.m600 : E, u = /* @__PURE__ */ z(
100
- K,
100
+ }, { m400: I, m500: L, m600: R } = (b = B[r]) != null ? b : w, { height: h, width: f, font: T } = K[v] || {}, u = ["white", "yellow"].includes(r) ? y.m600 : P, $ = /* @__PURE__ */ z(
101
+ M,
101
102
  {
102
103
  type: "button",
103
- ...C,
104
- onKeyDown: x,
105
- $hoverColor: I,
106
- $activeColor: L,
107
- $selectedColor: k,
104
+ ...x,
105
+ onKeyDown: k,
106
+ $hoverColor: L,
107
+ $activeColor: R,
108
+ $selectedColor: I,
108
109
  $height: h,
109
110
  $width: c || f,
110
111
  disabled: o.disabled,
111
112
  $isLoading: n,
112
113
  children: [
113
- /* @__PURE__ */ i(O, { $isLoading: n, children: /* @__PURE__ */ i(R, { size: "small", color: m || $ }) }),
114
- /* @__PURE__ */ i(M, { $isLoading: n, $textColor: m || $, $font: T, children: e })
114
+ /* @__PURE__ */ i(U, { $isLoading: n, children: /* @__PURE__ */ i(j, { size: "small", color: m || u }) }),
115
+ /* @__PURE__ */ i(W, { $isLoading: n, $textColor: m || u, $font: T, children: e })
115
116
  ]
116
117
  }
117
118
  );
118
119
  return /* @__PURE__ */ i(
119
- W,
120
+ O,
120
121
  {
122
+ style: C,
121
123
  $height: h,
122
124
  $width: c || f,
123
125
  disabled: o.disabled,
124
126
  $isLoading: n,
125
- children: n ? u : /* @__PURE__ */ i(U, { theme: r, children: u })
127
+ children: n ? $ : /* @__PURE__ */ i(Y, { theme: r, children: $ })
126
128
  }
127
129
  );
128
130
  };
129
- Y.propTypes = {
131
+ Z.propTypes = {
130
132
  /** Button label or content */
131
133
  children: t.node,
132
134
  /** Color theme key from the meticulous-ui color map. Defaults to `'blue'` */
@@ -147,5 +149,5 @@ Y.propTypes = {
147
149
  disabled: t.bool
148
150
  };
149
151
  export {
150
- Y as default
152
+ Z as default
151
153
  };
@@ -98,7 +98,7 @@ const Z = l.div`
98
98
  white-space: nowrap;
99
99
  opacity: 0;
100
100
  pointer-events: none;
101
- `, Q = ({ theme: e, children: o }) => /* @__PURE__ */ t(H, { rippleColor: e.m100, children: o }), V = ({
101
+ `, Q = ({ theme: e, children: o }) => /* @__PURE__ */ t(H, { rippleColor: e.m100, borderRadius: "0.96rem", children: o }), V = ({
102
102
  label: e,
103
103
  labelColor: o,
104
104
  theme: i = C,
@@ -9,13 +9,13 @@ import U from "../../colors/teal.js";
9
9
  import j from "../../colors/grey.js";
10
10
  import L from "../../colors/white.js";
11
11
  import { black as q } from "../../colors/black.js";
12
- import { ICON_SIZE_MAPPING as H, MEDIUM as V, FONT_SIZE_MAPPING as g, SIZE_REM_MAPPING as G, SELECTED_BG as I, NOT_SELECTED_BG as T, ACTIVE_NOT_SELECTED_BG as K } from "./constants.js";
12
+ import { ICON_SIZE_MAPPING as H, MEDIUM as V, FONT_SIZE_MAPPING as g, SIZE_REM_MAPPING as G, SELECTED_BG as I, NOT_SELECTED_BG as b, ACTIVE_NOT_SELECTED_BG as K } from "./constants.js";
13
13
  const v = (e) => ({ $shades: i }) => {
14
14
  if (["#FFFFFF"].includes(i))
15
15
  return q.m900;
16
16
  if (e === I)
17
17
  return i.m600;
18
- if (e === T)
18
+ if (e === b)
19
19
  return i.m50;
20
20
  if (e === K)
21
21
  return i.m100;
@@ -60,7 +60,7 @@ const v = (e) => ({ $shades: i }) => {
60
60
  background-color: transparent;
61
61
 
62
62
  &:hover {
63
- background-color: ${v(T)};
63
+ background-color: ${v(b)};
64
64
  }
65
65
 
66
66
  &:active {
@@ -69,7 +69,7 @@ const v = (e) => ({ $shades: i }) => {
69
69
  }
70
70
 
71
71
  &:focus-visible {
72
- outline: 1px solid ${v(T)};
72
+ outline: 1px solid ${v(b)};
73
73
  }
74
74
  `}
75
75
  `, Q = f.span`
@@ -122,7 +122,7 @@ const v = (e) => ({ $shades: i }) => {
122
122
  },
123
123
  `page_${n}`
124
124
  );
125
- }, D = () => /* @__PURE__ */ o(Q, { "aria-hidden": "true", children: "…" }), S = ({ iconSize: e, shades: i, setPrevPage: r }) => /* @__PURE__ */ o(P, { onClick: r, "aria-label": "Previous page", $shades: i, children: /* @__PURE__ */ o(M, { rippleColor: i.m50, children: /* @__PURE__ */ o(W, { size: e, "aria-hidden": "true" }) }) }), _ = ({ iconSize: e, shades: i, setNextPage: r }) => /* @__PURE__ */ o(P, { onClick: r, "aria-label": "Next page", $shades: i, children: /* @__PURE__ */ o(M, { rippleColor: i.m50, children: /* @__PURE__ */ o(X, { size: e, "aria-hidden": "true" }) }) }), fe = ({
125
+ }, D = () => /* @__PURE__ */ o(Q, { "aria-hidden": "true", children: "…" }), S = ({ iconSize: e, shades: i, setPrevPage: r }) => /* @__PURE__ */ o(P, { onClick: r, "aria-label": "Previous page", $shades: i, children: /* @__PURE__ */ o(M, { rippleColor: i.m50, borderRadius: "50%", children: /* @__PURE__ */ o(W, { size: e, "aria-hidden": "true" }) }) }), _ = ({ iconSize: e, shades: i, setNextPage: r }) => /* @__PURE__ */ o(P, { onClick: r, "aria-label": "Next page", $shades: i, children: /* @__PURE__ */ o(M, { rippleColor: i.m50, borderRadius: "50%", children: /* @__PURE__ */ o(X, { size: e, "aria-hidden": "true" }) }) }), fe = ({
126
126
  pageNumber: e,
127
127
  setPageNumber: i,
128
128
  totalPages: r,
@@ -131,7 +131,7 @@ const v = (e) => ({ $shades: i }) => {
131
131
  isDisabled: p = !1,
132
132
  ...y
133
133
  }) => {
134
- var b;
134
+ var T;
135
135
  const a = F(null), l = F(!1);
136
136
  B(() => {
137
137
  var s, w;
@@ -145,7 +145,7 @@ const v = (e) => ({ $shades: i }) => {
145
145
  e < r && c(e + 1);
146
146
  }, E = (s) => {
147
147
  ["ArrowLeft", "ArrowUp"].includes(s.code) && (l.current = !0, u()), ["ArrowRight", "ArrowDown"].includes(s.code) && (l.current = !0, d());
148
- }, t = (b = Z[x]) != null ? b : U, C = G[n], m = H[n];
148
+ }, t = (T = Z[x]) != null ? T : U, C = G[n], m = H[n];
149
149
  return r <= 7 ? /* @__PURE__ */ $(
150
150
  k,
151
151
  {
@@ -1,44 +1,46 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import { useRef as y, useEffect as h } from "react";
3
- const g = ".ripple-container{position:relative;overflow:hidden;display:inline-block;cursor:pointer}.ripple-effect{position:absolute;border-radius:50%;transform:scale(0);animation:ripple-animation 600ms linear;pointer-events:none}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}", x = ({
4
- children: c,
1
+ import { jsx as y } from "react/jsx-runtime";
2
+ import { useRef as h, useEffect as g } from "react";
3
+ const C = ".ripple-container{position:relative;overflow:hidden;display:inline-block;cursor:pointer}.ripple-effect{position:absolute;border-radius:50%;transform:scale(0);animation:ripple-animation 600ms linear;pointer-events:none}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}", E = ({
4
+ children: a,
5
5
  rippleColor: p = "rgba(255, 255, 255, 0.3)",
6
- className: a = "",
7
- ...d
6
+ borderRadius: d,
7
+ className: u = "",
8
+ ...l
8
9
  }) => {
9
- const i = y(null);
10
- h(() => {
10
+ const i = h(null);
11
+ g(() => {
11
12
  if (!document.getElementById("meticulous-ripple-styles")) {
12
13
  const e = document.createElement("style");
13
- e.id = "meticulous-ripple-styles", e.textContent = g, document.head.appendChild(e);
14
+ e.id = "meticulous-ripple-styles", e.textContent = C, document.head.appendChild(e);
14
15
  }
15
16
  }, []);
16
- const l = (e, n) => {
17
+ const s = (e, n) => {
17
18
  const o = i.current;
18
19
  if (!o) return;
19
- const t = document.createElement("span"), s = o.getBoundingClientRect(), r = Math.max(s.width, s.height);
20
+ const t = document.createElement("span"), c = o.getBoundingClientRect(), r = Math.max(c.width, c.height);
20
21
  t.style.width = t.style.height = `${r}px`, t.style.left = `${e - r / 2}px`, t.style.top = `${n - r / 2}px`, t.style.backgroundColor = p, t.classList.add("ripple-effect"), o.appendChild(t), t.addEventListener("animationend", () => t.remove());
21
- }, u = (e) => {
22
+ }, m = (e) => {
22
23
  if (e.detail === 0) return;
23
24
  const n = i.current.getBoundingClientRect();
24
- l(e.clientX - n.left, e.clientY - n.top);
25
- }, m = (e) => {
25
+ s(e.clientX - n.left, e.clientY - n.top);
26
+ }, f = (e) => {
26
27
  if (e.key !== "Enter" && e.key !== " ") return;
27
28
  const n = i.current.getBoundingClientRect();
28
- l(n.width / 2, n.height / 2);
29
+ s(n.width / 2, n.height / 2);
29
30
  };
30
- return /* @__PURE__ */ f(
31
+ return /* @__PURE__ */ y(
31
32
  "div",
32
33
  {
33
34
  ref: i,
34
- className: `ripple-container ${a}`,
35
- onClick: u,
36
- onKeyDown: m,
37
- ...d,
38
- children: c
35
+ className: `ripple-container ${u}`,
36
+ onClick: m,
37
+ onKeyDown: f,
38
+ ...l,
39
+ style: { borderRadius: d, ...l.style },
40
+ children: a
39
41
  }
40
42
  );
41
43
  };
42
44
  export {
43
- x as default
45
+ E as default
44
46
  };
@@ -188,6 +188,7 @@ const P = () => {
188
188
  flex-shrink: 0;
189
189
  width: 2.8rem;
190
190
  height: 2.8rem;
191
+ cursor: pointer;
191
192
  `, me = o.svg`
192
193
  position: absolute;
193
194
  inset: 0;
@@ -212,9 +213,7 @@ const P = () => {
212
213
  animation: ${se} ${({ $duration: e }) => e - 0.5}s linear forwards;
213
214
  animation-play-state: ${({ $paused: e }) => e ? "paused" : "running"};
214
215
  }
215
- `, ce = o(S)`
216
- cursor: pointer;
217
- `, le = o.div`
216
+ `, ce = o.div`
218
217
  font-weight: 600;
219
218
  font-size: 1.92rem;
220
219
  color: ${k.m800};
@@ -226,7 +225,7 @@ const P = () => {
226
225
  @media screen and (max-width: 380px) {
227
226
  font-size: 1.56rem;
228
227
  }
229
- `, he = o.div`
228
+ `, le = o.div`
230
229
  display: flex;
231
230
  flex-direction: column;
232
231
  gap: 0.32rem;
@@ -244,7 +243,7 @@ const P = () => {
244
243
  max-width: 18rem;
245
244
  width: auto;
246
245
  }
247
- `, fe = o.div`
246
+ `, he = o.div`
248
247
  font-weight: 400;
249
248
  font-size: 1.6rem;
250
249
  color: ${k.m700};
@@ -256,25 +255,25 @@ const P = () => {
256
255
  @media screen and (max-width: 380px) {
257
256
  font-size: 1.32rem;
258
257
  }
259
- `, ue = (e, r) => e === f ? /* @__PURE__ */ i(S, { size: 16, color: r }) : e === N ? /* @__PURE__ */ i(U, { size: 18, color: r }) : e === R ? /* @__PURE__ */ i(H, { size: 28, color: L }) : /* @__PURE__ */ i(q, { size: 22, color: r }), pe = (e) => e === f ? 1.6 : e === N ? 1.76 : e === R ? 2.8 : 2.08, ge = ({ type: e, $main: r, $side: n }) => {
260
- const a = ue(e, r), s = e === R;
258
+ `, fe = (e, r) => e === f ? /* @__PURE__ */ i(S, { size: 16, color: r }) : e === N ? /* @__PURE__ */ i(U, { size: 18, color: r }) : e === R ? /* @__PURE__ */ i(H, { size: 28, color: L }) : /* @__PURE__ */ i(q, { size: 22, color: r }), ue = (e) => e === f ? 1.6 : e === N ? 1.76 : e === R ? 2.8 : 2.08, pe = ({ type: e, $main: r, $side: n }) => {
259
+ const a = fe(e, r), s = e === R;
261
260
  return /* @__PURE__ */ m(oe, { "aria-hidden": "true", $side: n, children: [
262
261
  /* @__PURE__ */ i(ae, { $main: r }),
263
262
  !s && /* @__PURE__ */ i(ie, { $main: r, type: e }),
264
- /* @__PURE__ */ i(ne, { size: pe(e), $isWarning: s, children: a })
263
+ /* @__PURE__ */ i(ne, { size: ue(e), $isWarning: s, children: a })
265
264
  ] });
266
- }, we = ({ toasts: e, ...r }) => {
265
+ }, ge = ({ toasts: e, ...r }) => {
267
266
  const [n, a] = h(e);
268
267
  y(() => {
269
268
  a(e);
270
269
  }, [e]);
271
- const s = ({ type: u, id: l, title: p, subtitle: g, duration: d, onExpire: w = P }, x) => /* @__PURE__ */ B(W, { type: u, title: p, subtitle: g, duration: d, key: l, onExpire: w });
270
+ const s = ({ type: u, id: l, title: p, subtitle: g, duration: d, onExpire: w = P }, x) => /* @__PURE__ */ B(j, { type: u, title: p, subtitle: g, duration: d, key: l, onExpire: w });
272
271
  return D(
273
272
  /* @__PURE__ */ i(re, { ...r, children: [...n].reverse().map(s) }),
274
273
  document.body
275
274
  );
276
275
  };
277
- we.propTypes = {
276
+ ge.propTypes = {
278
277
  /** Array of toast config objects, each with `{ id, type, title, subtitle, duration, onExpire }` */
279
278
  toasts: t.arrayOf(
280
279
  t.shape({
@@ -291,7 +290,7 @@ const M = (e, r, n) => () => {
291
290
  e(!0), setTimeout(() => {
292
291
  r(!1), n();
293
292
  }, 500);
294
- }, W = ({
293
+ }, j = ({
295
294
  type: e = K,
296
295
  visible: r = !0,
297
296
  duration: n = 5,
@@ -302,13 +301,13 @@ const M = (e, r, n) => () => {
302
301
  ...p
303
302
  }) => {
304
303
  var I;
305
- const [g, d] = h(r), [w, x] = h(!1), [j, T] = h(!1), b = v(null), $ = v((n - 0.5) * 1e3), z = v(null), O = (_) => {
304
+ const [g, d] = h(r), [w, x] = h(!1), [F, T] = h(!1), b = v(null), $ = v((n - 0.5) * 1e3), z = v(null), O = (_) => {
306
305
  z.current = Date.now(), b.current = setTimeout(M(x, d, a), _);
307
306
  };
308
307
  y(() => {
309
308
  d(r);
310
309
  }, [r]), y(() => (O($.current), () => clearTimeout(b.current)), []);
311
- const F = () => {
310
+ const W = () => {
312
311
  clearTimeout(b.current), $.current -= Date.now() - z.current, T(!0);
313
312
  }, X = () => {
314
313
  T(!1), O($.current);
@@ -322,16 +321,16 @@ const M = (e, r, n) => () => {
322
321
  "aria-live": e === f ? "assertive" : "polite",
323
322
  "aria-atomic": "true",
324
323
  className: `${w ? "fade-out" : "fade-in"}`,
325
- onMouseEnter: F,
324
+ onMouseEnter: W,
326
325
  onMouseLeave: X,
327
326
  ...p,
328
327
  children: [
329
- /* @__PURE__ */ i(ge, { type: e, $main: E, $side: G }),
330
- /* @__PURE__ */ m(he, { children: [
331
- /* @__PURE__ */ i(le, { children: u }),
332
- l && /* @__PURE__ */ i(fe, { children: l })
328
+ /* @__PURE__ */ i(pe, { type: e, $main: E, $side: G }),
329
+ /* @__PURE__ */ m(le, { children: [
330
+ /* @__PURE__ */ i(ce, { children: u }),
331
+ l && /* @__PURE__ */ i(he, { children: l })
333
332
  ] }),
334
- /* @__PURE__ */ m(de, { children: [
333
+ /* @__PURE__ */ m(de, { onClick: M(x, d, a), children: [
335
334
  /* @__PURE__ */ m(
336
335
  me,
337
336
  {
@@ -339,7 +338,7 @@ const M = (e, r, n) => () => {
339
338
  viewBox: "0 0 28 28",
340
339
  $duration: n,
341
340
  $color: E,
342
- $paused: j,
341
+ $paused: F,
343
342
  $hasClockwiseRotation: s,
344
343
  children: [
345
344
  /* @__PURE__ */ i("circle", { cx: "14", cy: "14", r: "12" }),
@@ -347,21 +346,13 @@ const M = (e, r, n) => () => {
347
346
  ]
348
347
  }
349
348
  ),
350
- /* @__PURE__ */ i(
351
- ce,
352
- {
353
- "aria-label": "Close notification",
354
- size: 13,
355
- color: k.m600,
356
- onClick: M(x, d, a)
357
- }
358
- )
349
+ /* @__PURE__ */ i(S, { "aria-label": "Close notification", size: 13, color: k.m600 })
359
350
  ] })
360
351
  ]
361
352
  }
362
353
  );
363
354
  };
364
- W.propTypes = {
355
+ j.propTypes = {
365
356
  /** Notification variant: `'info'`, `'success'`, `'warning'`, or `'error'`. Defaults to `'info'` */
366
357
  type: t.string,
367
358
  /** Controls initial visibility. Defaults to `true` */
@@ -378,6 +369,6 @@ W.propTypes = {
378
369
  subtitle: t.string
379
370
  };
380
371
  export {
381
- we as ToastContainer,
382
- W as default
372
+ ge as ToastContainer,
373
+ j as default
383
374
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meticulous-ui",
3
- "version": "3.11.3",
3
+ "version": "3.11.5",
4
4
  "license": "ISC",
5
5
  "description": "A comprehensive React UI component library with a wide range of customizable components, icons, colors, and utilities for building modern web applications.",
6
6
  "types": "./index.d.ts",