Skip to content

Commit

Permalink
chore: version packages (#2478)
Browse files Browse the repository at this point in the history
Co-authored-by: eikeland <[email protected]>
  • Loading branch information
github-actions[bot] and eikeland authored Feb 24, 2025
1 parent eba9cf6 commit f995423
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 63 deletions.
61 changes: 0 additions & 61 deletions .changeset/academy-unrest-linear.md

This file was deleted.

63 changes: 63 additions & 0 deletions packages/stepper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,68 @@
# Change Log

## 2.0.0

### Major Changes

- eba9cf6: Changed implementation of the Stepper component from being uncontrolled to having a both an uncontrolled and controlled mode.

- Required 'activeStepKey' prop removed. Replaced with 'initialStepKey' and 'stepKey' (both optional)
- If 'stepKey' is set, then the component becomes controlled by that prop.
- If 'stepKey' is set and 'initialStepKey' is set, then the initial step will be that prop, but otherwise be uncontrolled.
- If none of these props are set then it will be uncontrolled, and default to the first step of the steps provided as the initial step.
- Updated 'Stepper' README and Storybook with examples of usage.

This is a breaking change since the 'activeStepKey' was required, and now needs to be either removed or replaced with one of the two new optional props.

## Migration guide:

### Uncontrolled usage:

```tsx
import { Stepper } from '@equinor/fusion-react-stepper';

/** initialStepKey here is optional. If not set it defaults to the first step ('step1') */
<Stepper initialStepKey="step1" onChange={(e, k) => console.log('active: ', e, ' keys: ', k)} props>
<Step title="Title 1" stepKey="step1" props>
Step content 1
</Step>
<Step title="Title 2" stepKey="step2" props>
Step content 2
</Step>
<Step title="Title 3" stepKey="step3" props>
Step content 3
</Step>
</Stepper>;
```

### Controlled usage:

```tsx
import { Stepper } from '@equinor/fusion-react-stepper';

const [activeStep, setActiveStep] = useState<string>('step1');
const onChangeStep = (stepKey: string, allSteps: StepKey[]) => {
console.log('active: ', stepKey, ' keys: ', allSteps);
if (activeStep !== stepKey) {
setActiveStep(String(stepKey));
}
};

return (
<Stepper stepKey={activeStep} onChange={onChangeStep} props>
<Step title="Title 1" stepKey="step1" props>
Step content 1
</Step>
<Step title="Title 2" stepKey="step2" props>
Step content 2
</Step>
<Step title="Title 3" stepKey="step3" props>
Step content 3
</Step>
</Stepper>
);
```

## 1.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/stepper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/fusion-react-stepper",
"version": "1.0.1",
"version": "2.0.0",
"description": "Component for displaying and using stepps in stepper",
"keywords": [
"stepper",
Expand Down
66 changes: 66 additions & 0 deletions storybook/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,71 @@
# Change Log

## 4.1.13

### Patch Changes

- eba9cf6: Changed implementation of the Stepper component from being uncontrolled to having a both an uncontrolled and controlled mode.

- Required 'activeStepKey' prop removed. Replaced with 'initialStepKey' and 'stepKey' (both optional)
- If 'stepKey' is set, then the component becomes controlled by that prop.
- If 'stepKey' is set and 'initialStepKey' is set, then the initial step will be that prop, but otherwise be uncontrolled.
- If none of these props are set then it will be uncontrolled, and default to the first step of the steps provided as the initial step.
- Updated 'Stepper' README and Storybook with examples of usage.

This is a breaking change since the 'activeStepKey' was required, and now needs to be either removed or replaced with one of the two new optional props.

## Migration guide:

### Uncontrolled usage:

```tsx
import { Stepper } from '@equinor/fusion-react-stepper';

/** initialStepKey here is optional. If not set it defaults to the first step ('step1') */
<Stepper initialStepKey="step1" onChange={(e, k) => console.log('active: ', e, ' keys: ', k)} props>
<Step title="Title 1" stepKey="step1" props>
Step content 1
</Step>
<Step title="Title 2" stepKey="step2" props>
Step content 2
</Step>
<Step title="Title 3" stepKey="step3" props>
Step content 3
</Step>
</Stepper>;
```

### Controlled usage:

```tsx
import { Stepper } from '@equinor/fusion-react-stepper';

const [activeStep, setActiveStep] = useState<string>('step1');
const onChangeStep = (stepKey: string, allSteps: StepKey[]) => {
console.log('active: ', stepKey, ' keys: ', allSteps);
if (activeStep !== stepKey) {
setActiveStep(String(stepKey));
}
};

return (
<Stepper stepKey={activeStep} onChange={onChangeStep} props>
<Step title="Title 1" stepKey="step1" props>
Step content 1
</Step>
<Step title="Title 2" stepKey="step2" props>
Step content 2
</Step>
<Step title="Title 3" stepKey="step3" props>
Step content 3
</Step>
</Stepper>
);
```

- Updated dependencies [eba9cf6]
- @equinor/fusion-react-stepper@2.0.0

## 4.1.12

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/fusion-react-components-stories",
"version": "4.1.12",
"version": "4.1.13",
"description": "",
"private": true,
"scripts": {
Expand Down

0 comments on commit f995423

Please sign in to comment.