@mailstep/design-system 0.7.20 → 0.7.21-beta.1
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/CommonGrid/store/index.d.ts +1 -1
- package/ui/Blocks/CommonGrid/store/index.js +4 -1
- package/ui/Blocks/LoginPage/LoginPage.js +2 -2
- package/ui/Blocks/LoginPage/components/LoginForm.d.ts +2 -0
- package/ui/Blocks/LoginPage/components/LoginForm.js +3 -3
- package/ui/Blocks/LoginPage/stories/LoginPage.stories.d.ts +1 -0
- package/ui/Blocks/LoginPage/stories/LoginPage.stories.js +9 -0
- package/ui/Blocks/LoginPage/types.d.ts +2 -0
- package/ui/Elements/Icon/icons/index.d.ts +0 -1
- package/ui/Elements/Icon/icons/index.js +0 -1
- package/ui/index.es.js +3411 -3415
- package/ui/index.umd.js +489 -489
- package/ui/Elements/Icon/icons/Pallet.d.ts +0 -3
- package/ui/Elements/Icon/icons/Pallet.js +0 -13
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@ export declare const actionTypes: {
|
|
|
29
29
|
declare const _default: (state: MultiState | undefined, action: Action) => MultiState;
|
|
30
30
|
export default _default;
|
|
31
31
|
export declare const createActions: (gridName: string) => {
|
|
32
|
-
init: (initProps
|
|
32
|
+
init: (initProps?: InitProps) => Action;
|
|
33
33
|
clearUxState: () => Action;
|
|
34
34
|
handleUxChange: (uxKey: keyof GridState['uxState'], uxValue: any) => Action;
|
|
35
35
|
openConfigForm: () => Action;
|
|
@@ -158,7 +158,10 @@ export default (function (state, action) {
|
|
|
158
158
|
});
|
|
159
159
|
});
|
|
160
160
|
export var createActions = function (gridName) { return ({
|
|
161
|
-
init: function (initProps) {
|
|
161
|
+
init: function (initProps) {
|
|
162
|
+
if (initProps === void 0) { initProps = {}; }
|
|
163
|
+
return ({ gridName: gridName, type: actionTypes.init, initProps: initProps });
|
|
164
|
+
},
|
|
162
165
|
clearUxState: function () { return ({ gridName: gridName, type: actionTypes.clearUxState }); },
|
|
163
166
|
handleUxChange: function (uxKey, uxValue) { return ({
|
|
164
167
|
gridName: gridName,
|
|
@@ -8,7 +8,7 @@ import { Trans } from '@lingui/react';
|
|
|
8
8
|
import { x } from '@xstyled/styled-components';
|
|
9
9
|
import { Wrapper, MailTo, LanguageBox, LogoWrapper, MainLogo, Version, CardBodyWithLanguage } from './styles';
|
|
10
10
|
var Login = function (_a) {
|
|
11
|
-
var onSubmit = _a.onSubmit, activeLanguage = _a.activeLanguage, onLanguageChange = _a.onLanguageChange, children = _a.children, brand = _a.brand, brandVariant = _a.brandVariant, isSubmitting = _a.isSubmitting, isSubmitDisabled = _a.isSubmitDisabled, withDistributionCenterSelect = _a.withDistributionCenterSelect, distributionCenterOptions = _a.distributionCenterOptions, selectedDistributionCenter = _a.selectedDistributionCenter, onChangeDistributionCenter = _a.onChangeDistributionCenter, languageItems = _a.languageItems, version = _a.version, backgroundImage = _a.backgroundImage, _b = _a.hasSupport, hasSupport = _b === void 0 ? true : _b, _c = _a.hasSocialLinks, hasSocialLinks = _c === void 0 ? true : _c;
|
|
12
|
-
return (_jsxs(Wrapper, { backgroundImage: backgroundImage, children: [_jsxs(CardBodyWithLanguage, { children: [_jsx(LogoWrapper, { children: _jsx(MainLogo, { brand: brand, variant: brandVariant }) }), _jsxs(LanguageBox, { children: [hasSupport && (_jsxs(x.div, { mr: 4, children: [_jsx(H6, { color: "gray1", variant: "bold", mt: "8px", mb: "8px", as: "h6", children: _jsx(Trans, { id: "form.heading.support", message: "Support:" }) }), _jsx(MailTo, { href: "mailto:mailstep@mailstep.cz", children: EMAIL_ADDRESS })] })), _jsx(LanguageSwitch, { activeLanguage: activeLanguage, onLanguageChange: onLanguageChange, languageItems: languageItems })] }), _jsx(LoginForm, { onSubmit: onSubmit, isSubmitDisabled: isSubmitDisabled, isSubmitting: isSubmitting, onChangeDistributionCenter: onChangeDistributionCenter, withDistributionCenterSelect: withDistributionCenterSelect, distributionCenterOptions: distributionCenterOptions, selectedDistributionCenter: selectedDistributionCenter })] }), children, version && _jsx(Version, { children: version }), hasSocialLinks && _jsx(SocialLinks, {})] }));
|
|
11
|
+
var onSubmit = _a.onSubmit, activeLanguage = _a.activeLanguage, onLanguageChange = _a.onLanguageChange, children = _a.children, brand = _a.brand, brandVariant = _a.brandVariant, isSubmitting = _a.isSubmitting, isSubmitDisabled = _a.isSubmitDisabled, withDistributionCenterSelect = _a.withDistributionCenterSelect, distributionCenterOptions = _a.distributionCenterOptions, selectedDistributionCenter = _a.selectedDistributionCenter, onChangeDistributionCenter = _a.onChangeDistributionCenter, languageItems = _a.languageItems, version = _a.version, backgroundImage = _a.backgroundImage, _b = _a.hasSupport, hasSupport = _b === void 0 ? true : _b, _c = _a.hasSocialLinks, hasSocialLinks = _c === void 0 ? true : _c, _d = _a.withPassword, withPassword = _d === void 0 ? true : _d, loginLabel = _a.loginLabel;
|
|
12
|
+
return (_jsxs(Wrapper, { backgroundImage: backgroundImage, children: [_jsxs(CardBodyWithLanguage, { children: [_jsx(LogoWrapper, { children: _jsx(MainLogo, { brand: brand, variant: brandVariant }) }), _jsxs(LanguageBox, { children: [hasSupport && (_jsxs(x.div, { mr: 4, children: [_jsx(H6, { color: "gray1", variant: "bold", mt: "8px", mb: "8px", as: "h6", children: _jsx(Trans, { id: "form.heading.support", message: "Support:" }) }), _jsx(MailTo, { href: "mailto:mailstep@mailstep.cz", children: EMAIL_ADDRESS })] })), _jsx(LanguageSwitch, { activeLanguage: activeLanguage, onLanguageChange: onLanguageChange, languageItems: languageItems })] }), _jsx(LoginForm, { onSubmit: onSubmit, isSubmitDisabled: isSubmitDisabled, isSubmitting: isSubmitting, onChangeDistributionCenter: onChangeDistributionCenter, withDistributionCenterSelect: withDistributionCenterSelect, distributionCenterOptions: distributionCenterOptions, selectedDistributionCenter: selectedDistributionCenter, withPassword: withPassword, loginLabel: loginLabel })] }), children, version && _jsx(Version, { children: version }), hasSocialLinks && _jsx(SocialLinks, {})] }));
|
|
13
13
|
};
|
|
14
14
|
export default Login;
|
|
@@ -9,6 +9,8 @@ type Props = {
|
|
|
9
9
|
distributionCenterOptions?: Option[];
|
|
10
10
|
onChangeDistributionCenter?: (dcId: string) => void;
|
|
11
11
|
selectedDistributionCenter?: string;
|
|
12
|
+
withPassword?: boolean;
|
|
13
|
+
loginLabel?: string;
|
|
12
14
|
};
|
|
13
15
|
export declare const LoginForm: FC<Props>;
|
|
14
16
|
export {};
|
|
@@ -13,7 +13,7 @@ import styled, { x } from '@xstyled/styled-components';
|
|
|
13
13
|
var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: block;\n width: 100%;\n box-sizing: border-box;\n margin-bottom: 10px;\n & > div > H4 {\n display: none;\n }\n @media (min-width: 1024px) {\n height: 300px;\n min-width: 300px;\n margin-bottom: 50px;\n & > div > H4 {\n display: block;\n }\n }\n"], ["\n display: block;\n width: 100%;\n box-sizing: border-box;\n margin-bottom: 10px;\n & > div > H4 {\n display: none;\n }\n @media (min-width: 1024px) {\n height: 300px;\n min-width: 300px;\n margin-bottom: 50px;\n & > div > H4 {\n display: block;\n }\n }\n"])));
|
|
14
14
|
var ButtonsContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n margin-top: 15px;\n width: 100%;\n @media (min-width: 1024px) {\n display: inline-block;\n margin-top: 40px;\n }\n"], ["\n display: flex;\n margin-top: 15px;\n width: 100%;\n @media (min-width: 1024px) {\n display: inline-block;\n margin-top: 40px;\n }\n"])));
|
|
15
15
|
export var LoginForm = function (_a) {
|
|
16
|
-
var onSubmit = _a.onSubmit, isSubmitting = _a.isSubmitting, isSubmitDisabled = _a.isSubmitDisabled, distributionCenterOptions = _a.distributionCenterOptions, withDistributionCenterSelect = _a.withDistributionCenterSelect, onChangeDistributionCenter = _a.onChangeDistributionCenter, selectedDistributionCenter = _a.selectedDistributionCenter;
|
|
16
|
+
var onSubmit = _a.onSubmit, isSubmitting = _a.isSubmitting, isSubmitDisabled = _a.isSubmitDisabled, distributionCenterOptions = _a.distributionCenterOptions, withDistributionCenterSelect = _a.withDistributionCenterSelect, onChangeDistributionCenter = _a.onChangeDistributionCenter, selectedDistributionCenter = _a.selectedDistributionCenter, withPassword = _a.withPassword, loginLabel = _a.loginLabel;
|
|
17
17
|
var _b = useState(''), login = _b[0], setLogin = _b[1];
|
|
18
18
|
var _c = useState(''), password = _c[0], setPassword = _c[1];
|
|
19
19
|
var _d = useState(''), loginError = _d[0], setLoginError = _d[1];
|
|
@@ -33,7 +33,7 @@ export var LoginForm = function (_a) {
|
|
|
33
33
|
setLoginError(i18n._({ id: 'requiredField', message: 'Required field' }));
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
if (!password) {
|
|
36
|
+
if (withPassword && !password) {
|
|
37
37
|
setPasswordError(i18n._({ id: 'requiredField', message: 'Required field' }));
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
@@ -49,7 +49,7 @@ export var LoginForm = function (_a) {
|
|
|
49
49
|
var handleChangeDistributionCenter = useCallback(function (e) {
|
|
50
50
|
onChangeDistributionCenter === null || onChangeDistributionCenter === void 0 ? void 0 : onChangeDistributionCenter(e.target.value);
|
|
51
51
|
}, [onChangeDistributionCenter]);
|
|
52
|
-
return (_jsxs(Container, { children: [_jsx(x.div, { mt: "24px", children: _jsx(Input, { label: i18n._({ id: 'form.login.label', message: 'Login' }), placeholder: i18n._({ id: 'form.login.label', message: 'Login' }), type: "text", name: "login", error: loginError, value: login, onChange: handleChangeLogin, onEnter: handleSubmit }) }), _jsx(x.div, { mt: "12px", children: _jsx(Input, { label: i18n._({ id: 'form.password.label', message: 'Password' }), placeholder: i18n._({ id: 'form.password.label', message: 'Password' }), name: "password", type: "password", value: password, onChange: handleChangePassword, error: passwordError, onEnter: handleSubmit }) }), withDistributionCenterSelect && (_jsx(x.div, { mt: "12px", children: _jsx(SingleSelect
|
|
52
|
+
return (_jsxs(Container, { children: [_jsx(x.div, { mt: "24px", children: _jsx(Input, { label: loginLabel || i18n._({ id: 'form.login.label', message: 'Login' }), placeholder: i18n._({ id: 'form.login.label', message: 'Login' }), type: "text", name: "login", autoFocus: true, error: loginError, value: login, onChange: handleChangeLogin, onEnter: handleSubmit }) }), withPassword && (_jsx(x.div, { mt: "12px", children: _jsx(Input, { label: i18n._({ id: 'form.password.label', message: 'Password' }), placeholder: i18n._({ id: 'form.password.label', message: 'Password' }), name: "password", type: "password", value: password, onChange: handleChangePassword, error: passwordError, onEnter: handleSubmit }) })), withDistributionCenterSelect && (_jsx(x.div, { mt: "12px", children: _jsx(SingleSelect
|
|
53
53
|
// @ts-ignore
|
|
54
54
|
, {
|
|
55
55
|
// @ts-ignore
|
|
@@ -7,3 +7,4 @@ export declare const Default: () => import("react/jsx-runtime").JSX.Element;
|
|
|
7
7
|
export declare const WithDistributionCenterSelect: () => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export declare const WithBackgroundImage: () => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export declare const WarehouseBrand: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const WarehouseBrandWithAccessKey: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -102,3 +102,12 @@ export var WarehouseBrand = function () {
|
|
|
102
102
|
console.log('Language changed:', language);
|
|
103
103
|
}, brand: "warehouse", brandVariant: "m", languageItems: languageItems, hasSupport: false, hasSocialLinks: false }) }));
|
|
104
104
|
};
|
|
105
|
+
export var WarehouseBrandWithAccessKey = function () {
|
|
106
|
+
return (_jsx(LinguiContainer, { children: _jsx(LoginPage, { onSubmit: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
107
|
+
return __generator(this, function (_a) {
|
|
108
|
+
alert("submit");
|
|
109
|
+
console.log('Login data:', data);
|
|
110
|
+
return [2 /*return*/];
|
|
111
|
+
});
|
|
112
|
+
}); }, isSubmitting: false, isSubmitDisabled: false, activeLanguage: "en", version: "1.0.0", onLanguageChange: console.log, brand: "warehouse", brandVariant: "m", languageItems: languageItems, hasSupport: false, hasSocialLinks: false, withPassword: false, loginLabel: "Access Key" }) }));
|
|
113
|
+
};
|