@iyulab/components 2.39.1 → 3.1.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.
Files changed (84) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/README.md +18 -0
  3. package/dist/components/UElement.d.ts +18 -0
  4. package/dist/components/UElement.js +18 -0
  5. package/dist/components/UFloatingElement.styles.js +1 -0
  6. package/dist/components/UFormControlElement.d.ts +1 -2
  7. package/dist/components/UFormControlElement.js +2 -24
  8. package/dist/components/alert/UAlert.d.ts +3 -3
  9. package/dist/components/alert/UAlert.js +2 -2
  10. package/dist/components/alert/UAlert.styles.js +20 -18
  11. package/dist/components/badge/UBadge.styles.js +4 -3
  12. package/dist/components/breadcrumb/UBreadcrumb.js +1 -0
  13. package/dist/components/breadcrumb/UBreadcrumb.styles.js +6 -0
  14. package/dist/components/breadcrumb-item/UBreadcrumbItem.d.ts +2 -0
  15. package/dist/components/breadcrumb-item/UBreadcrumbItem.js +8 -1
  16. package/dist/components/breadcrumb-item/UBreadcrumbItem.styles.js +2 -2
  17. package/dist/components/button/UButton.d.ts +1 -1
  18. package/dist/components/button/UButton.js +3 -17
  19. package/dist/components/button/UButton.styles.js +6 -8
  20. package/dist/components/calendar/UCalendar.js +3 -2
  21. package/dist/components/calendar/UCalendar.styles.js +4 -0
  22. package/dist/components/calendar/picker.styles.js +3 -16
  23. package/dist/components/card/UCard.d.ts +1 -0
  24. package/dist/components/card/UCard.js +3 -0
  25. package/dist/components/carousel/UCarousel.js +2 -4
  26. package/dist/components/carousel/UCarousel.styles.js +8 -5
  27. package/dist/components/command-palette/UCommandPalette.styles.js +2 -6
  28. package/dist/components/divider/UDivider.styles.js +3 -3
  29. package/dist/components/drawer/UDrawer.styles.js +2 -0
  30. package/dist/components/expander/UExpander.styles.js +6 -0
  31. package/dist/components/field/UField.styles.js +1 -1
  32. package/dist/components/file-input/UFileInput.styles.js +3 -4
  33. package/dist/components/icon-button/UIconButton.d.ts +1 -2
  34. package/dist/components/icon-button/UIconButton.js +2 -13
  35. package/dist/components/input/UInput.styles.js +9 -8
  36. package/dist/components/menu/UMenu.js +2 -2
  37. package/dist/components/menu-item/UMenuItem.js +1 -1
  38. package/dist/components/menu-item/UMenuItem.styles.js +19 -9
  39. package/dist/components/option/UOption.styles.js +10 -8
  40. package/dist/components/pagination/UPagination.styles.js +6 -0
  41. package/dist/components/popover/UPopover.d.ts +7 -0
  42. package/dist/components/popover/UPopover.js +25 -0
  43. package/dist/components/progress-bar/UProgressBar.styles.js +15 -8
  44. package/dist/components/radio/URadio.js +3 -3
  45. package/dist/components/radio/URadio.styles.js +11 -4
  46. package/dist/components/rating/URating.js +7 -2
  47. package/dist/components/rating/URating.styles.js +1 -1
  48. package/dist/components/select/USelect.d.ts +15 -15
  49. package/dist/components/select/USelect.js +7 -9
  50. package/dist/components/select/USelect.styles.js +17 -8
  51. package/dist/components/skeleton/USkeleton.styles.js +1 -2
  52. package/dist/components/slider/USlider.js +11 -6
  53. package/dist/components/slider/USlider.styles.js +7 -5
  54. package/dist/components/split-panel/USplitPanel.d.ts +2 -0
  55. package/dist/components/split-panel/USplitPanel.js +13 -5
  56. package/dist/components/split-panel/USplitPanel.styles.js +4 -1
  57. package/dist/components/steps/USteps.styles.js +3 -4
  58. package/dist/components/switch/USwitch.styles.js +7 -4
  59. package/dist/components/tab/UTab.styles.js +5 -5
  60. package/dist/components/tab-nav/UTabNav.styles.js +1 -2
  61. package/dist/components/tab-panel/UTabPanel.js +2 -2
  62. package/dist/components/tab-panel/UTabPanel.styles.js +4 -4
  63. package/dist/components/tag/UTag.styles.js +4 -4
  64. package/dist/components/textarea/UTextarea.styles.js +3 -3
  65. package/dist/components/tree/UTree.js +2 -2
  66. package/dist/components/tree-item/UTreeItem.js +1 -1
  67. package/dist/components/tree-item/UTreeItem.styles.js +20 -13
  68. package/dist/index.d.ts +1 -0
  69. package/dist/index.js +2 -1
  70. package/dist/react/USelect.d.ts +3 -3
  71. package/dist/react/USelect.js +1 -1
  72. package/dist/utilities/Toast.js +1 -0
  73. package/dist/utilities/collation.d.ts +11 -0
  74. package/dist/utilities/collation.js +52 -0
  75. package/package.json +4 -3
  76. package/skills/iyulab-components/SKILL.md +5 -1
  77. package/skills/iyulab-components/references/components/alert.md +8 -7
  78. package/skills/iyulab-components/references/components/breadcrumb.md +1 -1
  79. package/skills/iyulab-components/references/components/input.md +7 -2
  80. package/skills/iyulab-components/references/components/popover.md +3 -0
  81. package/skills/iyulab-components/references/components/select.md +3 -3
  82. package/skills/iyulab-components/references/components/split-panel.md +1 -1
  83. package/skills/iyulab-components/references/usage.md +16 -0
  84. package/skills/iyulab-components/references/utilities/locale.md +14 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,144 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.1.0] - 2026-11-12
4
+
5
+ ### Added
6
+
7
+ - **`compareText(a, b, locale?)` and `getCollator(locale?)` — one text order for tables and lists.** Digit runs
8
+ inside text compare as numbers (`A-2` before `A-10`, `9` before `10`), case and accents compare as the same letter (equal
9
+ rows keep their input order), and the locale is the app's `Locale.get()` (`<html lang>`, then the browser language, then
10
+ `en`) — not the browser default, so one app orders Hangul and Latin the same way for every user (`Locale.set('ko')` puts
11
+ Hangul first). One `Intl.Collator` is built per locale and reused; a malformed locale tag compares as English instead of
12
+ throwing. The table packages use it for their text columns.
13
+
14
+ ### Fixed
15
+
16
+ - **`u-radio` no longer passes its own host as the `setValidity` anchor.** `ElementInternals.setValidity(flags,
17
+ message, anchor)` requires the anchor to be a shadow-including descendant of the element; the host is not one. Older
18
+ Chromium (the 120 generation) threw `NotFoundError` on every selection, and because the exception interrupted
19
+ validation before the event was dispatched, `change` never fired while `value` had already changed. The anchor is
20
+ now the radiogroup container, like every other form control. Current browsers accept the host, so they were not
21
+ affected.
22
+
23
+ ### Documentation
24
+
25
+ - The README now states the browser floor: browsers that support `:state()` without the `--` prefix (Chrome and
26
+ Edge 125, Firefox 126, Safari 17.4). Below it, form controls throw on `states.add()` and styling that keys on
27
+ states does not apply. The skill overview carries the same line.
28
+
29
+ ## [3.0.0] - 2026-11-11
30
+
31
+ ### Changed (BREAKING — 3.0)
32
+
33
+ - **`u-select` announces its filter text as `query-change`, not `search`.** `search` now means one thing across the
34
+ library — «a search was committed» (`u-input type="search"`: Enter, the clear button, Escape). `u-select searchable`
35
+ used to bubble the same name on every keystroke, so anything outside that listened for `search` (a list page, a
36
+ table toolbar) read an option query as a list search. The event is now `query-change` with `detail: { query }`,
37
+ and the type is `USelectQueryChangeDetail` (was `USelectSearchDetail`). React: `onQueryChange` (was `onSearch`).
38
+ **Migrate:** `select.addEventListener('search', …)` → `'query-change'`; on a remote-search select, listen for
39
+ `query-change`. A listener on an element that wraps a `u-select` and hears `search` no longer receives the select's
40
+ query — that is the point; remove any guard that filtered it out.
41
+ - **`query-change` is not fired while an IME composition is in progress.** The old `search` fired on every
42
+ composition step with `detail.composing: true` and once more with `false` when it ended. Now the event fires once,
43
+ with the finished text, when the composition ends; `detail.composing` is gone (it would always be `false`). A
44
+ server search no longer has to skip half-composed syllables (`ㅅ`, `성` on the way to `서울`). The built-in
45
+ filter is unchanged — it still narrows on the committed part while you compose.
46
+ - **`u-alert` sits in the page flow by default; `floating` is the toast look.** Before, the default was the floating
47
+ look (content width, large shadow, scale transition, keeps its place while closed) and the page-flow form was
48
+ `inline`. Now the default fills its container, has no shadow or transition and takes no space while closed, and
49
+ `floating` gives the toast look. `Toast` sets `floating` itself. **Migrate:** delete `inline` (the attribute no longer
50
+ does anything); add `floating` where you relied on the old default look. An alert you opened in a flow without
51
+ `inline` now fills the width and loses its shadow — that is the new default.
52
+
53
+ #### Finding what to migrate
54
+
55
+ TypeScript reports these when you upgrade: importing `USelectSearchDetail`, `onSearch` on the React `USelect`,
56
+ reading `detail.composing`, and setting the `inline` property (`alert.inline = …`, `inline` on the React `UAlert`).
57
+
58
+ It cannot report these, so search your sources for them:
59
+
60
+ - a `search` listener on a `u-select` (or on an element around one) — the string overload accepts any event name, and a
61
+ listener cast to `EventListener` hides the detail type: `rg -n "addEventListener\(['\"]search"` and
62
+ `rg -n "@search="`;
63
+ - a `u-alert` in markup that relied on the old floating look — markup attributes have no types:
64
+ `rg -nP '<u-alert(?![^>]*\bfloating\b)'`, then add `floating` where the toast look was meant. A leftover `inline`
65
+ attribute is harmless (the new default is the old `inline`).
66
+
67
+ ### Added
68
+
69
+ - **`UElement.forwardedAttributes`** — a component that copies a host attribute (usually `aria-*`) onto an inner element declares it
70
+ once: `static forwardedAttributes = ['aria-label']`. The attribute is then observed and a change re-renders, which a declared
71
+ property would give but these attributes are not. `u-button`, `u-icon-button` and the form controls moved onto it from their
72
+ own copies of the same override; behaviour is unchanged.
73
+
74
+ ### Changed
75
+
76
+ - **Layout mirrors under `dir="rtl"`: margins, inner padding, borders and text alignment are logical properties.** `margin-left/right`,
77
+ `padding-left/right`, `border-left/right` and `text-align: left/right` in the published styles of 13 components (`u-badge`, `u-button`,
78
+ `u-breadcrumb-item`, `u-divider`, `u-field`, `u-input`, `u-menu-item`, `u-option`, `u-select`, `u-tab`, `u-textarea`, `u-tree-item`, and the
79
+ date picker's field) became `margin-inline-start/end` and so on, so the prefix and suffix slots, indentation and the counter side swap in a
80
+ right-to-left document. **Left-to-right rendering is unchanged.** What names a physical side on purpose stays physical: `u-drawer
81
+ placement`, `u-tab-panel placement` and the device safe-area insets. Not yet mirrored, outside this package: the virtualized
82
+ grid and the timeline. `u-switch` (the thumb and its travel), the indeterminate bar of `u-progress-bar`, `u-carousel` (the first slide at the start
83
+ side, the track and the previous/next buttons and their chevrons, and a drag toward the start side goes on), `u-slider` and `u-rating` mirror too:
84
+ the value grows from the start side, a pointer position and the arrow keys follow it (in a right-to-left page the left arrow raises
85
+ the value, as in a native range input), and a half-filled star is filled from its start edge. `u-split-panel` follows the pointer in a right-to-left page too: the first pane
86
+ sits at the right, so dragging right shrinks it and the handle (and the `lazy` preview bar) stays under the pointer — before, the handle ran
87
+ away from it (a drag of 40px moved it 40px the other way). A consumer rule that overrode
88
+ one of these with a physical property (`::part(prefix) { margin-right: 0 }`) still applies in left-to-right text; write the logical
89
+ property to cover both directions. A vertical `u-divider` with `line="dashed"` or `"dotted"` now draws that style in a right-to-left
90
+ page too (its width sat on the start border but the style on the left one, so it came out solid). The chevrons the components draw themselves mirror
91
+ as well, so "previous" and "expand" point the way the page reads: the `u-breadcrumb` separator, the previous/next buttons of `u-pagination` and
92
+ `u-calendar`, the closed marker of `u-expander` (it turns from pointing at the start side to pointing down), the submenu marker of `u-menu-item` and
93
+ the closed marker of `u-tree-item`. A chevron you pass in yourself (a `separator` or `expand-icon` slot) is left as you drew it. The outer
94
+ corners of a button-style `u-radio` group and the divider between its cells sit on the start and end sides too (the first cell is rounded on
95
+ the start side, the dividers are drawn on each cell's end side), so the group reads as one piece in a right-to-left page. The buttons at the
96
+ end of a field (the clear button of `u-input`, `u-select` and `u-file-input`, the calendar button of the date pickers) and the vertical
97
+ connector of a folded `u-steps` and the toggle of `u-tree-item` use start/end margins as well: the clear button of `u-input` sat 10px
98
+ further from the end of the field in a right-to-left page than in a left-to-right one. The fill and the buffer of a determinate
99
+ `u-progress-bar` grow from the start side too (a bar at 40% was filled from the left in a right-to-left page).
100
+ The horizontal arrow keys follow the screen in a right-to-left page, as in a native radio group: in `u-tab-panel` (horizontal tabs),
101
+ `u-radio` and `u-calendar` the left arrow now goes to the next tab, option or day (the right arrow to the previous one), and in
102
+ `u-tree` and `u-menu` the arrow toward the end side (the left one) opens a branch while the one toward the start side closes it
103
+ or goes to the parent. A sub-menu of `u-menu-item` opens toward the end side. Vertical keys and left-to-right pages are unchanged.
104
+ - **`u-menu-item` states its text alignment in logical terms.** The reflected `align` attribute is also HTML's legacy alignment attribute,
105
+ which the browser turns into a physical `text-align` on the host (`align="left"` on a menu item left-aligned its text even in a
106
+ right-to-left page). `left` now means the start side and `right` the end side; `center` is unchanged.
107
+
108
+ ### Fixed
109
+
110
+ - **A host `aria-label` on a link-like component reaches its inner link, and follows a change.** The host's `aria-label` does not
111
+ cross the shadow boundary, so a component has to copy it onto the `<a>`/`<button>` that takes focus — and because the attribute
112
+ is not a declared property, a change after the element is connected never re-rendered. `u-card href` took the name only
113
+ at the first render (a later `setAttribute('aria-label', …)` left the link with the old name or none), and `u-breadcrumb-item href`
114
+ never copied it, so its link was named by its text only. Both now carry the host's name and track it, as `u-button` does.
115
+
116
+ - **`u-select multiple searchable` shows its whole placeholder.** With no chips the placeholder and the search input shared
117
+ the row's width half and half, so a placeholder that fit the control was cut to «…» at half its width. While no chip stands
118
+ the input now lies over the placeholder (as the single-value select already did) and the placeholder keeps the full width;
119
+ typing hides it in place, so the row does not collapse. With chips the layout is unchanged.
120
+
121
+ - **`u-popover trigger="contextmenu"` opens from the keyboard in Safari.** The menu key and Shift+F10 on the anchor
122
+ open it at the focused element. Chromium and Firefox turn those keys into a `contextmenu` event themselves; Safari does
123
+ not, so a popover opened by right-click had no keyboard way to it there. The popover now takes the key (and ignores the
124
+ `contextmenu` Chromium still fires when the menu key is released, so it opens once).
125
+ - **Labels that do not fit wrap instead of ending in «…».** `u-button`, `u-tag`, `u-option`, `u-menu-item`,
126
+ `u-tree-item`, the `u-command-palette` item name and description, the `u-file-input` file name, the `u-steps`
127
+ compact summary and the `u-carousel` page labels were one line with an ellipsis and no tooltip or title, so in a
128
+ narrow place — a long translated label, 200% text, user text-spacing — the tail was cut and could not be read
129
+ anywhere. A label that fits is unchanged; one that does not fit now wraps. `u-button` and `u-tag` break only between
130
+ words, like a native `<button>`, so they do not shrink below their longest word. The `u-select` field keeps its single
131
+ line: the open list now shows a long option in full (it wraps inside the list).
132
+
133
+ ### Documentation
134
+
135
+ - The component skill's usage reference now teaches `--u-target-size` (a floor for everything that is pressed, with the
136
+ `@media (pointer: coarse)` snippet) — it was only in `docs/theming.md`, so a consumer reading the skill wrote
137
+ `::part()` rules per component instead.
138
+
139
+ - `u-input`: a sign-in form example with `autocomplete="username"` / `"current-password"`, and a note that the browser's
140
+ password manager saves and fills `u-input` fields inside a `<form>` like native ones.
141
+
3
142
  ## [2.39.1] - 2026-10-31
4
143
 
5
144
  ### Fixed
package/README.md CHANGED
@@ -10,6 +10,13 @@ Lit 기반 웹 컴포넌트 라이브러리.
10
10
  npm install @iyulab/components
11
11
  ```
12
12
 
13
+ ## Browser support
14
+
15
+ 지원 하한은 **`CustomStateSet` 의 `:state()` 를 `--` 접두 없이 지원하는 판**입니다 — Chrome · Edge 125, Firefox 126,
16
+ Safari 17.4 이상. 폼 컨트롤은 `:state(field)` 같은 상태를 `ElementInternals.states` 에 싣고 시트가 그 선택자로 모양을
17
+ 정하므로, 그 아래 판(예: Chromium 120)에서는 `states.add('field')` 가 `--` 접두를 요구하며 던지고 스타일도 어긋납니다.
18
+ 호환 shim 은 두지 않습니다 — 하한을 올리거나, 하한 아래가 꼭 필요하면 알려 주세요.
19
+
13
20
  ## Quick Start
14
21
 
15
22
  아래 파일 하나가 그대로 돌아가는 첫 페이지입니다(Vite 기준 — `index.html` 이 `src/main.ts` 를 모듈로 싣는다).
@@ -259,6 +266,17 @@ Locale.set('ko'); // 활성 로케일
259
266
  Locale.register('nl', { valueMissing: '…' }); // 검증 메시지 override
260
267
  ```
261
268
 
269
+ ### 오른쪽에서 왼쪽 (RTL)
270
+
271
+ 컴포넌트의 배치는 **문서 방향을 따릅니다.** 게시 스타일은 논리 속성(`margin-inline-start` · `padding-inline-end` · `border-inline-start` · `text-align: start`)으로 서 있어,
272
+ `dir="rtl"` 에서 접두 · 접미 위치와 안쪽 여백이 좌우로 뒤집히고 LTR 렌더는 그대로입니다. 방향이 **의미**인 것 — 서랍의 `placement="left"` · 탭 줄의 `placement` ·
273
+ 기기 안전 영역(`env(safe-area-inset-*)`) — 은 물리 방향 그대로입니다. **물리 방향 그대로인 것**: 배지를 모서리에 얹는 자리(`u-badge anchor`) · 스켈레톤의 빛이 지나가는 방향은
274
+ 물리 방향 그대로입니다. 가로 가상 스크롤 격자 `flex-table` 과 스프레드시트 `u-simple-sheet`(`@iyulab/data-components`)는 RTL 에서 거울입니다(열은 시작부터 · 고정 열 · 방향키 · 열 너비 끌기가 화면을 따른다). 타임라인(`dimension-timeline`)은 크롬(차원 선택 열 · 모서리 머리)이 읽는 방향을 따르고 **시간은 어느 방향의 페이지에서도 왼쪽에서 오른쪽으로 흐릅니다**(시간축 · 캔버스 · 스크롤바 · 줌 단추는 한 플롯 영역).
275
+ `u-switch` 손잡이와 `u-progress-bar` 의 불확정 막대는 논리 위치로 거울이고, `u-carousel` 의 트랙과 끌기 · `u-split-panel` 의 끌기는 포인터를 따르며, 탭 · 라디오 · 트리 · 메뉴 · 달력의 가로 방향키는 화면을 따르고(RTL 에서 왼쪽 키가 다음), `u-slider` · `u-rating` 은 값이 시작 쪽에서 자라며 포인터와 방향키도 그를 따릅니다
276
+ (RTL 에서 왼쪽 키가 값을 올립니다 — 네이티브 `range` 와 같습니다).
277
+ 컴포넌트가 스스로 그리는 방향 글리프(셰브론)도 «이전» 과 «펼침» 이 읽는 방향을 가리키도록 뒤집힙니다 — `u-breadcrumb` 구분자 · `u-pagination` 과 `u-calendar` 의
278
+ 이전/다음 · `u-expander` 와 `u-tree-item` 의 닫힘 표시 · `u-menu-item` 의 하위 메뉴 표시. 구분자(`separator`)나 펼침 아이콘(`expand-icon`) 슬롯으로 직접 넣은 글리프는 그린 그대로 둡니다.
279
+
262
280
  ### 네임스페이스 — 상위 패키지·앱의 문자열 (1.23.0~)
263
281
 
264
282
  검증 메시지 키셋은 **닫혀 있습니다**(9키). 그 위에 자기 문자열을 담으려면 네임스페이스를
@@ -1,6 +1,18 @@
1
1
  import { LitElement, CSSResultGroup, RenderOptions } from 'lit';
2
2
  export declare class UElement extends LitElement {
3
3
  static styles: CSSResultGroup;
4
+ /**
5
+ * 호스트에 단 속성(대개 `aria-*`)을 **안쪽 요소로 옮겨 그리는** 컴포넌트가 «이 속성이 바뀌면 다시 그린다» 를 선언하는 자리.
6
+ *
7
+ * 호스트의 `aria-label` 은 섀도 경계를 넘지 않아, 안쪽의 `<a>`·`<button>`·`<input>` 에 `render()` 가 옮겨 줘야 접근성 이름이
8
+ * 생긴다. 그런데 Lit 은 선언된 프로퍼티의 속성만 관찰하므로 이 속성들은 `observedAttributes` 에 없고, 없는 속성은 연결 뒤에
9
+ * 바뀌어도 `attributeChangedCallback` 이 불리지 않는다 — 처음 그릴 때만 맞는 «조용한 결함» 이다(`u-button` · 폼 컨트롤 ·
10
+ * `u-card` 가 같은 모양으로 각자 고쳤다). 한 번 여기 선언하면 관찰과 다시 그리기가 함께 온다.
11
+ * 하위 클래스가 더하려면 부모 것을 펼쳐 적는다(`[...super.forwardedAttributes, 'x']`).
12
+ */
13
+ static forwardedAttributes: readonly string[];
14
+ static get observedAttributes(): string[];
15
+ attributeChangedCallback(name: string, old: string | null, value: string | null): void;
4
16
  /** 연결된 동안의 로케일 구독 해제 함수 · 떨어질 때 본 로케일 판(다시 붙을 때 그 사이 바뀌었는가를 묻는다). */
5
17
  private unsubscribeLocale?;
6
18
  private detachedLocaleRevision?;
@@ -21,6 +33,12 @@ export declare class UElement extends LitElement {
21
33
  * 종전에는 런타임에 언어를 바꿔도 이미 그려진 문장이 다음 재렌더까지 옛 언어로 남았다.
22
34
  */
23
35
  protected localeChanged(): void;
36
+ /**
37
+ * 이 요소의 읽는 방향이 오른쪽→왼쪽인가. 화면 좌표(포인터 · 좌우 화살표 키)를 «시작/끝» 으로 바꿔야 하는 컴포넌트가 읽는다 —
38
+ * 레이아웃은 CSS 논리 속성이 따라가지만 스크립트가 읽는 좌표와 키는 스스로 방향을 알아야 한다. 매번 계산값을 읽으므로(`dir` 이
39
+ * 바뀌어도 맞다) 렌더 경로가 아니라 이벤트 처리에서 부른다.
40
+ */
41
+ protected get isRtl(): boolean;
24
42
  /**
25
43
  * 커스텀 이벤트를 생성하여 발행합니다.
26
44
  * 기본적으로 bubbles, composed, cancelable이 활성화됩니다.
@@ -34,6 +34,16 @@ var UElement = class extends LitElement {
34
34
  static {
35
35
  this.styles = styles;
36
36
  }
37
+ static {
38
+ this.forwardedAttributes = [];
39
+ }
40
+ static get observedAttributes() {
41
+ return [...super.observedAttributes, ...this.forwardedAttributes];
42
+ }
43
+ attributeChangedCallback(name, old, value) {
44
+ super.attributeChangedCallback(name, old, value);
45
+ if (this.constructor.forwardedAttributes.includes(name)) this.requestUpdate();
46
+ }
37
47
  connectedCallback() {
38
48
  super.connectedCallback();
39
49
  if (process.env.NODE_ENV !== "production") warnIfTokensMissing();
@@ -72,6 +82,14 @@ var UElement = class extends LitElement {
72
82
  this.requestUpdate();
73
83
  }
74
84
  /**
85
+ * 이 요소의 읽는 방향이 오른쪽→왼쪽인가. 화면 좌표(포인터 · 좌우 화살표 키)를 «시작/끝» 으로 바꿔야 하는 컴포넌트가 읽는다 —
86
+ * 레이아웃은 CSS 논리 속성이 따라가지만 스크립트가 읽는 좌표와 키는 스스로 방향을 알아야 한다. 매번 계산값을 읽으므로(`dir` 이
87
+ * 바뀌어도 맞다) 렌더 경로가 아니라 이벤트 처리에서 부른다.
88
+ */
89
+ get isRtl() {
90
+ return getComputedStyle(this).direction === "rtl";
91
+ }
92
+ /**
75
93
  * 커스텀 이벤트를 생성하여 발행합니다.
76
94
  * 기본적으로 bubbles, composed, cancelable이 활성화됩니다.
77
95
  *
@@ -12,6 +12,7 @@ var styles = css`
12
12
  :host {
13
13
  position: absolute;
14
14
  z-index: var(--u-layer-floating, 1000);
15
+
15
16
  top: 0;
16
17
  left: 0;
17
18
  width: max-content;
@@ -125,8 +125,7 @@ export declare abstract class UFormControlElement<T> extends UElement {
125
125
  * 없는 속성은 `attributeChangedCallback` 자체가 호출되지 않아(커스텀 엘리먼트 표준 동작)
126
126
  * 초기 렌더만 되고 연결 후 변경이 반영되지 않는다. 명시적으로 추가해야 한다.
127
127
  */
128
- static get observedAttributes(): string[];
129
- attributeChangedCallback(name: string, old: string | null, value: string | null): void;
128
+ static forwardedAttributes: readonly string[];
130
129
  /**
131
130
  * 내부 네이티브 컨트롤에 실을 접근성 이름. 자기 `label` 이 우선이고, 없으면 호스트의
132
131
  * `aria-label` 을 쓴다 — 후자는 `u-field` 같은 «바깥 라벨 소유자» 가 채우는 경로다.
@@ -117,30 +117,8 @@ var UFormControlElement = class extends UElement {
117
117
  if (this.hasUpdated) this.setValidity();
118
118
  super.localeChanged();
119
119
  }
120
- /**
121
- * 호스트에 세팅된 `aria-label`/`aria-description` 은 접근성 트리에 노출되는 노드가 아니다 —
122
- * 그것은 shadow DOM 안쪽의 네이티브 컨트롤이고, 섀도우 경계를 넘지 않으므로 자동으로
123
- * 반영되지 않는다(속성은 붙어 있는데 접근 가능한 이름이 빈 채로 남는다).
124
- *
125
- * ⚠**이 처방은 오랫동안 `u-button` 한 곳에만 있었다.** 폼 컨트롤 열 종이 같은 구조인데
126
- * 같은 경로가 없어서, 바깥에서 라벨을 소유하는 래퍼(`u-field`)가 슬롯된 컨트롤에 이름을
127
- * 줄 수단 자체가 없었다 — 라벨은 그려지는데 컨트롤은 이름이 없는 «조용한 결함» 이다.
128
- * ⇒ 사본을 열 벌 만드는 대신 **공통 기반에 한 번** 둔다.
129
- *
130
- * ⚠`aria-label` 은 Lit 리액티브 프로퍼티가 아니라 `observedAttributes` 에 없다 — 그 목록에
131
- * 없는 속성은 `attributeChangedCallback` 자체가 호출되지 않아(커스텀 엘리먼트 표준 동작)
132
- * 초기 렌더만 되고 연결 후 변경이 반영되지 않는다. 명시적으로 추가해야 한다.
133
- */
134
- static get observedAttributes() {
135
- return [
136
- ...super.observedAttributes,
137
- "aria-label",
138
- "aria-description"
139
- ];
140
- }
141
- attributeChangedCallback(name, old, value) {
142
- super.attributeChangedCallback(name, old, value);
143
- if (name === "aria-label" || name === "aria-description") this.requestUpdate();
120
+ static {
121
+ this.forwardedAttributes = ["aria-label", "aria-description"];
144
122
  }
145
123
  /**
146
124
  * 내부 네이티브 컨트롤에 실을 접근성 이름. 자기 `label` 이 우선이고, 없으면 호스트의
@@ -51,10 +51,10 @@ export declare class UAlert extends UElement {
51
51
  /** 자동 닫힘 타이머 (밀리초 단위, 0이하면 비활성화) */
52
52
  duration: number;
53
53
  /**
54
- * 페이지 흐름 안의 알림 — 그 자리의 폭을 채우고, 그림자와 확대 전환이 없고, 닫히면 자리를 비운다.
55
- * 기본(속성 없음)은 떠 있는 알림(토스트)의 모양이다.
54
+ * 떠 있는 알림(토스트)의 모양 — 내용 폭, 큰 그림자, 확대 전환이고 닫혀도 자리를 지킨다. `Toast` 가 붙인다.
55
+ * 기본(속성 없음)은 페이지 흐름 안의 알림이다: 그 자리의 폭을 채우고, 그림자와 확대 전환이 없고, 닫히면 자리를 비운다.
56
56
  */
57
- inline: boolean;
57
+ floating: boolean;
58
58
  /** 역할·`aria-atomic` — 작성자가 단 값(정적 메모의 `role="note"` 등)은 덮지 않는다. */
59
59
  private readonly aria;
60
60
  /** 자동 닫힘 타이머 ID */
@@ -40,7 +40,7 @@ var UAlert = class UAlert extends UElement {
40
40
  this.appearance = "soft";
41
41
  this.title = "";
42
42
  this.duration = 0;
43
- this.inline = false;
43
+ this.floating = false;
44
44
  this.aria = new HostAria(this);
45
45
  }
46
46
  static {
@@ -200,6 +200,6 @@ __decorate([property({ type: Number }), __decorateMetadata("design:type", Number
200
200
  __decorate([property({
201
201
  type: Boolean,
202
202
  reflect: true
203
- }), __decorateMetadata("design:type", Boolean)], UAlert.prototype, "inline", void 0);
203
+ }), __decorateMetadata("design:type", Boolean)], UAlert.prototype, "floating", void 0);
204
204
  UAlert = __decorate([customElement("u-alert")], UAlert);
205
205
  export { ALERT_STATUSES, UAlert };
@@ -40,15 +40,27 @@ var styles = css`
40
40
  --alert-background-color: var(--u-neutral-200, #EEEEEE);
41
41
  }
42
42
 
43
+
43
44
  :host {
44
45
  display: block;
46
+ max-height: none;
47
+ border-radius: var(--u-radius-xl, 8px);
48
+ }
49
+ :host(:not([open])) {
50
+ display: none;
51
+ }
52
+ :host .content {
53
+ overflow-y: visible;
54
+ }
55
+
56
+
57
+ :host([floating]) {
45
58
  width: fit-content;
46
59
  min-width: 200px;
47
60
  max-width: 100%;
48
61
  max-height: 50vh;
49
- border-radius: var(--u-radius-xl, 8px);
50
62
  box-shadow: var(--u-shadow-lg, 0 4px 12px rgba(0, 0, 0, 0.16), 0 2px 4px rgba(0, 0, 0, 0.06));
51
-
63
+
52
64
  opacity: 0;
53
65
  transform: scale(0.8);
54
66
  visibility: hidden;
@@ -58,28 +70,18 @@ var styles = css`
58
70
  opacity var(--u-duration-normal, 220ms) var(--u-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
59
71
  transform var(--u-duration-normal, 220ms) ease-out;
60
72
  }
61
- :host([open]) {
73
+ :host([floating]:not([open])) {
74
+ display: block;
75
+ }
76
+ :host([floating][open]) {
62
77
  opacity: 1;
63
78
  transform: scale(1);
64
79
  visibility: visible;
65
80
  pointer-events: auto;
66
81
  transition-delay: 0s;
67
82
  }
68
-
69
-
70
- :host([inline]) {
71
- width: auto;
72
- min-width: 0;
73
- max-height: none;
74
- box-shadow: none;
75
- transform: none;
76
- transition: none;
77
- }
78
- :host([inline]:not([open])) {
79
- display: none;
80
- }
81
- :host([inline]) .content {
82
- overflow-y: visible;
83
+ :host([floating]) .content {
84
+ overflow-y: auto;
83
85
  }
84
86
 
85
87
 
@@ -123,6 +123,7 @@ var styles = css`
123
123
  position: absolute;
124
124
  z-index: 1;
125
125
  }
126
+
126
127
  :host([anchor="top-right"]) {
127
128
  top: 0;
128
129
  right: 0;
@@ -147,7 +148,7 @@ var styles = css`
147
148
 
148
149
  .icon {
149
150
  flex-shrink: 0;
150
- margin-right: 0.25em;
151
+ margin-inline-end: 0.25em;
151
152
  }
152
153
 
153
154
 
@@ -161,10 +162,10 @@ var styles = css`
161
162
  display: none;
162
163
  }
163
164
  .affix-prefix {
164
- margin-right: 0.25em;
165
+ margin-inline-end: 0.25em;
165
166
  }
166
167
  .affix-suffix {
167
- margin-left: 0.25em;
168
+ margin-inline-start: 0.25em;
168
169
  }
169
170
  `;
170
171
  export { styles };
@@ -54,6 +54,7 @@ var UBreadcrumb = class UBreadcrumb extends UElement {
54
54
  const icon = document.createElement("u-icon");
55
55
  icon.setAttribute("lib", "internal");
56
56
  icon.setAttribute("name", "chevron-right");
57
+ icon.setAttribute("class", "separator-icon");
57
58
  sep.appendChild(icon);
58
59
  }
59
60
  return sep;
@@ -32,5 +32,11 @@ var styles = css`
32
32
  font-size: 0.75em;
33
33
  user-select: none;
34
34
  }
35
+
36
+
37
+
38
+ :host(:dir(rtl)) .separator-icon {
39
+ transform: scaleX(-1);
40
+ }
35
41
  `;
36
42
  export { styles };
@@ -24,6 +24,8 @@ export declare class UBreadcrumbItem extends UElement {
24
24
  target?: string;
25
25
  /** 링크 rel 속성 */
26
26
  rel?: string;
27
+ /** 링크의 이름은 기본으로 글이다 — 달리 하려면 호스트의 `aria-label` 이 안쪽 `<a>` 에 실린다(`u-button`·`u-card` 와 같은 규약). */
28
+ static forwardedAttributes: readonly string[];
27
29
  render(): import('lit-html').TemplateResult<1>;
28
30
  private handleAnchorClick;
29
31
  }
@@ -29,10 +29,16 @@ var UBreadcrumbItem = class UBreadcrumbItem extends UElement {
29
29
  delegatesFocus: true
30
30
  };
31
31
  }
32
+ static {
33
+ this.forwardedAttributes = ["aria-label"];
34
+ }
32
35
  render() {
33
- if (this.href) return html`
36
+ if (this.href) {
37
+ const ariaLabel = this.getAttribute("aria-label") ?? void 0;
38
+ return html`
34
39
  <a part="link"
35
40
  href=${this.href}
41
+ aria-label=${ifDefined(ariaLabel)}
36
42
  aria-disabled=${ifDefined(this.disabled ? "true" : void 0)}
37
43
  target=${ifDefined(this.target)}
38
44
  rel=${ifDefined(this.rel)}
@@ -42,6 +48,7 @@ var UBreadcrumbItem = class UBreadcrumbItem extends UElement {
42
48
  <slot></slot>
43
49
  <span class="affix affix-suffix" ?hidden=${!this.affixes.has("suffix")}><slot name="suffix"></slot></span>
44
50
  </a>`;
51
+ }
45
52
  return html`
46
53
  <span class="affix affix-prefix" ?hidden=${!this.affixes.has("prefix")}><slot name="prefix"></slot></span>
47
54
  <slot></slot>
@@ -44,10 +44,10 @@ var styles = css`
44
44
  display: none;
45
45
  }
46
46
  .affix-prefix {
47
- margin-right: 0.2em;
47
+ margin-inline-end: 0.2em;
48
48
  }
49
49
  .affix-suffix {
50
- margin-left: 0.2em;
50
+ margin-inline-start: 0.2em;
51
51
  }
52
52
  `;
53
53
  export { styles };
@@ -136,7 +136,7 @@ export declare class UButton extends UElement {
136
136
  * (커스텀 엘리먼트 표준 동작). 초기 렌더는 되지만 연결 후 동적 변경은 반영되지
137
137
  * 않았다 — 목록에 명시적으로 추가해야 한다.
138
138
  */
139
- static get observedAttributes(): string[];
139
+ static forwardedAttributes: readonly string[];
140
140
  attributeChangedCallback(name: string, old: string | null, value: string | null): void;
141
141
  protected updated(changed: PropertyValues): void;
142
142
  /**
@@ -91,26 +91,12 @@ var UButton = class UButton extends UElement {
91
91
  super.click();
92
92
  this.submitOrReset();
93
93
  }
94
- /**
95
- * 호스트에 세팅된 `aria-label`은 실제 접근 가능한(포커스 대상) 엘리먼트가 아니라 —
96
- * 그 안쪽 shadow DOM 의 네이티브 `<a>`/`<button>`이다. 섀도우 경계를 넘지 않으므로
97
- * 접근성 트리에 자동 반영되지 않는다(실측 — 속성은 붙어 있는데
98
- * 접근성 이름이 비어 있음). `render()`가 이 값을 읽어 내부 엘리먼트에 직접 옮긴다.
99
- *
100
- * `aria-label`은 Lit 리액티브 프로퍼티로 선언돼 있지 않아 `observedAttributes`에
101
- * 없다 — 그 목록에 없는 속성은 `attributeChangedCallback` 자체가 호출되지 않는다
102
- * (커스텀 엘리먼트 표준 동작). 초기 렌더는 되지만 연결 후 동적 변경은 반영되지
103
- * 않았다 — 목록에 명시적으로 추가해야 한다.
104
- */
105
- static get observedAttributes() {
106
- return [...super.observedAttributes, ...FORWARDED_ARIA];
94
+ static {
95
+ this.forwardedAttributes = FORWARDED_ARIA;
107
96
  }
108
97
  attributeChangedCallback(name, old, value) {
109
98
  super.attributeChangedCallback(name, old, value);
110
- if (FORWARDED_ARIA.includes(name)) {
111
- this.syncHostRole();
112
- this.requestUpdate();
113
- }
99
+ if (FORWARDED_ARIA.includes(name)) this.syncHostRole();
114
100
  }
115
101
  updated(changed) {
116
102
  super.updated(changed);
@@ -375,23 +375,22 @@ var styles = css`
375
375
  display: none;
376
376
  }
377
377
  .affix-prefix {
378
- margin-right: 0.5em;
378
+ margin-inline-end: 0.5em;
379
379
  }
380
380
  .affix-suffix {
381
- margin-left: 0.5em;
381
+ margin-inline-start: 0.5em;
382
382
  }
383
383
 
384
384
  .content {
385
385
 
386
+
386
387
  flex: 1 1 auto;
387
- min-width: 0;
388
388
  line-height: 1.5;
389
389
  display: inline-flex;
390
390
  align-items: center;
391
391
  justify-content: center;
392
- overflow: hidden;
393
- text-overflow: ellipsis;
394
- white-space: nowrap;
392
+ text-align: center;
393
+ overflow-wrap: break-word;
395
394
  }
396
395
 
397
396
 
@@ -399,8 +398,7 @@ var styles = css`
399
398
  position: absolute;
400
399
  z-index: 100;
401
400
  top: 0;
402
- left: 0;
403
- right: 0;
401
+ inset-inline: 0;
404
402
  bottom: 0;
405
403
 
406
404
  display: flex;
@@ -49,9 +49,10 @@ var UCalendar = class UCalendar extends UElement {
49
49
  this.handlePrevMonth = () => this.navigateMonth(-1);
50
50
  this.handleNextMonth = () => this.navigateMonth(1);
51
51
  this.handleDayKeydown = (e, date) => {
52
+ const forward = this.isRtl ? -1 : 1;
52
53
  const deltas = {
53
- ArrowRight: 1,
54
- ArrowLeft: -1,
54
+ ArrowRight: forward,
55
+ ArrowLeft: -forward,
55
56
  ArrowDown: 7,
56
57
  ArrowUp: -7,
57
58
  Home: -date.getDay(),
@@ -29,6 +29,10 @@ var styles = css`
29
29
  padding: 0 4px 8px;
30
30
  }
31
31
 
32
+ :host(:dir(rtl)) .calendar-header u-icon-button::part(icon) {
33
+ transform: scaleX(-1);
34
+ }
35
+
32
36
 
33
37
  .nav-spacer {
34
38
  width: 2em;
@@ -17,7 +17,7 @@ var styles = css`
17
17
 
18
18
  --_target-pad: max(0.25em, calc(12px - 0.5em), calc(var(--u-target-size, 0px) / 2 - 0.5em));
19
19
 
20
- padding-right: max(var(--u-field-padding-inline, 0.6em), var(--_target-pad));
20
+ padding-inline-end: max(var(--u-field-padding-inline, 0.6em), var(--_target-pad));
21
21
 
22
22
 
23
23
 
@@ -49,19 +49,6 @@ var styles = css`
49
49
  box-shadow: 0 0 0 1px var(--u-input-border-color-invalid, #C62828);
50
50
  }
51
51
 
52
- .text-content {
53
- flex: 1 0 auto;
54
- min-width: 0;
55
- font-size: 1em;
56
- line-height: 1.5;
57
- overflow: hidden;
58
- text-overflow: ellipsis;
59
- white-space: nowrap;
60
- }
61
- .text-content.placeholder {
62
- color: var(--u-txt-color-weak, #616161);
63
- }
64
-
65
52
 
66
53
 
67
54
  .text-input {
@@ -96,8 +83,8 @@ var styles = css`
96
83
 
97
84
  .suffix-item[role="button"] {
98
85
  box-sizing: content-box;
99
- margin: calc(-1 * var(--_target-pad)) calc(-1 * var(--_target-pad)) calc(-1 * var(--_target-pad))
100
- max(0.4em, var(--_target-pad));
86
+ margin-block: calc(-1 * var(--_target-pad));
87
+ margin-inline: max(0.4em, var(--_target-pad)) calc(-1 * var(--_target-pad));
101
88
  padding: var(--_target-pad);
102
89
  }
103
90