@synerise/ds-wizard 0.4.0 → 0.5.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 +19 -0
- package/README.md +15 -0
- package/dist/Wizard.d.ts +1 -1
- package/dist/Wizard.js +15 -8
- package/dist/Wizard.types.d.ts +13 -7
- package/dist/onModal/onModal.d.ts +2 -2
- package/dist/onModal/onModal.js +13 -8
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.5.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-wizard@0.5.0...@synerise/ds-wizard@0.5.1) (2023-08-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-wizard
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.5.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-wizard@0.4.0...@synerise/ds-wizard@0.5.0) (2023-08-22)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **wizard:** adds prop to customise wizard step button props ([346551d](https://github.com/Synerise/synerise-design/commit/346551d00ef56ad832468ba34cd98f16681fa4d4))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [0.4.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-wizard@0.3.72...@synerise/ds-wizard@0.4.0) (2023-08-20)
|
|
7
26
|
|
|
8
27
|
|
package/README.md
CHANGED
|
@@ -33,6 +33,15 @@ import Wizard from '@synerise/ds-wizard'
|
|
|
33
33
|
...
|
|
34
34
|
</Stepper>
|
|
35
35
|
}
|
|
36
|
+
stepButtonProps={{
|
|
37
|
+
prevButtonProps: {
|
|
38
|
+
type: 'primary'
|
|
39
|
+
},
|
|
40
|
+
nextButtonProps: {
|
|
41
|
+
type: 'primary',
|
|
42
|
+
disabled: true
|
|
43
|
+
}
|
|
44
|
+
}}
|
|
36
45
|
footer={
|
|
37
46
|
<>
|
|
38
47
|
<Button mode="icon-label" type="ghost" onClick={() => {}}>
|
|
@@ -63,6 +72,7 @@ import Wizard from '@synerise/ds-wizard'
|
|
|
63
72
|
| contentWidth | Width of content ex: `500px` | string | `100%` |
|
|
64
73
|
| onPrevStep | Function called when user clicks on prev step button | () => void | - |
|
|
65
74
|
| onNextStep | Function called when user clicks on next step button | () => void | - |
|
|
75
|
+
| stepButtonProps| Custom props for prev/next buttons | WizardStepButtons | - |
|
|
66
76
|
| texts | Translations object for wizard | WizardTexts | - |
|
|
67
77
|
|
|
68
78
|
### WizardTexts
|
|
@@ -71,3 +81,8 @@ import Wizard from '@synerise/ds-wizard'
|
|
|
71
81
|
| prevButtonLabel | Label of prev button | React.ReactNode \ String | - |
|
|
72
82
|
| nextButtonLabel | Label of next button | React.ReactNode \ String | - |
|
|
73
83
|
|
|
84
|
+
### WizardStepButtons
|
|
85
|
+
| Property | Description | Type | Default |
|
|
86
|
+
| --- | --- | --- | --- |
|
|
87
|
+
| prevButtonProps | Props of prev button | Partial<Omit<ButtonProps, 'onClick'>> | - |
|
|
88
|
+
| nextButtonLabel | Props of next button | Partial<Omit<ButtonProps, 'onClick'>> | - |
|
package/dist/Wizard.d.ts
CHANGED
package/dist/Wizard.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
2
4
|
import Layout from '@synerise/ds-layout';
|
|
3
5
|
import PageHeader from '@synerise/ds-page-header/dist/PageHeader';
|
|
4
6
|
import Button from '@synerise/ds-button';
|
|
@@ -18,9 +20,17 @@ var Wizard = function Wizard(_ref) {
|
|
|
18
20
|
children = _ref.children,
|
|
19
21
|
onPrevStep = _ref.onPrevStep,
|
|
20
22
|
onNextStep = _ref.onNextStep,
|
|
23
|
+
stepButtonProps = _ref.stepButtonProps,
|
|
21
24
|
texts = _ref.texts,
|
|
22
25
|
visible = _ref.visible;
|
|
23
26
|
var intl = useIntl();
|
|
27
|
+
var prevButtonProps = stepButtonProps != null && stepButtonProps.prevButtonProps ? stepButtonProps.prevButtonProps : {
|
|
28
|
+
type: 'ghost',
|
|
29
|
+
mode: 'icon-label'
|
|
30
|
+
};
|
|
31
|
+
var nextButtonProps = stepButtonProps != null && stepButtonProps.nextButtonProps ? stepButtonProps.nextButtonProps : {
|
|
32
|
+
type: 'primary'
|
|
33
|
+
};
|
|
24
34
|
return visible ? /*#__PURE__*/React.createElement(S.WizardWrapper, {
|
|
25
35
|
className: "ds-wizard"
|
|
26
36
|
}, /*#__PURE__*/React.createElement(Layout, {
|
|
@@ -36,19 +46,16 @@ var Wizard = function Wizard(_ref) {
|
|
|
36
46
|
withFooter: Boolean(footer)
|
|
37
47
|
}, /*#__PURE__*/React.createElement(S.WizardContent, {
|
|
38
48
|
contentWidth: contentWidth
|
|
39
|
-
}, children, /*#__PURE__*/React.createElement(S.WizardButtons, null, onPrevStep ? /*#__PURE__*/React.createElement(Button, {
|
|
40
|
-
mode: "icon-label",
|
|
41
|
-
type: "ghost",
|
|
49
|
+
}, children, /*#__PURE__*/React.createElement(S.WizardButtons, null, onPrevStep ? /*#__PURE__*/React.createElement(Button, _extends({}, prevButtonProps, {
|
|
42
50
|
onClick: onPrevStep
|
|
43
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
51
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
44
52
|
component: /*#__PURE__*/React.createElement(ArrowLeftCircleM, null)
|
|
45
53
|
}), ' ', (texts == null ? void 0 : texts.prevButtonLabel) || intl.formatMessage({
|
|
46
54
|
id: 'DS.WIZARD.PREV-BUTTON',
|
|
47
55
|
defaultMessage: 'Back'
|
|
48
|
-
})) : /*#__PURE__*/React.createElement(S.ButtonPlaceholder, null), onNextStep && /*#__PURE__*/React.createElement(Button, {
|
|
49
|
-
type: "primary",
|
|
56
|
+
})) : /*#__PURE__*/React.createElement(S.ButtonPlaceholder, null), onNextStep && /*#__PURE__*/React.createElement(Button, _extends({}, nextButtonProps, {
|
|
50
57
|
onClick: onNextStep
|
|
51
|
-
}, (texts == null ? void 0 : texts.nextButtonLabel) || intl.formatMessage({
|
|
58
|
+
}), (texts == null ? void 0 : texts.nextButtonLabel) || intl.formatMessage({
|
|
52
59
|
id: 'DS.WIZARD.NEXT-BUTTON',
|
|
53
60
|
defaultMessage: 'Next step'
|
|
54
61
|
}))))), footer && /*#__PURE__*/React.createElement(S.WizardFooter, null, footer))) : null;
|
package/dist/Wizard.types.d.ts
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from '@synerise/ds-button';
|
|
2
3
|
import WizardOnModal from './onModal/onModal';
|
|
3
4
|
export declare type WizardProps = {
|
|
4
|
-
stepper?:
|
|
5
|
-
footer?:
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
stepper?: ReactNode;
|
|
6
|
+
footer?: ReactNode;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
title: ReactNode | string;
|
|
9
|
+
headerAction?: ReactNode;
|
|
8
10
|
onClose: () => void;
|
|
9
11
|
visible: boolean;
|
|
10
12
|
contentWidth?: string;
|
|
11
13
|
onPrevStep?: () => void;
|
|
12
14
|
onNextStep?: () => void;
|
|
13
15
|
texts?: {
|
|
14
|
-
prevButtonLabel: string |
|
|
15
|
-
nextButtonLabel: string |
|
|
16
|
+
prevButtonLabel: string | ReactNode;
|
|
17
|
+
nextButtonLabel: string | ReactNode;
|
|
18
|
+
};
|
|
19
|
+
stepButtonProps?: {
|
|
20
|
+
prevButtonProps?: Partial<Omit<ButtonProps, 'onClick'>>;
|
|
21
|
+
nextButtonProps?: Partial<Omit<ButtonProps, 'onClick'>>;
|
|
16
22
|
};
|
|
17
23
|
};
|
|
18
24
|
export declare type WizardSubComponent = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { OnModalProps } from './onModal.types';
|
|
3
|
-
declare const WizardOnModal:
|
|
3
|
+
declare const WizardOnModal: ({ visible, stepper, headerAction, title, onClose, children, onPrevStep, onNextStep, texts, modalProps, stepButtonProps, }: OnModalProps) => JSX.Element;
|
|
4
4
|
export default WizardOnModal;
|
package/dist/onModal/onModal.js
CHANGED
|
@@ -17,27 +17,32 @@ var WizardOnModal = function WizardOnModal(_ref) {
|
|
|
17
17
|
onPrevStep = _ref.onPrevStep,
|
|
18
18
|
onNextStep = _ref.onNextStep,
|
|
19
19
|
texts = _ref.texts,
|
|
20
|
-
modalProps = _ref.modalProps
|
|
20
|
+
modalProps = _ref.modalProps,
|
|
21
|
+
stepButtonProps = _ref.stepButtonProps;
|
|
21
22
|
var intl = useIntl();
|
|
23
|
+
var prevButtonProps = stepButtonProps != null && stepButtonProps.prevButtonProps ? stepButtonProps.prevButtonProps : {
|
|
24
|
+
type: 'ghost',
|
|
25
|
+
mode: 'icon-label'
|
|
26
|
+
};
|
|
27
|
+
var nextButtonProps = stepButtonProps != null && stepButtonProps.nextButtonProps ? stepButtonProps.nextButtonProps : {
|
|
28
|
+
type: 'primary'
|
|
29
|
+
};
|
|
22
30
|
return /*#__PURE__*/React.createElement(Modal, _extends({
|
|
23
31
|
visible: visible,
|
|
24
32
|
onCancel: onClose,
|
|
25
33
|
title: title
|
|
26
34
|
}, modalProps, {
|
|
27
35
|
headerActions: /*#__PURE__*/React.createElement(S.HeaderActions, null, stepper, " ", headerAction),
|
|
28
|
-
footer: /*#__PURE__*/React.createElement(S.ModalWizardButtons, null, onPrevStep ? /*#__PURE__*/React.createElement(Button, {
|
|
29
|
-
mode: "icon-label",
|
|
30
|
-
type: "ghost",
|
|
36
|
+
footer: /*#__PURE__*/React.createElement(S.ModalWizardButtons, null, onPrevStep ? /*#__PURE__*/React.createElement(Button, _extends({}, prevButtonProps, {
|
|
31
37
|
onClick: onPrevStep
|
|
32
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
38
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
33
39
|
component: /*#__PURE__*/React.createElement(ArrowLeftCircleM, null)
|
|
34
40
|
}), ' ', (texts == null ? void 0 : texts.prevButtonLabel) || intl.formatMessage({
|
|
35
41
|
id: 'DS.WIZARD.PREV-BUTTON',
|
|
36
42
|
defaultMessage: 'Back'
|
|
37
|
-
})) : /*#__PURE__*/React.createElement(S.ButtonPlaceholder, null), onNextStep && /*#__PURE__*/React.createElement(Button, {
|
|
38
|
-
type: "primary",
|
|
43
|
+
})) : /*#__PURE__*/React.createElement(S.ButtonPlaceholder, null), onNextStep && /*#__PURE__*/React.createElement(Button, _extends({}, nextButtonProps, {
|
|
39
44
|
onClick: onNextStep
|
|
40
|
-
}, (texts == null ? void 0 : texts.nextButtonLabel) || intl.formatMessage({
|
|
45
|
+
}), (texts == null ? void 0 : texts.nextButtonLabel) || intl.formatMessage({
|
|
41
46
|
id: 'DS.WIZARD.NEXT-BUTTON',
|
|
42
47
|
defaultMessage: 'Next step'
|
|
43
48
|
})))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-wizard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Wizard UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@synerise/ds-button": "^0.18.0",
|
|
36
36
|
"@synerise/ds-icon": "^0.58.0",
|
|
37
|
-
"@synerise/ds-layout": "^0.13.
|
|
38
|
-
"@synerise/ds-modal": "^0.17.
|
|
39
|
-
"@synerise/ds-page-header": "^0.14.
|
|
37
|
+
"@synerise/ds-layout": "^0.13.29",
|
|
38
|
+
"@synerise/ds-modal": "^0.17.2",
|
|
39
|
+
"@synerise/ds-page-header": "^0.14.73"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@synerise/ds-core": "*",
|
|
43
43
|
"react": ">=16.9.0 < 17.0.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "9d424b025fe368bbf3beccea2102f000f4d7e82c"
|
|
46
46
|
}
|