@kwantis-id3/frontend-library 0.21.0-rc.0 → 0.21.0-rc.2
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
|
@@ -261,12 +261,14 @@ import*as e from"react";import t,{useLayoutEffect as u,useContext as n,createEle
|
|
|
261
261
|
color: ${e=>e.$textColor};
|
|
262
262
|
`,va=Hu.span`
|
|
263
263
|
label: ItemSpanValue;
|
|
264
|
-
width: 100
|
|
264
|
+
width: ${e=>void 0===e.$direction?"auto":"100%"};
|
|
265
265
|
display: flex;
|
|
266
266
|
justify-content: space-between;
|
|
267
267
|
align-items: center;
|
|
268
268
|
color: inherit;
|
|
269
|
-
|
|
269
|
+
text-align: ${e=>"left"===e.$direction?"right":"left"};
|
|
270
|
+
white-space: pre-wrap;
|
|
271
|
+
`;var Ea={};Object.defineProperty(Ea,"__esModule",{value:!0});var ya=Ea.chevronDown=void 0;ya=Ea.chevronDown={viewBox:"0 0 1792 1792",children:[{name:"path",attribs:{d:"M1683 808l-742 741q-19 19-45 19t-45-19l-742-741q-19-19-19-45.5t19-45.5l166-165q19-19 45-19t45 19l531 531 531-531q19-19 45-19t45 19l166 165q19 19 19 45.5t-19 45.5z"}}]};var Ia={};Object.defineProperty(Ia,"__esModule",{value:!0});var Fa=Ia.chevronRight=void 0;Fa=Ia.chevronRight={viewBox:"0 0 1280 1792",children:[{name:"path",attribs:{d:"M1107 877l-742 742q-19 19-45 19t-45-19l-166-166q-19-19-19-45t19-45l531-531-531-531q-19-19-19-45t19-45l166-166q19-19 45-19t45 19l742 742q19 19 19 45t-19 45z"}}]};var Ba={};Object.defineProperty(Ba,"__esModule",{value:!0});var xa=Ba.chevronLeft=void 0;xa=Ba.chevronLeft={viewBox:"0 0 1280 1792",children:[{name:"path",attribs:{d:"M1171 301l-531 531 531 531q19 19 19 45t-19 45l-166 166q-19 19-45 19t-45-19l-742-742q-19-19-19-45t19-45l742-742q19-19 45-19t45 19l166 166q19 19 19 45t-19 45z"}}]};var Da={};Object.defineProperty(Da,"__esModule",{value:!0});var wa=Da.minus=void 0;wa=Da.minus={viewBox:"0 0 1408 1792",children:[{name:"path",attribs:{d:"M1408 736v192q0 40-28 68t-68 28h-1216q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h1216q40 0 68 28t28 68z"}}]};const Oa=e=>{var u,n;const[r,o]=t.useState(!1),i=Gu(),a=i.getColor(null!==(u=e.color)&&void 0!==u?u:"white"),s=e.color?Ut(i.getColor(e.color).main).darken(20).toString():i.colors.secondary.main,c=t.useRef(null);return d((()=>()=>{c.current&&clearTimeout(c.current)}),[]),St(da,Object.assign({onMouseLeave:()=>c.current=setTimeout((()=>{o(!1)}),300),onMouseEnter:()=>{c.current&&(clearTimeout(c.current),c.current=null)}},{children:[kt(pa,Object.assign({onClick:()=>o((e=>!e))},{children:e.trigger})),kt(ga,Object.assign({$direction:null!==(n=e.direction)&&void 0!==n?n:"left",$isOpen:r,$bgColor:a.main},{children:e.content.map((t=>{var u,n;return Vt(Ga,Object.assign({},t,{color:null!==(u=t.color)&&void 0!==u?u:a.main,hoverColor:null!==(n=e.hoverColor)&&void 0!==n?n:s,direction:e.direction,key:t.value}))}))}))]}))},Ga=e=>{var t,u,n;const r=Gu(),o=r.getColor(null!==(t=e.color)&&void 0!==t?t:"white"),i=r.getColor(e.hoverColor),a=e.color?Ut(r.getColor(e.color).main).darken(20).toString():r.colors.secondary.main,s=e.textColor?r.getColor(e.textColor).main:o.contrastText;return St(fa,Object.assign({onClick:t=>{e.onClick&&e.onClick(),t.stopPropagation()},$bgColor:o.main,$textColor:s,$hoverColor:i.main,$hoverTextColor:i.contrastText,$direction:null!==(u=e.direction)&&void 0!==u?u:"left"},{children:[(c=e.value,l=null!==(n=e.direction)&&void 0!==n?n:"left",d=!!e.children,d?St(va,"right"===l?Object.assign({$direction:l},{children:[c,kt(zn,{icon:Fa,size:10})]}):Object.assign({$direction:l},{children:[kt(zn,{icon:xa,size:10}),c]})):kt(va,{children:c})),e.children&&kt("div",Object.assign({className:"dropdownChildrenContainer"},{children:e.children.map((t=>{var u,n,r;return Vt(Ga,Object.assign({},t,{color:null!==(n=null!==(u=t.color)&&void 0!==u?u:e.color)&&void 0!==n?n:"white",hoverColor:null!==(r=e.hoverColor)&&void 0!==r?r:a,direction:e.direction,key:t.value}))}))}))]}));var c,l,d},Ta=e=>{var u;const[n,r]=t.useState(!1),o=Gu(),i=e.color?Ut(o.getColor(e.color).main).darken(20).toString():o.colors.secondary.main;return St(da,{children:[kt(pa,Object.assign({onClick:()=>r((e=>!e))},{children:e.trigger})),kt(ba,Object.assign({$isOpen:n,$bgColor:o.getColor(null!==(u=e.color)&&void 0!==u?u:"white").main},{children:e.content.map((t=>{var u,n,r;return Vt(Na,Object.assign({},t,{color:null!==(n=null!==(u=t.color)&&void 0!==u?u:e.color)&&void 0!==n?n:"white",hoverColor:null!==(r=e.hoverColor)&&void 0!==r?r:i,direction:e.direction,key:t.value}))}))}))]})},Na=e=>{var u;const[n,r]=t.useState(!1),o=Gu(),i=o.getColor(null!==(u=e.color)&&void 0!==u?u:"white"),a=e.color?Ut(o.getColor(e.color).main).darken(20).toString():o.colors.secondary.main,s=o.getColor(e.hoverColor),c=e.textColor?o.getColor(e.textColor).main:i.contrastText;return kt(ha,Object.assign({$bgColor:i.main,$textColor:c},{children:e.children?kt("div",Object.assign({style:{width:"100%"}},{children:kt(nr,Object.assign({onClick:()=>{r((e=>!e))},color:c,title:e.value,isOpen:n,hideDivider:!0,customTrigger:(t=>kt(Aa,Object.assign({onClick:()=>{e.onClick&&e.onClick()}},{children:St(Ca,Object.assign({$bgColor:t.main,$textColor:t.contrastText},{children:[kt(zn,{icon:n?ya:Fa,size:12}),kt("span",{children:e.value})]}))})))(n?s:i)},{children:kt(ma,{children:e.children&&e.children.map((t=>{var u,n,r;return Vt(Na,Object.assign({},t,{color:null!==(n=null!==(u=t.color)&&void 0!==u?u:e.color)&&void 0!==n?n:"primary",hoverColor:null!==(r=e.hoverColor)&&void 0!==r?r:a,direction:e.direction,key:t.value}))}))})}))})):kt(Aa,Object.assign({onClick:()=>{e.onClick&&e.onClick()}},{children:St(Ca,{children:[kt(zn,{icon:wa,size:12}),kt("span",{children:e.value})]})}))}))},ka=e=>{const t=Tu(e.mobileBreakpoint);return kt(Nt,{children:kt(t?Ta:Oa,Object.assign({},e))})};var Sa={};Object.defineProperty(Sa,"__esModule",{value:!0});var Va=Sa.ic_close=void 0;Va=Sa.ic_close={viewBox:"0 0 24 24",children:[{name:"path",attribs:{d:"M0 0h24v24H0z",fill:"none"},children:[]},{name:"path",attribs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},children:[]}]};const Ra=Hu.dialog`
|
|
270
272
|
label: DialogElement;
|
|
271
273
|
border: none;
|
|
272
274
|
border-radius: 8px;
|