@synerise/ds-stepper 0.3.31 → 0.3.33
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/dist/Step/Step.d.ts +2 -2
- package/dist/Step/Step.js +8 -8
- package/dist/Step/Step.styles.js +2 -2
- package/dist/Step/Step.types.d.ts +4 -3
- package/dist/Stepper.types.d.ts +1 -1
- package/package.json +4 -4
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.3.33](https://github.com/Synerise/synerise-design/compare/@synerise/ds-stepper@0.3.32...@synerise/ds-stepper@0.3.33) (2023-08-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **stepper:** fixed warning step styles ([8dd3b0a](https://github.com/Synerise/synerise-design/commit/8dd3b0a8af0a343c9c5c6d796479809af1c8b2fd))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.3.32](https://github.com/Synerise/synerise-design/compare/@synerise/ds-stepper@0.3.31...@synerise/ds-stepper@0.3.32) (2023-08-22)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-stepper
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.3.31](https://github.com/Synerise/synerise-design/compare/@synerise/ds-stepper@0.3.30...@synerise/ds-stepper@0.3.31) (2023-08-20)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-stepper
|
package/dist/Step/Step.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { StepProps } from './Step.types';
|
|
3
|
-
declare const Step:
|
|
3
|
+
declare const Step: ({ stepNumber, label, active, done, warning, validated, tooltip, onClick, children, size, orientation, }: StepProps) => JSX.Element;
|
|
4
4
|
export default Step;
|
package/dist/Step/Step.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useState, useCallback, useEffect } from 'react';
|
|
2
|
+
import AnimateHeight from 'react-animate-height';
|
|
2
3
|
import Icon, { CheckS, WarningFillS } from '@synerise/ds-icon';
|
|
3
4
|
import { theme } from '@synerise/ds-core';
|
|
4
5
|
import Tooltip from '@synerise/ds-tooltip';
|
|
5
|
-
import AnimateHeight from 'react-animate-height';
|
|
6
6
|
import * as S from './Step.styles';
|
|
7
7
|
import { ORIENTATIONS } from '../Stepper.types';
|
|
8
8
|
|
|
@@ -21,14 +21,14 @@ var Step = function Step(_ref) {
|
|
|
21
21
|
_ref$orientation = _ref.orientation,
|
|
22
22
|
orientation = _ref$orientation === void 0 ? ORIENTATIONS.HORIZONTAL : _ref$orientation;
|
|
23
23
|
|
|
24
|
-
var
|
|
25
|
-
wasActive =
|
|
26
|
-
setWasActive =
|
|
24
|
+
var _useState = useState(Boolean(active)),
|
|
25
|
+
wasActive = _useState[0],
|
|
26
|
+
setWasActive = _useState[1];
|
|
27
27
|
|
|
28
|
-
var handleClick =
|
|
28
|
+
var handleClick = useCallback(function () {
|
|
29
29
|
onClick && onClick();
|
|
30
30
|
}, [onClick]);
|
|
31
|
-
|
|
31
|
+
useEffect(function () {
|
|
32
32
|
if (!active && wasActive) {
|
|
33
33
|
setWasActive(false);
|
|
34
34
|
}
|
|
@@ -57,7 +57,7 @@ var Step = function Step(_ref) {
|
|
|
57
57
|
noMargin: !label
|
|
58
58
|
}, done && !validated ? /*#__PURE__*/React.createElement(Icon, {
|
|
59
59
|
component: /*#__PURE__*/React.createElement(CheckS, null),
|
|
60
|
-
color: theme.palette['green-600']
|
|
60
|
+
color: warning ? theme.palette['yellow-600'] : theme.palette['green-600']
|
|
61
61
|
}) : /*#__PURE__*/React.createElement(S.StepNumber, null, stepNumber))), /*#__PURE__*/React.createElement(S.StepName, {
|
|
62
62
|
"data-label": label
|
|
63
63
|
}, /*#__PURE__*/React.createElement(S.StepLabel, null, label), tooltip && active && /*#__PURE__*/React.createElement(Tooltip, {
|
package/dist/Step/Step.styles.js
CHANGED
|
@@ -63,8 +63,8 @@ export var Step = styled.div.withConfig({
|
|
|
63
63
|
if (props.active) return css(["", "{padding:", " 0 ", " 20px;}"], StepContent, props.hasChildren ? '16px' : '0', props.hasChildren ? '16px' : '0');
|
|
64
64
|
return false;
|
|
65
65
|
}, function (props) {
|
|
66
|
-
if (props.validated) return css(["", "{border-color:", ";}", ",", "{color:", ";font-weight:400;}"], StepPrefix, props.theme.palette['red-600'], StepNumber, StepLabel, props.theme.palette['red-600']);
|
|
67
|
-
if (props.warning) return css(["", "{border-color:", ";}", ",", "{color:", ";font-weight:400;}"], StepPrefix, props.theme.palette['yellow-600'], StepNumber, StepLabel, props.theme.palette['yellow-600']);
|
|
66
|
+
if (props.validated) return css(["", "{border-color:", ";}", "", ",", "", "{color:", ";font-weight:400;}"], StepPrefix, props.theme.palette['red-600'], StepNumber, StepNumber, StepLabel, StepLabel, props.theme.palette['red-600']);
|
|
67
|
+
if (props.warning) return css(["", "{border-color:", ";}", "", ",", "", "{color:", ";font-weight:400;}"], StepPrefix, props.theme.palette['yellow-600'], StepNumber, StepNumber, StepLabel, StepLabel, props.theme.palette['yellow-600']);
|
|
68
68
|
if (props.done) return css(["", "{border-color:", ";}", ",", "{color:", ";font-weight:400;}"], StepPrefix, props.theme.palette['green-600'], StepNumber, StepLabel, props.theme.palette['green-600']);
|
|
69
69
|
if (props.active) return css(["", "{border-color:", ";}", "{color:", ";font-weight:500;}", "{&::before{border-color:", ";color:", ";visibility:visible;}", "{visibility:hidden;}}"], StepPrefix, props.theme.palette['grey-700'], StepNumber, props.theme.palette['grey-700'], StepName, props.theme.palette['grey-700'], props.theme.palette['grey-700'], StepLabel);
|
|
70
70
|
return css(["&:hover{", "{border-color:", ";}", ",", "{color:", ";font-weight:400;}}"], StepPrefix, props.theme.palette['grey-700'], StepNumber, StepLabel, props.theme.palette['grey-700']);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { StepperOrientation, StepperSize } from '../Stepper.types';
|
|
3
3
|
export declare type StepProps = {
|
|
4
|
-
label: string |
|
|
4
|
+
label: string | ReactNode;
|
|
5
5
|
stepNumber: number;
|
|
6
6
|
active?: boolean;
|
|
7
7
|
done?: boolean;
|
|
8
8
|
warning?: boolean;
|
|
9
9
|
validated?: boolean;
|
|
10
|
-
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
tooltip?: string | ReactNode;
|
|
11
12
|
onClick?: () => void;
|
|
12
13
|
size?: StepperSize;
|
|
13
14
|
orientation?: StepperOrientation;
|
package/dist/Stepper.types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Step from 'Step/Step';
|
|
2
1
|
import { CSSProperties } from 'styled-components';
|
|
2
|
+
import Step from './Step/Step';
|
|
3
3
|
export declare type StepperOrientation = 'vertical' | 'horizontal' | string;
|
|
4
4
|
export declare type StepperSize = 'small' | 'default' | string;
|
|
5
5
|
export declare const ORIENTATIONS: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-stepper",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.33",
|
|
4
4
|
"description": "Stepper UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@synerise/ds-icon": "^0.58.0",
|
|
36
|
-
"@synerise/ds-tooltip": "^0.14.
|
|
37
|
-
"@synerise/ds-
|
|
36
|
+
"@synerise/ds-tooltip": "^0.14.2",
|
|
37
|
+
"@synerise/ds-utils": "^0.24.13",
|
|
38
38
|
"react-animate-height": "^2.0.23"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@synerise/ds-core": "*",
|
|
42
42
|
"react": ">=16.9.0 < 17.0.0"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "9d424b025fe368bbf3beccea2102f000f4d7e82c"
|
|
45
45
|
}
|