@mailstep/design-system 0.7.24-beta.3 → 0.7.24-beta.4
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 +1 -1
- package/ui/Blocks/Tabs/Tabs.d.ts +1 -1
- package/ui/Blocks/Tabs/Tabs.js +2 -2
- package/ui/Blocks/Tabs/stories/Tabs.stories.d.ts +1 -1
- package/ui/Blocks/Tabs/styles.d.ts +1 -0
- package/ui/Blocks/Tabs/styles.js +5 -2
- package/ui/Blocks/Tabs/types.d.ts +1 -0
- package/ui/index.es.js +7 -3
- package/ui/index.umd.js +3 -2
package/package.json
CHANGED
package/ui/Blocks/Tabs/Tabs.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TabsProps } from './types';
|
|
2
|
-
export declare const Tabs: ({ tabsDefinition, activeTab, onTabSwitch, mb }: TabsProps) => JSX.Element;
|
|
2
|
+
export declare const Tabs: ({ tabsDefinition, activeTab, onTabSwitch, mb, mt }: TabsProps) => JSX.Element;
|
package/ui/Blocks/Tabs/Tabs.js
CHANGED
|
@@ -12,8 +12,8 @@ var Tab = function (_a) {
|
|
|
12
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
|
-
var tabsDefinition = _a.tabsDefinition, activeTab = _a.activeTab, onTabSwitch = _a.onTabSwitch, mb = _a.mb;
|
|
16
|
-
return (_jsx(TabPanel, { "$mb": mb, children: tabsDefinition.map(function (item, index) {
|
|
15
|
+
var tabsDefinition = _a.tabsDefinition, activeTab = _a.activeTab, onTabSwitch = _a.onTabSwitch, mb = _a.mb, mt = _a.mt;
|
|
16
|
+
return (_jsx(TabPanel, { "$mb": mb, "$mt": mt, children: tabsDefinition.map(function (item, index) {
|
|
17
17
|
return _jsx(Tab, { value: index, tabDefinition: item, isActive: index === activeTab, onTabSwitch: onTabSwitch }, index);
|
|
18
18
|
}) }));
|
|
19
19
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { StoryObj } from '@storybook/react';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ tabsDefinition, activeTab, onTabSwitch, mb }: import("../types").TabsProps) => JSX.Element;
|
|
5
|
+
component: ({ tabsDefinition, activeTab, onTabSwitch, mb, mt }: import("../types").TabsProps) => JSX.Element;
|
|
6
6
|
tags: string[];
|
|
7
7
|
argTypes: {};
|
|
8
8
|
};
|
|
@@ -8,4 +8,5 @@ export declare const Tab: import("styled-components").StyledComponent<"div", imp
|
|
|
8
8
|
}, never>;
|
|
9
9
|
export declare const TabPanel: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
10
10
|
$mb?: string | undefined;
|
|
11
|
+
$mt?: string | undefined;
|
|
11
12
|
}, never>;
|
package/ui/Blocks/Tabs/styles.js
CHANGED
|
@@ -7,7 +7,7 @@ export var StyledImageBox = styled(x.div)(templateObject_1 || (templateObject_1
|
|
|
7
7
|
export var StyledTabWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n position: relative;\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n position: relative;\n"])));
|
|
8
8
|
export var RoundedWrap = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex !important;\n justify-content: center;\n align-items: center;\n height: 23px;\n background-color: ", ";\n border-radius: 29px;\n padding: 3px 10px;\n margin-left: 8px;\n"], ["\n display: flex !important;\n justify-content: center;\n align-items: center;\n height: 23px;\n background-color: ", ";\n border-radius: 29px;\n padding: 3px 10px;\n margin-left: 8px;\n"])), th.color('lightGray7'));
|
|
9
9
|
var activeTab = css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n\n &:after {\n content: '';\n position: absolute;\n bottom: 2;\n left: 0;\n right: 0;\n background-color: ", ";\n height: 4px;\n border-radius: 6px 6px 0px 0px;\n }\n & > div {\n display: inline;\n color: ", ";\n }\n"], ["\n color: ", ";\n\n &:after {\n content: '';\n position: absolute;\n bottom: 2;\n left: 0;\n right: 0;\n background-color: ", ";\n height: 4px;\n border-radius: 6px 6px 0px 0px;\n }\n & > div {\n display: inline;\n color: ", ";\n }\n"])), th.color('red1'), th.color('red1'), th.color('typoPrimary'));
|
|
10
|
-
export var Tab = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: ", ";\n padding: 0 8px
|
|
10
|
+
export var Tab = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: ", ";\n padding: 0 8px 8px;\n transition: 200ms;\n color: ", ";\n font-weight: bold;\n font-size: 14px;\n letter-spacing: 0.03em;\n min-width: 100px;\n\n & > div {\n display: none;\n }\n &:not(:last-child) {\n margin-right: 0.5rem;\n }\n\n :hover {\n color: ", ";\n }\n\n :active {\n ", ";\n }\n\n ", ";\n\n @media (min-width: 400px) {\n min-width: 120px;\n }\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: ", ";\n padding: 0 8px 8px;\n transition: 200ms;\n color: ", ";\n font-weight: bold;\n font-size: 14px;\n letter-spacing: 0.03em;\n min-width: 100px;\n\n & > div {\n display: none;\n }\n &:not(:last-child) {\n margin-right: 0.5rem;\n }\n\n :hover {\n color: ", ";\n }\n\n :active {\n ", ";\n }\n\n ", ";\n\n @media (min-width: 400px) {\n min-width: 120px;\n }\n"])), function (_a) {
|
|
11
11
|
var disabled = _a.disabled;
|
|
12
12
|
return (disabled ? 'auto' : 'pointer');
|
|
13
13
|
}, th.color('gray'), function (_a) {
|
|
@@ -20,8 +20,11 @@ export var Tab = styled.div(templateObject_5 || (templateObject_5 = __makeTempla
|
|
|
20
20
|
var active = _a.active;
|
|
21
21
|
return (active ? activeTab : '');
|
|
22
22
|
});
|
|
23
|
-
export var TabPanel = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n overflow: auto;\n width: fit-content;\n position: relative;\n margin-bottom: ", ";\n align-items: stretch;\n\n &:after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ", ";\n height: 2px;\n }\n"], ["\n display: flex;\n align-items: center;\n overflow: auto;\n width: fit-content;\n position: relative;\n margin-bottom: ", ";\n align-items: stretch;\n\n &:after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ", ";\n height: 2px;\n }\n"])), function (_a) {
|
|
23
|
+
export var TabPanel = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n overflow: auto;\n width: fit-content;\n position: relative;\n margin-bottom: ", ";\n margin-top: ", ";\n align-items: stretch;\n\n &:after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ", ";\n height: 2px;\n }\n"], ["\n display: flex;\n align-items: center;\n overflow: auto;\n width: fit-content;\n position: relative;\n margin-bottom: ", ";\n margin-top: ", ";\n align-items: stretch;\n\n &:after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ", ";\n height: 2px;\n }\n"])), function (_a) {
|
|
24
24
|
var _b = _a.$mb, $mb = _b === void 0 ? 0 : _b;
|
|
25
25
|
return $mb;
|
|
26
|
+
}, function (_a) {
|
|
27
|
+
var _b = _a.$mt, $mt = _b === void 0 ? 0 : _b;
|
|
28
|
+
return $mt;
|
|
26
29
|
}, th.color('bgLightGray1'));
|
|
27
30
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
package/ui/index.es.js
CHANGED
|
@@ -48689,7 +48689,7 @@ const AOe = /* @__PURE__ */ Hr(fOe), pOe = Qe`
|
|
|
48689
48689
|
cursor: ${({
|
|
48690
48690
|
disabled: e
|
|
48691
48691
|
}) => e ? "auto" : "pointer"};
|
|
48692
|
-
padding: 0 8px
|
|
48692
|
+
padding: 0 8px 8px;
|
|
48693
48693
|
transition: 200ms;
|
|
48694
48694
|
color: ${V.color("gray")};
|
|
48695
48695
|
font-weight: bold;
|
|
@@ -48731,6 +48731,9 @@ const AOe = /* @__PURE__ */ Hr(fOe), pOe = Qe`
|
|
|
48731
48731
|
position: relative;
|
|
48732
48732
|
margin-bottom: ${({
|
|
48733
48733
|
$mb: e = 0
|
|
48734
|
+
}) => e};
|
|
48735
|
+
margin-top: ${({
|
|
48736
|
+
$mt: e = 0
|
|
48734
48737
|
}) => e};
|
|
48735
48738
|
align-items: stretch;
|
|
48736
48739
|
|
|
@@ -48766,8 +48769,9 @@ const AOe = /* @__PURE__ */ Hr(fOe), pOe = Qe`
|
|
|
48766
48769
|
tabsDefinition: e,
|
|
48767
48770
|
activeTab: t,
|
|
48768
48771
|
onTabSwitch: r,
|
|
48769
|
-
mb: n
|
|
48770
|
-
|
|
48772
|
+
mb: n,
|
|
48773
|
+
mt: i
|
|
48774
|
+
}) => /* @__PURE__ */ p.jsx(EOe, { $mb: n, $mt: i, children: e.map((a, o) => /* @__PURE__ */ p.jsx(IOe, { value: o, tabDefinition: a, isActive: o === t, onTabSwitch: r }, o)) }), cMe = ({
|
|
48771
48775
|
activeTab: e,
|
|
48772
48776
|
value: t,
|
|
48773
48777
|
children: r
|
package/ui/index.umd.js
CHANGED
|
@@ -4013,7 +4013,7 @@ ${Z.current.stack}
|
|
|
4013
4013
|
align-items: center;
|
|
4014
4014
|
justify-content: center;
|
|
4015
4015
|
cursor: ${({disabled:e})=>e?"auto":"pointer"};
|
|
4016
|
-
padding: 0 8px
|
|
4016
|
+
padding: 0 8px 8px;
|
|
4017
4017
|
transition: 200ms;
|
|
4018
4018
|
color: ${j.color("gray")};
|
|
4019
4019
|
font-weight: bold;
|
|
@@ -4048,6 +4048,7 @@ ${Z.current.stack}
|
|
|
4048
4048
|
width: fit-content;
|
|
4049
4049
|
position: relative;
|
|
4050
4050
|
margin-bottom: ${({$mb:e=0})=>e};
|
|
4051
|
+
margin-top: ${({$mt:e=0})=>e};
|
|
4051
4052
|
align-items: stretch;
|
|
4052
4053
|
|
|
4053
4054
|
&:after {
|
|
@@ -4059,7 +4060,7 @@ ${Z.current.stack}
|
|
|
4059
4060
|
background-color: ${j.color("bgLightGray1")};
|
|
4060
4061
|
height: 2px;
|
|
4061
4062
|
}
|
|
4062
|
-
`,Awe=({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(cwe,{children:p.jsxs(dwe,{onClick:s?void 0:c,active:r,disabled:s,children:[i&&p.jsx(lwe,{children:p.jsx(rt,{icon:i})}),p.jsx(jp,{children:a}),o===0||o&&o>0&&p.jsx(uwe,{children:p.jsx(jp,{variant:"medium",children:o})})]})})},pwe=({tabsDefinition:e,activeTab:t,onTabSwitch:r,mb:n})=>p.jsx(fwe,{$mb:n,children:e.map((
|
|
4063
|
+
`,Awe=({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(cwe,{children:p.jsxs(dwe,{onClick:s?void 0:c,active:r,disabled:s,children:[i&&p.jsx(lwe,{children:p.jsx(rt,{icon:i})}),p.jsx(jp,{children:a}),o===0||o&&o>0&&p.jsx(uwe,{children:p.jsx(jp,{variant:"medium",children:o})})]})})},pwe=({tabsDefinition:e,activeTab:t,onTabSwitch:r,mb:n,mt:i})=>p.jsx(fwe,{$mb:n,$mt:i,children:e.map((a,o)=>p.jsx(Awe,{value:o,tabDefinition:a,isActive:o===t,onTabSwitch:r},o))}),hwe=({activeTab:e,value:t,children:r})=>e===t?r:null,gwe=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}},vwe=Bt(Be.div)`
|
|
4063
4064
|
width: calc(100vw - 20px);
|
|
4064
4065
|
display: flex;
|
|
4065
4066
|
min-height: 48px;
|