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.
- package/cjs/components/Button/Button.cjs +7 -7
- package/cjs/components/Input/FileUploader/FileUploader.cjs +1 -1
- package/cjs/components/Pagination/Pagination.cjs +5 -5
- package/cjs/components/Ripple/Ripple.cjs +1 -1
- package/components/Button/Button.js +30 -28
- package/components/Input/FileUploader/FileUploader.js +1 -1
- package/components/Pagination/Pagination.js +7 -7
- package/components/Ripple/Ripple.js +24 -22
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
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:
|
|
18
|
+
background-color: ${({$hoverColor:r})=>r};
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
&:active {
|
|
22
|
-
background-color: ${({$activeColor:
|
|
22
|
+
background-color: ${({$activeColor:r})=>r};
|
|
23
23
|
}
|
|
24
24
|
`};
|
|
25
25
|
|
|
26
26
|
&:focus-visible {
|
|
27
27
|
outline: none;
|
|
28
28
|
}
|
|
29
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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:
|
|
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"),
|
|
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
|
-
`,
|
|
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(
|
|
72
|
+
`,z=a.default(G.default)`
|
|
73
73
|
cursor: pointer;
|
|
74
|
-
`,g=a.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,
|
|
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
|
|
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
|
|
4
|
-
import
|
|
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
|
|
7
|
-
import
|
|
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
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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 =
|
|
81
|
+
size: v = S,
|
|
82
82
|
width: c,
|
|
83
|
-
leftIcon:
|
|
84
|
-
rightIcon:
|
|
83
|
+
leftIcon: q,
|
|
84
|
+
rightIcon: A,
|
|
85
85
|
isLoading: n,
|
|
86
86
|
textColor: m,
|
|
87
87
|
onKeyDown: d,
|
|
88
|
-
|
|
89
|
-
|
|
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:
|
|
100
|
-
|
|
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
|
-
...
|
|
104
|
-
onKeyDown:
|
|
105
|
-
$hoverColor:
|
|
106
|
-
$activeColor:
|
|
107
|
-
$selectedColor:
|
|
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(
|
|
114
|
-
/* @__PURE__ */ i(
|
|
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
|
-
|
|
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 ?
|
|
127
|
+
children: n ? $ : /* @__PURE__ */ i(Y, { theme: r, children: $ })
|
|
126
128
|
}
|
|
127
129
|
);
|
|
128
130
|
};
|
|
129
|
-
|
|
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
|
-
|
|
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
|
|
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 ===
|
|
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(
|
|
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(
|
|
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
|
|
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 = (
|
|
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
|
|
2
|
-
import { useRef as
|
|
3
|
-
const
|
|
4
|
-
children:
|
|
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
|
-
|
|
7
|
-
|
|
6
|
+
borderRadius: d,
|
|
7
|
+
className: u = "",
|
|
8
|
+
...l
|
|
8
9
|
}) => {
|
|
9
|
-
const i =
|
|
10
|
-
|
|
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 =
|
|
14
|
+
e.id = "meticulous-ripple-styles", e.textContent = C, document.head.appendChild(e);
|
|
14
15
|
}
|
|
15
16
|
}, []);
|
|
16
|
-
const
|
|
17
|
+
const s = (e, n) => {
|
|
17
18
|
const o = i.current;
|
|
18
19
|
if (!o) return;
|
|
19
|
-
const t = document.createElement("span"),
|
|
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
|
-
},
|
|
22
|
+
}, m = (e) => {
|
|
22
23
|
if (e.detail === 0) return;
|
|
23
24
|
const n = i.current.getBoundingClientRect();
|
|
24
|
-
|
|
25
|
-
},
|
|
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
|
-
|
|
29
|
+
s(n.width / 2, n.height / 2);
|
|
29
30
|
};
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ y(
|
|
31
32
|
"div",
|
|
32
33
|
{
|
|
33
34
|
ref: i,
|
|
34
|
-
className: `ripple-container ${
|
|
35
|
-
onClick:
|
|
36
|
-
onKeyDown:
|
|
37
|
-
...
|
|
38
|
-
|
|
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
|
-
|
|
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.
|
|
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",
|