@kwantis-id3/frontend-library 1.0.0-rc.29 → 1.0.0-rc.30
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/esm/index.js
CHANGED
|
@@ -185,6 +185,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"@emotion/react/jsx-runtime";import*
|
|
|
185
185
|
display: flex;
|
|
186
186
|
align-items: center;
|
|
187
187
|
justify-content: center;
|
|
188
|
+
width: fit-content;
|
|
188
189
|
`,oo=x("div",we)`
|
|
189
190
|
label: DropdownBody;
|
|
190
191
|
position: ${e=>e.$position};
|
|
@@ -307,7 +308,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"@emotion/react/jsx-runtime";import*
|
|
|
307
308
|
color: inherit;
|
|
308
309
|
text-align: ${e=>"left"===e.$direction?"right":"left"};
|
|
309
310
|
white-space: pre-wrap;
|
|
310
|
-
`,po=n=>{const[i,o]=r(!1),l=N(),c=n.bgColor??l.activePalette.surface.main,s=u(null),d=u(null),g=u(null)
|
|
311
|
+
`,po=n=>{const[i,o]=r(!1),l=N(),c=n.bgColor??l.activePalette.surface.main,s=u(null),d=u(null),g=u(null),p=()=>{if(!d.current||!g.current)return{};const e=d.current.getBoundingClientRect(),t=g.current.offsetWidth;if("right"===n.direction){return{left:e.left,top:e.bottom}}return{left:e.right-t,top:e.bottom}};a((()=>()=>{s.current&&clearTimeout(s.current)}),[]);const b=e(oo,{$direction:n.direction??"left",$isOpen:i,$bgColor:c,ref:g,$position:n.menuPosition??"absolute",style:"fixed"===n.menuPosition&&i?{position:"fixed",left:p().left,top:p().top,zIndex:9999,minWidth:d.current?.offsetWidth}:void 0,children:n.content.map((e=>C(bo,{...e,bgColor:e.bgColor,textColor:e.textColor,hoverColor:e.hoverColor,direction:n.direction,key:e.value,closeBody:()=>o(!1)})))});return t(no,{onMouseLeave:()=>s.current=setTimeout((()=>{o(!1)}),150),onMouseEnter:()=>{s.current&&(clearTimeout(s.current),s.current=null)},children:[e(io,{onClick:()=>o((e=>!e)),ref:d,children:n.trigger}),"fixed"===n.menuPosition&&i?y(b,document.body):b]})},bo=i=>{const o=N(),r=i.bgColor??o.activePalette.surface.main,a=i.textColor??Ce(r),l=i.hoverColor??xe(r);return e(n,{children:!i.isHidden&&t(ro,{onClick:e=>{i.onClick&&(i.onClick(),i.closeOnClick&&i.closeBody()),e.stopPropagation()},$bgColor:r,$textColor:a,$hoverColor:l,$hoverTextColor:Ce(l),$direction:i.direction??"left",children:[(c=i.value,s=i.direction??"left",u=!!i.children,u?t(go,"right"===s?{$direction:s,$hasChildren:!0,children:[c,e(A,{icon:"prime:chevron-right",width:20,height:20})]}:{$direction:s,$hasChildren:!0,children:[e(A,{icon:"prime:chevron-left",width:20,height:20}),c]}):e(go,{$direction:s,$hasChildren:!1,children:c})),i.children&&e("div",{className:"dropdownChildrenContainer",children:i.children.map((e=>C(bo,{...e,bgColor:e.bgColor,textColor:e.textColor,hoverColor:e.hoverColor??i.hoverColor,direction:i.direction,key:e.value,closeBody:i.closeBody})))})]})});var c,s,u},ho=n=>{const[i,o]=r(!1),a=N(),l=n.bgColor??a.activePalette.surface.main;return t(no,{children:[e(io,{onClick:()=>o((e=>!e)),children:n.trigger}),e(ao,{$isOpen:i,$bgColor:l,children:n.content.map((e=>C(mo,{...e,bgColor:e.bgColor,textColor:e.textColor,hoverColor:e.hoverColor??n.hoverColor,direction:n.direction,key:e.value,closeBody:()=>o(!1)})))})]})},mo=t=>{const[i,o]=r(!1),a=N(),l=t.bgColor??a.activePalette.surface.main,c=t.textColor??Ce(l);return e(n,{children:!t.isHidden&&e(lo,{$textColor:c,children:t.children?e("div",{style:{width:"100%"},children:e(He,{onClick:()=>{o((e=>!e))},title:t.value,isOpen:i,variant:"light",children:e(co,{children:t.children.map((e=>C(mo,{...e,bgColor:e.bgColor,textColor:e.textColor,hoverColor:e.hoverColor,direction:t.direction,key:e.value,closeBody:t.closeBody})))})})}):e(so,{onClick:()=>{t.onClick&&(t.onClick(),t.closeOnClick&&t.closeBody())},children:e(uo,{children:e("span",{children:t.value})})})})})},fo=t=>{const i=Be(t.mobileBreakpoint);return e(n,{children:e(i?ho:po,{...t})})},vo=x("dialog",we)`
|
|
311
312
|
label: DialogElement;
|
|
312
313
|
border: none;
|
|
313
314
|
border-radius: 8px;
|