diff --git a/README.md b/README.md index c31e68c..f2a267b 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ at https://simrail.tools. Currently implemented are: - A journey view showing live detailed information about a single journey (including future and past trains). Can currently only be accessed by selecting a train on the map and clicking on "Journey Details" (https://simrail.tools/journeys/) +- Departure Boards, showing all departing trains at a point on a server (https://simrail.tools/departureboard) Planned features include: - A nicer home page - Journey search feature - Vehicle composition display (including images) -- Departure Boards (preview available at https://departure-boards.sit-frontend.pages.dev/departureboard) If you want to request a feature feel free to [open an issue](https://github.com/simrailtools/frontend/issues/new) or contact me on Discord: `@derklaro`. diff --git a/package.json b/package.json index 7054b50..bbf412e 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,8 @@ "@maplibre/maplibre-gl-style-spec": "^24.4.1", "@nats-io/nats-core": "^3.3.1", "@tanstack/react-devtools": "^0.9.5", + "@tanstack/react-form": "^1.28.3", + "@tanstack/react-form-devtools": "^0.2.16", "@tanstack/react-pacer": "^0.19.4", "@tanstack/react-pacer-devtools": "^0.5.2", "@tanstack/react-query": "^5.90.21", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8355083..28c3524 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,12 @@ importers: '@tanstack/react-devtools': specifier: ^0.9.5 version: 0.9.5(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(csstype@3.2.3)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(solid-js@1.9.11) + '@tanstack/react-form': + specifier: ^1.28.3 + version: 1.28.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + '@tanstack/react-form-devtools': + specifier: ^0.2.16 + version: 0.2.16(@types/react@19.2.14)(csstype@3.2.3)(react@19.2.4)(solid-js@1.9.11) '@tanstack/react-pacer': specifier: ^0.19.4 version: 0.19.4(react-dom@19.2.4(react@19.2.4))(react@19.2.4) @@ -909,6 +915,27 @@ packages: vue: optional: true + '@tanstack/devtools-utils@0.3.0': + resolution: {integrity: sha512-JgApXVrgtgSLIPrm/QWHx0u6c9Ji0MNMDWhwujapj8eMzux5aOfi+2Ycwzj0A0qITXA12SEPYV3HC568mDtYmQ==} + engines: {node: '>=18'} + peerDependencies: + '@types/react': '>=17.0.0' + preact: '>=10.0.0' + react: '>=17.0.0' + solid-js: '>=1.9.7' + vue: '>=3.2.0' + peerDependenciesMeta: + '@types/react': + optional: true + preact: + optional: true + react: + optional: true + solid-js: + optional: true + vue: + optional: true + '@tanstack/devtools-vite@0.5.1': resolution: {integrity: sha512-5dXxMznSxx8NNpO9IbDC011sIdvTVvsoLaLAxm69dgDAX0+2OB8gdXrQp8dnzeNMvszKCgRxI2cgr/pjPgmnNw==} engines: {node: '>=18'} @@ -921,6 +948,14 @@ packages: peerDependencies: solid-js: '>=1.9.7' + '@tanstack/form-core@1.28.3': + resolution: {integrity: sha512-DBhnu1d5VfACAYOAZJO8tsEUHjWczZMJY8v/YrtAJNWpwvL/3ogDuz8e6yUB2m/iVTNq6K8yrnVN2nrX0/BX/w==} + + '@tanstack/form-devtools@0.2.16': + resolution: {integrity: sha512-jnCHyeP7Gy0NRGkjJSLQu7/IBpZBknf/5MV5+e24kMzoSs0x4LdhcwVVZwKszNFTBNFdXePPyhOXHand/r9Jkg==} + peerDependencies: + solid-js: '>=1.9.9' + '@tanstack/history@1.154.14': resolution: {integrity: sha512-xyIfof8eHBuub1CkBnbKNKQXeRZC4dClhmzePHVOEel4G7lk/dW+TQ16da7CFdeNLv6u6Owf5VoBQxoo6DFTSA==} engines: {node: '>=12'} @@ -931,6 +966,10 @@ packages: peerDependencies: '@tanstack/pacer': '>=0.16.4' + '@tanstack/pacer-lite@0.1.1': + resolution: {integrity: sha512-y/xtNPNt/YeyoVxE/JCx+T7yjEzpezmbb+toK8DDD1P4m7Kzs5YR956+7OKexG3f8aXgC3rLZl7b1V+yNUSy5w==} + engines: {node: '>=18'} + '@tanstack/pacer@0.18.0': resolution: {integrity: sha512-qhCRSFei0hokQr3xYcQXqxsRD/LKlgHCxHXtKHrQoImp4x2Zu6tUOpUGVH4y2qexIrzSu3aibQBNNfC3Eay6Mg==} engines: {node: '>=18'} @@ -950,6 +989,20 @@ packages: react: '>=16.8' react-dom: '>=16.8' + '@tanstack/react-form-devtools@0.2.16': + resolution: {integrity: sha512-8zZZoi3XlIjEjDEr1LREmdTyKkYIGgBDgSqx4WVg/VLoqGw/j5mfXwjzbYhPNHd9eHzjmsweOJ9jzozbWKRh4g==} + peerDependencies: + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + + '@tanstack/react-form@1.28.3': + resolution: {integrity: sha512-84yd0swZRcyC3Q46dYBH6bHf1tlIY1flchbdG3VwArg/wLVW5RdBenIrJhleHjk2OxXuF+9HoKQbHglJyWIXQA==} + peerDependencies: + '@tanstack/react-start': '*' + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + '@tanstack/react-start': + optional: true + '@tanstack/react-pacer-devtools@0.5.2': resolution: {integrity: sha512-VpZ64QCNIHOZFTTwQ6XyQbUYPNbOEw7+n5qK72uoqyaFlAMONKtRyE+hxuqup483bmHROou7mN/MLmfQxVSKfQ==} engines: {node: '>=18'} @@ -2624,6 +2677,16 @@ snapshots: transitivePeerDependencies: - csstype + '@tanstack/devtools-utils@0.3.0(@types/react@19.2.14)(csstype@3.2.3)(react@19.2.4)(solid-js@1.9.11)': + dependencies: + '@tanstack/devtools-ui': 0.4.4(csstype@3.2.3)(solid-js@1.9.11) + optionalDependencies: + '@types/react': 19.2.14 + react: 19.2.4 + solid-js: 1.9.11 + transitivePeerDependencies: + - csstype + '@tanstack/devtools-vite@0.5.1(vite@7.3.1(@types/node@22.19.10)(jiti@2.6.1)(lightningcss@1.30.2)(tsx@4.21.0))': dependencies: '@babel/core': 7.29.0 @@ -2658,6 +2721,28 @@ snapshots: - csstype - utf-8-validate + '@tanstack/form-core@1.28.3': + dependencies: + '@tanstack/devtools-event-client': 0.4.0 + '@tanstack/pacer-lite': 0.1.1 + '@tanstack/store': 0.8.1 + + '@tanstack/form-devtools@0.2.16(@types/react@19.2.14)(csstype@3.2.3)(react@19.2.4)(solid-js@1.9.11)': + dependencies: + '@tanstack/devtools-ui': 0.4.4(csstype@3.2.3)(solid-js@1.9.11) + '@tanstack/devtools-utils': 0.3.0(@types/react@19.2.14)(csstype@3.2.3)(react@19.2.4)(solid-js@1.9.11) + '@tanstack/form-core': 1.28.3 + clsx: 2.1.1 + dayjs: 1.11.19 + goober: 2.1.18(csstype@3.2.3) + solid-js: 1.9.11 + transitivePeerDependencies: + - '@types/react' + - csstype + - preact + - react + - vue + '@tanstack/history@1.154.14': {} '@tanstack/pacer-devtools@1.1.2(@tanstack/pacer@0.18.0)(@types/react@19.2.14)(csstype@3.2.3)(react@19.2.4)': @@ -2677,6 +2762,8 @@ snapshots: - react - vue + '@tanstack/pacer-lite@0.1.1': {} + '@tanstack/pacer@0.18.0': dependencies: '@tanstack/devtools-event-client': 0.4.0 @@ -2699,6 +2786,26 @@ snapshots: - solid-js - utf-8-validate + '@tanstack/react-form-devtools@0.2.16(@types/react@19.2.14)(csstype@3.2.3)(react@19.2.4)(solid-js@1.9.11)': + dependencies: + '@tanstack/devtools-utils': 0.3.0(@types/react@19.2.14)(csstype@3.2.3)(react@19.2.4)(solid-js@1.9.11) + '@tanstack/form-devtools': 0.2.16(@types/react@19.2.14)(csstype@3.2.3)(react@19.2.4)(solid-js@1.9.11) + react: 19.2.4 + transitivePeerDependencies: + - '@types/react' + - csstype + - preact + - solid-js + - vue + + '@tanstack/react-form@1.28.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4)': + dependencies: + '@tanstack/form-core': 1.28.3 + '@tanstack/react-store': 0.8.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4) + react: 19.2.4 + transitivePeerDependencies: + - react-dom + '@tanstack/react-pacer-devtools@0.5.2(@tanstack/pacer@0.18.0)(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(csstype@3.2.3)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(solid-js@1.9.11)': dependencies: '@tanstack/devtools-utils': 0.2.4(@types/react@19.2.14)(csstype@3.2.3)(react@19.2.4)(solid-js@1.9.11) diff --git a/src/api/rest/types.gen.ts b/src/api/rest/types.gen.ts index 0a642ab..70612fa 100644 --- a/src/api/rest/types.gen.ts +++ b/src/api/rest/types.gen.ts @@ -314,9 +314,13 @@ export type JourneyStopPlaceDto = { export type JourneyTransportDto = { /** - * The external category of the transport + * The category of the transport */ category: string; + /** + * The external category of the transport (for example internal can be RPJ, external IR), null if the same as the internal category + */ + categoryExternal?: string | null; /** * The number of the transport */ @@ -405,7 +409,7 @@ export type SimRailServerDto = { /** * The scenery (map part) that is available on the server */ - scenery: 'FULL' | 'WARSAW_LODZ_PSARY' | 'WARSAW_LODZ_KRAKOW' | 'WARSAW_LODZ_KATOWICE' | 'WARSAW_KATOWICE_KRAKOW'; + scenery: 'FULL' | 'WARSAW_LODZ_PSARY' | 'WARSAW_LODZ_KRAKOW' | 'WARSAW_LODZ_KATOWICE' | 'WARSAW_KATOWICE_KRAKOW' | 'KATOWICE_PSARY_KOZLOW'; /** * The instant (ISO-8601) when the data of the server was last updated */ @@ -520,6 +524,10 @@ export type JourneyTransportSummaryDto = { * The external category of the transport */ category: string; + /** + * The external category of the transport (for example internal can be RPJ, external IR), null if the same as the internal category + */ + categoryExternal?: string | null; /** * The number of the transport */ @@ -777,9 +785,13 @@ export type BoardStopInfoDto = { export type BoardTransportDto = { /** - * The external category of the transport + * The category of the transport */ category: string; + /** + * The external category of the transport (for example internal can be RPJ, external IR), null if the same as the internal category + */ + categoryExternal?: string | null; /** * The number of the transport */ diff --git a/src/components/form/Button.tsx b/src/components/form/Button.tsx new file mode 100644 index 0000000..1750c20 --- /dev/null +++ b/src/components/form/Button.tsx @@ -0,0 +1,16 @@ +import type { ComponentProps, FC } from "react"; +import { cn } from "@/lib/utils.ts"; + +export const Button: FC> = ({ children, className = "", ref, ...props }) => ( + +); diff --git a/src/components/form/RangeInput.tsx b/src/components/form/RangeInput.tsx new file mode 100644 index 0000000..32f00b6 --- /dev/null +++ b/src/components/form/RangeInput.tsx @@ -0,0 +1,19 @@ +import type { ComponentProps, FC } from "react"; +import { cn } from "@/lib/utils.ts"; + +export const RangeInput: FC, "type">> = ({ className, value, ref, ...props }) => ( +
+ + {value} +
+); diff --git a/src/components/form/SelectInput.tsx b/src/components/form/SelectInput.tsx new file mode 100644 index 0000000..a2ed68e --- /dev/null +++ b/src/components/form/SelectInput.tsx @@ -0,0 +1,34 @@ +import type { ComponentProps, FC, PropsWithChildren } from "react"; +import { cn } from "@/lib/utils.ts"; + +export const SelectInput: FC>> = ({ + children, + className = "", + ref, + ...props +}) => ( +
+ +
+ + Dropdown Arrow + + +
+
+); diff --git a/src/components/form/ToggleInput.tsx b/src/components/form/ToggleInput.tsx new file mode 100644 index 0000000..2b04b8a --- /dev/null +++ b/src/components/form/ToggleInput.tsx @@ -0,0 +1,10 @@ +import type { ComponentProps, FC } from "react"; +import { cn } from "@/lib/utils.ts"; + +export const ToggleInput: FC, "type">> = ({ className = "", ref, ...props }) => ( +