@mailstep/design-system 0.7.19 → 0.7.20-beta.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.7.19",
3
+ "version": "0.7.20-beta.0",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -9,7 +9,7 @@ var Tab = function (_a) {
9
9
  var handleOnClick = useCallback(function () {
10
10
  onTabSwitch(value);
11
11
  }, [onTabSwitch, value]);
12
- return (_jsx(StyledTabWrapper, { children: _jsxs(StyledTab, { onClick: !disabled ? handleOnClick : undefined, active: isActive, disabled: disabled, children: [icon && (_jsx(StyledImageBox, { children: _jsx(Icon, { icon: icon }) })), _jsx(Text, { children: label }), isActive && badgeCount && badgeCount > 0 && (_jsx(RoundedWrap, { children: _jsx(Text, { variant: "medium", children: badgeCount }) }))] }) }));
12
+ return (_jsx(StyledTabWrapper, { children: _jsxs(StyledTab, { onClick: !disabled ? handleOnClick : undefined, active: isActive, disabled: disabled, children: [icon && (_jsx(StyledImageBox, { children: _jsx(Icon, { icon: icon }) })), _jsx(Text, { children: label }), badgeCount === 0 || (badgeCount && badgeCount > 0) && (_jsx(RoundedWrap, { children: _jsx(Text, { variant: "medium", children: badgeCount }) }))] }) }));
13
13
  };
14
14
  export var Tabs = function (_a) {
15
15
  var tabsDefinition = _a.tabsDefinition, activeTab = _a.activeTab, onTabSwitch = _a.onTabSwitch, mb = _a.mb;
package/ui/index.es.js CHANGED
@@ -48742,7 +48742,7 @@ const AOe = /* @__PURE__ */ Hr(fOe), pOe = Qe`
48742
48742
  return /* @__PURE__ */ p.jsx(wOe, { children: /* @__PURE__ */ p.jsxs(SOe, { onClick: s ? void 0 : c, active: r, disabled: s, children: [
48743
48743
  i && /* @__PURE__ */ p.jsx(COe, { children: /* @__PURE__ */ p.jsx(ct, { icon: i }) }),
48744
48744
  /* @__PURE__ */ p.jsx(Bh, { children: a }),
48745
- r && o && o > 0 && /* @__PURE__ */ p.jsx(xOe, { children: /* @__PURE__ */ p.jsx(Bh, { variant: "medium", children: o }) })
48745
+ o === 0 || o && o > 0 && /* @__PURE__ */ p.jsx(xOe, { children: /* @__PURE__ */ p.jsx(Bh, { variant: "medium", children: o }) })
48746
48746
  ] }) });
48747
48747
  }, sMe = ({
48748
48748
  tabsDefinition: e,
package/ui/index.umd.js CHANGED
@@ -4060,7 +4060,7 @@ ${Z.current.stack}
4060
4060
  background-color: ${R.color("bgLightGray1")};
4061
4061
  height: 2px;
4062
4062
  }
4063
- `,fwe=({tabDefinition:e,value:t,isActive:r,onTabSwitch:n})=>{const{icon:i,label:a,badgeCount:o,disabled:s}=e,c=x.useCallback(()=>{n(t)},[n,t]);return p.jsx(lwe,{children:p.jsxs(uwe,{onClick:s?void 0:c,active:r,disabled:s,children:[i&&p.jsx(swe,{children:p.jsx(rt,{icon:i})}),p.jsx(Rp,{children:a}),r&&o&&o>0&&p.jsx(cwe,{children:p.jsx(Rp,{variant:"medium",children:o})})]})})},Awe=({tabsDefinition:e,activeTab:t,onTabSwitch:r,mb:n})=>p.jsx(dwe,{$mb:n,children:e.map((i,a)=>p.jsx(fwe,{value:a,tabDefinition:i,isActive:a===t,onTabSwitch:r},a))}),pwe=({activeTab:e,value:t,children:r})=>e===t?r:null,hwe=e=>{const t=e.map(o=>o.default).indexOf(!0),r=t===-1?0:t,[n,i]=x.useState(r),a=x.useCallback(o=>{i(o)},[]);return{activeTab:n,onTabSwitch:a}},gwe=Bt(Be.div)`
4063
+ `,fwe=({tabDefinition:e,value:t,isActive:r,onTabSwitch:n})=>{const{icon:i,label:a,badgeCount:o,disabled:s}=e,c=x.useCallback(()=>{n(t)},[n,t]);return p.jsx(lwe,{children:p.jsxs(uwe,{onClick:s?void 0:c,active:r,disabled:s,children:[i&&p.jsx(swe,{children:p.jsx(rt,{icon:i})}),p.jsx(Rp,{children:a}),o===0||o&&o>0&&p.jsx(cwe,{children:p.jsx(Rp,{variant:"medium",children:o})})]})})},Awe=({tabsDefinition:e,activeTab:t,onTabSwitch:r,mb:n})=>p.jsx(dwe,{$mb:n,children:e.map((i,a)=>p.jsx(fwe,{value:a,tabDefinition:i,isActive:a===t,onTabSwitch:r},a))}),pwe=({activeTab:e,value:t,children:r})=>e===t?r:null,hwe=e=>{const t=e.map(o=>o.default).indexOf(!0),r=t===-1?0:t,[n,i]=x.useState(r),a=x.useCallback(o=>{i(o)},[]);return{activeTab:n,onTabSwitch:a}},gwe=Bt(Be.div)`
4064
4064
  width: calc(100vw - 20px);
4065
4065
  display: flex;
4066
4066
  min-height: 48px;