@synerise/ds-wizard 0.6.3 → 0.7.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/CHANGELOG.md +22 -0
- package/dist/Wizard.d.ts +2 -2
- package/dist/Wizard.js +29 -18
- package/dist/Wizard.styles.d.ts +3 -1
- package/dist/Wizard.styles.js +18 -10
- package/dist/Wizard.types.d.ts +6 -0
- package/dist/index.d.ts +2 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.7.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-wizard@0.7.0...@synerise/ds-wizard@0.7.1) (2024-02-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **wizard:** fixed types exports ([ff356df](https://github.com/Synerise/synerise-design/commit/ff356dfeb5f1ed84b30f06cb17e0df5fc73094ae))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [0.7.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-wizard@0.6.3...@synerise/ds-wizard@0.7.0) (2024-02-21)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **wizard:** navigation in footer, editable header ([e4c70fa](https://github.com/Synerise/synerise-design/commit/e4c70fa734e0557d236d0fee36d0b9b83a99ad09))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [0.6.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-wizard@0.6.2...@synerise/ds-wizard@0.6.3) (2024-02-19)
|
|
7
29
|
|
|
8
30
|
**Note:** Version bump only for package @synerise/ds-wizard
|
package/dist/Wizard.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WizardProps } from './Wizard.types';
|
|
2
2
|
declare const Wizard: {
|
|
3
|
-
({ stepper, contentWidth, headerAction, footer, title, onClose, children, onPrevStep, onNextStep, stepButtonProps, texts, visible, className, }: WizardProps): JSX.Element | null;
|
|
4
|
-
OnModal: ({ visible, stepper, headerAction, title, onClose, children, onPrevStep, onNextStep, texts, modalProps, stepButtonProps, }: import("
|
|
3
|
+
({ stepper, contentWidth, headerAction, footerAction, footer, footerLeft, title, onClose, children, onPrevStep, onNextStep, stepButtonProps, texts, visible, className, navigationInFooter, headerInlineEdit, headerAvatar, }: WizardProps): JSX.Element | null;
|
|
4
|
+
OnModal: ({ visible, stepper, headerAction, title, onClose, children, onPrevStep, onNextStep, texts, modalProps, stepButtonProps, }: import(".").OnModalProps) => JSX.Element;
|
|
5
5
|
};
|
|
6
6
|
export default Wizard;
|
package/dist/Wizard.js
CHANGED
|
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import Layout from '@synerise/ds-layout';
|
|
6
|
-
import PageHeader from '@synerise/ds-page-header
|
|
6
|
+
import PageHeader from '@synerise/ds-page-header';
|
|
7
7
|
import Button from '@synerise/ds-button';
|
|
8
8
|
import Icon, { ArrowLeftCircleM } from '@synerise/ds-icon';
|
|
9
9
|
import { useIntl } from 'react-intl';
|
|
@@ -14,7 +14,9 @@ var Wizard = function Wizard(_ref) {
|
|
|
14
14
|
var stepper = _ref.stepper,
|
|
15
15
|
contentWidth = _ref.contentWidth,
|
|
16
16
|
headerAction = _ref.headerAction,
|
|
17
|
+
footerAction = _ref.footerAction,
|
|
17
18
|
footer = _ref.footer,
|
|
19
|
+
footerLeft = _ref.footerLeft,
|
|
18
20
|
title = _ref.title,
|
|
19
21
|
onClose = _ref.onClose,
|
|
20
22
|
children = _ref.children,
|
|
@@ -23,43 +25,52 @@ var Wizard = function Wizard(_ref) {
|
|
|
23
25
|
stepButtonProps = _ref.stepButtonProps,
|
|
24
26
|
texts = _ref.texts,
|
|
25
27
|
visible = _ref.visible,
|
|
26
|
-
className = _ref.className
|
|
28
|
+
className = _ref.className,
|
|
29
|
+
navigationInFooter = _ref.navigationInFooter,
|
|
30
|
+
headerInlineEdit = _ref.headerInlineEdit,
|
|
31
|
+
headerAvatar = _ref.headerAvatar;
|
|
27
32
|
var intl = useIntl();
|
|
33
|
+
var prevButtonType = navigationInFooter ? 'secondary' : 'ghost';
|
|
28
34
|
var prevButtonProps = stepButtonProps != null && stepButtonProps.prevButtonProps ? stepButtonProps.prevButtonProps : {
|
|
29
|
-
type:
|
|
35
|
+
type: prevButtonType,
|
|
30
36
|
mode: 'icon-label'
|
|
31
37
|
};
|
|
32
38
|
var nextButtonProps = stepButtonProps != null && stepButtonProps.nextButtonProps ? stepButtonProps.nextButtonProps : {
|
|
33
39
|
type: 'primary'
|
|
34
40
|
};
|
|
41
|
+
var navButtons = /*#__PURE__*/React.createElement(React.Fragment, null, onPrevStep ? /*#__PURE__*/React.createElement(Button, _extends({}, prevButtonProps, {
|
|
42
|
+
onClick: onPrevStep
|
|
43
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
44
|
+
component: /*#__PURE__*/React.createElement(ArrowLeftCircleM, null)
|
|
45
|
+
}), ' ', (texts == null ? void 0 : texts.prevButtonLabel) || intl.formatMessage({
|
|
46
|
+
id: 'DS.WIZARD.PREV-BUTTON',
|
|
47
|
+
defaultMessage: 'Back'
|
|
48
|
+
})) : /*#__PURE__*/React.createElement(S.ButtonPlaceholder, null), onNextStep && /*#__PURE__*/React.createElement(Button, _extends({}, nextButtonProps, {
|
|
49
|
+
onClick: onNextStep
|
|
50
|
+
}), (texts == null ? void 0 : texts.nextButtonLabel) || intl.formatMessage({
|
|
51
|
+
id: 'DS.WIZARD.NEXT-BUTTON',
|
|
52
|
+
defaultMessage: 'Next step'
|
|
53
|
+
})));
|
|
54
|
+
var hasFooter = Boolean(footer || footerLeft || navigationInFooter);
|
|
55
|
+
var editableTitle = headerInlineEdit !== undefined;
|
|
35
56
|
return visible ? /*#__PURE__*/React.createElement(S.WizardWrapper, {
|
|
36
57
|
className: classnames(className, 'ds-wizard')
|
|
37
58
|
}, /*#__PURE__*/React.createElement(Layout, {
|
|
38
59
|
fullPage: true,
|
|
39
60
|
header: /*#__PURE__*/React.createElement(PageHeader, {
|
|
40
|
-
|
|
61
|
+
inlineEdit: headerInlineEdit,
|
|
62
|
+
avatar: editableTitle && headerAvatar,
|
|
63
|
+
title: !editableTitle && title,
|
|
41
64
|
onClose: onClose,
|
|
42
65
|
rightSide: /*#__PURE__*/React.createElement(S.WizardHeader, {
|
|
43
66
|
withHeaderAction: !!headerAction
|
|
44
67
|
}, stepper && /*#__PURE__*/React.createElement(S.WizardStepper, null, stepper), headerAction && /*#__PURE__*/React.createElement(S.WizardHeaderAction, null, headerAction))
|
|
45
68
|
})
|
|
46
69
|
}, /*#__PURE__*/React.createElement(S.WizardContainer, {
|
|
47
|
-
withFooter:
|
|
70
|
+
withFooter: hasFooter
|
|
48
71
|
}, /*#__PURE__*/React.createElement(S.WizardContent, {
|
|
49
72
|
contentWidth: contentWidth
|
|
50
|
-
}, children, /*#__PURE__*/React.createElement(S.WizardButtons, null,
|
|
51
|
-
onClick: onPrevStep
|
|
52
|
-
}), /*#__PURE__*/React.createElement(Icon, {
|
|
53
|
-
component: /*#__PURE__*/React.createElement(ArrowLeftCircleM, null)
|
|
54
|
-
}), ' ', (texts == null ? void 0 : texts.prevButtonLabel) || intl.formatMessage({
|
|
55
|
-
id: 'DS.WIZARD.PREV-BUTTON',
|
|
56
|
-
defaultMessage: 'Back'
|
|
57
|
-
})) : /*#__PURE__*/React.createElement(S.ButtonPlaceholder, null), onNextStep && /*#__PURE__*/React.createElement(Button, _extends({}, nextButtonProps, {
|
|
58
|
-
onClick: onNextStep
|
|
59
|
-
}), (texts == null ? void 0 : texts.nextButtonLabel) || intl.formatMessage({
|
|
60
|
-
id: 'DS.WIZARD.NEXT-BUTTON',
|
|
61
|
-
defaultMessage: 'Next step'
|
|
62
|
-
}))))), footer && /*#__PURE__*/React.createElement(S.WizardFooter, null, footer))) : null;
|
|
73
|
+
}, children, !navigationInFooter && /*#__PURE__*/React.createElement(S.WizardButtons, null, navButtons))), hasFooter && /*#__PURE__*/React.createElement(S.WizardFooter, null, (footerLeft || footer) && /*#__PURE__*/React.createElement(S.FooterLeftSide, null, footerLeft || footer), navigationInFooter && /*#__PURE__*/React.createElement(S.FooterRightSide, null, footerAction, " ", navButtons)))) : null;
|
|
63
74
|
};
|
|
64
75
|
|
|
65
76
|
Wizard.OnModal = WizardOnModal;
|
package/dist/Wizard.styles.d.ts
CHANGED
|
@@ -8,12 +8,14 @@ export declare const WizardContainer: import("styled-components").StyledComponen
|
|
|
8
8
|
contentWidth?: string | undefined;
|
|
9
9
|
withFooter: boolean;
|
|
10
10
|
}, never>;
|
|
11
|
+
export declare const WizardButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
12
|
export declare const WizardContent: import("styled-components").StyledComponent<"div", any, {
|
|
12
13
|
contentWidth?: string | undefined;
|
|
13
14
|
}, never>;
|
|
14
15
|
export declare const ModalWizardContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
|
-
export declare const WizardButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
16
|
export declare const ButtonPlaceholder: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
17
17
|
export declare const ModalWizardButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
|
+
export declare const FooterLeftSide: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
19
|
+
export declare const FooterRightSide: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
20
|
export declare const WizardFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
19
21
|
export declare const HeaderActions: import("styled-components").StyledComponent<"div", any, {}, never>;
|
package/dist/Wizard.styles.js
CHANGED
|
@@ -29,20 +29,20 @@ export var WizardContainer = styled.div.withConfig({
|
|
|
29
29
|
}, function (props) {
|
|
30
30
|
return props.withFooter ? '80px' : '0';
|
|
31
31
|
});
|
|
32
|
+
export var WizardButtons = styled.div.withConfig({
|
|
33
|
+
displayName: "Wizardstyles__WizardButtons",
|
|
34
|
+
componentId: "sc-1lvfph4-5"
|
|
35
|
+
})(["display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;margin:48px 0 0;"]);
|
|
32
36
|
export var WizardContent = styled.div.withConfig({
|
|
33
37
|
displayName: "Wizardstyles__WizardContent",
|
|
34
|
-
componentId: "sc-1lvfph4-
|
|
38
|
+
componentId: "sc-1lvfph4-6"
|
|
35
39
|
})(["width:", ";max-width:calc(100% - 48px);display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;"], function (props) {
|
|
36
40
|
return props.contentWidth ? props.contentWidth : '100%';
|
|
37
41
|
});
|
|
38
42
|
export var ModalWizardContent = styled.div.withConfig({
|
|
39
43
|
displayName: "Wizardstyles__ModalWizardContent",
|
|
40
|
-
componentId: "sc-1lvfph4-6"
|
|
41
|
-
})(["width:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;"]);
|
|
42
|
-
export var WizardButtons = styled.div.withConfig({
|
|
43
|
-
displayName: "Wizardstyles__WizardButtons",
|
|
44
44
|
componentId: "sc-1lvfph4-7"
|
|
45
|
-
})(["display:flex;flex-direction:
|
|
45
|
+
})(["width:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;"]);
|
|
46
46
|
export var ButtonPlaceholder = styled.span.withConfig({
|
|
47
47
|
displayName: "Wizardstyles__ButtonPlaceholder",
|
|
48
48
|
componentId: "sc-1lvfph4-8"
|
|
@@ -51,17 +51,25 @@ export var ModalWizardButtons = styled.div.withConfig({
|
|
|
51
51
|
displayName: "Wizardstyles__ModalWizardButtons",
|
|
52
52
|
componentId: "sc-1lvfph4-9"
|
|
53
53
|
})(["display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;"]);
|
|
54
|
+
export var FooterLeftSide = styled.div.withConfig({
|
|
55
|
+
displayName: "Wizardstyles__FooterLeftSide",
|
|
56
|
+
componentId: "sc-1lvfph4-10"
|
|
57
|
+
})(["display:flex;justify-content:flex-start;"]);
|
|
58
|
+
export var FooterRightSide = styled.div.withConfig({
|
|
59
|
+
displayName: "Wizardstyles__FooterRightSide",
|
|
60
|
+
componentId: "sc-1lvfph4-11"
|
|
61
|
+
})(["display:flex;justify-content:flex-end;align-items:center;gap:16px;", "{display:none;}"], ButtonPlaceholder);
|
|
54
62
|
export var WizardFooter = styled.div.withConfig({
|
|
55
63
|
displayName: "Wizardstyles__WizardFooter",
|
|
56
|
-
componentId: "sc-1lvfph4-
|
|
57
|
-
})(["display:flex;width:calc(100% - 48px);padding:15px 0;margin:0 24px;background-color:", ";border-top:1px solid ", ";position:fixed;bottom:0;left:0;& > *{margin-right:8px;}"], function (props) {
|
|
64
|
+
componentId: "sc-1lvfph4-12"
|
|
65
|
+
})(["display:flex;justify-content:space-between;width:calc(100% - 48px);padding:15px 0;margin:0 24px;background-color:", ";border-top:1px solid ", ";position:fixed;bottom:0;left:0;& > *{margin-right:8px;}", ":empty,", ":empty{display:none;}"], function (props) {
|
|
58
66
|
return props.theme.palette.white;
|
|
59
67
|
}, function (props) {
|
|
60
68
|
return props.theme.palette['grey-200'];
|
|
61
|
-
});
|
|
69
|
+
}, FooterLeftSide, FooterRightSide);
|
|
62
70
|
export var HeaderActions = styled.div.withConfig({
|
|
63
71
|
displayName: "Wizardstyles__HeaderActions",
|
|
64
|
-
componentId: "sc-1lvfph4-
|
|
72
|
+
componentId: "sc-1lvfph4-13"
|
|
65
73
|
})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-end;margin-right:16px;padding-right:24px;position:relative;.ds-stepper{margin-right:24px;}&:after{content:'';display:flex;height:40px;width:1px;background-color:", ";position:absolute;right:0;top:-4px;}"], function (props) {
|
|
66
74
|
return props.theme.palette['grey-200'];
|
|
67
75
|
});
|
package/dist/Wizard.types.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ButtonProps } from '@synerise/ds-button';
|
|
3
|
+
import type { PageHeaderProps } from '@synerise/ds-page-header';
|
|
3
4
|
export type WizardProps = {
|
|
4
5
|
stepper?: ReactNode;
|
|
5
6
|
footer?: ReactNode;
|
|
7
|
+
footerLeft?: ReactNode;
|
|
6
8
|
children?: ReactNode;
|
|
7
9
|
title: ReactNode;
|
|
8
10
|
headerAction?: ReactNode;
|
|
11
|
+
footerAction?: ReactNode;
|
|
9
12
|
onClose: () => void;
|
|
10
13
|
visible: boolean;
|
|
11
14
|
contentWidth?: string;
|
|
@@ -20,4 +23,7 @@ export type WizardProps = {
|
|
|
20
23
|
prevButtonProps?: Partial<Omit<ButtonProps, 'onClick'>>;
|
|
21
24
|
nextButtonProps?: Partial<Omit<ButtonProps, 'onClick'>>;
|
|
22
25
|
};
|
|
26
|
+
headerInlineEdit?: PageHeaderProps['inlineEdit'];
|
|
27
|
+
headerAvatar?: PageHeaderProps['avatar'];
|
|
28
|
+
navigationInFooter?: boolean;
|
|
23
29
|
};
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-wizard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Wizard UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
],
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@synerise/ds-button": "^0.19.
|
|
37
|
-
"@synerise/ds-icon": "^0.60.
|
|
38
|
-
"@synerise/ds-layout": "^0.14.
|
|
39
|
-
"@synerise/ds-modal": "^0.17.
|
|
40
|
-
"@synerise/ds-page-header": "^0.
|
|
41
|
-
"@synerise/ds-utils": "^0.24.
|
|
36
|
+
"@synerise/ds-button": "^0.19.2",
|
|
37
|
+
"@synerise/ds-icon": "^0.60.2",
|
|
38
|
+
"@synerise/ds-layout": "^0.14.2",
|
|
39
|
+
"@synerise/ds-modal": "^0.17.20",
|
|
40
|
+
"@synerise/ds-page-header": "^0.15.1",
|
|
41
|
+
"@synerise/ds-utils": "^0.24.26",
|
|
42
42
|
"classnames": "2.3.2",
|
|
43
43
|
"react-dom": "16.13.0",
|
|
44
44
|
"react-intl": "3.12.0"
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"@testing-library/react": "10.0.1",
|
|
54
54
|
"@testing-library/user-event": "^10.3.1"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "751dc6640206153c0d4ab08107743bc816df532c"
|
|
57
57
|
}
|