From edd0bb9930c8ee80eeac1f22d0276682f09b283f Mon Sep 17 00:00:00 2001 From: kaori-killer <75800958+kaori-killer@users.noreply.github.com> Date: Mon, 22 Sep 2025 11:10:07 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20`index.html`=EC=97=90=20`lang`=20?= =?UTF-8?q?=EC=86=8D=EC=84=B1=EC=9D=84=20=ED=95=9C=EA=B5=AD=EC=96=B4?= =?UTF-8?q?=EB=A1=9C=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a11y/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a11y/index.html b/a11y/index.html index 12fa3e7..73a1d92 100644 --- a/a11y/index.html +++ b/a11y/index.html @@ -1,5 +1,5 @@ - + From 9344d74347e26fc5a7639fab3c7432f8d80c8f4c Mon Sep 17 00:00:00 2001 From: kaori-killer <75800958+kaori-killer@users.noreply.github.com> Date: Mon, 22 Sep 2025 11:10:32 +0900 Subject: [PATCH 2/3] =?UTF-8?q?chore:=20=EB=8F=99=EC=9D=BC=ED=95=9C=20?= =?UTF-8?q?=EC=99=80=EC=9D=B4=ED=8C=8C=EC=9D=B4=EB=9D=BC=EB=A9=B4=20?= =?UTF-8?q?=EC=99=B8=EB=B6=80=EC=97=90=EC=84=9C=20=EC=A0=91=EC=86=8D?= =?UTF-8?q?=ED=95=A0=20=EC=88=98=EC=9E=88=EB=8F=84=EB=A1=9D=20package.json?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a11y/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a11y/package.json b/a11y/package.json index 1148c94..aa440de 100644 --- a/a11y/package.json +++ b/a11y/package.json @@ -4,7 +4,7 @@ "version": "0.0.0", "type": "module", "scripts": { - "dev": "vite", + "dev": "vite --host 0.0.0.0", "build": "tsc -b && vite build", "lint": "eslint .", "preview": "vite preview" From 13f1a7ec427ea10b818fcd88e6746c8b11a81e91 Mon Sep 17 00:00:00 2001 From: kaori-killer <75800958+kaori-killer@users.noreply.github.com> Date: Mon, 22 Sep 2025 11:21:00 +0900 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20accessibility=20=EA=B0=9C=EC=84=A0?= =?UTF-8?q?=EC=9D=84=20=EC=9C=84=ED=95=9C=20=EC=83=81=ED=83=9C=20=EB=A9=94?= =?UTF-8?q?=EC=8B=9C=EC=A7=80=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20HTML=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a11y/src/App.tsx | 12 +++---- a11y/src/components/FlightBooking.css | 5 +++ a11y/src/components/FlightBooking.tsx | 51 ++++++++++++++++++++++----- 3 files changed, 53 insertions(+), 15 deletions(-) diff --git a/a11y/src/App.tsx b/a11y/src/App.tsx index a8159f9..15db74d 100644 --- a/a11y/src/App.tsx +++ b/a11y/src/App.tsx @@ -5,13 +5,13 @@ import FlightBooking from "./components/FlightBooking"; function App() { return ( -
-
-
+
+
+
-
-
-
+ + + ); } diff --git a/a11y/src/components/FlightBooking.css b/a11y/src/components/FlightBooking.css index d9d6083..35c9944 100644 --- a/a11y/src/components/FlightBooking.css +++ b/a11y/src/components/FlightBooking.css @@ -61,3 +61,8 @@ border-radius: 4px; cursor: pointer; } + +.visually-hidden { + position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; + overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; +} diff --git a/a11y/src/components/FlightBooking.tsx b/a11y/src/components/FlightBooking.tsx index 313cab3..2e1757b 100644 --- a/a11y/src/components/FlightBooking.tsx +++ b/a11y/src/components/FlightBooking.tsx @@ -1,37 +1,70 @@ import { useState } from "react"; - import "./FlightBooking.css"; const MAX_PASSENGERS = 3; const FlightBooking = () => { const [adultCount, setAdultCount] = useState(1); + const [statusMessage, setStatusMessage] = useState(""); const incrementCount = () => { - setAdultCount((prev) => Math.min(MAX_PASSENGERS, prev + 1)); + setAdultCount((prev) => { + if (prev >= MAX_PASSENGERS) { + setStatusMessage("최대 승객 수에 도달했습니다."); + return prev; + } + setStatusMessage(""); + return prev + 1; + }); }; const decrementCount = () => { - setAdultCount((prev) => Math.max(1, prev - 1)); + setAdultCount((prev) => { + if (prev <= 1) { + setStatusMessage("최소 1명의 승객이 필요합니다."); + return prev; + } + setStatusMessage(""); + return prev - 1; + }); }; return ( -
+

항공권 예매

+
- 성인 + + 성인 + +
- - {adultCount} -
+ + {statusMessage} +
-
+ ); };