Checkbox/CheckboxGroup invalid 상태 텍스트 색상 수정 및 tone 정책 반영#962
Checkbox/CheckboxGroup invalid 상태 텍스트 색상 수정 및 tone 정책 반영#962
Conversation
|
ab11b3a to
7746389
Compare
|
#962 (comment) 관련해서는 AI 스터디에 이슈 제보했습니다. DaleStudy/github#24 |
| </label> | ||
| <div className={checkboxGroupStyles({ orientation })}>{children}</div> | ||
| {invalid && helperText && ( | ||
| <div className={helperTextStyles} role="alert"> |
There was a problem hiding this comment.
<RadioGroup/>에서는 helperText가 있을 때 aria-describedby로 에러 메시지를 연결합니다. 이 연결이 빠지면 스크린 리더가 에러 메시지를 체크박스 그룹과 자동으로 연관짓지 못합니다. role="alert"만으로는 메시지가 "어떤 필드"의 에러인지 전달되지 않습니다.
daleui/src/components/RadioGroup/RadioGroup.tsx
Lines 79 to 93 in 4eabb97
| @@ -1,12 +1,15 @@ | |||
| import { type ReactNode, createContext, useContext, useState } from "react"; | |||
| import { CircleAlert } from "lucide-react"; | |||
There was a problem hiding this comment.
lucide-react에서 CircleAlert을 직접 import하고, 크기를 CSS로 직접 지정하고 있습니다. 디자인 시스템 내 일괄적인 아이콘 사용 일관성을 위해 Icon 컴포넌트를 사용하는 것이 좋겠습니다.
| )} | ||
| </label> | ||
| <div className={checkboxGroupStyles({ orientation })}>{children}</div> | ||
| {invalid && helperText && ( |
There was a problem hiding this comment.
<RadioGroup/>는 helperText만 있으면 invalid 여부와 무관하게 항상 노출합니다. 두 컴포넌트의 동작이 다르면 혼란스러운 사용자 경험이 될 것 같습니다.
daleui/src/components/RadioGroup/RadioGroup.tsx
Lines 125 to 134 in 4eabb97
| @@ -1,5 +1,5 @@ | |||
| import { render, screen } from "@testing-library/react"; | |||
| import { userEvent } from "@testing-library/user-event"; | |||
| import userEvent from "@testing-library/user-event"; | |||
There was a problem hiding this comment.
named import에서 default import로 변경하신 이유가 있으신가요?
| tone: "brand", | ||
| invalid: false, | ||
| required: false, | ||
| helperText: undefined, |
There was a problem hiding this comment.
optional prop의 기본값은 이미 undefined이므로 명시할 필요가 없습니다. Storybook Controls 패널에서 보이게 하려는 의도라면 argTypes에서 control을 지정하는 게 더 명확합니다.
변경사항
테스팅
helperText로 에러 메시지 노출체크 리스트