kwant-ui 3.51.0-dev.44 → 3.51.0-dev.45

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,3 +1,3 @@
1
1
  import { ITabs } from './TabsTypes';
2
- declare const Tabs: ({ activeTab, tabs, tabHeight, fullWidth, showNeutralBorder, onTabChange, onTabClick, onLeftIconClick, onRightIconClick, onUnreadCountClick, }: ITabs.Props) => import("react/jsx-runtime").JSX.Element;
2
+ declare const Tabs: ({ activeTab, tabs, tabHeight, fullWidth, showNeutralBorder, onTabChange, onTabClick, onLeftIconClick, onRightIconClick, onUnreadCountClick, tabClassName, tabBarHeight, tabBarHighlightHeight, }: ITabs.Props) => import("react/jsx-runtime").JSX.Element;
3
3
  export { Tabs };
@@ -7,8 +7,10 @@ export declare const Tab: import("styled-components").StyledComponent<"div", any
7
7
  }, never>;
8
8
  export declare const TabBar: import("styled-components").StyledComponent<"div", any, {
9
9
  showNeutralBorder?: boolean;
10
+ tabBarHeight?: string;
10
11
  }, never>;
11
12
  export declare const TabBarHighlight: import("styled-components").StyledComponent<"div", any, {
12
13
  width?: string;
13
14
  left: string;
15
+ tabBarHighlightHeight?: string;
14
16
  }, never>;
@@ -11,6 +11,9 @@ export declare namespace ITabs {
11
11
  onLeftIconClick?: (tab: Tab, event?: React.MouseEvent) => void;
12
12
  onRightIconClick?: (tab: Tab, event?: React.MouseEvent) => void;
13
13
  onUnreadCountClick?: (tab: Tab, event?: React.MouseEvent) => void;
14
+ tabClassName?: string;
15
+ tabBarHeight?: string;
16
+ tabBarHighlightHeight?: string;
14
17
  }
15
18
  interface Tab {
16
19
  id?: string;
package/dist/index.es.js CHANGED
@@ -3377,17 +3377,17 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{css as
3377
3377
  }
3378
3378
  }
3379
3379
  `,el=r.div`
3380
- height: 1px;
3380
+ height: ${e=>e.tabBarHeight||"1px"};
3381
3381
  background-color: ${e=>e.showNeutralBorder?e.theme.grey.grey250:"transparent"};
3382
3382
  position: relative;
3383
3383
  `,tl=r.div`
3384
3384
  position: absolute;
3385
- height: 2px;
3385
+ height: ${e=>e.tabBarHighlightHeight||"2px"};
3386
3386
  transition: all 0.2s ease-in-out;
3387
3387
  width: ${e=>e.width};
3388
3388
  left: ${e=>e.left};
3389
3389
  background-color: ${e=>e.theme.secondary.secondary100};
3390
- `,nl=e=>e?.clientWidth,rl=({activeTab:n,tabs:r=[],tabHeight:a,fullWidth:c,showNeutralBorder:l=!0,onTabChange:i,onTabClick:s,onLeftIconClick:h,onRightIconClick:p,onUnreadCountClick:g})=>{const m=u([]),[d,f]=v(()=>n||r[0]?.id?.toString()),[_,w]=v({left:0,width:0}),b=e=>{f(e)},x=e=>(e=>{let t=0;for(let n=0;n<e.length;n++)t+=nl(e[n])||0;return t})(m.current.slice(0,e));return o(()=>{const e=r.findIndex(e=>e.id===d),t=r[e];-1!==e&&(i?.(t),document.fonts.ready.then(()=>{var t;w({left:x(e),width:(t=e,nl(m.current[t]))})}))},[d,r,c]),o(()=>{m.current=m.current.slice(0,r.length)},[r]),o(()=>{f(n)},[n]),t(Kc,{children:[e(Gc,{children:r.map((n,r)=>t(Jc,{ref:e=>m.current[r]=e,onClick:e=>((e,t)=>{b(e.id?.toString()),s?.(e,t)})(n,e),isActive:d===n.id,tabHeight:a,fullWidth:c,children:[n.leftIcon&&e("div",{onClick:e=>((e,t)=>{t.stopPropagation(),h?.(e,t)})(n,e),children:n.leftIcon}),n.title,n.unreadCount&&e("span",{onClick:e=>((e,t)=>{t.stopPropagation(),g?.(e,t)})(n,e),children:e(xc,{label:n.unreadCount?.toString(),type:"secondary"})}),n.rightIcon&&e("div",{onClick:e=>((e,t)=>{t.stopPropagation(),p?.(e,t)})(n,e),children:n.rightIcon})]},n.id||n.title))}),e(el,{showNeutralBorder:l,children:e(tl,{width:`${_.width}px`,left:`${_.left}px`})})]})},al=r.div`
3390
+ `,nl=e=>e?.clientWidth,rl=({activeTab:n,tabs:r=[],tabHeight:a,fullWidth:c,showNeutralBorder:l=!0,onTabChange:i,onTabClick:s,onLeftIconClick:h,onRightIconClick:p,onUnreadCountClick:g,tabClassName:m="",tabBarHeight:d,tabBarHighlightHeight:f})=>{const _=u([]),[w,b]=v(()=>n||r[0]?.id?.toString()),[x,y]=v({left:0,width:0}),M=e=>{b(e)},E=e=>(e=>{let t=0;for(let n=0;n<e.length;n++)t+=nl(e[n])||0;return t})(_.current.slice(0,e));return o(()=>{const e=r.findIndex(e=>e.id===w),t=r[e];-1!==e&&(i?.(t),document.fonts.ready.then(()=>{var t;y({left:E(e),width:(t=e,nl(_.current[t]))})}))},[w,r,c]),o(()=>{_.current=_.current.slice(0,r.length)},[r]),o(()=>{b(n)},[n]),t(Kc,{children:[e(Gc,{children:r.map((n,r)=>t(Jc,{ref:e=>_.current[r]=e,onClick:e=>((e,t)=>{M(e.id?.toString()),s?.(e,t)})(n,e),isActive:w===n.id,tabHeight:a,fullWidth:c,className:m,children:[n.leftIcon&&e("div",{onClick:e=>((e,t)=>{t.stopPropagation(),h?.(e,t)})(n,e),children:n.leftIcon}),n.title,n.unreadCount&&e("span",{onClick:e=>((e,t)=>{t.stopPropagation(),g?.(e,t)})(n,e),children:e(xc,{label:n.unreadCount?.toString(),type:"secondary"})}),n.rightIcon&&e("div",{onClick:e=>((e,t)=>{t.stopPropagation(),p?.(e,t)})(n,e),children:n.rightIcon})]},n.id||n.title))}),e(el,{showNeutralBorder:l,tabBarHeight:d,children:e(tl,{width:`${x.width}px`,left:`${x.left}px`,tabBarHighlightHeight:f})})]})},al=r.div`
3391
3391
  .collapsed {
3392
3392
  gap: 0px;
3393
3393
  height: auto !important;