forstok-ui-lib 8.9.6 → 8.9.8
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/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/checkbox/styles.ts +44 -24
- package/src/components/dropdown/index.tsx +1 -1
- package/src/components/radio/styles.ts +6 -6
package/dist/index.js
CHANGED
|
@@ -430,22 +430,22 @@ function O(e,t){if(!1===e||null==e)throw new Error(t)}function M(e,t){if(!e){"un
|
|
|
430
430
|
user-select: none;
|
|
431
431
|
align-items: center;
|
|
432
432
|
padding-left: 24px;
|
|
433
|
-
> input {
|
|
434
|
-
${Pt}
|
|
433
|
+
> input {
|
|
434
|
+
${Pt}
|
|
435
435
|
}
|
|
436
|
-
input:checked ~ span,
|
|
436
|
+
input:checked ~ span,
|
|
437
437
|
input.checked ~ span {
|
|
438
438
|
background-color: var(--ck-clr-bg__act);
|
|
439
439
|
border: 0;
|
|
440
440
|
}
|
|
441
|
-
input:checked ~ span:after,
|
|
441
|
+
input:checked ~ span:after,
|
|
442
442
|
input.checked ~ span:after {
|
|
443
443
|
display: grid;
|
|
444
444
|
}
|
|
445
445
|
@media (min-width: 425px) {
|
|
446
446
|
padding-left: 24px;
|
|
447
447
|
}
|
|
448
|
-
${({$flow:e,$iconRight:t,disabled:r})=>{let i="";if(r&&(i+="\n cursor: default; \n "),"column"===e)i+="\n display: inline-grid; \n grid-auto-flow: column;\n ";else i+="\n display: grid; \n grid-auto-flow: row;\n ";return t&&(i+=St),i}}
|
|
448
|
+
${({$flow:e,$iconRight:t,disabled:r})=>{let i="";if(r&&(i+="\n cursor: default; \n > span {\n border: 1px solid transparent !important;\n background-color: var(--mt-clr-bg__fc) !important;\n }\n "),"column"===e)i+="\n display: inline-grid; \n grid-auto-flow: column;\n ";else i+="\n display: grid; \n grid-auto-flow: row;\n ";return t&&(i+=St),i}}
|
|
449
449
|
`;m.default.input`
|
|
450
450
|
&:disabled {
|
|
451
451
|
cursor: default;
|
|
@@ -4520,7 +4520,7 @@ function O(e,t){if(!1===e||null==e)throw new Error(t)}function M(e,t){if(!e){"un
|
|
|
4520
4520
|
display: block;
|
|
4521
4521
|
}
|
|
4522
4522
|
}
|
|
4523
|
-
`,wa=t=>{var{children:i,title:n,subTitle:a,$externalWidth:o,$externalMinWidth:l,$internalWidth:s,$area:d,$openPosition:c,$placement:C,$top:p,onClick:g,$alias:h,type:x,portalId:m,$bottom:u,$isPopup:v}=t,f=b(t,["children","title","subTitle","$externalWidth","$externalMinWidth","$internalWidth","$area","$openPosition","$placement","$top","onClick","$alias","type","portalId","$bottom","$isPopup"]);const w=r.useRef(null),F=(e,t)=>{const r=Number.parseInt(e||"",10);return Number.isNaN(r)?t:r},y=()=>window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,A=()=>y()<768,D=e=>null==e?void 0:e.querySelector("._refDropdownWrapper"),E=(e,t)=>{if("top"===C)return"top";const r=e.getBoundingClientRect(),i=t.getBoundingClientRect().height||t.offsetHeight,n=F(p,40),a=F(u,35),o=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-r.bottom,l=r.top,s=i+Math.max(n-r.height,0),d=i+Math.max(a-r.height,0);return o>=s?"bottom":l>=d||l>o?"top":"bottom"},B=(e,t)=>{if("top"===t)return e.style.animation="none",e.style.top="auto",void(e.style.bottom=`${F(u,35)}px`);e.style.top=`${F(p,40)}px`,e.style.bottom="auto"},j=e=>{e.style.top="auto",e.style.bottom="0",e.style.left="0",e.style.right="auto",e.style.transform="none"},k=e=>{const t=D(e);t&&(t.style.top="",t.style.bottom="",t.style.left="",t.style.right="",t.style.transform="",t.style.visibility="",t.style.animation="")},O=(e,t)=>{const r=D(e);r&&(r.style.visibility=t)},M=e=>{if(!m)return;const t=document.querySelector(`#${m} ._refDropdownPortal`),r=D(t);if(!t||!r)return;if(A())return j(r),t.style.left="'-100%'",t.style.top="'-100%'",void(t.style.zIndex=
|
|
4523
|
+
`,wa=t=>{var{children:i,title:n,subTitle:a,$externalWidth:o,$externalMinWidth:l,$internalWidth:s,$area:d,$openPosition:c,$placement:C,$top:p,onClick:g,$alias:h,type:x,portalId:m,$bottom:u,$isPopup:v}=t,f=b(t,["children","title","subTitle","$externalWidth","$externalMinWidth","$internalWidth","$area","$openPosition","$placement","$top","onClick","$alias","type","portalId","$bottom","$isPopup"]);const w=r.useRef(null),F=(e,t)=>{const r=Number.parseInt(e||"",10);return Number.isNaN(r)?t:r},y=()=>window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,A=()=>y()<768,D=e=>null==e?void 0:e.querySelector("._refDropdownWrapper"),E=(e,t)=>{if("top"===C)return"top";const r=e.getBoundingClientRect(),i=t.getBoundingClientRect().height||t.offsetHeight,n=F(p,40),a=F(u,35),o=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-r.bottom,l=r.top,s=i+Math.max(n-r.height,0),d=i+Math.max(a-r.height,0);return o>=s?"bottom":l>=d||l>o?"top":"bottom"},B=(e,t)=>{if("top"===t)return e.style.animation="none",e.style.top="auto",void(e.style.bottom=`${F(u,35)}px`);e.style.top=`${F(p,40)}px`,e.style.bottom="auto"},j=e=>{e.style.top="auto",e.style.bottom="0",e.style.left="0",e.style.right="auto",e.style.transform="none"},k=e=>{const t=D(e);t&&(t.style.top="",t.style.bottom="",t.style.left="",t.style.right="",t.style.transform="",t.style.visibility="",t.style.animation="")},O=(e,t)=>{const r=D(e);r&&(r.style.visibility=t)},M=e=>{if(!m)return;const t=document.querySelector(`#${m} ._refDropdownPortal`),r=D(t);if(!t||!r)return;if(A())return j(r),t.style.left="'-100%'",t.style.top="'-100%'",void(t.style.zIndex="101");const i=e.getBoundingClientRect(),n=E(e,r),a=r.getBoundingClientRect().width||r.offsetWidth,o=y();let l=i.left+i.width-a;"left"===c?l=i.left:"center"===c&&(l=i.left+i.width/2-a/2),l=Math.max(0,Math.min(l,Math.max(o-a,0))),r.style.left="0",r.style.right="auto",r.style.transform="none",B(r,n),t.style.left=`${l}px`,t.style.top=`${"top"===n?i.bottom:i.top}px`,t.style.zIndex=v?"101":"8"},L=()=>{const e=document.getElementsByClassName("_refContainer is-shown")[0];e&&m&&M(e)},z=()=>{const e=document.getElementsByClassName("_refContainer is-shown"),t=document.getElementsByTagName("BODY")[0];if(e.length){t.classList.remove("is-immuned");for(let t=0;t<e.length;t++){e[t].querySelector("._refDropdownOverlay").style.display="none",e[t].classList.remove("is-shown"),k(e[t])}}const r=document.querySelector("._refScrollContainer");r&&r.removeEventListener("scroll",L,!0),setTimeout((()=>{if(m){const e=document.getElementsByClassName("_refDropdownPortal is-shown");if(e.length)for(let t=0;t<e.length;t++)k(e[t]),e[t].style.left="'-100%'",e[t].style.top="'-100%'",e[t].classList.remove("is-shown")}}),10)},I=e=>{const t=w.current;if(t){const r=e.target.closest(`.${t.classList[0]}`);if(!r)return;const i=r.closest("._refContainer"),n=document.getElementsByTagName("BODY")[0];if(i){const t=i.querySelector("._refDropdownOverlay");i.classList.contains("is-shown")?(t.style.display="none",n.classList.remove("is-immuned"),i.classList.remove("is-shown"),setTimeout((()=>{if(m){const e=document.querySelector(`#${m} ._refDropdownPortal`),t=document.querySelector("._refScrollContainer");e&&(k(e),e.classList.remove("is-shown"),e.style.left="-100%",e.style.top="-100%",t&&t.removeEventListener("scroll",L,!0))}}),10),k(i)):(z(),t.style.display="block",n.classList.add("is-immuned"),m||O(i,"hidden"),i.classList.add("is-shown"),setTimeout((()=>{if(m){const e=document.querySelector(`#${m} ._refDropdownPortal`),t=document.querySelector("._refScrollContainer");e&&(e.classList.add("is-shown"),setTimeout((()=>{M(i),t&&t.addEventListener("scroll",L,!0)}),10))}else e=()=>{(e=>{const t=D(e);if(!t)return;if(A())return void j(t);const r=E(e,t);B(t,r)})(i),O(i,"visible")},window.requestAnimationFrame((()=>e()));var e}),10),g&&g(e))}}};r.useEffect((()=>(setTimeout((()=>{const e=document.querySelectorAll("._refDropdownPortal._refHover");for(let t of e)t&&t.addEventListener("mouseenter",(e=>{const t=e.target;t.classList.add("is-shown"),t.classList.add("unhiddenable")})),t&&t.addEventListener("mouseleave",(e=>{const t=e.target;t.classList.remove("is-shown"),t.classList.remove("unhiddenable"),t.style.left="-100%",t.style.top="-100%"}))}),1),()=>{const e=document.querySelectorAll("._refDropdownPortal._refHover");for(let t of e)t&&t.removeEventListener("mouseenter",(e=>{const t=e.target;t.classList.add("is-shown"),t.classList.add("unhiddenable")}),!0),t&&t.removeEventListener("mouseleave",(e=>{const t=e.target;t.classList.remove("is-shown"),t.classList.remove("unhiddenable"),t.style.left="-100%",t.style.top="-100%"}),!0)})),[m]);const P=a?e.jsx(ma,{children:a}):null,S=n?e.jsxs(xa,{children:[n," ",P]}):null,T=i.filter((e=>r.isValidElement(e)?"control"===e.props["aria-label"]:null)),Q=T&&r.isValidElement(T[0])?"hover"===x?e.jsxs(ga,{children:[e.jsx(pa,Object.assign({className:"_refDropdownControl"},m&&{onMouseEnter:e=>{const t=w.current;if(t){const r=e.target.closest(`.${t.classList[0]}`);if(!r)return;const i=document.querySelectorAll("._refDropdownPortal");for(const e of i)e.classList.remove("is-shown"),e.style.left="-100%",e.style.top="-100%";const n=r.closest("._refContainer");if(n){const e=document.querySelector(`#${m} ._refDropdownPortal`);e&&(e.classList.add("is-shown"),setTimeout((()=>{M(n)}),10))}}},onMouseLeave:e=>{const t=w.current;if(t){if(!e.target.closest(`.${t.classList[0]}`))return;setTimeout((()=>{const e=document.querySelector(`#${m} ._refDropdownPortal`);e&&!e.classList.contains("unhiddenable")&&(k(e),e.classList.remove("is-shown"),e.style.left="-100%",e.style.top="-100%")}),150)}}},{children:T[0].props.children})),e.jsx(pa,{className:"_refDropdownControlMobile",ref:w,onClick:I,children:T[0].props.children})]}):e.jsx(pa,{ref:w,onClick:I,children:T[0].props.children}):null,H=i.filter((e=>r.isValidElement(e)?"body"===e.props["aria-label"]:null)),Y=H&&r.isValidElement(H[0])?e.jsx(ua,{$area:d,children:H[0].props.children}):null,V=i.filter((e=>r.isValidElement(e)?"action"===e.props["aria-label"]:null)),N=V&&r.isValidElement(V[0])?e.jsx(va,{$position:V[0].props["data-position"],className:V[0].props.className,children:V[0].props.children}):null,X=e.jsxs(ca,Object.assign({className:"_refDropdownWrapper"},s&&{$internalWidth:s},p&&{$top:p},c&&{$openPosition:c},C&&{$placement:C},u&&{$bottom:u},{children:[S,Y,N]}));return e.jsxs(ha,Object.assign({className:"_refContainer "+(x?`_refContainer${x}`:"")},o&&{$externalWidth:o},l&&{$externalMinWidth:l},d&&{$area:d},p&&{$top:p},h&&{$alias:h},c&&{$openPosition:c},C&&{$placement:C},u&&{$bottom:u},f,{children:[Q,e.jsx(Ca,{className:"_refDropdownOverlay",onClick:()=>{z()}}),m?e.jsx(da,{wrapperId:m,children:e.jsx(fa,{className:"_refDropdownPortal "+("hover"===x?"_refHover":""),children:X})}):X]}))},Fa=t.css`
|
|
4524
4524
|
background-color: var(--mt-clr-bg__fc);
|
|
4525
4525
|
width: 30px;
|
|
4526
4526
|
height: 30px;
|
|
@@ -4815,7 +4815,7 @@ function O(e,t){if(!1===e||null==e)throw new Error(t)}function M(e,t){if(!e){"un
|
|
|
4815
4815
|
height: 10px;
|
|
4816
4816
|
z-index: 0;
|
|
4817
4817
|
transition: 0.28s ease;
|
|
4818
|
-
border:
|
|
4818
|
+
border: 1px solid var(--ck-clr-ln);
|
|
4819
4819
|
border-radius: 50%;
|
|
4820
4820
|
}
|
|
4821
4821
|
b {
|
|
@@ -4845,12 +4845,12 @@ function O(e,t){if(!1===e||null==e)throw new Error(t)}function M(e,t){if(!e){"un
|
|
|
4845
4845
|
width: auto;
|
|
4846
4846
|
&:checked + ${Ka} {
|
|
4847
4847
|
&:before {
|
|
4848
|
-
border:
|
|
4848
|
+
border: 1px solid var(--err-clr-ln);
|
|
4849
4849
|
}
|
|
4850
4850
|
&:after {
|
|
4851
4851
|
transform: scale(0.6);
|
|
4852
4852
|
background-color: var(--err-clr-ln);
|
|
4853
|
-
border:
|
|
4853
|
+
border: 1px solid transparent;
|
|
4854
4854
|
}
|
|
4855
4855
|
}
|
|
4856
4856
|
${({$mode:e})=>"check"===e?t.css`
|
|
@@ -4881,12 +4881,12 @@ function O(e,t){if(!1===e||null==e)throw new Error(t)}function M(e,t){if(!e){"un
|
|
|
4881
4881
|
`:"blue"===e?t.css`
|
|
4882
4882
|
&:checked + ${Ka} {
|
|
4883
4883
|
&:before {
|
|
4884
|
-
border:
|
|
4884
|
+
border: 1px solid var(--ck-clr-bg__act);
|
|
4885
4885
|
}
|
|
4886
4886
|
&:after {
|
|
4887
4887
|
transform: scale(0.6);
|
|
4888
|
-
background-color: var(--
|
|
4889
|
-
border:
|
|
4888
|
+
background-color: var(--ck-clr-bg__act);
|
|
4889
|
+
border: 1px solid transparent;
|
|
4890
4890
|
}
|
|
4891
4891
|
}
|
|
4892
4892
|
`:void 0}
|