From e0e2945564e37a2583f77ea00dbd7fa6696f824b Mon Sep 17 00:00:00 2001 From: 00kang Date: Mon, 23 Sep 2024 15:47:48 +0900 Subject: [PATCH 1/6] =?UTF-8?q?chore:=20localhost=20=EB=AA=A8=EB=B0=94?= =?UTF-8?q?=EC=9D=BC=EC=97=90=EC=84=9C=20=EC=A0=91=EA=B7=BC=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20=EC=9C=84=ED=95=9C=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a11y/vite.config.ts | 3 +++ package-lock.json | 6 ++++++ 2 files changed, 9 insertions(+) create mode 100644 package-lock.json diff --git a/a11y/vite.config.ts b/a11y/vite.config.ts index 9cc50ea..d8d4e6c 100644 --- a/a11y/vite.config.ts +++ b/a11y/vite.config.ts @@ -4,4 +4,7 @@ import react from "@vitejs/plugin-react"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + server: { + host: "0.0.0.0", + }, }); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6846ea4 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "self-paced-enhance-usability", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} From 9a5ec13abb958c0068125564bc439be0046911a9 Mon Sep 17 00:00:00 2001 From: 00kang Date: Mon, 23 Sep 2024 15:48:32 +0900 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20lang=3D"ko"=20=EC=96=B8=EC=96=B4=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a11y/index.html | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/a11y/index.html b/a11y/index.html index 12fa3e7..e525729 100644 --- a/a11y/index.html +++ b/a11y/index.html @@ -1,16 +1,14 @@ - - - - - - - - Accessibility - - - -
- - + + + + + + + Accessibility + + +
+ + From a091e70c999a8c779db1916841ad5b2f0507f06e Mon Sep 17 00:00:00 2001 From: 00kang Date: Mon, 23 Sep 2024 15:49:04 +0900 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=EC=A0=81=EC=A0=88=ED=95=9C=20?= =?UTF-8?q?=EC=8B=9C=EB=A7=A8=ED=8B=B1=20=ED=83=9C=EA=B7=B8=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a11y/src/App.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/a11y/src/App.tsx b/a11y/src/App.tsx index a8159f9..b8fecc8 100644 --- a/a11y/src/App.tsx +++ b/a11y/src/App.tsx @@ -6,11 +6,11 @@ import FlightBooking from "./components/FlightBooking"; function App() { return (
-
-
+
+
-
-
+ +
); } From ab0eac7799fa194045e48e626afb6566bcf878a3 Mon Sep 17 00:00:00 2001 From: 00kang Date: Mon, 23 Sep 2024 16:01:01 +0900 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=EB=B2=84=ED=8A=BC=EC=97=90=20aria-?= =?UTF-8?q?label=20=EC=86=8D=EC=84=B1=20=EC=B6=94=EA=B0=80=ED=95=98?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a11y/src/components/FlightBooking.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/a11y/src/components/FlightBooking.tsx b/a11y/src/components/FlightBooking.tsx index 313cab3..dcbcea6 100644 --- a/a11y/src/components/FlightBooking.tsx +++ b/a11y/src/components/FlightBooking.tsx @@ -21,11 +21,11 @@ const FlightBooking = () => {
성인
- {adultCount} -
From d7a629059cce9b06805e2bb70658394a9c13f1dc Mon Sep 17 00:00:00 2001 From: 00kang Date: Mon, 23 Sep 2024 16:09:22 +0900 Subject: [PATCH 5/6] =?UTF-8?q?feat:=20aria-live=20=EC=86=8D=EC=84=B1=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a11y/src/components/FlightBooking.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a11y/src/components/FlightBooking.tsx b/a11y/src/components/FlightBooking.tsx index dcbcea6..fe0b874 100644 --- a/a11y/src/components/FlightBooking.tsx +++ b/a11y/src/components/FlightBooking.tsx @@ -24,7 +24,7 @@ const FlightBooking = () => { - {adultCount} + {adultCount} From c425278ce269f91aeaa413c1ace4bdd6625745ed Mon Sep 17 00:00:00 2001 From: 00kang Date: Mon, 23 Sep 2024 16:18:56 +0900 Subject: [PATCH 6/6] =?UTF-8?q?feat:=20=EC=B5=9C=EB=8C=80,=20=EC=B5=9C?= =?UTF-8?q?=EC=86=8C=20=EC=8A=B9=EA=B0=9D=20=EC=88=98=20=EB=8F=84=EB=8B=AC?= =?UTF-8?q?=20=EC=8B=9C=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a11y/src/components/FlightBooking.css | 14 +++++++++++++- a11y/src/components/FlightBooking.tsx | 25 +++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/a11y/src/components/FlightBooking.css b/a11y/src/components/FlightBooking.css index d9d6083..5235c41 100644 --- a/a11y/src/components/FlightBooking.css +++ b/a11y/src/components/FlightBooking.css @@ -34,7 +34,7 @@ width: 30px; height: 30px; border-radius: 16px; - border: 1px solid #C0C0C0; + border: 1px solid #c0c0c0; background-color: #fff; cursor: pointer; display: flex; @@ -61,3 +61,15 @@ 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 fe0b874..832fe33 100644 --- a/a11y/src/components/FlightBooking.tsx +++ b/a11y/src/components/FlightBooking.tsx @@ -2,17 +2,29 @@ import { useState } from "react"; import "./FlightBooking.css"; +const MIN_PASSENGERS = 1; const MAX_PASSENGERS = 3; const FlightBooking = () => { const [adultCount, setAdultCount] = useState(1); + const [statusMessage, setStatusMessage] = useState(""); const incrementCount = () => { + if (adultCount === MAX_PASSENGERS) { + setStatusMessage("최대 승객 수에 도달했습니다"); + return; + } + setAdultCount((prev) => Math.min(MAX_PASSENGERS, prev + 1)); }; const decrementCount = () => { - setAdultCount((prev) => Math.max(1, prev - 1)); + if (adultCount === MIN_PASSENGERS) { + setStatusMessage("최소 ${MIN_PASSENGERS}명의 승객이 필요합니다"); + return; + } + + setAdultCount((prev) => Math.max(MIN_PASSENGERS, prev - 1)); }; return ( @@ -24,12 +36,21 @@ const FlightBooking = () => { - {adultCount} + + {adultCount} +
+ + {statusMessage && ( +
+ {statusMessage} +
+ )} + );