Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 31 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"packageManager": "pnpm@10.8.1",
"packageManager": "pnpm@10.30.1",
"engines": {
"node": ">=22.0.0",
"pnpm": ">=10.0.0"
Expand All @@ -155,20 +155,24 @@
"type": "corporate",
"url": "https://www.kubit-lab.com/"
},
"peerDependencies": {
"react": "^18.3.0 || ^19.0.0",
"react-dom": "^18.3.0 || ^19.0.0"
},
"devDependencies": {
"@changesets/cli": "^2.29.8",
"@babel/core": "^7.29.0",
"@babel/preset-env": "^7.29.0",
"@babel/preset-react": "^7.28.5",
"@babel/preset-typescript": "^7.28.5",
"@kubit-ui-web/eslint-plugin-no-index-import": "^1.0.2",
"@storybook/addon-a11y": "10.2.5",
"@storybook/addon-a11y": "10.2.10",
"@storybook/addon-coverage": "3.0.0",
"@storybook/addon-designs": "11.1.1",
"@storybook/addon-docs": "10.2.5",
"@storybook/addon-links": "10.2.5",
"@storybook/addon-themes": "10.2.5",
"@storybook/react-vite": "10.2.5",
"@storybook/addon-designs": "11.1.2",
"@storybook/addon-docs": "10.2.10",
"@storybook/addon-links": "10.2.10",
"@storybook/addon-themes": "10.2.10",
"@storybook/react-vite": "10.2.10",
"@storybook/test-runner": "0.24.2",
"@storybook/testing-library": "0.2.2",
"@testing-library/jest-dom": "^6.9.1",
Expand All @@ -177,47 +181,47 @@
"@testing-library/user-event": "^14.6.1",
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
"@types/mocha": "^10.0.10",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0",
"@vitejs/plugin-react": "^5.1.3",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@typescript-eslint/eslint-plugin": "^8.56.0",
"@typescript-eslint/parser": "^8.56.0",
"@vitejs/plugin-react": "^5.1.4",
"@vitest/coverage-v8": "^4.0.18",
"@vitest/ui": "^4.0.18",
"add": "^2.0.6",
"chromatic": "^15.0.0",
"cpy-cli": "^6.0.0",
"eslint": "^9.39.2",
"eslint-config-kubit": "1.7.0",
"chromatic": "^15.1.1",
"cpy-cli": "^7.0.0",
"eslint": "^10.0.0",
"eslint-config-kubit": "2.0.2",
"eslint-config-prettier": "^10.1.8",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-n": "^17.23.2",
"eslint-plugin-n": "^17.24.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-promise": "^7.2.1",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.5.0",
"eslint-plugin-storybook": "^10.2.5",
"eslint-plugin-unused-imports": "^4.3.0",
"glob": "^13.0.0",
"html-validate": "^10.7.0",
"jsdom": "^28.0.0",
"eslint-plugin-storybook": "^10.2.10",
"eslint-plugin-unused-imports": "^4.4.1",
"glob": "^13.0.6",
"html-validate": "^10.8.0",
"jsdom": "^28.1.0",
"prettier": "^3.8.1",
"storybook": "10.2.5",
"storybook": "10.2.10",
"typescript": "^5.9.3",
"typescript-eslint": "^8.54.0",
"typescript-eslint": "^8.56.0",
"vite": "8.0.0-beta.10",
"vite-plugin-dts": "^4.5.4",
"vitest": "^4.0.18",
"vitest-axe": "^0.1.0"
"vitest-axe": "^0.1.0",
"react": "^19.2.4",
"react-dom": "^19.2.4"
},
"dependencies": {
"react": "18.3.1",
"react-dom": "18.3.1",
"react-transition-group": "^4.4.5"
}
}
1,346 changes: 722 additions & 624 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/charts/barChart/stories/barChart.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from '@storybook/react';

Check failure on line 1 in src/charts/barChart/stories/barChart.stories.tsx

View workflow job for this annotation

GitHub Actions / Validate PR Standards

Cannot find module '@storybook/react' or its corresponding type declarations.

import { BarOrientation } from '@/components/bar/bar.type';
import { Note } from '@/storybook/components/note/note';
Expand Down Expand Up @@ -40,7 +40,7 @@
};

// Reusable decorator for customization examples
const withCustomizationNote = (Story: React.ComponentType): JSX.Element => {
const withCustomizationNote = (Story: React.ComponentType): React.JSX.Element => {
return (
<>
<Note
Expand Down Expand Up @@ -133,7 +133,7 @@
orientation: BarOrientation.VERTICAL,
},
decorators: [
(Story: React.ComponentType): JSX.Element => {
(Story: React.ComponentType): React.JSX.Element => {
return (
<>
<Note
Expand Down Expand Up @@ -194,7 +194,7 @@
orientation: BarOrientation.VERTICAL,
},
decorators: [
(Story: React.ComponentType): JSX.Element => {
(Story: React.ComponentType): React.JSX.Element => {
return (
<>
<Note
Expand Down Expand Up @@ -262,7 +262,7 @@
orientation: BarOrientation.HORIZONTAL,
},
decorators: [
(Story: React.ComponentType): JSX.Element => {
(Story: React.ComponentType): React.JSX.Element => {
return (
<>
<Note
Expand Down
8 changes: 4 additions & 4 deletions src/charts/barChart/stories/children/Path/path.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from '@storybook/react';

Check failure on line 1 in src/charts/barChart/stories/children/Path/path.stories.tsx

View workflow job for this annotation

GitHub Actions / Validate PR Standards

Cannot find module '@storybook/react' or its corresponding type declarations.

import { BarOrientation } from '@/components/bar/bar.type';
import { Note } from '@/storybook/components/note/note';
Expand Down Expand Up @@ -55,7 +55,7 @@
},

decorators: [
(Story: React.ComponentType): JSX.Element => (
(Story: React.ComponentType): React.JSX.Element => (
<>
<Note
collapsible={true}
Expand Down Expand Up @@ -94,7 +94,7 @@
),
],

render: (args: BarChartPathProps): JSX.Element => (
render: (args: BarChartPathProps): React.JSX.Element => (
<div style={{ height: '400px', width: '600px' }}>
<BarChart
data={COMPARATIVE_DATA}
Expand Down Expand Up @@ -172,7 +172,7 @@
},

decorators: [
(Story: React.ComponentType): JSX.Element => (
(Story: React.ComponentType): React.JSX.Element => (
<>
<Note
collapsible={true}
Expand Down Expand Up @@ -217,7 +217,7 @@
),
],

render: (args: BarChartPathProps): JSX.Element => (
render: (args: BarChartPathProps): React.JSX.Element => (
<div style={{ height: '400px', width: '600px' }}>
<BarChart
data={COMPARATIVE_DATA}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface ErrorInfoState {
hasErrors: boolean;
}

export const BarChartWithErrorHandlingWithHooks = (): JSX.Element => {
export const BarChartWithErrorHandlingWithHooks = (): React.JSX.Element => {
const [errorInfo, setErrorInfo] = useState<ErrorInfoState>({
errors: {},
hasErrors: false,
Expand Down
8 changes: 6 additions & 2 deletions src/charts/barChart/utils/countBarChildren.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
export const countBarChildren = (children: BarChartChildrenType): number => {
let higherOrder = 0;
Children.toArray(children).forEach(child => {
if (isValidElement(child) && child.type === BarChartPath && child.props.order > higherOrder) {
higherOrder = child.props.order;
if (
isValidElement(child) &&
child.type === BarChartPath &&
(child.props as any).order > higherOrder

Check warning on line 12 in src/charts/barChart/utils/countBarChildren.ts

View workflow job for this annotation

GitHub Actions / Validate PR Standards

Unexpected any. Specify a different type
) {
higherOrder = (child.props as any).order;

Check warning on line 14 in src/charts/barChart/utils/countBarChildren.ts

View workflow job for this annotation

GitHub Actions / Validate PR Standards

Unexpected any. Specify a different type
}
});
return higherOrder;
Expand Down
10 changes: 5 additions & 5 deletions src/charts/barChart/utils/getAxisExtraSpacing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
canvasHeight: number,
canvasWidth: number
) => {
const { position, tickText, tickValues } = child.props;
const { position, tickText, tickValues } = child.props as any;

Check warning on line 29 in src/charts/barChart/utils/getAxisExtraSpacing.ts

View workflow job for this annotation

GitHub Actions / Validate PR Standards

Unexpected any. Specify a different type
const fontSize = tickText?.fontSize ?? 0;
const spaceFontSize = fontSize * ajustedX;

Expand Down Expand Up @@ -71,7 +71,7 @@
canvasHeight: number,
canvasWidth: number
) => {
const { position, tickText, tickValues } = child.props;
const { position, tickText, tickValues } = child.props as any;

Check warning on line 74 in src/charts/barChart/utils/getAxisExtraSpacing.ts

View workflow job for this annotation

GitHub Actions / Validate PR Standards

Unexpected any. Specify a different type
const fontSize = tickText?.fontSize ?? 0;
const spaceFontSize = fontSize * ajustedY; //! review

Expand Down Expand Up @@ -154,9 +154,9 @@

Children.forEach(children, (child: React.ReactNode) => {
if (isValidElement(child)) {
if (child.type === BarChartPath && !reviews.includes(child.props.order)) {
reviews.push(child.props.order);
barsSpacing += child.props.barConfig.barWidth ?? 0;
if (child.type === BarChartPath && !reviews.includes((child.props as any).order)) {

Check warning on line 157 in src/charts/barChart/utils/getAxisExtraSpacing.ts

View workflow job for this annotation

GitHub Actions / Validate PR Standards

Unexpected any. Specify a different type
reviews.push((child.props as any).order);

Check warning on line 158 in src/charts/barChart/utils/getAxisExtraSpacing.ts

View workflow job for this annotation

GitHub Actions / Validate PR Standards

Unexpected any. Specify a different type
barsSpacing += (child.props as any).barConfig.barWidth ?? 0;

Check warning on line 159 in src/charts/barChart/utils/getAxisExtraSpacing.ts

View workflow job for this annotation

GitHub Actions / Validate PR Standards

Unexpected any. Specify a different type
}
if (child.type === BarChartXAxis) {
const securitySpace = orientation === BarOrientation.VERTICAL ? barsSpacing : 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from '@storybook/react';

Check failure on line 1 in src/charts/customBackgroundChart/stories/children/Plot/plot.stories.tsx

View workflow job for this annotation

GitHub Actions / Validate PR Standards

Cannot find module '@storybook/react' or its corresponding type declarations.

import { Note } from '@/storybook/components/note/note';

Expand Down Expand Up @@ -41,7 +41,7 @@
},

decorators: [
(Story: React.ComponentType): JSX.Element => (
(Story: React.ComponentType): React.JSX.Element => (
<>
<Note
collapsible={true}
Expand Down Expand Up @@ -78,7 +78,7 @@
),
],

render: (args: CustomBackgroundChartPlotProps): JSX.Element => {
render: (args: CustomBackgroundChartPlotProps): React.JSX.Element => {
return (
<CustomBackgroundChart
backgroundUrl={GRID_BACKGROUND_URL}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from '@storybook/react';

Check failure on line 1 in src/charts/customBackgroundChart/stories/customBackgroundChart.stories.tsx

View workflow job for this annotation

GitHub Actions / Validate PR Standards

Cannot find module '@storybook/react' or its corresponding type declarations.

import { Note } from '@/storybook/components/note/note';

Expand Down Expand Up @@ -40,7 +40,7 @@
width: '100%',
};

const withBasicNote = (Story: React.ComponentType): JSX.Element => {
const withBasicNote = (Story: React.ComponentType): React.JSX.Element => {
return (
<>
<Note
Expand Down Expand Up @@ -359,7 +359,7 @@
width: '100%',
},
decorators: [
(Story: React.ComponentType): JSX.Element => {
(Story: React.ComponentType): React.JSX.Element => {
return (
<>
<Note
Expand Down Expand Up @@ -613,7 +613,7 @@
width: '100%',
},
decorators: [
(Story: React.ComponentType): JSX.Element => {
(Story: React.ComponentType): React.JSX.Element => {
return (
<>
<Note
Expand Down
2 changes: 1 addition & 1 deletion src/charts/lineChart/fragments/lineChartProjection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const LineChartProjection: FC<LineChartProjectionProps> = ({
lineProjection,
points,
svgHeight,
}): JSX.Element => {
}): React.JSX.Element => {
const { addError } = useContext(LineChartContext);
const { lower, shapeColor, upper } = lineProjection;
const { xProjection: xUp, yProjection: yUp, ...upperProps } = upper || {};
Expand Down
3 changes: 2 additions & 1 deletion src/charts/lineChart/lineChartStructure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type { ChartError, ErrorType } from '@/types/errors.type';
import { createErrorAccumulator } from '@/utils/createErrorAccumulator';
import { getChildrenAttr } from '@/utils/getChildrenAttr/getChildrenAttr';
import { getDataFingerprint } from '@/utils/getDataFingerprint/getDataFingerprint';

import { buildLineContextValue } from './context/buildLineContextValue';
import { LineChartContext } from './context/lineChartContext';
import { LineChartXAxis } from './fragments/lineChartXAxis';
Expand Down Expand Up @@ -79,7 +80,7 @@ export const LineChartStructure: FC<LineChartProps> = ({
<LineChartXAxis key="default-x-axis" />,
<LineChartYAxis key="default-y-axis" />,
];
const arrayChildren = (Children.toArray(children) || []) as JSX.Element[];
const arrayChildren = (Children.toArray(children) || []) as React.JSX.Element[];
const chidrenWithDefaultAxis = defaultAxis.concat(arrayChildren);

// watch the Y childs keys
Expand Down
8 changes: 4 additions & 4 deletions src/charts/lineChart/stories/children/Path/path.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from '@storybook/react';

Check failure on line 1 in src/charts/lineChart/stories/children/Path/path.stories.tsx

View workflow job for this annotation

GitHub Actions / Validate PR Standards

Cannot find module '@storybook/react' or its corresponding type declarations.

import { Note } from '@/storybook/components/note/note';

Expand Down Expand Up @@ -144,7 +144,7 @@
},

decorators: [
(Story: React.ComponentType): JSX.Element => (
(Story: React.ComponentType): React.JSX.Element => (
<>
<Note
collapsible={true}
Expand Down Expand Up @@ -208,7 +208,7 @@
),
],

render: (args: LineChartPathProps): JSX.Element => {
render: (args: LineChartPathProps): React.JSX.Element => {
return (
<LineChart data={SUBCOMPONENT_DEMO_DATA} xKey="x">
{/* Path protagonist - receives args from controls */}
Expand Down Expand Up @@ -310,7 +310,7 @@
},

decorators: [
(Story: React.ComponentType): JSX.Element => (
(Story: React.ComponentType): React.JSX.Element => (
<>
<Note
collapsible={true}
Expand Down Expand Up @@ -352,7 +352,7 @@
),
],

render: (args: LineChartPathProps): JSX.Element => {
render: (args: LineChartPathProps): React.JSX.Element => {
return (
<LineChart data={PROJECTION_DEMO_DATA} xKey="x">
<LineChart.Path {...args} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from '@storybook/react';

Check failure on line 1 in src/charts/lineChart/stories/children/Separator/separator.stories.tsx

View workflow job for this annotation

GitHub Actions / Validate PR Standards

Cannot find module '@storybook/react' or its corresponding type declarations.

import { Note } from '@/storybook/components/note/note';

Expand All @@ -12,7 +12,7 @@
argTypes: separatorArgTypes(),
component: LineChartSeparator,
decorators: [
(Story: React.ComponentType): JSX.Element => (
(Story: React.ComponentType): React.JSX.Element => (
<>
<Note
collapsible={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { XAxisStoryArgs } from './xAxis.types';
const meta = {
argTypes: xAxisArgTypes(),
decorators: [
(Story: React.ComponentType): JSX.Element => (
(Story: React.ComponentType): React.JSX.Element => (
<>
<Note
collapsible={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { YAxisStoryArgs } from './yAxis.types';
const meta = {
argTypes: yAxisArgTypes(),
decorators: [
(Story: React.ComponentType): JSX.Element => (
(Story: React.ComponentType): React.JSX.Element => (
<>
<Note
collapsible={true}
Expand Down
Loading
Loading