@toptal/picasso-step 1.1.7 → 1.1.8
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../src/Stepper/Stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC3D,OAAO,
|
|
1
|
+
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../src/Stepper/Stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC3D,OAAO,KAA+B,MAAM,OAAO,CAAA;AAGnD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAKvE,MAAM,WAAW,gBACf,SAAQ,SAAS,EACf,cAAc,EACd,cAAc,CAAC,cAAc,CAAC;IAChC,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,+BAA+B;IAC/B,KAAK,EAAE,MAAM,EAAE,GAAG;QAAE,GAAG,EAAE,GAAG,CAAC;QAAC,OAAO,EAAE,SAAS,CAAA;KAAE,EAAE,CAAA;IACpD,gMAAgM;IAChM,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,MAAM,WAAW,KAAM,SAAQ,gBAAgB;IAC7C,sCAAsC;IACtC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,UAAU,GAAG,YAAY,CAAA;CACtC;AAED,QAAA,MAAM,OAAO,8EAiDX,CAAA;AAYF,eAAe,OAAO,CAAA"}
|
|
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import React, { forwardRef } from 'react';
|
|
12
|
+
import React, { forwardRef, Fragment } from 'react';
|
|
13
13
|
import cx from 'classnames';
|
|
14
14
|
import { twMerge } from 'tailwind-merge';
|
|
15
15
|
import { Step } from '../Step';
|
|
@@ -21,8 +21,8 @@ const Stepper = forwardRef((props, ref) => {
|
|
|
21
21
|
'flex-col': direction === 'vertical',
|
|
22
22
|
}), className), style: style, ref: ref }, rest), steps.map((step, stepIndex) => {
|
|
23
23
|
const isStringStep = typeof step === 'string';
|
|
24
|
-
return (React.createElement(
|
|
25
|
-
React.createElement(Step, {
|
|
24
|
+
return (React.createElement(Fragment, { key: isStringStep ? step : step.key },
|
|
25
|
+
React.createElement(Step, { active: stepIndex === active, completed: stepIndex < active, expand: !hideLabels || stepIndex === active, titleCase: titleCase, withOverflowEllipsis: overflowEllipsis }, isStringStep ? step : step.content),
|
|
26
26
|
stepIndex < steps.length - 1 && (React.createElement(StepConnector, { direction: direction }))));
|
|
27
27
|
})));
|
|
28
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.js","sourceRoot":"","sources":["../../../src/Stepper/Stepper.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Stepper.js","sourceRoot":"","sources":["../../../src/Stepper/Stepper.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAGxC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAoBhD,MAAM,OAAO,GAAG,UAAU,CAAwB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC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K;IACjB,SAAS,EAAE,YAAY;IACvB,gBAAgB,EAAE,KAAK;IACvB,KAAK,EAAE,EAAE;CACV,CAAA;AAED,OAAO,CAAC,WAAW,GAAG,SAAS,CAAA;AAE/B,eAAe,OAAO,CAAA"}
|
package/package.json
CHANGED
package/src/Stepper/Stepper.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HTMLAttributes, Key, ReactNode } from 'react'
|
|
2
|
-
import React, { forwardRef } from 'react'
|
|
2
|
+
import React, { forwardRef, Fragment } from 'react'
|
|
3
3
|
import cx from 'classnames'
|
|
4
4
|
import { twMerge } from 'tailwind-merge'
|
|
5
5
|
import type { BaseProps, TextLabelProps } from '@toptal/picasso-shared'
|
|
@@ -56,9 +56,8 @@ const Stepper = forwardRef<HTMLDivElement, Props>((props, ref) => {
|
|
|
56
56
|
const isStringStep = typeof step === 'string'
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
|
-
|
|
59
|
+
<Fragment key={isStringStep ? step : step.key}>
|
|
60
60
|
<Step
|
|
61
|
-
key={isStringStep ? step : step.key}
|
|
62
61
|
active={stepIndex === active}
|
|
63
62
|
completed={stepIndex < active}
|
|
64
63
|
expand={!hideLabels || stepIndex === active}
|
|
@@ -70,7 +69,7 @@ const Stepper = forwardRef<HTMLDivElement, Props>((props, ref) => {
|
|
|
70
69
|
{stepIndex < steps.length - 1 && (
|
|
71
70
|
<StepConnector direction={direction} />
|
|
72
71
|
)}
|
|
73
|
-
|
|
72
|
+
</Fragment>
|
|
74
73
|
)
|
|
75
74
|
})}
|
|
76
75
|
</div>
|