fix(design-system): 공통 primitive의 키보드·보조기술 동작을 약속대로 맞춘다
공통 primitive가 디자인 시스템 설계 8.1·8.2절과 WCAG 2.2 AA 약속을 어긴다. - Popover가 이름 없는 role="dialog"를 그린다(1112/05-10). - Dialog 안의 Menu·Popover·Tooltip에서 Escape를 누르면 Dialog까지 닫힌다. Dialog가 안쪽이 처리한 Escape를 보지 않는다(05-11). - SearchField는 required 기호만, Checkbox는 상태만 있다(05-13). - Toast를 닫기 버튼으로 닫으면 포커스가 body로 떨어진다(05-14). - TextArea 글자 수가 <output>(암묵 status)이라 글자마다 발표되고 입력과 이어지지 않는다(05-17). - 라우트 h1의 :focus outline 제거가 layer 순서로 키보드 :focus-visible 표시까지 지운다(05-02). Tooltip이 pointer-events: none과 틈 때문에 포인터를 설명 위로 옮기면 사라진다(1.4.13, 05-06). - 홈 readiness 목록이 role 없는 div에 aria-label을 단다(05-15). - fe-a11y·fe-ux 스킬이 제출 실패 때 오류 요약으로 포커스가 간다고 적는다. 코드는 첫 오류 필드로 보낸다(05-09). 고른 방법: Popover는 trigger id로 이름을 받는다. Popover·Tooltip은 Escape를 capture 단계에서 받아 preventDefault하고, Dialog는 기본 동작이 막힌 Escape(과 그 뒤 cancel)를 넘긴다. Tooltip은 보일 때(hover·focus)만 Escape를 가진다. 숨은 tooltip이 다른 Dialog의 Escape를 막지 않게 하려는 것이다. Toast 닫기는 다음 toast의 닫기 버튼, 없으면 toast로 들어오기 전 요소로 포커스를 돌린다. TextArea 글자 수는 aria-describedby로 잇고 0에 닿을 때만 따로 발표한다. h1은 :focus:not(:focus-visible)만 outline을 지운다. Tooltip은 보일 때만 포인터를 받고 ::before 다리로 틈을 메운다. 버린 대안: Dialog가 안쪽 layer 목록을 들고 Escape를 나누기(primitive끼리 묶인다). 위험·한계: native <dialog>가 막힌 keydown 뒤에도 cancel을 쏘는지는 브라우저마다 다를 수 있어, Dialog는 같은 task의 cancel 하나를 넘긴다. Toast가 돌려줄 요소가 지워졌으면 포커스를 옮기지 않는다. 시각 골든이 바뀌는지는 desktop test:visual로 본다. 검증: 새 component 시험(tests/component/design-system-a11y.test.tsx, starter-pages), e2e(app-shell focus ring, 세 엔진), storybook(tooltip hover)의 RED·GREEN은 desktop에서 돌려 PR 본문에 적는다. Refs: 1112/05-02, 1112/05-06, 1112/05-09, 1112/05-10, 1112/05-11, 1112/05-13, 1112/05-14, 1112/05-15, 1112/05-17
This commit is contained in:
@@ -516,9 +516,21 @@
|
||||
transition: opacity var(--duration-fast) var(--easing-standard);
|
||||
}
|
||||
|
||||
/* 1112/05-06. WCAG 1.4.13 hoverable: a shown tooltip takes the pointer,
|
||||
and the bridge below it covers the gap to the trigger, so moving onto it
|
||||
keeps .ui-tooltip hovered. A hidden one stays out of the pointer's way. */
|
||||
.ui-tooltip__content::before {
|
||||
position: absolute;
|
||||
inset-inline: 0;
|
||||
inset-block-start: 100%;
|
||||
block-size: var(--space-2);
|
||||
content: "";
|
||||
}
|
||||
|
||||
.ui-tooltip:focus-within .ui-tooltip__content,
|
||||
.ui-tooltip:hover .ui-tooltip__content {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.ui-progress,
|
||||
|
||||
Reference in New Issue
Block a user