Skip to content

Commit 31ae5b5

Browse files
neotobmanni497
andauthored
upgrade packages #TECH-409 (#141)
Co-authored-by: Gianmarco Manni <gianmarco.manni@collana.com>
1 parent 7ed6964 commit 31ae5b5

65 files changed

Lines changed: 5689 additions & 13074 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ jobs:
7373
runs-on: ubuntu-latest
7474
strategy:
7575
matrix:
76-
node-version: [20.x, 22.x]
76+
node-version: [20.x, 22.x, 24.x]
77+
react-version: [^18.2.0, ^19.0.0]
7778
steps:
7879
- uses: actions/checkout@v4
7980

@@ -84,6 +85,7 @@ jobs:
8485
cache: "yarn"
8586

8687
- run: yarn --frozen-lockfile
88+
- run: yarn add react@${{ matrix.react-version }} react-dom@${{ matrix.react-version }} --dev
8789
- run: yarn lint
8890
- run: yarn build
8991
- run: yarn prettier-check

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ storybook-static
3030
terraform
3131

3232
.npmrc
33+
*storybook.log
3334

3435
# Ignore vs folder
35-
.vs
36+
.vs

.storybook/main.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

.storybook/main.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import type { StorybookConfig } from "@storybook/react-webpack5";
2+
import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin";
3+
4+
const config: StorybookConfig = {
5+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
6+
addons: ["@storybook/addon-webpack5-compiler-swc", "@storybook/addon-docs"],
7+
framework: {
8+
name: "@storybook/react-webpack5",
9+
options: {},
10+
},
11+
webpackFinal: (config) => {
12+
if (config && config.resolve) {
13+
config.resolve.plugins = [
14+
...(config.resolve.plugins || []),
15+
new TsconfigPathsPlugin({
16+
extensions: config.resolve.extensions,
17+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
18+
}) as any,
19+
];
20+
}
21+
return config;
22+
},
23+
};
24+
export default config;

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- updated most dependencies to newest possible version
13+
1014
## [3.17.0] - 2026-02-09
1115

1216
### Fixed
@@ -44,7 +48,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4448

4549
- `TelephoneNumberInput` countries order, in order to be alphabetically sorted.
4650
- Required field label on `FormGroupLayoutLabel`, `ColorPicker`, `TelephoneNumberInput`, `TypeaheadTextField` (hence `StaticTypeaheadInput` and `AsyncTypeaheadInput`) in order to display \* also on nested and array fields.
47-
4851
1. `requiredFields` can still accept a `FieldPath<T>[]`
4952
2. In order to be complaint with `FieldPath` react-hook-form type (`object.${number}.property`) array properties provide a wildcard:
5053

@@ -250,7 +253,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
250253

251254
- :boom: `AsyncTypeAheadInput` based on MUI Autocomplete component.
252255
- :boom: renamed `AsyncTypeaheadProps` to `AsyncTypeaheadInputProps`.
253-
254256
1. The component is by default **form** controlled. However, updating values using form methods could lead to an unexpected behavior because MUI library requires consistency between options and value. In order to manually to control the input, a ref is exposed which allows to mutually modify input value and form value.
255257
2. `inputRef` is exposed to clear, reset or set new selected options, as mentioned in point 1.
256258
3. `defaultSelected` options is still needed as in previous version.
@@ -260,7 +262,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
260262
7. `onInputChange` exposes the reason why the input-text changes. Check whether reason is `input` for checking only the typing event.
261263

262264
- :boom: `StaticTypeAheadInput` based on MUI Autocomplete component.
263-
264265
1. The component is fully **form** controlled.
265266
2. In order to control input value, use form methods being sure to be consistent between the set value and available options. Therefore, any input ref is exposed anymore.
266267
3. No need to specify a `defaultSelected` option according to point 1. The input automatically select options based on form value.

cypress/cypress/component/AutoSubmit/AutoSumbit.cy.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { yupResolver } from "@hookform/resolvers/yup";
33
import { Form, Input } from "react-hook-form-components";
44
import * as yup from "yup";
55
import { generateOptions } from "../../helpers/typeahead";
6+
import { mount } from "cypress/react";
67

78
it("radio button multiple autosave works", () => {
89
const name1 = faker.random.alpha(10);
@@ -17,7 +18,7 @@ it("radio button multiple autosave works", () => {
1718
const { objectOptions: options1 } = generateOptions(faker.datatype.number({ min: 1, max: 10 }));
1819
const { objectOptions: options2 } = generateOptions(faker.datatype.number({ min: 1, max: 10 }));
1920

20-
cy.mount(
21+
mount(
2122
<>
2223
<Form onSubmit={cy.spy().as("onSubmitSpy1")} resolver={yupResolver(schema1)} autoSubmitConfig={{ wait: 500 }}>
2324
<Input type="radio" label="hello" name={name1} helpText="help" options={options1} />
@@ -59,7 +60,7 @@ it("radio button autosave only once", () => {
5960

6061
const { objectOptions: options } = generateOptions(faker.datatype.number({ min: 1, max: 10 }));
6162

62-
cy.mount(
63+
mount(
6364
<Form onSubmit={cy.spy().as("onSubmitSpy")} resolver={yupResolver(schema)} autoSubmitConfig={{ wait: 500 }}>
6465
<Input type="radio" label="hello" name={name} helpText="help" options={options} />
6566
</Form>,
@@ -83,7 +84,7 @@ it("text input autosave only once", () => {
8384

8485
const randomText = faker.random.alphaNumeric(10);
8586

86-
cy.mount(
87+
mount(
8788
<Form onSubmit={cy.spy().as("onSubmitSpy")} resolver={yupResolver(schema)} autoSubmitConfig={{ wait: 500 }}>
8889
<Input type="text" label={name} name={name} />
8990
</Form>,

cypress/cypress/component/ClassName/ClassName.cy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Form, Input, DatePickerInput, AsyncTypeaheadInput, StaticTypeaheadInput, FormattedInput } from "react-hook-form-components";
22
import { faker } from "@faker-js/faker";
33
import { fetchMock, generateOptions } from "../../helpers/typeahead";
4-
import { mount } from "cypress/react18";
4+
import { mount } from "cypress/react";
55

66
it("input has correct classname", () => {
77
const name = faker.random.alpha(10);

cypress/cypress/component/ColorPicker/ColorPicker.cy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Form, ColorPickerInput } from "react-hook-form-components";
22
import { faker } from "@faker-js/faker";
3-
import { mount } from "cypress/react18";
3+
import { mount } from "cypress/react";
44

55
it("select correct color by specific format", () => {
66
const hexName = faker.random.alpha(10);

cypress/cypress/component/Datepicker/DatePickerInput.cy.tsx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/* eslint-disable max-lines */
21
import { DatePickerInput, Form, getUtcTimeZeroDate } from "react-hook-form-components";
3-
import "react-datepicker/dist/react-datepicker.css";
2+
import "react-hook-form-components/styles.css";
43
import { faker } from "@faker-js/faker";
54
import * as yup from "yup";
65
import { yupResolver } from "@hookform/resolvers/yup";
7-
import { faCalendar } from "@fortawesome/free-solid-svg-icons";
6+
import { faCalendar, faClock } from "@fortawesome/free-solid-svg-icons";
87
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
9-
import { Button, InputGroupText } from "reactstrap";
8+
import { Button, InputGroupText } from "@neolution-ch/reactstrap";
9+
import { mount } from "cypress/react";
1010

1111
import { SinonSpy } from "cypress/types/sinon";
1212
import { useRef, useEffect, FC } from "react";
@@ -19,7 +19,7 @@ it("selecting today works", () => {
1919
[name]: yup.date().required(),
2020
});
2121

22-
cy.mount(
22+
mount(
2323
<Form onSubmit={cy.spy().as("onSubmitSpy")} resolver={yupResolver(schema)}>
2424
<DatePickerInput name={name} label={name} />
2525

@@ -51,7 +51,7 @@ it("setting intial value as iso string works", () => {
5151
console.log(JSON.stringify(values));
5252
};
5353

54-
cy.mount(
54+
mount(
5555
<Form
5656
onSubmit={cy.spy(x).as("onSubmitSpy")}
5757
resolver={yupResolver(schema)}
@@ -80,7 +80,7 @@ it("setting intial value as date object works", () => {
8080
[name]: yup.date().required(),
8181
});
8282

83-
cy.mount(
83+
mount(
8484
<Form
8585
onSubmit={cy.spy().as("onSubmitSpy")}
8686
resolver={yupResolver(schema)}
@@ -104,7 +104,7 @@ it("setting intial value as date object works", () => {
104104
it("is disabled", () => {
105105
const name = faker.random.word();
106106

107-
cy.mount(
107+
mount(
108108
<Form
109109
onSubmit={() => {
110110
// Do nothing
@@ -123,7 +123,7 @@ it("contains calendar icon if provided in DateInput", () => {
123123
[name]: yup.date(),
124124
});
125125

126-
cy.mount(
126+
mount(
127127
<Form
128128
onSubmit={() => {
129129
// Nothing to do
@@ -133,21 +133,22 @@ it("contains calendar icon if provided in DateInput", () => {
133133
<DatePickerInput
134134
name={name}
135135
label={name}
136-
addonLeft={
136+
addonRight={
137137
<InputGroupText>
138138
<FontAwesomeIcon icon={faCalendar} />
139139
</InputGroupText>
140140
}
141-
addonRight={
141+
addonLeft={
142142
<InputGroupText>
143-
<FontAwesomeIcon icon={faCalendar} />
143+
<FontAwesomeIcon icon={faClock} />
144144
</InputGroupText>
145145
}
146146
/>
147147
</Form>,
148148
);
149149

150150
cy.get(`label[for=${name}]`).parent().find("svg[data-icon=calendar]");
151+
cy.get(`label[for=${name}]`).parent().find("svg[data-icon=clock]");
151152
});
152153

153154
it("not contains calendar icon if not provided in DateInput", () => {
@@ -156,7 +157,7 @@ it("not contains calendar icon if not provided in DateInput", () => {
156157
[name]: yup.date(),
157158
});
158159

159-
cy.mount(
160+
mount(
160161
<Form
161162
onSubmit={() => {
162163
// Nothing to do
@@ -186,7 +187,7 @@ it("passing an IANA timezone works", () => {
186187
const fixedDate = new Date(isoInputDate);
187188
const inputJsonString = JSON.stringify(fixedDate);
188189

189-
cy.mount(
190+
mount(
190191
<Form<FormFields>
191192
defaultValues={{
192193
[name]: fixedDate,
@@ -225,7 +226,7 @@ it("passing the ref works", () => {
225226
});
226227

227228
const DatePickerWithRef: FC = () => {
228-
const ref = useRef<ReactDatePickers<never, undefined>>(null);
229+
const ref = useRef<ReactDatePickers>(null);
229230

230231
useEffect(() => {
231232
if (ref && ref.current) {
@@ -248,7 +249,7 @@ it("passing the ref works", () => {
248249
);
249250
};
250251

251-
cy.mount(<DatePickerWithRef />);
252+
mount(<DatePickerWithRef />);
252253

253254
cy.get(".react-datepicker-popper").should("be.visible");
254255
});
@@ -259,7 +260,7 @@ it("addon works as a function (with onClick)", () => {
259260
[name]: yup.date(),
260261
});
261262

262-
cy.mount(
263+
mount(
263264
<Form
264265
onSubmit={() => {
265266
// Nothing to do

cypress/cypress/component/Disabled/Disabled.cy.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
StaticTypeaheadInput,
99
useFormContext,
1010
} from "react-hook-form-components";
11-
import { Input as ReactstrapInput, Label } from "reactstrap";
12-
import { mount } from "cypress/react18";
11+
import { Input as ReactstrapInput, Label } from "@neolution-ch/reactstrap";
12+
import { mount } from "cypress/react";
1313

1414
it("disable all fields when readonly attribute is set", () => {
1515
const inputName = faker.random.alpha(10);

0 commit comments

Comments
 (0)