@synerise/ds-stepper 1.0.12 → 1.0.13

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/README.md CHANGED
@@ -6,6 +6,7 @@ title: Stepper
6
6
  Stepper UI Component
7
7
 
8
8
  ## Installation
9
+
9
10
  ```
10
11
  npm i @synerise/ds-stepper
11
12
  or
@@ -13,6 +14,7 @@ yarn add @synerise/ds-stepper
13
14
  ```
14
15
 
15
16
  ## Usage
17
+
16
18
  ```
17
19
  import Stepper from '@synerise/ds-stepper'
18
20
 
@@ -39,14 +41,14 @@ import Stepper from '@synerise/ds-stepper'
39
41
 
40
42
  ### Stepper
41
43
 
42
- | Property | Description | Type | Default |
43
- | --- | --- | --- | --- |
44
- | orientation | Defines direction of Stepper steps | `horizontal` \ `vertical` | `horizontal` |
44
+ | Property | Description | Type | Default |
45
+ | ----------- | ---------------------------------- | ------------------------- | ------------ |
46
+ | orientation | Defines direction of Stepper steps | `horizontal` \ `vertical` | `horizontal` |
45
47
 
46
48
  ### Stepper.Step
47
49
 
48
50
  | Property | Description | Type | Default |
49
- | --- | --- | --- | --- |
51
+ | ---------- | ----------------------------------------- | ---------------------------- | ------- |
50
52
  | active | Whether current step is active | `boolean` | `false` |
51
53
  | done | Whether step was completed | `boolean` | `false` |
52
54
  | label | Label of step | `string` \ `React.ReactNode` | - |
@@ -57,4 +59,3 @@ import Stepper from '@synerise/ds-stepper'
57
59
  | warning | Whether step has warning status | `boolean` | - |
58
60
 
59
61
  'Acive', 'done', 'validated', 'warning' are properties that determinate what color will have internal wrappers. Please note that it might overwrite some css properties. Properties hierarchy: 'validated' < 'warning' < 'done' < 'active'
60
-
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { StepProps } from './Step.types';
2
+ import { type StepProps } from './Step.types';
3
3
  declare const Step: ({ stepNumber, label, active, done, warning, validated, tooltip, onClick, children, size, orientation, }: StepProps) => React.JSX.Element;
4
4
  export default Step;
package/dist/Step/Step.js CHANGED
@@ -1,10 +1,10 @@
1
- import React, { useState, useCallback, useEffect } from 'react';
1
+ import React, { useCallback, useEffect, useState } from 'react';
2
2
  import AnimateHeight from 'react-animate-height';
3
- import Icon, { CheckS, WarningFillS } from '@synerise/ds-icon';
4
3
  import { theme } from '@synerise/ds-core';
4
+ import Icon, { CheckS, WarningFillS } from '@synerise/ds-icon';
5
5
  import Tooltip from '@synerise/ds-tooltip';
6
- import * as S from './Step.styles';
7
6
  import { ORIENTATIONS } from '../Stepper.types';
7
+ import * as S from './Step.styles';
8
8
  var Step = function Step(_ref) {
9
9
  var stepNumber = _ref.stepNumber,
10
10
  label = _ref.label,
@@ -1,4 +1,4 @@
1
- import { StepperOrientation, StepperSize } from '../Stepper.types';
1
+ import { type StepperOrientation, type StepperSize } from '../Stepper.types';
2
2
  export declare const StepPrefix: import("styled-components").StyledComponent<"div", any, {
3
3
  noMargin: boolean;
4
4
  }, never>;
@@ -54,13 +54,23 @@ export var Step = styled.div.withConfig({
54
54
  if (props.active && props.size === 'small' && props.orientation === ORIENTATIONS.HORIZONTAL) {
55
55
  return css(["", "{margin-right:8px;}", "{max-width:100px;opacity:1;}"], StepPrefix, StepName);
56
56
  }
57
- if (props.active) return css(["", "{padding:", " 0 ", " 20px;}"], StepContent, props.hasChildren ? '16px' : '0', props.hasChildren ? '16px' : '0');
57
+ if (props.active) {
58
+ return css(["", "{padding:", " 0 ", " 20px;}"], StepContent, props.hasChildren ? '16px' : '0', props.hasChildren ? '16px' : '0');
59
+ }
58
60
  return false;
59
61
  }, function (props) {
60
- 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']);
61
- 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']);
62
- if (props.done) return css(["", "{border-color:", ";}", ",", "{color:", ";font-weight:400;}"], StepPrefix, props.theme.palette['green-600'], StepNumber, StepLabel, props.theme.palette['green-600']);
63
- 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);
62
+ if (props.validated) {
63
+ return css(["", "{border-color:", ";}", "", ",", "", "{color:", ";font-weight:400;}"], StepPrefix, props.theme.palette['red-600'], StepNumber, StepNumber, StepLabel, StepLabel, props.theme.palette['red-600']);
64
+ }
65
+ if (props.warning) {
66
+ return css(["", "{border-color:", ";}", "", ",", "", "{color:", ";font-weight:400;}"], StepPrefix, props.theme.palette['yellow-600'], StepNumber, StepNumber, StepLabel, StepLabel, props.theme.palette['yellow-600']);
67
+ }
68
+ if (props.done) {
69
+ return css(["", "{border-color:", ";}", ",", "{color:", ";font-weight:400;}"], StepPrefix, props.theme.palette['green-600'], StepNumber, StepLabel, props.theme.palette['green-600']);
70
+ }
71
+ if (props.active) {
72
+ 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);
73
+ }
64
74
  return props.clickable && css(["&:hover{", "{border-color:", ";}", ",", "{color:", ";font-weight:400;}}"], StepPrefix, props.theme.palette['grey-700'], StepNumber, StepLabel, props.theme.palette['grey-700']);
65
75
  }, StepContent, StepWrapper, function (props) {
66
76
  return props.clickable ? 'pointer' : 'default';
@@ -1,5 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { StepperOrientation, StepperSize } from '../Stepper.types';
1
+ import { type ReactNode } from 'react';
2
+ import { type StepperOrientation, type StepperSize } from '../Stepper.types';
3
3
  export type StepProps = {
4
4
  label: string | ReactNode;
5
5
  stepNumber: number;
package/dist/Stepper.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { StepperProps } from './Stepper.types';
2
+ import { type StepperProps } from './Stepper.types';
3
3
  declare const Stepper: {
4
- ({ orientation, style, children, size }: StepperProps): React.JSX.Element;
4
+ ({ orientation, style, children, size, }: StepperProps): React.JSX.Element;
5
5
  Step: ({ stepNumber, label, active, done, warning, validated, tooltip, onClick, children, size, orientation, }: import("./Step/Step.types").StepProps) => React.JSX.Element;
6
6
  };
7
7
  export default Stepper;
package/dist/Stepper.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import React, { Children, cloneElement, isValidElement } from 'react';
2
+ import Step from './Step/Step';
2
3
  import * as S from './Stepper.styles';
3
4
  import { ORIENTATIONS } from './Stepper.types';
4
- import Step from './Step/Step';
5
5
  var Stepper = function Stepper(_ref) {
6
6
  var _ref$orientation = _ref.orientation,
7
7
  orientation = _ref$orientation === void 0 ? ORIENTATIONS.HORIZONTAL : _ref$orientation,
@@ -17,7 +17,9 @@ var Stepper = function Stepper(_ref) {
17
17
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/isValidElement(Child) ? /*#__PURE__*/cloneElement(Child, {
18
18
  size: size,
19
19
  orientation: orientation
20
- }) : Child, orientation === ORIENTATIONS.HORIZONTAL && index < children.length - 1 && /*#__PURE__*/React.createElement(S.StepDivider, null));
20
+ }) : Child, orientation === ORIENTATIONS.HORIZONTAL &&
21
+ // @ts-expect-error Property 'length' does not exist on type 'number'.
22
+ index < children.length - 1 && /*#__PURE__*/React.createElement(S.StepDivider, null));
21
23
  }));
22
24
  };
23
25
  Stepper.Step = Step;
@@ -1,4 +1,4 @@
1
- import { StepperOrientation } from './Stepper.types';
1
+ import { type StepperOrientation } from './Stepper.types';
2
2
  export declare const StepperWrapper: import("styled-components").StyledComponent<"div", any, {
3
3
  orientation: StepperOrientation;
4
4
  }, never>;
@@ -1,6 +1,6 @@
1
1
  import styled from 'styled-components';
2
- import { ORIENTATIONS } from './Stepper.types';
3
2
  import { Step, StepContent, StepWrapper } from './Step/Step.styles';
3
+ import { ORIENTATIONS } from './Stepper.types';
4
4
  export var StepperWrapper = styled.div.withConfig({
5
5
  displayName: "Stepperstyles__StepperWrapper",
6
6
  componentId: "sc-2yak4n-0"
@@ -1,5 +1,5 @@
1
1
  import type { CSSProperties, ReactNode } from 'react';
2
- import Step from './Step/Step';
2
+ import type Step from './Step/Step';
3
3
  export type StepperOrientation = 'vertical' | 'horizontal' | string;
4
4
  export 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": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Stepper UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,9 +34,9 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-icon": "^1.5.3",
38
- "@synerise/ds-tooltip": "^1.1.11",
39
- "@synerise/ds-utils": "^1.3.0",
37
+ "@synerise/ds-icon": "^1.5.4",
38
+ "@synerise/ds-tooltip": "^1.1.12",
39
+ "@synerise/ds-utils": "^1.3.1",
40
40
  "react-animate-height": "^2.0.23"
41
41
  },
42
42
  "peerDependencies": {
@@ -44,5 +44,5 @@
44
44
  "react": ">=16.9.0 <= 18.3.1",
45
45
  "styled-components": "^5.3.3"
46
46
  },
47
- "gitHead": "11fe1d29b2ac23e70c3d5e6ce8ae20201a619a34"
47
+ "gitHead": "4512641033ba3581a3df208143c547fcfed45895"
48
48
  }