Skip to content

Commit 265dd76

Browse files
authored
Merge pull request #23 from kubit-ui/feat/react-external-dependency
feat(core): update peerdependencies
2 parents ed2d8c5 + 26b1889 commit 265dd76

File tree

63 files changed

+904
-798
lines changed

Some content is hidden

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

63 files changed

+904
-798
lines changed

package.json

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
"access": "public",
147147
"registry": "https://registry.npmjs.org/"
148148
},
149-
"packageManager": "pnpm@10.8.1",
149+
"packageManager": "pnpm@10.30.1",
150150
"engines": {
151151
"node": ">=22.0.0",
152152
"pnpm": ">=10.0.0"
@@ -155,20 +155,24 @@
155155
"type": "corporate",
156156
"url": "https://www.kubit-lab.com/"
157157
},
158+
"peerDependencies": {
159+
"react": "^18.3.0 || ^19.0.0",
160+
"react-dom": "^18.3.0 || ^19.0.0"
161+
},
158162
"devDependencies": {
159163
"@changesets/cli": "^2.29.8",
160164
"@babel/core": "^7.29.0",
161165
"@babel/preset-env": "^7.29.0",
162166
"@babel/preset-react": "^7.28.5",
163167
"@babel/preset-typescript": "^7.28.5",
164168
"@kubit-ui-web/eslint-plugin-no-index-import": "^1.0.2",
165-
"@storybook/addon-a11y": "10.2.5",
169+
"@storybook/addon-a11y": "10.2.10",
166170
"@storybook/addon-coverage": "3.0.0",
167-
"@storybook/addon-designs": "11.1.1",
168-
"@storybook/addon-docs": "10.2.5",
169-
"@storybook/addon-links": "10.2.5",
170-
"@storybook/addon-themes": "10.2.5",
171-
"@storybook/react-vite": "10.2.5",
171+
"@storybook/addon-designs": "11.1.2",
172+
"@storybook/addon-docs": "10.2.10",
173+
"@storybook/addon-links": "10.2.10",
174+
"@storybook/addon-themes": "10.2.10",
175+
"@storybook/react-vite": "10.2.10",
172176
"@storybook/test-runner": "0.24.2",
173177
"@storybook/testing-library": "0.2.2",
174178
"@testing-library/jest-dom": "^6.9.1",
@@ -177,47 +181,47 @@
177181
"@testing-library/user-event": "^14.6.1",
178182
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
179183
"@types/mocha": "^10.0.10",
180-
"@types/react": "^18.3.3",
181-
"@types/react-dom": "^18.3.0",
182-
"@typescript-eslint/eslint-plugin": "^8.54.0",
183-
"@typescript-eslint/parser": "^8.54.0",
184-
"@vitejs/plugin-react": "^5.1.3",
184+
"@types/react": "^19.2.14",
185+
"@types/react-dom": "^19.2.3",
186+
"@typescript-eslint/eslint-plugin": "^8.56.0",
187+
"@typescript-eslint/parser": "^8.56.0",
188+
"@vitejs/plugin-react": "^5.1.4",
185189
"@vitest/coverage-v8": "^4.0.18",
186190
"@vitest/ui": "^4.0.18",
187191
"add": "^2.0.6",
188-
"chromatic": "^15.0.0",
189-
"cpy-cli": "^6.0.0",
190-
"eslint": "^9.39.2",
191-
"eslint-config-kubit": "1.7.0",
192+
"chromatic": "^15.1.1",
193+
"cpy-cli": "^7.0.0",
194+
"eslint": "^10.0.0",
195+
"eslint-config-kubit": "2.0.2",
192196
"eslint-config-prettier": "^10.1.8",
193197
"eslint-config-standard-with-typescript": "^43.0.1",
194198
"eslint-import-resolver-typescript": "^4.4.4",
195199
"eslint-plugin-import": "^2.32.0",
196200
"eslint-plugin-jsx-a11y": "^6.10.2",
197-
"eslint-plugin-n": "^17.23.2",
201+
"eslint-plugin-n": "^17.24.0",
198202
"eslint-plugin-node": "^11.1.0",
199203
"eslint-plugin-prettier": "^5.5.5",
200204
"eslint-plugin-promise": "^7.2.1",
201205
"eslint-plugin-react": "^7.37.5",
202206
"eslint-plugin-react-hooks": "^7.0.1",
203207
"eslint-plugin-react-refresh": "^0.5.0",
204-
"eslint-plugin-storybook": "^10.2.5",
205-
"eslint-plugin-unused-imports": "^4.3.0",
206-
"glob": "^13.0.0",
207-
"html-validate": "^10.7.0",
208-
"jsdom": "^28.0.0",
208+
"eslint-plugin-storybook": "^10.2.10",
209+
"eslint-plugin-unused-imports": "^4.4.1",
210+
"glob": "^13.0.6",
211+
"html-validate": "^10.8.0",
212+
"jsdom": "^28.1.0",
209213
"prettier": "^3.8.1",
210-
"storybook": "10.2.5",
214+
"storybook": "10.2.10",
211215
"typescript": "^5.9.3",
212-
"typescript-eslint": "^8.54.0",
216+
"typescript-eslint": "^8.56.0",
213217
"vite": "8.0.0-beta.10",
214218
"vite-plugin-dts": "^4.5.4",
215219
"vitest": "^4.0.18",
216-
"vitest-axe": "^0.1.0"
220+
"vitest-axe": "^0.1.0",
221+
"react": "^19.2.4",
222+
"react-dom": "^19.2.4"
217223
},
218224
"dependencies": {
219-
"react": "18.3.1",
220-
"react-dom": "18.3.1",
221225
"react-transition-group": "^4.4.5"
222226
}
223227
}

pnpm-lock.yaml

Lines changed: 722 additions & 624 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/charts/barChart/stories/barChart.stories.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const complexArgs = {
4040
};
4141

4242
// Reusable decorator for customization examples
43-
const withCustomizationNote = (Story: React.ComponentType): JSX.Element => {
43+
const withCustomizationNote = (Story: React.ComponentType): React.JSX.Element => {
4444
return (
4545
<>
4646
<Note
@@ -133,7 +133,7 @@ export const BarChartWithErrorHandling: Story = {
133133
orientation: BarOrientation.VERTICAL,
134134
},
135135
decorators: [
136-
(Story: React.ComponentType): JSX.Element => {
136+
(Story: React.ComponentType): React.JSX.Element => {
137137
return (
138138
<>
139139
<Note
@@ -194,7 +194,7 @@ export const WithTooltip: Story = {
194194
orientation: BarOrientation.VERTICAL,
195195
},
196196
decorators: [
197-
(Story: React.ComponentType): JSX.Element => {
197+
(Story: React.ComponentType): React.JSX.Element => {
198198
return (
199199
<>
200200
<Note
@@ -262,7 +262,7 @@ export const WithTooltipHorizontal: Story = {
262262
orientation: BarOrientation.HORIZONTAL,
263263
},
264264
decorators: [
265-
(Story: React.ComponentType): JSX.Element => {
265+
(Story: React.ComponentType): React.JSX.Element => {
266266
return (
267267
<>
268268
<Note

src/charts/barChart/stories/children/Path/path.stories.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const PathCustomization: Story = {
5555
},
5656

5757
decorators: [
58-
(Story: React.ComponentType): JSX.Element => (
58+
(Story: React.ComponentType): React.JSX.Element => (
5959
<>
6060
<Note
6161
collapsible={true}
@@ -94,7 +94,7 @@ export const PathCustomization: Story = {
9494
),
9595
],
9696

97-
render: (args: BarChartPathProps): JSX.Element => (
97+
render: (args: BarChartPathProps): React.JSX.Element => (
9898
<div style={{ height: '400px', width: '600px' }}>
9999
<BarChart
100100
data={COMPARATIVE_DATA}
@@ -172,7 +172,7 @@ export const StackedBars: Story = {
172172
},
173173

174174
decorators: [
175-
(Story: React.ComponentType): JSX.Element => (
175+
(Story: React.ComponentType): React.JSX.Element => (
176176
<>
177177
<Note
178178
collapsible={true}
@@ -217,7 +217,7 @@ export const StackedBars: Story = {
217217
),
218218
],
219219

220-
render: (args: BarChartPathProps): JSX.Element => (
220+
render: (args: BarChartPathProps): React.JSX.Element => (
221221
<div style={{ height: '400px', width: '600px' }}>
222222
<BarChart
223223
data={COMPARATIVE_DATA}

src/charts/barChart/stories/templates/withErrorHandling.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface ErrorInfoState {
2222
hasErrors: boolean;
2323
}
2424

25-
export const BarChartWithErrorHandlingWithHooks = (): JSX.Element => {
25+
export const BarChartWithErrorHandlingWithHooks = (): React.JSX.Element => {
2626
const [errorInfo, setErrorInfo] = useState<ErrorInfoState>({
2727
errors: {},
2828
hasErrors: false,

src/charts/barChart/utils/countBarChildren.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ import { BarChartPath } from '../fragments/barChartPath';
66
export const countBarChildren = (children: BarChartChildrenType): number => {
77
let higherOrder = 0;
88
Children.toArray(children).forEach(child => {
9-
if (isValidElement(child) && child.type === BarChartPath && child.props.order > higherOrder) {
10-
higherOrder = child.props.order;
9+
if (
10+
isValidElement(child) &&
11+
child.type === BarChartPath &&
12+
(child.props as any).order > higherOrder
13+
) {
14+
higherOrder = (child.props as any).order;
1115
}
1216
});
1317
return higherOrder;

src/charts/barChart/utils/getAxisExtraSpacing.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const handleBarChartXAxis = (
2626
canvasHeight: number,
2727
canvasWidth: number
2828
) => {
29-
const { position, tickText, tickValues } = child.props;
29+
const { position, tickText, tickValues } = child.props as any;
3030
const fontSize = tickText?.fontSize ?? 0;
3131
const spaceFontSize = fontSize * ajustedX;
3232

@@ -71,7 +71,7 @@ const handleBarChartYAxis = (
7171
canvasHeight: number,
7272
canvasWidth: number
7373
) => {
74-
const { position, tickText, tickValues } = child.props;
74+
const { position, tickText, tickValues } = child.props as any;
7575
const fontSize = tickText?.fontSize ?? 0;
7676
const spaceFontSize = fontSize * ajustedY; //! review
7777

@@ -154,9 +154,9 @@ export const getAxisExtraSpacing = ({
154154

155155
Children.forEach(children, (child: React.ReactNode) => {
156156
if (isValidElement(child)) {
157-
if (child.type === BarChartPath && !reviews.includes(child.props.order)) {
158-
reviews.push(child.props.order);
159-
barsSpacing += child.props.barConfig.barWidth ?? 0;
157+
if (child.type === BarChartPath && !reviews.includes((child.props as any).order)) {
158+
reviews.push((child.props as any).order);
159+
barsSpacing += (child.props as any).barConfig.barWidth ?? 0;
160160
}
161161
if (child.type === BarChartXAxis) {
162162
const securitySpace = orientation === BarOrientation.VERTICAL ? barsSpacing : 0;

src/charts/customBackgroundChart/__tests__/accessibility.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ describe('accessibility utils', () => {
3434

3535
describe('formatValue', () => {
3636
it('formats numbers with locale separators', () => {
37-
expect(formatValue(1234567)).toBe('1,234,567');
37+
const result = formatValue(1234567);
38+
// Accept both English (1,234,567) and Spanish (1.234.567) locale formats
39+
expect(result).toMatch(/^1[,.]234[,.]567$/);
3840
});
3941

4042
it('returns strings as-is', () => {

src/charts/customBackgroundChart/__tests__/customBackgroundChart.test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ describe('CustomBackgroundChart', () => {
141141
false
142142
);
143143

144-
expect(screen.getByLabelText('Spain: 1,250,000 EUR')).toBeInTheDocument();
144+
// Accept both English (1,250,000) and Spanish (1.250.000) locale formats
145+
const element = screen.getByRole('button', { name: /Spain: 1[,.]250[,.]000 EUR/ });
146+
expect(element).toBeInTheDocument();
145147
});
146148

147149
it('supports custom ariaLabel template', () => {

src/charts/customBackgroundChart/stories/children/Plot/plot.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const PlotCustomization: Story = {
4141
},
4242

4343
decorators: [
44-
(Story: React.ComponentType): JSX.Element => (
44+
(Story: React.ComponentType): React.JSX.Element => (
4545
<>
4646
<Note
4747
collapsible={true}
@@ -78,7 +78,7 @@ export const PlotCustomization: Story = {
7878
),
7979
],
8080

81-
render: (args: CustomBackgroundChartPlotProps): JSX.Element => {
81+
render: (args: CustomBackgroundChartPlotProps): React.JSX.Element => {
8282
return (
8383
<CustomBackgroundChart
8484
backgroundUrl={GRID_BACKGROUND_URL}

0 commit comments

Comments
 (0)