From cb2238bbb3e001b71c58b01eb80def91cd1898c7 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Mar 2026 15:48:25 +0000 Subject: [PATCH 1/2] feat: add "Load from URL" tab for direct GTFS URL input Add a new UrlInput component and tab that allows users to paste a GTFS feed URL directly. The tab is enabled by default and appears between the file import and source search tabs. No URL format validation is performed per design. https://claude.ai/code/session_01C57bNoi7igqU1xEtLS2Coy --- CHANGELOG.md | 5 +++ src/components/GtfsSelector.tsx | 11 ++++++ src/components/UrlInput.test.tsx | 58 ++++++++++++++++++++++++++++++++ src/components/UrlInput.tsx | 35 +++++++++++++++++++ src/index.ts | 2 ++ src/style.css | 37 ++++++++++++++++++++ 6 files changed, 148 insertions(+) create mode 100644 src/components/UrlInput.test.tsx create mode 100644 src/components/UrlInput.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index 98e4840..6a96b4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- "Load from URL" tab allowing users to input a GTFS feed URL directly +- `UrlInput` component exported for standalone use + ## [0.2.2] - 2026-03-09 ### Changed diff --git a/src/components/GtfsSelector.tsx b/src/components/GtfsSelector.tsx index 0be2f76..d57098e 100644 --- a/src/components/GtfsSelector.tsx +++ b/src/components/GtfsSelector.tsx @@ -4,6 +4,7 @@ import { transportDataGouvFr } from '../sources/transport-data-gouv-fr'; import { mobilityDataCsv } from '../sources/mobility-data-csv'; import { DropZone } from './DropZone'; import { SourceSearch } from './SourceSearch'; +import { UrlInput } from './UrlInput'; export interface GtfsSelectorProps { /** Called when a GTFS source is selected (file dropped or URL picked) */ @@ -67,6 +68,14 @@ export function GtfsSelector({ > Import file + {allSources.map((source) => ( + + ); +} diff --git a/src/index.ts b/src/index.ts index a6a3d70..71f6913 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,8 @@ export { GtfsSelector } from './components/GtfsSelector'; export type { GtfsSelectorProps } from './components/GtfsSelector'; export { DropZone } from './components/DropZone'; +export { UrlInput } from './components/UrlInput'; +export type { UrlInputProps } from './components/UrlInput'; export { SourceSearch } from './components/SourceSearch'; export type { GtfsSelectionResult, GtfsSearchResult, GtfsSource } from './types'; diff --git a/src/style.css b/src/style.css index f342609..ae6c28d 100644 --- a/src/style.css +++ b/src/style.css @@ -82,6 +82,43 @@ color: #d32f2f; } +/* URL input */ +.rgs-url-input { + display: flex; + gap: 8px; +} + +.rgs-url-input input { + flex: 1; + padding: 10px 12px; + font-size: 14px; + border: 1px solid #ccc; + border-radius: 6px; + outline: none; + box-sizing: border-box; + transition: border-color 0.15s; +} + +.rgs-url-input input:focus { + border-color: #0066cc; + box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.15); +} + +.rgs-url-input button { + padding: 10px 20px; + font-size: 14px; + border: none; + border-radius: 6px; + background: #0066cc; + color: #fff; + cursor: pointer; + transition: background 0.15s; +} + +.rgs-url-input button:hover { + background: #0052a3; +} + /* Source search */ .rgs-source-search { position: relative; From 17d42bfc468d1145909be2a1f12bd2a56209edeb Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Mar 2026 15:48:51 +0000 Subject: [PATCH 2/2] chore: update package-lock.json after npm install https://claude.ai/code/session_01C57bNoi7igqU1xEtLS2Coy --- package-lock.json | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 05ab5c8..e2db7e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-gtfs-selector", - "version": "0.2.1", + "version": "0.2.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "react-gtfs-selector", - "version": "0.2.1", + "version": "0.2.2", "license": "MIT", "dependencies": { "papaparse": "^5.5.3" @@ -58,6 +58,7 @@ "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", @@ -215,7 +216,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -239,7 +239,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=18" } @@ -1324,7 +1323,8 @@ "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/estree": { "version": "1.0.8", @@ -1366,7 +1366,6 @@ "integrity": "sha512-z9VXpC7MWrhfWipitjNdgCauoMLRdIILQsAEV+ZesIzBq/oUlxk0m3ApZuMFCXdnS4U7KrI+l3WRUEGQ8K1QKw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.2.2" @@ -1378,7 +1377,6 @@ "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", "dev": true, "license": "MIT", - "peer": true, "peerDependencies": { "@types/react": "^18.0.0" } @@ -1712,6 +1710,7 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -1722,6 +1721,7 @@ "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -1993,7 +1993,8 @@ "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/dunder-proto": { "version": "1.0.1", @@ -2482,7 +2483,6 @@ "integrity": "sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "cssstyle": "^4.1.0", "data-urls": "^5.0.0", @@ -2603,6 +2603,7 @@ "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", "dev": true, "license": "MIT", + "peer": true, "bin": { "lz-string": "bin/bin.js" } @@ -2811,7 +2812,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -2866,6 +2866,7 @@ "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", @@ -2908,7 +2909,6 @@ "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -2922,7 +2922,6 @@ "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -2936,7 +2935,8 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/redent": { "version": "3.0.0", @@ -3327,7 +3327,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -3366,7 +3365,6 @@ "integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", @@ -4529,7 +4527,6 @@ "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43",