Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ dist-ssr

coverage

docs-build
docs-build

# yarn
.yarn
.yarnrc.yml

*storybook.log
16 changes: 0 additions & 16 deletions .storybook/main.cjs

This file was deleted.

19 changes: 19 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { StorybookConfig } from '@storybook/react-vite';

const config: StorybookConfig = {
"stories": [
"../src/**/*.mdx",
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
],
"addons": [
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@chromatic-com/storybook",
"@storybook/addon-interactions"
],
"framework": {
"name": "@storybook/react-vite",
"options": {}
}
};
export default config;
7 changes: 0 additions & 7 deletions .storybook/preview-body.html

This file was deleted.

8 changes: 0 additions & 8 deletions .storybook/preview-head.html

This file was deleted.

14 changes: 14 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Preview } from '@storybook/react'

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
66 changes: 37 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"nt4",
"react"
],
"version": "2.0.0",
"version": "2.1.0",
"type": "module",
"license": "MIT",
"scripts": {
Expand All @@ -23,37 +23,44 @@
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build -o docs-build",
"build-storybook": "storybook build",
"chromatic": "chromatic --exit-zero-on-changes"
},
"peerDependencies": {
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"dependencies": {
"ntcore-ts-client": "^2.0.0-beta.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"zod": "^3.22.4"
"ntcore-ts-client": "^3.1.2"
},
"devDependencies": {
"@storybook/addon-docs": "^7.0.13",
"@storybook/addon-essentials": "^7.0.13",
"@storybook/react": "^7.0.13",
"@storybook/react-vite": "^7.0.13",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@types/jest": "^29.4.0",
"@types/node": "^20.1.7",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-react-swc": "^3.0.0",
"chromatic": "^6.17.4",
"@chromatic-com/storybook": "^3.2.6",
"@storybook/addon-essentials": "^8.6.7",
"@storybook/addon-interactions": "^8.6.7",
"@storybook/addon-onboarding": "^8.6.7",
"@storybook/blocks": "^8.6.7",
"@storybook/react": "^8.6.7",
"@storybook/react-vite": "^8.6.7",
"@storybook/test": "^8.6.7",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@types/jest": "^29.5.14",
"@types/node": "^22.13.10",
"@types/react": "^19.0.11",
"@types/react-dom": "^19.0.4",
"@vitejs/plugin-react-swc": "^3.8.0",
"chromatic": "^11.27.0",
"cz-conventional-changelog": "^3.3.0",
"jest": "^29.4.2",
"jest": "^29.7.0",
"jest-dom": "^4.0.0",
"jest-environment-jsdom": "^29.4.2",
"storybook": "^7.0.13",
"ts-jest": "^29.0.5",
"typescript": "^5.0.4",
"vite": "^4.1.0",
"vite-plugin-dts": "^2.3.0"
"jest-environment-jsdom": "^29.7.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"storybook": "^8.6.7",
"ts-jest": "^29.2.6",
"typescript": "^5.8.2",
"vite": "^6.2.2",
"vite-plugin-dts": "^4.5.3"
},
"browserslist": {
"production": [
Expand All @@ -69,9 +76,9 @@
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/ntcore-react.es.js",
"require": "./dist/ntcore-react.umd.js",
"types": "./dist/index.d.ts"
"require": "./dist/ntcore-react.umd.js"
}
},
"main": "dist/ntcore-react.umd.js",
Expand All @@ -91,5 +98,6 @@
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
},
"packageManager": "yarn@4.7.0"
}
6 changes: 3 additions & 3 deletions src/components/Field2d/Field2d.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

import { ComponentStory, ComponentMeta } from "@storybook/react";
import { StoryFn, Meta } from "@storybook/react";

import { Field2d, Field2dProps } from "../index";

Expand All @@ -9,9 +9,9 @@ import { Year } from "../../lib/util/Year";
export default {
title: "Field2d",
component: Field2d,
} as ComponentMeta<typeof Field2d>;
} as Meta<typeof Field2d>;

const Template: ComponentStory<typeof Field2d> = (args: Field2dProps) => (
const Template: StoryFn<typeof Field2d> = (args: Field2dProps) => (
<Field2d {...args} />
);

Expand Down
1 change: 0 additions & 1 deletion src/components/Field2d/Fields/Field2dChargedUp.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { Transform2d, transformsToSVGPoints, useAllianceFlip } from "../Util";
import Units from "../../../lib/util/Units";

Expand Down
3 changes: 2 additions & 1 deletion src/components/Field2d/Years.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ReactNode } from "react";
import Units from "../../lib/util/Units";
import { Year } from "../../lib/util/Year";

Expand All @@ -6,7 +7,7 @@ import Field2dChargedUp from "./Fields/Field2dChargedUp";
type YearData = {
fieldMirrored: boolean;
fieldSize: [number, number];
fieldBase: () => JSX.Element;
fieldBase: () => ReactNode;
};

export const Years: { [key in Year]: YearData } = {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Gauge/Gauge.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from "react";

import { ComponentStory, ComponentMeta } from "@storybook/react";
import { StoryFn, Meta } from "@storybook/react";

import { Gauge, GaugeProps } from "../index";

export default {
title: "Gauge",
component: Gauge,
} as ComponentMeta<typeof Gauge>;
} as Meta<typeof Gauge>;

const Template: ComponentStory<typeof Gauge> = (args: GaugeProps) => (
const Template: StoryFn<typeof Gauge> = (args: GaugeProps) => (
<Gauge {...args} />
);

Expand Down
6 changes: 3 additions & 3 deletions src/components/Indicator/Indicator.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from "react";

import { ComponentStory, ComponentMeta } from "@storybook/react";
import { StoryFn, Meta } from "@storybook/react";

import { Indicator, IndicatorProps } from "../index";

export default {
title: "Indicator",
component: Indicator,
} as ComponentMeta<typeof Indicator>;
} as Meta<typeof Indicator>;

const Template: ComponentStory<typeof Indicator> = (args: IndicatorProps) => (
const Template: StoryFn<typeof Indicator> = (args: IndicatorProps) => (
<Indicator {...args} />
);

Expand Down
2 changes: 1 addition & 1 deletion src/lib/NTProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function NTProvider({
setNtConnectionCreatedUsingTeamNumber,
] = useState<boolean>(false);

const oldTeamNumber = useRef<number | undefined>();
const oldTeamNumber = useRef<number | undefined>(undefined);

useEffect(() => {
// Create a network tables connection if one doesn't exist
Expand Down
Loading