@mailstep/design-system 0.7.54 → 0.7.56-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 +7 -3
- package/ui/Blocks/CommonGrid/CommonGrid.d.ts +2 -2
- package/ui/Blocks/CommonGrid/CommonGrid.js +1 -1
- package/ui/Blocks/CommonGrid/components/GridModals/index.d.ts +3 -3
- package/ui/Blocks/CommonGrid/components/HeadCell.d.ts +16 -0
- package/ui/Blocks/CommonGrid/components/HeadCell.js +29 -0
- package/ui/Blocks/CommonGrid/components/HeadRow.d.ts +4 -5
- package/ui/Blocks/CommonGrid/components/HeadRow.js +12 -13
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.d.ts +7 -8
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +10 -25
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ManageColumnRow.d.ts +11 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ManageColumnRow.js +41 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/styles.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/styles.js +8 -2
- package/ui/Blocks/CommonGrid/components/Table.d.ts +6 -2
- package/ui/Blocks/CommonGrid/components/Table.js +1 -1
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +2 -2
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +11 -12
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +21 -13
- package/ui/Blocks/CommonGrid/storybook/utils/withRedux.d.ts +1 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withRedux.js +5 -3
- package/ui/Blocks/CommonGrid/styles.d.ts +1 -1
- package/ui/Blocks/Tabs/TabContent.d.ts +2 -2
- package/ui/Blocks/Tabs/Tabs.d.ts +2 -2
- package/ui/Blocks/Tabs/Tabs.js +7 -6
- 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 +7 -1
- package/ui/Blocks/Tabs/types.d.ts +2 -0
- package/ui/index.es.js +23912 -27127
- package/ui/index.umd.js +656 -825
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.d.ts +0 -12
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +0 -30
package/ui/Blocks/Tabs/Tabs.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
|
-
import { RoundedWrap, StyledImageBox, Tab as StyledTab, StyledTabWrapper, TabPanel } from './styles';
|
|
4
|
-
import { Text } from '../../Elements/Text';
|
|
5
3
|
import { Icon } from '../../Elements/Icon';
|
|
4
|
+
import { Text } from '../../Elements/Text';
|
|
5
|
+
import { RoundedWrap, StyledImageBox, Tab as StyledTab, StyledTabWrapper, TabPanel } from './styles';
|
|
6
6
|
var Tab = function (_a) {
|
|
7
|
-
var tabDefinition = _a.tabDefinition, value = _a.value, isActive = _a.isActive, onTabSwitch = _a.onTabSwitch;
|
|
7
|
+
var tabDefinition = _a.tabDefinition, value = _a.value, isActive = _a.isActive, onTabSwitch = _a.onTabSwitch, minWidth = _a.minWidth;
|
|
8
8
|
var icon = tabDefinition.icon, label = tabDefinition.label, badgeCount = tabDefinition.badgeCount, disabled = tabDefinition.disabled;
|
|
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 }), badgeCount === 0 ||
|
|
12
|
+
return (_jsx(StyledTabWrapper, { children: _jsxs(StyledTab, { onClick: !disabled ? handleOnClick : undefined, active: isActive, disabled: disabled, minWidth: minWidth, children: [icon && (_jsx(StyledImageBox, { children: _jsx(Icon, { icon: icon }) })), _jsx(Text, { children: label }), badgeCount === 0 ||
|
|
13
|
+
(badgeCount && badgeCount > 0 && (_jsx(RoundedWrap, { children: _jsx(Text, { variant: "medium", children: badgeCount }) })))] }) }));
|
|
13
14
|
};
|
|
14
15
|
export var Tabs = function (_a) {
|
|
15
|
-
var tabsDefinition = _a.tabsDefinition, activeTab = _a.activeTab, onTabSwitch = _a.onTabSwitch, mb = _a.mb, mt = _a.mt;
|
|
16
|
+
var tabsDefinition = _a.tabsDefinition, activeTab = _a.activeTab, onTabSwitch = _a.onTabSwitch, mb = _a.mb, mt = _a.mt, minTabWidth = _a.minTabWidth;
|
|
16
17
|
return (_jsx(TabPanel, { "$mb": mb, "$mt": mt, children: tabsDefinition.map(function (item, index) {
|
|
17
|
-
return _jsx(Tab, { value: index, tabDefinition: item, isActive: index === activeTab, onTabSwitch: onTabSwitch }, index);
|
|
18
|
+
return (_jsx(Tab, { value: index, tabDefinition: item, isActive: index === activeTab, minWidth: minTabWidth, onTabSwitch: onTabSwitch }, index));
|
|
18
19
|
}) }));
|
|
19
20
|
};
|
|
@@ -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, mt }: import("../types").TabsProps) => JSX.Element;
|
|
5
|
+
component: ({ tabsDefinition, activeTab, onTabSwitch, mb, mt, minTabWidth }: import("../types").TabsProps) => JSX.Element;
|
|
6
6
|
tags: string[];
|
|
7
7
|
argTypes: {};
|
|
8
8
|
};
|
|
@@ -5,6 +5,7 @@ export declare const RoundedWrap: import("styled-components").StyledComponent<"d
|
|
|
5
5
|
export declare const Tab: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
6
6
|
active: boolean;
|
|
7
7
|
disabled?: boolean | undefined;
|
|
8
|
+
minWidth?: string | string[] | undefined;
|
|
8
9
|
}, never>;
|
|
9
10
|
export declare const TabPanel: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
10
11
|
$mb?: string | undefined;
|
package/ui/Blocks/Tabs/styles.js
CHANGED
|
@@ -7,10 +7,13 @@ 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
|
|
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 12px 12px;\n transition: 200ms;\n color: ", ";\n font-weight: bold;\n font-size: 14px;\n letter-spacing: 0.03em;\n min-width: ", ";\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: ", ";\n }\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: ", ";\n padding: 0 12px 12px;\n transition: 200ms;\n color: ", ";\n font-weight: bold;\n font-size: 14px;\n letter-spacing: 0.03em;\n min-width: ", ";\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: ", ";\n }\n"])), function (_a) {
|
|
11
11
|
var disabled = _a.disabled;
|
|
12
12
|
return (disabled ? 'auto' : 'pointer');
|
|
13
13
|
}, th.color('gray'), function (_a) {
|
|
14
|
+
var minWidth = _a.minWidth;
|
|
15
|
+
return minWidth ? (Array.isArray(minWidth) ? minWidth[0] : minWidth) : '100px';
|
|
16
|
+
}, function (_a) {
|
|
14
17
|
var disabled = _a.disabled;
|
|
15
18
|
return th.color(disabled ? 'gray' : 'typoPrimary');
|
|
16
19
|
}, function (_a) {
|
|
@@ -19,6 +22,9 @@ export var Tab = styled.div(templateObject_5 || (templateObject_5 = __makeTempla
|
|
|
19
22
|
}, function (_a) {
|
|
20
23
|
var active = _a.active;
|
|
21
24
|
return (active ? activeTab : '');
|
|
25
|
+
}, function (_a) {
|
|
26
|
+
var minWidth = _a.minWidth;
|
|
27
|
+
return minWidth ? (Array.isArray(minWidth) ? minWidth[1] : minWidth) : '120px';
|
|
22
28
|
});
|
|
23
29
|
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
30
|
var _b = _a.$mb, $mb = _b === void 0 ? 0 : _b;
|
|
@@ -12,12 +12,14 @@ export type TabsProps = {
|
|
|
12
12
|
onTabSwitch: (tab: number) => void;
|
|
13
13
|
mb?: string;
|
|
14
14
|
mt?: string;
|
|
15
|
+
minTabWidth?: string | string[];
|
|
15
16
|
};
|
|
16
17
|
export type TabElementProps = {
|
|
17
18
|
tabDefinition: TabDefinition;
|
|
18
19
|
value: number;
|
|
19
20
|
isActive: boolean;
|
|
20
21
|
onTabSwitch: (tab: number) => void;
|
|
22
|
+
minWidth?: string | string[];
|
|
21
23
|
};
|
|
22
24
|
export type UseTabsHook = (tabDefinitions: TabDefinition[]) => {
|
|
23
25
|
activeTab: number;
|