@iyulab/modern-app 0.32.0 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.33.0] - 2026-09-30
4
+
5
+ ### Added
6
+
7
+ - **«Skip to main content» link in the sidebar layout** — the shell's first Tab stop, shown only while
8
+ it has focus (`part="skip-link"`). Activating it moves focus the way a finished route does: to the
9
+ screen's `[autofocus]` element, else to the route area. A keyboard user no longer tabs through the
10
+ whole menu on every screen (WCAG 2.4.1 Bypass Blocks). The text is the new `skipToContent` key of
11
+ `modernAppLocale` (English and Korean built in).
12
+
13
+ ### Changed
14
+
15
+ - **The route area (`part="main"`) is a `<main>` element**, so screen readers list it as the main
16
+ landmark. It was a `<div>`. Styling through `::part(main)` and `layout.styles` is unchanged. If your
17
+ route screens render their own `<main>`, change it to a `<div>` or `<section>` — a page should have
18
+ one main landmark.
19
+
3
20
  ## [0.32.0] - 2026-09-28
4
21
 
5
22
  ### Changed
package/README.md CHANGED
@@ -276,6 +276,7 @@ conformance claim for the success criteria it does not list.
276
276
  |---|---|---|
277
277
  | SC 2.5.8 Target Size (Minimum) | Every pointer target this package renders itself — sidebar links, buttons and group headers (expanded and compact), the sidebar logo and toggle, wizard steps, the page header's back link — is at least 24×24 CSS px or meets the spacing exception (24px between centers), and is actually hit at that position | `tests/browser/target-size.browser.test.ts` (real Chromium) |
278
278
  | SC 2.1.1 Keyboard (pointer-cursor check) | Nothing this package renders shows a pointer cursor without being an interactive element — the sidebar logo is a link | `tests/browser/target-size.browser.test.ts` |
279
+ | SC 2.4.1 Bypass Blocks | The sidebar layout's first Tab stop is a «Skip to main content» link, visible when focused and at least 24px tall; it moves focus to the screen's `[autofocus]` element or to the route area, which is the page's single `<main>` landmark | `tests/browser/sidebar-layout-skip-link.browser.test.ts` |
279
280
 
280
281
  Buttons placed through slots or rendered as `u-button` without size overrides (wizard back/next, the
281
282
  master-detail close button) follow `@iyulab/components`, which measures them in its own gate. Color
@@ -13,6 +13,8 @@ export interface ModernAppLocaleStrings {
13
13
  toggleMobileMenu: string;
14
14
  /** Sidebar layout — accessible label for the sidebar-header collapse/expand toggle button. */
15
15
  toggleSidebar: string;
16
+ /** Sidebar layout — the «skip to main content» link, the first Tab stop of the shell. */
17
+ skipToContent: string;
16
18
  /** Wizard — default Back/Next action labels ("Submit" wording is the consumer's call). */
17
19
  wizardBack: string;
18
20
  wizardNext: string;
@@ -9,6 +9,7 @@ var t = {
9
9
  detailClose: "Close",
10
10
  toggleMobileMenu: "Toggle menu",
11
11
  toggleSidebar: "Toggle sidebar",
12
+ skipToContent: "Skip to main content",
12
13
  wizardBack: "Back",
13
14
  wizardNext: "Next",
14
15
  wizardStepAnnouncement: "Step {index} of {total}: {label}"
@@ -22,6 +23,7 @@ n.register("en", t), n.register("ko", {
22
23
  detailClose: "닫기",
23
24
  toggleMobileMenu: "메뉴 열고 닫기",
24
25
  toggleSidebar: "사이드바 열고 닫기",
26
+ skipToContent: "본문으로 건너뛰기",
25
27
  wizardBack: "이전",
26
28
  wizardNext: "다음",
27
29
  wizardStepAnnouncement: "{total}단계 중 {index}단계: {label}"
@@ -53,6 +55,7 @@ function l(e) {
53
55
  detailClose: t("detailClose"),
54
56
  toggleMobileMenu: t("toggleMobileMenu"),
55
57
  toggleSidebar: t("toggleSidebar"),
58
+ skipToContent: t("skipToContent"),
56
59
  wizardBack: t("wizardBack"),
57
60
  wizardNext: t("wizardNext"),
58
61
  wizardStepAnnouncement: (t, n, r) => {
@@ -111,6 +111,10 @@ export declare class SidebarLayout extends StyledElement<SidebarParts> {
111
111
  * 그리기 전에 올 수 있고, 그때 찾으면 `[autofocus]` 가 아직 없다.
112
112
  */
113
113
  private focusRoute;
114
+ /** 본문의 시작으로 포커스 — 화면이 선언한 `[autofocus]`, 없으면 본문(`main`) 자체. */
115
+ private focusContentStart;
116
+ /** «본문 바로가기» — 라우트 완료와 같은 규칙으로 본문의 시작에 포커스를 둔다(`#517`). */
117
+ private handleSkipLinkClick;
114
118
  /** 라우트 에러 핸들러 */
115
119
  private handleRouteError;
116
120
  private handleOverlaySlotChange;
@@ -74,6 +74,10 @@ var j = class extends i {
74
74
  }, 300);
75
75
  let t = this.shadowRoot?.querySelector(".main");
76
76
  t && (this.config?.scrollBehavior?.(e.context, t), this.focusRoute(t));
77
+ }, this.handleSkipLinkClick = (e) => {
78
+ e.preventDefault();
79
+ let t = this.shadowRoot?.querySelector(".main");
80
+ t && this.focusContentStart(this.hasOverlay ? [] : this.routeContent(), t);
77
81
  }, this.handleRouteError = (e) => {
78
82
  this.progressBarEl.status = "error", this.progressBarEl.value = 100, setTimeout(() => {
79
83
  this.progressBarEl.removeAttribute("visible"), this.progressBarEl.status = "default";
@@ -156,6 +160,11 @@ var j = class extends i {
156
160
  }
157
161
  render() {
158
162
  return this.config ? l`
163
+ <!-- 반복 영역 건너뛰기(WCAG 2.4.1) — 셸의 첫 Tab. 포커스될 때만 보인다. -->
164
+ <a class="skip-link" part="skip-link" href="#" @click=${this.handleSkipLinkClick}>
165
+ ${a(this.locale || void 0).skipToContent}
166
+ </a>
167
+
159
168
  <!-- Mobile Header -->
160
169
  <div class="mobile-header" part="mobile-header" ?hidden="${!this.state.startsWith("mobile")}">
161
170
  ${this.renderLogo()}
@@ -204,7 +213,7 @@ var j = class extends i {
204
213
 
205
214
  <!-- Main Content -->
206
215
  <div class="main-region">
207
- <div class="main" part="main" scrollable tabindex="-1" @keydown=${this._handleMainKeydown}>
216
+ <main class="main" part="main" scrollable tabindex="-1" @keydown=${this._handleMainKeydown}>
208
217
  <u-progress-bar part="progress"></u-progress-bar>
209
218
 
210
219
  <div class="main-content" part="main-content" ?inert=${this.hasOverlay}>
@@ -215,7 +224,7 @@ var j = class extends i {
215
224
  </div>
216
225
  <slot></slot>
217
226
  </div>
218
- </div>
227
+ </main>
219
228
 
220
229
  <div class="overlay ${this.hasOverlay ? "" : "empty"}" part="overlay">
221
230
  <u-button class="overlay-close" part="overlay-close" variant="ghost"
@@ -341,11 +350,13 @@ var j = class extends i {
341
350
  let t = this.routeContent();
342
351
  if (await Promise.all(t.map((e) => e.updateComplete)), this.hasOverlay || !e.isConnected) return;
343
352
  let n = k();
344
- if (n && t.some((e) => A(e, n))) return;
345
- let r = b(t, "[autofocus]", y);
346
- r?.focus();
347
- let i = k();
348
- r && i && A(r, i) || e.focus({ preventScroll: !0 });
353
+ n && t.some((e) => A(e, n)) || this.focusContentStart(t, e);
354
+ }
355
+ focusContentStart(e, t) {
356
+ let n = b(e, "[autofocus]", y);
357
+ n?.focus();
358
+ let r = k();
359
+ n && r && A(n, r) || t.focus({ preventScroll: !0 });
349
360
  }
350
361
  overlayPanels() {
351
362
  return (this.shadowRoot?.querySelector("slot[name=\"overlay\"]"))?.assignedElements({ flatten: !0 }) ?? [];
@@ -72,6 +72,35 @@ var t = e`
72
72
  color: var(--u-txt-color-hover, #1565C0);
73
73
  }
74
74
 
75
+ /* 본문 바로가기 — 포커스될 때만 보인다(보이지 않을 때는 자리도 차지하지 않는다). */
76
+ .skip-link {
77
+ position: absolute;
78
+ top: 8px;
79
+ left: 8px;
80
+ z-index: calc(var(--u-layer-shell, 1000) + 2);
81
+ width: 1px;
82
+ height: 1px;
83
+ overflow: hidden;
84
+ clip-path: inset(50%);
85
+ white-space: nowrap;
86
+ }
87
+ .skip-link:focus {
88
+ width: auto;
89
+ height: auto;
90
+ min-height: 24px;
91
+ overflow: visible;
92
+ clip-path: none;
93
+ display: inline-flex;
94
+ align-items: center;
95
+ padding: 6px 12px;
96
+ border-radius: var(--u-radius-md, 4px);
97
+ background: var(--u-bg-color, #FFFFFF);
98
+ color: var(--u-txt-color, #212121);
99
+ box-shadow: 0 0 0 2px var(--u-primary-color, #1976D2);
100
+ text-decoration: none;
101
+ outline: none;
102
+ }
103
+
75
104
  /* Sidebar Container */
76
105
  .sidebar {
77
106
  position: relative;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iyulab/modern-app",
3
3
  "description": "web-framework by iyulab based on lit-element",
4
- "version": "0.32.0",
4
+ "version": "0.33.0",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "web-framework",
@@ -257,6 +257,7 @@ Parts available for `styles` overrides on the root layout:
257
257
  | Part | Element |
258
258
  |------|---------|
259
259
  | `host` | Outer layout shell |
260
+ | `skip-link` | «Skip to main content» link — the shell's first Tab stop, shown only while focused |
260
261
  | `mobile-header` | Top bar shown on mobile |
261
262
  | `sidebar` | Sidebar panel |
262
263
  | `sidebar-header` | Logo + title area |
@@ -333,6 +334,15 @@ told apart in CSS; notices are rare and short-lived.
333
334
  While the overlay is open, `part="main-content"` becomes a box at the area's height, because a
334
335
  stacking context needs one — route content is inert and under the overlay then.
335
336
 
337
+ ### Skip link and main landmark
338
+
339
+ The route area is a `<main>` landmark (`part="main"`), so a screen reader can jump to it. The shell's
340
+ first Tab stop is a **«Skip to main content»** link (`part="skip-link"`, localized — `skipToContent` in
341
+ `modernAppLocale`), visible only while it has focus. Activating it moves focus by the same rule as a
342
+ finished route (steps 2 and 3 below): your screen's `[autofocus]` element, else `main` itself — so a
343
+ keyboard user does not tab through the whole menu on every screen (WCAG 2.4.1 Bypass Blocks). Do not put
344
+ another `<main>` in your route screens; the shell already provides it.
345
+
336
346
  ### Focus when a route finishes
337
347
 
338
348
  On every `route-done` the shell places focus so the keyboard works on the new screen without a