meticulous-ui 3.11.4 → 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,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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meticulous-ui",
3
- "version": "3.11.4",
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",