Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/shared/ui/form-control/FormControlLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type { FormControlLabelProps } from './FormControl.types';
* ### 접근성
*
* 필수 표시 `*`는 장식 요소이므로 스크린 리더에서 제외합니다. 실제 필수 상태는 Root와
* 연결된 Field의 네이티브 `required` 및 `aria-required` 속성으로 전달합니다.
* 연결된 Field의 네이티브 `required` 속성으로 전달합니다.
*
* @param children - 입력 요소의 목적을 설명하는 Label 문구
* @param className - 공통 Label 스타일을 확장하는 클래스 이름
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/input/Input.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ interface InputFieldGroupProps extends ComponentPropsWithoutRef<'div'> {
*/
interface InputFieldProps extends Omit<
ComponentPropsWithRef<'input'>,
'aria-errormessage' | 'aria-invalid' | 'disabled' | 'id' | 'readOnly' | 'required' | 'type'
'aria-errormessage' | 'aria-invalid' | 'disabled' | 'id' | 'required' | 'type'
> {
type?: InputType;
}
Expand Down
4 changes: 2 additions & 2 deletions src/shared/ui/input/InputErrorMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import type { InputErrorMessageProps } from './Input.types';
*
* ### 접근성
*
* `role="alert"`로 오류를 알리고 Field의 `aria-describedby` 및 `aria-errormessage`와
* 자동으로 연결합니다. 사용자가 수정할 수 있는 구체적인 메시지를 전달합니다.
* `role="alert"`로 오류를 알리고 Field의 `aria-errormessage`와 자동으로 연결합니다.
* 사용자가 수정할 수 있는 구체적인 메시지를 전달합니다.
*
* @param children - 유효성 검증 오류 메시지
* @param className - ErrorMessage의 기본 스타일을 확장하는 클래스 이름
Expand Down
1 change: 0 additions & 1 deletion src/shared/ui/input/InputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export function InputField({ className, ref, type = 'text', ...props }: InputFie
{...props}
aria-errormessage={ariaErrorMessageId}
aria-invalid={invalid || undefined}
aria-required={required || undefined}
className={cn(
'h-16.75',
fieldBaseClassName,
Expand Down
4 changes: 2 additions & 2 deletions src/shared/ui/input/InputLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import type { InputLabelProps } from './Input.types';
*
* ### 접근성
*
* 필수 표시 `*`는 장식 요소로 숨기고 실제 필수 상태는 Field의 네이티브 `required`
* `aria-required`로 전달합니다.
* 필수 표시 `*`는 장식 요소로 숨기고 실제 필수 상태는 Field의 네이티브 `required`
* 전달합니다.
*
* @param children - Field의 목적을 설명하는 Label 문구
* @param className - Label의 기본 스타일을 확장하는 클래스 이름
Expand Down
8 changes: 4 additions & 4 deletions src/shared/ui/textarea/TextArea.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ type TextAreaLengthProps =
type TextAreaFieldProps = TextAreaFieldBaseProps & TextAreaLengthProps;

/** Label은 Root가 제공하는 id와 required 상태를 상속합니다. */
type TextAreaLabelProps = Omit<ComponentPropsWithoutRef<'label'>, 'htmlFor'> & {
interface TextAreaLabelProps extends Omit<ComponentPropsWithoutRef<'label'>, 'htmlFor'> {
children: ReactNode;
};
}

/** Root가 invalid일 때 유효성 검증 오류를 표시하는 문구입니다. */
type TextAreaErrorMessageProps = Omit<ComponentPropsWithoutRef<'p'>, 'id'> & {
interface TextAreaErrorMessageProps extends Omit<ComponentPropsWithoutRef<'p'>, 'id'> {
children?: ReactNode;
};
}

export type { TextAreaErrorMessageProps, TextAreaFieldProps, TextAreaLabelProps, TextAreaProps };
4 changes: 1 addition & 3 deletions src/shared/ui/textarea/TextAreaField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export function TextAreaField({
const isControlled = value !== undefined;
const currentLength = isControlled ? getValueLength(value) : uncontrolledLength;
const countId = `${fieldId}-character-count`;
const describedBy = showCount ? countId : undefined;
const ariaErrorMessageId = invalid && hasErrorMessage ? errorMessageId : undefined;
const hasReachedMaxLength = maxLength !== undefined && currentLength >= maxLength;
const hasExceededRecommendedLength =
Expand Down Expand Up @@ -76,10 +75,9 @@ export function TextAreaField({
<div className="relative w-full">
<textarea
{...props}
aria-describedby={describedBy}
aria-describedby={showCount ? countId : undefined}
aria-errormessage={ariaErrorMessageId}
aria-invalid={invalid || undefined}
aria-required={required || undefined}
className={cn(
'textarea-scrollbar block min-h-81.75 resize-y py-5',
showCount ? 'pb-12' : undefined,
Expand Down
Loading